Capability Seams And Core Services
A service can be a core spine service, a swappable capability seam, or a bundle/composition point. The graph shows the package that owns the service declaration, known implementation packages, and packages that consume the service directly.
| ctx key | Role | Owner | Implementations | Direct consumers | Companion plugins | Note |
|---|---|---|---|---|---|---|
ctx.attachments | seam | attachment | attachment-local | host-runtime, llm-pi-ai | - | The host commits accepted images before session events; provider adapters resolve authorized durable references into provider-native content. |
ctx.llm | seam | llm | llm-deepseek, llm-pi-ai, llm-replay | agent-loop, compaction-basic | - | Adapters register provider implementations; the loop and compaction call the provider-neutral stream service. |
ctx.tokenMeter | core | token-meter | - | compaction-basic | - | Owns isolated per-session replay folds; pressure consumers share immutable revisioned measurements. |
ctx.toolResultPruner | core | compaction-tool-result-pruner | - | compaction-basic | - | Rewrites oversized current tool results through replayable single-node surface replacements before summary compaction. |
ctx.sessions | core | session | - | agent-loop, agent, session-persistence, session-query, session-query-sqlite, subagent-inprocess, invariants, message-feedback | - | Owns append-only Session instances and emits the durable session event feed. |
ctx.invariants | core | invariants | - | session, agent, scope, agent-loop | - | Companion subpaths register owner-local checks; the service owns selection, uniqueness, child fibers, and package-attributed failures. |
ctx.typert | core | typert-registry | - | typert-loader, api-gateway | - | Plugins register live zod contributions directly or through dsh-typert-loader; the API gateway consumes invocation descriptors and providers, while other runtime consumers query schemas and reflection metadata at their own edges. |
ctx.typertGateway | core | api-gateway | - | - | - | Associates generated Remote descriptors with live Cordis services, resolves registered identities, and exposes unary calls through the shared Connection RPC carrier. |
ctx.sessionPersistence | seam | session-persistence | session-persistence-jsonl, session-persistence-sqlite | agent-loop, tool-bash, hooks-claude-code, hooks-codex, session-query, session-query-sqlite, message-feedback | - | Backends persist the same SessionEvent vocabulary; apps choose a backend at composition time. |
ctx.settings | seam | settings | settings-file | llm-deepseek, llm-pi-ai, apiproxy | - | Plugins register namespace schemas and resolve layered values; providers store the raw document. The LLM adapters register their entry config as the composition base under the user section; the web gateway serves redacted layered descriptors and writes the user layer. |
ctx.credentials | seam | credentials | credentials-local | llm-deepseek, llm-pi-ai, apiproxy | - | Configuration carries references to secrets; providers own the values. Consumers resolve per operation, so a rotated credential reaches the very next request; the web gateway exposes value-free views and write-only storage. |
ctx.sessionTelemetry | seam | session-telemetry | session-telemetry-otel | - | - | The seam captures, redacts, and hands session records to one backend; nothing else consumes the service — its output leaves the process. |
ctx.storage | seam | storage | storage-json, storage-sqlite | storage-domain | - | Backends register side by side under names; data forms (domain first) mount on the hub and translate typed operations into opaque KV-unit primitives. |
ctx.storageDomain | core | storage-domain | - | workspace, message-feedback | - | Waits for every configured backend, then publishes the domain form as one lifecycle-bound service for typed durable state. |
ctx.messageFeedback | core | message-feedback | - | - | - | Owns local per-assistant-message feedback, lifecycle and target validation, per-item compare-and-set, and the Host unary Remote contract without entering Session history or telemetry. |
ctx.workspaceRegistry | core | workspace | - | apiproxy | - | Owns WorkspaceId-branded records over the domain facility; stable sessionIds accounts drive Host RPC and GUI projections. |
ctx.sessionQuery | seam | session-query | session-query-sqlite | session-reference, tool-session-query | - | The interface supplies exact reads, filters, and traces; its concrete backend adds full-text reconciliation, ranking, snippets, and cursor generations, while the model consumer owns workspace authority and cursor-free rendering. |
ctx.sessionReferenceResolver | core | session-reference | - | - | - | Projects bounded current-surface conversation snapshots into durable untrusted message context; host adapters own mention syntax. |
ctx.sessionTitle | seam | session-title | session-title-first-prompt-llm, session-title-all-prompts-llm | - | - | Owns the deterministic fallback, latest-title fold, and sole optional asynchronous provider registration. |
ctx.systemPrompt | core | system-prompt | - | agent-loop, tools, tool-fs, tool-terminal, tool-web | - | Collects prompt sections and model-facing tool schemas for each step. |
ctx.tools | core | tools | - | agent-loop, tool-ask-user, tool-bash, tool-cordis, tool-fs, tool-terminal, tool-skill, tool-subagent, tool-todo, tool-web | - | Registers capabilities, owns Code Mode transport, and routes calls through pre-policy, monotonic guards, around dispatch, post-policy, and final-result observation. |
ctx.userQuestions | seam | user-questions | - | tool-ask-user | - | UI front ends provide the active human-answer provider; tool-ask-user pauses a tool call on the provider-neutral ask() promise. |
ctx.planMode | core | plan-mode | - | - | - | Folds logged plan/mode state, flushes user selections at turn boundaries, renders deployment-owned guidance, registers /plan, and keeps the plan-exit schema stable across transitions. |
ctx.agentPresets | core | agent-presets | - | - | - | Discovers preset directories over trusted and user-authored roots and mounts one preset cordis.yml under an agent scope during creation, rejecting a row that never activates or that publishes into the root service realm. |
ctx.commands | core | commands | - | - | - | Plugins register direct human commands without sending invocations to the model. |
ctx.sessionProjections | core | session-projection | - | tool-todo, session-title, host-apiproxy | - | Domains register state-driven fold units; the eager drive keeps per-session watermark states and api-proxy serves baselines and pushes changed values. |
ctx.sessionProjectionCache | core | session-projection-cache | - | host-apiproxy | - | Durably checkpoints projection unit states per session (throttled + turn/end/detach mandatory points) and serves the cold-read ladder: cache row + persistence tail replay, so listings never load full logs. |
ctx.skills | seam | skill | skill-badge, skill-filesystem | tool-skill | - | Merges provider skill catalogs; tool-skill renders the session-prefix catalog and loads complete skill bodies. |
ctx.agents | core | agent | - | agent-loop, acp, subagent-inprocess | - | Owns live Agent handles, the create/resume factory seam, and process-local initiator propagation. |
ctx.agentDefaultModel | core | agent-default-model | - | headless, host-apiproxy | - | Layers the default ModelSelection through settings so direct and Host-backed Agent entry points share one state owner. |
ctx.agentLoop | bundle | agent-loop | - | agent-spine-demo | - | The one concrete loop plugin; extension packages depend on dsh-agent events and services, not on this package. |
ctx.goals | core | goal | - | - | - | Folds revisioned objective state from the session log and keeps live continuation activation process-local. |
ctx.e2b | core | e2b | - | fs-e2b, subprocess-e2b | - | Owns one shared E2B SDK handle, remote working directory, and final sandbox disposition so both fundamental E2B providers inhabit the same Linux runtime. |
ctx.subprocess | seam | subprocess | subprocess-local, subprocess-e2b | bash-local, bash-sandbox, terminal-bash, lsp-stdio, subagent-acp, subagent-codex, subagent-claude-code | - | The bash executors, the PTY shell backend, the LSP host, and the out-of-process ACP, Codex, and Claude Code subagent backends spawn through ctx.subprocess; the service owns process coordinates, tree/session lifetime, stdio dispositions, terminal mechanics, and kill escalation. |
ctx.shell | seam | shell | bash-local, bash-sandbox, pwsh-local | tool-bash, tool-pwsh, hooks-claude-code, hooks-codex | - | The model-facing shell tools and hook bridges consume this seam; sandboxed, remote, or PowerShell executors replace bash-local without touching them. |
ctx.shellEnv | core | shell-env | - | tool-bash, tool-pwsh | - | Plugins declare effect-scoped DSH_* facts; each shell tool collects one trusted snapshot per execution and its executor rebuilds the namespace. |
ctx.terminals | seam | terminal | terminal-bash | tool-terminal | - | The registry owns exact-Agent session identity and cleanup; backends own terminal mechanics, while tool-terminal exposes the owner-scoped model tools. |
ctx.sandbox | seam | sandbox | sandbox-local | bash-sandbox, terminal-bash | - | Consumers hand over the exact argv they are about to spawn; same-world backends wrap it under a per-call policy and report enforcement. |
ctx.sandboxPolicy | core | sandbox-policy | - | bash-sandbox, fs-sandbox, terminal-bash | - | The one home for the deployment default mode + workspace root; only the sandboxed executor and provider read the service (the tool layers use the pure sandbox/mode fold it also exports). Both enforcing families read it so bash and fs cannot confine to different roots. |
ctx.approval | seam | approval | acp | tools, tool-bash | - | One-shot permission decisions dispatched over the approval/request waterfall; answerers are listeners (the ACP bridge for its own agents), absence fails closed to unavailable. |
ctx.permissionPresets | core | permission-presets | - | - | - | User-facing preset table (workspace-write/danger-full-access) bundling the sandbox-mode and approval-policy knobs; a switch writes one permission/preset event through to both knob events. |
ctx.codeRuntime | seam | code-runtime | code-runtime-worker | tools | - | Runs one model-written program against host-provided async bindings; backends differ by substrate and language (the tool registry consumes it for Code Mode). |
ctx.fs | seam | fs | fs-local, fs-sandbox, fs-e2b | tool-fs | fs-observation-policy | tool-fs executes read/write/edit through ctx.fs; fs-sandbox fences mutations by the shared sandbox mode; fs-observation-policy contributes observed-state checks through the fs/* event gate. |
ctx.compaction | seam | compaction | compaction-basic | compaction-basic | - | The basic backend consumes post-step pressure and request-error recovery events; there is no model-facing compact tool. |
ctx.subagents | seam | subagent | subagent-spawn-in-process, subagent-fork-in-process, subagent-acp, subagent-codex, subagent-claude-code, subagent-dsh-sdk | tool-subagent, tool-subagent-control, tool-ralph | - | Providers implement transports; the service also owns optional Activation-based continuation orchestration, tool-subagent selects one-shot or continuable delegation, tool-subagent-control delivers follow-ups, and tool-ralph requires one fresh structured-output route. |
ctx.jobs | seam | jobs | jobs-local | tool-bash, tool-terminal, tool-subagent, tool-jobs | - | Producers (background bash, PTY sends, and subagent delegations) register running work; tool-jobs is the model-facing controller that reads, lists, and kills it; jobs-local is the process-local registry. |
ctx.web | seam | web | web-search-exa, web-search-perplexity, web-search-deepseek, web-fetch-http | tool-web | - | Search and fetch providers register into one ctx.web seam; tool-web owns the stable model-facing names. |
ctx.spillStore | seam | spill | spill-local | spill-policy | - | The backend saves oversized tool text and returns a model-facing locator plus retrieval hint; spill-policy is the tools/post-execute consumer that decides when to spill. |
ctx.directoryPicker | seam | directory-picker | directory-picker-native, directory-picker-browse | apiproxy | - | Discriminated interaction capability: the native backend opens one OS chooser on the host display, the browse backend serves listing/creation primitives for the in-app browser; dual-face backends fill ui-workspace directory-flow slots from their browser halves (no wire advertisement). |
ctx.webServer | core | webserver | - | connection, modules, hmr | - | Plain node:http carrier: named-route registry, index transform taps, and the static dist fallback; web-transport plugins register their own routes. |
ctx.clientModules | core | modules | - | hmr | - | Composes the DSH_BOOT entry graph from an incremental dsh.client scan, serves plugin bundles, and notifies rebuilt/graph-changed subscribers. |
ctx.workflowEngine | seam | workflow | workflow-worker-thread | tool-workflow, tool-ralph | - | One engine per context, as in bash, with no named-provider registry; the general workflow and fixed Ralph consumers start runs whose agent() calls fan out through ctx.subagents. |
ctx.lsp | seam | lsp | lsp-local | tool-lsp | - | Provider registration and selection plus normalized query execution over exactly four operations; the seam offers no protocol escape hatch, so a backend translates into the normalized request and result. |
ctx.apiProxy | core | apiproxy | - | connection | - | The transport-agnostic host gateway face: it dispatches browser API calls, and each open host stream subscribes to the events it forwards rather than being pushed to through a broadcast verb. |
ctx.dynamicCordisRunner | core | cordis-host-runner | - | tool-cordis | - | Owns the in-memory definition registry, the vm sandbox for host halves, and the request-run round trip; browser pages reach the same service over the wire through its remote namespace. |
ctx.cordisInspect | core | cordis-host-runner | - | tool-cordis | - | Registers host inspect providers, mirrors the client provider manifest, and routes client queries through the dynamic Cordis transport. |
Maintenance mode: hybrid: services are discovered from Cordis declarations; interface/implementation/consumer roles are classified in scripts/gen-doc-graphs.ts with a completeness guard.