dsh-plugin-dev-kb 1.4.0 → 1.5.2
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 +25 -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 +70 -0
- package/kb/extra/defensive-patterns.md +0 -33
- package/kb/extra/defensive-patterns.zh.md +0 -35
|
@@ -4,62 +4,89 @@ rawMarkdownPath: "reference/subsystems/subagent.md"
|
|
|
4
4
|
outline: [2,3]
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
#
|
|
7
|
+
# 子代理
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
统一的 activation API 管理本地会话和外部执行。
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## 能力与 activation 请求
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
所有后端都使用 startActivation。能力标记校验请求选项;prepareContinuable 选择本地 Agent 创建,start 选择一次外部执行。面向模型的工具采用 parent 回传。Workflow 与 code mode 消费者可以等待 caller 结果,不额外向父代理注入消息。历史子会话的 descriptor 不可用时,以 `mode: 'unknown'` 保持可发现性,但不授予继续执行能力;[包 README](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/subagent/subagent/README.zh.md) 定义目录持久化语义。
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
## 两类能力,两种发现方式
|
|
18
|
-
|
|
19
|
-
提供方通过一个静态描述符公布其**启动时**功能,服务会在单次 run 存在之前即行检查;如果请求依赖提供方不具备的功能,会被明确拒绝(`SubagentError('UNSUPPORTED_CAPABILITY')`),绝不会被接受后静默忽略。这些 flag 仅描述单次 [`start()`](#the-provider-contract-subagentprovider) 路径,即由提供方组合子 agent 的路径。**可继续**子 agent 由继续执行管理器自行组合,因此它们由唯一一个可选方法把关,方法存在即为能力,并以 TypeScript 的类型收窄作为发现机制:[`SubagentProvider.prepareContinuable`](#the-provider-contract-subagentprovider)。
|
|
15
|
+
可选的 `request.cwd` 指定子级的初始目录;相对路径以父级当前有效目录为基准解析。省略时,在准入阶段捕获该目录。本地子 Session 保留父级的原始项目,冷恢复保留其日志中的目录状态。
|
|
20
16
|
|
|
21
17
|
```ts type-equiv
|
|
22
18
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* {@link SubagentProvider.start} path, where the provider composes the child;
|
|
28
|
-
* continuable children are composed by the continuation manager itself and are
|
|
29
|
-
* gated by {@link SubagentProvider.prepareContinuable} instead. Each flag
|
|
30
|
-
* corresponds one-to-one to a {@link SubagentStartRequest} option: `depthLimit`
|
|
31
|
-
* to `maxDepth`; the other names match.
|
|
19
|
+
* Start-time options supported by a registered backend. The manager checks
|
|
20
|
+
* every requested option before preparing a local child or starting an external
|
|
21
|
+
* execution. depthLimit controls maxDepth; the remaining flag names match
|
|
22
|
+
* SubagentStartRequest fields.
|
|
32
23
|
*/
|
|
33
24
|
interface SubagentCapabilities {
|
|
34
25
|
readonly agentOptions: boolean
|
|
26
|
+
/** Supports selecting a preset independently of the parent's composition. */
|
|
27
|
+
readonly agentPreset: boolean
|
|
35
28
|
readonly outputSchema: boolean
|
|
36
29
|
readonly depthLimit: boolean
|
|
37
|
-
readonly toolFilter: boolean
|
|
38
|
-
readonly persona: boolean
|
|
39
30
|
}
|
|
40
31
|
```
|
|
41
32
|
|
|
42
|
-
|
|
33
|
+
```ts type-equiv
|
|
34
|
+
/** One managed child execution and its result delivery policy. */
|
|
35
|
+
interface SubagentActivationSpec {
|
|
36
|
+
/** Registered backend to use. */
|
|
37
|
+
readonly provider: string
|
|
38
|
+
/** Short task label retained in cataloged child membership. */
|
|
39
|
+
readonly label: string
|
|
40
|
+
/** Optional reserved identity for a local child; external backends allocate their own ids. */
|
|
41
|
+
readonly childId?: SessionId
|
|
42
|
+
/** Task, parent, and backend-supported execution options. */
|
|
43
|
+
readonly request: Omit<SubagentStartRequest, 'label' | 'signal'>
|
|
44
|
+
/** Cancellation before publication; callers own later cancellation through dispose. */
|
|
45
|
+
readonly signal: AbortSignal
|
|
46
|
+
/** Parent delivery notifies the model; caller delivery only returns the result. Local children always enter the parent catalog. */
|
|
47
|
+
readonly delivery: 'parent' | 'caller'
|
|
48
|
+
}
|
|
49
|
+
```
|
|
43
50
|
|
|
44
|
-
|
|
51
|
+
```ts type-equiv
|
|
52
|
+
/** A managed execution; disposal addresses this exact activation, never a later resume. */
|
|
53
|
+
interface SubagentActivation {
|
|
54
|
+
/** Stable identity of the child. */
|
|
55
|
+
readonly childId: SessionId
|
|
56
|
+
/** Accepted inbox message, when the backend has a local inbox. */
|
|
57
|
+
readonly messageId?: MessageId
|
|
58
|
+
/**
|
|
59
|
+
* Execution result after teardown settles and notifications are sent; capture failures reject.
|
|
60
|
+
* Teardown failures are reported by dispose() without replacing a captured result.
|
|
61
|
+
*/
|
|
62
|
+
readonly result: Promise<SubagentResult>
|
|
63
|
+
/** Stop and release this activation and its owned descendants; rejects on teardown failure. */
|
|
64
|
+
dispose(): Promise<void>
|
|
65
|
+
}
|
|
66
|
+
```
|
|
45
67
|
|
|
46
68
|
```ts type-equiv
|
|
47
69
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* and resolves the durable descriptor before dispatching to
|
|
52
|
-
* {@link SubagentProvider.start}.
|
|
70
|
+
* Task and optional capabilities supplied to a backend. startActivation carries
|
|
71
|
+
* these fields in request while owning its label, cancellation, and delivery
|
|
72
|
+
* policy separately.
|
|
53
73
|
*/
|
|
54
74
|
interface SubagentStartRequest {
|
|
75
|
+
/** Initial child directory; relative paths resolve against the parent's current directory. Omitted inherits that directory at start. */
|
|
76
|
+
readonly cwd?: string
|
|
77
|
+
/**
|
|
78
|
+
* Independent preset id; omission joins the parent's current generation.
|
|
79
|
+
* Requires a provider with `capabilities.agentPreset` that does not inherit
|
|
80
|
+
* parent context.
|
|
81
|
+
*/
|
|
82
|
+
readonly agentPreset?: string
|
|
55
83
|
/** Optional short display label persisted with a session-backed child. */
|
|
56
84
|
readonly label?: string
|
|
57
85
|
/** Content delivered as the child's user message. */
|
|
58
86
|
readonly prompt: ContentBlock[]
|
|
59
87
|
/**
|
|
60
|
-
* The spawning agent.
|
|
61
|
-
*
|
|
62
|
-
* and only when no deployment `cwd` override is configured.
|
|
88
|
+
* The spawning agent. Its effective directory supplies the default cwd;
|
|
89
|
+
* in-process children retain its origin, lineage, and delegation depth.
|
|
63
90
|
*/
|
|
64
91
|
readonly parent: Agent
|
|
65
92
|
/**
|
|
@@ -91,91 +118,69 @@ interface SubagentStartRequest {
|
|
|
91
118
|
* start otherwise.
|
|
92
119
|
*/
|
|
93
120
|
readonly maxDepth?: number
|
|
94
|
-
/**
|
|
95
|
-
* Optional child tool scoping. Requires {@link SubagentCapabilities.toolFilter};
|
|
96
|
-
* rejected at start otherwise. In-process backends apply it as a scoped
|
|
97
|
-
* `tools.restrict()` in the child's creation window: the named tools vanish
|
|
98
|
-
* from the child's prompt AND refuse to execute (one visibility), with loud
|
|
99
|
-
* unknown-name validation.
|
|
100
|
-
*/
|
|
101
|
-
readonly toolFilter?: ToolRestriction
|
|
102
|
-
/**
|
|
103
|
-
* Optional per-child persona. Requires {@link SubagentCapabilities.persona};
|
|
104
|
-
* rejected at start otherwise. In-process backends register it as a scoped
|
|
105
|
-
* `deployment:persona-prefix` section on the child, SHADOWING the deployment's
|
|
106
|
-
* persona for this child alone — same template semantics as the deployment
|
|
107
|
-
* persona (strict `{{…}}` interpolation against the registered variables).
|
|
108
|
-
*/
|
|
109
|
-
readonly persona?: string
|
|
110
121
|
}
|
|
111
122
|
```
|
|
112
123
|
|
|
113
|
-
`signal` 是就绪前后唯一的取消通道。[subagent 组合控制 Agent Note](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/feature/2026-07-12-subagent-persona-tool-filter-and-depth.zh.md)规定 persona、live 全局工具过滤、绝对深度以及「可见性而非权限」的设计理由。
|
|
114
|
-
|
|
115
|
-
面向调用方的请求不携带目录格式细节或继续执行状态。`SubagentRuntime.start()` 会在能力检查后解析分离的一次性描述符,再将以下面向提供方的请求传给所选传输;可继续子 agent 绝不会到达 `SubagentProvider.start()`:
|
|
116
|
-
|
|
117
124
|
```ts type-equiv
|
|
118
|
-
/**
|
|
119
|
-
* Provider-facing one-shot request after {@link SubagentRuntime.start} resolves
|
|
120
|
-
* the durable child descriptor.
|
|
121
|
-
*/
|
|
125
|
+
/** Provider-facing request with an absolute directory selected before startup. */
|
|
122
126
|
interface ResolvedSubagentStartRequest extends SubagentStartRequest {
|
|
123
|
-
/**
|
|
124
|
-
readonly
|
|
127
|
+
/** Absolute child directory captured from the parent or explicit request. */
|
|
128
|
+
readonly cwd: string
|
|
125
129
|
}
|
|
126
130
|
```
|
|
127
131
|
|
|
128
|
-
##
|
|
129
|
-
|
|
130
|
-
**可继续后台 subagent** 是一份持久化子 agent 会话(Session),至多关联一个进程内的 **Activation(激活)**,即被重建的子 Agent 处于驻留状态的时段。Activation 不是请求、结果、取消或 Task:它可以执行多个 FIFO 轮次,并在其创建的后代仍在运行期间保持驻留。继续执行管理器负责 activation 准入、直接父级鉴权、实时所有权图、冷恢复(cold resume)与子级优先释放;agent loop 负责一切轮次排序与执行。任何可继续路径都不会创建 Task,也不会创建承载中间结果的包装层。
|
|
131
|
-
|
|
132
|
-
```text
|
|
133
|
-
persisted Session
|
|
134
|
-
-> optional live Activation
|
|
135
|
-
-> one retained AgentHandle
|
|
136
|
-
-> Agent inbox as the only turn FIFO
|
|
137
|
-
-> zero or more owned child Activations
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
`SubagentRuntime.startContinuable()` 会预留稳定的子 agent id,对版本化的 `subagent/descriptor` payload 建立快照,向指定提供方索取其分离的 `ContinuableCreateSpec`,通过私有的 activation-owner 作用域创建子 Agent,建立任何可继续父级的所有权,并提交初始提示词。当收件箱(inbox)准入产出消息 id 时,它以 `{ childId, messageId }` resolve——无需等待轮次开始,也无需等待消息进入会话日志。在该准入之前的任何失败都会以两个 id 都不返回的方式 reject,并 dispose(资源释放)任何已创建的 handle,回滚 Activation 与父级所有权。
|
|
141
|
-
|
|
142
|
-
`SubagentRuntime.sendMessage()` 是唯一由模型编写消息的操作。它接收确切在线 sender 与目标 id,只允许直接 parent 或直接可继续 child,自行推导 sender 来源信息,并根据目标 child 的 Activation 驻留状态路由:
|
|
143
|
-
|
|
144
|
-
| 目标 Activation 状态 | `sendMessage` |
|
|
145
|
-
|---|---|
|
|
146
|
-
| `running` | 在同一 Activation 中 steer 最近的 step |
|
|
147
|
-
| `waiting` | 唤醒并 steer 同一 Activation |
|
|
148
|
-
| 无 Activation | 冷恢复新的 Activation,然后 steer |
|
|
149
|
-
|
|
150
|
-
`running` 表示 Agent 拥有活跃的 driver 或 maintenance 任务;`waiting` 表示没有活跃的 Agent 工作,但其 Inbox 非空或仍拥有至少一个尚未完成 dispose 的子 Activation;`settled` 表示没有活跃的 Agent 工作、Inbox 为空且其拥有的每个子级都已 dispose,此时管理器会 dispose [`AgentHandle`](./core.md#creation-and-ownership) 并移除该 Activation。管理器根据 `Agent.whenIdle()`、`Agent.inbox.hasPending`、其拥有的子级集合,以及让过期观察失效的 Activation generation 推导这些内部条件,而非维护第二套执行状态机。最终 Session flush 之后,child-lock 决策会通过 `Agent.runMaintenance()` 的同步 task 入口占用 idle 阶段,并在同一个 JavaScript turn 内关闭准入。这条保守规则不区分投递模式:`Agent.inject()` 停放的 context 可以让空闲 Activation 及其在线祖先继续驻留,直到唤醒投递将其 claim、queue 变更将其移除,或 manager teardown 将其丢弃。
|
|
151
|
-
|
|
152
|
-
Agent 收件箱是唯一队列。每条 Agent 消息都使用 `Agent.steer()`:空闲目标会启动一个轮次,运行中目标则在最近的 step 边界领取消息。浏览器 `subagent.prompt` Remote 会另行通过同一条内部准入路径携带 `delivery: 'queue' | 'steer'`;Queue 开启后续 FIFO 轮次,Steer 保留 Agent loop 的 best-effort 最近 step 行为以及消息的人类来源。投递成功会返回被接受的 `MessageId`;既有的 `agent/inbox/inserted`、`agent/inbox/claimed` 与 `agent/inbox/discarded` 事件仍是消息生命周期的观测点,继续执行层不定义第二条队列。
|
|
153
|
-
|
|
154
|
-
权限来自确切在线 sender。parent 到 child 的投递要求目标的 `SessionHeader.parentSession` 指向 sender;child 到 parent 的投递要求 sender 的驻留 Activation 指向目标。sibling、相隔多于一条边的 ancestor、self-target、陈旧 Agent 对象与一次性 child 都会被拒绝。每条已接受消息都以 `Agent <sender-id> sent a message:` 作为前缀,并记录 `AgentMessageSource`;来源信息记录 sender,但不授予权限。
|
|
132
|
+
## 本地子代理与 activation
|
|
155
133
|
|
|
156
|
-
|
|
134
|
+
只有 spawn 支持独立的 `agentPreset`;省略选择与 fork 都继承父方的活跃组装。[子级 preset 规则](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/subagent/subagent/README.zh.md#restoring-child-composition)定义显式选择、事件顺序和历史恢复行为。
|
|
157
135
|
|
|
158
|
-
|
|
136
|
+
本地子代理拥有持久 Session,最多有一个在线 activation。Manager 预留身份和容量,通过后端准备子代理,并管理输入准入、冷恢复以及先子后父的释放顺序。activation 结果在资源释放和完成通知之后结算。释放操作单独报告清理失败,不会覆盖已捕获的结果。结构化结果提交会关闭该 activation 的输入;之后的冷恢复不会继承输出 schema。
|
|
159
137
|
|
|
160
|
-
|
|
138
|
+
```ts type-equiv
|
|
139
|
+
/**
|
|
140
|
+
* What the continuation manager asks a provider for while materializing one
|
|
141
|
+
* continuable child's FIRST activation. The manager has already reserved the
|
|
142
|
+
* durable child identity and owns every later operation, so this request
|
|
143
|
+
* carries only what distinguishes a fresh child from one seeded with parent
|
|
144
|
+
* history.
|
|
145
|
+
*/
|
|
146
|
+
interface ContinuableCreateRequest {
|
|
147
|
+
/** Absolute initial directory captured before provider preparation. */
|
|
148
|
+
readonly cwd: string
|
|
149
|
+
/** The reserved durable child session id, for provider diagnostics. */
|
|
150
|
+
readonly sessionId: SessionId
|
|
151
|
+
/** The delegating parent agent whose history a seeding provider reads. */
|
|
152
|
+
readonly parent: Agent
|
|
153
|
+
/**
|
|
154
|
+
* Caller cancellation, which owns preparation only until the manager accepts
|
|
155
|
+
* the initial prompt into the child's inbox.
|
|
156
|
+
*/
|
|
157
|
+
readonly signal: AbortSignal
|
|
158
|
+
}
|
|
159
|
+
```
|
|
161
160
|
|
|
162
161
|
```ts type-equiv
|
|
163
162
|
/**
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
163
|
+
* A provider's detached contribution to one continuable child's creation. This
|
|
164
|
+
* is DATA, never a capability: it carries no Agent, `AgentHandle`, prompt
|
|
165
|
+
* delivery, result, disposal, or resume operation, because the continuation
|
|
166
|
+
* manager owns the child's whole lifecycle after preparation.
|
|
167
167
|
*/
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
168
|
+
interface ContinuableCreateSpec {
|
|
169
|
+
/**
|
|
170
|
+
* Completed-turn prefix of the parent's log to seed the child session with,
|
|
171
|
+
* or absent for a fresh child. Same durable contract as
|
|
172
|
+
* `CreateAgentOptions.seed`: contiguous from seq 0, lossless JSON, balanced.
|
|
173
|
+
*/
|
|
174
|
+
readonly seed?: readonly SessionEvent[]
|
|
175
|
+
}
|
|
171
176
|
```
|
|
172
177
|
|
|
173
|
-
|
|
178
|
+
## 消息与中断
|
|
174
179
|
|
|
175
|
-
|
|
180
|
+
sendMessage 根据确切的在线发送者实例授权,仅允许相邻本地代理通信。运行中的子代理接收引导输入;不在线的可继续子代理从持久化恢复。外部执行拒绝后续消息。本地与外部执行都会通过父级结束通知自动回传最终文本、结构化结果、诊断和状态。本地子代理也可以通过 send_message 发送消息。caller 回传会抑制结束通知。drainDescendants 与 drainChildren 对本地和外部 activation 都等待所属任务清理完成。
|
|
176
181
|
|
|
177
182
|
```ts type-equiv
|
|
178
|
-
/** Durable attribution for one model-authored message between
|
|
183
|
+
/** Durable attribution for one model-authored message between Agents. */
|
|
179
184
|
interface AgentMessageSource {
|
|
180
185
|
readonly kind: 'agent-message'
|
|
181
186
|
/** A message another agent addressed to this one (`relay` context form). */
|
|
@@ -185,26 +190,6 @@ interface AgentMessageSource {
|
|
|
185
190
|
}
|
|
186
191
|
```
|
|
187
192
|
|
|
188
|
-
```ts type-equiv
|
|
189
|
-
/** Options for one model-authored message between adjacent Agents. */
|
|
190
|
-
interface SubagentSendMessageOptions {
|
|
191
|
-
/** Caller cancellation, owning the operation only until inbox acceptance. */
|
|
192
|
-
readonly signal: AbortSignal
|
|
193
|
-
}
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
```ts type-equiv
|
|
197
|
-
/** Identities returned once a continuable child accepted its initial prompt. */
|
|
198
|
-
interface ContinuableStart {
|
|
199
|
-
/** The durable child session id, stable across activations. */
|
|
200
|
-
readonly childId: SessionId
|
|
201
|
-
/** The accepted initial prompt's inbox message id. */
|
|
202
|
-
readonly messageId: MessageId
|
|
203
|
-
}
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
当驻留 Activation 结算时,管理器会向该 child 持久化的直接 parent 投递一条通知,说明该 epoch 如何结束,并携带其最终 assistant 输出中的非空文本块;若没有剩余的非空文本,则携带 `It left no closing message.`。对每个调用方拿到过 id 的 child,这条投递都是无条件的;它发生在会让 parent 被判定为已结算的所有权释放之前,并通过与 Agent 消息相同的唤醒 Agent 投递到达驻留 parent。若 parent 自身所在的谱系已在拆卸中,这条通知会以不唤醒的方式送达,因为唤醒一个 idle Agent 是开启一个轮次,而不是排队等待工作。其来源信息使用一个独立的 kind,因此 transcript(文本记录)绝不会把运行时的记账呈现为 child 自己写下的内容。
|
|
207
|
-
|
|
208
193
|
```ts type-equiv
|
|
209
194
|
/**
|
|
210
195
|
* Durable attribution for the runtime's own account of a continuable child
|
|
@@ -224,74 +209,32 @@ interface SubagentSettledMessageSource {
|
|
|
224
209
|
}
|
|
225
210
|
```
|
|
226
211
|
|
|
227
|
-
提供方只参与准备初始创建 spec,`spawn` 与 `fork` 在此有所不同。其返回的 spec 只携带分离的、提供方专属的创建输入——即可选的父级历史种子——不含 Agent、`AgentHandle`、提示词投递、结果、dispose 或恢复操作。冷恢复根本不经由提供方分发:管理器折叠通用描述符,通过同一个 activation-owner 作用域调用 `ctx.agents.resume()`,并提交等待中的轮次。
|
|
228
|
-
|
|
229
212
|
```ts type-equiv
|
|
230
|
-
/**
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
* durable child identity and owns every later operation, so this request
|
|
234
|
-
* carries only what distinguishes a fresh child from one seeded with parent
|
|
235
|
-
* history.
|
|
236
|
-
*/
|
|
237
|
-
interface ContinuableCreateRequest {
|
|
238
|
-
/** The reserved durable child session id, for provider diagnostics. */
|
|
239
|
-
readonly sessionId: SessionId
|
|
240
|
-
/** The delegating parent agent whose history a seeding provider reads. */
|
|
241
|
-
readonly parent: Agent
|
|
242
|
-
/**
|
|
243
|
-
* Caller cancellation, which owns preparation only until the manager accepts
|
|
244
|
-
* the initial prompt into the child's inbox.
|
|
245
|
-
*/
|
|
213
|
+
/** Options for one model-authored message between adjacent Agents. */
|
|
214
|
+
interface SubagentSendMessageOptions {
|
|
215
|
+
/** Caller cancellation, owning the operation only until inbox acceptance. */
|
|
246
216
|
readonly signal: AbortSignal
|
|
247
217
|
}
|
|
248
218
|
```
|
|
249
219
|
|
|
250
220
|
```ts type-equiv
|
|
251
221
|
/**
|
|
252
|
-
*
|
|
253
|
-
*
|
|
254
|
-
*
|
|
255
|
-
* manager owns the child's whole lifecycle after preparation.
|
|
222
|
+
* Authority under which one interrupt request is admitted. `user` carries the
|
|
223
|
+
* durable direct-parent address a human client presented; `ancestor` carries
|
|
224
|
+
* the exact live Agent object whose recorded lineage must contain the caller.
|
|
256
225
|
*/
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
* or absent for a fresh child. Same durable contract as
|
|
261
|
-
* `CreateAgentOptions.seed`: contiguous from seq 0, lossless JSON, balanced.
|
|
262
|
-
*/
|
|
263
|
-
readonly seed?: readonly SessionEvent[]
|
|
264
|
-
}
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
描述符([descriptor.ts](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/subagent/subagent/src/descriptor.ts) 中的 `SubagentDescriptorData`)是每个由会话支撑的 subagent 所使用、按模式判别的持久化身份。两种模式都携带提供方名称。`one-shot` 描述符可以携带调用方拥有的可选显示 `label`;`continuable` 描述符要求以委派 `description` 作为持久化创建标签,并另外对已解析的子 agent `agentOptions.provider`/`model`/`reasoningEffort` 与可选的 `persona`/`toolFilter` 建立快照,用于冷恢复。它绝不会对可合并扩展的 `AgentOptions` 对象建立快照,因此无关的扩展值不会破坏继续执行,后续新增组合配置输入则是一次有意的版本更改。描述符省略 `subagentDepth`(冷恢复以持久化 header 中的 `delegationDepth` 作为单调下界)和 `outputSchema`(单次运行或 Activation 的结果约定,而非持久化身份)。
|
|
268
|
-
|
|
269
|
-
本地一次性提供方会在子 agent 的初始轮次内、首次请求前追加描述符。继续执行管理器会在任何提供方提供的谱系之后、初始提示词获准之前追加描述符;`Session.inheritedEventCount` 仍是 fork 谱系边界:恢复时的描述符权威读取子 agent 自身的后缀,而身份投影以 last-wins 折叠 `subagent/descriptor`,子 agent 自己的描述符会覆盖 fork seed 中祖先的描述符。该事件只进入日志:不含 `surfaceOp`,绝不进入模型历史,并由仅追加日志跨压缩保留。格式错误的当前版本描述符属于损坏;本运行时无法对不受支持的版本进行分类。
|
|
270
|
-
|
|
271
|
-
## 持久化枚举:`listChildren()`、`listDescendants()` 与其条目
|
|
272
|
-
|
|
273
|
-
模型侧的 `list_agents` 适配器将当前活动表示为 `running` 或 `inactive`。这些值不描述任务完成情况,也不保证 `send_message` 会成功。
|
|
274
|
-
|
|
275
|
-
`SubagentRuntime.listChildren(parentSessionId, signal?)` 通过优先使用在线 Session 的观察读取父会话的 `subagentCatalog` 视图,并在成功或失败时释放观察。它按父会话事件顺序返回直接子级条目,不读取子级日志,也不枚举 Session 语料库。查询失败直接传播;缺少目录投影时显式失败。浏览器条目从共享 projection store 派生成员关系,并从 Session 状态补充活动状态;control stream 推送完整目录更新。`listDescendants()` 递归读取这些目录,并从每个子级目录推导 `hasChildren`。[父目录 Agent Note](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/architecture/2026-09-01-parent-owned-subagent-catalog.zh.md) 说明创建、fork 隔离、排序和持久化成本。
|
|
276
|
-
|
|
277
|
-
`SubagentRuntime.listDescendants(rootSessionId)` 以稳定前序递归调用同一目录读取函数,保留每个父级的事件顺序。一次性和未知模式条目仍是遍历节点;未知模式产生 `unsupported` 诊断。无法读取的子级目录产生 `corrupt` 或 `unavailable`,只停止该分支。根读取失败、服务或投影缺失、取消会使整个查询失败。每个可达目录只观察一次,并在下一次读取前释放;重复 id 和循环引用会被跳过。可达目录中不存在的 Session 不会被发现,包括普通 Session fork 及其下的子 agent。每行携带目录中的父级和相对根的深度:
|
|
278
|
-
|
|
279
|
-
```ts type-equiv
|
|
280
|
-
/** One catalog descendant with its direct parent and edge distance from the requested root. */
|
|
281
|
-
type SubagentDescendantListEntry = SubagentListEntry & {
|
|
282
|
-
/** Parent whose catalog contains this child. */
|
|
283
|
-
readonly parentId: SessionId
|
|
284
|
-
/** Edge distance from the requested root; direct children are `1`. */
|
|
285
|
-
readonly depth: number
|
|
286
|
-
}
|
|
226
|
+
type SubagentInterruptAuthority =
|
|
227
|
+
| { readonly kind: 'user'; readonly parentSessionId: SessionId }
|
|
228
|
+
| { readonly kind: 'ancestor'; readonly agent: Agent }
|
|
287
229
|
```
|
|
288
230
|
|
|
231
|
+
## 持久枚举
|
|
289
232
|
|
|
290
|
-
|
|
233
|
+
`listChildren` 读取父级拥有的目录,其中包含所有本地子级及 parent 投递的外部子级。caller 投递的外部执行由调用方负责成员关系与结果收集;本地工作流子级在完成后仍可被发现。外部条目携带 `mode: 'external'`,不能打开子 Session 或接受后续消息。目录在创建时记录成员关系,不携带执行状态。`list_agents` 展示可继续的直接子级,其活跃状态为 `running` 或 `inactive`;参见[控制工具](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/subagent/tool-subagent-control/README.zh.md#list_agents)。
|
|
291
234
|
|
|
292
|
-
##
|
|
235
|
+
## 结果与后端句柄
|
|
293
236
|
|
|
294
|
-
|
|
237
|
+
SubagentResult 供程序消费方读取。activation 注册表保留外部后端句柄,直到释放完成。清理失败不会覆盖已捕获的执行结果:activation 结果与父级通知保留该结果,dispose 拒绝,而在线 subagent/end 事件报告 error。后端提供的诊断必须满足下述安全信息要求。
|
|
295
238
|
|
|
296
239
|
```ts type-equiv
|
|
297
240
|
/**
|
|
@@ -326,8 +269,6 @@ interface SubagentResult {
|
|
|
326
269
|
}
|
|
327
270
|
```
|
|
328
271
|
|
|
329
|
-
`SubagentStopReason` 是一个[可合并扩展的派生联合类型](./core.md#the-map--derived-union-pattern)——后端可以添加变体,因此消费方应对已知 case 分支处理,将未知的终态原因视为失败:
|
|
330
|
-
|
|
331
272
|
```ts type-equiv
|
|
332
273
|
/**
|
|
333
274
|
* Why a subagent run ended. Merge-extensible (a backend may add variants);
|
|
@@ -349,33 +290,17 @@ interface SubagentStopReasonMap {
|
|
|
349
290
|
}
|
|
350
291
|
```
|
|
351
292
|
|
|
352
|
-
## 单次 run:`SubagentRun`
|
|
353
|
-
|
|
354
|
-
`SubagentRun` 是消费方持有的、指向一个已发布单次子 agent 的句柄——一次可 dispose 的前台委派,只有一个结果,绝不是持久化子 agent handle。发布后的提示词提交、轮次工作与基础设施故障归 `result` 所有。消费方 await 该结果并始终 dispose 该 run,直至完全停稳。子 agent 失败时以非 completed 的 stop reason resolve;只有无法表示的基础设施故障才会 reject。run 没有 steering,也没有恢复:可继续对话根本没有 run,因为继续执行管理器直接持有它们的 `AgentHandle`,并通过子 agent 自己的收件箱为每个轮次排序。
|
|
355
|
-
|
|
356
293
|
```ts type-equiv
|
|
357
294
|
/**
|
|
358
|
-
*
|
|
359
|
-
*
|
|
360
|
-
*
|
|
361
|
-
*
|
|
362
|
-
*
|
|
363
|
-
* continuation manager holds their `AgentHandle` directly and orders every
|
|
364
|
-
* turn through the child's own inbox.
|
|
295
|
+
* Backend execution handle owned directly by the activation registry.
|
|
296
|
+
* A result may become available before resource release; the manager always
|
|
297
|
+
* disposes the handle and awaits cleanup. Backend startup failures clean up
|
|
298
|
+
* partial resources before rejecting, while accepted execution failures settle
|
|
299
|
+
* through result.
|
|
365
300
|
*/
|
|
366
301
|
interface SubagentRun {
|
|
367
|
-
/**
|
|
368
|
-
* Parent-scoped run id. For a local run, this MUST equal the published child
|
|
369
|
-
* session id, whose `parentSession` records `request.parent.session.id`; a
|
|
370
|
-
* remote provider mints an id unique in the parent namespace.
|
|
371
|
-
*/
|
|
302
|
+
/** Provider-minted id, unique across all parents, providers, and local Sessions in this runtime. */
|
|
372
303
|
readonly id: SessionId
|
|
373
|
-
/**
|
|
374
|
-
* The exact published in-process child, or `undefined` for a remote run.
|
|
375
|
-
* When present, its id is {@link id}; the provider retains no ownership
|
|
376
|
-
* implication beyond the run's ordinary {@link dispose} contract.
|
|
377
|
-
*/
|
|
378
|
-
readonly localAgent: Agent | undefined
|
|
379
304
|
/**
|
|
380
305
|
* Resolves with the child's terminal {@link SubagentResult} when the run
|
|
381
306
|
* settles. Does NOT reject on a child-level failure — a model/transport
|
|
@@ -392,13 +317,9 @@ interface SubagentRun {
|
|
|
392
317
|
}
|
|
393
318
|
```
|
|
394
319
|
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
<a id="the-provider-contract-subagentprovider"></a>
|
|
398
|
-
|
|
399
|
-
## 提供方约定:`SubagentProvider`
|
|
320
|
+
## 提供方约定:SubagentProvider
|
|
400
321
|
|
|
401
|
-
|
|
322
|
+
`SubagentManager` 统一管理启动、消息准入与执行生命周期。Spawn 与 Fork 提供用于本地 Agent 的独立创建输入。Codex、Claude Code、ACP 和 DSH SDK 提供一个执行句柄,不增加多轮能力。每条 activation 都是直接持有 AgentHandle 或 SubagentRun 的执行期记录。外部完成由句柄的 result promise 确定;inbox 与空闲准入仅属于本地执行。两条路径共用准入、容量、父子所有权、取消和释放机制。[包参考](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/subagent/subagent/README.zh.md)说明组合与部署要求。
|
|
402
323
|
|
|
403
324
|
```ts type-equiv
|
|
404
325
|
/**
|
|
@@ -421,31 +342,28 @@ interface SubagentProvider {
|
|
|
421
342
|
*/
|
|
422
343
|
readonly inheritsParentContext: boolean
|
|
423
344
|
/**
|
|
424
|
-
* Optional static provider-owned provider/model route for
|
|
345
|
+
* Optional static provider-owned provider/model route for child Agent
|
|
425
346
|
* options. Consumers merge tool/model overrides over these values before
|
|
426
347
|
* preflight; providers whose route derives from the parent omit it. The value
|
|
427
348
|
* is detached immutable data and requires `agentOptions` support.
|
|
428
349
|
*/
|
|
429
350
|
readonly agentRouteDefaults?: Readonly<{ provider: string; model: string }>
|
|
430
351
|
/**
|
|
431
|
-
* Establish
|
|
352
|
+
* Establish one external execution and return its owned handle.
|
|
432
353
|
* The service has already validated that every requested start-time
|
|
433
|
-
* capability is supported
|
|
434
|
-
*
|
|
435
|
-
* initial turn. Before fulfillment, the provider owns setup and cleans any
|
|
436
|
-
* unpublished partial resources before rejecting. Ownership transfers on
|
|
354
|
+
* capability is supported. Before fulfillment, the provider owns setup and
|
|
355
|
+
* cleans any unpublished partial resources before rejecting. Ownership transfers on
|
|
437
356
|
* fulfillment; subsequent turn or infrastructure failure settles through
|
|
438
357
|
* the returned run. Distinct starts may overlap; cancellation, failure,
|
|
439
358
|
* result settlement, and disposal remain independent for each run.
|
|
440
359
|
*/
|
|
441
|
-
start(request: ResolvedSubagentStartRequest): Promise<SubagentRun>
|
|
360
|
+
start?(request: ResolvedSubagentStartRequest): Promise<SubagentRun>
|
|
442
361
|
/**
|
|
443
362
|
* OPTIONAL (continuable-creation capability): contribute the detached
|
|
444
363
|
* creation inputs that distinguish this provider's continuable children —
|
|
445
364
|
* only whether the child session is seeded with parent history. Method
|
|
446
|
-
* presence
|
|
447
|
-
*
|
|
448
|
-
* ordinary one-shot delegations.
|
|
365
|
+
* presence selects local activation execution. Providers without it execute
|
|
366
|
+
* through start and do not accept subsequent messages.
|
|
449
367
|
*
|
|
450
368
|
* This is the provider's ONLY participation in a continuable child. The
|
|
451
369
|
* continuation manager owns identity reservation, composition, Agent
|
|
@@ -458,18 +376,27 @@ interface SubagentProvider {
|
|
|
458
376
|
}
|
|
459
377
|
```
|
|
460
378
|
|
|
461
|
-
|
|
379
|
+
## 持久化枚举:`listChildren()`、`listDescendants()` 与其条目
|
|
380
|
+
|
|
381
|
+
模型侧的 `list_agents` 适配器将当前活动表示为 `running` 或 `inactive`。这些值不描述任务完成情况,也不保证 `send_message` 会成功。
|
|
382
|
+
|
|
383
|
+
`SubagentRuntime.listChildren(parentSessionId, signal?)` 通过优先使用在线 Session 的观察读取父会话的 `subagentCatalog` 视图,并在成功或失败时释放观察。它按父会话事件顺序返回直接子级条目,不读取子级日志,也不枚举 Session 语料库。查询失败直接传播;缺少目录投影时显式失败。浏览器条目从共享 projection store 派生成员关系,并从 Session 状态补充活动状态;control stream 推送完整目录更新。`listDescendants()` 递归读取这些目录,并从每个子级目录推导 `hasChildren`。[父目录 Agent Note](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/architecture/2026-09-01-parent-owned-subagent-catalog.zh.md) 说明创建、fork 隔离、排序和持久化成本。
|
|
462
384
|
|
|
463
|
-
|
|
385
|
+
`SubagentRuntime.listDescendants(rootSessionId)` 以稳定前序递归调用同一目录读取函数,保留每个父级的事件顺序。外部条目是没有本地 Session 的叶节点。一次性和未知模式条目仍是遍历节点;未知模式产生 `unsupported` 诊断。无法读取的子级目录产生 `corrupt` 或 `unavailable`,只停止该分支。根读取失败、服务或投影缺失、取消会使整个查询失败。每个可达目录只观察一次,并在下一次读取前释放;重复 id 和循环引用会被跳过。可达目录中不存在的 Session 不会被发现,包括普通 Session fork 及其下的子 agent。每行携带目录中的父级和相对根的深度:
|
|
464
386
|
|
|
465
|
-
|
|
387
|
+
```ts type-equiv
|
|
388
|
+
/** One catalog descendant with its direct parent and edge distance from the requested root. */
|
|
389
|
+
type SubagentDescendantListEntry = SubagentListEntry & {
|
|
390
|
+
/** Parent whose catalog contains this child. */
|
|
391
|
+
readonly parentId: SessionId
|
|
392
|
+
/** Edge distance from the requested root; direct children are `1`. */
|
|
393
|
+
readonly depth: number
|
|
394
|
+
}
|
|
395
|
+
```
|
|
466
396
|
|
|
467
|
-
- **委派权限**在首次 await 前捕获。Auto 与 Full access 父级在 fresh child 完成 fork seed 和 sandbox/approval override 后,追加捕获的 `permission/preset` 身份。单次与可继续 child 共用此路径;cold resume 只读取 child 日志。Read Only 与 Workspace Write 保留继承的 sandbox override 加 `approval: never`,不匹配预设的组合仍为 `custom`。每个 Auto child 调用都使用既有 `parentSession`、创建 prompt 和经过核验的 human/直接父级消息独立审查。[Auto review 决策](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/feature/2026-08-28-auto-review.zh.md)定义 low/medium/high 语义;不增加 委派记录、receipt、Header 字段、descriptor 字段或 Session format。
|
|
468
397
|
|
|
469
|
-
-
|
|
470
|
-
- **Fork 种子注入**使用 [`CreateAgentOptions.seed`](./core.md#creation-and-ownership)(一个 `SessionEvent[]` 前缀,经由 `AgentLoop.createAgent` → `ctx.sessions.prepare({ seed })` 传递,与 `ctx.agents.resume()` 使用的原语相同)。fork 后端传入父级日志的一段*平衡的已完成轮次前缀*——父级事件直到并包括其最后一个 `turn/end`——因此种子从 0 连续,且只包含平衡的轮次(进行中的、未平衡的轮次被排除在外)。
|
|
398
|
+
<a id="the-terminal-result-subagentresult"></a>
|
|
471
399
|
|
|
472
|
-
`SubagentCatalogEntry` 描述一条完整或未知模式的直接子级目录记录;`SubagentCatalogState` 是仅 host 使用的 projection state。`listChildren()` 拥有一次 live-preferred 父 Session observation,不打开子级日志。浏览器消费者通过共享 Session projection store 读取 `subagentCatalog`,并将成员关系与 Session 列表活动状态组合。`SubagentCatalogRow` 属于递归目录列表。[父目录决策](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/architecture/2026-09-01-parent-owned-subagent-catalog.zh.md) 规定持久事实与读取语义。
|
|
473
400
|
|
|
474
401
|
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
|
|
475
402
|
|
|
@@ -499,7 +426,7 @@ Source: [`packages/subagent/tool-subagent/src/model-selection-settings.ts`](http
|
|
|
499
426
|
|
|
500
427
|
### `ctx.subagents` — `SubagentRuntime`
|
|
501
428
|
|
|
502
|
-
Named provider registry with
|
|
429
|
+
Named provider registry with managed activations, durable discovery, and local child messaging.
|
|
503
430
|
|
|
504
431
|
```ts cordis-catalog
|
|
505
432
|
/**
|
|
@@ -510,15 +437,26 @@ Named provider registry with one-shot runs, durable discovery, and continuable-c
|
|
|
510
437
|
resolveMaxDepth(configured?: number | 'provider-managed'): number | undefined
|
|
511
438
|
|
|
512
439
|
/**
|
|
513
|
-
*
|
|
514
|
-
*
|
|
515
|
-
*
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
440
|
+
* Start a local child under its reserved identity.
|
|
441
|
+
* @param spec - local task, reserved child id, and result recipient.
|
|
442
|
+
* @returns activation with its accepted initial message id.
|
|
443
|
+
*/
|
|
444
|
+
startActivation(spec: SubagentActivationSpec & { readonly childId: SessionId }): Promise<SubagentActivation & { readonly messageId: MessageId }>
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* Start a local or external child.
|
|
448
|
+
* @param spec - task, backend, and result recipient.
|
|
449
|
+
* @returns activation with a message id only for local children.
|
|
520
450
|
*/
|
|
521
|
-
|
|
451
|
+
startActivation(spec: SubagentActivationSpec): Promise<SubagentActivation>
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* Join progressing descendants without cancelling them. Idle descendants whose
|
|
455
|
+
* inboxes require a later wake stay resident and do not delay host completion.
|
|
456
|
+
* @param parent - the exact parent whose descendant work is observed.
|
|
457
|
+
* @returns whether work was joined; hosts recheck parent idle after true.
|
|
458
|
+
*/
|
|
459
|
+
async waitForChildren(parent: Agent): Promise<boolean>
|
|
522
460
|
|
|
523
461
|
/**
|
|
524
462
|
* Steer one model-authored message to the sender's direct parent or direct
|
|
@@ -537,13 +475,13 @@ async startContinuable(spec: ContinuableStartSpec): Promise<ContinuableStart>
|
|
|
537
475
|
async sendMessage( sender: Agent, targetId: SessionId, content: ContentBlock[], options: SubagentSendMessageOptions, ): Promise<MessageId>
|
|
538
476
|
|
|
539
477
|
/**
|
|
540
|
-
* Interrupt one live
|
|
478
|
+
* Interrupt one live child's current execution under a human parent
|
|
541
479
|
* address or an exact live ancestor Agent. Fire-and-return: the cancel
|
|
542
480
|
* signal is issued before this returns, but the target may keep running
|
|
543
481
|
* until it observes the signal. Unclaimed pending inbox work, the Activation,
|
|
544
482
|
* and published descendants are preserved; claimed work is not requeued.
|
|
545
|
-
* Once the interrupted
|
|
546
|
-
* queue.
|
|
483
|
+
* Once the interrupted Agent is idle, a waking send resumes the parked FIFO
|
|
484
|
+
* queue. External backends stop their single execution. An absent target
|
|
547
485
|
* is an accepted no-op, as is a manager-less composition, which cannot own a
|
|
548
486
|
* live Activation.
|
|
549
487
|
* @param targetSessionId - the durable child session id to interrupt.
|
|
@@ -554,28 +492,28 @@ async sendMessage( sender: Agent, targetId: SessionId, content: ContentBlock[],
|
|
|
554
492
|
interrupt(targetSessionId: SessionId, authority: SubagentInterruptAuthority): void
|
|
555
493
|
|
|
556
494
|
/**
|
|
557
|
-
* Close
|
|
495
|
+
* Close subagent admission below exact live parent Agents, stop only their
|
|
558
496
|
* visible descendant Activations synchronously, then await admitted scoped
|
|
559
497
|
* materializations and release those forests child-first. The scoped cutoff
|
|
560
498
|
* lasts until each exact parent leaves the registry; unrelated parent trees
|
|
561
499
|
* remain live.
|
|
562
500
|
* @param parents - exact host-owned parent Agents entering teardown.
|
|
563
|
-
* @returns once every retained descendant
|
|
501
|
+
* @returns once every retained descendant activation released its execution handle.
|
|
564
502
|
* @throws an aggregate error after all branches settle when any failed.
|
|
565
503
|
*/
|
|
566
|
-
async
|
|
504
|
+
async drainDescendants(parents: readonly Agent[]): Promise<void>
|
|
567
505
|
|
|
568
506
|
/**
|
|
569
|
-
* Release selected resident
|
|
507
|
+
* Release selected resident direct children of one exact live
|
|
570
508
|
* parent. Other children of the same parent remain admitted and resident.
|
|
571
509
|
* Absent targets and a manager-less composition are accepted no-ops.
|
|
572
510
|
* @param parent - exact live direct parent authorizing the selected release.
|
|
573
511
|
* @param childIds - durable direct-child ids to release when resident.
|
|
574
|
-
* @returns once every selected
|
|
512
|
+
* @returns once every selected activation released its execution handle.
|
|
575
513
|
* @throws {SubagentError} `UNAUTHORIZED` when a resident target belongs to a
|
|
576
514
|
* different parent or the supplied parent identity is stale.
|
|
577
515
|
*/
|
|
578
|
-
async
|
|
516
|
+
async drainChildren(parent: Agent, childIds: readonly SessionId[]): Promise<void>
|
|
579
517
|
|
|
580
518
|
/**
|
|
581
519
|
* Read the parent's durable direct-child catalog without loading or resuming an Agent.
|
|
@@ -591,7 +529,8 @@ listChildren(parentSessionId: SessionId, signal?: AbortSignal): Promise<Subagent
|
|
|
591
529
|
/**
|
|
592
530
|
* Recursively list reachable parent catalogs in stable pre-order, preserving
|
|
593
531
|
* each catalog's event order. Each row carries its catalog parent and depth;
|
|
594
|
-
* one-shot and unknown-mode children remain
|
|
532
|
+
* external children are leaves; one-shot and unknown-mode children remain
|
|
533
|
+
* traversal nodes. Unknown modes
|
|
595
534
|
* produce unsupported diagnostics. Unreadable child catalogs produce corrupt
|
|
596
535
|
* or unavailable diagnostics and stop only that branch. Root read failures,
|
|
597
536
|
* missing services or projections, and cancellation reject the whole listing.
|
|
@@ -644,7 +583,8 @@ listDescendants(rootSessionId: SessionId, signal?: AbortSignal): Promise<Subagen
|
|
|
644
583
|
/**
|
|
645
584
|
* Register a provider under its name. Registration is effect-scoped and HMR
|
|
646
585
|
* safe; removing a provider blocks new starts but does not revoke runs that
|
|
647
|
-
* were already returned to their holders.
|
|
586
|
+
* were already returned to their holders. Providers without either execution
|
|
587
|
+
* method are rejected with UNSUPPORTED_CAPABILITY before registration.
|
|
648
588
|
* @param provider - the trusted provider implementation.
|
|
649
589
|
* @returns the exact Cordis effect disposer.
|
|
650
590
|
*/
|
|
@@ -662,20 +602,6 @@ getProvider(name: string): SubagentProvider | undefined
|
|
|
662
602
|
* @returns the registered names.
|
|
663
603
|
*/
|
|
664
604
|
list(): string[]
|
|
665
|
-
|
|
666
|
-
/**
|
|
667
|
-
* Establish a published child on the named provider. Capability and semantic
|
|
668
|
-
* checks run before delegation. Provider ownership lasts until its promise
|
|
669
|
-
* fulfills; a rejection therefore has no run for the caller to dispose and
|
|
670
|
-
* emits no run lifecycle events. Post-publication turn and infrastructure
|
|
671
|
-
* failures settle through the returned run.
|
|
672
|
-
* A catalog append failure disposes the run and handles its result rejection;
|
|
673
|
-
* the caller receives the catalog error even if disposal also fails.
|
|
674
|
-
* @param name - the provider to use.
|
|
675
|
-
* @param request - child label, prompt, parent, signal, and optional capabilities.
|
|
676
|
-
* @returns the published holder-owned run.
|
|
677
|
-
*/
|
|
678
|
-
async start(name: string, request: SubagentStartRequest): Promise<SubagentRun>
|
|
679
605
|
```
|
|
680
606
|
|
|
681
607
|
Types: [Agent](./core.md) · [ContentBlock](./llm-streaming.md) · [MessageId](./llm-streaming.md) · [SessionId](./core.md)
|