Extends keisei CLI from single-client (v0.18) to multi-client exobrain:
new subcommands detach/mount/list-adapters, 3 new adapters (Cursor,
Continue, Zed), schema v2 for ~/.claude/keisei-attached.toml with
[[attachments]] array (v1 backward-compat via untagged serde).
New subcommands:
detach — iterate marker attachments, call adapter.detach() on each,
then delete marker. Real strip of mcpServers entry per adapter.
mount <brain> — auto-attach to ALL detected clients in one call.
list-adapters — tabular status (name / detected / config path).
New adapters (each <130 LOC mirrors claude_code.rs pattern):
adapters/cursor.rs — .cursor/mcp.json project-local, fallback
~/.cursor/mcp.json global.
adapters/continue_adapter.rs — ~/.continue/config.json with
experimental.modelContextProtocolServers key.
adapters/zed.rs — ~/.config/zed/settings.json (Linux) or
~/Library/Application Support/Zed/settings.json (macOS) with
context_servers key. Zed schema marked [UNVERIFIED] pending docs.
Schema v2 (~/.claude/keisei-attached.toml):
[[attachments]]
client_type = "claude-code"
config_path = "/Users/.../.claude/settings.json"
[[attachments]]
client_type = "cursor"
config_path = "/Users/.../proj/.cursor/mcp.json"
v1 marker migration: untagged serde accepts legacy client_type=string,
upgrades to single-entry attachments[] on next write.
Tests: 5 (v0.18) + 6 new = 11 integration tests, all pass:
- attach_then_status_happy_path
- attach_missing_manifest_errors
- attach_unsupported_schema_errors
- status_without_attach_is_clean
- attach_writes_marker_with_expected_fields
- mount_with_claude_code_only_detected (new)
- mount_with_no_client_detected (new)
- detach_round_trip (new)
- detach_preserves_other_mcp_servers (new)
- list_adapters_prints_expected_rows (new)
- schema_v1_to_v2_migration (new)
Known issues (defer to follow-up commit):
- CRITIC HIGH#1: rusqlite declared but unused
- CRITIC HIGH#3: BrainPaths fields required but only mcp_server used
- SECURITY H1/H2/H3: brain path/name not validated before writing
into client config — will be addressed before tagging v0.19.0
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| _rust | ||
| templates | ||
| design-scrape.sh | ||
| figma-tokens.sh | ||
| frontend-inspect.sh | ||
| harden-base.sh | ||
| kei-ci-lint.sh | ||
| kei-docs-scaffold.sh | ||
| kei-sleep-queue.sh | ||
| kei-sleep-setup.sh | ||
| kei-sleep-sync.sh | ||
| live-preview.sh | ||
| log-ship.sh | ||
| MANIFEST.toml | ||
| metrics-scrape.sh | ||
| provision-hetzner.sh | ||
| provision-vultr.sh | ||
| README.md | ||
| screenshot-decode.sh | ||
| tomd.sh | ||
_primitives — first-class building blocks
_primitives/ holds standalone utilities that agents, hooks, and skills
(including /compose-solution) depend on. Unlike _blocks/ (behavioral
markdown) or _manifests/ (agent TOML), primitives are executable shell
programs installed at $HOME/.claude/agents/_primitives/ by install.sh.
Current primitives
| Primitive | Purpose | Invocation |
|---|---|---|
tomd.sh |
Universal non-native-format → markdown converter (PDF, DOCX, XLSX, PPTX, CSV, images, code). | ~/.claude/agents/_primitives/tomd.sh <file> |
tomd.sh is ported from the KeiAgent project (user's personal CLI
predecessor) bin/keiagent-tomd — same format matrix, KeiSeiKit-style
error tags ([tomd]), configurable cache directory (KEISEI_TOMD_CACHE).
Hook integration
hooks/tomd-preread.sh is a PreToolUse(Read) hook that auto-redirects
Claude to the converted markdown when a Read targets .docx / .doc / .xlsx / .pptx / .csv. Cached under $KEISEI_TOMD_CACHE (default
/tmp/keisei-tomd-cache).
/compose-solution discovery
Phase 3 prior-art sweep greps _primitives/ alongside _blocks/,
_manifests/, skills/, _bridges/, hooks/. If a user task involves
file-format parsing, the meta-composer surfaces tomd automatically —
reuse over rewrite (RULE "No Patching").