dsh-plugin-guide 0.3.1 → 0.3.3
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/README.es.md +1 -1
- package/README.hi.md +1 -1
- package/README.md +1 -1
- package/README.pt.md +1 -1
- package/README.zh.md +1 -1
- package/SKILL.md +1 -1
- package/dist/dsh-plugin-dev.js +5 -5
- package/guide/links.md +1 -1
- package/guide/plugin-dev-guide.md +1 -1
- package/guide/quick-reference.es.md +2 -2
- package/guide/quick-reference.hi.md +1 -1
- package/guide/quick-reference.md +2 -2
- package/guide/quick-reference.pt.md +2 -2
- package/guide/quick-reference.zh-CN.md +2 -2
- package/package.json +3 -3
- package/references/cordis-paper-and-community.md +1 -1
- package/references/official-docs/AGENTS.md +28 -23
- package/references/official-docs/README.i18n.yaml +2 -2
- package/references/official-docs/README.md +1 -1
- package/references/official-docs/README.zh.md +19 -9
- package/references/official-docs/SNAPSHOT.md +5 -5
- package/references/official-docs/THIRD_PARTY_NOTICES.md +36 -13
- package/references/official-docs/docs/AGENTS.md +4 -4
- package/references/official-docs/docs/agent-lifecycle.i18n.yaml +2 -2
- package/references/official-docs/docs/agent-lifecycle.md +1 -1
- package/references/official-docs/docs/agent-lifecycle.zh.md +2 -2
- package/references/official-docs/docs/api-gateway.i18n.yaml +2 -2
- package/references/official-docs/docs/api-gateway.md +8 -8
- package/references/official-docs/docs/api-gateway.zh.md +8 -8
- package/references/official-docs/docs/architecture.i18n.yaml +2 -2
- package/references/official-docs/docs/architecture.md +25 -8
- package/references/official-docs/docs/architecture.zh.md +38 -21
- package/references/official-docs/docs/capability-seams.i18n.yaml +2 -2
- package/references/official-docs/docs/capability-seams.md +134 -67
- package/references/official-docs/docs/capability-seams.zh.md +134 -67
- package/references/official-docs/docs/config-catalog.i18n.yaml +2 -2
- package/references/official-docs/docs/config-catalog.md +731 -403
- package/references/official-docs/docs/config-catalog.zh.md +747 -419
- package/references/official-docs/docs/cookbook/adding-a-package.i18n.yaml +2 -2
- package/references/official-docs/docs/cookbook/adding-a-package.md +3 -4
- package/references/official-docs/docs/cookbook/adding-a-package.zh.md +9 -8
- package/references/official-docs/docs/cookbook/{adding-a-conversation-node.i18n.yaml → adding-a-remote-api.i18n.yaml} +3 -3
- package/references/official-docs/docs/cookbook/adding-a-remote-api.md +197 -0
- package/references/official-docs/docs/cookbook/adding-a-remote-api.zh.md +197 -0
- package/references/official-docs/docs/cookbook/adding-a-settings-card.i18n.yaml +6 -0
- package/references/official-docs/docs/cookbook/adding-a-settings-card.md +102 -0
- package/references/official-docs/docs/cookbook/adding-a-settings-card.zh.md +102 -0
- package/references/official-docs/docs/cookbook/adding-a-tool.i18n.yaml +2 -2
- package/references/official-docs/docs/cookbook/adding-a-tool.md +11 -4
- package/references/official-docs/docs/cookbook/adding-a-tool.zh.md +16 -9
- package/references/official-docs/docs/cookbook/adding-a-vendored-package.i18n.yaml +2 -2
- package/references/official-docs/docs/cookbook/adding-a-vendored-package.md +2 -2
- package/references/official-docs/docs/cookbook/adding-a-vendored-package.zh.md +4 -4
- package/references/official-docs/docs/cookbook/adding-an-llm-adapter.i18n.yaml +2 -2
- package/references/official-docs/docs/cookbook/adding-an-llm-adapter.md +1 -1
- package/references/official-docs/docs/cookbook/adding-an-llm-adapter.zh.md +3 -3
- package/references/official-docs/docs/cookbook/extension-cookbook.i18n.yaml +2 -2
- package/references/official-docs/docs/cookbook/extension-cookbook.md +9 -8
- package/references/official-docs/docs/cookbook/extension-cookbook.zh.md +17 -14
- package/references/official-docs/docs/cookbook/maintaining-dsh-code-review.i18n.yaml +1 -1
- package/references/official-docs/docs/cookbook/maintaining-dsh-code-review.zh.md +1 -1
- package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.i18n.yaml +1 -1
- package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.zh.md +1 -1
- package/references/official-docs/docs/cordis-api/context.i18n.yaml +1 -1
- package/references/official-docs/docs/cordis-api/context.zh.md +1 -1
- package/references/official-docs/docs/cordis-api/events.i18n.yaml +1 -1
- package/references/official-docs/docs/cordis-api/events.zh.md +1 -1
- package/references/official-docs/docs/cordis-api/inherited.md +1 -1
- package/references/official-docs/docs/cordis-primer.i18n.yaml +2 -2
- package/references/official-docs/docs/cordis-primer.md +2 -1
- package/references/official-docs/docs/cordis-primer.zh.md +3 -2
- package/references/official-docs/docs/cordis-tutorial/01-first-plugin.i18n.yaml +1 -1
- package/references/official-docs/docs/cordis-tutorial/01-first-plugin.zh.md +4 -4
- package/references/official-docs/docs/cordis-tutorial/02-lifecycle-and-effects.i18n.yaml +1 -1
- package/references/official-docs/docs/cordis-tutorial/02-lifecycle-and-effects.zh.md +4 -4
- package/references/official-docs/docs/cordis-tutorial/03-services.i18n.yaml +1 -1
- package/references/official-docs/docs/cordis-tutorial/03-services.zh.md +4 -4
- package/references/official-docs/docs/cordis-tutorial/04-events.i18n.yaml +1 -1
- package/references/official-docs/docs/cordis-tutorial/04-events.zh.md +4 -4
- package/references/official-docs/docs/cordis-tutorial/05-config.i18n.yaml +1 -1
- package/references/official-docs/docs/cordis-tutorial/05-config.zh.md +2 -2
- package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.i18n.yaml +1 -1
- package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.zh.md +3 -3
- package/references/official-docs/docs/cordis-tutorial/07-into-the-harness.i18n.yaml +2 -2
- package/references/official-docs/docs/cordis-tutorial/07-into-the-harness.md +5 -4
- package/references/official-docs/docs/cordis-tutorial/07-into-the-harness.zh.md +11 -10
- package/references/official-docs/docs/cordis-tutorial/index.i18n.yaml +1 -1
- package/references/official-docs/docs/cordis-tutorial/index.zh.md +10 -10
- package/references/official-docs/docs/deepseek-llm-api-wire-extensions.i18n.yaml +6 -0
- package/references/official-docs/docs/deepseek-llm-api-wire-extensions.md +159 -0
- package/references/official-docs/docs/deepseek-llm-api-wire-extensions.zh.md +159 -0
- package/references/official-docs/docs/defensive-patterns.i18n.yaml +1 -1
- package/references/official-docs/docs/defensive-patterns.zh.md +3 -1
- package/references/official-docs/docs/development.i18n.yaml +2 -2
- package/references/official-docs/docs/development.md +9 -13
- package/references/official-docs/docs/development.zh.md +23 -21
- package/references/official-docs/docs/event-producer-consumer.i18n.yaml +2 -2
- package/references/official-docs/docs/event-producer-consumer.md +55 -46
- package/references/official-docs/docs/event-producer-consumer.zh.md +55 -46
- package/references/official-docs/docs/glossary.i18n.yaml +2 -2
- package/references/official-docs/docs/glossary.md +1 -1
- package/references/official-docs/docs/glossary.zh.md +1 -1
- package/references/official-docs/docs/graph-atlas.i18n.yaml +2 -2
- package/references/official-docs/docs/graph-atlas.md +0 -2
- package/references/official-docs/docs/graph-atlas.zh.md +7 -9
- package/references/official-docs/docs/i18n/README.i18n.yaml +2 -2
- package/references/official-docs/docs/i18n/README.md +7 -7
- package/references/official-docs/docs/i18n/README.zh.md +11 -9
- package/references/official-docs/docs/i18n/style-samples.md +3 -3
- package/references/official-docs/docs/i18n/translation-prompt.md +3 -3
- package/references/official-docs/docs/i18n/translation-rules.i18n.yaml +2 -2
- package/references/official-docs/docs/i18n/translation-rules.md +2 -2
- package/references/official-docs/docs/i18n/translation-rules.zh.md +3 -3
- package/references/official-docs/docs/module-graph.i18n.yaml +2 -2
- package/references/official-docs/docs/module-graph.md +660 -909
- package/references/official-docs/docs/module-graph.zh.md +662 -911
- package/references/official-docs/docs/persistence-catalog.i18n.yaml +2 -2
- package/references/official-docs/docs/persistence-catalog.md +185 -53
- package/references/official-docs/docs/persistence-catalog.zh.md +193 -61
- package/references/official-docs/docs/postmortem/0001-acp-default-export-drops-inject.i18n.yaml +2 -2
- package/references/official-docs/docs/postmortem/0001-acp-default-export-drops-inject.md +2 -2
- package/references/official-docs/docs/postmortem/0001-acp-default-export-drops-inject.zh.md +3 -3
- package/references/official-docs/docs/postmortem/0002-js-expression-disabled-filesystem-tools.i18n.yaml +2 -2
- package/references/official-docs/docs/postmortem/0002-js-expression-disabled-filesystem-tools.md +2 -2
- package/references/official-docs/docs/postmortem/0002-js-expression-disabled-filesystem-tools.zh.md +2 -2
- package/references/official-docs/docs/postmortem/0003-web-agent-gui-feedback-loop.i18n.yaml +2 -2
- package/references/official-docs/docs/postmortem/0003-web-agent-gui-feedback-loop.md +2 -2
- package/references/official-docs/docs/postmortem/0003-web-agent-gui-feedback-loop.zh.md +2 -2
- package/references/official-docs/docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.i18n.yaml +2 -2
- package/references/official-docs/docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.md +1 -1
- package/references/official-docs/docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.zh.md +2 -2
- package/references/official-docs/docs/postmortem/README.i18n.yaml +1 -1
- package/references/official-docs/docs/postmortem/README.zh.md +5 -5
- package/references/official-docs/docs/rescope.i18n.yaml +2 -2
- package/references/official-docs/docs/rescope.md +2 -2
- package/references/official-docs/docs/rescope.zh.md +3 -3
- package/references/official-docs/docs/subsystems/README.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/README.md +8 -2
- package/references/official-docs/docs/subsystems/README.zh.md +53 -47
- package/references/official-docs/docs/subsystems/agent-team.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/agent-team.md +207 -0
- package/references/official-docs/docs/subsystems/agent-team.zh.md +207 -0
- package/references/official-docs/docs/subsystems/approval.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/approval.md +12 -12
- package/references/official-docs/docs/subsystems/approval.zh.md +13 -13
- package/references/official-docs/docs/subsystems/attachment.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/attachment.md +90 -7
- package/references/official-docs/docs/subsystems/attachment.zh.md +90 -7
- package/references/official-docs/docs/subsystems/client-modules.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/client-modules.md +69 -19
- package/references/official-docs/docs/subsystems/client-modules.zh.md +69 -19
- package/references/official-docs/docs/subsystems/code-runtime.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/code-runtime.md +12 -8
- package/references/official-docs/docs/subsystems/code-runtime.zh.md +13 -9
- package/references/official-docs/docs/subsystems/commands.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/commands.md +30 -7
- package/references/official-docs/docs/subsystems/commands.zh.md +31 -8
- package/references/official-docs/docs/subsystems/compaction.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/compaction.md +14 -14
- package/references/official-docs/docs/subsystems/compaction.zh.md +19 -19
- package/references/official-docs/docs/subsystems/conversation.i18n.yaml +6 -0
- package/references/official-docs/docs/{cookbook/adding-a-conversation-node.md → subsystems/conversation.md} +49 -24
- package/references/official-docs/docs/{cookbook/adding-a-conversation-node.zh.md → subsystems/conversation.zh.md} +49 -24
- package/references/official-docs/docs/subsystems/core.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/core.md +114 -36
- package/references/official-docs/docs/subsystems/core.zh.md +145 -65
- package/references/official-docs/docs/subsystems/credentials.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/credentials.md +207 -11
- package/references/official-docs/docs/subsystems/credentials.zh.md +207 -11
- package/references/official-docs/docs/subsystems/extensions.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/extensions.md +27 -9
- package/references/official-docs/docs/subsystems/extensions.zh.md +30 -12
- package/references/official-docs/docs/subsystems/feedback.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/feedback.md +6 -6
- package/references/official-docs/docs/subsystems/feedback.zh.md +6 -6
- package/references/official-docs/docs/subsystems/filesystem.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/filesystem.md +17 -7
- package/references/official-docs/docs/subsystems/filesystem.zh.md +19 -9
- package/references/official-docs/docs/subsystems/goal.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/goal.md +4 -4
- package/references/official-docs/docs/subsystems/goal.zh.md +8 -8
- package/references/official-docs/docs/subsystems/invariants.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/invariants.md +2 -2
- package/references/official-docs/docs/subsystems/invariants.zh.md +5 -5
- package/references/official-docs/docs/subsystems/jobs.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/jobs.md +3 -3
- package/references/official-docs/docs/subsystems/jobs.zh.md +6 -6
- package/references/official-docs/docs/subsystems/llm-streaming.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/llm-streaming.md +193 -22
- package/references/official-docs/docs/subsystems/llm-streaming.zh.md +199 -28
- package/references/official-docs/docs/subsystems/lsp.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/lsp.md +2 -2
- package/references/official-docs/docs/subsystems/lsp.zh.md +3 -3
- package/references/official-docs/docs/subsystems/permission-presets.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/permission-presets.md +8 -8
- package/references/official-docs/docs/subsystems/permission-presets.zh.md +8 -8
- package/references/official-docs/docs/subsystems/persistence.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/persistence.md +183 -173
- package/references/official-docs/docs/subsystems/persistence.zh.md +182 -172
- package/references/official-docs/docs/subsystems/plan.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/plan.md +4 -4
- package/references/official-docs/docs/subsystems/plan.zh.md +10 -10
- package/references/official-docs/docs/subsystems/sandbox.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/sandbox.md +5 -3
- package/references/official-docs/docs/subsystems/sandbox.zh.md +8 -6
- package/references/official-docs/docs/subsystems/schedule.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/schedule.md +9 -3
- package/references/official-docs/docs/subsystems/schedule.zh.md +11 -5
- package/references/official-docs/docs/subsystems/scope.i18n.yaml +1 -1
- package/references/official-docs/docs/subsystems/scope.zh.md +1 -1
- package/references/official-docs/docs/subsystems/session-projection.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/session-projection.md +148 -75
- package/references/official-docs/docs/subsystems/session-projection.zh.md +148 -75
- package/references/official-docs/docs/subsystems/session-query.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/session-query.md +30 -16
- package/references/official-docs/docs/subsystems/session-query.zh.md +31 -17
- package/references/official-docs/docs/subsystems/session-reference.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/session-reference.md +94 -7
- package/references/official-docs/docs/subsystems/session-reference.zh.md +95 -8
- package/references/official-docs/docs/subsystems/session-telemetry.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/session-telemetry.md +5 -6
- package/references/official-docs/docs/subsystems/session-telemetry.zh.md +9 -10
- package/references/official-docs/docs/subsystems/session-title.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/session-title.md +8 -8
- package/references/official-docs/docs/subsystems/session-title.zh.md +10 -10
- package/references/official-docs/docs/subsystems/session.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/session.md +376 -71
- package/references/official-docs/docs/subsystems/session.zh.md +392 -85
- package/references/official-docs/docs/subsystems/settings.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/settings.md +105 -10
- package/references/official-docs/docs/subsystems/settings.zh.md +105 -10
- package/references/official-docs/docs/subsystems/shell.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/shell.md +3 -3
- package/references/official-docs/docs/subsystems/shell.zh.md +11 -11
- package/references/official-docs/docs/subsystems/skills.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/skills.md +26 -3
- package/references/official-docs/docs/subsystems/skills.zh.md +29 -6
- package/references/official-docs/docs/subsystems/slots.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/slots.md +175 -0
- package/references/official-docs/docs/subsystems/slots.zh.md +175 -0
- package/references/official-docs/docs/subsystems/spill.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/spill.md +4 -4
- package/references/official-docs/docs/subsystems/spill.zh.md +6 -6
- package/references/official-docs/docs/subsystems/storage.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/storage.md +38 -7
- package/references/official-docs/docs/subsystems/storage.zh.md +41 -10
- package/references/official-docs/docs/subsystems/subagent.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/subagent.md +148 -116
- package/references/official-docs/docs/subsystems/subagent.zh.md +158 -124
- package/references/official-docs/docs/subsystems/subprocess.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/subprocess.md +3 -3
- package/references/official-docs/docs/subsystems/subprocess.zh.md +5 -5
- package/references/official-docs/docs/subsystems/system-prompt.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/system-prompt.md +21 -8
- package/references/official-docs/docs/subsystems/system-prompt.zh.md +23 -10
- package/references/official-docs/docs/subsystems/terminal.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/terminal.md +2 -2
- package/references/official-docs/docs/subsystems/terminal.zh.md +4 -4
- package/references/official-docs/docs/subsystems/todo.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/todo.md +32 -0
- package/references/official-docs/docs/subsystems/todo.zh.md +32 -0
- package/references/official-docs/docs/subsystems/token-meter.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/token-meter.md +29 -14
- package/references/official-docs/docs/subsystems/token-meter.zh.md +30 -15
- package/references/official-docs/docs/subsystems/tools.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/tools.md +46 -46
- package/references/official-docs/docs/subsystems/tools.zh.md +54 -54
- package/references/official-docs/docs/subsystems/typert.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/typert.md +65 -58
- package/references/official-docs/docs/subsystems/typert.zh.md +67 -60
- package/references/official-docs/docs/subsystems/user-questions.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/user-questions.md +35 -35
- package/references/official-docs/docs/subsystems/user-questions.zh.md +35 -35
- package/references/official-docs/docs/subsystems/web-client.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/web-client.md +95 -0
- package/references/official-docs/docs/subsystems/web-client.zh.md +95 -0
- package/references/official-docs/docs/subsystems/web-server.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/web-server.md +55 -9
- package/references/official-docs/docs/subsystems/web-server.zh.md +56 -10
- package/references/official-docs/docs/subsystems/web.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/web.md +14 -7
- package/references/official-docs/docs/subsystems/web.zh.md +16 -9
- package/references/official-docs/docs/subsystems/webhook.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/webhook.md +70 -0
- package/references/official-docs/docs/subsystems/webhook.zh.md +70 -0
- package/references/official-docs/docs/subsystems/workflow.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/workflow.md +8 -8
- package/references/official-docs/docs/subsystems/workflow.zh.md +13 -13
- package/references/official-docs/docs/subsystems/workspace.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/workspace.md +98 -5
- package/references/official-docs/docs/subsystems/workspace.zh.md +102 -9
- package/references/official-docs/docs/testing.i18n.yaml +2 -2
- package/references/official-docs/docs/testing.md +15 -10
- package/references/official-docs/docs/testing.zh.md +15 -10
- package/references/official-docs/docs/tool-catalog.i18n.yaml +2 -2
- package/references/official-docs/docs/tool-catalog.md +413 -61
- package/references/official-docs/docs/tool-catalog.zh.md +418 -63
- package/references/official-docs/docs/tool-execution-pipeline.i18n.yaml +2 -2
- package/references/official-docs/docs/tool-execution-pipeline.md +1 -1
- package/references/official-docs/docs/tool-execution-pipeline.zh.md +1 -1
- package/references/official-docs/docs/user/develop/basic/config.i18n.yaml +2 -2
- package/references/official-docs/docs/user/develop/basic/config.md +1 -1
- package/references/official-docs/docs/user/develop/basic/config.zh.md +4 -4
- package/references/official-docs/docs/user/develop/basic/index.i18n.yaml +1 -1
- package/references/official-docs/docs/user/develop/basic/index.zh.md +5 -5
- package/references/official-docs/docs/user/develop/basic/publish.i18n.yaml +2 -2
- package/references/official-docs/docs/user/develop/basic/publish.md +3 -3
- package/references/official-docs/docs/user/develop/basic/publish.zh.md +7 -7
- package/references/official-docs/docs/user/develop/basic/tool.i18n.yaml +2 -2
- package/references/official-docs/docs/user/develop/basic/tool.md +3 -3
- package/references/official-docs/docs/user/develop/basic/tool.zh.md +4 -4
- package/references/official-docs/docs/user/develop/framework/events.i18n.yaml +2 -2
- package/references/official-docs/docs/user/develop/framework/events.md +2 -2
- package/references/official-docs/docs/user/develop/framework/events.zh.md +3 -3
- package/references/official-docs/docs/user/develop/framework/index.i18n.yaml +1 -1
- package/references/official-docs/docs/user/develop/framework/index.zh.md +3 -3
- package/references/official-docs/docs/user/develop/framework/service.i18n.yaml +2 -2
- package/references/official-docs/docs/user/develop/framework/service.md +1 -1
- package/references/official-docs/docs/user/develop/framework/service.zh.md +3 -3
- package/references/official-docs/docs/user/develop/practice/dynamic-cordis.i18n.yaml +6 -0
- package/references/official-docs/docs/user/develop/practice/dynamic-cordis.md +15 -0
- package/references/official-docs/docs/user/develop/practice/dynamic-cordis.zh.md +15 -0
- package/references/official-docs/docs/user/develop/practice/index.i18n.yaml +2 -2
- package/references/official-docs/docs/user/develop/practice/index.md +1 -1
- package/references/official-docs/docs/user/develop/practice/index.zh.md +3 -3
- package/references/official-docs/docs/user/develop/practice/llm-adapter.i18n.yaml +2 -2
- package/references/official-docs/docs/user/develop/practice/llm-adapter.md +4 -3
- package/references/official-docs/docs/user/develop/practice/llm-adapter.zh.md +4 -3
- package/references/official-docs/docs/user/guide/github-review.i18n.yaml +6 -0
- package/references/official-docs/docs/user/guide/github-review.md +102 -0
- package/references/official-docs/docs/user/guide/github-review.zh.md +102 -0
- package/references/official-docs/docs/user/guide/index.i18n.yaml +2 -2
- package/references/official-docs/docs/user/guide/index.md +2 -2
- package/references/official-docs/docs/user/guide/index.zh.md +8 -8
- package/references/official-docs/docs/user/guide/mcp-memory.i18n.yaml +6 -0
- package/references/official-docs/docs/user/guide/mcp-memory.md +101 -0
- package/references/official-docs/docs/user/guide/mcp-memory.zh.md +101 -0
- package/references/official-docs/docs/user/guide/providers.i18n.yaml +2 -2
- package/references/official-docs/docs/user/guide/providers.md +40 -1
- package/references/official-docs/docs/user/guide/providers.zh.md +41 -2
- package/references/official-docs/docs/user/guide/python-sdk.i18n.yaml +2 -2
- package/references/official-docs/docs/user/guide/python-sdk.md +80 -34
- package/references/official-docs/docs/user/guide/python-sdk.zh.md +87 -41
- package/references/official-docs/docs/user/guide/schedule.i18n.yaml +6 -0
- package/references/official-docs/docs/user/guide/schedule.md +21 -0
- package/references/official-docs/docs/user/guide/schedule.zh.md +21 -0
- package/references/official-docs/docs/web-styling.i18n.yaml +2 -2
- package/references/official-docs/docs/web-styling.md +3 -0
- package/references/official-docs/docs/web-styling.zh.md +5 -2
- package/references/official-docs/packages/AGENTS.md +4 -3
- package/references/official-docs/packages/README.md +104 -59
- package/references/official-docs/vendor/README.md +1 -0
- package/references/official-docs/website-docs.ts +52 -11
- package/references/sources.md +2 -2
- package/references/website-pages.md +3 -3
- package/scripts/download-sources.ps1 +1 -1
- package/scripts/sync-official-docs.ps1 +19 -11
- package/scripts/verify-kit.ps1 +0 -4
- package/templates/js/README.es.md +1 -1
- package/templates/js/README.hi.md +1 -1
- package/templates/js/README.md +1 -1
- package/templates/js/README.pt.md +1 -1
- package/templates/js/README.zh.md +1 -1
- package/templates/js/package.json +4 -4
- package/templates/ts/README.es.md +1 -1
- package/templates/ts/README.hi.md +1 -1
- package/templates/ts/README.md +1 -1
- package/templates/ts/README.pt.md +1 -1
- package/templates/ts/README.zh.md +1 -1
- package/templates/ts/package.json +4 -4
- package/references/official-docs/examples/AGENTS.md +0 -20
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
English | [中文](code-runtime.zh.md)
|
|
4
4
|
|
|
5
|
-
The code-execution seam — a [capability seam](../../.agents/notes/implemented/architecture/2026-06-13-capability-seams.md) whose Service Definition ([dsh-code-runtime](../../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 [
|
|
5
|
+
The code-execution seam — a [capability seam](../../.agents/notes/implemented/architecture/2026-06-13-capability-seams.md) whose Service Definition ([dsh-code-runtime](../../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](../../.agents/notes/implemented/feature/2026-06-15-ptc.md) and [typed-return contract](../../.agents/notes/implemented/feature/2026-07-20-ptc-typed-tool-returns.md).
|
|
6
6
|
|
|
7
7
|
Source: [`packages/code-runtime/code-runtime/src/types.ts`](../../packages/code-runtime/code-runtime/src/types.ts)
|
|
8
8
|
|
|
@@ -52,7 +52,11 @@ interface CodeRunResult {
|
|
|
52
52
|
* rendered string; a failed or value-less run leaves this absent.
|
|
53
53
|
*/
|
|
54
54
|
value?: CodeJsonValue
|
|
55
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* Captured text. Each source channel preserves emission order; interleaving
|
|
57
|
+
* across independent channels is backend-dependent. Bounded only as part of
|
|
58
|
+
* the outer result.
|
|
59
|
+
*/
|
|
56
60
|
logs: string[]
|
|
57
61
|
/** Present iff the run failed; see {@link CodeRunFailure} for the taxonomy. */
|
|
58
62
|
error?: CodeRunFailure
|
|
@@ -61,7 +65,7 @@ interface CodeRunResult {
|
|
|
61
65
|
|
|
62
66
|
## Bindings: host functions as program globals
|
|
63
67
|
|
|
64
|
-
Each `CodeBindingNamespace` becomes one global object of async callables inside the program (the
|
|
68
|
+
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):
|
|
65
69
|
|
|
66
70
|
```ts type-equiv
|
|
67
71
|
/**
|
|
@@ -69,7 +73,7 @@ Each `CodeBindingNamespace` becomes one global object of async callables inside
|
|
|
69
73
|
* injects a real error constructor under `name`; rejected member calls become
|
|
70
74
|
* its instances and expose the exact member name through
|
|
71
75
|
* `memberNameProperty`. Both strings are runtime data rather than knowledge
|
|
72
|
-
* of a particular consumer such as
|
|
76
|
+
* of a particular consumer such as PTC mode.
|
|
73
77
|
*/
|
|
74
78
|
interface CodeBindingErrorClass {
|
|
75
79
|
/** Constructor global and resulting `Error.name`; same portable identifier rule as {@link CodeBindingNamespace.global}. */
|
|
@@ -131,7 +135,7 @@ type CodeBindingFunction = (args: unknown) => Promise<CodeJsonValue>
|
|
|
131
135
|
|
|
132
136
|
## Captured output and the failure taxonomy
|
|
133
137
|
|
|
134
|
-
Logs are plain strings
|
|
138
|
+
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.
|
|
135
139
|
|
|
136
140
|
Failure kinds are **orthogonal outcomes reported independently** (per [defensive-patterns](../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:
|
|
137
141
|
|
|
@@ -158,7 +162,7 @@ interface CodeRunFailure {
|
|
|
158
162
|
|
|
159
163
|
## The service
|
|
160
164
|
|
|
161
|
-
`CodeRuntime` (`ctx.codeRuntime`, abstract — defined in [`packages/code-runtime/code-runtime/src/index.ts`](../../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, and
|
|
165
|
+
`CodeRuntime` (`ctx.codeRuntime`, abstract — defined in [`packages/code-runtime/code-runtime/src/index.ts`](../../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.
|
|
162
166
|
|
|
163
167
|
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
|
|
164
168
|
|
|
@@ -166,7 +170,7 @@ interface CodeRunFailure {
|
|
|
166
170
|
|
|
167
171
|
## Cordis API
|
|
168
172
|
|
|
169
|
-
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`) —
|
|
173
|
+
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).
|
|
170
174
|
|
|
171
175
|
<a id="ctxcoderuntime--coderuntime-abstract-seam"></a>
|
|
172
176
|
|
|
@@ -187,5 +191,5 @@ Registers one `ctx.codeRuntime` implementation. Program, budget, abort, and subs
|
|
|
187
191
|
abstract run(request: CodeRunRequest): Promise<CodeRunResult>
|
|
188
192
|
```
|
|
189
193
|
|
|
190
|
-
Source: [`packages/code-runtime/code-runtime/src/index.ts
|
|
194
|
+
Source: [`packages/code-runtime/code-runtime/src/index.ts`](../../packages/code-runtime/code-runtime/src/index.ts)
|
|
191
195
|
<!-- END GENERATED cordis-surface -->
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[English](code-runtime.md) | 中文
|
|
4
4
|
|
|
5
|
-
代码执行 seam 是一个[能力 seam](../../.agents/notes/implemented/architecture/2026-06-13-capability-seams.md):其 Service Definition([dsh-code-runtime](../../packages/code-runtime/code-runtime),`ctx.codeRuntime`)使用宿主提供的异步绑定运行一段模型编写的程序,并报告其打印内容与返回值。代码执行是**一项可选能力**,不属于 agent loop(智能体循环)主干,因此其词汇定义在此而非 [core.md](core.md) 中。各后端的执行基底与源语言不同,这两项均为服务上的只读描述符;worker-thread Service Provider 与工具注册表 Consumer 的约定见 [
|
|
5
|
+
代码执行 seam 是一个[能力 seam](../../.agents/notes/implemented/architecture/2026-06-13-capability-seams.zh.md):其 Service Definition([dsh-code-runtime](../../packages/code-runtime/code-runtime),`ctx.codeRuntime`)使用宿主提供的异步绑定运行一段模型编写的程序,并报告其打印内容与返回值。代码执行是**一项可选能力**,不属于 agent loop(智能体循环)主干,因此其词汇定义在此而非 [core.md](core.zh.md) 中。各后端的执行基底与源语言不同,这两项均为服务上的只读描述符;worker-thread Service Provider 与工具注册表 Consumer 的约定见 [PTC mode 基础设计](../../.agents/notes/implemented/feature/2026-06-15-ptc.zh.md) 和[类型化返回约定](../../.agents/notes/implemented/feature/2026-07-20-ptc-typed-tool-returns.zh.md)。
|
|
6
6
|
|
|
7
7
|
源码:[`packages/code-runtime/code-runtime/src/types.ts`](../../packages/code-runtime/code-runtime/src/types.ts)
|
|
8
8
|
|
|
@@ -52,7 +52,11 @@ interface CodeRunResult {
|
|
|
52
52
|
* rendered string; a failed or value-less run leaves this absent.
|
|
53
53
|
*/
|
|
54
54
|
value?: CodeJsonValue
|
|
55
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* Captured text. Each source channel preserves emission order; interleaving
|
|
57
|
+
* across independent channels is backend-dependent. Bounded only as part of
|
|
58
|
+
* the outer result.
|
|
59
|
+
*/
|
|
56
60
|
logs: string[]
|
|
57
61
|
/** Present iff the run failed; see {@link CodeRunFailure} for the taxonomy. */
|
|
58
62
|
error?: CodeRunFailure
|
|
@@ -61,7 +65,7 @@ interface CodeRunResult {
|
|
|
61
65
|
|
|
62
66
|
## 绑定:宿主函数作为程序全局变量
|
|
63
67
|
|
|
64
|
-
每个 `CodeBindingNamespace` 在程序内成为一个由异步可调用函数组成的全局对象(
|
|
68
|
+
每个 `CodeBindingNamespace` 在程序内成为一个由异步可调用函数组成的全局对象(PTC mode Consumer 传入一个:`tools`)。参数与返回值必须是无损 JSON,且跨越边界时不受 seam 层字节上限约束;运行时可以通过结构化克隆桥接它们。命名空间可以声明程序可见的错误类,而无需让运行时知道 Consumer 的名称:运行时会注入真实构造函数,并将被拒绝的调用转为该类的实例。运行时也将绑定名视为不可信输入(`__proto__` 是普通自有属性,绝不会发生原型碰撞):
|
|
65
69
|
|
|
66
70
|
```ts type-equiv
|
|
67
71
|
/**
|
|
@@ -69,7 +73,7 @@ interface CodeRunResult {
|
|
|
69
73
|
* injects a real error constructor under `name`; rejected member calls become
|
|
70
74
|
* its instances and expose the exact member name through
|
|
71
75
|
* `memberNameProperty`. Both strings are runtime data rather than knowledge
|
|
72
|
-
* of a particular consumer such as
|
|
76
|
+
* of a particular consumer such as PTC mode.
|
|
73
77
|
*/
|
|
74
78
|
interface CodeBindingErrorClass {
|
|
75
79
|
/** Constructor global and resulting `Error.name`; same portable identifier rule as {@link CodeBindingNamespace.global}. */
|
|
@@ -131,9 +135,9 @@ type CodeBindingFunction = (args: unknown) => Promise<CodeJsonValue>
|
|
|
131
135
|
|
|
132
136
|
## 捕获的输出与失败分类体系
|
|
133
137
|
|
|
134
|
-
|
|
138
|
+
日志是纯字符串。每个来源通道保留自身的发出顺序;由于通道元数据不属于 seam,相互独立的通道如何交错由后端决定。运行时捕获程序的 console 与流输出,Consumer 只渲染文本。实现会对序列化后的外层日志数组,以及完成值或失败消息的组合载荷设置上限;固定的结果封装语法与 Consumer 展示空白不计入这份可变载荷计量。超限会显式失败,而不会在值中插入替代内容。
|
|
135
139
|
|
|
136
|
-
失败类型是**正交的结果,独立报告**(见 [defensive-patterns](../defensive-patterns.md)):预算耗尽不是异常,中止不是超时,基底崩溃(如 OOM)也不是二者中的任何一个:
|
|
140
|
+
失败类型是**正交的结果,独立报告**(见 [defensive-patterns](../defensive-patterns.zh.md)):预算耗尽不是异常,中止不是超时,基底崩溃(如 OOM)也不是二者中的任何一个:
|
|
137
141
|
|
|
138
142
|
```ts type-equiv
|
|
139
143
|
/**
|
|
@@ -158,7 +162,7 @@ interface CodeRunFailure {
|
|
|
158
162
|
|
|
159
163
|
## 服务
|
|
160
164
|
|
|
161
|
-
`CodeRuntime`(`ctx.codeRuntime`,抽象服务,定义于 [`packages/code-runtime/code-runtime/src/index.ts`](../../packages/code-runtime/code-runtime/src/index.ts))由 `run(request)` 加两个只读描述符组成:`language`(程序必须使用的语言,已知值为 `'typescript'` 与 `'python'`,即 `dsh-tools`
|
|
165
|
+
`CodeRuntime`(`ctx.codeRuntime`,抽象服务,定义于 [`packages/code-runtime/code-runtime/src/index.ts`](../../packages/code-runtime/code-runtime/src/index.ts))由 `run(request)` 加两个只读描述符组成:`language`(程序必须使用的语言,已知值为 `'typescript'` 与 `'python'`,即 `dsh-tools` 能呈现的那些,TypeScript 后端已发布、Python 后端为实验性且私有(未发布);生成语言相关展示的 Consumer 据此切换,遇到无法展示的语言时应显式报错)和 `isolation`(执行基底,`'worker-thread'`、`'process'`、`'container'`;仅为诊断标签,**不构成安全承诺**)。实现必须保证各次运行彼此隔离(无跨运行状态),并在 dispose(资源释放)时等待系统完全停稳:teardown 要等到所有进行中的运行均已终止并结算后才完成。
|
|
162
166
|
|
|
163
167
|
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
|
|
164
168
|
|
|
@@ -166,7 +170,7 @@ interface CodeRunFailure {
|
|
|
166
170
|
|
|
167
171
|
## Cordis API
|
|
168
172
|
|
|
169
|
-
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`) —
|
|
173
|
+
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.zh.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
|
|
170
174
|
|
|
171
175
|
<a id="ctxcoderuntime--coderuntime-abstract-seam"></a>
|
|
172
176
|
|
|
@@ -187,5 +191,5 @@ Registers one `ctx.codeRuntime` implementation. Program, budget, abort, and subs
|
|
|
187
191
|
abstract run(request: CodeRunRequest): Promise<CodeRunResult>
|
|
188
192
|
```
|
|
189
193
|
|
|
190
|
-
Source: [`packages/code-runtime/code-runtime/src/index.ts
|
|
194
|
+
Source: [`packages/code-runtime/code-runtime/src/index.ts`](../../packages/code-runtime/code-runtime/src/index.ts)
|
|
191
195
|
<!-- END GENERATED cordis-surface -->
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write docs/subsystems/commands.md
|
|
5
|
-
commands.md:
|
|
6
|
-
commands.zh.md:
|
|
5
|
+
commands.md: 46d3b736afd3a72d1119c9744cd592a86b9cbc29
|
|
6
|
+
commands.zh.md: db8d6e722e3a1742887aaa4023ab67b9ed914552
|
|
@@ -8,13 +8,21 @@ Source: [`packages/interaction/commands/src/index.ts`](../../packages/interactio
|
|
|
8
8
|
|
|
9
9
|
## Input metadata
|
|
10
10
|
|
|
11
|
-
The service exposes one optional unstructured-input hint. Command availability follows plugin composition: every adapter consuming the registry sees every effective definition.
|
|
11
|
+
The service exposes one optional unstructured-input descriptor: a hint plus an image-acceptance flag. Command availability follows plugin composition: every adapter consuming the registry sees every effective definition.
|
|
12
12
|
|
|
13
13
|
```ts type-equiv
|
|
14
14
|
/** Immutable metadata for a command's optional unstructured input. */
|
|
15
15
|
interface CommandInputDescriptor {
|
|
16
16
|
/** Placeholder shown before the user supplies free-form input. */
|
|
17
17
|
readonly hint: string
|
|
18
|
+
/**
|
|
19
|
+
* Whether composer image attachments may accompany an invocation. Absent or
|
|
20
|
+
* false = the executor rejects an invocation carrying images and capable
|
|
21
|
+
* composers refuse the submission before dispatch. A declaring command's
|
|
22
|
+
* handler receives the admitted durable blocks and owns every further
|
|
23
|
+
* grammar decision, including rejecting sub-commands that cannot use them.
|
|
24
|
+
*/
|
|
25
|
+
readonly images?: boolean
|
|
18
26
|
}
|
|
19
27
|
```
|
|
20
28
|
|
|
@@ -55,6 +63,14 @@ interface CommandInvocation {
|
|
|
55
63
|
readonly agent: Agent
|
|
56
64
|
/** Exact text following the registered command name, including separator whitespace. */
|
|
57
65
|
readonly rawInput: string
|
|
66
|
+
/**
|
|
67
|
+
* Durably admitted image blocks accompanying this invocation, in submission
|
|
68
|
+
* order; empty unless the definition declares `input.images`. The handler
|
|
69
|
+
* owns their model-visible use — the registry never schedules them itself —
|
|
70
|
+
* and a handler whose grammar cannot use them in this invocation returns an
|
|
71
|
+
* error so the dispatching composer retains the originals.
|
|
72
|
+
*/
|
|
73
|
+
readonly attachments: readonly ImageBlock[]
|
|
58
74
|
/** Cancellation signal owned by the dispatching UI request. */
|
|
59
75
|
readonly signal: AbortSignal
|
|
60
76
|
}
|
|
@@ -67,7 +83,7 @@ type CommandResult =
|
|
|
67
83
|
readonly kind: 'success'
|
|
68
84
|
readonly text?: string
|
|
69
85
|
/** Earlier authoritative domain event that owns a richer presentation. */
|
|
70
|
-
readonly sourceEventSeq?:
|
|
86
|
+
readonly sourceEventSeq?: SessionSeq
|
|
71
87
|
}
|
|
72
88
|
| { readonly kind: 'error'; readonly text: string }
|
|
73
89
|
```
|
|
@@ -106,7 +122,7 @@ interface ParsedCommand {
|
|
|
106
122
|
|
|
107
123
|
## Cordis API
|
|
108
124
|
|
|
109
|
-
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`) —
|
|
125
|
+
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).
|
|
110
126
|
|
|
111
127
|
<a id="ctxcommands--commandruntime"></a>
|
|
112
128
|
|
|
@@ -150,18 +166,25 @@ find(agent: Agent, name: string): CommandDefinition | undefined
|
|
|
150
166
|
* handler-failure path is contained so the handler's own error stays the
|
|
151
167
|
* reported failure.
|
|
152
168
|
*
|
|
169
|
+
* Image admission is enforced here, not in the composer: images sent to a
|
|
170
|
+
* command that does not declare `input.images`, an absent attachment store,
|
|
171
|
+
* and an exceeded attachment limit each settle as an error result before
|
|
172
|
+
* the handler runs, and a rejected batch publishes no durable object.
|
|
173
|
+
*
|
|
153
174
|
* @param agent - exact receiving agent.
|
|
154
175
|
* @param line - complete slash-command line.
|
|
176
|
+
* @param images - base64-encoded composer images accompanying the line, in
|
|
177
|
+
* submission order; empty for a plain invocation.
|
|
155
178
|
* @param signal - cancellation signal owned by the UI request.
|
|
156
179
|
* @returns the settled execution (result + lifecycle pairing id), or
|
|
157
180
|
* `undefined` when syntax or name does not resolve.
|
|
158
181
|
*/
|
|
159
|
-
@Remote async execute( agent: Agent, line: string, signal: AbortSignal, ): Promise<CommandExecution | undefined>
|
|
182
|
+
@Remote async execute( agent: Agent, line: string, images: readonly EncodedImageAttachment[], signal: AbortSignal, ): Promise<CommandExecution | undefined>
|
|
160
183
|
```
|
|
161
184
|
|
|
162
|
-
Types: [Agent](core.md)
|
|
185
|
+
Types: [Agent](core.md) · [EncodedImageAttachment](attachment.md)
|
|
163
186
|
|
|
164
|
-
Source: [`packages/interaction/commands/src/index.ts
|
|
187
|
+
Source: [`packages/interaction/commands/src/index.ts`](../../packages/interaction/commands/src/index.ts)
|
|
165
188
|
|
|
166
189
|
<a id="commands-events"></a>
|
|
167
190
|
|
|
@@ -183,5 +206,5 @@ A command was registered or unregistered. This is an unfiltered registry notific
|
|
|
183
206
|
'commands/change'(): void
|
|
184
207
|
```
|
|
185
208
|
|
|
186
|
-
Source: [`packages/interaction/commands/src/types.ts
|
|
209
|
+
Source: [`packages/interaction/commands/src/types.ts`](../../packages/interaction/commands/src/types.ts)
|
|
187
210
|
<!-- END GENERATED cordis-surface -->
|
|
@@ -2,19 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
[English](commands.md) | 中文
|
|
4
4
|
|
|
5
|
-
[`dsh-commands`](../../packages/interaction/commands) 提供的用户命令注册表服务。交互式适配器用它发现插件拥有的命令,并针对确切的 agent(智能体)直接执行这些命令,而不创建模型消息。[命令 Agent Note](../../.agents/notes/implemented/feature/2026-07-19-plugin-command-registration.md) 负责分发与生命周期的决策依据;[包 README](../../packages/interaction/commands/README.md) 负责组合方式与限制。
|
|
5
|
+
[`dsh-commands`](../../packages/interaction/commands) 提供的用户命令注册表服务。交互式适配器用它发现插件拥有的命令,并针对确切的 agent(智能体)直接执行这些命令,而不创建模型消息。[命令 Agent Note](../../.agents/notes/implemented/feature/2026-07-19-plugin-command-registration.zh.md) 负责分发与生命周期的决策依据;[包 README](../../packages/interaction/commands/README.zh.md) 负责组合方式与限制。
|
|
6
6
|
|
|
7
7
|
来源:[`packages/interaction/commands/src/index.ts`](../../packages/interaction/commands/src/index.ts)
|
|
8
8
|
|
|
9
9
|
## 输入元数据
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
该服务公开一个可选的非结构化输入描述符:提示文本加图片接受标志。命令的可用性由插件组合决定:每个消费注册表的适配器都会看到全部生效定义。
|
|
12
12
|
|
|
13
13
|
```ts type-equiv
|
|
14
14
|
/** Immutable metadata for a command's optional unstructured input. */
|
|
15
15
|
interface CommandInputDescriptor {
|
|
16
16
|
/** Placeholder shown before the user supplies free-form input. */
|
|
17
17
|
readonly hint: string
|
|
18
|
+
/**
|
|
19
|
+
* Whether composer image attachments may accompany an invocation. Absent or
|
|
20
|
+
* false = the executor rejects an invocation carrying images and capable
|
|
21
|
+
* composers refuse the submission before dispatch. A declaring command's
|
|
22
|
+
* handler receives the admitted durable blocks and owns every further
|
|
23
|
+
* grammar decision, including rejecting sub-commands that cannot use them.
|
|
24
|
+
*/
|
|
25
|
+
readonly images?: boolean
|
|
18
26
|
}
|
|
19
27
|
```
|
|
20
28
|
|
|
@@ -55,6 +63,14 @@ interface CommandInvocation {
|
|
|
55
63
|
readonly agent: Agent
|
|
56
64
|
/** Exact text following the registered command name, including separator whitespace. */
|
|
57
65
|
readonly rawInput: string
|
|
66
|
+
/**
|
|
67
|
+
* Durably admitted image blocks accompanying this invocation, in submission
|
|
68
|
+
* order; empty unless the definition declares `input.images`. The handler
|
|
69
|
+
* owns their model-visible use — the registry never schedules them itself —
|
|
70
|
+
* and a handler whose grammar cannot use them in this invocation returns an
|
|
71
|
+
* error so the dispatching composer retains the originals.
|
|
72
|
+
*/
|
|
73
|
+
readonly attachments: readonly ImageBlock[]
|
|
58
74
|
/** Cancellation signal owned by the dispatching UI request. */
|
|
59
75
|
readonly signal: AbortSignal
|
|
60
76
|
}
|
|
@@ -67,7 +83,7 @@ type CommandResult =
|
|
|
67
83
|
readonly kind: 'success'
|
|
68
84
|
readonly text?: string
|
|
69
85
|
/** Earlier authoritative domain event that owns a richer presentation. */
|
|
70
|
-
readonly sourceEventSeq?:
|
|
86
|
+
readonly sourceEventSeq?: SessionSeq
|
|
71
87
|
}
|
|
72
88
|
| { readonly kind: 'error'; readonly text: string }
|
|
73
89
|
```
|
|
@@ -106,7 +122,7 @@ interface ParsedCommand {
|
|
|
106
122
|
|
|
107
123
|
## Cordis API
|
|
108
124
|
|
|
109
|
-
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`) —
|
|
125
|
+
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.zh.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
|
|
110
126
|
|
|
111
127
|
<a id="ctxcommands--commandruntime"></a>
|
|
112
128
|
|
|
@@ -150,18 +166,25 @@ find(agent: Agent, name: string): CommandDefinition | undefined
|
|
|
150
166
|
* handler-failure path is contained so the handler's own error stays the
|
|
151
167
|
* reported failure.
|
|
152
168
|
*
|
|
169
|
+
* Image admission is enforced here, not in the composer: images sent to a
|
|
170
|
+
* command that does not declare `input.images`, an absent attachment store,
|
|
171
|
+
* and an exceeded attachment limit each settle as an error result before
|
|
172
|
+
* the handler runs, and a rejected batch publishes no durable object.
|
|
173
|
+
*
|
|
153
174
|
* @param agent - exact receiving agent.
|
|
154
175
|
* @param line - complete slash-command line.
|
|
176
|
+
* @param images - base64-encoded composer images accompanying the line, in
|
|
177
|
+
* submission order; empty for a plain invocation.
|
|
155
178
|
* @param signal - cancellation signal owned by the UI request.
|
|
156
179
|
* @returns the settled execution (result + lifecycle pairing id), or
|
|
157
180
|
* `undefined` when syntax or name does not resolve.
|
|
158
181
|
*/
|
|
159
|
-
@Remote async execute( agent: Agent, line: string, signal: AbortSignal, ): Promise<CommandExecution | undefined>
|
|
182
|
+
@Remote async execute( agent: Agent, line: string, images: readonly EncodedImageAttachment[], signal: AbortSignal, ): Promise<CommandExecution | undefined>
|
|
160
183
|
```
|
|
161
184
|
|
|
162
|
-
Types: [Agent](core.md)
|
|
185
|
+
Types: [Agent](core.zh.md) · [EncodedImageAttachment](attachment.zh.md)
|
|
163
186
|
|
|
164
|
-
Source: [`packages/interaction/commands/src/index.ts
|
|
187
|
+
Source: [`packages/interaction/commands/src/index.ts`](../../packages/interaction/commands/src/index.ts)
|
|
165
188
|
|
|
166
189
|
<a id="commands-events"></a>
|
|
167
190
|
|
|
@@ -183,5 +206,5 @@ A command was registered or unregistered. This is an unfiltered registry notific
|
|
|
183
206
|
'commands/change'(): void
|
|
184
207
|
```
|
|
185
208
|
|
|
186
|
-
Source: [`packages/interaction/commands/src/types.ts
|
|
209
|
+
Source: [`packages/interaction/commands/src/types.ts`](../../packages/interaction/commands/src/types.ts)
|
|
187
210
|
<!-- END GENERATED cordis-surface -->
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write docs/subsystems/compaction.md
|
|
5
|
-
compaction.md:
|
|
6
|
-
compaction.zh.md:
|
|
5
|
+
compaction.md: b49957a5f476a02ccd12b791f287a9675073c0ae
|
|
6
|
+
compaction.zh.md: 4b4c6845b8ff48bce019b352a811f968628cbdbf
|
|
@@ -34,11 +34,11 @@ interface CompactionResult {
|
|
|
34
34
|
/** Human command that initiated this compaction, when it was manual. */
|
|
35
35
|
sourceCommandId?: CommandId
|
|
36
36
|
/** The seq of the appended `compaction/start` event. */
|
|
37
|
-
startSeq:
|
|
37
|
+
startSeq: SessionSeq
|
|
38
38
|
/** The seq of the appended `compaction/summary` event. */
|
|
39
|
-
summarySeq:
|
|
39
|
+
summarySeq: SessionSeq
|
|
40
40
|
/** The seq of the appended `compaction/end` event. */
|
|
41
|
-
endSeq:
|
|
41
|
+
endSeq: SessionSeq
|
|
42
42
|
/** The summary content blocks produced by the backend. */
|
|
43
43
|
summary: ContentBlock[]
|
|
44
44
|
/**
|
|
@@ -49,9 +49,9 @@ interface CompactionResult {
|
|
|
49
49
|
* can be GREATER than `end`. {@link CompactionResult.shadowedSeqs} is the
|
|
50
50
|
* authoritative set of shadowed nodes, in surface order.
|
|
51
51
|
*/
|
|
52
|
-
shadowedRange: { start:
|
|
52
|
+
shadowedRange: { start: SessionSeq; end: SessionSeq }
|
|
53
53
|
/** The seqs of all shadowed surface nodes, in surface order. */
|
|
54
|
-
shadowedSeqs:
|
|
54
|
+
shadowedSeqs: SessionSeq[]
|
|
55
55
|
/** Estimated token count of the shadowed content. */
|
|
56
56
|
shadowedTokenCount: number
|
|
57
57
|
}
|
|
@@ -83,7 +83,7 @@ type ManualCompactionErrorCode =
|
|
|
83
83
|
|
|
84
84
|
`changed` and `summary` leave the conversation surface unchanged but still close and persist the failed attempt in the log. `commit` may follow partial mutation; `persistence` means the in-memory bracket closed but its flush failed. Cancellation remains separate and throws the exact abort reason after required cleanup.
|
|
85
85
|
|
|
86
|
-
Pressure compaction runs at
|
|
86
|
+
Pressure compaction runs at the `agent/pre-step` waterfall before request derivation. Once pressure or canonical overflow qualifies, compaction-basic invokes optional [`ctx.toolResultPruner`](../../packages/compaction/compaction-tool-result-pruner/README.md) before range selection, remeasures through `ctx.tokenMeter`, and can advance the surface without a summary. Failed-request recovery runs through `agent/request-error` after the failed step closes and returns a retry action only when the surface replacement generation advances, even if later summary work throws after pruning; cancellation still wins. Region boundaries preserve tool-call/result pairing but not whole turns, allowing early closed steps of one oversized turn to compact. `dsh-compaction-basic` owns thresholds, retained-tail policy, overflow caps, and failure handling.
|
|
87
87
|
|
|
88
88
|
The Service Definition exports `toolPairingBalancedBefore(session, seq)` and `toolPairingBalancedAfter(session, seq)` for the tool-call/result pairing checks before and after a seq. Both validate current surface membership and reject missing seqs and orphan results; the [package contract](../../packages/compaction/compaction/README.md#tool-pairing-boundaries) defines their cache behavior.
|
|
89
89
|
|
|
@@ -95,11 +95,11 @@ The optional tool-result pruning service reports each durable content replacemen
|
|
|
95
95
|
/** Cited source event and size accounting for one landed surface replacement. */
|
|
96
96
|
interface PrunedEntry {
|
|
97
97
|
/** Full-fidelity tool-result event shadowed by the replacement. */
|
|
98
|
-
readonly originalSeq:
|
|
98
|
+
readonly originalSeq: SessionSeq
|
|
99
99
|
/** Newly appended pruned tool-result event. */
|
|
100
|
-
readonly replacementSeq:
|
|
100
|
+
readonly replacementSeq: SessionSeq
|
|
101
101
|
/** Tool call shared by the original and replacement. */
|
|
102
|
-
readonly callId:
|
|
102
|
+
readonly callId: ToolCallId
|
|
103
103
|
/** Original text size in Unicode code points. */
|
|
104
104
|
readonly charsBefore: number
|
|
105
105
|
/** Replacement text size in Unicode code points. */
|
|
@@ -123,7 +123,7 @@ interface PruneResult {
|
|
|
123
123
|
|
|
124
124
|
## Cordis API
|
|
125
125
|
|
|
126
|
-
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`) —
|
|
126
|
+
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).
|
|
127
127
|
|
|
128
128
|
<a id="ctxcompaction--compactionengine-abstract-seam"></a>
|
|
129
129
|
|
|
@@ -187,12 +187,12 @@ abstract compactNow( agent: ManualCompactAgentContext, signal: AbortSignal, sour
|
|
|
187
187
|
* @throws when compaction is active or the range is missing, reversed, or unbalanced.
|
|
188
188
|
* @returns the appended event seqs, summary, replaced range, and token accounting.
|
|
189
189
|
*/
|
|
190
|
-
abstract compactRegion( start:
|
|
190
|
+
abstract compactRegion( start: SessionSeq, end: SessionSeq, agent: CompactionAgentContext, signal?: AbortSignal, ): Promise<CompactionResult>
|
|
191
191
|
```
|
|
192
192
|
|
|
193
|
-
Types: [CommandId](commands.md)
|
|
193
|
+
Types: [CommandId](commands.md) · [SessionSeq](session.md)
|
|
194
194
|
|
|
195
|
-
Source: [`packages/compaction/compaction/src/index.ts
|
|
195
|
+
Source: [`packages/compaction/compaction/src/index.ts`](../../packages/compaction/compaction/src/index.ts)
|
|
196
196
|
|
|
197
197
|
<a id="ctxtoolresultpruner--toolresultpruner"></a>
|
|
198
198
|
|
|
@@ -234,5 +234,5 @@ pruneSession(session: Session): PruneResult
|
|
|
234
234
|
|
|
235
235
|
Types: [ContentBlock](llm-streaming.md) · [Session](session.md)
|
|
236
236
|
|
|
237
|
-
Source: [`packages/compaction/compaction-tool-result-pruner/src/index.ts
|
|
237
|
+
Source: [`packages/compaction/compaction-tool-result-pruner/src/index.ts`](../../packages/compaction/compaction-tool-result-pruner/src/index.ts)
|
|
238
238
|
<!-- END GENERATED cordis-surface -->
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
[English](compaction.md) | 中文
|
|
4
4
|
|
|
5
|
-
压缩 seam 是一个[能力 seam](../../.agents/notes/implemented/architecture/2026-06-13-capability-seams.md),与 bash 一样分为 Service Definition([dsh-compaction](../../packages/compaction/compaction),`ctx.compaction`)、Service Provider(例如 [dsh-compaction-basic](../../packages/compaction/compaction-basic) 后端)和面向用户的 Consumer([dsh-command-compact](../../packages/compaction/command-compact))。压缩是**一项可选能力**,不属于 agent loop(智能体循环)主干,因此其词汇定义在此而非 [core.md](core.md) 中。基于 tokenizer 或模板的后端是实现同一接口的兄弟包。与 bash 不同,该接口必然依赖 `dsh-session` 和 `dsh-llm`:其动词作用于 agent 所有的 `Session`,而其持久摘要事件使用 `ContentBlock` 词汇(见[压缩能力 seam Agent Note](../../.agents/notes/implemented/feature/2026-06-18-compaction-capability-seam.md))。
|
|
5
|
+
压缩 seam 是一个[能力 seam](../../.agents/notes/implemented/architecture/2026-06-13-capability-seams.zh.md),与 bash 一样分为 Service Definition([dsh-compaction](../../packages/compaction/compaction),`ctx.compaction`)、Service Provider(例如 [dsh-compaction-basic](../../packages/compaction/compaction-basic) 后端)和面向用户的 Consumer([dsh-command-compact](../../packages/compaction/command-compact))。压缩是**一项可选能力**,不属于 agent loop(智能体循环)主干,因此其词汇定义在此而非 [core.md](core.zh.md) 中。基于 tokenizer 或模板的后端是实现同一接口的兄弟包。与 bash 不同,该接口必然依赖 `dsh-session` 和 `dsh-llm`:其动词作用于 agent 所有的 `Session`,而其持久摘要事件使用 `ContentBlock` 词汇(见[压缩能力 seam Agent Note](../../.agents/notes/implemented/feature/2026-06-18-compaction-capability-seam.zh.md))。
|
|
6
6
|
|
|
7
7
|
源码:[`packages/compaction/compaction/src/types.ts`](../../packages/compaction/compaction/src/types.ts)
|
|
8
8
|
|
|
9
9
|
## `compaction/*` 会话事件
|
|
10
10
|
|
|
11
|
-
压缩通过声明合并为 [`SessionEventMap`](session.md) 扩展三种事件类型。三者都**仅写入日志**——它们记录锁、摘要、选中范围、被遮蔽事件 seq、token 数以及模型调用,绝不进入 surface。这里有意不扩展 `SurfaceEventType`(只有产生消息的事件才到达模型),因此摘要本身承载在另一条带有 `surfaceOp: { op: 'replace', start, end }` 的 `user/message` 上——这是摘要压缩执行的唯一 surface 变更。[Agent Note](../../.agents/notes/implemented/feature/2026-06-18-compaction-capability-seam.md) 负责复用 `user/message` 的决策依据。
|
|
11
|
+
压缩通过声明合并为 [`SessionEventMap`](session.zh.md) 扩展三种事件类型。三者都**仅写入日志**——它们记录锁、摘要、选中范围、被遮蔽事件 seq、token 数以及模型调用,绝不进入 surface。这里有意不扩展 `SurfaceEventType`(只有产生消息的事件才到达模型),因此摘要本身承载在另一条带有 `surfaceOp: { op: 'replace', start, end }` 的 `user/message` 上——这是摘要压缩执行的唯一 surface 变更。[Agent Note](../../.agents/notes/implemented/feature/2026-06-18-compaction-capability-seam.zh.md) 负责复用 `user/message` 的决策依据。
|
|
12
12
|
|
|
13
13
|
| 事件 | 载荷 | 作用 |
|
|
14
14
|
|---|---|---|
|
|
@@ -34,11 +34,11 @@ interface CompactionResult {
|
|
|
34
34
|
/** Human command that initiated this compaction, when it was manual. */
|
|
35
35
|
sourceCommandId?: CommandId
|
|
36
36
|
/** The seq of the appended `compaction/start` event. */
|
|
37
|
-
startSeq:
|
|
37
|
+
startSeq: SessionSeq
|
|
38
38
|
/** The seq of the appended `compaction/summary` event. */
|
|
39
|
-
summarySeq:
|
|
39
|
+
summarySeq: SessionSeq
|
|
40
40
|
/** The seq of the appended `compaction/end` event. */
|
|
41
|
-
endSeq:
|
|
41
|
+
endSeq: SessionSeq
|
|
42
42
|
/** The summary content blocks produced by the backend. */
|
|
43
43
|
summary: ContentBlock[]
|
|
44
44
|
/**
|
|
@@ -49,9 +49,9 @@ interface CompactionResult {
|
|
|
49
49
|
* can be GREATER than `end`. {@link CompactionResult.shadowedSeqs} is the
|
|
50
50
|
* authoritative set of shadowed nodes, in surface order.
|
|
51
51
|
*/
|
|
52
|
-
shadowedRange: { start:
|
|
52
|
+
shadowedRange: { start: SessionSeq; end: SessionSeq }
|
|
53
53
|
/** The seqs of all shadowed surface nodes, in surface order. */
|
|
54
|
-
shadowedSeqs:
|
|
54
|
+
shadowedSeqs: SessionSeq[]
|
|
55
55
|
/** Estimated token count of the shadowed content. */
|
|
56
56
|
shadowedTokenCount: number
|
|
57
57
|
}
|
|
@@ -66,7 +66,7 @@ interface CompactionResult {
|
|
|
66
66
|
type CompactionTrigger = 'pressure' | 'context-overflow'
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
`CompactionEngine` 暴露 `compactIfNeeded(agent, trigger, signal)` 以执行自动 `pressure` 或 `context-overflow` 策略,暴露 `compactNow(agent, signal)` 以便即使未达到压力也对空闲会话进行一次有效缩减,还针对显式、两端均包含的 surface 范围暴露 `compactRegion(...)`。`compactNow()` 作为轮次之间的 agent maintenance 运行;没有有效范围时返回 `null` 且不写入;在摘要前记录独立的 `turn: null` 标记对,并在后续排队提示词能够从新表层派生前 flush 已闭合尝试。每个后端都使用 `compactCheckpointSource(compactionId, sourceCommandId?)` 创建替换用 `user/message` 的源;client 与 wire 消费方从无 Cordis 的 `@deepseek-ai/dsh-compaction/checkpoint` 子路径导入该构造函数、`CompactionCheckpointSource` 和 `isCompactCheckpointSource()`,包根则为 host 消费方重新导出它们。必填的事务身份会关联替换检查点,而该判定函数使检查点识别不依赖任一特定后端。实现必须把传入的 signal 转发给摘要流程。该 seam 不拥有计价 API:单例 [`ctx.tokenMeter`](token-meter.md) 直接拥有估算与回放,而 `dsh-compaction-basic` 拥有保留策略、事件排序、按路由执行的摘要调用及其配置。
|
|
69
|
+
`CompactionEngine` 暴露 `compactIfNeeded(agent, trigger, signal)` 以执行自动 `pressure` 或 `context-overflow` 策略,暴露 `compactNow(agent, signal)` 以便即使未达到压力也对空闲会话进行一次有效缩减,还针对显式、两端均包含的 surface 范围暴露 `compactRegion(...)`。`compactNow()` 作为轮次之间的 agent maintenance 运行;没有有效范围时返回 `null` 且不写入;在摘要前记录独立的 `turn: null` 标记对,并在后续排队提示词能够从新表层派生前 flush 已闭合尝试。每个后端都使用 `compactCheckpointSource(compactionId, sourceCommandId?)` 创建替换用 `user/message` 的源;client 与 wire 消费方从无 Cordis 的 `@deepseek-ai/dsh-compaction/checkpoint` 子路径导入该构造函数、`CompactionCheckpointSource` 和 `isCompactCheckpointSource()`,包根则为 host 消费方重新导出它们。必填的事务身份会关联替换检查点,而该判定函数使检查点识别不依赖任一特定后端。实现必须把传入的 signal 转发给摘要流程。该 seam 不拥有计价 API:单例 [`ctx.tokenMeter`](token-meter.zh.md) 直接拥有估算与回放,而 `dsh-compaction-basic` 拥有保留策略、事件排序、按路由执行的摘要调用及其配置。
|
|
70
70
|
|
|
71
71
|
预期的手动失败使用 `ManualCompactionErrorCode`:
|
|
72
72
|
|
|
@@ -83,9 +83,9 @@ type ManualCompactionErrorCode =
|
|
|
83
83
|
|
|
84
84
|
`changed` 和 `summary` 保持会话表层不变,但仍会闭合失败尝试并将其持久化到日志。`commit` 可能发生在部分变更之后;`persistence` 表示内存中的标记对已闭合,但 flush 失败。取消独立于这些失败,并在完成必要清理后抛出原始 abort 原因。
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
压力压缩在 `agent/pre-step` waterfall(瀑布式事件)中运行,先于请求推导。一旦压力或规范化溢出满足条件,compaction-basic 会在选择范围前调用可选的 [`ctx.toolResultPruner`](../../packages/compaction/compaction-tool-result-pruner/README.zh.md),再通过 `ctx.tokenMeter` 重新测量,并且可以在不生成摘要的情况下推进 surface。失败请求的恢复在失败的步骤关闭后通过 `agent/request-error` 运行;仅当 surface replacement generation 前进时才返回重试动作,即便后续摘要工作在剪枝后抛异常亦如此;取消仍然优先。区域边界保持工具调用/结果配对,但不保持整个轮次,因此一个过大轮次中较早关闭的步骤可以被压缩。`dsh-compaction-basic` 拥有阈值、保留尾部策略、溢出上限与失败处理。
|
|
87
87
|
|
|
88
|
-
该 Service Definition 导出 `toolPairingBalancedBefore(session, seq)` 与 `toolPairingBalancedAfter(session, seq)`,用于检查 seq 之前与之后的工具调用/结果配对。两者都会验证当前 surface 成员关系,并拒绝缺失的 seq 与遗留结果;[包约定](../../packages/compaction/compaction/README.md#tool-pairing-boundaries)定义其缓存行为。
|
|
88
|
+
该 Service Definition 导出 `toolPairingBalancedBefore(session, seq)` 与 `toolPairingBalancedAfter(session, seq)`,用于检查 seq 之前与之后的工具调用/结果配对。两者都会验证当前 surface 成员关系,并拒绝缺失的 seq 与遗留结果;[包约定](../../packages/compaction/compaction/README.zh.md#tool-pairing-boundaries)定义其缓存行为。
|
|
89
89
|
|
|
90
90
|
## 工具结果剪枝产出
|
|
91
91
|
|
|
@@ -95,11 +95,11 @@ type ManualCompactionErrorCode =
|
|
|
95
95
|
/** Cited source event and size accounting for one landed surface replacement. */
|
|
96
96
|
interface PrunedEntry {
|
|
97
97
|
/** Full-fidelity tool-result event shadowed by the replacement. */
|
|
98
|
-
readonly originalSeq:
|
|
98
|
+
readonly originalSeq: SessionSeq
|
|
99
99
|
/** Newly appended pruned tool-result event. */
|
|
100
|
-
readonly replacementSeq:
|
|
100
|
+
readonly replacementSeq: SessionSeq
|
|
101
101
|
/** Tool call shared by the original and replacement. */
|
|
102
|
-
readonly callId:
|
|
102
|
+
readonly callId: ToolCallId
|
|
103
103
|
/** Original text size in Unicode code points. */
|
|
104
104
|
readonly charsBefore: number
|
|
105
105
|
/** Replacement text size in Unicode code points. */
|
|
@@ -123,7 +123,7 @@ interface PruneResult {
|
|
|
123
123
|
|
|
124
124
|
## Cordis API
|
|
125
125
|
|
|
126
|
-
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`) —
|
|
126
|
+
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.zh.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
|
|
127
127
|
|
|
128
128
|
<a id="ctxcompaction--compactionengine-abstract-seam"></a>
|
|
129
129
|
|
|
@@ -187,12 +187,12 @@ abstract compactNow( agent: ManualCompactAgentContext, signal: AbortSignal, sour
|
|
|
187
187
|
* @throws when compaction is active or the range is missing, reversed, or unbalanced.
|
|
188
188
|
* @returns the appended event seqs, summary, replaced range, and token accounting.
|
|
189
189
|
*/
|
|
190
|
-
abstract compactRegion( start:
|
|
190
|
+
abstract compactRegion( start: SessionSeq, end: SessionSeq, agent: CompactionAgentContext, signal?: AbortSignal, ): Promise<CompactionResult>
|
|
191
191
|
```
|
|
192
192
|
|
|
193
|
-
Types: [CommandId](commands.md)
|
|
193
|
+
Types: [CommandId](commands.zh.md) · [SessionSeq](session.zh.md)
|
|
194
194
|
|
|
195
|
-
Source: [`packages/compaction/compaction/src/index.ts
|
|
195
|
+
Source: [`packages/compaction/compaction/src/index.ts`](../../packages/compaction/compaction/src/index.ts)
|
|
196
196
|
|
|
197
197
|
<a id="ctxtoolresultpruner--toolresultpruner"></a>
|
|
198
198
|
|
|
@@ -232,7 +232,7 @@ pruneContent(blocks: readonly ContentBlock[]): ContentBlock[] | null
|
|
|
232
232
|
pruneSession(session: Session): PruneResult
|
|
233
233
|
```
|
|
234
234
|
|
|
235
|
-
Types: [ContentBlock](llm-streaming.md) · [Session](session.md)
|
|
235
|
+
Types: [ContentBlock](llm-streaming.zh.md) · [Session](session.zh.md)
|
|
236
236
|
|
|
237
|
-
Source: [`packages/compaction/compaction-tool-result-pruner/src/index.ts
|
|
237
|
+
Source: [`packages/compaction/compaction-tool-result-pruner/src/index.ts`](../../packages/compaction/compaction-tool-result-pruner/src/index.ts)
|
|
238
238
|
<!-- 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/conversation.md
|
|
5
|
+
conversation.md: df1476537b95690ae2055f367e8586653b99a9a9
|
|
6
|
+
conversation.zh.md: 784f52975cbb829d8914ef630aa1041693e1de62
|