dsh-plugin-dev-kb 1.4.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/README.en.md +6 -6
- package/README.md +10 -5
- package/kb/INDEX.md +8 -4
- package/kb/extra/AGENTS.md +4 -3
- package/kb/extra/agent-lifecycle.md +91 -0
- package/kb/extra/agent-lifecycle.zh.md +93 -0
- package/kb/extra/api-gateway.md +172 -0
- package/kb/extra/api-gateway.zh.md +178 -0
- package/kb/extra/architecture.md +165 -0
- package/kb/extra/architecture.zh.md +169 -0
- package/kb/extra/capability-seams.md +714 -0
- package/kb/extra/capability-seams.zh.md +716 -0
- package/kb/extra/cli-help.md +203 -0
- package/kb/extra/cli-help.zh.md +205 -0
- package/kb/extra/config-catalog.md +4801 -0
- package/kb/extra/config-catalog.zh.md +4803 -0
- package/kb/extra/cookbook/adding-a-package.md +170 -0
- package/kb/extra/cookbook/adding-a-package.zh.md +170 -0
- package/kb/extra/cookbook/adding-a-plugin-preview.md +52 -0
- package/kb/extra/cookbook/adding-a-plugin-preview.zh.md +52 -0
- package/kb/extra/cookbook/adding-a-session-format-version.md +7 -5
- package/kb/extra/cookbook/adding-a-session-format-version.zh.md +7 -5
- package/kb/extra/cookbook/adding-a-settings-card.md +72 -0
- package/kb/extra/cookbook/adding-a-settings-card.zh.md +72 -0
- package/kb/extra/cookbook/adding-a-tool.md +101 -0
- package/kb/extra/cookbook/adding-a-tool.zh.md +103 -0
- package/kb/extra/cookbook/adding-an-llm-adapter.md +43 -0
- package/kb/extra/cookbook/adding-an-llm-adapter.zh.md +43 -0
- package/kb/extra/cookbook/extension-cookbook.md +132 -0
- package/kb/extra/cookbook/extension-cookbook.zh.md +136 -0
- package/kb/extra/cookbook/reviewing-persistence-type-changes.md +11 -9
- package/kb/extra/cookbook/reviewing-persistence-type-changes.zh.md +11 -9
- package/kb/extra/cordis-api/context.md +364 -0
- package/kb/extra/cordis-api/context.zh.md +366 -0
- package/kb/extra/cordis-api/events.md +207 -0
- package/kb/extra/cordis-api/events.zh.md +209 -0
- package/kb/extra/cordis-api/fiber.md +375 -0
- package/kb/extra/cordis-api/fiber.zh.md +377 -0
- package/kb/extra/cordis-api/inherited.md +38 -0
- package/kb/extra/cordis-api/registry.md +152 -0
- package/kb/extra/cordis-api/registry.zh.md +154 -0
- package/kb/extra/cordis-api/service.md +102 -0
- package/kb/extra/cordis-api/service.zh.md +104 -0
- package/kb/extra/cordis-tutorial/01-first-plugin.md +95 -0
- package/kb/extra/cordis-tutorial/01-first-plugin.zh.md +95 -0
- package/kb/extra/cordis-tutorial/02-lifecycle-and-effects.md +98 -0
- package/kb/extra/cordis-tutorial/02-lifecycle-and-effects.zh.md +98 -0
- package/kb/extra/cordis-tutorial/03-services.md +98 -0
- package/kb/extra/cordis-tutorial/03-services.zh.md +98 -0
- package/kb/extra/cordis-tutorial/04-events.md +144 -0
- package/kb/extra/cordis-tutorial/04-events.zh.md +144 -0
- package/kb/extra/cordis-tutorial/05-config.md +111 -0
- package/kb/extra/cordis-tutorial/05-config.zh.md +111 -0
- package/kb/extra/cordis-tutorial/06-composition-and-hmr.md +113 -0
- package/kb/extra/cordis-tutorial/06-composition-and-hmr.zh.md +113 -0
- package/kb/extra/cordis-tutorial/07-into-the-harness.md +108 -0
- package/kb/extra/cordis-tutorial/07-into-the-harness.zh.md +108 -0
- package/kb/extra/cordis-tutorial/index.md +60 -0
- package/kb/extra/cordis-tutorial/index.zh.md +62 -0
- package/kb/extra/deepseek-llm-api-wire-extensions.md +5 -5
- package/kb/extra/deepseek-llm-api-wire-extensions.zh.md +5 -5
- package/kb/extra/defensive-patterns/README.md +25 -0
- package/kb/extra/defensive-patterns/README.zh.md +27 -0
- package/kb/extra/defensive-patterns/client-components.md +493 -0
- package/kb/extra/defensive-patterns/client-components.zh.md +495 -0
- package/kb/extra/defensive-patterns/conversation-and-session.md +316 -0
- package/kb/extra/defensive-patterns/conversation-and-session.zh.md +316 -0
- package/kb/extra/defensive-patterns/general.md +222 -0
- package/kb/extra/defensive-patterns/general.zh.md +252 -0
- package/kb/extra/defensive-patterns/package-surface.md +231 -0
- package/kb/extra/defensive-patterns/package-surface.zh.md +231 -0
- package/kb/extra/defensive-patterns/remote-and-api.md +115 -0
- package/kb/extra/defensive-patterns/remote-and-api.zh.md +115 -0
- package/kb/extra/development.md +31 -11
- package/kb/extra/development.zh.md +32 -11
- package/kb/extra/event-producer-consumer.md +40 -39
- package/kb/extra/event-producer-consumer.zh.md +40 -39
- package/kb/extra/experimental-persistence-catalog.md +17 -0
- package/kb/extra/experimental-persistence-catalog.zh.md +17 -0
- package/kb/extra/glossary.md +1 -0
- package/kb/extra/glossary.zh.md +1 -0
- package/kb/extra/i18n/style-samples.md +2 -2
- package/kb/extra/i18n/terminology.md +1 -0
- package/kb/extra/module-graph.md +274 -195
- package/kb/extra/module-graph.zh.md +274 -195
- package/kb/extra/persistence-catalog.md +9140 -0
- package/kb/extra/persistence-catalog.zh.md +9142 -0
- package/kb/extra/persistence-changes/2026-09-13-working-directory.md +48 -0
- package/kb/extra/persistence-changes/2026-09-13-working-directory.zh.md +48 -0
- package/kb/extra/persistence-changes/2026-09-16-session-format-v4.md +2 -2
- package/kb/extra/persistence-changes/2026-09-16-session-format-v4.zh.md +2 -2
- package/kb/extra/persistence-changes/2026-09-19-external-subagent-catalog.md +48 -0
- package/kb/extra/persistence-changes/2026-09-19-external-subagent-catalog.zh.md +48 -0
- package/kb/extra/persistence-changes/2026-09-30-job-session-lifecycle.md +52 -0
- package/kb/extra/persistence-changes/2026-09-30-job-session-lifecycle.zh.md +52 -0
- package/kb/extra/persistence-changes/2026-10-05-ptc-operation-metadata.md +48 -0
- package/kb/extra/persistence-changes/2026-10-05-ptc-operation-metadata.zh.md +48 -0
- package/kb/extra/persistence-changes/2026-10-05-working-directory-attribution.md +60 -0
- package/kb/extra/persistence-changes/2026-10-05-working-directory-attribution.zh.md +60 -0
- package/kb/extra/persistence-changes/2026-10-07-title-reasoning-effort.md +48 -0
- package/kb/extra/persistence-changes/2026-10-07-title-reasoning-effort.zh.md +48 -0
- package/kb/extra/persistence-changes/2026-10-13-deepseek-search-thinking.md +48 -0
- package/kb/extra/persistence-changes/2026-10-13-deepseek-search-thinking.zh.md +48 -0
- package/kb/extra/persistence-changes/2026-10-13-user-rpc-principal.md +60 -0
- package/kb/extra/persistence-changes/2026-10-13-user-rpc-principal.zh.md +60 -0
- package/kb/extra/persistence-changes/README.md +12 -10
- package/kb/extra/persistence-changes/README.zh.md +12 -10
- package/kb/extra/persistence-changes/historical-formats/README.md +1 -1
- package/kb/extra/persistence-changes/historical-formats/README.zh.md +1 -1
- package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.2.md +50 -50
- package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.2.zh.md +50 -50
- package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.3.md +14 -14
- package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.3.zh.md +14 -14
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.7.md +3 -3
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.7.zh.md +3 -3
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.8.md +10 -10
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.8.zh.md +10 -10
- package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.1.md +3 -3
- package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.1.zh.md +3 -3
- package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.2.md +13 -13
- package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.2.zh.md +13 -13
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.1.md +63 -63
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.1.zh.md +63 -63
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.2.md +54 -54
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.2.zh.md +54 -54
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.4.md +7 -7
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.4.zh.md +7 -7
- package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.1.md +27 -27
- package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.1.zh.md +27 -27
- package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.2.md +4 -4
- package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.2.zh.md +4 -4
- package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.1.md +27 -27
- package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.1.zh.md +27 -27
- package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.2.md +7 -7
- package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.2.zh.md +7 -7
- package/kb/extra/session-format-status.md +6 -6
- package/kb/extra/session-format-status.zh.md +6 -6
- package/kb/extra/subsystems/README.md +76 -0
- package/kb/extra/subsystems/README.zh.md +76 -0
- package/kb/extra/subsystems/agent-team.md +10 -10
- package/kb/extra/subsystems/agent-team.zh.md +10 -10
- package/kb/extra/subsystems/approval.md +170 -0
- package/kb/extra/subsystems/approval.zh.md +170 -0
- package/kb/extra/subsystems/boot.md +128 -4
- package/kb/extra/subsystems/boot.zh.md +128 -4
- package/kb/extra/subsystems/claude-code-mods.md +1 -1
- package/kb/extra/subsystems/claude-code-mods.zh.md +1 -1
- package/kb/extra/subsystems/client-modules.md +198 -0
- package/kb/extra/subsystems/client-modules.zh.md +198 -0
- package/kb/extra/subsystems/client-resources.md +92 -0
- package/kb/extra/subsystems/client-resources.zh.md +92 -0
- package/kb/extra/subsystems/commands.md +223 -0
- package/kb/extra/subsystems/commands.zh.md +223 -0
- package/kb/extra/subsystems/compaction.md +284 -0
- package/kb/extra/subsystems/compaction.zh.md +284 -0
- package/kb/extra/subsystems/computer-use.md +3 -0
- package/kb/extra/subsystems/computer-use.zh.md +3 -0
- package/kb/extra/subsystems/conversation.md +301 -0
- package/kb/extra/subsystems/conversation.zh.md +303 -0
- package/kb/extra/subsystems/core.md +1113 -0
- package/kb/extra/subsystems/core.zh.md +1125 -0
- package/kb/extra/subsystems/credentials.md +493 -0
- package/kb/extra/subsystems/credentials.zh.md +493 -0
- package/kb/extra/subsystems/filesystem.md +530 -0
- package/kb/extra/subsystems/filesystem.zh.md +530 -0
- package/kb/extra/subsystems/goal.md +313 -0
- package/kb/extra/subsystems/goal.zh.md +313 -0
- package/kb/extra/subsystems/jobs.md +554 -0
- package/kb/extra/subsystems/jobs.zh.md +554 -0
- package/kb/extra/subsystems/llm-streaming.md +1196 -0
- package/kb/extra/subsystems/llm-streaming.zh.md +1202 -0
- package/kb/extra/subsystems/lsp.md +202 -0
- package/kb/extra/subsystems/lsp.zh.md +202 -0
- package/kb/extra/subsystems/permission-presets.md +167 -0
- package/kb/extra/subsystems/permission-presets.zh.md +167 -0
- package/kb/extra/subsystems/persistence.md +418 -0
- package/kb/extra/subsystems/persistence.zh.md +418 -0
- package/kb/extra/subsystems/plan.md +87 -0
- package/kb/extra/subsystems/plan.zh.md +87 -0
- package/kb/extra/subsystems/product-telemetry.md +4 -2
- package/kb/extra/subsystems/product-telemetry.zh.md +4 -2
- package/kb/extra/subsystems/ptc-runtime.md +250 -0
- package/kb/extra/subsystems/ptc-runtime.zh.md +250 -0
- package/kb/extra/subsystems/sandbox.md +221 -0
- package/kb/extra/subsystems/sandbox.zh.md +221 -0
- package/kb/extra/subsystems/schedule.md +550 -0
- package/kb/extra/subsystems/schedule.zh.md +550 -0
- package/kb/extra/subsystems/scope.md +59 -0
- package/kb/extra/subsystems/scope.zh.md +61 -0
- package/kb/extra/subsystems/session-projection.md +356 -0
- package/kb/extra/subsystems/session-projection.zh.md +356 -0
- package/kb/extra/subsystems/session-query.md +511 -0
- package/kb/extra/subsystems/session-query.zh.md +511 -0
- package/kb/extra/subsystems/session-reference.md +224 -0
- package/kb/extra/subsystems/session-reference.zh.md +224 -0
- package/kb/extra/subsystems/session-telemetry.md +212 -0
- package/kb/extra/subsystems/session-telemetry.zh.md +212 -0
- package/kb/extra/subsystems/session-title.md +213 -0
- package/kb/extra/subsystems/session-title.zh.md +213 -0
- package/kb/extra/subsystems/session.md +1339 -0
- package/kb/extra/subsystems/session.zh.md +1343 -0
- package/kb/extra/subsystems/settings.md +155 -0
- package/kb/extra/subsystems/settings.zh.md +155 -0
- package/kb/extra/subsystems/shell.md +314 -0
- package/kb/extra/subsystems/shell.zh.md +314 -0
- package/kb/extra/subsystems/sidebar-right.md +160 -0
- package/kb/extra/subsystems/sidebar-right.zh.md +160 -0
- package/kb/extra/subsystems/skills.md +352 -0
- package/kb/extra/subsystems/skills.zh.md +352 -0
- package/kb/extra/subsystems/slots.md +200 -0
- package/kb/extra/subsystems/slots.zh.md +204 -0
- package/kb/extra/subsystems/spill.md +124 -0
- package/kb/extra/subsystems/spill.zh.md +124 -0
- package/kb/extra/subsystems/ssh.md +22 -11
- package/kb/extra/subsystems/ssh.zh.md +22 -11
- package/kb/extra/subsystems/storage.md +259 -0
- package/kb/extra/subsystems/storage.zh.md +259 -0
- package/kb/extra/subsystems/subagent.md +686 -0
- package/kb/extra/subsystems/subagent.zh.md +688 -0
- package/kb/extra/subsystems/subprocess.md +321 -0
- package/kb/extra/subsystems/subprocess.zh.md +321 -0
- package/kb/extra/subsystems/system-prompt.md +254 -0
- package/kb/extra/subsystems/system-prompt.zh.md +254 -0
- package/kb/extra/subsystems/terminal.md +184 -0
- package/kb/extra/subsystems/terminal.zh.md +184 -0
- package/kb/extra/subsystems/token-meter.md +106 -0
- package/kb/extra/subsystems/token-meter.zh.md +106 -0
- package/kb/extra/subsystems/tools.md +747 -0
- package/kb/extra/subsystems/tools.zh.md +747 -0
- package/kb/extra/subsystems/translation.md +103 -0
- package/kb/extra/subsystems/translation.zh.md +103 -0
- package/kb/extra/subsystems/typert.md +690 -0
- package/kb/extra/subsystems/typert.zh.md +690 -0
- package/kb/extra/subsystems/user-questions.md +307 -0
- package/kb/extra/subsystems/user-questions.zh.md +307 -0
- package/kb/extra/subsystems/web-client.md +100 -0
- package/kb/extra/subsystems/web-client.zh.md +100 -0
- package/kb/extra/subsystems/web-server.md +302 -0
- package/kb/extra/subsystems/web-server.zh.md +302 -0
- package/kb/extra/subsystems/web.md +206 -0
- package/kb/extra/subsystems/web.zh.md +206 -0
- package/kb/extra/subsystems/webhook.md +1 -1
- package/kb/extra/subsystems/webhook.zh.md +1 -1
- package/kb/extra/subsystems/workflow.md +278 -0
- package/kb/extra/subsystems/workflow.zh.md +278 -0
- package/kb/extra/subsystems/working-directory.md +64 -0
- package/kb/extra/subsystems/working-directory.zh.md +64 -0
- package/kb/extra/subsystems/workspace.md +647 -0
- package/kb/extra/subsystems/workspace.zh.md +647 -0
- package/kb/extra/subsystems/worktrees.md +76 -0
- package/kb/extra/subsystems/worktrees.zh.md +76 -0
- package/kb/extra/testing.md +1 -1
- package/kb/extra/testing.zh.md +1 -1
- package/kb/extra/tool-catalog.md +2824 -0
- package/kb/extra/tool-catalog.zh.md +2832 -0
- package/kb/extra/tool-execution-pipeline.md +65 -0
- package/kb/extra/tool-execution-pipeline.zh.md +67 -0
- package/kb/extra/ui-radius.md +6 -4
- package/kb/extra/ui-radius.zh.md +6 -4
- package/kb/extra/upgrade-guide/v0.2.0-rc.2/bundled-python-tests/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.0-rc.2/bundled-python-tests/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.0-rc.2/primary-runtime-python-aliases/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.0-rc.2/primary-runtime-python-aliases/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/deepseek-model-discovery/guide.md +17 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/deepseek-model-discovery/guide.zh.md +17 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/desktop-test-auth-popup/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/desktop-test-auth-popup/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/experimental-package-composition/guide.md +28 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/experimental-package-composition/guide.zh.md +28 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/instruction-home-override/guide.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/instruction-home-override/guide.zh.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/job-id-identity/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/job-id-identity/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/jsonl-persistence-plugin/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/jsonl-persistence-plugin/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/mock-messages-events/guide.md +17 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/mock-messages-events/guide.zh.md +17 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/native-subagent-bundle-tools/guide.md +31 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/native-subagent-bundle-tools/guide.zh.md +31 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/new-session-generations/guide.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/new-session-generations/guide.zh.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/plugin-option-placement/guide.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/plugin-option-placement/guide.zh.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/python-optional-resources/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/python-optional-resources/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/python-ptc-sandbox/guide.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/python-ptc-sandbox/guide.zh.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/session-title-adapters/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/session-title-adapters/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/session-title-provider-strategy/guide.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/session-title-provider-strategy/guide.zh.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/ssh-helper-launch/guide.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/ssh-helper-launch/guide.zh.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/subagent-activations/guide.md +59 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/subagent-activations/guide.zh.md +59 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/subagent-preset-composition/guide.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/subagent-preset-composition/guide.zh.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/team-direct-inbox/guide.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/team-direct-inbox/guide.zh.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/terminal-command-labels/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/terminal-command-labels/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/tool-presentation-mode/guide.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/tool-presentation-mode/guide.zh.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/web-listener-trust-config/guide.md +36 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/web-listener-trust-config/guide.zh.md +36 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/working-directory/guide.md +25 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/working-directory/guide.zh.md +25 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/deepseek-account-identity-watch/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/deepseek-account-identity-watch/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/deepseek-account-model-catalog/guide.md +27 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/deepseek-account-model-catalog/guide.zh.md +27 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/desktop-font-size-shortcuts/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/desktop-font-size-shortcuts/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/from-default-profile-replaces-target/guide.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/from-default-profile-replaces-target/guide.zh.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/operator-connect/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/operator-connect/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/pi-ai-azure-provider/guide.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/pi-ai-azure-provider/guide.zh.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/pi-ai-model-discovery/guide.md +17 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/pi-ai-model-discovery/guide.zh.md +17 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/plugin-install-over-installed/guide.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/plugin-install-over-installed/guide.zh.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/sdk-minimal-image-compaction/guide.md +32 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/sdk-minimal-image-compaction/guide.zh.md +32 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/stored-credentials-precedence/guide.md +25 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/stored-credentials-precedence/guide.zh.md +25 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.3/plugin-engines-dsh/guide.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.3/plugin-engines-dsh/guide.zh.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.4/account-notification-fields/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.4/account-notification-fields/guide.zh.md +18 -0
- package/kb/meta/search-index.json +1932 -366
- package/kb/meta/source.json +9 -8
- package/kb/site/develop/basic/publish.md +3 -1
- package/kb/site/en/develop/basic/publish.md +3 -1
- package/kb/site/en/guide/github-review.md +7 -10
- package/kb/site/en/guide/plugin-market.md +151 -0
- package/kb/site/en/guide/providers.md +27 -4
- package/kb/site/en/guide/public-deployments.md +10 -6
- package/kb/site/en/guide/python-sdk.md +8 -9
- package/kb/site/en/reference/api-gateway.md +10 -3
- package/kb/site/en/reference/capability-seams.md +71 -24
- package/kb/site/en/reference/config-catalog.md +452 -191
- package/kb/site/en/reference/experimental-persistence-catalog.md +20 -0
- package/kb/site/en/reference/index.md +11 -12
- package/kb/site/en/reference/persistence-catalog.md +552 -192
- package/kb/site/en/reference/subsystems/client-modules.md +14 -0
- package/kb/site/en/reference/subsystems/conversation.md +14 -0
- package/kb/site/en/reference/subsystems/core.md +3 -1
- package/kb/site/en/reference/subsystems/credentials.md +13 -12
- package/kb/site/en/reference/subsystems/index.md +4 -1
- package/kb/site/en/reference/subsystems/jobs.md +62 -7
- package/kb/site/en/reference/subsystems/llm-streaming.md +82 -15
- package/kb/site/en/reference/subsystems/persistence.md +2 -0
- package/kb/site/en/reference/subsystems/plan.md +1 -1
- package/kb/site/en/reference/subsystems/ptc-runtime.md +24 -6
- package/kb/site/en/reference/subsystems/session-query.md +2 -0
- package/kb/site/en/reference/subsystems/session-title.md +14 -5
- package/kb/site/en/reference/subsystems/session.md +59 -14
- package/kb/site/en/reference/subsystems/sidebar-right.md +2 -0
- package/kb/site/en/reference/subsystems/skills.md +2 -2
- package/kb/site/en/reference/subsystems/slots.md +80 -83
- package/kb/site/en/reference/subsystems/subagent.md +175 -247
- package/kb/site/en/reference/subsystems/system-prompt.md +32 -2
- package/kb/site/en/reference/subsystems/tools.md +3 -3
- package/kb/site/en/reference/subsystems/typert.md +222 -17
- package/kb/site/en/reference/subsystems/web-client.md +1 -1
- package/kb/site/en/reference/subsystems/web-server.md +87 -11
- package/kb/site/en/reference/subsystems/web.md +2 -2
- package/kb/site/en/reference/subsystems/workflow.md +1 -1
- package/kb/site/en/reference/subsystems/workspace.md +25 -37
- package/kb/site/en/reference/tool-catalog.md +156 -51
- package/kb/site/guide/github-review.md +7 -10
- package/kb/site/guide/plugin-market.md +151 -0
- package/kb/site/guide/providers.md +27 -4
- package/kb/site/guide/public-deployments.md +10 -6
- package/kb/site/guide/python-sdk.md +8 -9
- package/kb/site/reference/api-gateway.md +16 -3
- package/kb/site/reference/capability-seams.md +71 -24
- package/kb/site/reference/config-catalog.md +452 -191
- package/kb/site/reference/experimental-persistence-catalog.md +20 -0
- package/kb/site/reference/index.md +11 -12
- package/kb/site/reference/persistence-catalog.md +552 -192
- package/kb/site/reference/subsystems/client-modules.md +14 -0
- package/kb/site/reference/subsystems/conversation.md +16 -0
- package/kb/site/reference/subsystems/core.md +5 -1
- package/kb/site/reference/subsystems/credentials.md +13 -12
- package/kb/site/reference/subsystems/index.md +4 -1
- package/kb/site/reference/subsystems/jobs.md +62 -7
- package/kb/site/reference/subsystems/llm-streaming.md +82 -15
- package/kb/site/reference/subsystems/persistence.md +2 -0
- package/kb/site/reference/subsystems/plan.md +1 -1
- package/kb/site/reference/subsystems/ptc-runtime.md +24 -6
- package/kb/site/reference/subsystems/scope.md +2 -0
- package/kb/site/reference/subsystems/session-query.md +2 -0
- package/kb/site/reference/subsystems/session-title.md +14 -5
- package/kb/site/reference/subsystems/session.md +59 -14
- package/kb/site/reference/subsystems/sidebar-right.md +2 -0
- package/kb/site/reference/subsystems/skills.md +2 -2
- package/kb/site/reference/subsystems/slots.md +84 -83
- package/kb/site/reference/subsystems/subagent.md +177 -251
- package/kb/site/reference/subsystems/system-prompt.md +32 -2
- package/kb/site/reference/subsystems/tools.md +3 -3
- package/kb/site/reference/subsystems/typert.md +222 -17
- package/kb/site/reference/subsystems/web-client.md +1 -1
- package/kb/site/reference/subsystems/web-server.md +87 -11
- package/kb/site/reference/subsystems/web.md +2 -2
- package/kb/site/reference/subsystems/workflow.md +1 -1
- package/kb/site/reference/subsystems/workspace.md +25 -37
- package/kb/site/reference/tool-catalog.md +160 -55
- package/package.json +2 -2
- package/skills/dsh-dev-sandbox.md +67 -0
- package/kb/extra/defensive-patterns.md +0 -33
- package/kb/extra/defensive-patterns.zh.md +0 -35
|
@@ -61,11 +61,23 @@ interface WebBootBatch {
|
|
|
61
61
|
}
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
+
```ts type-equiv
|
|
65
|
+
/** Host release identity; two releases are the same when both fields are equal. */
|
|
66
|
+
interface WebBootRelease {
|
|
67
|
+
/** Release version label. */
|
|
68
|
+
version: string
|
|
69
|
+
/** Source commit fixed in when the Host was built; absent when the build recorded none. */
|
|
70
|
+
commit?: string
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
64
74
|
```ts type-equiv
|
|
65
75
|
/** The composed client entry graph the host injects as `window.__DSH_BOOT__`. */
|
|
66
76
|
interface WebBootGraph {
|
|
67
77
|
/** Consistency anchor over the current entry and batch descriptors. */
|
|
68
78
|
rev: string
|
|
79
|
+
/** Host release identity; absent from a Host that publishes none. */
|
|
80
|
+
release?: WebBootRelease
|
|
69
81
|
/**
|
|
70
82
|
* Composed entries in module-graph order — a dynamic package row precedes
|
|
71
83
|
* rows whose `external` requests that package. Cordis activation order is
|
|
@@ -79,6 +91,8 @@ interface WebBootGraph {
|
|
|
79
91
|
|
|
80
92
|
Initial publication and HMR derive each row's `rev` from the entry's mtime, ctime, and size, without hashing executable bytes. The same artifacts retain their revisions across Host restarts. The initial descriptors partition rows into bootstrap and application scheduling phases, and either phase may contain several descriptors. Their URLs contain only the ordered package-resource list and a revision derived from those row revisions; phase names do not enter the route. Graph composition preserves row order while greedily splitting before the map-form URL exceeds 3 KiB, without concatenating scripts or reading maps. The graph revision hashes the entry and batch descriptors. `immediately` marks the stage-one registration barrier; rows within one combo share its script transport, while separate combos load independently.
|
|
81
93
|
|
|
94
|
+
`release` pairs this package's version with the source commit the client build fixes into the built Host artifact, and stays outside the graph revision. A page applies graphs and rebuilt frames only while the Host serves the page's boot release; another release waits for a page reload ([Host release changes](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/client/modules/README.md#host-release-changes)).
|
|
95
|
+
|
|
82
96
|
## The scan
|
|
83
97
|
|
|
84
98
|
A package joins the table by declaring `dsh.client` (`platform: 'web'`, optional `inject` edges, optional `immediately`) in its package.json and exporting its built bundle at `exports["./client"]`. Each live row resolves from its own Loader specifier and owning-tree `baseUrl`, through the same `loader.internal.resolveSync` implementation that imports its Host face when available. The nearest owning package manifest supplies the browser module id, so relative source and built overlays retain the package identity. Distinct active Loader sources resolving to one package name fail composition; after one source unloads, the surviving source supplies the row without a fiber restart.
|
|
@@ -251,10 +251,24 @@ export function apply(ctx: ClientContext): void {
|
|
|
251
251
|
|
|
252
252
|
`ConversationNodeDefinitionInput` accepts either this function or a read-only table from event type to matching function. Function-form registrations receive every event; table registrations receive only their listed types. The Registry copies table entries and precomputes ordered candidate Sets when registrations change, keeping candidate construction out of per-event dispatch. Replace a table by unregistering and registering again. Resolved `ConversationNodeDefinition` values retain a callable `match(event)` in both cases.
|
|
253
253
|
|
|
254
|
+
A match result with `exclusive: true` claims that event on the Definition's target. The assembler evaluates every match of the event before accepting any, so the outcome is independent of registration order: other Definitions of the claimed target build no Context for the event, and the target's unmatched-event fallback does not run. Definitions of other targets and Definitions without a target still receive it. Two claims on one target, or a claim from a Definition without a target, throw during dispatch; a claim returned by the fallback itself has no effect. A business Definition uses a claim to present one kind of message that a generic Definition of the same target would otherwise also present, such as a late question reply.
|
|
255
|
+
|
|
254
256
|
`buildLocationData(context, scope)` optionally publishes Definition-owned data onto an engine-owned Turn or Step. Use declaration merging to give each key a precise value type. Another Node in the same Location can consume that value through its constrained slot hook, such as `useTurnData(key)`, without receiving the Session or scanning `snapshot.chat.nodes`.
|
|
255
257
|
|
|
256
258
|
`target` and `buildViewNode(context)` declare one target-owned rendering contribution and must appear together. Preserve `context.key` as the React-facing identity, choose `anchorSeq` from the matched event ordering, and return only renderer-ready data. Once a target Node has been published, keep returning the same key; use `visibility: 'hidden'` when it must temporarily leave the visible flow rather than withdrawing it with `null`.
|
|
257
259
|
|
|
260
|
+
A Chat Node also chooses where its row stands through `groupTree`. Positions are ordered from the outermost inward, and a Node at a position also has the effect of every inner one. Chat process grouping, whole-Turn folding, and Turn-input detection read only this position; [group-tree.ts](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/client/ui-chat/src/client/contract/group-tree.ts) holds the complete contract.
|
|
261
|
+
|
|
262
|
+
| The Node is | Declare |
|
|
263
|
+
|---|---|
|
|
264
|
+
| A person's input claimed in Step 1; its Turn opens an exchange | `exchange` |
|
|
265
|
+
| Another input of its Turn, such as later human input or a trigger notice; before the process it is the opening input, after it the whole Turn stays open | `input` |
|
|
266
|
+
| A Turn notice that stays outside whole-Turn folding, such as an error or the completed-turn footer | `turn` |
|
|
267
|
+
| An independent row that whole-Turn folding still hides, such as a model retry | `process` |
|
|
268
|
+
| Ordinary process content that joins the surrounding step run | omit `groupTree` |
|
|
269
|
+
|
|
270
|
+
The [Chat business rules](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/client/ui-chat/src/client/conversation-nodes/README.md#process-grouping) list the positions the built-in Nodes declare. When a generic Definition of the same target also matches the event your Node presents, claim the event with `exclusive: true` as described above.
|
|
271
|
+
|
|
258
272
|
## Predecessor reads
|
|
259
273
|
|
|
260
274
|
Some Definitions need the latest earlier State of another business kind. `start` receives a `ConversationContextReader`; call `reader.previous<State>(kind)` there instead of accepting a Context collection or scanning events. The reader returns the nearest started Context before the current start `seq` as read-only data.
|
|
@@ -561,7 +561,9 @@ serviceFor<K extends string & keyof Context>(agent: { ctx: Context }, name: K):
|
|
|
561
561
|
*/
|
|
562
562
|
async recompose(ctx: Context, id: string): Promise<AgentPreset>
|
|
563
563
|
|
|
564
|
-
/** Select a preset before a session starts its first turn.
|
|
564
|
+
/** Select a preset before a session starts its first turn. A Session whose
|
|
565
|
+
* log records the preset and whose Agent runs its current revision keeps its
|
|
566
|
+
* composition; nothing is logged or announced.
|
|
565
567
|
* @param agent Target Agent.
|
|
566
568
|
* @param agentPreset Requested identity.
|
|
567
569
|
* @returns Committed preset identity.
|
|
@@ -19,6 +19,7 @@ A reference names one credential as a POSIX-style environment-variable name. The
|
|
|
19
19
|
type CredentialRef = Branded<'CredentialRef'>
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
+
<a id="resolution"></a>
|
|
22
23
|
## Resolution
|
|
23
24
|
|
|
24
25
|
`resolve(ref)` returns the value with the provider-defined source layer that supplied it, or `undefined` while unconfigured. Consumers re-resolve at each operation and never cache across operations — that per-operation read is the hot-update mechanism.
|
|
@@ -35,7 +36,7 @@ interface ResolvedCredential {
|
|
|
35
36
|
|
|
36
37
|
## Description
|
|
37
38
|
|
|
38
|
-
`describe(ref)` answers configuration surfaces without ever exposing a value: whether the reference resolves, from which layer, and whether `set` would currently succeed. The local provider
|
|
39
|
+
`describe(ref)` answers configuration surfaces without ever exposing a value: whether the reference resolves, from which layer, and whether `set` would currently succeed. The local provider ranks its managed file above the launch environment, so saving a value always creates the effective writable layer; removing it reveals the launch environment or `.env` fallback again.
|
|
39
40
|
|
|
40
41
|
```ts type-equiv
|
|
41
42
|
/**
|
|
@@ -59,7 +60,7 @@ interface CredentialInfo {
|
|
|
59
60
|
|
|
60
61
|
## Embedded Platform credentials
|
|
61
62
|
|
|
62
|
-
PlatformSession is a Host-only snapshot from getPlatformSession: origin names the configured Platform issuer and token contains its stored account credential. userId repeats the stable account ID from the most recent successful getProfile, and is null until one succeeds or when that profile carries no ID. The snapshot reuses that ID without issuing a profile request of its own, so an unknown ID leaves userId null instead of delaying the caller; a profile read whose stable ID first becomes available or changes notifies
|
|
63
|
+
PlatformSession is a Host-only snapshot from getPlatformSession: origin names the configured Platform issuer and token contains its stored account credential. userId repeats the stable account ID from the most recent successful getProfile, and is null until one succeeds or when that profile carries no ID. The snapshot reuses that ID without issuing a profile request of its own, so an unknown ID leaves userId null instead of delaying the caller; a profile read whose stable ID first becomes available or changes notifies only Host subscribers using `watch(signal, true)`, which lets identity consumers re-read the snapshot. Consumers key persistent browser storage by origin and userId and fall back to temporary storage for null. Signed-out accounts and credentials changed during the credential read return no snapshot; a mismatched issuer fails. Native consumers own document invalidation when credentials change. This snapshot is excluded from account-controller RPC, AccountView, and AccountDetails.
|
|
63
64
|
|
|
64
65
|
AccountDetails.balance projects recharge wallets in value and promotional wallets in bonusWallets, with independent currency and decimal balance strings. Failed queries contain no wallet arrays.
|
|
65
66
|
|
|
@@ -140,7 +141,7 @@ Source: [`packages/credentials/authorization/src/index.ts`](https://github.com/d
|
|
|
140
141
|
|
|
141
142
|
Abstract credential service over two key spaces that answer two questions.
|
|
142
143
|
|
|
143
|
-
A CredentialRef answers "what is behind this environment-variable name",
|
|
144
|
+
A CredentialRef answers "what is behind this environment-variable name": the provider-managed store first, then ambient fallbacks such as the process environment and `.env` files. One seam-wide rule binds that half: an empty stored value is absent everywhere — `resolve` skips it, `describe` reports it unconfigured — so a blank never masquerades as a configured secret.
|
|
144
145
|
|
|
145
146
|
A CredentialKey answers "what credential does this plugin hold for this id". Nothing can layer here — an authorization grant has no environment to be read from — so presence of the record is the whole fact, and modifyRecord is the only write path because a correct write depends on the current value (a token refresh is read-decide-replace under one lock).
|
|
146
147
|
|
|
@@ -164,10 +165,9 @@ abstract resolve(ref: CredentialRef): Promise<ResolvedCredential | undefined>
|
|
|
164
165
|
abstract describe(ref: CredentialRef): Promise<CredentialInfo>
|
|
165
166
|
|
|
166
167
|
/**
|
|
167
|
-
* Durably store one value in the provider-managed writable source.
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
* rejects an empty value (use {@link unset}).
|
|
168
|
+
* Durably store one value in the provider-managed writable source. The stored
|
|
169
|
+
* value takes precedence over ambient fallbacks, and empty values are
|
|
170
|
+
* rejected (use {@link unset}).
|
|
171
171
|
* @param ref - the reference to store.
|
|
172
172
|
* @param value - the non-empty secret value.
|
|
173
173
|
*/
|
|
@@ -175,8 +175,8 @@ abstract set(ref: CredentialRef, value: string): Promise<void>
|
|
|
175
175
|
|
|
176
176
|
/**
|
|
177
177
|
* Remove one reference from the provider-managed writable source; removing
|
|
178
|
-
* an absent reference is a no-op.
|
|
179
|
-
*
|
|
178
|
+
* an absent reference is a no-op. Ambient fallback layers may become
|
|
179
|
+
* effective again after removal.
|
|
180
180
|
* @param ref - the reference to remove.
|
|
181
181
|
*/
|
|
182
182
|
abstract unset(ref: CredentialRef): Promise<void>
|
|
@@ -280,8 +280,8 @@ abstract getState(): Promise<AccountView>
|
|
|
280
280
|
|
|
281
281
|
/**
|
|
282
282
|
* Query Platform profile independently of wallet balances.
|
|
283
|
-
* A ready result whose stable profile ID first becomes available or changes notifies watch
|
|
284
|
-
* consumers, so
|
|
283
|
+
* A ready result whose stable profile ID first becomes available or changes notifies identity-enabled watch
|
|
284
|
+
* consumers, so they re-read getPlatformSession; repeated IDs stay silent.
|
|
285
285
|
* @param client - identity of the requesting UI for this call.
|
|
286
286
|
* @returns profile outcome, or null if signed out or the grant changed during the query.
|
|
287
287
|
*/
|
|
@@ -336,9 +336,10 @@ abstract signOut(client: AccountClientMetadata): Promise<AccountView>
|
|
|
336
336
|
/**
|
|
337
337
|
* Subscribe to snapshots including a complete initial state.
|
|
338
338
|
* @param signal - subscription lifetime; ending it never cancels login.
|
|
339
|
+
* @param includeIdentityChanges - also notify when cached Platform identity changes; defaults to false.
|
|
339
340
|
* @returns complete snapshots as account state changes.
|
|
340
341
|
*/
|
|
341
|
-
abstract watch(signal: AbortSignal): AsyncIterable<AccountView>
|
|
342
|
+
abstract watch(signal: AbortSignal, includeIdentityChanges?: boolean): AsyncIterable<AccountView>
|
|
342
343
|
|
|
343
344
|
/**
|
|
344
345
|
* Resolve a credential only for the inference origin allowed by the provider.
|
|
@@ -22,6 +22,8 @@ One page per subsystem of the DeepSeek Harness: what it is, the data structures
|
|
|
22
22
|
| [deliverables.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/deliverables.md) | what a turn hands to the user: `PresentedFile` deliveries from `present` and the Host-served `WorkspaceChangesSummary` of changed files from git snapshots |
|
|
23
23
|
| [commands.md](./commands.md) | the human-command registry service: definitions, adapter discovery, direct invocation, results, and parsing views |
|
|
24
24
|
| [session.md](./session.md) | the full `SessionEventMap` variant catalog, `TurnEndReason`, `deriveMessages()`, execution enclosure, and standalone events |
|
|
25
|
+
| [working-directory.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/working-directory.md) | Session execution directories, durable changes, recovery, and user context |
|
|
26
|
+
| [worktrees.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/worktrees.md) | Experimental Git branch and checkout creation under existing permissions |
|
|
25
27
|
| [persistence.md](./persistence.md) | the durability seam: `SessionPersistence`, the JSONL provider, `session/flush`, crash recovery, `SessionHeader` |
|
|
26
28
|
| [settings.md](./settings.md) | the user-settings seam: `SettingsNamespace` registration, layered resolution (defaults → composition `base` → user document), owner scopes, hot commits |
|
|
27
29
|
| [credentials.md](./credentials.md) | the credential seam: `CredentialRef` references (never values) in configuration, per-operation resolution, UI-safe `CredentialInfo`, provider source layers |
|
|
@@ -51,7 +53,8 @@ One page per subsystem of the DeepSeek Harness: what it is, the data structures
|
|
|
51
53
|
| [compaction.md](./compaction.md) | the compaction seam: the `compaction/*` session events, `CompactionResult`, the `CompactionEngine` interface |
|
|
52
54
|
| [subagent.md](./subagent.md) | the subagent seam: the named-provider registry, `SubagentStartRequest`/`Result`/`Run`, the start-time-vs-runtime capability split |
|
|
53
55
|
| [voice-input.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/voice-input.md) | experimental named recognizers, transient audio and revision-guarded draft insertion |
|
|
54
|
-
| [
|
|
56
|
+
| [translation.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/translation.md) | experimental anonymous text translation and explicit provider requests |
|
|
57
|
+
| [agent-team.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/agent-team.md) | Agent Teams: implicit Lead identity, named continuable teammates, direct peer inbox delivery, and shared task DAG |
|
|
55
58
|
| [claude-code-mods.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/claude-code-mods.md) | Claude Code mods through the experimental bridge: every event, `$` member, chain rule, drawing feature, and example mod that differs from Claude Code |
|
|
56
59
|
| [web.md](./web.md) | the web access seam: `WebSearchRequest`/`Result`, `WebFetchRequest`/`Result`, `WebFetchBody`, provider availability, `WebError` |
|
|
57
60
|
| [spill.md](./spill.md) | the spill storage seam: `SaveTextSpill`, `SpillOwner`/`SpillSource`, `SpillRef`, the branded `SpillLocator` |
|
|
@@ -10,7 +10,7 @@ Types shared by long-running producers, `ctx.jobs`, and job controls. The [seam
|
|
|
10
10
|
|
|
11
11
|
## Ids and status
|
|
12
12
|
|
|
13
|
-
`JobId` is a [branded id](./core.md#branded-ids) generated as `<kind
|
|
13
|
+
`JobId` is a [branded id](./core.md#branded-ids) generated as `<kind>-<short-uuid>` with 16 lowercase UUID hex characters after the kind. Access control relies on owner authorization, not id secrecy. `JobKind` derives from a merge-extensible map; the registry treats kinds as opaque id namespaces.
|
|
14
14
|
|
|
15
15
|
```ts type-equiv
|
|
16
16
|
/**
|
|
@@ -19,16 +19,69 @@ Types shared by long-running producers, `ctx.jobs`, and job controls. The [seam
|
|
|
19
19
|
*/
|
|
20
20
|
interface JobKindMap {
|
|
21
21
|
bash: 'bash'
|
|
22
|
-
subagent: 'subagent'
|
|
23
22
|
}
|
|
24
23
|
```
|
|
25
24
|
|
|
26
25
|
`JobStatus` is `'running' | 'stopping' | 'completed' | 'killed' | 'failed'`; producer-specific facts belong in `JobView.progress` while the job runs and in `JobView.detail` once it settled.
|
|
27
26
|
|
|
27
|
+
<a id="session-lifecycle-records"></a>
|
|
28
|
+
|
|
29
|
+
## Session lifecycle records
|
|
30
|
+
|
|
31
|
+
Owned jobs publish `job/registered` and `job/settled` in their original owner Session. The globally unique `jobId` pairs those records and controls the live job. The SDK forwards these log-only records through `session.event`, independently of output reads. Timestamps describe registry commits, not CPU time or exact OS process boundaries; a missing settlement remains incomplete. `producerReported` means the producer fulfilled `done` with a terminal outcome; it is false for forced teardown or rejection and does not independently certify resource release.
|
|
32
|
+
|
|
33
|
+
`job/settled` may follow `turn/end`. An SDK run result covers only its own observation window; consumers needing later settlements retain a Session subscription or read persisted history. Turn completion does not imply that every owned job stopped.
|
|
34
|
+
|
|
35
|
+
Application teardown can stop Session event routing or close its writer before an owned job's final settlement reaches storage. This includes normal one-shot completion and signal shutdown, as well as hard process loss. A missing `job/settled` remains incomplete even if the live registry reported termination; consumers must not invent a finish timestamp.
|
|
36
|
+
|
|
37
|
+
```ts type-equiv
|
|
38
|
+
/** Durable identity and registration time of one owned job execution. */
|
|
39
|
+
interface JobRegisteredData {
|
|
40
|
+
/** Unique execution id accepted by job controls and retained in Session history. */
|
|
41
|
+
readonly jobId: JobId
|
|
42
|
+
/** Original owner; copied history does not transfer execution ownership. */
|
|
43
|
+
readonly owner: SessionId
|
|
44
|
+
/** Producer kind. */
|
|
45
|
+
readonly kind: string
|
|
46
|
+
/** Producer-supplied label. */
|
|
47
|
+
readonly label: string
|
|
48
|
+
/** Unix epoch milliseconds when registration committed. */
|
|
49
|
+
readonly startedAt: number
|
|
50
|
+
/** Creating tool invocation, when the producer was called through a tool. */
|
|
51
|
+
readonly toolCall?: JobToolCall
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
```ts type-equiv
|
|
56
|
+
/** Registry settlement, including whether the producer reported a terminal outcome. */
|
|
57
|
+
interface JobSettledData extends JobRegisteredData {
|
|
58
|
+
/** Unix epoch milliseconds when the registry committed the terminal record. */
|
|
59
|
+
readonly finishedAt: number
|
|
60
|
+
/** Recorded terminal outcome. */
|
|
61
|
+
readonly status: JobOutcome['status']
|
|
62
|
+
/** Source of the termination request, or producer completion. */
|
|
63
|
+
readonly cause: JobSettleCause
|
|
64
|
+
/** True when done fulfilled; false for rejection or forced failure. Does not certify resource release. */
|
|
65
|
+
readonly producerReported: boolean
|
|
66
|
+
/** Terminal reason, including a recorded kill reason when applicable. */
|
|
67
|
+
readonly detail?: string
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
28
71
|
## Producer contract
|
|
29
72
|
|
|
30
73
|
A `JobSpec` declares identity, the owning session, optional pull `output` sources, and a starter. The runtime finishes preflight before calling `run()` with the job's `JobHandle` and commits without a later failable step. Producers own execution resources; the runtime owns identity, access, lifecycle state, and the output ring.
|
|
31
74
|
|
|
75
|
+
```ts type-equiv
|
|
76
|
+
/** Tool dispatch that created a job; nested calls retain their root invocation. */
|
|
77
|
+
interface JobToolCall {
|
|
78
|
+
/** Exact invocation, including a PTC sub-call when applicable. */
|
|
79
|
+
readonly callId: SessionEventMap['tool/call']['callId']
|
|
80
|
+
/** Root model-requested invocation owning this execution. */
|
|
81
|
+
readonly rootCallId: SessionEventMap['tool/call']['callId']
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
32
85
|
```ts type-equiv
|
|
33
86
|
/**
|
|
34
87
|
* Producer declaration passed to {@link JobRegistry.start}. The runtime
|
|
@@ -37,7 +90,7 @@ A `JobSpec` declares identity, the owning session, optional pull `output` source
|
|
|
37
90
|
* the output ring.
|
|
38
91
|
*/
|
|
39
92
|
interface JobSpec {
|
|
40
|
-
/** Producer kind — also the id prefix (`bash`,
|
|
93
|
+
/** Producer kind — also the id prefix (`bash`, …). */
|
|
41
94
|
kind: JobKind
|
|
42
95
|
/** One-line model-facing label (the command; the delegation description). */
|
|
43
96
|
label: string
|
|
@@ -48,6 +101,8 @@ interface JobSpec {
|
|
|
48
101
|
* caller until service disposal.
|
|
49
102
|
*/
|
|
50
103
|
owner?: SessionId
|
|
104
|
+
/** Creating tool invocation, retained in the durable lifecycle records. */
|
|
105
|
+
toolCall?: JobToolCall
|
|
51
106
|
/**
|
|
52
107
|
* Optional UTF-8 byte cap for each complete model-facing completion notice or
|
|
53
108
|
* output read, including controller status metadata. Independent of ring
|
|
@@ -81,7 +136,7 @@ interface JobSpec {
|
|
|
81
136
|
* throwing, so a producer's trailing flush cannot break its own teardown path.
|
|
82
137
|
*/
|
|
83
138
|
interface JobHandle {
|
|
84
|
-
/** The registry-issued id (`<kind
|
|
139
|
+
/** The registry-issued id (`<kind>-<short-uuid>`). */
|
|
85
140
|
readonly id: JobId
|
|
86
141
|
/**
|
|
87
142
|
* Append one chunk to the output ring. Offsets advance by the chunk's UTF-8
|
|
@@ -99,7 +154,7 @@ interface JobHandle {
|
|
|
99
154
|
}
|
|
100
155
|
```
|
|
101
156
|
|
|
102
|
-
`JobHooks.done` resolves after the producer releases its resources, not merely when work finishes. A job whose result is a value rather than a stream — a
|
|
157
|
+
`JobHooks.done` resolves after the producer releases its resources, not merely when work finishes. A job whose result is a value rather than a stream — a workflow's rendered result — returns it as `JobOutcome.result`; the model's first read after settlement carries it once.
|
|
103
158
|
|
|
104
159
|
```ts type-equiv
|
|
105
160
|
/** Hooks through which the runtime controls and observes producer work. */
|
|
@@ -224,7 +279,7 @@ interface JobOutputRead {
|
|
|
224
279
|
* stream all consume this one shape.
|
|
225
280
|
*/
|
|
226
281
|
interface JobView {
|
|
227
|
-
/** The registry-issued id (`<kind
|
|
282
|
+
/** The registry-issued id (`<kind>-<short-uuid>`). */
|
|
228
283
|
readonly id: JobId
|
|
229
284
|
/**
|
|
230
285
|
* The producer kind the job was registered with: a Host-registered
|
|
@@ -410,7 +465,7 @@ Implementations must honor these semantics:
|
|
|
410
465
|
* rejection leaves no job id or execution resource. A throwing starter
|
|
411
466
|
* leaves nothing registered; after it returns, registration cannot fail.
|
|
412
467
|
* @param spec - job identity, owner, output sources, and synchronous starter.
|
|
413
|
-
* @returns the registry-issued `<kind
|
|
468
|
+
* @returns the registry-issued `<kind>-<short-uuid>` id.
|
|
414
469
|
*/
|
|
415
470
|
abstract start(spec: JobSpec): JobId
|
|
416
471
|
|
|
@@ -502,11 +502,33 @@ interface LlmConfigurableProvider {
|
|
|
502
502
|
* from outside.
|
|
503
503
|
*/
|
|
504
504
|
declared?: boolean
|
|
505
|
+
/**
|
|
506
|
+
* Route endpoint the adapter uses when the profile sets no `baseURL`; the
|
|
507
|
+
* adapter may still send an individual model to that model's own endpoint.
|
|
508
|
+
* Absent when the route has no fixed endpoint.
|
|
509
|
+
*/
|
|
510
|
+
defaultBaseURL?: string
|
|
511
|
+
/** Environment variables used to construct a provider endpoint; absent when none are reported. */
|
|
512
|
+
baseURLEnv?: readonly string[]
|
|
513
|
+
/** Authentication the adapter performs when the profile names no credential reference; absent when it reports none. */
|
|
514
|
+
nativeAuth?: LlmNativeAuth
|
|
505
515
|
/** Configuration diagnostic for repair; unaffected models may remain serviceable. */
|
|
506
516
|
error?: string
|
|
507
517
|
}
|
|
508
518
|
```
|
|
509
519
|
|
|
520
|
+
A settings editor shows `defaultBaseURL`, endpoint configuration variables from `baseURLEnv`, and `nativeAuth` for a profile that leaves the endpoint or the credential reference unset. Both variable lists contain names, never values.
|
|
521
|
+
|
|
522
|
+
```ts type-equiv
|
|
523
|
+
/** Authentication a provider route performs without a credential reference in its profile. */
|
|
524
|
+
interface LlmNativeAuth {
|
|
525
|
+
/** Environment variables the route's authentication reads, in lookup order; empty when it reads none. */
|
|
526
|
+
env: readonly string[]
|
|
527
|
+
/** Whether a stored OAuth sign-in can authenticate the route. */
|
|
528
|
+
oauth: boolean
|
|
529
|
+
}
|
|
530
|
+
```
|
|
531
|
+
|
|
510
532
|
```ts type-equiv
|
|
511
533
|
/** One adapter-discovered model; catalog membership is advisory, not request validation. */
|
|
512
534
|
interface LlmModelInfo {
|
|
@@ -533,7 +555,7 @@ interface LlmModelContext {
|
|
|
533
555
|
}
|
|
534
556
|
```
|
|
535
557
|
|
|
536
|
-
Reasoning effort is another exact-route capability. The core brands identifiers but does not enumerate their values; each adapter owns the
|
|
558
|
+
Reasoning effort is another exact-route capability. The core brands identifiers but does not enumerate their values; each adapter owns the choices in increasing effort order, display names, and optional deployment default. Ordering compares selectable controls, not predicted token use, cost, or latency.
|
|
537
559
|
|
|
538
560
|
```ts type-equiv
|
|
539
561
|
/** Adapter-owned identifier for one model's selectable reasoning effort. */
|
|
@@ -555,7 +577,7 @@ interface LlmReasoningEffortInfo {
|
|
|
555
577
|
```ts type-equiv
|
|
556
578
|
/** Selectable reasoning efforts for one exact provider/model route. */
|
|
557
579
|
interface LlmModelReasoningInfo {
|
|
558
|
-
/** Supported efforts
|
|
580
|
+
/** Supported efforts from least to greatest selectable reasoning effort, not predicted token use or latency. */
|
|
559
581
|
efforts: readonly LlmReasoningEffortInfo[]
|
|
560
582
|
/**
|
|
561
583
|
* Adapter-configured default materialized into requests when callers omit
|
|
@@ -638,8 +660,8 @@ interface GenerateOptions {
|
|
|
638
660
|
sessionId?: Branded<'SessionId'>
|
|
639
661
|
/**
|
|
640
662
|
* Provider-neutral classification for an auxiliary model call. Adapters may
|
|
641
|
-
* map the purpose to model-hidden transport metadata
|
|
642
|
-
*
|
|
663
|
+
* map the purpose to model-hidden transport metadata. Ordinary conversation
|
|
664
|
+
* requests leave it unset.
|
|
643
665
|
*/
|
|
644
666
|
purpose?: 'compaction' | 'session-title'
|
|
645
667
|
}
|
|
@@ -748,6 +770,16 @@ On the wire, a loop-built request is the derived history alone: the rendered pro
|
|
|
748
770
|
|
|
749
771
|
FIXME(call-config-shape): revisit which remaining fields are genuinely epoch-level for cache purposes (`model` and the model-owned reasoning effort are explicit; the sampling scalars sit here out of caution).
|
|
750
772
|
|
|
773
|
+
```ts type-equiv
|
|
774
|
+
/** Concrete generation settings; omitted controls use the selected route's defaults. */
|
|
775
|
+
interface LlmCallControls {
|
|
776
|
+
reasoningEffort?: ReasoningEffortId
|
|
777
|
+
temperature?: number
|
|
778
|
+
maxTokens?: number
|
|
779
|
+
stop?: string[]
|
|
780
|
+
}
|
|
781
|
+
```
|
|
782
|
+
|
|
751
783
|
```ts type-equiv
|
|
752
784
|
/**
|
|
753
785
|
* Provider, model, reasoning effort, and sampling scalars of one conversation's
|
|
@@ -755,16 +787,28 @@ FIXME(call-config-shape): revisit which remaining fields are genuinely epoch-lev
|
|
|
755
787
|
* the loop builds requests from the logged header rather than accepting these
|
|
756
788
|
* per call.
|
|
757
789
|
*/
|
|
758
|
-
interface LlmCallConfig {
|
|
790
|
+
interface LlmCallConfig extends LlmCallControls {
|
|
759
791
|
provider: string
|
|
760
792
|
model: string
|
|
761
|
-
reasoningEffort?: ReasoningEffortId
|
|
762
|
-
temperature?: number
|
|
763
|
-
maxTokens?: number
|
|
764
|
-
stop?: string[]
|
|
765
793
|
}
|
|
766
794
|
```
|
|
767
795
|
|
|
796
|
+
```ts type-equiv
|
|
797
|
+
/**
|
|
798
|
+
* Synchronous, pure configuration of one call before defaults and validation.
|
|
799
|
+
* Compose functions in the desired order; later writes replace earlier ones.
|
|
800
|
+
* The returned controls cannot change the captured route. Errors reject
|
|
801
|
+
* preparation before dispatch; only the resolved configuration is recordable.
|
|
802
|
+
* @param controls - detached, deeply frozen proposed controls, without defaults.
|
|
803
|
+
* @param model - detached, deeply frozen metadata from the captured adapter generation.
|
|
804
|
+
* @returns concrete controls; omitted fields receive the route's defaults.
|
|
805
|
+
*/
|
|
806
|
+
type ConfigureCall = (
|
|
807
|
+
controls: Readonly<LlmCallControls>,
|
|
808
|
+
model: Readonly<LlmResolvedModelInfo>,
|
|
809
|
+
) => LlmCallControls
|
|
810
|
+
```
|
|
811
|
+
|
|
768
812
|
```ts type-equiv
|
|
769
813
|
/**
|
|
770
814
|
* Effective config fields supplied by exact-model adapter resolution rather
|
|
@@ -778,7 +822,7 @@ interface LlmCallConfigAdapterDefaults {
|
|
|
778
822
|
|
|
779
823
|
## Official DeepSeek request extensions
|
|
780
824
|
|
|
781
|
-
`ctx.deepseekLlmApiExtensions` is the provider-specific registry for additive top-level fields on `deepseek-official` requests. Contributor plugins use `register(field, provider)` to claim one field; the adapter calls `prepare(request)` after serializing its base body and merges the returned fields before HTTP. The prepared `accept()` transaction runs after 2xx, so a contributor can commit delivery state without treating a transport or provider rejection as acceptance.
|
|
825
|
+
`ctx.deepseekLlmApiExtensions` is the provider-specific registry for additive top-level fields on `deepseek-official` requests. Contributor plugins use `register(field, provider)` to claim one field; the adapter calls `prepare(request)` after serializing its base body and merges the returned fields before HTTP. The prepared `accept()` transaction runs after 2xx, so a contributor can commit delivery state without treating a transport or provider rejection as acceptance. A contributor whose preparation throws is logged and omitted from that request, and an acceptance failure is logged without failing the request; a base-field collision uses `REQUEST_EXTENSION` and fails the model request. A merged body that fails to serialize is sent without extension fields; acceptance is skipped and the provider plugin logs the omitted field names.
|
|
782
826
|
|
|
783
827
|
The [wire reference](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/deepseek-llm-api-wire-extensions.md) defines the exact request headers, extension transaction, field versions, and receiver obligations. The shipped composition registers [`dsh_session_log`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/session/session-log-deepseek/README.md) as a lossless incremental canonical-log suffix and [`dsh_plugin_packages`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/llm/plugin-package-inventory-deepseek/README.md) as the complete active Loader-backed package set. These fields remain outside model messages and are absent from the pi-ai adapter path.
|
|
784
828
|
|
|
@@ -844,6 +888,15 @@ declare abstract class LlmAdapter {
|
|
|
844
888
|
* @returns route-owned image pricing, or `undefined` when the route declares none.
|
|
845
889
|
*/
|
|
846
890
|
imageRequestPricing(_provider: string, _model: string): LlmImageRequestPricing | undefined;
|
|
891
|
+
/**
|
|
892
|
+
* Resolve the image dimensions and byte target this adapter sends to the model.
|
|
893
|
+
* The default preserves normalized images; adapters that resize must override it.
|
|
894
|
+
* @param _provider - registered provider route.
|
|
895
|
+
* @param _model - exact model id.
|
|
896
|
+
* @param image - normalized image whose request projection is being resolved.
|
|
897
|
+
* @returns the same target used by request serialization, before provider-internal processing.
|
|
898
|
+
*/
|
|
899
|
+
imageRequestTarget(_provider: string, _model: string, image: ImageAttachmentRef): ImageRequestTarget;
|
|
847
900
|
/**
|
|
848
901
|
* List models this adapter can currently advertise for one owned provider.
|
|
849
902
|
* Core routing accepts unlisted model ids; catalog-driven entry points such
|
|
@@ -913,8 +966,9 @@ register<K extends keyof DeepSeekLlmApiExtensionMap>( field: K, provider: DeepSe
|
|
|
913
966
|
|
|
914
967
|
/**
|
|
915
968
|
* Prepare every currently registered field from one immutable base request.
|
|
916
|
-
*
|
|
917
|
-
*
|
|
969
|
+
* A provider whose preparation throws, or whose value cannot be cloned, is omitted
|
|
970
|
+
* from this request; the first such failure per field is logged. Only cancellation rejects. Field values are cloned
|
|
971
|
+
* and frozen; providers retain no mutable alias to the outgoing request.
|
|
918
972
|
* @param request - exact serialized request facts before extension fields.
|
|
919
973
|
* @returns detached fields and their idempotent joint acceptance transaction.
|
|
920
974
|
*/
|
|
@@ -1014,6 +1068,15 @@ providerRetryPolicy(provider: string): ResolvedRetryPolicy
|
|
|
1014
1068
|
*/
|
|
1015
1069
|
imageRequestPricing(provider: string, model: string): LlmImageRequestPricing | undefined
|
|
1016
1070
|
|
|
1071
|
+
/**
|
|
1072
|
+
* Resolve the image projection for an exact registered model route.
|
|
1073
|
+
* @param provider - registered provider route.
|
|
1074
|
+
* @param model - exact model id.
|
|
1075
|
+
* @param image - normalized image reference.
|
|
1076
|
+
* @returns dimensions and byte target used by the adapter's request serializer.
|
|
1077
|
+
*/
|
|
1078
|
+
imageRequestTarget(provider: string, model: string, image: ImageAttachmentRef): ImageRequestTarget
|
|
1079
|
+
|
|
1017
1080
|
/**
|
|
1018
1081
|
* Resolve the exact text one durable file occurrence contributes to every
|
|
1019
1082
|
* provider request in the current execution environment.
|
|
@@ -1058,11 +1121,15 @@ async resolveCallConfig(config: LlmCallConfig, signal?: AbortSignal): Promise<Ll
|
|
|
1058
1121
|
* Resolve one call under its current adapter registration. The returned
|
|
1059
1122
|
* one-shot handle keeps that registration across header logging and dispatch,
|
|
1060
1123
|
* so HMR cannot combine one adapter's capability result with another adapter.
|
|
1061
|
-
*
|
|
1124
|
+
* An optional synchronous callback selects concrete controls using captured
|
|
1125
|
+
* model metadata. Defaults and validation apply to its result. Callback
|
|
1126
|
+
* failures and cancellation reject preparation before dispatch.
|
|
1127
|
+
* @param config - provider/model route and optional concrete request controls.
|
|
1062
1128
|
* @param signal - optional cancellation for adapter-owned capability lookup.
|
|
1129
|
+
* @param configure - pure control selection, called once before defaults and validation.
|
|
1063
1130
|
* @returns a prepared config and its registration-bound stream entry point.
|
|
1064
1131
|
*/
|
|
1065
|
-
async prepareCall(config: LlmCallConfig, signal?: AbortSignal): Promise<PreparedLlmCall>
|
|
1132
|
+
async prepareCall( config: LlmCallConfig, signal?: AbortSignal, configure?: ConfigureCall, ): Promise<PreparedLlmCall>
|
|
1066
1133
|
|
|
1067
1134
|
/**
|
|
1068
1135
|
* Stream one model call as raw chunks (token-level deltas). Replay state is
|
|
@@ -1078,7 +1145,7 @@ async prepareCall(config: LlmCallConfig, signal?: AbortSignal): Promise<Prepared
|
|
|
1078
1145
|
stream(options: GenerateOptions): AsyncIterable<StreamChunk>
|
|
1079
1146
|
```
|
|
1080
1147
|
|
|
1081
|
-
Types: [FileAttachmentRef](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/attachment.md)
|
|
1148
|
+
Types: [FileAttachmentRef](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/attachment.md) · [ImageAttachmentRef](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/attachment.md) · [ImageRequestTarget](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/attachment.md)
|
|
1082
1149
|
|
|
1083
1150
|
Source: [`packages/llm/llm/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/llm/llm/src/index.ts)
|
|
1084
1151
|
|
|
@@ -315,6 +315,8 @@ type SessionPersistenceRevision = Branded<'SessionPersistenceRevision'>
|
|
|
315
315
|
interface SessionPersistenceSnapshot {
|
|
316
316
|
/** Detached metadata for one stored session. */
|
|
317
317
|
readonly header: SessionHeader
|
|
318
|
+
/** Header-only format classification; absent without versioned artifact metadata. */
|
|
319
|
+
readonly formatStatus?: 'current' | 'migration-required'
|
|
318
320
|
/** Opaque change token; see {@link SessionPersistence.stat}. */
|
|
319
321
|
readonly revision: SessionPersistenceRevision
|
|
320
322
|
/** Logical event count, when the backend can provide it cheaply from metadata; otherwise absent. */
|
|
@@ -34,7 +34,7 @@ A missing, blank, or non-string `section` and any unknown key fail at plugin loa
|
|
|
34
34
|
|
|
35
35
|
## The exit tool and the `/plan` command
|
|
36
36
|
|
|
37
|
-
[`exit_plan_mode`](../tool-catalog.md#deepseek-aidsh-plan-mode) stays registered while plan mode is inactive, so entering or leaving plan mode changes only the prompt section, never the request tool catalog; execution outside plan mode fails. In plan mode it requires a complete markdown plan starting with a `#` heading and presents it for review through the [user-questions seam](./user-questions.md). Approval returns `{ approved: true }` and records a silent (non-narrated) pending exit that is appended at the next accepted in-turn pre-step. Plan guidance therefore remains active for the rest of the assistant's current tool batch, and the tool result itself reports the transition. Keep-planning is a failed call carrying the user's feedback, so the model revises and presents again
|
|
37
|
+
[`exit_plan_mode`](../tool-catalog.md#deepseek-aidsh-plan-mode) stays registered while plan mode is inactive, so entering or leaving plan mode changes only the prompt section, never the request tool catalog; execution outside plan mode fails. In plan mode it requires a complete markdown plan starting with a `#` heading and presents it for review through the [user-questions seam](./user-questions.md). Approval returns `{ approved: true }` and records a silent (non-narrated) pending exit that is appended at the next accepted in-turn pre-step. Plan guidance therefore remains active for the rest of the assistant's current tool batch, and the tool result itself reports the transition. Keep-planning is a failed call carrying the user's feedback, so the model revises and presents again. A dismissed review returns `{ approved: false }` and concludes the turn, so plan mode stays active until the user's next message. A missing interaction channel and a service reload during review also fail the call rather than silently leaving plan mode.
|
|
38
38
|
|
|
39
39
|
When [`ctx.commands`](./commands.md) is composed, the plugin registers `/plan [off|message]`: bare `/plan` selects plan mode, any other non-empty message selects it and then submits the text through `agent.steer()` so it becomes the next step's ordinary logged user message under plan guidance, and the exact argument `off` selects inactive, which also cancels a pending entry before it is appended and becomes visible to a request.
|
|
40
40
|
|
|
@@ -22,11 +22,18 @@ Source: [`packages/ptc-runtime/ptc-runtime/src/types.ts`](https://github.com/dee
|
|
|
22
22
|
interface PtcRunRequest {
|
|
23
23
|
/**
|
|
24
24
|
* The program source, in the runtime's {@link ../index.ts | language}. It
|
|
25
|
-
*
|
|
26
|
-
*
|
|
25
|
+
* follows the provider's programFormat: an async function body supports
|
|
26
|
+
* top-level `await` and `return`; a REPL supports top-level declarations,
|
|
27
|
+
* `await`, and a final expression. The completion value becomes
|
|
27
28
|
* {@link PtcRunResult.value}.
|
|
28
29
|
*/
|
|
29
30
|
program: string
|
|
31
|
+
/**
|
|
32
|
+
* Object-identity owner for optional in-memory state. Omission requests a fresh
|
|
33
|
+
* environment. Consumers must await runtime.release(owner) when the owner ends.
|
|
34
|
+
* Stateless providers ignore this field; retained state is never durable.
|
|
35
|
+
*/
|
|
36
|
+
stateOwner?: object
|
|
30
37
|
/** Host functions exposed to the program, one global object per namespace. */
|
|
31
38
|
bindings: PtcBindingNamespace[]
|
|
32
39
|
/** Working directory in the mounted filesystem and subprocess execution world. */
|
|
@@ -81,7 +88,7 @@ interface PtcRunResult {
|
|
|
81
88
|
/** Applied file policy and observed denial, when the provider enforces file policy. */
|
|
82
89
|
sandbox?: PtcRunSandbox
|
|
83
90
|
/**
|
|
84
|
-
* The program's completion value (
|
|
91
|
+
* The program's completion value (a return or final REPL expression), when it ran to
|
|
85
92
|
* completion and the value crossed the runtime's lossless-JSON boundary.
|
|
86
93
|
* Invalid or over-limit completions fail the run instead of substituting a
|
|
87
94
|
* rendered string; a failed or value-less run leaves this absent.
|
|
@@ -98,6 +105,8 @@ interface PtcRunResult {
|
|
|
98
105
|
}
|
|
99
106
|
```
|
|
100
107
|
|
|
108
|
+
`programFormat` distinguishes async function bodies from REPL statements. `stateOwner` is an in-process object identity for optional retained memory; distinct objects remain isolated. Consumers await `release(owner)` when that owner ends; cleanup failures reject that call. Omitted owners are one-shot, and stateless providers ignore ownership. The [persistent Node provider](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/ptc-runtime/ptc-runtime-node/README.md#persistent-repl) defines reset and recovery behavior; no retained object enters the durable Session format.
|
|
109
|
+
|
|
101
110
|
## Bindings: host functions as program globals
|
|
102
111
|
|
|
103
112
|
Each `PtcBindingNamespace` becomes a global object of async callables; PTC passes `tools`. Arguments and resolutions must be lossless JSON. Providers enforce their own transport caps; the seam sets no uniform binding-byte limit. An optional error-class descriptor creates program-visible typed rejections without naming a consumer inside the runtime. Binding names are own properties, so `__proto__` cannot traverse a prototype:
|
|
@@ -172,12 +181,12 @@ type PtcBindingFunction = (args: unknown) => Promise<PtcJsonValue>
|
|
|
172
181
|
|
|
173
182
|
Logs are plain strings. Each source channel preserves emission order, while interleaving across independent channels is backend-dependent because channel metadata is not part of the seam. The runtime captures the program's console and stream output, and consumers render only the text. Implementations cap the serialized outer log-array plus completion-value or failure-message payload; fixed result-envelope syntax and consumer presentation whitespace are not part of that variable-payload ledger. Overflow is an explicit failure rather than in-band value substitution.
|
|
174
183
|
|
|
175
|
-
Failure kinds are **orthogonal outcomes reported independently** (per [defensive-patterns](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/defensive-patterns.md)): a budget expiry is not an exception, an abort is not a timeout, and a substrate death (e.g. OOM) is neither:
|
|
184
|
+
Failure kinds are **orthogonal outcomes reported independently** (per [defensive-patterns](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/defensive-patterns/general.md)): a budget expiry is not an exception, an abort is not a timeout, and a substrate death (e.g. OOM) is neither:
|
|
176
185
|
|
|
177
186
|
```ts type-equiv
|
|
178
187
|
/**
|
|
179
188
|
* Why a run failed. The kinds are orthogonal outcomes reported independently
|
|
180
|
-
* (per docs/defensive-patterns.md): a budget expiry is not an exception, an
|
|
189
|
+
* (per docs/defensive-patterns/general.md): a budget expiry is not an exception, an
|
|
181
190
|
* abort is not a timeout, and a substrate death is neither.
|
|
182
191
|
*
|
|
183
192
|
* - `'exception'` — the program threw or failed to parse/transform.
|
|
@@ -213,9 +222,18 @@ Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnp
|
|
|
213
222
|
|
|
214
223
|
### `ctx.ptcRuntime` — `PtcRuntime` (abstract seam)
|
|
215
224
|
|
|
216
|
-
Registers one `ctx.ptcRuntime` implementation. Program, budget, abort, and substrate failures resolve in PtcRunResult; only Service Definition contract misuse rejects. Implementations bridge structured-cloneable bindings, materialize each declared namespace rejection class, treat programs as hostile peers, isolate
|
|
225
|
+
Registers one `ctx.ptcRuntime` implementation. Program, budget, abort, and substrate failures resolve in PtcRunResult; only Service Definition contract misuse rejects. Implementations bridge structured-cloneable bindings, materialize each declared namespace rejection class, treat programs as hostile peers, isolate distinct state owners, and terminate and await in-flight runs during disposal.
|
|
217
226
|
|
|
218
227
|
```ts cordis-catalog
|
|
228
|
+
/**
|
|
229
|
+
* Release an owner's retained environment and await its execution resources.
|
|
230
|
+
* Stateless providers have no retained resources to release.
|
|
231
|
+
* @param owner - The exact object supplied as the request's state owner.
|
|
232
|
+
* @returns Completion after all owned execution resources have been released.
|
|
233
|
+
* @throws When managed resource cleanup fails.
|
|
234
|
+
*/
|
|
235
|
+
release(owner: object): Promise<void>
|
|
236
|
+
|
|
219
237
|
/**
|
|
220
238
|
* Resolve supported options and provider defaults before execution.
|
|
221
239
|
* @param request - Program, bindings, cancellation and optional execution choices.
|
|
@@ -28,6 +28,8 @@ interface SessionRecord {
|
|
|
28
28
|
live: boolean
|
|
29
29
|
/** Whether the active persistence backend currently lists the id, including a created-but-unmaterialized session it already observes. */
|
|
30
30
|
persisted: boolean
|
|
31
|
+
/** Current for live Sessions; otherwise the persistence format status when reported. */
|
|
32
|
+
formatStatus?: 'current' | 'migration-required'
|
|
31
33
|
}
|
|
32
34
|
```
|
|
33
35
|
|