dsh-plugin-guide 0.1.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/LICENSE +202 -0
- package/NOTICE.md +26 -0
- package/README.es.md +139 -0
- package/README.hi.md +138 -0
- package/README.md +165 -0
- package/README.pt.md +139 -0
- package/README.zh-CN.md +164 -0
- package/SKILL.md +69 -0
- package/cordis.patch.yml +4 -0
- package/guide/links.md +92 -0
- package/guide/plugin-dev-guide.md +429 -0
- package/guide/quick-reference.es.md +176 -0
- package/guide/quick-reference.hi.md +176 -0
- package/guide/quick-reference.md +176 -0
- package/guide/quick-reference.pt.md +176 -0
- package/guide/quick-reference.zh-CN.md +175 -0
- package/index.js +58 -0
- package/package.json +83 -0
- package/references/community-ecosystem.md +201 -0
- package/references/community-repo-deep-dive.md +695 -0
- package/references/cordis-paper-and-community.md +326 -0
- package/references/harness-repo.md +654 -0
- package/references/official-docs/AGENTS.md +149 -0
- package/references/official-docs/BENCHMARK.md +3 -0
- package/references/official-docs/CLAUDE.md +1 -0
- package/references/official-docs/CONTRIBUTING.i18n.yaml +6 -0
- package/references/official-docs/CONTRIBUTING.md +23 -0
- package/references/official-docs/CONTRIBUTING.zh.md +23 -0
- package/references/official-docs/LICENSE +21 -0
- package/references/official-docs/README.i18n.yaml +6 -0
- package/references/official-docs/README.md +35 -0
- package/references/official-docs/README.zh.md +74 -0
- package/references/official-docs/SNAPSHOT.md +16 -0
- package/references/official-docs/THIRD_PARTY_NOTICES.md +192 -0
- package/references/official-docs/docs/AGENTS.md +75 -0
- package/references/official-docs/docs/agent-lifecycle.i18n.yaml +6 -0
- package/references/official-docs/docs/agent-lifecycle.md +82 -0
- package/references/official-docs/docs/agent-lifecycle.zh.md +84 -0
- package/references/official-docs/docs/api-gateway.i18n.yaml +6 -0
- package/references/official-docs/docs/api-gateway.md +164 -0
- package/references/official-docs/docs/api-gateway.zh.md +164 -0
- package/references/official-docs/docs/architecture.i18n.yaml +6 -0
- package/references/official-docs/docs/architecture.md +129 -0
- package/references/official-docs/docs/architecture.zh.md +133 -0
- package/references/official-docs/docs/capability-seams.i18n.yaml +6 -0
- package/references/official-docs/docs/capability-seams.md +471 -0
- package/references/official-docs/docs/capability-seams.zh.md +473 -0
- package/references/official-docs/docs/config-catalog.i18n.yaml +6 -0
- package/references/official-docs/docs/config-catalog.md +3151 -0
- package/references/official-docs/docs/config-catalog.zh.md +3152 -0
- package/references/official-docs/docs/cookbook/adding-a-conversation-node.i18n.yaml +6 -0
- package/references/official-docs/docs/cookbook/adding-a-conversation-node.md +233 -0
- package/references/official-docs/docs/cookbook/adding-a-conversation-node.zh.md +233 -0
- package/references/official-docs/docs/cookbook/adding-a-package.i18n.yaml +6 -0
- package/references/official-docs/docs/cookbook/adding-a-package.md +118 -0
- package/references/official-docs/docs/cookbook/adding-a-package.zh.md +118 -0
- package/references/official-docs/docs/cookbook/adding-a-tool.i18n.yaml +6 -0
- package/references/official-docs/docs/cookbook/adding-a-tool.md +94 -0
- package/references/official-docs/docs/cookbook/adding-a-tool.zh.md +96 -0
- package/references/official-docs/docs/cookbook/adding-a-vendored-package.i18n.yaml +6 -0
- package/references/official-docs/docs/cookbook/adding-a-vendored-package.md +59 -0
- package/references/official-docs/docs/cookbook/adding-a-vendored-package.zh.md +59 -0
- package/references/official-docs/docs/cookbook/adding-an-llm-adapter.i18n.yaml +6 -0
- package/references/official-docs/docs/cookbook/adding-an-llm-adapter.md +43 -0
- package/references/official-docs/docs/cookbook/adding-an-llm-adapter.zh.md +43 -0
- package/references/official-docs/docs/cookbook/extension-cookbook.i18n.yaml +6 -0
- package/references/official-docs/docs/cookbook/extension-cookbook.md +129 -0
- package/references/official-docs/docs/cookbook/extension-cookbook.zh.md +131 -0
- package/references/official-docs/docs/cookbook/maintaining-dsh-code-review.i18n.yaml +6 -0
- package/references/official-docs/docs/cookbook/maintaining-dsh-code-review.md +64 -0
- package/references/official-docs/docs/cookbook/maintaining-dsh-code-review.zh.md +64 -0
- package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.i18n.yaml +6 -0
- package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.md +32 -0
- package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.zh.md +32 -0
- package/references/official-docs/docs/cordis-api/context.i18n.yaml +6 -0
- package/references/official-docs/docs/cordis-api/context.md +364 -0
- package/references/official-docs/docs/cordis-api/context.zh.md +366 -0
- package/references/official-docs/docs/cordis-api/events.i18n.yaml +6 -0
- package/references/official-docs/docs/cordis-api/events.md +207 -0
- package/references/official-docs/docs/cordis-api/events.zh.md +209 -0
- package/references/official-docs/docs/cordis-api/fiber.i18n.yaml +6 -0
- package/references/official-docs/docs/cordis-api/fiber.md +375 -0
- package/references/official-docs/docs/cordis-api/fiber.zh.md +377 -0
- package/references/official-docs/docs/cordis-api/inherited.md +39 -0
- package/references/official-docs/docs/cordis-api/registry.i18n.yaml +6 -0
- package/references/official-docs/docs/cordis-api/registry.md +152 -0
- package/references/official-docs/docs/cordis-api/registry.zh.md +154 -0
- package/references/official-docs/docs/cordis-api/service.i18n.yaml +6 -0
- package/references/official-docs/docs/cordis-api/service.md +102 -0
- package/references/official-docs/docs/cordis-api/service.zh.md +104 -0
- package/references/official-docs/docs/cordis-primer.i18n.yaml +6 -0
- package/references/official-docs/docs/cordis-primer.md +44 -0
- package/references/official-docs/docs/cordis-primer.zh.md +50 -0
- package/references/official-docs/docs/cordis-tutorial/01-first-plugin.i18n.yaml +6 -0
- package/references/official-docs/docs/cordis-tutorial/01-first-plugin.md +95 -0
- package/references/official-docs/docs/cordis-tutorial/01-first-plugin.zh.md +95 -0
- package/references/official-docs/docs/cordis-tutorial/02-lifecycle-and-effects.i18n.yaml +6 -0
- package/references/official-docs/docs/cordis-tutorial/02-lifecycle-and-effects.md +98 -0
- package/references/official-docs/docs/cordis-tutorial/02-lifecycle-and-effects.zh.md +98 -0
- package/references/official-docs/docs/cordis-tutorial/03-services.i18n.yaml +6 -0
- package/references/official-docs/docs/cordis-tutorial/03-services.md +98 -0
- package/references/official-docs/docs/cordis-tutorial/03-services.zh.md +98 -0
- package/references/official-docs/docs/cordis-tutorial/04-events.i18n.yaml +6 -0
- package/references/official-docs/docs/cordis-tutorial/04-events.md +144 -0
- package/references/official-docs/docs/cordis-tutorial/04-events.zh.md +144 -0
- package/references/official-docs/docs/cordis-tutorial/05-config.i18n.yaml +6 -0
- package/references/official-docs/docs/cordis-tutorial/05-config.md +84 -0
- package/references/official-docs/docs/cordis-tutorial/05-config.zh.md +84 -0
- package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.i18n.yaml +6 -0
- package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.md +113 -0
- package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.zh.md +113 -0
- package/references/official-docs/docs/cordis-tutorial/07-into-the-harness.i18n.yaml +6 -0
- package/references/official-docs/docs/cordis-tutorial/07-into-the-harness.md +107 -0
- package/references/official-docs/docs/cordis-tutorial/07-into-the-harness.zh.md +107 -0
- package/references/official-docs/docs/cordis-tutorial/index.i18n.yaml +6 -0
- package/references/official-docs/docs/cordis-tutorial/index.md +60 -0
- package/references/official-docs/docs/cordis-tutorial/index.zh.md +62 -0
- package/references/official-docs/docs/defensive-patterns.i18n.yaml +6 -0
- package/references/official-docs/docs/defensive-patterns.md +33 -0
- package/references/official-docs/docs/defensive-patterns.zh.md +33 -0
- package/references/official-docs/docs/development.i18n.yaml +6 -0
- package/references/official-docs/docs/development.md +171 -0
- package/references/official-docs/docs/development.zh.md +171 -0
- package/references/official-docs/docs/event-producer-consumer.i18n.yaml +6 -0
- package/references/official-docs/docs/event-producer-consumer.md +76 -0
- package/references/official-docs/docs/event-producer-consumer.zh.md +78 -0
- package/references/official-docs/docs/glossary.i18n.yaml +6 -0
- package/references/official-docs/docs/glossary.md +45 -0
- package/references/official-docs/docs/glossary.zh.md +45 -0
- package/references/official-docs/docs/graph-atlas.i18n.yaml +6 -0
- package/references/official-docs/docs/graph-atlas.md +24 -0
- package/references/official-docs/docs/graph-atlas.zh.md +26 -0
- package/references/official-docs/docs/i18n/README.i18n.yaml +6 -0
- package/references/official-docs/docs/i18n/README.md +60 -0
- package/references/official-docs/docs/i18n/README.zh.md +60 -0
- package/references/official-docs/docs/i18n/style-samples.md +87 -0
- package/references/official-docs/docs/i18n/terminology.md +214 -0
- package/references/official-docs/docs/i18n/translation-prompt.md +263 -0
- package/references/official-docs/docs/i18n/translation-rules.i18n.yaml +6 -0
- package/references/official-docs/docs/i18n/translation-rules.md +69 -0
- package/references/official-docs/docs/i18n/translation-rules.zh.md +69 -0
- package/references/official-docs/docs/module-graph.i18n.yaml +6 -0
- package/references/official-docs/docs/module-graph.md +1638 -0
- package/references/official-docs/docs/module-graph.zh.md +1640 -0
- package/references/official-docs/docs/persistence-catalog.i18n.yaml +6 -0
- package/references/official-docs/docs/persistence-catalog.md +944 -0
- package/references/official-docs/docs/persistence-catalog.zh.md +946 -0
- package/references/official-docs/docs/postmortem/0001-acp-default-export-drops-inject.i18n.yaml +6 -0
- package/references/official-docs/docs/postmortem/0001-acp-default-export-drops-inject.md +113 -0
- package/references/official-docs/docs/postmortem/0001-acp-default-export-drops-inject.zh.md +113 -0
- package/references/official-docs/docs/postmortem/0002-js-expression-disabled-filesystem-tools.i18n.yaml +6 -0
- package/references/official-docs/docs/postmortem/0002-js-expression-disabled-filesystem-tools.md +47 -0
- package/references/official-docs/docs/postmortem/0002-js-expression-disabled-filesystem-tools.zh.md +47 -0
- package/references/official-docs/docs/postmortem/0003-web-agent-gui-feedback-loop.i18n.yaml +6 -0
- package/references/official-docs/docs/postmortem/0003-web-agent-gui-feedback-loop.md +53 -0
- package/references/official-docs/docs/postmortem/0003-web-agent-gui-feedback-loop.zh.md +53 -0
- package/references/official-docs/docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.i18n.yaml +6 -0
- package/references/official-docs/docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.md +55 -0
- package/references/official-docs/docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.zh.md +55 -0
- package/references/official-docs/docs/postmortem/README.i18n.yaml +6 -0
- package/references/official-docs/docs/postmortem/README.md +18 -0
- package/references/official-docs/docs/postmortem/README.zh.md +18 -0
- package/references/official-docs/docs/rescope.i18n.yaml +6 -0
- package/references/official-docs/docs/rescope.md +53 -0
- package/references/official-docs/docs/rescope.zh.md +53 -0
- package/references/official-docs/docs/subsystems/README.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/README.md +55 -0
- package/references/official-docs/docs/subsystems/README.zh.md +55 -0
- package/references/official-docs/docs/subsystems/approval.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/approval.md +170 -0
- package/references/official-docs/docs/subsystems/approval.zh.md +170 -0
- package/references/official-docs/docs/subsystems/attachment.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/attachment.md +115 -0
- package/references/official-docs/docs/subsystems/attachment.zh.md +115 -0
- package/references/official-docs/docs/subsystems/client-modules.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/client-modules.md +118 -0
- package/references/official-docs/docs/subsystems/client-modules.zh.md +118 -0
- package/references/official-docs/docs/subsystems/code-runtime.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/code-runtime.md +191 -0
- package/references/official-docs/docs/subsystems/code-runtime.zh.md +191 -0
- package/references/official-docs/docs/subsystems/commands.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/commands.md +187 -0
- package/references/official-docs/docs/subsystems/commands.zh.md +187 -0
- package/references/official-docs/docs/subsystems/compaction.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/compaction.md +238 -0
- package/references/official-docs/docs/subsystems/compaction.zh.md +238 -0
- package/references/official-docs/docs/subsystems/core.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/core.md +1070 -0
- package/references/official-docs/docs/subsystems/core.zh.md +1078 -0
- package/references/official-docs/docs/subsystems/credentials.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/credentials.md +133 -0
- package/references/official-docs/docs/subsystems/credentials.zh.md +133 -0
- package/references/official-docs/docs/subsystems/extensions.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/extensions.md +364 -0
- package/references/official-docs/docs/subsystems/extensions.zh.md +364 -0
- package/references/official-docs/docs/subsystems/feedback.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/feedback.md +266 -0
- package/references/official-docs/docs/subsystems/feedback.zh.md +266 -0
- package/references/official-docs/docs/subsystems/filesystem.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/filesystem.md +495 -0
- package/references/official-docs/docs/subsystems/filesystem.zh.md +495 -0
- package/references/official-docs/docs/subsystems/goal.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/goal.md +277 -0
- package/references/official-docs/docs/subsystems/goal.zh.md +277 -0
- package/references/official-docs/docs/subsystems/invariants.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/invariants.md +88 -0
- package/references/official-docs/docs/subsystems/invariants.zh.md +88 -0
- package/references/official-docs/docs/subsystems/jobs.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/jobs.md +290 -0
- package/references/official-docs/docs/subsystems/jobs.zh.md +290 -0
- package/references/official-docs/docs/subsystems/llm-streaming.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/llm-streaming.md +888 -0
- package/references/official-docs/docs/subsystems/llm-streaming.zh.md +894 -0
- package/references/official-docs/docs/subsystems/lsp.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/lsp.md +202 -0
- package/references/official-docs/docs/subsystems/lsp.zh.md +202 -0
- package/references/official-docs/docs/subsystems/permission-presets.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/permission-presets.md +131 -0
- package/references/official-docs/docs/subsystems/permission-presets.zh.md +131 -0
- package/references/official-docs/docs/subsystems/persistence.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/persistence.md +385 -0
- package/references/official-docs/docs/subsystems/persistence.zh.md +385 -0
- package/references/official-docs/docs/subsystems/plan.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/plan.md +87 -0
- package/references/official-docs/docs/subsystems/plan.zh.md +87 -0
- package/references/official-docs/docs/subsystems/sandbox.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/sandbox.md +218 -0
- package/references/official-docs/docs/subsystems/sandbox.zh.md +218 -0
- package/references/official-docs/docs/subsystems/schedule.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/schedule.md +186 -0
- package/references/official-docs/docs/subsystems/schedule.zh.md +186 -0
- package/references/official-docs/docs/subsystems/scope.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/scope.md +59 -0
- package/references/official-docs/docs/subsystems/scope.zh.md +59 -0
- package/references/official-docs/docs/subsystems/session-projection.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/session-projection.md +262 -0
- package/references/official-docs/docs/subsystems/session-projection.zh.md +262 -0
- package/references/official-docs/docs/subsystems/session-query.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/session-query.md +495 -0
- package/references/official-docs/docs/subsystems/session-query.zh.md +495 -0
- package/references/official-docs/docs/subsystems/session-reference.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/session-reference.md +108 -0
- package/references/official-docs/docs/subsystems/session-reference.zh.md +108 -0
- package/references/official-docs/docs/subsystems/session-telemetry.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/session-telemetry.md +194 -0
- package/references/official-docs/docs/subsystems/session-telemetry.zh.md +194 -0
- package/references/official-docs/docs/subsystems/session-title.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/session-title.md +204 -0
- package/references/official-docs/docs/subsystems/session-title.zh.md +204 -0
- package/references/official-docs/docs/subsystems/session.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/session.md +849 -0
- package/references/official-docs/docs/subsystems/session.zh.md +851 -0
- package/references/official-docs/docs/subsystems/settings.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/settings.md +310 -0
- package/references/official-docs/docs/subsystems/settings.zh.md +310 -0
- package/references/official-docs/docs/subsystems/shell.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/shell.md +303 -0
- package/references/official-docs/docs/subsystems/shell.zh.md +303 -0
- package/references/official-docs/docs/subsystems/skills.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/skills.md +331 -0
- package/references/official-docs/docs/subsystems/skills.zh.md +331 -0
- package/references/official-docs/docs/subsystems/spill.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/spill.md +117 -0
- package/references/official-docs/docs/subsystems/spill.zh.md +117 -0
- package/references/official-docs/docs/subsystems/storage.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/storage.md +229 -0
- package/references/official-docs/docs/subsystems/storage.zh.md +229 -0
- package/references/official-docs/docs/subsystems/subagent.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/subagent.md +734 -0
- package/references/official-docs/docs/subsystems/subagent.zh.md +736 -0
- package/references/official-docs/docs/subsystems/subprocess.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/subprocess.md +324 -0
- package/references/official-docs/docs/subsystems/subprocess.zh.md +324 -0
- package/references/official-docs/docs/subsystems/system-prompt.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/system-prompt.md +207 -0
- package/references/official-docs/docs/subsystems/system-prompt.zh.md +207 -0
- package/references/official-docs/docs/subsystems/terminal.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/terminal.md +184 -0
- package/references/official-docs/docs/subsystems/terminal.zh.md +184 -0
- package/references/official-docs/docs/subsystems/token-meter.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/token-meter.md +90 -0
- package/references/official-docs/docs/subsystems/token-meter.zh.md +90 -0
- package/references/official-docs/docs/subsystems/tools.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/tools.md +720 -0
- package/references/official-docs/docs/subsystems/tools.zh.md +720 -0
- package/references/official-docs/docs/subsystems/typert.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/typert.md +336 -0
- package/references/official-docs/docs/subsystems/typert.zh.md +336 -0
- package/references/official-docs/docs/subsystems/user-questions.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/user-questions.md +178 -0
- package/references/official-docs/docs/subsystems/user-questions.zh.md +178 -0
- package/references/official-docs/docs/subsystems/web-server.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/web-server.md +108 -0
- package/references/official-docs/docs/subsystems/web-server.zh.md +108 -0
- package/references/official-docs/docs/subsystems/web.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/web.md +199 -0
- package/references/official-docs/docs/subsystems/web.zh.md +199 -0
- package/references/official-docs/docs/subsystems/workflow.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/workflow.md +278 -0
- package/references/official-docs/docs/subsystems/workflow.zh.md +278 -0
- package/references/official-docs/docs/subsystems/workspace.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/workspace.md +228 -0
- package/references/official-docs/docs/subsystems/workspace.zh.md +228 -0
- package/references/official-docs/docs/testing.i18n.yaml +6 -0
- package/references/official-docs/docs/testing.md +49 -0
- package/references/official-docs/docs/testing.zh.md +49 -0
- package/references/official-docs/docs/tool-catalog.i18n.yaml +6 -0
- package/references/official-docs/docs/tool-catalog.md +1873 -0
- package/references/official-docs/docs/tool-catalog.zh.md +1878 -0
- package/references/official-docs/docs/tool-execution-pipeline.i18n.yaml +6 -0
- package/references/official-docs/docs/tool-execution-pipeline.md +62 -0
- package/references/official-docs/docs/tool-execution-pipeline.zh.md +64 -0
- package/references/official-docs/docs/user/develop/basic/config.i18n.yaml +6 -0
- package/references/official-docs/docs/user/develop/basic/config.md +106 -0
- package/references/official-docs/docs/user/develop/basic/config.zh.md +106 -0
- package/references/official-docs/docs/user/develop/basic/index.i18n.yaml +6 -0
- package/references/official-docs/docs/user/develop/basic/index.md +144 -0
- package/references/official-docs/docs/user/develop/basic/index.zh.md +144 -0
- package/references/official-docs/docs/user/develop/basic/publish.i18n.yaml +6 -0
- package/references/official-docs/docs/user/develop/basic/publish.md +183 -0
- package/references/official-docs/docs/user/develop/basic/publish.zh.md +183 -0
- package/references/official-docs/docs/user/develop/basic/tool.i18n.yaml +6 -0
- package/references/official-docs/docs/user/develop/basic/tool.md +52 -0
- package/references/official-docs/docs/user/develop/basic/tool.zh.md +52 -0
- package/references/official-docs/docs/user/develop/framework/events.i18n.yaml +6 -0
- package/references/official-docs/docs/user/develop/framework/events.md +143 -0
- package/references/official-docs/docs/user/develop/framework/events.zh.md +143 -0
- package/references/official-docs/docs/user/develop/framework/index.i18n.yaml +6 -0
- package/references/official-docs/docs/user/develop/framework/index.md +137 -0
- package/references/official-docs/docs/user/develop/framework/index.zh.md +137 -0
- package/references/official-docs/docs/user/develop/framework/service.i18n.yaml +6 -0
- package/references/official-docs/docs/user/develop/framework/service.md +148 -0
- package/references/official-docs/docs/user/develop/framework/service.zh.md +150 -0
- package/references/official-docs/docs/user/develop/practice/index.i18n.yaml +6 -0
- package/references/official-docs/docs/user/develop/practice/index.md +155 -0
- package/references/official-docs/docs/user/develop/practice/index.zh.md +155 -0
- package/references/official-docs/docs/user/develop/practice/llm-adapter.i18n.yaml +6 -0
- package/references/official-docs/docs/user/develop/practice/llm-adapter.md +188 -0
- package/references/official-docs/docs/user/develop/practice/llm-adapter.zh.md +188 -0
- package/references/official-docs/docs/user/guide/index.i18n.yaml +6 -0
- package/references/official-docs/docs/user/guide/index.md +30 -0
- package/references/official-docs/docs/user/guide/index.zh.md +30 -0
- package/references/official-docs/docs/user/guide/providers-custom-form.png +0 -0
- package/references/official-docs/docs/user/guide/providers-custom-form.zh.png +0 -0
- package/references/official-docs/docs/user/guide/providers-models-page.png +0 -0
- package/references/official-docs/docs/user/guide/providers-models-page.zh.png +0 -0
- package/references/official-docs/docs/user/guide/providers.i18n.yaml +6 -0
- package/references/official-docs/docs/user/guide/providers.md +98 -0
- package/references/official-docs/docs/user/guide/providers.zh.md +98 -0
- package/references/official-docs/docs/user/guide/python-sdk.i18n.yaml +6 -0
- package/references/official-docs/docs/user/guide/python-sdk.md +104 -0
- package/references/official-docs/docs/user/guide/python-sdk.zh.md +104 -0
- package/references/official-docs/docs/user/index.i18n.yaml +6 -0
- package/references/official-docs/docs/user/index.md +11 -0
- package/references/official-docs/docs/user/index.zh.md +11 -0
- package/references/official-docs/docs/web-styling.i18n.yaml +6 -0
- package/references/official-docs/docs/web-styling.md +25 -0
- package/references/official-docs/docs/web-styling.zh.md +25 -0
- package/references/official-docs/examples/AGENTS.md +20 -0
- package/references/official-docs/packages/AGENTS.md +27 -0
- package/references/official-docs/packages/README.md +69 -0
- package/references/official-docs/vendor/README.md +60 -0
- package/references/official-docs/website-docs.ts +524 -0
- package/references/sources.md +137 -0
- package/references/upstream-cordis.md +594 -0
- package/references/website-pages.md +668 -0
- package/scripts/archive-discussions.ps1 +154 -0
- package/scripts/download-community-articles.ps1 +188 -0
- package/scripts/download-community-repos.ps1 +232 -0
- package/scripts/download-sources.ps1 +195 -0
- package/scripts/gen-topic-snapshot.ps1 +91 -0
- package/scripts/install-skill.ps1 +63 -0
- package/scripts/sync-official-docs.ps1 +130 -0
- package/scripts/verify-kit.ps1 +191 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# System Prompt Assembly
|
|
2
|
+
|
|
3
|
+
English | [中文](system-prompt.zh.md)
|
|
4
|
+
|
|
5
|
+
The [system-prompt package](../../packages/core/system-prompt) owns the data exchanged between prompt contributors and one assembly call. The package [README](../../packages/core/system-prompt/README.md) documents registration, ordering, scoping, and rendering behavior; this page records the exact cross-package types that plugins implement or pass.
|
|
6
|
+
|
|
7
|
+
Source: [`packages/core/system-prompt/src/index.ts`](../../packages/core/system-prompt/src/index.ts).
|
|
8
|
+
|
|
9
|
+
## Assembly context
|
|
10
|
+
|
|
11
|
+
`AssembleContext` identifies the scope layer one assembly resolves and may carry the explicit control signal for that request. It is merge-extensible: `dsh-agent` adds the optional live `agent` field, and `assembleContextFor(agent, signal)` sets the explicit fields together. A bare assembly has neither scope nor signal.
|
|
12
|
+
|
|
13
|
+
```ts type-equiv
|
|
14
|
+
/** Merge-extensible context for one prompt assembly. */
|
|
15
|
+
interface AssembleContext {
|
|
16
|
+
/**
|
|
17
|
+
* Scope whose providers and waterfall listeners participate. When absent,
|
|
18
|
+
* only global providers and subject-less listeners participate.
|
|
19
|
+
*/
|
|
20
|
+
scope?: ScopeKey
|
|
21
|
+
/** Explicit control signal for the turn that requested this assembly, when any. */
|
|
22
|
+
signal?: AbortSignal
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Tool-provider result
|
|
27
|
+
|
|
28
|
+
`ToolProviderResult.schemas` is the model-visible set for the current assembly. `knownNames` is the provider's pre-restriction name universe used to distinguish a configured-name typo from a known tool that is deliberately hidden in this scope.
|
|
29
|
+
|
|
30
|
+
```ts type-equiv
|
|
31
|
+
/** Tool schemas visible in one assembly and their pre-restriction name set. */
|
|
32
|
+
interface ToolProviderResult {
|
|
33
|
+
/** The schemas this provider contributes to THIS assembly. */
|
|
34
|
+
readonly schemas: readonly ToolSchema[]
|
|
35
|
+
/** The pre-restriction name universe for config validation (defaults to `schemas`' names). */
|
|
36
|
+
readonly knownNames?: readonly string[]
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Prompt sections
|
|
41
|
+
|
|
42
|
+
`PromptSection` is a readonly same-process registration contract. Its text may be static or resolved from the current assembly context. One effective `complete` section becomes the sole prompt section after cooperative assembly.
|
|
43
|
+
|
|
44
|
+
```ts type-equiv
|
|
45
|
+
/** One contributed section of the system prompt (registry input). */
|
|
46
|
+
interface PromptSection {
|
|
47
|
+
/** Unique name — a duplicate registration throws (see {@link SystemPrompt.section}). */
|
|
48
|
+
readonly name: string
|
|
49
|
+
/**
|
|
50
|
+
* Sections are concatenated in ascending order. Convention: `-100` is the
|
|
51
|
+
* harness identity, `0` the deployment persona, tool guidance uses 100–199;
|
|
52
|
+
* other negative orders also render before the persona.
|
|
53
|
+
*/
|
|
54
|
+
readonly order: number
|
|
55
|
+
/**
|
|
56
|
+
* Static text or a provider evaluated at each assembly with that assembly's
|
|
57
|
+
* {@link AssembleContext}. The text may reference `{{variable}}`s — they are
|
|
58
|
+
* interpolated later, by {@link renderPrompt}.
|
|
59
|
+
*/
|
|
60
|
+
readonly text: string | ((context: AssembleContext) => string)
|
|
61
|
+
/**
|
|
62
|
+
* Treat this contribution as the complete system prompt. Assembly still
|
|
63
|
+
* runs the cooperative waterfall so tools, contexts, and variables can be
|
|
64
|
+
* resolved, then restores this exact section as the sole prompt section.
|
|
65
|
+
* More than one effective complete section makes assembly fail.
|
|
66
|
+
*/
|
|
67
|
+
readonly complete?: boolean
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Dynamic prompt context
|
|
72
|
+
|
|
73
|
+
`PromptContext` is the cache-safe counterpart to `PromptSection`. The assembly resolves and orders these contributions, while agent-loop logs their complete current snapshot after retained model history only when it changed or compaction removed it.
|
|
74
|
+
|
|
75
|
+
```ts type-equiv
|
|
76
|
+
/** Dynamic model context materialized as a durable user-role snapshot. */
|
|
77
|
+
interface PromptContext {
|
|
78
|
+
/** Unique name — a duplicate registration throws (see {@link SystemPrompt.context}). */
|
|
79
|
+
readonly name: string
|
|
80
|
+
/** Contexts are joined in ascending order. */
|
|
81
|
+
readonly order: number
|
|
82
|
+
/** Static text or a provider evaluated for each assembly. Empty text contributes nothing. */
|
|
83
|
+
readonly text: string | ((context: AssembleContext) => string)
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
|
|
88
|
+
|
|
89
|
+
<a id="cordis-surface"></a>
|
|
90
|
+
|
|
91
|
+
## Cordis API
|
|
92
|
+
|
|
93
|
+
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`) — this section is byte-identical in both language sides of the page. 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).
|
|
94
|
+
|
|
95
|
+
<a id="ctxsystemprompt--systemprompt"></a>
|
|
96
|
+
|
|
97
|
+
### `ctx.systemPrompt` — `SystemPrompt`
|
|
98
|
+
|
|
99
|
+
Registry service for the prompt inputs assembled before each model step.
|
|
100
|
+
|
|
101
|
+
```ts cordis-catalog
|
|
102
|
+
/**
|
|
103
|
+
* Register an ordered prompt section in the calling context's scope. A scoped
|
|
104
|
+
* section shadows a global section with the same name; duplicates within one
|
|
105
|
+
* layer and non-finite orders throw. Registration and disposal emit
|
|
106
|
+
* `system-prompt/change`.
|
|
107
|
+
* @param section - the section to register.
|
|
108
|
+
* @returns the exact Cordis effect disposer.
|
|
109
|
+
*/
|
|
110
|
+
section(section: PromptSection): () => void
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Register ordered dynamic context in the calling context's scope. Scoped
|
|
114
|
+
* entries shadow global entries with the same name.
|
|
115
|
+
* @param context - the context contribution to register.
|
|
116
|
+
* @returns the exact Cordis effect disposer.
|
|
117
|
+
*/
|
|
118
|
+
context(context: PromptContext): () => void
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Suppress every dynamic runtime-context contribution in the calling
|
|
122
|
+
* context's scope without changing the services that own or enforce those
|
|
123
|
+
* facts. Multiple suppressors remain independently disposable.
|
|
124
|
+
* @returns the exact Cordis effect disposer.
|
|
125
|
+
*/
|
|
126
|
+
suppressRuntimeContext(): () => void
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Register a tool-schema provider in the calling context's scope. Global and
|
|
130
|
+
* matching scoped providers both contribute; returning the reserved
|
|
131
|
+
* {@link TOOL_ORDER_REST} name makes assembly fail.
|
|
132
|
+
* @param provider - evaluated for each assembly with its context.
|
|
133
|
+
* @returns the exact Cordis effect disposer.
|
|
134
|
+
*/
|
|
135
|
+
tools(provider: (context: AssembleContext) => ToolProviderResult): () => void
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Register a prompt variable in the calling context's scope. Scoped values
|
|
139
|
+
* shadow globals; invalid or duplicate names throw. A provider may return
|
|
140
|
+
* `undefined`, but rendering a section that references that value then fails.
|
|
141
|
+
* @param name - the `[a-z][a-z0-9_]*` reference name.
|
|
142
|
+
* @param provider - evaluated for each assembly.
|
|
143
|
+
* @returns the exact Cordis effect disposer.
|
|
144
|
+
*/
|
|
145
|
+
variable(name: string, provider: (context: AssembleContext) => string | undefined): () => void
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Assemble global and scoped providers, detach tool parameters, apply
|
|
149
|
+
* canonical ordering, then run the assembly waterfall. Scoped sections and
|
|
150
|
+
* variables shadow globals. The returned waterfall value is authoritative
|
|
151
|
+
* except that an effective complete section is restored afterwards as the
|
|
152
|
+
* sole prompt section.
|
|
153
|
+
* @param context - the optional scope and plugin-defined assembly fields.
|
|
154
|
+
* @returns the post-waterfall assembly with any complete prompt enforced.
|
|
155
|
+
*/
|
|
156
|
+
async assemble(context: AssembleContext = {}): Promise<PromptAssembly>
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Source: [`packages/core/system-prompt/src/index.ts:338`](../../packages/core/system-prompt/src/index.ts)
|
|
160
|
+
|
|
161
|
+
<a id="system-prompt-events"></a>
|
|
162
|
+
|
|
163
|
+
### `system-prompt/*` events
|
|
164
|
+
|
|
165
|
+
<a id="system-promptassemble--waterfall"></a>
|
|
166
|
+
|
|
167
|
+
#### `system-prompt/assemble` — waterfall
|
|
168
|
+
|
|
169
|
+
Expert waterfall over the assembled sections, contexts, tools, and variables. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): scoped listeners receive only that scope's assemblies. The returned value is authoritative. A supplied signal controls only this explicit assembly request and must not be retained to control later turns. A registered complete section is restored after this waterfall, so listeners cannot add to or replace that scope's system prompt.
|
|
170
|
+
|
|
171
|
+
```ts cordis-catalog
|
|
172
|
+
/**
|
|
173
|
+
* Expert waterfall over the assembled sections, contexts, tools, and variables.
|
|
174
|
+
* Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): scoped listeners
|
|
175
|
+
* receive only that scope's assemblies. The returned value is authoritative.
|
|
176
|
+
* A supplied signal controls only this explicit assembly request and must not
|
|
177
|
+
* be retained to control later turns. A registered complete section is
|
|
178
|
+
* restored after this waterfall, so listeners cannot add to or replace
|
|
179
|
+
* that scope's system prompt.
|
|
180
|
+
* @param assembly - the mutable assembly built from registered providers.
|
|
181
|
+
* @param context - the caller's per-assembly context.
|
|
182
|
+
* @mode waterfall
|
|
183
|
+
*/
|
|
184
|
+
'system-prompt/assemble'(this: Scoped<SystemPrompt>, assembly: PromptAssembly, context: AssembleContext, next: () => Promise<PromptAssembly>): Promise<PromptAssembly>
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Types: [Scoped](scope.md)
|
|
188
|
+
|
|
189
|
+
Source: [`packages/core/system-prompt/src/index.ts:31`](../../packages/core/system-prompt/src/index.ts)
|
|
190
|
+
|
|
191
|
+
<a id="system-promptchange--emit"></a>
|
|
192
|
+
|
|
193
|
+
#### `system-prompt/change` — emit
|
|
194
|
+
|
|
195
|
+
Emitted when any prompt provider changes. This registry notification is unfiltered because a global change affects every scope.
|
|
196
|
+
|
|
197
|
+
```ts cordis-catalog
|
|
198
|
+
/**
|
|
199
|
+
* Emitted when any prompt provider changes. This registry notification is
|
|
200
|
+
* unfiltered because a global change affects every scope.
|
|
201
|
+
* @mode emit
|
|
202
|
+
*/
|
|
203
|
+
'system-prompt/change'(): void
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Source: [`packages/core/system-prompt/src/index.ts:37`](../../packages/core/system-prompt/src/index.ts)
|
|
207
|
+
<!-- END GENERATED cordis-surface -->
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# 系统提示词组装
|
|
2
|
+
|
|
3
|
+
[English](system-prompt.md) | 中文
|
|
4
|
+
|
|
5
|
+
[system-prompt 包](../../packages/core/system-prompt)负责管理提示词贡献者与一次组装调用之间交换的数据。该包的 [README](../../packages/core/system-prompt/README.md) 记录注册、排序、作用域与渲染行为;本页记录各插件实现或传递的确切跨包类型。
|
|
6
|
+
|
|
7
|
+
源码:[`packages/core/system-prompt/src/index.ts`](../../packages/core/system-prompt/src/index.ts)。
|
|
8
|
+
|
|
9
|
+
## 组装上下文
|
|
10
|
+
|
|
11
|
+
`AssembleContext` 标识一次组装所解析的作用域层,并可携带该请求的显式控制信号。它可合并扩展:`dsh-agent` 添加可选字段 `agent`,用于携带当前的 agent(智能体)实例;`assembleContextFor(agent, signal)` 则一起设置这些显式字段。裸组装既没有作用域,也没有信号。
|
|
12
|
+
|
|
13
|
+
```ts type-equiv
|
|
14
|
+
/** Merge-extensible context for one prompt assembly. */
|
|
15
|
+
interface AssembleContext {
|
|
16
|
+
/**
|
|
17
|
+
* Scope whose providers and waterfall listeners participate. When absent,
|
|
18
|
+
* only global providers and subject-less listeners participate.
|
|
19
|
+
*/
|
|
20
|
+
scope?: ScopeKey
|
|
21
|
+
/** Explicit control signal for the turn that requested this assembly, when any. */
|
|
22
|
+
signal?: AbortSignal
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## 工具提供方结果
|
|
27
|
+
|
|
28
|
+
`ToolProviderResult.schemas` 是当前组装中对模型可见的工具 schema 集合。`knownNames` 是提供方在限制前的名称全集,用于区分「配置名拼写错误」与「已知工具在此作用域中被有意隐藏」。
|
|
29
|
+
|
|
30
|
+
```ts type-equiv
|
|
31
|
+
/** Tool schemas visible in one assembly and their pre-restriction name set. */
|
|
32
|
+
interface ToolProviderResult {
|
|
33
|
+
/** The schemas this provider contributes to THIS assembly. */
|
|
34
|
+
readonly schemas: readonly ToolSchema[]
|
|
35
|
+
/** The pre-restriction name universe for config validation (defaults to `schemas`' names). */
|
|
36
|
+
readonly knownNames?: readonly string[]
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## 提示词段落
|
|
41
|
+
|
|
42
|
+
`PromptSection` 是一份只读的同进程注册约定。其文本可以是静态的,也可以从当前组装上下文动态解析。协作式组装完成后,一个有效的 `complete` 段会成为唯一的提示词段落。
|
|
43
|
+
|
|
44
|
+
```ts type-equiv
|
|
45
|
+
/** One contributed section of the system prompt (registry input). */
|
|
46
|
+
interface PromptSection {
|
|
47
|
+
/** Unique name — a duplicate registration throws (see {@link SystemPrompt.section}). */
|
|
48
|
+
readonly name: string
|
|
49
|
+
/**
|
|
50
|
+
* Sections are concatenated in ascending order. Convention: `-100` is the
|
|
51
|
+
* harness identity, `0` the deployment persona, tool guidance uses 100–199;
|
|
52
|
+
* other negative orders also render before the persona.
|
|
53
|
+
*/
|
|
54
|
+
readonly order: number
|
|
55
|
+
/**
|
|
56
|
+
* Static text or a provider evaluated at each assembly with that assembly's
|
|
57
|
+
* {@link AssembleContext}. The text may reference `{{variable}}`s — they are
|
|
58
|
+
* interpolated later, by {@link renderPrompt}.
|
|
59
|
+
*/
|
|
60
|
+
readonly text: string | ((context: AssembleContext) => string)
|
|
61
|
+
/**
|
|
62
|
+
* Treat this contribution as the complete system prompt. Assembly still
|
|
63
|
+
* runs the cooperative waterfall so tools, contexts, and variables can be
|
|
64
|
+
* resolved, then restores this exact section as the sole prompt section.
|
|
65
|
+
* More than one effective complete section makes assembly fail.
|
|
66
|
+
*/
|
|
67
|
+
readonly complete?: boolean
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## 动态提示词上下文
|
|
72
|
+
|
|
73
|
+
`PromptContext` 是与 `PromptSection` 对应的缓存安全结构。组装会解析这些贡献并排序;agent loop(智能体循环)仅在完整当前快照发生变化或被压缩(compaction)移除时,才会将其记录在保留的模型历史之后。
|
|
74
|
+
|
|
75
|
+
```ts type-equiv
|
|
76
|
+
/** Dynamic model context materialized as a durable user-role snapshot. */
|
|
77
|
+
interface PromptContext {
|
|
78
|
+
/** Unique name — a duplicate registration throws (see {@link SystemPrompt.context}). */
|
|
79
|
+
readonly name: string
|
|
80
|
+
/** Contexts are joined in ascending order. */
|
|
81
|
+
readonly order: number
|
|
82
|
+
/** Static text or a provider evaluated for each assembly. Empty text contributes nothing. */
|
|
83
|
+
readonly text: string | ((context: AssembleContext) => string)
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
|
|
88
|
+
|
|
89
|
+
<a id="cordis-surface"></a>
|
|
90
|
+
|
|
91
|
+
## Cordis API
|
|
92
|
+
|
|
93
|
+
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`) — this section is byte-identical in both language sides of the page. 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).
|
|
94
|
+
|
|
95
|
+
<a id="ctxsystemprompt--systemprompt"></a>
|
|
96
|
+
|
|
97
|
+
### `ctx.systemPrompt` — `SystemPrompt`
|
|
98
|
+
|
|
99
|
+
Registry service for the prompt inputs assembled before each model step.
|
|
100
|
+
|
|
101
|
+
```ts cordis-catalog
|
|
102
|
+
/**
|
|
103
|
+
* Register an ordered prompt section in the calling context's scope. A scoped
|
|
104
|
+
* section shadows a global section with the same name; duplicates within one
|
|
105
|
+
* layer and non-finite orders throw. Registration and disposal emit
|
|
106
|
+
* `system-prompt/change`.
|
|
107
|
+
* @param section - the section to register.
|
|
108
|
+
* @returns the exact Cordis effect disposer.
|
|
109
|
+
*/
|
|
110
|
+
section(section: PromptSection): () => void
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Register ordered dynamic context in the calling context's scope. Scoped
|
|
114
|
+
* entries shadow global entries with the same name.
|
|
115
|
+
* @param context - the context contribution to register.
|
|
116
|
+
* @returns the exact Cordis effect disposer.
|
|
117
|
+
*/
|
|
118
|
+
context(context: PromptContext): () => void
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Suppress every dynamic runtime-context contribution in the calling
|
|
122
|
+
* context's scope without changing the services that own or enforce those
|
|
123
|
+
* facts. Multiple suppressors remain independently disposable.
|
|
124
|
+
* @returns the exact Cordis effect disposer.
|
|
125
|
+
*/
|
|
126
|
+
suppressRuntimeContext(): () => void
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Register a tool-schema provider in the calling context's scope. Global and
|
|
130
|
+
* matching scoped providers both contribute; returning the reserved
|
|
131
|
+
* {@link TOOL_ORDER_REST} name makes assembly fail.
|
|
132
|
+
* @param provider - evaluated for each assembly with its context.
|
|
133
|
+
* @returns the exact Cordis effect disposer.
|
|
134
|
+
*/
|
|
135
|
+
tools(provider: (context: AssembleContext) => ToolProviderResult): () => void
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Register a prompt variable in the calling context's scope. Scoped values
|
|
139
|
+
* shadow globals; invalid or duplicate names throw. A provider may return
|
|
140
|
+
* `undefined`, but rendering a section that references that value then fails.
|
|
141
|
+
* @param name - the `[a-z][a-z0-9_]*` reference name.
|
|
142
|
+
* @param provider - evaluated for each assembly.
|
|
143
|
+
* @returns the exact Cordis effect disposer.
|
|
144
|
+
*/
|
|
145
|
+
variable(name: string, provider: (context: AssembleContext) => string | undefined): () => void
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Assemble global and scoped providers, detach tool parameters, apply
|
|
149
|
+
* canonical ordering, then run the assembly waterfall. Scoped sections and
|
|
150
|
+
* variables shadow globals. The returned waterfall value is authoritative
|
|
151
|
+
* except that an effective complete section is restored afterwards as the
|
|
152
|
+
* sole prompt section.
|
|
153
|
+
* @param context - the optional scope and plugin-defined assembly fields.
|
|
154
|
+
* @returns the post-waterfall assembly with any complete prompt enforced.
|
|
155
|
+
*/
|
|
156
|
+
async assemble(context: AssembleContext = {}): Promise<PromptAssembly>
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Source: [`packages/core/system-prompt/src/index.ts:338`](../../packages/core/system-prompt/src/index.ts)
|
|
160
|
+
|
|
161
|
+
<a id="system-prompt-events"></a>
|
|
162
|
+
|
|
163
|
+
### `system-prompt/*` events
|
|
164
|
+
|
|
165
|
+
<a id="system-promptassemble--waterfall"></a>
|
|
166
|
+
|
|
167
|
+
#### `system-prompt/assemble` — waterfall
|
|
168
|
+
|
|
169
|
+
Expert waterfall over the assembled sections, contexts, tools, and variables. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): scoped listeners receive only that scope's assemblies. The returned value is authoritative. A supplied signal controls only this explicit assembly request and must not be retained to control later turns. A registered complete section is restored after this waterfall, so listeners cannot add to or replace that scope's system prompt.
|
|
170
|
+
|
|
171
|
+
```ts cordis-catalog
|
|
172
|
+
/**
|
|
173
|
+
* Expert waterfall over the assembled sections, contexts, tools, and variables.
|
|
174
|
+
* Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): scoped listeners
|
|
175
|
+
* receive only that scope's assemblies. The returned value is authoritative.
|
|
176
|
+
* A supplied signal controls only this explicit assembly request and must not
|
|
177
|
+
* be retained to control later turns. A registered complete section is
|
|
178
|
+
* restored after this waterfall, so listeners cannot add to or replace
|
|
179
|
+
* that scope's system prompt.
|
|
180
|
+
* @param assembly - the mutable assembly built from registered providers.
|
|
181
|
+
* @param context - the caller's per-assembly context.
|
|
182
|
+
* @mode waterfall
|
|
183
|
+
*/
|
|
184
|
+
'system-prompt/assemble'(this: Scoped<SystemPrompt>, assembly: PromptAssembly, context: AssembleContext, next: () => Promise<PromptAssembly>): Promise<PromptAssembly>
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Types: [Scoped](scope.md)
|
|
188
|
+
|
|
189
|
+
Source: [`packages/core/system-prompt/src/index.ts:31`](../../packages/core/system-prompt/src/index.ts)
|
|
190
|
+
|
|
191
|
+
<a id="system-promptchange--emit"></a>
|
|
192
|
+
|
|
193
|
+
#### `system-prompt/change` — emit
|
|
194
|
+
|
|
195
|
+
Emitted when any prompt provider changes. This registry notification is unfiltered because a global change affects every scope.
|
|
196
|
+
|
|
197
|
+
```ts cordis-catalog
|
|
198
|
+
/**
|
|
199
|
+
* Emitted when any prompt provider changes. This registry notification is
|
|
200
|
+
* unfiltered because a global change affects every scope.
|
|
201
|
+
* @mode emit
|
|
202
|
+
*/
|
|
203
|
+
'system-prompt/change'(): void
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Source: [`packages/core/system-prompt/src/index.ts:37`](../../packages/core/system-prompt/src/index.ts)
|
|
207
|
+
<!-- END GENERATED cordis-surface -->
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
|
|
2
|
+
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
|
+
# after editing either side, bring the other along and re-record with:
|
|
4
|
+
# pnpm run verify-translation-pairing --write docs/subsystems/terminal.md
|
|
5
|
+
terminal.md: eedf6157b256e83d3b57e07bf738429773b87574
|
|
6
|
+
terminal.zh.md: 3cc2c281e8c2090bb7e92808f932be689fd0b710
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# Persistent PTY Sessions
|
|
2
|
+
|
|
3
|
+
English | [中文](terminal.zh.md)
|
|
4
|
+
|
|
5
|
+
Types shared by PTY backends, `ctx.terminals`, and the model-facing consumer. The [persistent PTY Agent Note](../../.agents/notes/implemented/feature/2026-07-16-persistent-pty-sessions.md) owns the rationale; this page records the cross-package vocabulary from [`packages/terminal/terminal/src/types.ts`](../../packages/terminal/terminal/src/types.ts).
|
|
6
|
+
|
|
7
|
+
## Identity and readiness
|
|
8
|
+
|
|
9
|
+
`TerminalSessionId` is a service-minted branded id. Optional names are owner-local display metadata; authorization compares the exact owning `Agent`, not a name or guessed id.
|
|
10
|
+
|
|
11
|
+
`TerminalWaitReason` says why one send returned. It is independent from `TerminalSessionStatus`: silence or timeout may return while the top-level shell remains alive, while `session_exit` means that shell exited rather than an arbitrary foreground child.
|
|
12
|
+
|
|
13
|
+
```ts type-equiv
|
|
14
|
+
/** Why one interactive send returned control to its caller. */
|
|
15
|
+
type TerminalWaitReason = 'stdin_read' | 'inferred_idle' | 'timeout' | 'session_exit'
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
```ts type-equiv
|
|
19
|
+
/** Top-level PTY process status, independent of a send's wait reason. */
|
|
20
|
+
type TerminalSessionStatus =
|
|
21
|
+
| { kind: 'running' }
|
|
22
|
+
| { kind: 'exited'; exitCode: number | null; signal: NodeJS.Signals | null }
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Backend and live session
|
|
26
|
+
|
|
27
|
+
A backend owns how one registered type starts and detects readiness. `TerminalSessionService` publishes the returned session only after setup succeeds, then owns id authorization and cleanup. A backend that cannot clean partial startup resources rejects with `TerminalBackendCleanupError`, allowing disposal to retain the cleanup failure without replacing the caller's cancellation reason. A backend session owns terminal state and captured-resource quiescence.
|
|
28
|
+
|
|
29
|
+
```ts type-equiv
|
|
30
|
+
/** Replaceable provider for one PTY session type. */
|
|
31
|
+
interface TerminalBackend {
|
|
32
|
+
/** Stable type selected by {@link TerminalSpawnRequest.type}. */
|
|
33
|
+
readonly type: string
|
|
34
|
+
/** Create an unpublished session or reject after cleaning partial resources; cleanup failure uses {@link TerminalBackendCleanupError}. */
|
|
35
|
+
spawn(spec: TerminalBackendSpawnSpec): Promise<TerminalBackendSession>
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
```ts type-equiv
|
|
40
|
+
/** Backend-owned live session retained by {@link TerminalSessionService}. */
|
|
41
|
+
interface TerminalBackendSession {
|
|
42
|
+
/** Initial bounded terminal output returned from `terminal_open`. */
|
|
43
|
+
readonly motd: string
|
|
44
|
+
/** Top-level process id when one exists. */
|
|
45
|
+
readonly pid?: number
|
|
46
|
+
/** Start one exclusive send operation. */
|
|
47
|
+
startSend(request: TerminalSendRequest): TerminalSendOperation
|
|
48
|
+
/** Read one bounded page from retained scrollback. */
|
|
49
|
+
read(request: TerminalReadRequest): TerminalReadResult
|
|
50
|
+
/** Signal the verified foreground process group. */
|
|
51
|
+
signal(signal: TerminalSignal): Promise<TerminalSignalResult>
|
|
52
|
+
/** Observe top-level process status. */
|
|
53
|
+
status(): TerminalSessionStatus
|
|
54
|
+
/** Idempotently close the captured owned process tree and await quiescence. */
|
|
55
|
+
close(reason: string): Promise<void>
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Send and retained output
|
|
60
|
+
|
|
61
|
+
One live session accepts one active send. Its operation exposes a consuming output cursor for generic background jobs and one terminal result for a foreground caller. `TerminalReadResult` separately pages the bounded session scrollback.
|
|
62
|
+
|
|
63
|
+
```ts type-equiv
|
|
64
|
+
/** Live backend-owned send; exactly one may be active per PTY session. */
|
|
65
|
+
interface TerminalSendOperation {
|
|
66
|
+
/** Resolves after readiness, timeout, cancellation, or top-level process exit. */
|
|
67
|
+
done: Promise<TerminalSendResult>
|
|
68
|
+
/** Consume output produced since the prior call. */
|
|
69
|
+
readOutput(): TerminalSendRead
|
|
70
|
+
/** Request `SIGINT`; returns false after the operation settled. */
|
|
71
|
+
cancel(): boolean
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
```ts type-equiv
|
|
76
|
+
/** Settled result for one foreground or background send. */
|
|
77
|
+
interface TerminalSendResult {
|
|
78
|
+
/** Bounded rendered terminal delta remaining at settlement. */
|
|
79
|
+
viewport: string
|
|
80
|
+
/** Why the wait returned; this does not imply arbitrary child-process exit. */
|
|
81
|
+
waitReason: TerminalWaitReason
|
|
82
|
+
/** Top-level session status observed at settlement. */
|
|
83
|
+
sessionStatus: TerminalSessionStatus
|
|
84
|
+
/** Whether output was dropped from the operation or retained scrollback. */
|
|
85
|
+
truncated: boolean
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Ownership and durability
|
|
90
|
+
|
|
91
|
+
`TerminalSessionService` attaches one awaited cleanup to the exact owner scope, rejects foreign operations, and keeps sessions alive across backend or tool-plugin reload. PTY state and raw bytes remain process-local. Model input and bounded returned output are durable through the existing `tool/call`, `tool/result`, and task-result paths rather than duplicate PTY session events.
|
|
92
|
+
|
|
93
|
+
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
|
|
94
|
+
|
|
95
|
+
<a id="cordis-surface"></a>
|
|
96
|
+
|
|
97
|
+
## Cordis API
|
|
98
|
+
|
|
99
|
+
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`) — this section is byte-identical in both language sides of the page. 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).
|
|
100
|
+
|
|
101
|
+
<a id="ctxterminals--terminalsessionservice"></a>
|
|
102
|
+
|
|
103
|
+
### `ctx.terminals` — `TerminalSessionService`
|
|
104
|
+
|
|
105
|
+
In-process registry for replaceable PTY backends and exact-Agent sessions.
|
|
106
|
+
|
|
107
|
+
```ts cordis-catalog
|
|
108
|
+
/**
|
|
109
|
+
* Register one backend type for this effect scope.
|
|
110
|
+
* @param backend - provider with a non-empty unique type.
|
|
111
|
+
* @returns disposer that removes exactly this contribution.
|
|
112
|
+
*/
|
|
113
|
+
registerBackend(backend: TerminalBackend): () => void
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* List registered backend types in registration order.
|
|
117
|
+
* @returns fresh backend type names.
|
|
118
|
+
*/
|
|
119
|
+
listBackends(): string[]
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Create and publish one owner-scoped session after backend setup succeeds.
|
|
123
|
+
* @param owner - exact registered Agent that owns access and cleanup.
|
|
124
|
+
* @param request - backend type plus optional owner-local name and cwd.
|
|
125
|
+
* @param signal - cancellation of unpublished setup.
|
|
126
|
+
* @returns published identity, metadata, status, and MOTD.
|
|
127
|
+
*/
|
|
128
|
+
async spawn(owner: Agent, request: TerminalSpawnRequest, signal?: AbortSignal): Promise<TerminalSpawnResult>
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Test whether an exact owner has a published session or unpublished spawn.
|
|
132
|
+
* @param owner - exact live owner to inspect.
|
|
133
|
+
* @returns true across the entire spawn-to-close interval, with no publication gap.
|
|
134
|
+
*/
|
|
135
|
+
hasOwnerActivity(owner: Agent): boolean
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Start one exclusive interactive send.
|
|
139
|
+
* @param owner - exact session owner.
|
|
140
|
+
* @param id - target PTY identity.
|
|
141
|
+
* @param request - explicit text, submit behavior, and cancellation.
|
|
142
|
+
* @returns live operation handle for foreground await or task registration.
|
|
143
|
+
*/
|
|
144
|
+
startSend(owner: Agent, id: TerminalSessionId, request: TerminalSendRequest): TerminalSendOperation
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Read one bounded scrollback page from an owned session.
|
|
148
|
+
* @param owner - exact session owner.
|
|
149
|
+
* @param id - target PTY identity.
|
|
150
|
+
* @param request - optional newest-relative offset and line count.
|
|
151
|
+
* @returns bounded retained text and pagination metadata.
|
|
152
|
+
*/
|
|
153
|
+
read(owner: Agent, id: TerminalSessionId, request: TerminalReadRequest = {}): TerminalReadResult
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Deliver an allowed signal through an owned backend session.
|
|
157
|
+
* @param owner - exact session owner.
|
|
158
|
+
* @param id - target PTY identity.
|
|
159
|
+
* @param signal - allowed POSIX signal name.
|
|
160
|
+
* @returns delivered foreground process-group identity.
|
|
161
|
+
*/
|
|
162
|
+
signal(owner: Agent, id: TerminalSessionId, signal: TerminalSignal): Promise<TerminalSignalResult>
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Close one owned session and remove it only after quiescent backend cleanup.
|
|
166
|
+
* @param owner - exact session owner.
|
|
167
|
+
* @param id - target PTY identity.
|
|
168
|
+
* @param reason - diagnostic cleanup reason.
|
|
169
|
+
* @returns true for a newly closed session, false when the same close is already in flight.
|
|
170
|
+
*/
|
|
171
|
+
async kill(owner: Agent, id: TerminalSessionId, reason: string = 'model request'): Promise<boolean>
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* List fresh snapshots for exactly one owner.
|
|
175
|
+
* @param owner - exact owner whose sessions are visible.
|
|
176
|
+
* @returns owner-visible snapshots in publication order.
|
|
177
|
+
*/
|
|
178
|
+
list(owner: Agent): TerminalSessionSnapshot[]
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Types: [Agent](core.md)
|
|
182
|
+
|
|
183
|
+
Source: [`packages/terminal/terminal/src/index.ts:105`](../../packages/terminal/terminal/src/index.ts)
|
|
184
|
+
<!-- END GENERATED cordis-surface -->
|