feat(familiars): add access tier so build-tier familiars can use git/shell#12
Merged
Conversation
…shell Adds an `access` field to `CovenFamiliar` (`~/.coven/familiars.toml`) and wires Coven familiars into the existing agent-mode pipeline so the familiar's access tier (`full`/`read-only`/`search-only`) controls which tools the familiar can invoke when selected via `--agent <id>` or the `/agents` picker. Default is `read-only` — write/exec is opt-in per familiar. Changes: - `coven_shared::CovenFamiliar` gains `access: Option<String>` with a `resolved_access()` accessor that falls back to `DEFAULT_FAMILIAR_ACCESS` (`"read-only"`). - New `familiar_to_agent_definition()` and `default_agents_with_familiars()` helpers convert each familiar to an `AgentDefinition` and merge them with the built-in agents (built-ins win on collision). - CLI agent merge (headless `--agent` flow and interactive agent-mode switch) now uses `default_agents_with_familiars()` so familiars take part in tool filtering exactly like `build`/`plan`/`explore`. - `/agents` picker: selecting a familiar from the list (or its detail view) now activates it as the session's agent mode and closes the menu; user-defined agents continue to open the editor. Tests: new unit coverage in `coven_shared` for `resolved_access()`, `familiar_to_agent_definition()`, and the merged-agents helper; new unit tests in `agents_view` for `familiar_id_from_source` and the `confirm_selection` return paths (familiar vs user agent). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an
accessfield toCovenFamiliar(~/.coven/familiars.toml) and wires Coven familiars into the existing--agent/ agent-mode pipeline so each familiar's declared access tier (full/read-only/search-only) controls which tools they can invoke once activated.read-only— write/exec power is opt-in per familiar (access = "full").nova,cody,kittyin the canonical roster) are expected to opt into"full"so they cangit, edit files, and run shell.sage,astra,echo,charm) stay on the default"read-only"tier and only get read/search tools.What changed
crates/core/src/coven_shared.rsDEFAULT_FAMILIAR_ACCESS = "read-only"constant.CovenFamiliargainsaccess: Option<String>with aresolved_access()helper that falls back to the default.familiar_to_agent_definition()— converts a familiar toconfig::AgentDefinition, threadingaccessinto the field the existing tool-filter pipeline already consults.default_agents_with_familiars()— merges built-in agents (build/plan/explore) with familiars (built-ins win on id collision). Callers extend this withconfig.agentsafterwards so user definitions still win.crates/cli/src/main.rs--agentheadless flow, interactive agent-mode switch) now usedefault_agents_with_familiars(). Merge order: built-ins → familiars → settings.json agents.crates/tui/src/agents_view.rs+crates/tui/src/app.rsconfirm_selection()now returnsOption<(id, display)>when the user picks a Coven familiar from the picker (List or Detail route).agent_mode+agent_mode_changed = trueand closes the menu. User-defined agents continue to open the editor as before.docs/familiars.mdaccessfield, the recommended tier per role, and howaccessinteracts withsettings.jsonoverrides.~/.coven/familiars.toml(user-side, not in this repo)access = "full"added tonova,cody,kitty. Other familiars omitaccessand inherit theread-onlydefault.Test plan
cargo build --workspace --manifest-path src-rust/Cargo.toml— clean.coven_shared(5) — defaults, explicit tiers, agent-definition propagation, merge collision behaviour.agents_view(4) —familiar_id_from_sourceparsing +confirm_selectionreturn paths.codex_adapter::test_anthropic_to_openai_request_basic,keybindings::test_default_bindings_contains_ctrl_c,keybindings::test_resolver_simple_action,app::test_ctrl_a_shortcut_opens_model_picker, and 4 other TUI snapshot tests — are identical toorigin/mainand unrelated to this branch).main: no new errors introduced (49 pre-existing errors on both).~/.coven/familiars.tomlverified to parse via the new unit test fixtures.Notes for review
cargo fmt --checkdrift (~2687 diffs onmain). This PR adds no new fmt drift; all my changes are fmt-clean (verified by comparing the diff list tomain).()toOption<(String, String)>— only one external caller (app.rs'shandle_agents_menu_key), updated in this PR.🤖 Generated with Claude Code