Skip to content

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 keyRoleOwnerImplementationsDirect consumersCompanion pluginsNote
ctx.attachmentsseamattachmentattachment-localhost-runtime, llm-pi-ai-The host commits accepted images before session events; provider adapters resolve authorized durable references into provider-native content.
ctx.llmseamllmllm-deepseek, llm-pi-ai, llm-replayagent-loop, compaction-basic-Adapters register provider implementations; the loop and compaction call the provider-neutral stream service.
ctx.tokenMetercoretoken-meter-compaction-basic-Owns isolated per-session replay folds; pressure consumers share immutable revisioned measurements.
ctx.toolResultPrunercorecompaction-tool-result-pruner-compaction-basic-Rewrites oversized current tool results through replayable single-node surface replacements before summary compaction.
ctx.sessionscoresession-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.invariantscoreinvariants-session, agent, scope, agent-loop-Companion subpaths register owner-local checks; the service owns selection, uniqueness, child fibers, and package-attributed failures.
ctx.typertcoretypert-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.typertGatewaycoreapi-gateway---Associates generated Remote descriptors with live Cordis services, resolves registered identities, and exposes unary calls through the shared Connection RPC carrier.
ctx.sessionPersistenceseamsession-persistencesession-persistence-jsonl, session-persistence-sqliteagent-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.settingsseamsettingssettings-filellm-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.credentialsseamcredentialscredentials-localllm-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.sessionTelemetryseamsession-telemetrysession-telemetry-otel--The seam captures, redacts, and hands session records to one backend; nothing else consumes the service — its output leaves the process.
ctx.storageseamstoragestorage-json, storage-sqlitestorage-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.storageDomaincorestorage-domain-workspace, message-feedback-Waits for every configured backend, then publishes the domain form as one lifecycle-bound service for typed durable state.
ctx.messageFeedbackcoremessage-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.workspaceRegistrycoreworkspace-apiproxy-Owns WorkspaceId-branded records over the domain facility; stable sessionIds accounts drive Host RPC and GUI projections.
ctx.sessionQueryseamsession-querysession-query-sqlitesession-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.sessionReferenceResolvercoresession-reference---Projects bounded current-surface conversation snapshots into durable untrusted message context; host adapters own mention syntax.
ctx.sessionTitleseamsession-titlesession-title-first-prompt-llm, session-title-all-prompts-llm--Owns the deterministic fallback, latest-title fold, and sole optional asynchronous provider registration.
ctx.systemPromptcoresystem-prompt-agent-loop, tools, tool-fs, tool-terminal, tool-web-Collects prompt sections and model-facing tool schemas for each step.
ctx.toolscoretools-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.userQuestionsseamuser-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.planModecoreplan-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.agentPresetscoreagent-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.commandscorecommands---Plugins register direct human commands without sending invocations to the model.
ctx.sessionProjectionscoresession-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.sessionProjectionCachecoresession-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.skillsseamskillskill-badge, skill-filesystemtool-skill-Merges provider skill catalogs; tool-skill renders the session-prefix catalog and loads complete skill bodies.
ctx.agentscoreagent-agent-loop, acp, subagent-inprocess-Owns live Agent handles, the create/resume factory seam, and process-local initiator propagation.
ctx.agentDefaultModelcoreagent-default-model-headless, host-apiproxy-Layers the default ModelSelection through settings so direct and Host-backed Agent entry points share one state owner.
ctx.agentLoopbundleagent-loop-agent-spine-demo-The one concrete loop plugin; extension packages depend on dsh-agent events and services, not on this package.
ctx.goalscoregoal---Folds revisioned objective state from the session log and keeps live continuation activation process-local.
ctx.e2bcoree2b-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.subprocessseamsubprocesssubprocess-local, subprocess-e2bbash-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.shellseamshellbash-local, bash-sandbox, pwsh-localtool-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.shellEnvcoreshell-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.terminalsseamterminalterminal-bashtool-terminal-The registry owns exact-Agent session identity and cleanup; backends own terminal mechanics, while tool-terminal exposes the owner-scoped model tools.
ctx.sandboxseamsandboxsandbox-localbash-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.sandboxPolicycoresandbox-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.approvalseamapprovalacptools, 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.permissionPresetscorepermission-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.codeRuntimeseamcode-runtimecode-runtime-workertools-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.fsseamfsfs-local, fs-sandbox, fs-e2btool-fsfs-observation-policytool-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.compactionseamcompactioncompaction-basiccompaction-basic-The basic backend consumes post-step pressure and request-error recovery events; there is no model-facing compact tool.
ctx.subagentsseamsubagentsubagent-spawn-in-process, subagent-fork-in-process, subagent-acp, subagent-codex, subagent-claude-code, subagent-dsh-sdktool-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.jobsseamjobsjobs-localtool-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.webseamwebweb-search-exa, web-search-perplexity, web-search-deepseek, web-fetch-httptool-web-Search and fetch providers register into one ctx.web seam; tool-web owns the stable model-facing names.
ctx.spillStoreseamspillspill-localspill-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.directoryPickerseamdirectory-pickerdirectory-picker-native, directory-picker-browseapiproxy-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.webServercorewebserver-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.clientModulescoremodules-hmr-Composes the DSH_BOOT entry graph from an incremental dsh.client scan, serves plugin bundles, and notifies rebuilt/graph-changed subscribers.
ctx.workflowEngineseamworkflowworkflow-worker-threadtool-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.lspseamlsplsp-localtool-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.apiProxycoreapiproxy-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.dynamicCordisRunnercorecordis-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.cordisInspectcorecordis-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.