dsh-plugin-dev-kb 1.1.0 → 1.4.0
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 +31 -0
- package/README.en.md +14 -8
- package/README.md +15 -9
- package/docs/banner.svg +25 -0
- package/kb/INDEX.md +23 -19
- package/kb/README.md +8 -6
- package/kb/extra/AGENTS.md +11 -10
- package/kb/extra/cookbook/adding-a-remote-api.md +2 -2
- package/kb/extra/cookbook/adding-a-remote-api.zh.md +2 -2
- package/kb/extra/cookbook/adding-a-session-format-version.md +151 -0
- package/kb/extra/cookbook/adding-a-session-format-version.zh.md +151 -0
- package/kb/extra/cookbook/adding-a-vendored-package.md +1 -1
- package/kb/extra/cookbook/adding-a-vendored-package.zh.md +1 -1
- package/kb/extra/cookbook/responding-to-pr-review-on-a-stack.md +1 -1
- package/kb/extra/cookbook/responding-to-pr-review-on-a-stack.zh.md +1 -1
- package/kb/extra/cookbook/reviewing-persistence-type-changes.md +120 -0
- package/kb/extra/cookbook/reviewing-persistence-type-changes.zh.md +120 -0
- package/kb/extra/deepseek-llm-api-wire-extensions.md +19 -20
- package/kb/extra/deepseek-llm-api-wire-extensions.zh.md +18 -19
- package/kb/extra/development.md +37 -10
- package/kb/extra/development.zh.md +37 -10
- package/kb/extra/event-producer-consumer.md +90 -67
- package/kb/extra/event-producer-consumer.zh.md +91 -68
- package/kb/extra/glossary.md +1 -1
- package/kb/extra/glossary.zh.md +1 -1
- package/kb/extra/i18n/README.md +16 -7
- package/kb/extra/i18n/README.zh.md +17 -8
- package/kb/extra/i18n/terminology.md +4 -4
- package/kb/extra/i18n/translation-prompt.md +3 -3
- package/kb/extra/module-graph.md +621 -335
- package/kb/extra/module-graph.zh.md +621 -335
- package/kb/extra/persistence-changes/2026-09-11-initial.md +280 -0
- package/kb/extra/persistence-changes/2026-09-11-initial.zh.md +280 -0
- package/kb/extra/persistence-changes/2026-09-12-auto-review-error-metadata.md +52 -0
- package/kb/extra/persistence-changes/2026-09-12-auto-review-error-metadata.zh.md +52 -0
- package/kb/extra/persistence-changes/2026-09-14-image-offload.md +96 -0
- package/kb/extra/persistence-changes/2026-09-14-image-offload.zh.md +96 -0
- package/kb/extra/persistence-changes/2026-09-14-workspace-changes-event.md +48 -0
- package/kb/extra/persistence-changes/2026-09-14-workspace-changes-event.zh.md +48 -0
- package/kb/extra/persistence-changes/2026-09-16-session-format-v4.md +120 -0
- package/kb/extra/persistence-changes/2026-09-16-session-format-v4.zh.md +120 -0
- package/kb/extra/persistence-changes/2026-09-18-schedule-optional-title.md +48 -0
- package/kb/extra/persistence-changes/2026-09-18-schedule-optional-title.zh.md +48 -0
- package/kb/extra/persistence-changes/2026-09-20-unknown-child-catalog.md +48 -0
- package/kb/extra/persistence-changes/2026-09-20-unknown-child-catalog.zh.md +48 -0
- package/kb/extra/persistence-changes/2026-09-21-user-question-reply.md +60 -0
- package/kb/extra/persistence-changes/2026-09-21-user-question-reply.zh.md +60 -0
- package/kb/extra/persistence-changes/README.md +88 -0
- package/kb/extra/persistence-changes/README.zh.md +88 -0
- package/kb/extra/persistence-changes/historical-formats/README.md +75 -0
- package/kb/extra/persistence-changes/historical-formats/README.zh.md +75 -0
- package/kb/extra/persistence-changes/historical-formats/v0.md +5105 -0
- package/kb/extra/persistence-changes/historical-formats/v0.zh.md +5105 -0
- package/kb/extra/persistence-changes/historical-formats/v1.md +5107 -0
- package/kb/extra/persistence-changes/historical-formats/v1.zh.md +5107 -0
- package/kb/extra/persistence-changes/historical-formats/v2.md +5362 -0
- package/kb/extra/persistence-changes/historical-formats/v2.zh.md +5362 -0
- package/kb/extra/persistence-changes/historical-formats/v3.md +5634 -0
- package/kb/extra/persistence-changes/historical-formats/v3.zh.md +5634 -0
- package/kb/extra/persistence-changes/releases/README.md +103 -0
- package/kb/extra/persistence-changes/releases/README.zh.md +103 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.1.md +201 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.1.zh.md +201 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.2.md +261 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.2.zh.md +261 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.3.md +126 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.3.zh.md +126 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.4.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.4.zh.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.5.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.5.zh.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.1.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.1.zh.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.2.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.2.zh.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.3.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.3.zh.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.5.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.5.zh.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.6.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.6.zh.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.7.md +82 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.7.zh.md +82 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.8.md +110 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.8.zh.md +110 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.1.md +82 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.1.zh.md +82 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.2.md +119 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.2.zh.md +119 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.1.md +295 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.1.zh.md +295 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.2.md +286 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.2.zh.md +286 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.3.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.3.zh.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.4.md +95 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.4.zh.md +95 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.5.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.5.zh.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-rc.1.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-rc.1.zh.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.1.md +154 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.1.zh.md +154 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.2.md +86 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.2.zh.md +86 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.1.md +139 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.1.zh.md +139 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.2.md +95 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.2.zh.md +95 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.5-rc.1.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.5-rc.1.zh.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.5-rc.2.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.5-rc.2.zh.md +75 -0
- package/kb/extra/rescope.md +2 -2
- package/kb/extra/rescope.zh.md +2 -2
- package/kb/extra/session-format-status.md +63 -0
- package/kb/extra/session-format-status.zh.md +63 -0
- package/kb/extra/subsystems/agent-team.md +52 -28
- package/kb/extra/subsystems/agent-team.zh.md +52 -28
- package/kb/extra/subsystems/attachment.md +19 -9
- package/kb/extra/subsystems/attachment.zh.md +19 -9
- package/kb/extra/subsystems/boot.md +323 -0
- package/kb/extra/subsystems/boot.zh.md +323 -0
- package/kb/extra/subsystems/browser-use.md +67 -0
- package/kb/extra/subsystems/browser-use.zh.md +67 -0
- package/kb/extra/subsystems/claude-code-mods.md +146 -0
- package/kb/extra/subsystems/claude-code-mods.zh.md +146 -0
- package/kb/extra/subsystems/computer-use.md +56 -0
- package/kb/extra/subsystems/computer-use.zh.md +56 -0
- package/kb/extra/subsystems/deliverables.md +178 -0
- package/kb/extra/subsystems/deliverables.zh.md +178 -0
- package/kb/extra/subsystems/extensions.md +6 -4
- package/kb/extra/subsystems/extensions.zh.md +6 -4
- package/kb/extra/subsystems/feedback.md +165 -31
- package/kb/extra/subsystems/feedback.zh.md +165 -31
- package/kb/extra/subsystems/mcp.md +139 -0
- package/kb/extra/subsystems/mcp.zh.md +139 -0
- package/kb/extra/subsystems/office-to-pdf.md +87 -0
- package/kb/extra/subsystems/office-to-pdf.zh.md +87 -0
- package/kb/extra/subsystems/otel.md +44 -0
- package/kb/extra/subsystems/otel.zh.md +44 -0
- package/kb/extra/subsystems/product-telemetry.md +79 -0
- package/kb/extra/subsystems/product-telemetry.zh.md +79 -0
- package/kb/extra/subsystems/ssh.md +135 -0
- package/kb/extra/subsystems/ssh.zh.md +135 -0
- package/kb/extra/subsystems/todo.md +3 -3
- package/kb/extra/subsystems/todo.zh.md +3 -3
- package/kb/extra/subsystems/voice-input.md +164 -0
- package/kb/extra/subsystems/voice-input.zh.md +164 -0
- package/kb/extra/subsystems/webhook.md +3 -3
- package/kb/extra/subsystems/webhook.zh.md +1 -1
- package/kb/extra/testing.md +5 -4
- package/kb/extra/testing.zh.md +5 -4
- package/kb/extra/ui-radius.md +115 -0
- package/kb/extra/ui-radius.zh.md +115 -0
- package/kb/extra/upgrade-guide/v0.1.7-rc.2/schedule-optional-bundle/guide.md +22 -0
- package/kb/extra/upgrade-guide/v0.1.7-rc.2/schedule-optional-bundle/guide.zh.md +22 -0
- package/kb/extra/upgrade-guide/v0.1.7-rc.2/transcript-view-legacy-normal/guide.md +25 -0
- package/kb/extra/upgrade-guide/v0.1.7-rc.2/transcript-view-legacy-normal/guide.zh.md +25 -0
- package/kb/extra/upgrade-guide/v0.2.0-rc.2/account-sign-in-errors/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.0-rc.2/account-sign-in-errors/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.0-rc.2/remove-runtime-invariants/guide.md +23 -0
- package/kb/extra/upgrade-guide/v0.2.0-rc.2/remove-runtime-invariants/guide.zh.md +23 -0
- package/kb/extra/upgrade-guide/v0.2.0-rc.2/schedule-bundle-retired/guide.md +22 -0
- package/kb/extra/upgrade-guide/v0.2.0-rc.2/schedule-bundle-retired/guide.zh.md +22 -0
- package/kb/extra/upgrade-guide/v0.2.0-rc.2/subpath-plugin-display-manifest/guide.md +27 -0
- package/kb/extra/upgrade-guide/v0.2.0-rc.2/subpath-plugin-display-manifest/guide.zh.md +27 -0
- package/kb/extra/web-styling.md +12 -2
- package/kb/extra/web-styling.zh.md +12 -2
- package/kb/meta/search-index.json +1019 -251
- package/kb/meta/site-pages.txt +187 -183
- package/kb/meta/source.json +8 -8
- package/kb/meta/topics.md +11 -7
- package/kb/site/develop/basic/config.md +1 -0
- package/kb/site/develop/basic/index.md +1 -0
- package/kb/site/develop/basic/publish.md +10 -3
- package/kb/site/develop/basic/tool.md +1 -0
- package/kb/site/develop/cordis-tutorial/01-first-plugin.md +1 -0
- package/kb/site/develop/cordis-tutorial/02-lifecycle-and-effects.md +1 -0
- package/kb/site/develop/cordis-tutorial/03-services.md +1 -0
- package/kb/site/develop/cordis-tutorial/04-events.md +1 -0
- package/kb/site/develop/cordis-tutorial/05-config.md +28 -0
- package/kb/site/develop/cordis-tutorial/06-composition-and-hmr.md +3 -2
- package/kb/site/develop/cordis-tutorial/07-into-the-harness.md +1 -0
- package/kb/site/develop/cordis-tutorial/index.md +1 -0
- package/kb/site/develop/framework/events.md +1 -0
- package/kb/site/develop/framework/index.md +2 -1
- package/kb/site/develop/framework/service.md +1 -0
- package/kb/site/develop/practice/dynamic-cordis.md +9 -8
- package/kb/site/develop/practice/index.md +1 -0
- package/kb/site/develop/practice/llm-adapter.md +2 -1
- package/kb/site/en/develop/basic/config.md +1 -0
- package/kb/site/en/develop/basic/index.md +1 -0
- package/kb/site/en/develop/basic/publish.md +10 -3
- package/kb/site/en/develop/basic/tool.md +1 -0
- package/kb/site/en/develop/cordis-tutorial/01-first-plugin.md +1 -0
- package/kb/site/en/develop/cordis-tutorial/02-lifecycle-and-effects.md +1 -0
- package/kb/site/en/develop/cordis-tutorial/03-services.md +1 -0
- package/kb/site/en/develop/cordis-tutorial/04-events.md +1 -0
- package/kb/site/en/develop/cordis-tutorial/05-config.md +28 -0
- package/kb/site/en/develop/cordis-tutorial/06-composition-and-hmr.md +3 -2
- package/kb/site/en/develop/cordis-tutorial/07-into-the-harness.md +1 -0
- package/kb/site/en/develop/cordis-tutorial/index.md +1 -0
- package/kb/site/en/develop/framework/events.md +1 -0
- package/kb/site/en/develop/framework/index.md +2 -1
- package/kb/site/en/develop/framework/service.md +1 -0
- package/kb/site/en/develop/practice/dynamic-cordis.md +9 -8
- package/kb/site/en/develop/practice/index.md +1 -0
- package/kb/site/en/develop/practice/llm-adapter.md +2 -1
- package/kb/site/en/guide/github-review.md +1 -0
- package/kb/site/en/guide/mcp-memory.md +1 -0
- package/kb/site/en/guide/network-proxy.md +2 -1
- package/kb/site/en/guide/providers-custom-form.png +0 -0
- package/kb/site/en/guide/providers-models-page.png +0 -0
- package/kb/site/en/guide/providers.md +98 -83
- package/kb/site/en/guide/public-deployments.md +36 -0
- package/kb/site/en/guide/python-sdk.md +60 -23
- package/kb/site/en/guide/quickstart.md +2 -0
- package/kb/site/en/guide/schedule.md +70 -11
- package/kb/site/en/reference/agent-lifecycle.md +13 -5
- package/kb/site/en/reference/api-gateway.md +13 -11
- package/kb/site/en/reference/capability-seams.md +187 -62
- package/kb/site/en/reference/config-catalog.md +1887 -819
- package/kb/site/en/reference/cookbook/adding-a-package.md +57 -3
- package/kb/site/en/reference/cookbook/adding-a-settings-card.md +35 -64
- package/kb/site/en/reference/cookbook/adding-a-tool.md +5 -4
- package/kb/site/en/reference/cookbook/adding-an-llm-adapter.md +1 -0
- package/kb/site/en/reference/cookbook/extension-cookbook.md +7 -6
- package/kb/site/en/reference/cordis-api/context.md +1 -0
- package/kb/site/en/reference/cordis-api/events.md +1 -0
- package/kb/site/en/reference/cordis-api/fiber.md +4 -3
- package/kb/site/en/reference/cordis-api/inherited.md +16 -16
- package/kb/site/en/reference/cordis-api/registry.md +1 -0
- package/kb/site/en/reference/cordis-api/service.md +1 -0
- package/kb/site/en/reference/cordis-primer.md +1 -0
- package/kb/site/en/reference/index.md +32 -15
- package/kb/site/en/reference/persistence-catalog.md +7787 -81
- package/kb/site/en/reference/subsystems/approval.md +3 -2
- package/kb/site/en/reference/subsystems/client-modules.md +30 -13
- package/kb/site/en/reference/subsystems/client-resources.md +96 -0
- package/kb/site/en/reference/subsystems/commands.md +6 -1
- package/kb/site/en/reference/subsystems/compaction.md +50 -3
- package/kb/site/en/reference/subsystems/conversation.md +36 -6
- package/kb/site/en/reference/subsystems/core.md +174 -271
- package/kb/site/en/reference/subsystems/credentials.md +169 -5
- package/kb/site/en/reference/subsystems/filesystem.md +26 -0
- package/kb/site/en/reference/subsystems/goal.md +39 -2
- package/kb/site/en/reference/subsystems/index.md +18 -5
- package/kb/site/en/reference/subsystems/jobs.md +337 -127
- package/kb/site/en/reference/subsystems/llm-streaming.md +93 -43
- package/kb/site/en/reference/subsystems/lsp.md +2 -1
- package/kb/site/en/reference/subsystems/permission-presets.md +66 -29
- package/kb/site/en/reference/subsystems/persistence.md +40 -18
- package/kb/site/en/reference/subsystems/plan.md +2 -1
- package/kb/site/en/reference/subsystems/ptc-runtime.md +236 -0
- package/kb/site/en/reference/subsystems/sandbox.md +7 -5
- package/kb/site/en/reference/subsystems/schedule.md +392 -33
- package/kb/site/en/reference/subsystems/scope.md +2 -1
- package/kb/site/en/reference/subsystems/session-projection.md +22 -19
- package/kb/site/en/reference/subsystems/session-query.md +1 -0
- package/kb/site/en/reference/subsystems/session-reference.md +12 -6
- package/kb/site/en/reference/subsystems/session-telemetry.md +27 -8
- package/kb/site/en/reference/subsystems/session-title.md +6 -5
- package/kb/site/en/reference/subsystems/session.md +258 -118
- package/kb/site/en/reference/subsystems/settings.md +43 -292
- package/kb/site/en/reference/subsystems/shell.md +44 -32
- package/kb/site/en/reference/subsystems/sidebar-right.md +162 -0
- package/kb/site/en/reference/subsystems/skills.md +5 -6
- package/kb/site/en/reference/subsystems/slots.md +68 -39
- package/kb/site/en/reference/subsystems/spill.md +15 -7
- package/kb/site/en/reference/subsystems/storage.md +2 -2
- package/kb/site/en/reference/subsystems/subagent.md +65 -72
- package/kb/site/en/reference/subsystems/subprocess.md +42 -44
- package/kb/site/en/reference/subsystems/system-prompt.md +7 -2
- package/kb/site/en/reference/subsystems/terminal.md +1 -0
- package/kb/site/en/reference/subsystems/token-meter.md +3 -1
- package/kb/site/en/reference/subsystems/tools.md +44 -16
- package/kb/site/en/reference/subsystems/typert.md +153 -10
- package/kb/site/en/reference/subsystems/user-questions.md +131 -1
- package/kb/site/en/reference/subsystems/web-client.md +15 -9
- package/kb/site/en/reference/subsystems/web-server.md +74 -1
- package/kb/site/en/reference/subsystems/web.md +1 -0
- package/kb/site/en/reference/subsystems/workflow.md +10 -9
- package/kb/site/en/reference/subsystems/workspace.md +343 -4
- package/kb/site/en/reference/tool-catalog.md +806 -311
- package/kb/site/en/reference/tool-execution-pipeline.md +9 -5
- package/kb/site/guide/github-review.md +1 -0
- package/kb/site/guide/mcp-memory.md +1 -0
- package/kb/site/guide/network-proxy.md +2 -1
- package/kb/site/guide/providers-custom-form.zh.png +0 -0
- package/kb/site/guide/providers-models-page.zh.png +0 -0
- package/kb/site/guide/providers.md +109 -94
- package/kb/site/guide/public-deployments.md +36 -0
- package/kb/site/guide/python-sdk.md +60 -23
- package/kb/site/guide/quickstart.md +2 -0
- package/kb/site/guide/schedule.md +70 -11
- package/kb/site/reference/agent-lifecycle.md +13 -5
- package/kb/site/reference/api-gateway.md +13 -11
- package/kb/site/reference/capability-seams.md +187 -62
- package/kb/site/reference/config-catalog.md +1889 -820
- package/kb/site/reference/cookbook/adding-a-package.md +55 -3
- package/kb/site/reference/cookbook/adding-a-settings-card.md +35 -64
- package/kb/site/reference/cookbook/adding-a-tool.md +5 -4
- package/kb/site/reference/cookbook/adding-an-llm-adapter.md +1 -0
- package/kb/site/reference/cookbook/extension-cookbook.md +7 -6
- package/kb/site/reference/cordis-api/context.md +1 -0
- package/kb/site/reference/cordis-api/events.md +1 -0
- package/kb/site/reference/cordis-api/fiber.md +4 -3
- package/kb/site/reference/cordis-api/inherited.md +16 -16
- package/kb/site/reference/cordis-api/registry.md +1 -0
- package/kb/site/reference/cordis-api/service.md +1 -0
- package/kb/site/reference/cordis-primer.md +1 -0
- package/kb/site/reference/index.md +32 -15
- package/kb/site/reference/persistence-catalog.md +7791 -85
- package/kb/site/reference/subsystems/approval.md +3 -2
- package/kb/site/reference/subsystems/client-modules.md +30 -13
- package/kb/site/reference/subsystems/client-resources.md +96 -0
- package/kb/site/reference/subsystems/commands.md +6 -1
- package/kb/site/reference/subsystems/compaction.md +50 -3
- package/kb/site/reference/subsystems/conversation.md +35 -5
- package/kb/site/reference/subsystems/core.md +174 -271
- package/kb/site/reference/subsystems/credentials.md +169 -5
- package/kb/site/reference/subsystems/filesystem.md +26 -0
- package/kb/site/reference/subsystems/goal.md +39 -2
- package/kb/site/reference/subsystems/index.md +28 -15
- package/kb/site/reference/subsystems/jobs.md +336 -126
- package/kb/site/reference/subsystems/llm-streaming.md +93 -43
- package/kb/site/reference/subsystems/lsp.md +2 -1
- package/kb/site/reference/subsystems/permission-presets.md +66 -29
- package/kb/site/reference/subsystems/persistence.md +40 -18
- package/kb/site/reference/subsystems/plan.md +2 -1
- package/kb/site/reference/subsystems/ptc-runtime.md +236 -0
- package/kb/site/reference/subsystems/sandbox.md +7 -5
- package/kb/site/reference/subsystems/schedule.md +392 -33
- package/kb/site/reference/subsystems/scope.md +2 -1
- package/kb/site/reference/subsystems/session-projection.md +22 -19
- package/kb/site/reference/subsystems/session-query.md +1 -0
- package/kb/site/reference/subsystems/session-reference.md +12 -6
- package/kb/site/reference/subsystems/session-telemetry.md +27 -8
- package/kb/site/reference/subsystems/session-title.md +6 -5
- package/kb/site/reference/subsystems/session.md +258 -118
- package/kb/site/reference/subsystems/settings.md +43 -292
- package/kb/site/reference/subsystems/shell.md +44 -32
- package/kb/site/reference/subsystems/sidebar-right.md +162 -0
- package/kb/site/reference/subsystems/skills.md +5 -6
- package/kb/site/reference/subsystems/slots.md +68 -39
- package/kb/site/reference/subsystems/spill.md +15 -7
- package/kb/site/reference/subsystems/storage.md +2 -2
- package/kb/site/reference/subsystems/subagent.md +64 -71
- package/kb/site/reference/subsystems/subprocess.md +42 -44
- package/kb/site/reference/subsystems/system-prompt.md +7 -2
- package/kb/site/reference/subsystems/terminal.md +1 -0
- package/kb/site/reference/subsystems/token-meter.md +3 -1
- package/kb/site/reference/subsystems/tools.md +44 -16
- package/kb/site/reference/subsystems/typert.md +153 -10
- package/kb/site/reference/subsystems/user-questions.md +132 -2
- package/kb/site/reference/subsystems/web-client.md +15 -9
- package/kb/site/reference/subsystems/web-server.md +74 -1
- package/kb/site/reference/subsystems/web.md +1 -0
- package/kb/site/reference/subsystems/workflow.md +10 -9
- package/kb/site/reference/subsystems/workspace.md +343 -4
- package/kb/site/reference/tool-catalog.md +810 -315
- package/kb/site/reference/tool-execution-pipeline.md +9 -5
- package/lib/index.js +25 -44
- package/package.json +3 -2
- package/skills/dsh-plugin-dev-kb.md +6 -5
- package/kb/site/en/reference/subsystems/code-runtime.md +0 -198
- package/kb/site/en/reference/subsystems/invariants.md +0 -91
- package/kb/site/reference/subsystems/code-runtime.md +0 -198
- package/kb/site/reference/subsystems/invariants.md +0 -91
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
editSource: "docs/tool-execution-pipeline.zh.md"
|
|
3
|
+
rawMarkdownPath: "reference/tool-execution-pipeline.md"
|
|
3
4
|
---
|
|
4
5
|
|
|
5
6
|
<!-- 英文源文件由 scripts/gen-doc-graphs.ts 生成;本中文文件是通过双语配对维护的经评审对侧。
|
|
@@ -7,7 +8,7 @@ editSource: "docs/tool-execution-pipeline.zh.md"
|
|
|
7
8
|
|
|
8
9
|
# 工具执行流水线
|
|
9
10
|
|
|
10
|
-
此图展示策略、钩子、沙箱、文件系统守卫、结果重写、最终结果观察和 UI 渲染在不改变循环的情况下何时运行。`tools/pre-execute` waterfall(瀑布式事件)首先运行,随后是单调守卫,然后运行 `tools/execute` 和 `tools/post-execute` waterfall;这三个 waterfall 可以改写一次调用。由定义自身控制的 `finalizeContent` 和 `tools/result` 在此之后运行。
|
|
11
|
+
此图展示策略、钩子、沙箱、文件系统守卫、结果重写、最终结果观察和 UI 渲染在不改变循环的情况下何时运行。`tools/pre-execute` waterfall(瀑布式事件)首先运行,随后是单调守卫,然后运行 `tools/execute` 和 `tools/post-execute` waterfall;这三个 waterfall 可以改写一次调用。由定义自身控制的 `projectContent` 在执行后策略之前安装已准备内容;`finalizeContent` 和 `tools/result` 在此之后运行。
|
|
11
12
|
|
|
12
13
|
```mermaid
|
|
13
14
|
flowchart TD
|
|
@@ -21,7 +22,8 @@ flowchart TD
|
|
|
21
22
|
around["<code>tools/execute</code> waterfall<br/>timeout, retry, metrics (around dispatch)"]
|
|
22
23
|
toolBody["Registered tool execute() body"]
|
|
23
24
|
fsGate["<code>fs/write-intent</code> or <code>fs/edit-intent</code><br/>tool-fs mutations only"]
|
|
24
|
-
owned["Tool-owned session events<br/><code>todo/write</code>, <code>fs/observed</code>, <code>hook/invoked</code>, <code>hook/result</code>, <code>tool/
|
|
25
|
+
owned["Tool-owned session events<br/><code>todo/write</code>, <code>fs/observed</code>, <code>hook/invoked</code>, <code>hook/result</code>, <code>tool/ptc-dispatch</code>"]
|
|
26
|
+
project["ToolDefinition.projectContent<br/>execution-prepared text and images"]
|
|
25
27
|
post["<code>tools/post-execute</code> waterfall<br/>accept, block, replace, add context"]
|
|
26
28
|
normalized["Registry outer normalization<br/>pipeline/result snapshot throws become isError"]
|
|
27
29
|
finalize["ToolDefinition.finalizeContent<br/>last content-only invariant"]
|
|
@@ -43,13 +45,15 @@ flowchart TD
|
|
|
43
45
|
approval -->|allowed-once| guards
|
|
44
46
|
approval -->|rejected, cancelled, unavailable| denied
|
|
45
47
|
approval -.->|throw| normalized
|
|
46
|
-
denied -->
|
|
48
|
+
denied --> project
|
|
47
49
|
pre -.->|throw| normalized
|
|
48
50
|
toolBody --> fsGate
|
|
49
51
|
fsGate --> toolBody
|
|
50
52
|
toolBody --> owned
|
|
51
53
|
toolBody --> around
|
|
52
|
-
around -->
|
|
54
|
+
around --> project
|
|
55
|
+
project --> post
|
|
56
|
+
project -.->|throw| normalized
|
|
53
57
|
around -.->|wrapper throws| normalized
|
|
54
58
|
post -.->|throw| normalized
|
|
55
59
|
post --> finalize
|
|
@@ -61,6 +65,6 @@ flowchart TD
|
|
|
61
65
|
allResults --> context
|
|
62
66
|
```
|
|
63
67
|
|
|
64
|
-
文件系统的先读后编辑检查位于 `tool-fs` 之下,通过 `fs/*` 事件实现。通用的前置/后置 waterfall 承载钩子与审批策略;`ctx.approval` 在单调守卫之前处理询问,而不得重新排序的所有者策略仍作为已注册的守卫。超时等环绕分发关注点对 `tools/execute` 进行包装。注册表会对候选结果进行无损快照;如果快照失败,则会先将失败规范化,之后再由可见定义中已随快照固定的 `finalizeContent` 回调强制执行其同步且仅限内容的不变式。随后,`tools/result` 会观察不可变、可由 JSON 无损表示的结果。这样一来,钩子便可跨越不同工具系列,而无需让工具与某个策略服务耦合。PTC mode 会将保留的 `run_code` 传输及其序列化子调用都送入流水线;子调用携带父级 token、记录 `tool/
|
|
68
|
+
文件系统的先读后编辑检查位于 `tool-fs` 之下,通过 `fs/*` 事件实现。通用的前置/后置 waterfall 承载钩子与审批策略;`ctx.approval` 在单调守卫之前处理询问,而不得重新排序的所有者策略仍作为已注册的守卫。超时等环绕分发关注点对 `tools/execute` 进行包装。注册表会对候选结果进行无损快照;如果快照失败,则会先将失败规范化,之后再由可见定义中已随快照固定的 `finalizeContent` 回调强制执行其同步且仅限内容的不变式。随后,`tools/result` 会观察不可变、可由 JSON 无损表示的结果。这样一来,钩子便可跨越不同工具系列,而无需让工具与某个策略服务耦合。PTC mode 会将保留的 `run_code` 传输及其序列化子调用都送入流水线;子调用携带父级 token、记录 `tool/ptc-dispatch`、将拒绝呈现为具有约束力的驳回,并省略 `additionalContexts`,以保持调用与结果相邻。
|
|
65
69
|
|
|
66
70
|
维护模式:英文源文件包含人工维护的 Mermaid 流程图,并由生成器写出;本中文文件作为经评审对侧通过双语配对维护。确切的工具 schema 与事件签名位于生成的目录中。
|
package/lib/index.js
CHANGED
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
* 从插件目录解析不到;这里本来也不需要)。
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { existsSync, readdirSync, readFileSync
|
|
18
|
-
import { homedir } from 'node:os'
|
|
17
|
+
import { existsSync, readdirSync, readFileSync } from 'node:fs'
|
|
19
18
|
import { dirname, join } from 'node:path'
|
|
20
19
|
import { fileURLToPath } from 'node:url'
|
|
21
20
|
|
|
@@ -26,6 +25,14 @@ const PKG_DIR = dirname(fileURLToPath(import.meta.url))
|
|
|
26
25
|
const SKILLS_DIR = join(PKG_DIR, '..', 'skills')
|
|
27
26
|
const KB_DIR = join(PKG_DIR, '..', 'kb')
|
|
28
27
|
|
|
28
|
+
/** logger 拿不到时降级 console。 */
|
|
29
|
+
function makeLogger(ctx, tag) {
|
|
30
|
+
return {
|
|
31
|
+
info: (...args) => (ctx.logger?.info ? ctx.logger.info(...args) : console.log(tag, ...args)),
|
|
32
|
+
warn: (...args) => (ctx.logger?.warn ? ctx.logger.warn(...args) : console.warn(tag, ...args))
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
29
36
|
/** 极简 frontmatter 解析(name/description/whenToUse)。 */
|
|
30
37
|
function parseFrontmatter(md) {
|
|
31
38
|
const match = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?/.exec(md)
|
|
@@ -41,10 +48,10 @@ function parseFrontmatter(md) {
|
|
|
41
48
|
}
|
|
42
49
|
|
|
43
50
|
/** 从 skills/ 目录加载技能定义(文件缺失/无 frontmatter 时跳过并警告,绝不让插件挂载失败)。 */
|
|
44
|
-
function loadSkills() {
|
|
51
|
+
function loadSkills(log) {
|
|
45
52
|
const out = []
|
|
46
53
|
if (!existsSync(SKILLS_DIR)) {
|
|
47
|
-
|
|
54
|
+
log.warn('skills 目录缺失,技能未加载:' + SKILLS_DIR)
|
|
48
55
|
return out
|
|
49
56
|
}
|
|
50
57
|
for (const file of readdirSync(SKILLS_DIR)) {
|
|
@@ -52,7 +59,7 @@ function loadSkills() {
|
|
|
52
59
|
try {
|
|
53
60
|
const fm = parseFrontmatter(readFileSync(join(SKILLS_DIR, file), 'utf8'))
|
|
54
61
|
if (!fm.name || !fm.description) {
|
|
55
|
-
|
|
62
|
+
log.warn(`技能文件缺少 name/description frontmatter,已跳过:${file}`)
|
|
56
63
|
continue
|
|
57
64
|
}
|
|
58
65
|
out.push({
|
|
@@ -62,20 +69,14 @@ function loadSkills() {
|
|
|
62
69
|
body: fm.body
|
|
63
70
|
})
|
|
64
71
|
} catch (err) {
|
|
65
|
-
|
|
72
|
+
log.warn(`技能文件读取失败,已跳过:${file}(${err?.message ?? err})`)
|
|
66
73
|
}
|
|
67
74
|
}
|
|
68
75
|
return out
|
|
69
76
|
}
|
|
70
77
|
|
|
71
|
-
/** 挂载状态文件(自诊断:$DSH_HOME/dsh-plugin-dev-kb.state.json)。 */
|
|
72
|
-
function dshHome() {
|
|
73
|
-
return process.env.DSH_HOME || join(homedir(), '.dsh')
|
|
74
|
-
}
|
|
75
|
-
|
|
76
78
|
export function apply(ctx, config) {
|
|
77
|
-
const
|
|
78
|
-
const state = { skills: [] }
|
|
79
|
+
const log = makeLogger(ctx, '[dsh-plugin-dev-kb]')
|
|
79
80
|
|
|
80
81
|
// 契约(dsh-skill validateDefinition):定义必须含 name/description/
|
|
81
82
|
// source/content 四个字符串;provider 缺省为 'runtime'。
|
|
@@ -85,37 +86,17 @@ export function apply(ctx, config) {
|
|
|
85
86
|
// resourceBase 让 skill 工具渲染相对资源引导——知识库位置随插件安装
|
|
86
87
|
// 位置动态解析,不依赖任何写死的机器路径。
|
|
87
88
|
const kbRoot = KB_DIR.replaceAll('\\', '/')
|
|
88
|
-
for (const skill of loadSkills()) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
state.skills.push(skill.name)
|
|
99
|
-
console.log(`[dsh-plugin-dev-kb] 技能已注册:${skill.name}`)
|
|
100
|
-
} catch (err) {
|
|
101
|
-
console.warn(`[dsh-plugin-dev-kb] 技能注册失败:${skill.name}(${err?.message ?? err})`)
|
|
102
|
-
}
|
|
89
|
+
for (const skill of loadSkills(log)) {
|
|
90
|
+
ctx.effect(() => ctx.skills.register({
|
|
91
|
+
name: skill.name,
|
|
92
|
+
description: skill.description,
|
|
93
|
+
...(skill.whenToUse ? { whenToUse: skill.whenToUse } : {}),
|
|
94
|
+
source: 'runtime',
|
|
95
|
+
content: skill.body.replaceAll('{{KB_ROOT}}', kbRoot),
|
|
96
|
+
resourceBase: { kind: 'directory', path: KB_DIR }
|
|
97
|
+
}), `dsh-plugin-dev-kb: register skill ${skill.name}`)
|
|
98
|
+
log.info(`技能已注册:${skill.name}`)
|
|
103
99
|
}
|
|
104
100
|
|
|
105
|
-
|
|
106
|
-
writeFileSync(join(dshHome(), 'dsh-plugin-dev-kb.state.json'), JSON.stringify({
|
|
107
|
-
plugin: 'dsh-plugin-dev-kb',
|
|
108
|
-
mountedAt: new Date().toISOString(),
|
|
109
|
-
skills: state.skills
|
|
110
|
-
}, null, 2), 'utf8')
|
|
111
|
-
} catch { /* 状态文件写入失败不影响挂载 */ }
|
|
112
|
-
|
|
113
|
-
console.log(`[dsh-plugin-dev-kb] 已挂载:${state.skills.length} 技能(知识库在 kb/ 目录)`)
|
|
114
|
-
|
|
115
|
-
// 卸载清理(HMR 重载时避免重复注册)。
|
|
116
|
-
return () => {
|
|
117
|
-
for (const dispose of disposers) {
|
|
118
|
-
try { dispose() } catch { /* ignore */ }
|
|
119
|
-
}
|
|
120
|
-
}
|
|
101
|
+
log.info(`已挂载(知识库在 kb/ 目录)`)
|
|
121
102
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-dev-kb",
|
|
3
|
-
"description": "dsh 插件开发知识库:DeepSeek Harness 官方文档站完整 Markdown 镜像(中英双语
|
|
4
|
-
"version": "1.
|
|
3
|
+
"description": "dsh 插件开发知识库:DeepSeek Harness 官方文档站完整 Markdown 镜像(中英双语 188 页)+ 182 篇仓库补充开发参考 + 主题导航与 373 文件全量搜索索引;以 dsh-plugin-dev-kb 技能让 agent 在插件开发任务中自动加载定位文档。纯数据插件,零运行时依赖。",
|
|
4
|
+
"version": "1.4.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
"lib",
|
|
13
|
+
"docs",
|
|
13
14
|
"kb",
|
|
14
15
|
"skills",
|
|
15
16
|
"scripts",
|
|
@@ -16,18 +16,19 @@ whenToUse: 开发 dsh 插件、查询 dsh 能力与 API、写 Tool、配置 cord
|
|
|
16
16
|
|
|
17
17
|
```
|
|
18
18
|
kb/
|
|
19
|
-
├── site/ 线上站点完整镜像(中英双语
|
|
20
|
-
│ ├── guide/ 入门:quickstart / providers / python-sdk / github-review / schedule / mcp-memory / network-proxy
|
|
19
|
+
├── site/ 线上站点完整镜像(中英双语 188 页,优先读这里)
|
|
20
|
+
│ ├── guide/ 入门:quickstart / providers / python-sdk / github-review / schedule / mcp-memory / network-proxy / public-deployments
|
|
21
21
|
│ ├── develop/ basic(第一个插件/tool/config/publish)、framework(生命周期/服务/事件)、
|
|
22
22
|
│ │ practice(能力分层/LLM适配器/动态装配)、cordis-tutorial(7章)
|
|
23
23
|
│ ├── reference/ index(架构)、cordis-primer、capability-seams、agent-lifecycle、
|
|
24
24
|
│ │ config-catalog、tool-catalog、api-gateway、cordis-api/(6)、cookbook/(5)、subsystems/(46)
|
|
25
25
|
│ └── en/ 英文站镜像(结构与中文站一致)
|
|
26
|
-
├── extra/ 仓库内未发布到站点的补充文档(
|
|
27
|
-
│ module-graph、testing、postmortem
|
|
26
|
+
├── extra/ 仓库内未发布到站点的补充文档(182 篇):glossary、defensive-patterns、
|
|
27
|
+
│ module-graph、testing、postmortem/、i18n/、cookbook 与 subsystems 扩展、
|
|
28
|
+
│ upgrade-guide/(各版本升级指南)、persistence-changes/(持久化格式变更)
|
|
28
29
|
├── meta/
|
|
29
30
|
│ ├── topics.md ★ 主题导航:任务场景 → 要读的文件(先用这个)
|
|
30
|
-
│ ├── search-index.json 全量检索索引(
|
|
31
|
+
│ ├── search-index.json 全量检索索引(373 文件:path/url/title/字符数)
|
|
31
32
|
│ ├── source.json 来源信息(commit/时间/统计)
|
|
32
33
|
│ └── site-pages.txt 线上站点页面清单
|
|
33
34
|
├── INDEX.md 全部 站点 URL ↔ 本地文件 对照
|
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
editSource: "docs/subsystems/code-runtime.md"
|
|
3
|
-
outline: [2,3]
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Code Runtime
|
|
7
|
-
|
|
8
|
-
The code-execution seam — a [capability seam](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/architecture/2026-06-13-capability-seams.md) whose Service Definition ([dsh-code-runtime](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/code-runtime/code-runtime), `ctx.codeRuntime`) runs one model-written program against host-provided async bindings and reports what it printed and returned. Code execution is **one optional capability**, not part of the agent-loop spine — so its vocabulary lives here, not in [core.md](./core.md). Backends differ by execution substrate and source language, both readonly descriptors on the service; the worker-thread Service Provider and tool-registry Consumer are specified by the [PTC mode foundation](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/feature/2026-06-15-ptc.md) and [typed-return contract](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/feature/2026-07-20-ptc-typed-tool-returns.md).
|
|
9
|
-
|
|
10
|
-
Source: [`packages/code-runtime/code-runtime/src/types.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/code-runtime/code-runtime/src/types.ts)
|
|
11
|
-
|
|
12
|
-
## The run: request in, result out
|
|
13
|
-
|
|
14
|
-
A `CodeRunRequest` carries **everything the runtime acts on** — per the "explicit > implicit at package boundaries" rule, defaulting (time budgets, output caps) is the implementation's validated config, never a hidden `??` inside `run()`:
|
|
15
|
-
|
|
16
|
-
```ts type-equiv
|
|
17
|
-
/**
|
|
18
|
-
* One run: the program source plus everything the runtime acts on. Per the
|
|
19
|
-
* explicit-over-implicit convention, defaulting (time budgets, output caps)
|
|
20
|
-
* is the implementation's validated config — a request carries no optional
|
|
21
|
-
* tuning knobs for a hidden `??` to fill in.
|
|
22
|
-
*/
|
|
23
|
-
interface CodeRunRequest {
|
|
24
|
-
/**
|
|
25
|
-
* The program source, in the runtime's {@link ../index.ts | language}. It
|
|
26
|
-
* runs as the body of an async function: top-level `await` and `return`
|
|
27
|
-
* are available, and the completion value becomes
|
|
28
|
-
* {@link CodeRunResult.value}.
|
|
29
|
-
*/
|
|
30
|
-
program: string
|
|
31
|
-
/** Host functions exposed to the program, one global object per namespace. */
|
|
32
|
-
bindings: CodeBindingNamespace[]
|
|
33
|
-
/**
|
|
34
|
-
* Abort the run: the runtime stops the program (hard, even mid-loop) and
|
|
35
|
-
* resolves with a {@link CodeRunFailure} of kind `'abort'`. In-flight
|
|
36
|
-
* binding calls are the CALLER's to settle — the runtime only stops asking.
|
|
37
|
-
*/
|
|
38
|
-
signal?: AbortSignal
|
|
39
|
-
}
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
The result reports an error as a **field**, never a rejection of `run()` — reporting a failed program is the caller's job, not an exception path (matching `ShellExecutor.run`'s resolve-on-failure contract):
|
|
43
|
-
|
|
44
|
-
```ts type-equiv
|
|
45
|
-
/**
|
|
46
|
-
* The outcome of one run. An error is a FIELD on a resolved result, never a
|
|
47
|
-
* rejection of `run()` — reporting a failed program is the caller's job, not
|
|
48
|
-
* an exception path.
|
|
49
|
-
*/
|
|
50
|
-
interface CodeRunResult {
|
|
51
|
-
/**
|
|
52
|
-
* The program's completion value (its top-level `return`), when it ran to
|
|
53
|
-
* completion and the value crossed the runtime's lossless-JSON boundary.
|
|
54
|
-
* Invalid or over-limit completions fail the run instead of substituting a
|
|
55
|
-
* rendered string; a failed or value-less run leaves this absent.
|
|
56
|
-
*/
|
|
57
|
-
value?: CodeJsonValue
|
|
58
|
-
/**
|
|
59
|
-
* Captured text. Each source channel preserves emission order; interleaving
|
|
60
|
-
* across independent channels is backend-dependent. Bounded only as part of
|
|
61
|
-
* the outer result.
|
|
62
|
-
*/
|
|
63
|
-
logs: string[]
|
|
64
|
-
/** Present iff the run failed; see {@link CodeRunFailure} for the taxonomy. */
|
|
65
|
-
error?: CodeRunFailure
|
|
66
|
-
}
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
## Bindings: host functions as program globals
|
|
70
|
-
|
|
71
|
-
Each `CodeBindingNamespace` becomes one global object of async callables inside the program (the PTC mode consumer passes one: `tools`). Arguments and resolutions must be lossless JSON and cross without a seam-level byte cap; the runtime may bridge them through structured clone. A namespace may declare a program-visible error class without making the runtime know the consumer's names: the runtime injects the real constructor and turns rejected calls into its instances. A runtime also treats binding names as hostile input (`__proto__` is an ordinary own property, never a prototype collision):
|
|
72
|
-
|
|
73
|
-
```ts type-equiv
|
|
74
|
-
/**
|
|
75
|
-
* Program-visible typed rejection for one binding namespace. The runtime
|
|
76
|
-
* injects a real error constructor under `name`; rejected member calls become
|
|
77
|
-
* its instances and expose the exact member name through
|
|
78
|
-
* `memberNameProperty`. Both strings are runtime data rather than knowledge
|
|
79
|
-
* of a particular consumer such as PTC mode.
|
|
80
|
-
*/
|
|
81
|
-
interface CodeBindingErrorClass {
|
|
82
|
-
/** Constructor global and resulting `Error.name`; same portable identifier rule as {@link CodeBindingNamespace.global}. */
|
|
83
|
-
name: string
|
|
84
|
-
/**
|
|
85
|
-
* Non-empty own property for the member name. The portable exclusion set is
|
|
86
|
-
* `RESERVED_ERROR_MEMBERS` plus dunder-form names (`__x__`, non-empty
|
|
87
|
-
* middle), enforced identically by every backend; any other name —
|
|
88
|
-
* identifiers or not — is accepted everywhere.
|
|
89
|
-
*/
|
|
90
|
-
memberNameProperty: string
|
|
91
|
-
}
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
```ts type-equiv
|
|
95
|
-
/**
|
|
96
|
-
* A named group of {@link CodeBindingFunction}s the runtime exposes to the
|
|
97
|
-
* program as one global object (e.g. `tools`). Function names are arbitrary
|
|
98
|
-
* strings — a runtime must treat names like `__proto__` or `constructor` as
|
|
99
|
-
* ordinary own properties (null-prototype construction), never as prototype
|
|
100
|
-
* collisions.
|
|
101
|
-
*/
|
|
102
|
-
interface CodeBindingNamespace {
|
|
103
|
-
/**
|
|
104
|
-
* The global identifier the program sees. Must match the LANGUAGE-PORTABLE
|
|
105
|
-
* identifier subset `[A-Za-z_][A-Za-z0-9_]*` and no language's reserved
|
|
106
|
-
* words, so the same namespace list works against every backend regardless
|
|
107
|
-
* of `language` — a JS-only spelling like `$tools` is rejected by design,
|
|
108
|
-
* not just by the Python backend. Names that satisfy the identifier rule but
|
|
109
|
-
* name a backend-owned slot (`RESERVED_BINDING_GLOBALS`, e.g. `console`,
|
|
110
|
-
* `__dsh_main__`) are also refused everywhere; see its declaration for the
|
|
111
|
-
* exact set and why each entry is reserved.
|
|
112
|
-
*/
|
|
113
|
-
global: string
|
|
114
|
-
/** The callable members, keyed by the exact name the program calls. */
|
|
115
|
-
functions: Record<string, CodeBindingFunction>
|
|
116
|
-
/** Optional program-visible typed rejection contract for this namespace. */
|
|
117
|
-
errorClass?: CodeBindingErrorClass
|
|
118
|
-
}
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
```ts type-equiv
|
|
122
|
-
/** A lossless JSON value transferable through the dependency-light Service Definition. */
|
|
123
|
-
type CodeJsonValue = null | boolean | number | string | CodeJsonValue[] | { [key: string]: CodeJsonValue }
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
```ts type-equiv
|
|
127
|
-
/**
|
|
128
|
-
* One host-side function exposed to the program as an async callable. The
|
|
129
|
-
* runtime bridges calls to it (possibly across a serialization boundary), so
|
|
130
|
-
* `args` and the resolution value MUST be lossless JSON. A runtime rejects a
|
|
131
|
-
* lossy or non-cloneable value with a descriptive error rather than corrupting
|
|
132
|
-
* the run. No seam-level byte cap applies to a binding resolution. A rejection
|
|
133
|
-
* of this function surfaces inside the program as a rejection of the
|
|
134
|
-
* corresponding call.
|
|
135
|
-
*/
|
|
136
|
-
type CodeBindingFunction = (args: unknown) => Promise<CodeJsonValue>
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
## Captured output and the failure taxonomy
|
|
140
|
-
|
|
141
|
-
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.
|
|
142
|
-
|
|
143
|
-
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:
|
|
144
|
-
|
|
145
|
-
```ts type-equiv
|
|
146
|
-
/**
|
|
147
|
-
* Why a run failed. The kinds are orthogonal outcomes reported independently
|
|
148
|
-
* (per docs/defensive-patterns.md): a budget expiry is not an exception, an
|
|
149
|
-
* abort is not a timeout, and a substrate death is neither.
|
|
150
|
-
*
|
|
151
|
-
* - `'exception'` — the program threw or failed to parse/transform.
|
|
152
|
-
* - `'timeout'` — an implementation-owned budget expired; the message says which.
|
|
153
|
-
* - `'abort'` — {@link CodeRunRequest.signal} fired.
|
|
154
|
-
* - `'worker-exit'` — the execution substrate died without settling (e.g. OOM).
|
|
155
|
-
* - `'invalid-output'` — the completion value was not lossless JSON.
|
|
156
|
-
* - `'output-limit'` — the serialized outer logs/value/diagnostic exceeded the configured cap.
|
|
157
|
-
*/
|
|
158
|
-
interface CodeRunFailure {
|
|
159
|
-
/** The failure class (see the interface doc for each kind's meaning). */
|
|
160
|
-
kind: 'exception' | 'timeout' | 'abort' | 'worker-exit' | 'invalid-output' | 'output-limit'
|
|
161
|
-
/** Human-readable detail, suitable for feeding back to a model to self-correct. */
|
|
162
|
-
message: string
|
|
163
|
-
}
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
## The service
|
|
167
|
-
|
|
168
|
-
`CodeRuntime` (`ctx.codeRuntime`, abstract — defined in [`packages/code-runtime/code-runtime/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/code-runtime/code-runtime/src/index.ts)) is `run(request)` plus two readonly descriptors: `language` (what the program must be written in — `'typescript'` and `'python'` are the well-known values, those `dsh-tools` presents, the TypeScript backend released and the Python backend experimental and private (not published); a consumer generating language-specific presentation switches on it and fails loud on one it cannot present) and `isolation` (the execution substrate — `'worker-thread'`, `'process'`, `'container'`; a diagnostic label, **not a security claim**). Implementations must keep runs isolated from each other (no cross-run state) and dispose to quiescence: in-flight runs are terminated and awaited before teardown completes.
|
|
169
|
-
|
|
170
|
-
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
|
|
171
|
-
|
|
172
|
-
<a id="cordis-surface"></a>
|
|
173
|
-
|
|
174
|
-
## Cordis API
|
|
175
|
-
|
|
176
|
-
Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — the language sides differ only in locale-specific paired document paths. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
|
|
177
|
-
|
|
178
|
-
<a id="ctxcoderuntime--coderuntime-abstract-seam"></a>
|
|
179
|
-
|
|
180
|
-
### `ctx.codeRuntime` — `CodeRuntime` (abstract seam)
|
|
181
|
-
|
|
182
|
-
Registers one `ctx.codeRuntime` implementation. Program, budget, abort, and substrate failures resolve in CodeRunResult; only Service Definition contract misuse rejects. Implementations bridge structured-cloneable bindings, materialize each declared namespace rejection class, treat programs as hostile peers, isolate runs from one another, and terminate and await in-flight runs during disposal.
|
|
183
|
-
|
|
184
|
-
```ts cordis-catalog
|
|
185
|
-
/**
|
|
186
|
-
* Execute one program against the request's bindings and capture what it
|
|
187
|
-
* emitted. See the class doc for the resolution contract (error is a result
|
|
188
|
-
* field; rejection means Service Definition contract misuse only).
|
|
189
|
-
* @param request - the program, its bindings, and the abort signal; the
|
|
190
|
-
* request carries everything the runtime acts on, with no hidden defaults.
|
|
191
|
-
* @returns the run's outcome: completion value (when transferable), the
|
|
192
|
-
* ordered log capture, and the failure (if any).
|
|
193
|
-
*/
|
|
194
|
-
abstract run(request: CodeRunRequest): Promise<CodeRunResult>
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
Source: [`packages/code-runtime/code-runtime/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/code-runtime/code-runtime/src/index.ts)
|
|
198
|
-
<!-- END GENERATED cordis-surface -->
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
editSource: "docs/subsystems/invariants.md"
|
|
3
|
-
outline: [2,3]
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Runtime Invariants
|
|
7
|
-
|
|
8
|
-
[dsh-invariants](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/runtime-diagnostics/invariants) is the configurable registry service (`ctx.invariants`) for package-owned runtime invariant checks. It is one support-group package, not a three-package capability seam, and not part of the agent-loop spine: the registry owns selection, name reservation, child-fiber lifecycle, and package-attributed failure, while every workspace package publishes a `./invariant` companion plugin that registers checks under its exact npm package name. What a check may assert — authoritative event streams or mutable data, never service or method presence — is the runtime-invariants convention in [AGENTS.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/AGENTS.md#conventions); the registry design is owned by the [invariant-service Agent Note](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/architecture/2026-07-19-package-owned-invariant-service.md).
|
|
9
|
-
|
|
10
|
-
Source: [`packages/runtime-diagnostics/invariants/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/runtime-diagnostics/invariants/src/index.ts)
|
|
11
|
-
|
|
12
|
-
## Selection
|
|
13
|
-
|
|
14
|
-
```ts type-equiv
|
|
15
|
-
/** Runtime invariant selection configured on the service plugin. */
|
|
16
|
-
interface Config {
|
|
17
|
-
/** Global switch; defaults to `true`. */
|
|
18
|
-
readonly enabled?: boolean
|
|
19
|
-
/** Case-sensitive JavaScript regex sources that admit package names; empty admits all. */
|
|
20
|
-
readonly package_allowlist?: string[]
|
|
21
|
-
/** Case-sensitive JavaScript regex sources that exclude package names after allowlist matching. */
|
|
22
|
-
readonly package_blocklist?: string[]
|
|
23
|
-
}
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
A package is selected when the service is enabled, the allowlist is empty or at least one pattern matches its full npm name, and no blocklist pattern matches — a blocklist match overrides an allowlist match. Entries compile with `new RegExp(source)`: matching is unanchored unless the source supplies `^` and `$`, and `/pattern/flags` syntax is not parsed. Validation fails loud at service startup: a blank, whitespace-padded, duplicate, or invalid entry throws instead of being skipped. A valid pattern may match no currently loaded package, so later loading and HMR stay deterministic; filters are fixed for the service lifetime ([README](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/runtime-diagnostics/invariants/README.md)).
|
|
27
|
-
|
|
28
|
-
## The installer
|
|
29
|
-
|
|
30
|
-
```ts type-equiv
|
|
31
|
-
/**
|
|
32
|
-
* Throw a package-attributed invariant failure.
|
|
33
|
-
* @param message - violated package contract without the standard prefix.
|
|
34
|
-
* @returns never because reporting a violation throws.
|
|
35
|
-
*/
|
|
36
|
-
type InvariantFailure = (message: string) => never
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
```ts type-equiv
|
|
40
|
-
/** Install one package's checks into the registration's child context. */
|
|
41
|
-
interface InvariantInstaller {
|
|
42
|
-
/**
|
|
43
|
-
* Install the package contribution.
|
|
44
|
-
* @param ctx - child context owned by this invariant registration.
|
|
45
|
-
* @param fail - reporter bound to the registering package name.
|
|
46
|
-
* @returns nothing, or a promise settling after asynchronous checks finish.
|
|
47
|
-
*/
|
|
48
|
-
(ctx: Context, fail: InvariantFailure): void | Promise<void>
|
|
49
|
-
/** Services the child installer fiber may access. */
|
|
50
|
-
readonly inject?: Inject
|
|
51
|
-
}
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
An enabled installer runs in a dedicated child Cordis fiber; `installer.inject` declares the services that fiber may access, and synchronous or asynchronous installer completion is joined before the registration succeeds. `fail(message)` throws `InvariantError` — `extends Error` with stable `code: 'INVARIANT'`, the owning `packageName`, and a message prefixed `invariant violated by "<package>": …` — so a violation is attributable without the registry importing any product package.
|
|
55
|
-
|
|
56
|
-
## The service
|
|
57
|
-
|
|
58
|
-
`ctx.invariants.register(packageName, installer)` reserves one active registration for the full npm package name and returns its effect-scoped disposer. The reservation holds even when filters keep the installer inactive, so two plugins can never silently claim the same package name; a duplicate, blank, or whitespace-containing name throws. An installer failure disposes the child fiber and releases the reservation atomically. The service owns every registration fiber while the returned disposer also belongs to the companion fiber: unloading either side removes listeners, trace state, and the reservation, so a companion can reload and register the same name again without retained state.
|
|
59
|
-
|
|
60
|
-
## The companion contract
|
|
61
|
-
|
|
62
|
-
Every workspace package owns a `./invariant` companion ([package contract](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/AGENTS.md)); publication and registration are exhaustive, but assertions are deliberately not synthetic. A companion installs a check only when its package owns an observable event or mutable-data relationship; otherwise it exports an empty installer whose leading comment starts `No runtime invariant:` and explains, package-specifically, why nothing is checkable. `pnpm run verify-package-invariants` mechanically rejects generated markers, unexplained empty installers, non-empty installers that omit or ignore the reporter, incorrect registration names, and incomplete export, publication, dependency, or bundle wiring ([mechanical-rule Agent Note](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/architecture/2026-07-19-package-invariant-runtime-contracts.md)). The catalog of executable companions and the standard composition live in the [package README](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/runtime-diagnostics/invariants/README.md).
|
|
63
|
-
|
|
64
|
-
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
|
|
65
|
-
|
|
66
|
-
<a id="cordis-surface"></a>
|
|
67
|
-
|
|
68
|
-
## Cordis API
|
|
69
|
-
|
|
70
|
-
Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — the language sides differ only in locale-specific paired document paths. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
|
|
71
|
-
|
|
72
|
-
<a id="ctxinvariants--invariantregistry"></a>
|
|
73
|
-
|
|
74
|
-
### `ctx.invariants` — `InvariantRegistry`
|
|
75
|
-
|
|
76
|
-
Package-owned invariant registry with global and regex-based selection.
|
|
77
|
-
|
|
78
|
-
```ts cordis-catalog
|
|
79
|
-
/**
|
|
80
|
-
* Register one package's invariant installer. The package name is reserved
|
|
81
|
-
* even when filtering disables its checks. Enabled installers run in a child
|
|
82
|
-
* fiber; failure disposes that fiber and releases the reservation.
|
|
83
|
-
* @param packageName - full npm package name that owns the contribution.
|
|
84
|
-
* @param installer - listener or startup-check installer for the child context.
|
|
85
|
-
* @returns an effect-scoped disposer for the registration.
|
|
86
|
-
*/
|
|
87
|
-
register(packageName: string, installer: InvariantInstaller): () => void
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
Source: [`packages/runtime-diagnostics/invariants/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/runtime-diagnostics/invariants/src/index.ts)
|
|
91
|
-
<!-- END GENERATED cordis-surface -->
|