2026-07-03 01:13:52 +08:00
<!-- Generated by scripts/gen - doc - graphs.ts - do not edit by hand.
Run `pnpm run gen-doc-graphs` to regenerate. -->
# 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.
```mermaid
flowchart LR
pkg_llm["llm"]
svc_llm["ctx.llm< br / > LLM adapter registry"]
pkg_llm_deepseek["llm-deepseek"]
pkg_llm_pi_ai["llm-pi-ai"]
pkg_llm_replay["llm-replay"]
pkg_agent_loop["agent-loop"]
pkg_compact_basic["compact-basic"]
2026-07-15 14:47:29 +08:00
pkg_token_meter["token-meter"]
svc_tokenMeter["ctx.tokenMeter< br / > Replay token measurement"]
2026-07-16 18:51:26 +08:00
pkg_compact_tool_result_prune["compact-tool-result-prune"]
2026-07-16 18:02:15 +08:00
svc_toolResultPrune["ctx.toolResultPrune< br / > Model-free tool-result pruning"]
2026-07-03 01:13:52 +08:00
pkg_session["session"]
svc_sessions["ctx.sessions< br / > In-memory session store"]
pkg_agent["agent"]
2026-07-15 21:21:24 +08:00
pkg_cli_demo["cli-demo"]
2026-07-03 01:13:52 +08:00
pkg_session_persistence["session-persistence"]
2026-07-10 16:51:19 +08:00
pkg_session_query["session-query"]
2026-07-15 10:51:38 +08:00
pkg_session_query_sqlite["session-query-sqlite"]
2026-07-03 01:13:52 +08:00
pkg_subagent_inprocess["subagent-inprocess"]
pkg_invariants["invariants"]
2026-07-19 19:19:57 +08:00
svc_invariants["ctx.invariants< br / > Package-owned invariant registry"]
pkg_scope["scope"]
2026-07-28 23:48:35 +08:00
pkg_typert_registry["typert-registry"]
svc_typert["ctx.typert< br / > Runtime type registry"]
pkg_typert_loader["typert-loader"]
2026-07-03 01:13:52 +08:00
svc_sessionPersistence["ctx.sessionPersistence< br / > Durable session persistence seam"]
pkg_session_persistence_jsonl["session-persistence-jsonl"]
pkg_session_persistence_sqlite["session-persistence-sqlite"]
fix(bash): close managed environment review gaps
The managed DSH_* runtime path was correct, but its public extension and documentation contracts were incomplete. A contributor following the README could access ctx.bashEnv without declaring an injection, the new environment types had no drift-checked catalog entries, and the capability graph omitted three packages that now query sessionPersistence.
Declare the README injection, catalog DshEnvironmentKey and DshEnvironment, and add tool-bash plus both hook bridges to the generated persistence consumer graph. Keep BashEnvRegistry.list() contributor-only for now because no production caller treats it as exhaustive, but record the built-in enumeration gap before diagnostics, prompt, or UI code depends on it.
Validated on the exact resulting tree with typecheck, lint, coverage, snapshot, documentation, module-graph, build, hygiene, demo-smoke, and built-artifact checks.
2026-07-15 00:04:00 +08:00
pkg_tool_bash["tool-bash"]
pkg_hooks_claude["hooks-claude"]
pkg_hooks_codex["hooks-codex"]
feat(settings): add user-settings seam (ctx.settings) + file provider
Two-package capability family mirroring session-persistence/:
- dsh-settings: abstract Settings service — namespace registry with
caller-fiber effect registrations, layered resolution (schema defaults
< composition base < user document), schemastery validation,
per-namespace deep-equal commit detection, and the settings/updated
event. Boot/registration validation fails loud; provider publishes
keep last-good per namespace.
- dsh-settings-local: settings.yaml/.json provider — resolveSpec
defaulting to $DSH_HOME/settings.yaml, chokidar hot reload,
content-equality self-write suppression, atomic 0600 tmp+rename
writes, comment-preserving YAML namespace patching.
Consumers register inside ctx.inject(['settings'], …), so every
composition works unchanged without a mounted provider. Real Loader +
Include composition test proves cordis.yml boot and external-edit hot
propagation; HMR disposal test proves registry cleanup. Both packages
hold per-file 100% coverage.
Doc budgets rise 1705→1710 (AGENTS.md) and 835→845 (packages/README.md):
one structural line per file for the new package group.
Agent Note: .agents/notes/implemented/architecture/2026-07-28-user-settings-seam.md
2026-07-28 17:30:12 +08:00
pkg_settings["settings"]
svc_settings["ctx.settings< br / > User-settings seam"]
pkg_settings_local["settings-local"]
2026-07-30 10:53:39 +08:00
pkg_apiproxy["apiproxy"]
docs: bilingual credentials/settings-consumer documentation, catalogs, and gates
New credentials data-structure page (type-equiv manifested), group README,
rewritten llm-deepseek/llm-pi-ai READMEs (dynamic configuration, dict
profiles, credential chain), capability-seams/service-role registration,
Agent Note (bilingual), demo compositions mounting settings-local +
credentials-local with no inline key plumbing, installSettingsSection
consumer helper on the settings seam (deduplicating both adapters' wiring),
jscpd symmetry markers for the provider twins, runtime-closure additions for
python/sdk-runtime, and doc-budget ceilings AGENTS.md 1750→1755 /
packages/README.md 850→865 for the structural one-line group rows.
2026-07-29 14:20:06 +08:00
pkg_credentials["credentials"]
svc_credentials["ctx.credentials< br / > Credential seam"]
pkg_credentials_local["credentials-local"]
2026-07-23 03:06:57 +08:00
pkg_session_telemetry["session-telemetry"]
svc_telemetry["ctx.telemetry< br / > Session telemetry seam"]
pkg_session_telemetry_otel["session-telemetry-otel"]
chore(storage,workspace): gates — coverage, catalogs, bilingual note
- Per-file 100% coverage across the five new packages (invariant
companion suites, failure-injection negatives, lifecycle and
malformed-medium branches).
- Canonical README Model Experience / Known Limitations sections; new
storage/ and workspace/ group READMEs; packages/README.md rows (budget
ceiling raised 760 → 790 for the two new groups).
- Cordis catalog/type-link registrations, service-role classification,
and regenerated catalogs/graphs for the new services and events.
- Agent Note: English body + i18n pairing record; design-sketch fences
opted out of doc-typecheck as ignore-check.
- Two exactOptionalPropertyTypes/discriminant fixes in new tests.
doc-sync (24 gates), typecheck, hygiene, and the five-package suite
(92 tests) all pass.
2026-07-24 22:49:57 +08:00
pkg_storage["storage"]
svc_storage["ctx.storage< br / > Non-session storage hub"]
pkg_storage_json["storage-json"]
pkg_storage_sqlite["storage-sqlite"]
2026-07-25 01:11:39 +08:00
pkg_storage_domain["storage-domain"]
2026-07-25 16:04:48 +08:00
svc_storageDomain["ctx.storageDomain< br / > Domain data facility"]
chore(storage,workspace): gates — coverage, catalogs, bilingual note
- Per-file 100% coverage across the five new packages (invariant
companion suites, failure-injection negatives, lifecycle and
malformed-medium branches).
- Canonical README Model Experience / Known Limitations sections; new
storage/ and workspace/ group READMEs; packages/README.md rows (budget
ceiling raised 760 → 790 for the two new groups).
- Cordis catalog/type-link registrations, service-role classification,
and regenerated catalogs/graphs for the new services and events.
- Agent Note: English body + i18n pairing record; design-sketch fences
opted out of doc-typecheck as ignore-check.
- Two exactOptionalPropertyTypes/discriminant fixes in new tests.
doc-sync (24 gates), typecheck, hygiene, and the five-package suite
(92 tests) all pass.
2026-07-24 22:49:57 +08:00
pkg_workspace["workspace"]
svc_workspace["ctx.workspace< br / > Workspace entity registry"]
2026-07-23 20:16:14 +08:00
svc_sessionQuery["ctx.sessionQuery< br / > Session reads, traces, filters, and search"]
2026-07-21 16:46:48 +08:00
pkg_session_reference["session-reference"]
2026-07-24 15:09:55 +08:00
pkg_tool_session_query["tool-session-query"]
2026-07-27 15:25:33 +08:00
pkg_file_reference["file-reference"]
svc_fileReferences["ctx.fileReferences< br / > Workspace file-reference discovery"]
pkg_file_reference_local["file-reference-local"]
2026-07-21 16:46:48 +08:00
svc_sessionReferences["ctx.sessionReferences< br / > Cross-session snapshot preparation"]
2026-07-21 01:54:00 +08:00
pkg_session_title["session-title"]
svc_sessionTitle["ctx.sessionTitle< br / > Log-backed session titles"]
pkg_session_title_first_message_llm["session-title-first-message-llm"]
pkg_session_title_all_messages_llm["session-title-all-messages-llm"]
2026-07-03 01:13:52 +08:00
pkg_system_prompt["system-prompt"]
svc_systemPrompt["ctx.systemPrompt< br / > System prompt assembly registry"]
pkg_tools["tools"]
2026-07-04 12:50:06 +08:00
pkg_tool_fs["tool-fs"]
2026-07-21 16:01:00 +08:00
pkg_tool_pty["tool-pty"]
2026-07-04 12:50:06 +08:00
pkg_tool_web["tool-web"]
2026-07-11 22:55:40 +08:00
svc_tools["ctx.tools< br / > Tool registry and guarded execution pipeline"]
2026-07-05 17:05:33 +08:00
pkg_tool_ask_user["tool-ask-user"]
2026-07-08 11:50:12 +08:00
pkg_tool_cordis["tool-cordis"]
2026-07-05 16:50:29 +08:00
pkg_tool_skill["tool-skill"]
2026-07-03 01:13:52 +08:00
pkg_tool_subagent["tool-subagent"]
pkg_tool_todo["tool-todo"]
2026-07-05 17:05:33 +08:00
pkg_user_interaction["user-interaction"]
svc_userInteraction["ctx.userInteraction< br / > Human question/answer seam"]
2026-07-22 16:57:23 +08:00
pkg_plan_mode["plan-mode"]
svc_planMode["ctx.planMode< br / > Plan collaboration state"]
2026-07-19 22:11:59 +08:00
pkg_commands["commands"]
svc_commands["ctx.commands< br / > Human command registry"]
2026-07-28 01:09:55 +08:00
pkg_session_projection["session-projection"]
svc_sessionProjections["ctx.sessionProjections< br / > Session projection units"]
pkg_host_apiproxy["host-apiproxy"]
2026-07-28 02:11:31 +08:00
pkg_session_projection_cache["session-projection-cache"]
svc_sessionProjectionCache["ctx.sessionProjectionCache< br / > Persisted projection cache"]
2026-07-05 16:50:29 +08:00
pkg_skill["skill"]
2026-07-08 15:50:38 +08:00
svc_skills["ctx.skills< br / > Skill provider registry"]
pkg_skill_local["skill-local"]
2026-07-19 13:30:45 +08:00
svc_agents["ctx.agents< br / > Agent service"]
2026-07-24 01:40:25 +08:00
pkg_acp["acp"]
2026-07-03 01:13:52 +08:00
svc_agentLoop["ctx.agentLoop< br / > Concrete loop driver"]
2026-07-15 15:57:57 +08:00
pkg_agent_spine_demo["agent-spine-demo"]
2026-07-19 18:47:34 +08:00
pkg_goal["goal"]
svc_goals["ctx.goals< br / > Same-session goal domain"]
2026-07-26 14:10:46 +08:00
pkg_subprocess["subprocess"]
svc_subprocess["ctx.subprocess< br / > Subprocess seam"]
pkg_subprocess_local["subprocess-local"]
2026-07-03 01:13:52 +08:00
pkg_bash_local["bash-local"]
2026-07-09 16:05:44 +08:00
pkg_bash_sandbox["bash-sandbox"]
feat(subprocess): migrate lsp-local, subagent-acp, and the env scrubs onto the seam
Review direction (tianyicui, PR #660): in a stacked PR, change all other
process-running places to use the new service.
- lsp-local: LspConnection spawns through ctx.subprocess (piped protocol
streams + a no-spill collected stderr tail); its private process-tree
helpers (POSIX group signalling, Windows taskkill, liveness polling) are
deleted in favor of the seam's handle verbs, and its buildChildEnv now
rides scrubbedParentEnv (LSP children also stop inheriting stale DSH_*).
The plugin injects 'subprocess'; compositions/tests mount
dsh-subprocess-local.
- subagent-acp: the ACP child spawns through the seam (piped ndjson streams,
inherited stderr); spawn failure surfaces through done-rejection into the
same startup race; disposal is handle.dispose with the plugin's configured
graces. dsh-subagent-subprocess is DELETED — its dispose ladder and scrub
are the seam's, and the isolated-config-dir helper had no consumer.
- mcp-client, pty-local, sdk-helper: adopt scrubbedParentEnv as the one
scrub definition (their spawns stay put by ownership: the MCP SDK and
node-pty own those calls; the SDK wizard runs outside any composition).
- Coverage: per-file 100% over every touched src file, with each v8 ignore
carrying a platform or contract reason; new suites cover stdio
dispositions, the dispose ladder tiers, injected-win32 tree semantics,
waitForExit, settled-kill/terminate no-ops, and spawn-failure disposal.
- Docs: consumer-migration Agent Note (en; zh follows in this PR), seam note
updated in place, subprocess.md rewritten for the reshaped vocabulary
(type-equiv re-registered), READMEs and SERVICE_ROLES updated, taskkill
added to knip ignoreBinaries.
2026-07-26 15:27:59 +08:00
pkg_lsp_local["lsp-local"]
pkg_subagent_acp["subagent-acp"]
refactor(process): split the process manager out of the bash executor
New process/ capability family: @deepseek-ai/dsh-process owns ctx.processes —
abstract ProcessManager.spawn(spec) over a fully-explicit ProcessSpawnSpec —
plus the shared DSH_* managed-environment and CollectedOutput vocabulary;
@deepseek-ai/dsh-process-local carries the former bash-local run.ts plumbing
(detached groups, tail-keep spill-backed output, credential scrub, kill
escalation, kill-and-join disposal) with no config of its own.
dsh-bash-local becomes a consumer: it keeps command defaulting, the fused
deadline timedOut/aborted classification, the model-friendly terminal env
(now merged through the ordinary env channel), and the [stderr]-marked
background read merge, and spawns through ctx.processes. Background-process
lifetime moves to the manager, so an executor reload no longer kills live
background work; a background spawn failure is injected once into the read
path instead of being buffered as fake stderr. dsh-bash re-exports the moved
vocabulary so bash consumers keep one import root; dsh-bash-sandbox only
redeclares the inherited inject.
Every composition loading a bash executor now loads dsh-process-local (CLI,
examples, python bundled runtime, create-sdk bash feature, inline test
configs).
2026-07-26 06:59:01 +08:00
pkg_bash["bash"]
svc_bash["ctx.bash< br / > Bash executor seam"]
2026-08-02 21:46:53 +08:00
pkg_pwsh_local["pwsh-local"]
pkg_tool_pwsh["tool-pwsh"]
pkg_bash_env["bash-env"]
2026-07-12 15:41:42 +08:00
svc_bashEnv["ctx.bashEnv< br / > Managed bash environment registry"]
2026-07-21 16:01:00 +08:00
pkg_pty["pty"]
svc_pty["ctx.pty< br / > Persistent PTY session registry"]
pkg_pty_local["pty-local"]
2026-07-09 15:42:37 +08:00
pkg_sandbox["sandbox"]
svc_sandbox["ctx.sandbox< br / > Process-sandbox seam"]
pkg_sandbox_local["sandbox-local"]
2026-07-20 13:59:18 +08:00
pkg_sandbox_policy["sandbox-policy"]
feat(sandbox): cross-family file sandbox — one policy home, sandboxed fs provider, fs escalation parity
Extend SandboxMode enforcement from bash to the filesystem tools, the sandbox
RFC's deferred cross-family phase.
- dsh-sandbox-policy (new, ctx.sandboxPolicy): the single home for the
deployment default mode + workspaceRoot and the per-session override event,
renamed bash/sandbox-mode -> sandbox/mode and moved here with its fold/setter.
Decouples the bash seam from dsh-session.
- dsh-fs-sandbox (new): SandboxedFileSystem extends LocalFileSystem and fences
write/edit by the per-call mode (read-only denies, workspace-write contains to
the workspace + temp roots via the shared writableRoots, danger passes
through); reads pass through. Structured FS_SANDBOX_DENIED; in-lock parent
re-canonicalization. A policy fence in trusted code, not a kernel boundary.
- dsh-sandbox: the shared escalation kit (writableRoots, the strictly-wider
ladder, denial/hint markers, approveEscalation) both tool families use;
approveEscalation takes a structural approver so dsh-sandbox gains no
approval/agent dependency, and both tools stay duplication-free.
- tool-fs: write/edit advertise sandbox_permissions/justification under a
confining ctx.fs, map FS_SANDBOX_DENIED to the shared [sandbox: ...] marker,
and resolve the same one-approved-wider retry.
- examples/acp-agent: composes sandbox-policy + fs-sandbox, drops the gating
that disabled the fs stack under confined modes.
RFC docs/rfc/implemented/feature/2026-07-14-cross-family-fs-sandbox.md; the old
sandbox RFC's In-process/deferred/FAQ sections updated to shipped fact.
2026-07-14 20:05:57 +08:00
svc_sandboxPolicy["ctx.sandboxPolicy< br / > Sandbox policy home"]
pkg_fs_sandbox["fs-sandbox"]
2026-07-09 15:25:18 +08:00
pkg_approval["approval"]
svc_approval["ctx.approval< br / > Approval seam"]
feat(permission): user-facing permission presets — one Permissions select over the two knobs
A preset names a bundle of the two mechanism knobs — request =
workspace-write + ask, yolo = danger-full-access + never — so the editor
shows ONE 'Permissions' select where the sandbox-mode and approval-policy
tiers stay orthogonal capabilities (the Codex /approvals shape: presets over
two dials). ctx.permission (dsh-permission) owns the config-defined table,
validates the default preset's bundle against the composed knob defaults at
load (fails loud), and writes a switch THROUGH: one log-only
permission/preset event (the audit fact reverse-mapping cannot recover —
the planned 'agent' preset shares request's knob values and differs only in
composed policy) plus each knob event via its own setter, deduped — a
net-zero switch appends nothing. Every knob consumer keeps reading its own
fold, untouched.
The current preset DERIVES from the effective knob values — the fold breaks
bundle ties, a knob state outside the table is the reserved 'custom' value
(a state, not an error: shown while it holds, switchable FROM, never a
target), and defaultPreset disappears (zero-event state reverse-maps from
the composition defaults).
The ACP bridge drops the two per-knob selects for the one preset select
(advertised only when ctx.permission is composed); pending/anchor/no-op
semantics carry over unchanged, with the no-op echo acknowledged before
vocabulary validation so a client re-pushing a derived 'custom' current
never errors. The sandbox variant example composes the
service with a workspace-write default; the permission-switching,
escalation-approved and escalation-rejected scenarios are re-recorded under
it (escalations now target an outside-workspace /tmp path under
danger-full-access, self-cleaning) and config-options is re-authored on the
single-select wire.
2026-07-12 21:03:41 +08:00
pkg_permission["permission"]
svc_permission["ctx.permission< br / > Permission presets"]
2026-07-08 02:17:24 +08:00
pkg_code_runtime["code-runtime"]
svc_codeRuntime["ctx.codeRuntime< br / > Code-execution seam"]
feat: add the worker-thread code runtime (dsh-code-runtime-worker)
The shipped backend of the code-execution seam, per the Code Mode RFC's
worker-thread section: one fresh Node worker per run, executing the
model's TypeScript after a host-side type-strip (wrapped in an
async-function shell so top-level return/await parse, sliced back out
position-preserved), bindings bridged over the message port under
hostile-peer rules (own-property name lookup, at-most-once replies,
post-settlement drops, null-prototype namespaces), logs streamed eagerly
with an in-band truncation marker, and two independent budgets — measured
event-loop busy time (computeMs) plus a never-pausing wall ceiling
(maxWallMs) — funneling into worker.terminate(). env: {} and execArgv: []
keep the isolate hermetic; disposal aborts in-flight runs and awaits
worker exits.
The worker entry loads unbuilt via Node's native type stripping
(src/worker.ts, erasable-only) and ships built as a sibling tsdown bundle
(lib/worker.js); tests/built-lib.e2e.ts pins the built load path under
plain node and joins the built-artifact smoke gate. Unit suites cover the
bootstrap in-process (fake port) and the runtime over real workers,
per-file 100%.
2026-07-08 11:00:06 +08:00
pkg_code_runtime_worker["code-runtime-worker"]
2026-07-04 12:50:06 +08:00
pkg_fs["fs"]
svc_fs["ctx.fs< br / > Filesystem provider seam"]
pkg_fs_local["fs-local"]
pkg_fs_policy["fs-policy"]
2026-07-03 01:13:52 +08:00
pkg_compact["compact"]
svc_compact["ctx.compact< br / > Compaction seam"]
pkg_subagent["subagent"]
2026-07-27 00:00:14 +08:00
svc_subagents["ctx.subagents< br / > Subagent provider and continuation service"]
2026-07-03 01:13:52 +08:00
pkg_subagent_spawn["subagent-spawn"]
pkg_subagent_fork["subagent-fork"]
feat(subagent): continuable background subagents
Implement the continuable background subagents RFC: a durable child
session with a series of Task-backed activations, each disposing its
run before the Task settles.
- dsh-subagent: rename SubagentRun.sendMessage to strict steer, drop
run-level resume, add SubagentProvider.resume dispatch via
SubagentService.resume, the continuation start field, and the
versioned model-hidden subagent/descriptor session event.
- dsh-subagent-inprocess/-spawn/-fork: publish the control-allocated
child id, append the descriptor inside the initial turn, implement
cold resume from the child's own transcript under the live parent
scope, and strict running-only steer.
- dsh-subagent-control (new): SubagentControlService owning stable
child ids, descriptor snapshot/fold/authorization, Task-backed
activation with settle-then-dispose ordering, the process-local
active-run association, and steer-or-resume sendMessage routing.
- dsh-tool-subagent: background route branches on the provider's
resume capability (continuable via the control service; one-shot
task for ACP), returning both child and task ids.
- dsh-tool-subagent-control (new): the globally named send_message
tool rendering steered/started routes.
Keyless coverage spans Task ownership and disposal ordering, running
delivery, cold follow-up, descriptor rejection and rollback, known-id
reconstruction, kill during lookup, admission races, and a new
subagent-continuable ACP snapshot scenario.
2026-07-23 17:07:38 +08:00
pkg_tool_subagent_control["tool-subagent-control"]
2026-07-20 00:51:19 +08:00
pkg_tool_ralph["tool-ralph"]
feat(tasks): background task runtime, generic task_* control tools, bash/subagent producers
One shared ctx.tasks registry (branded <kind>-N ids, owner-fenced
read/kill/wait/list, attachSurface misconfiguration fence, reported-flag
notice dedup, atomic register) + dsh-tool-tasks (task_output/task_list/
task_kill, completion-notice injection, background prompt habit).
Producers opt in via their own enableRunInBackground config: bash
(stream kind; seam slimmed to resolve/run/start returning a BashProcess
handle, bash_output/bash_kill deleted) and subagent (final-output kind;
done settles after run.dispose()). Owner disposal drains tasks through
the new awaited ctx.agents.onCleanup seam in the loop's disposal chain.
Both RFCs moved to implemented/; docs, catalogs, snapshots re-pinned.
2026-07-09 21:22:54 +08:00
pkg_tasks["tasks"]
svc_tasks["ctx.tasks< br / > Background task registry"]
2026-07-26 05:13:39 +08:00
pkg_tasks_local["tasks-local"]
feat(tasks): background task runtime, generic task_* control tools, bash/subagent producers
One shared ctx.tasks registry (branded <kind>-N ids, owner-fenced
read/kill/wait/list, attachSurface misconfiguration fence, reported-flag
notice dedup, atomic register) + dsh-tool-tasks (task_output/task_list/
task_kill, completion-notice injection, background prompt habit).
Producers opt in via their own enableRunInBackground config: bash
(stream kind; seam slimmed to resolve/run/start returning a BashProcess
handle, bash_output/bash_kill deleted) and subagent (final-output kind;
done settles after run.dispose()). Owner disposal drains tasks through
the new awaited ctx.agents.onCleanup seam in the loop's disposal chain.
Both RFCs moved to implemented/; docs, catalogs, snapshots re-pinned.
2026-07-09 21:22:54 +08:00
pkg_tool_tasks["tool-tasks"]
2026-07-04 12:50:06 +08:00
pkg_web["web"]
svc_web["ctx.web< br / > Web access provider registry"]
pkg_web_search_exa["web-search-exa"]
pkg_web_search_perplexity["web-search-perplexity"]
pkg_web_search_deepseek["web-search-deepseek"]
pkg_web_fetch_local["web-fetch-local"]
2026-07-08 19:20:50 +08:00
pkg_spill["spill"]
2026-07-13 11:07:27 +08:00
svc_spillStore["ctx.spillStore< br / > Spill storage seam"]
2026-07-08 19:20:50 +08:00
pkg_spill_local["spill-local"]
pkg_spill_policy["spill-policy"]
2026-07-28 15:44:53 +08:00
pkg_directory_picker["directory-picker"]
svc_directoryPicker["ctx.directoryPicker< br / > Workspace-directory picking seam"]
2026-07-28 21:07:28 +08:00
pkg_directory_picker_native["directory-picker-native"]
2026-07-28 15:44:53 +08:00
pkg_directory_picker_browse["directory-picker-browse"]
2026-07-25 02:15:58 +08:00
pkg_webserver["webserver"]
svc_httpServer["ctx.httpServer< br / > HTTP route registration"]
pkg_connection["connection"]
pkg_modules["modules"]
pkg_hmr["hmr"]
svc_clientModuleHost["ctx.clientModuleHost< br / > Client plugin graph host"]
2026-07-06 03:14:07 +08:00
pkg_workflow["workflow"]
svc_workflows["ctx.workflows< br / > Workflow script engine"]
2026-07-09 19:06:55 +08:00
pkg_workflow_workerthread["workflow-workerthread"]
2026-07-06 03:14:07 +08:00
pkg_tool_workflow["tool-workflow"]
2026-07-09 15:36:08 +08:00
pkg_acp --> svc_approval
2026-07-03 01:13:52 +08:00
pkg_agent --> svc_agents
pkg_agent_loop --> svc_agentLoop
2026-07-09 15:25:18 +08:00
pkg_approval --> svc_approval
2026-07-03 01:13:52 +08:00
pkg_bash --> svc_bash
2026-08-02 21:46:53 +08:00
pkg_bash_env --> svc_bashEnv
2026-07-03 01:13:52 +08:00
pkg_bash_local --> svc_bash
2026-07-09 16:05:44 +08:00
pkg_bash_sandbox --> svc_bash
2026-07-08 02:17:24 +08:00
pkg_code_runtime --> svc_codeRuntime
feat: add the worker-thread code runtime (dsh-code-runtime-worker)
The shipped backend of the code-execution seam, per the Code Mode RFC's
worker-thread section: one fresh Node worker per run, executing the
model's TypeScript after a host-side type-strip (wrapped in an
async-function shell so top-level return/await parse, sliced back out
position-preserved), bindings bridged over the message port under
hostile-peer rules (own-property name lookup, at-most-once replies,
post-settlement drops, null-prototype namespaces), logs streamed eagerly
with an in-band truncation marker, and two independent budgets — measured
event-loop busy time (computeMs) plus a never-pausing wall ceiling
(maxWallMs) — funneling into worker.terminate(). env: {} and execArgv: []
keep the isolate hermetic; disposal aborts in-flight runs and awaits
worker exits.
The worker entry loads unbuilt via Node's native type stripping
(src/worker.ts, erasable-only) and ships built as a sibling tsdown bundle
(lib/worker.js); tests/built-lib.e2e.ts pins the built load path under
plain node and joins the built-artifact smoke gate. Unit suites cover the
bootstrap in-process (fake port) and the runtime over real workers,
per-file 100%.
2026-07-08 11:00:06 +08:00
pkg_code_runtime_worker --> svc_codeRuntime
2026-07-19 22:11:59 +08:00
pkg_commands --> svc_commands
2026-07-03 01:13:52 +08:00
pkg_compact --> svc_compact
pkg_compact_basic --> svc_compact
2026-07-16 18:51:26 +08:00
pkg_compact_tool_result_prune --> svc_toolResultPrune
docs: bilingual credentials/settings-consumer documentation, catalogs, and gates
New credentials data-structure page (type-equiv manifested), group README,
rewritten llm-deepseek/llm-pi-ai READMEs (dynamic configuration, dict
profiles, credential chain), capability-seams/service-role registration,
Agent Note (bilingual), demo compositions mounting settings-local +
credentials-local with no inline key plumbing, installSettingsSection
consumer helper on the settings seam (deduplicating both adapters' wiring),
jscpd symmetry markers for the provider twins, runtime-closure additions for
python/sdk-runtime, and doc-budget ceilings AGENTS.md 1750→1755 /
packages/README.md 850→865 for the structural one-line group rows.
2026-07-29 14:20:06 +08:00
pkg_credentials --> svc_credentials
pkg_credentials_local --> svc_credentials
2026-07-28 15:44:53 +08:00
pkg_directory_picker --> svc_directoryPicker
pkg_directory_picker_browse --> svc_directoryPicker
2026-07-28 21:07:28 +08:00
pkg_directory_picker_native --> svc_directoryPicker
2026-07-27 15:25:33 +08:00
pkg_file_reference --> svc_fileReferences
pkg_file_reference_local --> svc_fileReferences
2026-07-04 12:50:06 +08:00
pkg_fs --> svc_fs
pkg_fs_local --> svc_fs
feat(sandbox): cross-family file sandbox — one policy home, sandboxed fs provider, fs escalation parity
Extend SandboxMode enforcement from bash to the filesystem tools, the sandbox
RFC's deferred cross-family phase.
- dsh-sandbox-policy (new, ctx.sandboxPolicy): the single home for the
deployment default mode + workspaceRoot and the per-session override event,
renamed bash/sandbox-mode -> sandbox/mode and moved here with its fold/setter.
Decouples the bash seam from dsh-session.
- dsh-fs-sandbox (new): SandboxedFileSystem extends LocalFileSystem and fences
write/edit by the per-call mode (read-only denies, workspace-write contains to
the workspace + temp roots via the shared writableRoots, danger passes
through); reads pass through. Structured FS_SANDBOX_DENIED; in-lock parent
re-canonicalization. A policy fence in trusted code, not a kernel boundary.
- dsh-sandbox: the shared escalation kit (writableRoots, the strictly-wider
ladder, denial/hint markers, approveEscalation) both tool families use;
approveEscalation takes a structural approver so dsh-sandbox gains no
approval/agent dependency, and both tools stay duplication-free.
- tool-fs: write/edit advertise sandbox_permissions/justification under a
confining ctx.fs, map FS_SANDBOX_DENIED to the shared [sandbox: ...] marker,
and resolve the same one-approved-wider retry.
- examples/acp-agent: composes sandbox-policy + fs-sandbox, drops the gating
that disabled the fs stack under confined modes.
RFC docs/rfc/implemented/feature/2026-07-14-cross-family-fs-sandbox.md; the old
sandbox RFC's In-process/deferred/FAQ sections updated to shipped fact.
2026-07-14 20:05:57 +08:00
pkg_fs_sandbox --> svc_fs
2026-07-19 18:47:34 +08:00
pkg_goal --> svc_goals
2026-07-19 19:19:57 +08:00
pkg_invariants --> svc_invariants
2026-07-03 01:13:52 +08:00
pkg_llm --> svc_llm
pkg_llm_deepseek --> svc_llm
pkg_llm_pi_ai --> svc_llm
pkg_llm_replay --> svc_llm
2026-07-25 02:15:58 +08:00
pkg_modules --> svc_clientModuleHost
feat(permission): user-facing permission presets — one Permissions select over the two knobs
A preset names a bundle of the two mechanism knobs — request =
workspace-write + ask, yolo = danger-full-access + never — so the editor
shows ONE 'Permissions' select where the sandbox-mode and approval-policy
tiers stay orthogonal capabilities (the Codex /approvals shape: presets over
two dials). ctx.permission (dsh-permission) owns the config-defined table,
validates the default preset's bundle against the composed knob defaults at
load (fails loud), and writes a switch THROUGH: one log-only
permission/preset event (the audit fact reverse-mapping cannot recover —
the planned 'agent' preset shares request's knob values and differs only in
composed policy) plus each knob event via its own setter, deduped — a
net-zero switch appends nothing. Every knob consumer keeps reading its own
fold, untouched.
The current preset DERIVES from the effective knob values — the fold breaks
bundle ties, a knob state outside the table is the reserved 'custom' value
(a state, not an error: shown while it holds, switchable FROM, never a
target), and defaultPreset disappears (zero-event state reverse-maps from
the composition defaults).
The ACP bridge drops the two per-knob selects for the one preset select
(advertised only when ctx.permission is composed); pending/anchor/no-op
semantics carry over unchanged, with the no-op echo acknowledged before
vocabulary validation so a client re-pushing a derived 'custom' current
never errors. The sandbox variant example composes the
service with a workspace-write default; the permission-switching,
escalation-approved and escalation-rejected scenarios are re-recorded under
it (escalations now target an outside-workspace /tmp path under
danger-full-access, self-cleaning) and config-options is re-authored on the
single-select wire.
2026-07-12 21:03:41 +08:00
pkg_permission --> svc_permission
2026-07-22 16:57:23 +08:00
pkg_plan_mode --> svc_planMode
2026-07-21 16:01:00 +08:00
pkg_pty --> svc_pty
pkg_pty_local --> svc_pty
2026-08-02 21:46:53 +08:00
pkg_pwsh_local --> svc_bash
2026-07-09 15:42:37 +08:00
pkg_sandbox --> svc_sandbox
pkg_sandbox_local --> svc_sandbox
2026-07-20 13:59:18 +08:00
pkg_sandbox_policy --> svc_sandboxPolicy
2026-07-03 01:13:52 +08:00
pkg_session --> svc_sessions
pkg_session_persistence --> svc_sessionPersistence
pkg_session_persistence_jsonl --> svc_sessionPersistence
pkg_session_persistence_sqlite --> svc_sessionPersistence
2026-07-28 01:09:55 +08:00
pkg_session_projection --> svc_sessionProjections
2026-07-28 02:11:31 +08:00
pkg_session_projection_cache --> svc_sessionProjectionCache
2026-07-10 16:51:19 +08:00
pkg_session_query --> svc_sessionQuery
2026-07-23 20:16:14 +08:00
pkg_session_query_sqlite --> svc_sessionQuery
2026-07-21 16:46:48 +08:00
pkg_session_reference --> svc_sessionReferences
2026-07-23 03:06:57 +08:00
pkg_session_telemetry --> svc_telemetry
pkg_session_telemetry_otel --> svc_telemetry
2026-07-21 01:54:00 +08:00
pkg_session_title --> svc_sessionTitle
pkg_session_title_all_messages_llm --> svc_sessionTitle
pkg_session_title_first_message_llm --> svc_sessionTitle
feat(settings): add user-settings seam (ctx.settings) + file provider
Two-package capability family mirroring session-persistence/:
- dsh-settings: abstract Settings service — namespace registry with
caller-fiber effect registrations, layered resolution (schema defaults
< composition base < user document), schemastery validation,
per-namespace deep-equal commit detection, and the settings/updated
event. Boot/registration validation fails loud; provider publishes
keep last-good per namespace.
- dsh-settings-local: settings.yaml/.json provider — resolveSpec
defaulting to $DSH_HOME/settings.yaml, chokidar hot reload,
content-equality self-write suppression, atomic 0600 tmp+rename
writes, comment-preserving YAML namespace patching.
Consumers register inside ctx.inject(['settings'], …), so every
composition works unchanged without a mounted provider. Real Loader +
Include composition test proves cordis.yml boot and external-edit hot
propagation; HMR disposal test proves registry cleanup. Both packages
hold per-file 100% coverage.
Doc budgets rise 1705→1710 (AGENTS.md) and 835→845 (packages/README.md):
one structural line per file for the new package group.
Agent Note: .agents/notes/implemented/architecture/2026-07-28-user-settings-seam.md
2026-07-28 17:30:12 +08:00
pkg_settings --> svc_settings
pkg_settings_local --> svc_settings
2026-07-05 16:50:29 +08:00
pkg_skill --> svc_skills
2026-07-10 14:19:06 +08:00
pkg_skill_local --> svc_skills
2026-07-13 11:07:27 +08:00
pkg_spill --> svc_spillStore
pkg_spill_local --> svc_spillStore
chore(storage,workspace): gates — coverage, catalogs, bilingual note
- Per-file 100% coverage across the five new packages (invariant
companion suites, failure-injection negatives, lifecycle and
malformed-medium branches).
- Canonical README Model Experience / Known Limitations sections; new
storage/ and workspace/ group READMEs; packages/README.md rows (budget
ceiling raised 760 → 790 for the two new groups).
- Cordis catalog/type-link registrations, service-role classification,
and regenerated catalogs/graphs for the new services and events.
- Agent Note: English body + i18n pairing record; design-sketch fences
opted out of doc-typecheck as ignore-check.
- Two exactOptionalPropertyTypes/discriminant fixes in new tests.
doc-sync (24 gates), typecheck, hygiene, and the five-package suite
(92 tests) all pass.
2026-07-24 22:49:57 +08:00
pkg_storage --> svc_storage
2026-07-25 16:04:48 +08:00
pkg_storage_domain --> svc_storageDomain
chore(storage,workspace): gates — coverage, catalogs, bilingual note
- Per-file 100% coverage across the five new packages (invariant
companion suites, failure-injection negatives, lifecycle and
malformed-medium branches).
- Canonical README Model Experience / Known Limitations sections; new
storage/ and workspace/ group READMEs; packages/README.md rows (budget
ceiling raised 760 → 790 for the two new groups).
- Cordis catalog/type-link registrations, service-role classification,
and regenerated catalogs/graphs for the new services and events.
- Agent Note: English body + i18n pairing record; design-sketch fences
opted out of doc-typecheck as ignore-check.
- Two exactOptionalPropertyTypes/discriminant fixes in new tests.
doc-sync (24 gates), typecheck, hygiene, and the five-package suite
(92 tests) all pass.
2026-07-24 22:49:57 +08:00
pkg_storage_json --> svc_storage
pkg_storage_sqlite --> svc_storage
2026-07-03 01:13:52 +08:00
pkg_subagent --> svc_subagents
pkg_subagent_acp --> svc_subagents
pkg_subagent_fork --> svc_subagents
pkg_subagent_spawn --> svc_subagents
2026-07-26 14:10:46 +08:00
pkg_subprocess --> svc_subprocess
pkg_subprocess_local --> svc_subprocess
2026-07-03 01:13:52 +08:00
pkg_system_prompt --> svc_systemPrompt
feat(tasks): background task runtime, generic task_* control tools, bash/subagent producers
One shared ctx.tasks registry (branded <kind>-N ids, owner-fenced
read/kill/wait/list, attachSurface misconfiguration fence, reported-flag
notice dedup, atomic register) + dsh-tool-tasks (task_output/task_list/
task_kill, completion-notice injection, background prompt habit).
Producers opt in via their own enableRunInBackground config: bash
(stream kind; seam slimmed to resolve/run/start returning a BashProcess
handle, bash_output/bash_kill deleted) and subagent (final-output kind;
done settles after run.dispose()). Owner disposal drains tasks through
the new awaited ctx.agents.onCleanup seam in the loop's disposal chain.
Both RFCs moved to implemented/; docs, catalogs, snapshots re-pinned.
2026-07-09 21:22:54 +08:00
pkg_tasks --> svc_tasks
2026-07-26 05:13:39 +08:00
pkg_tasks_local --> svc_tasks
2026-07-15 14:47:29 +08:00
pkg_token_meter --> svc_tokenMeter
2026-07-03 01:13:52 +08:00
pkg_tools --> svc_tools
2026-07-28 23:48:35 +08:00
pkg_typert_registry --> svc_typert
2026-07-05 17:05:33 +08:00
pkg_user_interaction --> svc_userInteraction
2026-07-04 12:50:06 +08:00
pkg_web --> svc_web
pkg_web_fetch_local --> svc_web
pkg_web_search_deepseek --> svc_web
pkg_web_search_exa --> svc_web
pkg_web_search_perplexity --> svc_web
2026-07-25 02:15:58 +08:00
pkg_webserver --> svc_httpServer
2026-07-06 03:14:07 +08:00
pkg_workflow --> svc_workflows
2026-07-09 19:06:55 +08:00
pkg_workflow_workerthread --> svc_workflows
chore(storage,workspace): gates — coverage, catalogs, bilingual note
- Per-file 100% coverage across the five new packages (invariant
companion suites, failure-injection negatives, lifecycle and
malformed-medium branches).
- Canonical README Model Experience / Known Limitations sections; new
storage/ and workspace/ group READMEs; packages/README.md rows (budget
ceiling raised 760 → 790 for the two new groups).
- Cordis catalog/type-link registrations, service-role classification,
and regenerated catalogs/graphs for the new services and events.
- Agent Note: English body + i18n pairing record; design-sketch fences
opted out of doc-typecheck as ignore-check.
- Two exactOptionalPropertyTypes/discriminant fixes in new tests.
doc-sync (24 gates), typecheck, hygiene, and the five-package suite
(92 tests) all pass.
2026-07-24 22:49:57 +08:00
pkg_workspace --> svc_workspace
2026-07-15 15:57:57 +08:00
svc_agentLoop --> pkg_agent_spine_demo
2026-07-03 01:13:52 +08:00
svc_agents --> pkg_acp
svc_agents --> pkg_agent_loop
2026-07-15 21:21:24 +08:00
svc_agents --> pkg_cli_demo
2026-07-03 01:13:52 +08:00
svc_agents --> pkg_subagent_inprocess
2026-07-09 16:37:10 +08:00
svc_approval --> pkg_tool_bash
2026-07-09 15:25:18 +08:00
svc_approval --> pkg_tools
2026-07-04 12:50:06 +08:00
svc_bash --> pkg_hooks_claude
svc_bash --> pkg_hooks_codex
2026-07-03 01:13:52 +08:00
svc_bash --> pkg_tool_bash
2026-08-02 21:46:53 +08:00
svc_bash --> pkg_tool_pwsh
svc_bashEnv --> pkg_tool_bash
svc_bashEnv --> pkg_tool_pwsh
2026-07-25 02:15:58 +08:00
svc_clientModuleHost --> pkg_hmr
feat: Code Mode — the registry's mode config, the SDK codegen, and the run_code bridge
The dsh-tools half of the Code Mode RFC (its fourth, final change): the
registry gains its first config — mode: native | code | both — and OWNS how
its tools reach the model. 'code' contributes exactly one wire tool,
run_code, plus a lazy tools:sdk prompt section declaring every other tool
as a generated TypeScript API (jsonSchemaToTs: total over the defineTool
subset, unknown degradation, lexicographic byte-identical rendering);
'both' ships both representations; 'native' is byte-for-byte the old
behavior. Non-native modes fail every assembly loudly without a
typescript-language ctx.codeRuntime.
run_code's dispatch bridge: JSON-normalizes each binding argument before
dispatch (what dispatches is what the tool/code-dispatch event logs — the
append can never fail on payload shape; BigInt/circulars reject that one
call), serializes all program tool calls through a per-run queue (even
Promise.all — no concurrency-safety metadata yet), routes every sub-call
through tools/pre-execute → tools/post-execute (a deny rejects the
program-side promise), drops sub-call additionalContext (no safe outlet
mid-run; pinned), owns a run-scoped abort that follows the outer signal in
and fires on settlement (in-flight sub-dispatch aborted, queued abandoned,
queue drained before returning), and converts a failed run into
CodeRunFailedError → a structured isError carrying kind + captured logs.
tool/code-dispatch joins SessionEventMap by declaration merging (log-only;
deriveMessages ignores it).
The composed surface: the tools config forwards through agent-core and
both app packages; examples/code-agent + demo:code run the worker runtime
under mode code (keyless boot smoke + a with-key e2e proving the collapsed
[run_code] header, the dispatch events, and the file the program wrote);
two new snapshot scenarios (code-mode-turn, both-mode-turn) record the SDK
section, collapsed header, dispatch events, and result card — each its own
header-pinning class (the harness gains per-scenario config overlays and
per-class pins). Catalogs, graphs, cookbook, hooks-bridge notes, and the
RFC (moved to implemented/, restructured to decision-era headings) updated
in the same change.
2026-07-08 12:58:23 +08:00
svc_codeRuntime --> pkg_tools
2026-07-03 01:13:52 +08:00
svc_compact --> pkg_compact_basic
2026-07-30 10:53:39 +08:00
svc_credentials --> pkg_apiproxy
docs: bilingual credentials/settings-consumer documentation, catalogs, and gates
New credentials data-structure page (type-equiv manifested), group README,
rewritten llm-deepseek/llm-pi-ai READMEs (dynamic configuration, dict
profiles, credential chain), capability-seams/service-role registration,
Agent Note (bilingual), demo compositions mounting settings-local +
credentials-local with no inline key plumbing, installSettingsSection
consumer helper on the settings seam (deduplicating both adapters' wiring),
jscpd symmetry markers for the provider twins, runtime-closure additions for
python/sdk-runtime, and doc-budget ceilings AGENTS.md 1750→1755 /
packages/README.md 850→865 for the structural one-line group rows.
2026-07-29 14:20:06 +08:00
svc_credentials --> pkg_llm_deepseek
svc_credentials --> pkg_llm_pi_ai
2026-07-28 15:44:53 +08:00
svc_directoryPicker --> pkg_apiproxy
2026-07-27 15:25:33 +08:00
svc_fileReferences --> pkg_apiproxy
2026-07-04 12:50:06 +08:00
svc_fs --> pkg_tool_fs
2026-07-25 02:15:58 +08:00
svc_httpServer --> pkg_connection
svc_httpServer --> pkg_hmr
svc_httpServer --> pkg_modules
2026-07-19 19:19:57 +08:00
svc_invariants --> pkg_agent
svc_invariants --> pkg_agent_loop
svc_invariants --> pkg_scope
svc_invariants --> pkg_session
2026-07-03 01:13:52 +08:00
svc_llm --> pkg_agent_loop
svc_llm --> pkg_compact_basic
2026-07-21 16:01:00 +08:00
svc_pty --> pkg_tool_pty
2026-07-09 16:05:44 +08:00
svc_sandbox --> pkg_bash_sandbox
2026-07-21 16:01:00 +08:00
svc_sandbox --> pkg_pty_local
feat(sandbox): cross-family file sandbox — one policy home, sandboxed fs provider, fs escalation parity
Extend SandboxMode enforcement from bash to the filesystem tools, the sandbox
RFC's deferred cross-family phase.
- dsh-sandbox-policy (new, ctx.sandboxPolicy): the single home for the
deployment default mode + workspaceRoot and the per-session override event,
renamed bash/sandbox-mode -> sandbox/mode and moved here with its fold/setter.
Decouples the bash seam from dsh-session.
- dsh-fs-sandbox (new): SandboxedFileSystem extends LocalFileSystem and fences
write/edit by the per-call mode (read-only denies, workspace-write contains to
the workspace + temp roots via the shared writableRoots, danger passes
through); reads pass through. Structured FS_SANDBOX_DENIED; in-lock parent
re-canonicalization. A policy fence in trusted code, not a kernel boundary.
- dsh-sandbox: the shared escalation kit (writableRoots, the strictly-wider
ladder, denial/hint markers, approveEscalation) both tool families use;
approveEscalation takes a structural approver so dsh-sandbox gains no
approval/agent dependency, and both tools stay duplication-free.
- tool-fs: write/edit advertise sandbox_permissions/justification under a
confining ctx.fs, map FS_SANDBOX_DENIED to the shared [sandbox: ...] marker,
and resolve the same one-approved-wider retry.
- examples/acp-agent: composes sandbox-policy + fs-sandbox, drops the gating
that disabled the fs stack under confined modes.
RFC docs/rfc/implemented/feature/2026-07-14-cross-family-fs-sandbox.md; the old
sandbox RFC's In-process/deferred/FAQ sections updated to shipped fact.
2026-07-14 20:05:57 +08:00
svc_sandboxPolicy --> pkg_bash_sandbox
svc_sandboxPolicy --> pkg_fs_sandbox
2026-07-21 16:01:00 +08:00
svc_sandboxPolicy --> pkg_pty_local
2026-07-03 01:13:52 +08:00
svc_sessionPersistence --> pkg_agent_loop
fix(bash): close managed environment review gaps
The managed DSH_* runtime path was correct, but its public extension and documentation contracts were incomplete. A contributor following the README could access ctx.bashEnv without declaring an injection, the new environment types had no drift-checked catalog entries, and the capability graph omitted three packages that now query sessionPersistence.
Declare the README injection, catalog DshEnvironmentKey and DshEnvironment, and add tool-bash plus both hook bridges to the generated persistence consumer graph. Keep BashEnvRegistry.list() contributor-only for now because no production caller treats it as exhaustive, but record the built-in enumeration gap before diagnostics, prompt, or UI code depends on it.
Validated on the exact resulting tree with typecheck, lint, coverage, snapshot, documentation, module-graph, build, hygiene, demo-smoke, and built-artifact checks.
2026-07-15 00:04:00 +08:00
svc_sessionPersistence --> pkg_hooks_claude
svc_sessionPersistence --> pkg_hooks_codex
2026-07-10 16:51:19 +08:00
svc_sessionPersistence --> pkg_session_query
2026-07-15 10:51:38 +08:00
svc_sessionPersistence --> pkg_session_query_sqlite
fix(bash): close managed environment review gaps
The managed DSH_* runtime path was correct, but its public extension and documentation contracts were incomplete. A contributor following the README could access ctx.bashEnv without declaring an injection, the new environment types had no drift-checked catalog entries, and the capability graph omitted three packages that now query sessionPersistence.
Declare the README injection, catalog DshEnvironmentKey and DshEnvironment, and add tool-bash plus both hook bridges to the generated persistence consumer graph. Keep BashEnvRegistry.list() contributor-only for now because no production caller treats it as exhaustive, but record the built-in enumeration gap before diagnostics, prompt, or UI code depends on it.
Validated on the exact resulting tree with typecheck, lint, coverage, snapshot, documentation, module-graph, build, hygiene, demo-smoke, and built-artifact checks.
2026-07-15 00:04:00 +08:00
svc_sessionPersistence --> pkg_tool_bash
2026-07-28 02:11:31 +08:00
svc_sessionProjectionCache --> pkg_host_apiproxy
2026-07-28 01:09:55 +08:00
svc_sessionProjections --> pkg_host_apiproxy
svc_sessionProjections --> pkg_session_title
svc_sessionProjections --> pkg_tool_todo
2026-07-21 16:46:48 +08:00
svc_sessionQuery --> pkg_session_reference
2026-07-24 15:09:55 +08:00
svc_sessionQuery --> pkg_tool_session_query
2026-07-27 15:25:33 +08:00
svc_sessionReferences --> pkg_apiproxy
2026-07-03 01:13:52 +08:00
svc_sessions --> pkg_agent
svc_sessions --> pkg_agent_loop
2026-07-15 21:21:24 +08:00
svc_sessions --> pkg_cli_demo
2026-07-03 01:13:52 +08:00
svc_sessions --> pkg_invariants
svc_sessions --> pkg_session_persistence
2026-07-10 16:51:19 +08:00
svc_sessions --> pkg_session_query
2026-07-15 10:51:38 +08:00
svc_sessions --> pkg_session_query_sqlite
2026-07-03 01:13:52 +08:00
svc_sessions --> pkg_subagent_inprocess
2026-07-30 10:53:39 +08:00
svc_settings --> pkg_apiproxy
docs: bilingual credentials/settings-consumer documentation, catalogs, and gates
New credentials data-structure page (type-equiv manifested), group README,
rewritten llm-deepseek/llm-pi-ai READMEs (dynamic configuration, dict
profiles, credential chain), capability-seams/service-role registration,
Agent Note (bilingual), demo compositions mounting settings-local +
credentials-local with no inline key plumbing, installSettingsSection
consumer helper on the settings seam (deduplicating both adapters' wiring),
jscpd symmetry markers for the provider twins, runtime-closure additions for
python/sdk-runtime, and doc-budget ceilings AGENTS.md 1750→1755 /
packages/README.md 850→865 for the structural one-line group rows.
2026-07-29 14:20:06 +08:00
svc_settings --> pkg_llm_deepseek
svc_settings --> pkg_llm_pi_ai
2026-07-05 16:50:29 +08:00
svc_skills --> pkg_tool_skill
2026-07-13 11:07:27 +08:00
svc_spillStore --> pkg_spill_policy
2026-07-25 01:11:39 +08:00
svc_storage --> pkg_storage_domain
2026-07-25 16:04:48 +08:00
svc_storageDomain --> pkg_workspace
2026-07-20 00:51:19 +08:00
svc_subagents --> pkg_tool_ralph
2026-07-03 01:13:52 +08:00
svc_subagents --> pkg_tool_subagent
2026-07-27 00:00:14 +08:00
svc_subagents --> pkg_tool_subagent_control
refactor(subprocess): rename the process seam to subprocess and address review
Review feedback (tianyicui): 'process' is a poor service name. The family is
now packages/subprocess/ — @deepseek-ai/dsh-subprocess (ctx.subprocess,
abstract SubprocessService, Subprocess* vocabulary) and
@deepseek-ai/dsh-subprocess-local (LocalSubprocessService) — renamed
throughout code, compositions, docs (en+zh, pairs re-recorded), catalogs,
and gates. 'subprocess' is the precise term for managed OS children (the
Python-stdlib sense), avoids colliding with Node's global process object,
and reads as one system beside dsh-subagent-subprocess.
ds-review-bot findings addressed:
- kill() on a settled handle is now a no-op (no signal to a possibly-reused
pgid, no referenced grace timer delaying exit); pinned by a spy test.
- The moved DshEnvironmentKey/DshEnvironment/CollectedOutput types get
drift-checked type-equiv blocks on the new subprocess.md page, restoring
their manifest registration.
- subprocess.md is registered in the core.md sub-page index (en+zh).
2026-07-26 12:43:14 +08:00
svc_subprocess --> pkg_bash_local
svc_subprocess --> pkg_bash_sandbox
feat(subprocess): migrate lsp-local, subagent-acp, and the env scrubs onto the seam
Review direction (tianyicui, PR #660): in a stacked PR, change all other
process-running places to use the new service.
- lsp-local: LspConnection spawns through ctx.subprocess (piped protocol
streams + a no-spill collected stderr tail); its private process-tree
helpers (POSIX group signalling, Windows taskkill, liveness polling) are
deleted in favor of the seam's handle verbs, and its buildChildEnv now
rides scrubbedParentEnv (LSP children also stop inheriting stale DSH_*).
The plugin injects 'subprocess'; compositions/tests mount
dsh-subprocess-local.
- subagent-acp: the ACP child spawns through the seam (piped ndjson streams,
inherited stderr); spawn failure surfaces through done-rejection into the
same startup race; disposal is handle.dispose with the plugin's configured
graces. dsh-subagent-subprocess is DELETED — its dispose ladder and scrub
are the seam's, and the isolated-config-dir helper had no consumer.
- mcp-client, pty-local, sdk-helper: adopt scrubbedParentEnv as the one
scrub definition (their spawns stay put by ownership: the MCP SDK and
node-pty own those calls; the SDK wizard runs outside any composition).
- Coverage: per-file 100% over every touched src file, with each v8 ignore
carrying a platform or contract reason; new suites cover stdio
dispositions, the dispose ladder tiers, injected-win32 tree semantics,
waitForExit, settled-kill/terminate no-ops, and spawn-failure disposal.
- Docs: consumer-migration Agent Note (en; zh follows in this PR), seam note
updated in place, subprocess.md rewritten for the reshaped vocabulary
(type-equiv re-registered), READMEs and SERVICE_ROLES updated, taskkill
added to knip ignoreBinaries.
2026-07-26 15:27:59 +08:00
svc_subprocess --> pkg_lsp_local
svc_subprocess --> pkg_subagent_acp
2026-07-03 01:13:52 +08:00
svc_systemPrompt --> pkg_agent_loop
2026-07-04 12:50:06 +08:00
svc_systemPrompt --> pkg_tool_fs
2026-07-21 16:01:00 +08:00
svc_systemPrompt --> pkg_tool_pty
2026-07-04 12:50:06 +08:00
svc_systemPrompt --> pkg_tool_web
2026-07-03 01:13:52 +08:00
svc_systemPrompt --> pkg_tools
feat(tasks): background task runtime, generic task_* control tools, bash/subagent producers
One shared ctx.tasks registry (branded <kind>-N ids, owner-fenced
read/kill/wait/list, attachSurface misconfiguration fence, reported-flag
notice dedup, atomic register) + dsh-tool-tasks (task_output/task_list/
task_kill, completion-notice injection, background prompt habit).
Producers opt in via their own enableRunInBackground config: bash
(stream kind; seam slimmed to resolve/run/start returning a BashProcess
handle, bash_output/bash_kill deleted) and subagent (final-output kind;
done settles after run.dispose()). Owner disposal drains tasks through
the new awaited ctx.agents.onCleanup seam in the loop's disposal chain.
Both RFCs moved to implemented/; docs, catalogs, snapshots re-pinned.
2026-07-09 21:22:54 +08:00
svc_tasks --> pkg_tool_bash
2026-07-21 16:01:00 +08:00
svc_tasks --> pkg_tool_pty
feat(tasks): background task runtime, generic task_* control tools, bash/subagent producers
One shared ctx.tasks registry (branded <kind>-N ids, owner-fenced
read/kill/wait/list, attachSurface misconfiguration fence, reported-flag
notice dedup, atomic register) + dsh-tool-tasks (task_output/task_list/
task_kill, completion-notice injection, background prompt habit).
Producers opt in via their own enableRunInBackground config: bash
(stream kind; seam slimmed to resolve/run/start returning a BashProcess
handle, bash_output/bash_kill deleted) and subagent (final-output kind;
done settles after run.dispose()). Owner disposal drains tasks through
the new awaited ctx.agents.onCleanup seam in the loop's disposal chain.
Both RFCs moved to implemented/; docs, catalogs, snapshots re-pinned.
2026-07-09 21:22:54 +08:00
svc_tasks --> pkg_tool_subagent
svc_tasks --> pkg_tool_tasks
2026-07-15 14:47:29 +08:00
svc_tokenMeter --> pkg_compact_basic
2026-07-16 18:02:15 +08:00
svc_toolResultPrune --> pkg_compact_basic
2026-07-03 01:13:52 +08:00
svc_tools --> pkg_agent_loop
2026-07-05 17:05:33 +08:00
svc_tools --> pkg_tool_ask_user
2026-07-03 01:13:52 +08:00
svc_tools --> pkg_tool_bash
2026-07-08 11:50:12 +08:00
svc_tools --> pkg_tool_cordis
2026-07-04 12:50:06 +08:00
svc_tools --> pkg_tool_fs
2026-07-21 16:01:00 +08:00
svc_tools --> pkg_tool_pty
2026-07-05 16:50:29 +08:00
svc_tools --> pkg_tool_skill
2026-07-03 01:13:52 +08:00
svc_tools --> pkg_tool_subagent
svc_tools --> pkg_tool_todo
2026-07-04 12:50:06 +08:00
svc_tools --> pkg_tool_web
2026-07-28 23:48:35 +08:00
svc_typert --> pkg_typert_loader
2026-07-05 17:05:33 +08:00
svc_userInteraction --> pkg_tool_ask_user
2026-07-04 12:50:06 +08:00
svc_web --> pkg_tool_web
2026-07-20 00:51:19 +08:00
svc_workflows --> pkg_tool_ralph
2026-07-06 03:14:07 +08:00
svc_workflows --> pkg_tool_workflow
2026-07-25 16:04:48 +08:00
svc_workspace --> pkg_apiproxy
2026-07-04 12:50:06 +08:00
svc_fs -. event gate .-> pkg_fs_policy
2026-07-03 01:13:52 +08:00
```
2026-07-04 12:50:06 +08:00
| ctx key | Role | Owner | Implementations | Direct consumers | Companion plugins | Note |
| --- | --- | --- | --- | --- | --- | --- |
2026-07-05 01:25:58 +08:00
| `ctx.llm` | `seam` | [`llm` ](../packages/llm/llm ) | [`llm-deepseek` ](../packages/llm/llm-deepseek ), [`llm-pi-ai` ](../packages/llm/llm-pi-ai ), [`llm-replay` ](../packages/support/llm-replay ) | [`agent-loop` ](../packages/core/agent-loop ), [`compact-basic` ](../packages/compact/compact-basic ) | - | Adapters register provider implementations; the loop and compaction call the provider-neutral stream service. |
2026-07-16 12:58:07 +08:00
| `ctx.tokenMeter` | `core` | [`token-meter` ](../packages/llm/token-meter ) | - | [`compact-basic` ](../packages/compact/compact-basic ) | - | Owns isolated per-session replay folds; pressure consumers share immutable revisioned measurements. |
2026-07-16 18:51:26 +08:00
| `ctx.toolResultPrune` | `core` | [`compact-tool-result-prune` ](../packages/compact/compact-tool-result-prune ) | - | [`compact-basic` ](../packages/compact/compact-basic ) | - | Rewrites oversized current tool results through replayable single-node surface replacements before summary compaction. |
2026-07-23 13:56:56 +08:00
| `ctx.sessions` | `core` | [`session` ](../packages/core/session ) | - | [`agent-loop` ](../packages/core/agent-loop ), [`agent` ](../packages/core/agent ), [`cli-demo` ](../packages/examples/cli-demo ), [`session-persistence` ](../packages/session-persistence/session-persistence ), [`session-query` ](../packages/session-query/session-query ), [`session-query-sqlite` ](../packages/session-query/session-query-sqlite ), [`subagent-inprocess` ](../packages/subagent/subagent-inprocess ), [`invariants` ](../packages/support/invariants ) | - | Owns append-only Session instances and emits the durable session event feed. |
2026-07-19 19:19:57 +08:00
| `ctx.invariants` | `core` | [`invariants` ](../packages/support/invariants ) | - | [`session` ](../packages/core/session ), [`agent` ](../packages/core/agent ), [`scope` ](../packages/core/scope ), [`agent-loop` ](../packages/core/agent-loop ) | - | Companion subpaths register owner-local checks; the service owns selection, uniqueness, child fibers, and package-attributed failures. |
2026-07-28 23:48:35 +08:00
| `ctx.typert` | `core` | [`typert-registry` ](../packages/typert/registry ) | - | [`typert-loader` ](../packages/typert/loader ) | - | Plugins register live zod contributions directly or through dsh-typert-loader; runtime consumers query schemas and reflection metadata at their own edges. |
2026-07-24 01:40:25 +08:00
| `ctx.sessionPersistence` | `seam` | [`session-persistence` ](../packages/session-persistence/session-persistence ) | [`session-persistence-jsonl` ](../packages/session-persistence/session-persistence-jsonl ), [`session-persistence-sqlite` ](../packages/session-persistence/session-persistence-sqlite ) | [`agent-loop` ](../packages/core/agent-loop ), [`tool-bash` ](../packages/bash/tool-bash ), [`hooks-claude` ](../packages/hooks/hooks-claude ), [`hooks-codex` ](../packages/hooks/hooks-codex ), [`session-query` ](../packages/session-query/session-query ), [`session-query-sqlite` ](../packages/session-query/session-query-sqlite ) | - | Backends persist the same SessionEvent vocabulary; apps choose a backend at composition time. |
2026-07-30 10:53:39 +08:00
| `ctx.settings` | `seam` | [`settings` ](../packages/settings/settings ) | [`settings-local` ](../packages/settings/settings-local ) | [`llm-deepseek` ](../packages/llm/llm-deepseek ), [`llm-pi-ai` ](../packages/llm/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` ](../packages/credentials/credentials ) | [`credentials-local` ](../packages/credentials/credentials-local ) | [`llm-deepseek` ](../packages/llm/llm-deepseek ), [`llm-pi-ai` ](../packages/llm/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. |
2026-07-23 03:06:57 +08:00
| `ctx.telemetry` | `seam` | [`session-telemetry` ](../packages/telemetry/session-telemetry ) | [`session-telemetry-otel` ](../packages/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. |
2026-07-25 16:04:48 +08:00
| `ctx.storage` | `seam` | [`storage` ](../packages/storage/storage ) | [`storage-json` ](../packages/storage/storage-json ), [`storage-sqlite` ](../packages/storage/storage-sqlite ) | [`storage-domain` ](../packages/storage/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` ](../packages/storage/storage-domain ) | - | [`workspace` ](../packages/workspace/workspace ) | - | Waits for every configured backend, then publishes the domain form as one lifecycle-bound service for typed durable state. |
| `ctx.workspace` | `core` | [`workspace` ](../packages/workspace/workspace ) | - | `apiproxy` | - | Owns WorkspaceId-branded records over the domain facility; stable sessionIds accounts drive Host RPC and GUI projections. |
2026-07-24 15:09:55 +08:00
| `ctx.sessionQuery` | `seam` | [`session-query` ](../packages/session-query/session-query ) | [`session-query-sqlite` ](../packages/session-query/session-query-sqlite ) | [`session-reference` ](../packages/context/session-reference ), [`tool-session-query` ](../packages/session-query/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. |
2026-07-27 15:25:33 +08:00
| `ctx.fileReferences` | `seam` | [`file-reference` ](../packages/context/file-reference ) | [`file-reference-local` ](../packages/context/file-reference-local ) | `apiproxy` | - | The local provider owns one invalidated path index per agent; Host RPC projects its cancellable path candidates to browser reference sources. |
2026-08-04 15:12:08 +08:00
| `ctx.sessionReferences` | `core` | [`session-reference` ](../packages/context/session-reference ) | - | `apiproxy` | - | Projects bounded current-surface conversation snapshots into durable untrusted message context; Host adapters own mention syntax. |
2026-07-21 01:54:00 +08:00
| `ctx.sessionTitle` | `seam` | [`session-title` ](../packages/session-title/session-title ) | [`session-title-first-message-llm` ](../packages/session-title/session-title-first-message-llm ), [`session-title-all-messages-llm` ](../packages/session-title/session-title-all-messages-llm ) | - | - | Owns the deterministic fallback, latest-title fold, and sole optional asynchronous provider registration. |
2026-07-21 16:01:00 +08:00
| `ctx.systemPrompt` | `core` | [`system-prompt` ](../packages/core/system-prompt ) | - | [`agent-loop` ](../packages/core/agent-loop ), [`tools` ](../packages/core/tools ), [`tool-fs` ](../packages/fs/tool-fs ), [`tool-pty` ](../packages/pty/tool-pty ), [`tool-web` ](../packages/web/tool-web ) | - | Collects prompt sections and model-facing tool schemas for each step. |
2026-07-24 01:40:25 +08:00
| `ctx.tools` | `core` | [`tools` ](../packages/core/tools ) | - | [`agent-loop` ](../packages/core/agent-loop ), [`tool-ask-user` ](../packages/ui/tool-ask-user ), [`tool-bash` ](../packages/bash/tool-bash ), [`tool-cordis` ](../packages/cordis/tool-cordis ), [`tool-fs` ](../packages/fs/tool-fs ), [`tool-pty` ](../packages/pty/tool-pty ), [`tool-skill` ](../packages/skill/tool-skill ), [`tool-subagent` ](../packages/subagent/tool-subagent ), [`tool-todo` ](../packages/todo/tool-todo ), [`tool-web` ](../packages/web/tool-web ) | - | Registers capabilities, owns Code Mode transport, and routes calls through pre-policy, monotonic guards, around dispatch, post-policy, and final-result observation. |
2026-08-04 10:07:17 +08:00
| `ctx.userInteraction` | `seam` | [`user-interaction` ](../packages/ui/user-interaction ) | - | [`tool-ask-user` ](../packages/ui/tool-ask-user ) | - | UI front doors provide the active human-answer provider; tool-ask-user pauses a tool call on the provider-neutral ask() promise. |
2026-07-24 01:40:25 +08:00
| `ctx.planMode` | `core` | [`plan-mode` ](../packages/plan/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. |
2026-08-04 10:07:17 +08:00
| `ctx.commands` | `core` | [`commands` ](../packages/ui/commands ) | - | - | - | Plugins register direct human commands without sending invocations to the model. |
2026-07-28 01:09:55 +08:00
| `ctx.sessionProjections` | `core` | [`session-projection` ](../packages/session-projection/session-projection ) | - | [`tool-todo` ](../packages/todo/tool-todo ), [`session-title` ](../packages/session-title/session-title ), [`host-apiproxy` ](../packages/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. |
2026-07-28 02:11:31 +08:00
| `ctx.sessionProjectionCache` | `core` | [`session-projection-cache` ](../packages/session-projection/session-projection-cache ) | - | [`host-apiproxy` ](../packages/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. |
2026-07-10 14:19:06 +08:00
| `ctx.skills` | `seam` | [`skill` ](../packages/skill/skill ) | [`skill-local` ](../packages/skill/skill-local ) | [`tool-skill` ](../packages/skill/tool-skill ) | - | Merges provider skill catalogs; tool-skill renders the session-prefix catalog and loads complete skill bodies. |
2026-08-04 10:07:17 +08:00
| `ctx.agents` | `core` | [`agent` ](../packages/core/agent ) | - | [`agent-loop` ](../packages/core/agent-loop ), [`acp` ](../packages/acp/acp ), [`cli-demo` ](../packages/examples/cli-demo ), [`subagent-inprocess` ](../packages/subagent/subagent-inprocess ) | - | Owns live Agent handles, the create/resume factory seam, and process-local initiator propagation. |
2026-07-15 15:57:57 +08:00
| `ctx.agentLoop` | `bundle` | [`agent-loop` ](../packages/core/agent-loop ) | - | [`agent-spine-demo` ](../packages/examples/agent-spine-demo ) | - | The one concrete loop plugin; extension packages depend on dsh-agent events and services, not on this package. |
2026-07-19 18:47:34 +08:00
| `ctx.goals` | `core` | [`goal` ](../packages/goal/goal ) | - | - | - | Folds revisioned objective state from the session log and keeps live continuation activation process-local. |
feat(subprocess): migrate lsp-local, subagent-acp, and the env scrubs onto the seam
Review direction (tianyicui, PR #660): in a stacked PR, change all other
process-running places to use the new service.
- lsp-local: LspConnection spawns through ctx.subprocess (piped protocol
streams + a no-spill collected stderr tail); its private process-tree
helpers (POSIX group signalling, Windows taskkill, liveness polling) are
deleted in favor of the seam's handle verbs, and its buildChildEnv now
rides scrubbedParentEnv (LSP children also stop inheriting stale DSH_*).
The plugin injects 'subprocess'; compositions/tests mount
dsh-subprocess-local.
- subagent-acp: the ACP child spawns through the seam (piped ndjson streams,
inherited stderr); spawn failure surfaces through done-rejection into the
same startup race; disposal is handle.dispose with the plugin's configured
graces. dsh-subagent-subprocess is DELETED — its dispose ladder and scrub
are the seam's, and the isolated-config-dir helper had no consumer.
- mcp-client, pty-local, sdk-helper: adopt scrubbedParentEnv as the one
scrub definition (their spawns stay put by ownership: the MCP SDK and
node-pty own those calls; the SDK wizard runs outside any composition).
- Coverage: per-file 100% over every touched src file, with each v8 ignore
carrying a platform or contract reason; new suites cover stdio
dispositions, the dispose ladder tiers, injected-win32 tree semantics,
waitForExit, settled-kill/terminate no-ops, and spawn-failure disposal.
- Docs: consumer-migration Agent Note (en; zh follows in this PR), seam note
updated in place, subprocess.md rewritten for the reshaped vocabulary
(type-equiv re-registered), READMEs and SERVICE_ROLES updated, taskkill
added to knip ignoreBinaries.
2026-07-26 15:27:59 +08:00
| `ctx.subprocess` | `seam` | [`subprocess` ](../packages/subprocess/subprocess ) | [`subprocess-local` ](../packages/subprocess/subprocess-local ) | [`bash-local` ](../packages/bash/bash-local ), [`bash-sandbox` ](../packages/bash/bash-sandbox ), [`lsp-local` ](../packages/lsp/lsp-local ), [`subagent-acp` ](../packages/subagent/subagent-acp ) | - | The bash executors, the LSP host, and the ACP subagent backend spawn their children through ctx.subprocess; the service owns tree lifetime, stdio dispositions (pipes, inherit, bounded spill-backed collection), and kill escalation. |
2026-08-02 21:46:53 +08:00
| `ctx.bash` | `seam` | [`bash` ](../packages/bash/bash ) | [`bash-local` ](../packages/bash/bash-local ), [`bash-sandbox` ](../packages/bash/bash-sandbox ), [`pwsh-local` ](../packages/bash/pwsh-local ) | [`tool-bash` ](../packages/bash/tool-bash ), [`tool-pwsh` ](../packages/bash/tool-pwsh ), [`hooks-claude` ](../packages/hooks/hooks-claude ), [`hooks-codex` ](../packages/hooks/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.bashEnv` | `core` | [`bash-env` ](../packages/bash/bash-env ) | - | [`tool-bash` ](../packages/bash/tool-bash ), [`tool-pwsh` ](../packages/bash/tool-pwsh ) | - | Plugins declare effect-scoped DSH_* facts; each shell tool collects one trusted snapshot per execution and its executor rebuilds the namespace. |
2026-07-21 16:01:00 +08:00
| `ctx.pty` | `seam` | [`pty` ](../packages/pty/pty ) | [`pty-local` ](../packages/pty/pty-local ) | [`tool-pty` ](../packages/pty/tool-pty ) | - | The registry owns exact-Agent session identity and cleanup; backends own terminal mechanics, while tool-pty exposes the owner-scoped model surface. |
| `ctx.sandbox` | `seam` | [`sandbox` ](../packages/sandbox/sandbox ) | [`sandbox-local` ](../packages/sandbox/sandbox-local ) | [`bash-sandbox` ](../packages/bash/bash-sandbox ), [`pty-local` ](../packages/pty/pty-local ) | - | 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` ](../packages/sandbox/sandbox-policy ) | - | [`bash-sandbox` ](../packages/bash/bash-sandbox ), [`fs-sandbox` ](../packages/fs/fs-sandbox ), [`pty-local` ](../packages/pty/pty-local ) | - | 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. |
2026-07-24 01:40:25 +08:00
| `ctx.approval` | `seam` | `approval` | [`acp` ](../packages/acp/acp ) | [`tools` ](../packages/core/tools ), [`tool-bash` ](../packages/bash/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.permission` | `core` | [`permission` ](../packages/ui/permission ) | - | - | - | 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. |
feat: Code Mode — the registry's mode config, the SDK codegen, and the run_code bridge
The dsh-tools half of the Code Mode RFC (its fourth, final change): the
registry gains its first config — mode: native | code | both — and OWNS how
its tools reach the model. 'code' contributes exactly one wire tool,
run_code, plus a lazy tools:sdk prompt section declaring every other tool
as a generated TypeScript API (jsonSchemaToTs: total over the defineTool
subset, unknown degradation, lexicographic byte-identical rendering);
'both' ships both representations; 'native' is byte-for-byte the old
behavior. Non-native modes fail every assembly loudly without a
typescript-language ctx.codeRuntime.
run_code's dispatch bridge: JSON-normalizes each binding argument before
dispatch (what dispatches is what the tool/code-dispatch event logs — the
append can never fail on payload shape; BigInt/circulars reject that one
call), serializes all program tool calls through a per-run queue (even
Promise.all — no concurrency-safety metadata yet), routes every sub-call
through tools/pre-execute → tools/post-execute (a deny rejects the
program-side promise), drops sub-call additionalContext (no safe outlet
mid-run; pinned), owns a run-scoped abort that follows the outer signal in
and fires on settlement (in-flight sub-dispatch aborted, queued abandoned,
queue drained before returning), and converts a failed run into
CodeRunFailedError → a structured isError carrying kind + captured logs.
tool/code-dispatch joins SessionEventMap by declaration merging (log-only;
deriveMessages ignores it).
The composed surface: the tools config forwards through agent-core and
both app packages; examples/code-agent + demo:code run the worker runtime
under mode code (keyless boot smoke + a with-key e2e proving the collapsed
[run_code] header, the dispatch events, and the file the program wrote);
two new snapshot scenarios (code-mode-turn, both-mode-turn) record the SDK
section, collapsed header, dispatch events, and result card — each its own
header-pinning class (the harness gains per-scenario config overlays and
per-class pins). Catalogs, graphs, cookbook, hooks-bridge notes, and the
RFC (moved to implemented/, restructured to decision-era headings) updated
in the same change.
2026-07-08 12:58:23 +08:00
| `ctx.codeRuntime` | `seam` | [`code-runtime` ](../packages/code-runtime/code-runtime ) | [`code-runtime-worker` ](../packages/code-runtime/code-runtime-worker ) | [`tools` ](../packages/core/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). |
feat(sandbox): cross-family file sandbox — one policy home, sandboxed fs provider, fs escalation parity
Extend SandboxMode enforcement from bash to the filesystem tools, the sandbox
RFC's deferred cross-family phase.
- dsh-sandbox-policy (new, ctx.sandboxPolicy): the single home for the
deployment default mode + workspaceRoot and the per-session override event,
renamed bash/sandbox-mode -> sandbox/mode and moved here with its fold/setter.
Decouples the bash seam from dsh-session.
- dsh-fs-sandbox (new): SandboxedFileSystem extends LocalFileSystem and fences
write/edit by the per-call mode (read-only denies, workspace-write contains to
the workspace + temp roots via the shared writableRoots, danger passes
through); reads pass through. Structured FS_SANDBOX_DENIED; in-lock parent
re-canonicalization. A policy fence in trusted code, not a kernel boundary.
- dsh-sandbox: the shared escalation kit (writableRoots, the strictly-wider
ladder, denial/hint markers, approveEscalation) both tool families use;
approveEscalation takes a structural approver so dsh-sandbox gains no
approval/agent dependency, and both tools stay duplication-free.
- tool-fs: write/edit advertise sandbox_permissions/justification under a
confining ctx.fs, map FS_SANDBOX_DENIED to the shared [sandbox: ...] marker,
and resolve the same one-approved-wider retry.
- examples/acp-agent: composes sandbox-policy + fs-sandbox, drops the gating
that disabled the fs stack under confined modes.
RFC docs/rfc/implemented/feature/2026-07-14-cross-family-fs-sandbox.md; the old
sandbox RFC's In-process/deferred/FAQ sections updated to shipped fact.
2026-07-14 20:05:57 +08:00
| `ctx.fs` | `seam` | [`fs` ](../packages/fs/fs ) | [`fs-local` ](../packages/fs/fs-local ), [`fs-sandbox` ](../packages/fs/fs-sandbox ) | [`tool-fs` ](../packages/fs/tool-fs ) | [`fs-policy` ](../packages/fs/fs-policy ) | tool-fs executes read/write/edit through ctx.fs; fs-sandbox fences mutations by the shared sandbox mode; fs-policy contributes observed-state checks through the fs/* event gate. |
2026-07-15 16:50:44 +08:00
| `ctx.compact` | `seam` | [`compact` ](../packages/compact/compact ) | [`compact-basic` ](../packages/compact/compact-basic ) | [`compact-basic` ](../packages/compact/compact-basic ) | - | The basic backend consumes post-step pressure and request-error recovery events; a model-facing compact tool remains deferred. |
2026-07-30 21:21:14 +08:00
| `ctx.subagents` | `seam` | [`subagent` ](../packages/subagent/subagent ) | [`subagent-spawn` ](../packages/subagent/subagent-spawn ), [`subagent-fork` ](../packages/subagent/subagent-fork ), [`subagent-acp` ](../packages/subagent/subagent-acp ) | [`tool-subagent` ](../packages/subagent/tool-subagent ), [`tool-subagent-control` ](../packages/subagent/tool-subagent-control ), [`tool-ralph` ](../packages/workflow/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. |
2026-07-26 05:13:39 +08:00
| `ctx.tasks` | `seam` | [`tasks` ](../packages/tasks/tasks ) | [`tasks-local` ](../packages/tasks/tasks-local ) | [`tool-bash` ](../packages/bash/tool-bash ), [`tool-pty` ](../packages/pty/tool-pty ), [`tool-subagent` ](../packages/subagent/tool-subagent ), [`tool-tasks` ](../packages/tasks/tool-tasks ) | - | Producers (background bash, PTY sends, and subagent delegations) register running work; tool-tasks is the model-facing control surface that reads, lists, and kills it; tasks-local is the process-local registry. |
2026-07-05 01:25:58 +08:00
| `ctx.web` | `seam` | [`web` ](../packages/web/web ) | [`web-search-exa` ](../packages/web/web-search-exa ), [`web-search-perplexity` ](../packages/web/web-search-perplexity ), [`web-search-deepseek` ](../packages/web/web-search-deepseek ), [`web-fetch-local` ](../packages/web/web-fetch-local ) | [`tool-web` ](../packages/web/tool-web ) | - | Search and fetch providers register into one ctx.web seam; tool-web owns the stable model-facing names. |
2026-07-13 11:07:27 +08:00
| `ctx.spillStore` | `seam` | [`spill` ](../packages/spill/spill ) | [`spill-local` ](../packages/spill/spill-local ) | [`spill-policy` ](../packages/spill/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. |
2026-07-29 02:11:31 +08:00
| `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). |
2026-07-25 02:15:58 +08:00
| `ctx.httpServer` | `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.clientModuleHost` | `core` | `modules` | - | `hmr` | - | Composes the __DSH_BOOT__ entry graph from an incremental dshClient scan, serves plugin bundles, and notifies rebuilt/graph-changed subscribers. |
2026-07-20 00:51:19 +08:00
| `ctx.workflows` | `seam` | [`workflow` ](../packages/workflow/workflow ) | [`workflow-workerthread` ](../packages/workflow/workflow-workerthread ) | [`tool-workflow` ](../packages/workflow/tool-workflow ), [`tool-ralph` ](../packages/workflow/tool-ralph ) | - | One engine per context (bash shape, no named-provider registry); the general workflow and fixed Ralph consumers start runs whose agent() calls fan out through ctx.subagents. |
2026-07-05 02:54:01 +08:00
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.