dsh-plugin-guide 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +27 -22
- 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 +23 -7
- package/references/official-docs/docs/architecture.zh.md +36 -20
- package/references/official-docs/docs/capability-seams.i18n.yaml +2 -2
- package/references/official-docs/docs/capability-seams.md +132 -67
- package/references/official-docs/docs/capability-seams.zh.md +132 -67
- package/references/official-docs/docs/config-catalog.i18n.yaml +2 -2
- package/references/official-docs/docs/config-catalog.md +659 -373
- package/references/official-docs/docs/config-catalog.zh.md +677 -391
- package/references/official-docs/docs/cookbook/adding-a-package.i18n.yaml +2 -2
- package/references/official-docs/docs/cookbook/adding-a-package.md +2 -3
- package/references/official-docs/docs/cookbook/adding-a-package.zh.md +8 -7
- 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 +666 -747
- package/references/official-docs/docs/module-graph.zh.md +668 -749
- package/references/official-docs/docs/persistence-catalog.i18n.yaml +2 -2
- package/references/official-docs/docs/persistence-catalog.md +172 -40
- package/references/official-docs/docs/persistence-catalog.zh.md +180 -48
- 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 +206 -0
- package/references/official-docs/docs/subsystems/agent-team.zh.md +206 -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 +5 -5
- package/references/official-docs/docs/subsystems/code-runtime.zh.md +6 -6
- package/references/official-docs/docs/subsystems/commands.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/commands.md +29 -6
- package/references/official-docs/docs/subsystems/commands.zh.md +30 -7
- package/references/official-docs/docs/subsystems/compaction.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/compaction.md +5 -5
- package/references/official-docs/docs/subsystems/compaction.zh.md +11 -11
- 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 +110 -33
- package/references/official-docs/docs/subsystems/core.zh.md +141 -62
- 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 +4 -4
- package/references/official-docs/docs/subsystems/feedback.zh.md +4 -4
- 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 +35 -17
- package/references/official-docs/docs/subsystems/persistence.zh.md +38 -20
- 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 +136 -67
- package/references/official-docs/docs/subsystems/session-projection.zh.md +136 -67
- package/references/official-docs/docs/subsystems/session-query.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/session-query.md +11 -3
- package/references/official-docs/docs/subsystems/session-query.zh.md +12 -4
- 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 +3 -3
- package/references/official-docs/docs/subsystems/session-title.zh.md +5 -5
- package/references/official-docs/docs/subsystems/session.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/session.md +284 -39
- package/references/official-docs/docs/subsystems/session.zh.md +301 -54
- 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 +174 -0
- package/references/official-docs/docs/subsystems/slots.zh.md +174 -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 +13 -5
- package/references/official-docs/docs/subsystems/storage.zh.md +16 -8
- package/references/official-docs/docs/subsystems/subagent.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/subagent.md +120 -32
- package/references/official-docs/docs/subsystems/subagent.zh.md +131 -41
- 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 +27 -12
- package/references/official-docs/docs/subsystems/token-meter.zh.md +28 -13
- 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 +433 -27
- package/references/official-docs/docs/tool-catalog.zh.md +438 -29
- 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 +1 -1
- package/references/official-docs/docs/web-styling.zh.md +2 -2
- package/references/official-docs/packages/AGENTS.md +3 -2
- 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,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
[English](session.md) | 中文
|
|
4
4
|
|
|
5
|
-
[dsh-session](../../packages/core/session) 的内存事件溯源模型。`Session` 是一份由类型化 `SessionEvent` 组成的**仅追加日志**,是 agent(智能体)完整交互历史的唯一真源。LLM(大语言模型)消息历史从日志*派生*而来,从不单独存储;回放即从同一组事件重新派生。日志如何实现**持久化**(持久化 seam、后端、崩溃恢复)是兄弟文档 [persistence.md](persistence.md) 的关注点。
|
|
5
|
+
[dsh-session](../../packages/core/session) 的内存事件溯源模型。`Session` 是一份由类型化 `SessionEvent` 组成的**仅追加日志**,是 agent(智能体)完整交互历史的唯一真源。LLM(大语言模型)消息历史从日志*派生*而来,从不单独存储;回放即从同一组事件重新派生。日志如何实现**持久化**(持久化 seam、后端、崩溃恢复)是兄弟文档 [persistence.md](persistence.zh.md) 的关注点。
|
|
6
6
|
|
|
7
7
|
源码:[`packages/core/session/src/types.ts`](../../packages/core/session/src/types.ts)
|
|
8
8
|
|
|
9
9
|
## `SessionEventMap`:事件词汇
|
|
10
10
|
|
|
11
|
-
仅追加的事件类型。可通过声明合并扩展:插件通过 declaration merging 声明额外的事件类型。例如[压缩(compaction) seam](compaction.md) 添加了 `compaction/start` / `compaction/summary` / `compaction/end`,`@deepseek-ai/dsh-hook-protocol` 为钩子桥接添加了仅记录日志的 `hook/invoked` / `hook/result` 记录。与 `compaction/*` 一样,这些都不是 `SurfaceEventType`(没有 `surfaceOp`)。生成的[持久化日志事件目录](../persistence-catalog.md)列举了所有成员(核心与合并扩展的),包含其 payload、surface 标记与声明位置。
|
|
11
|
+
仅追加的事件类型。可通过声明合并扩展:插件通过 declaration merging 声明额外的事件类型。例如[压缩(compaction) seam](compaction.zh.md) 添加了 `compaction/start` / `compaction/summary` / `compaction/end`,`@deepseek-ai/dsh-hook-protocol` 为钩子桥接添加了仅记录日志的 `hook/invoked` / `hook/result` 记录。与 `compaction/*` 一样,这些都不是 `SurfaceEventType`(没有 `surfaceOp`)。生成的[持久化日志事件目录](../persistence-catalog.zh.md)列举了所有成员(核心与合并扩展的),包含其 payload、surface 标记与声明位置。
|
|
12
12
|
|
|
13
13
|
```ts type-equiv
|
|
14
14
|
/** A user-role specialization of the one shared message representation. */
|
|
@@ -59,15 +59,19 @@ interface SessionEventMap {
|
|
|
59
59
|
* Assembled assistant message for one step (derived history uses this).
|
|
60
60
|
* Carries the step's `usage` when the adapter reported token accounting, so
|
|
61
61
|
* the model output and its accounting travel together (there is no separate
|
|
62
|
-
* usage record). `usage` is absent when the adapter reported none.
|
|
62
|
+
* usage record). `usage` is absent when the adapter reported none. A turn
|
|
63
|
+
* cancelled mid-stream finalizes its delivered text/reasoning prefix as this
|
|
64
|
+
* event with `interrupted: true`; undispatched tool calls are absent. The
|
|
65
|
+
* marker distinguishes that prefix without re-deriving interruption from turn
|
|
66
|
+
* boundaries. An aborted turn with no such event streamed no visible content.
|
|
63
67
|
*/
|
|
64
|
-
'assistant/message': { turn: number; step: number; message: AssistantMessage; usage?: TokenUsage }
|
|
68
|
+
'assistant/message': { turn: number; step: number; message: AssistantMessage; usage?: TokenUsage; interrupted?: true }
|
|
65
69
|
/**
|
|
66
70
|
* The model requested one tool invocation: `name` with the raw `arguments`
|
|
67
71
|
* JSON string exactly as the model produced it (unparsed). `callId` pairs the
|
|
68
72
|
* call with its `tool/result`.
|
|
69
73
|
*/
|
|
70
|
-
'tool/call': { turn: number; step: number; callId:
|
|
74
|
+
'tool/call': { turn: number; step: number; callId: ToolCallId; name: string; arguments: string }
|
|
71
75
|
/**
|
|
72
76
|
* A completed tool call's model-facing result, optional internal failure
|
|
73
77
|
* identity, and optional tool-private `meta` presentation payload. `meta` is
|
|
@@ -86,13 +90,16 @@ interface SessionEventMap {
|
|
|
86
90
|
error?: { name: string; code: string }
|
|
87
91
|
meta?: JsonValue
|
|
88
92
|
}
|
|
89
|
-
/** Whole-list snapshot; latest write wins on replay. Log-only UI state; never derived history. */
|
|
90
|
-
'todo/write': { todos: TodoItem[] }
|
|
91
93
|
/**
|
|
92
94
|
* Full header for the next request, appended inside its step before dispatch.
|
|
93
95
|
* It is log-only; the latest snapshot reconstructs the request header.
|
|
94
96
|
*/
|
|
95
|
-
'request/header': {
|
|
97
|
+
'request/header': {
|
|
98
|
+
header: EpochHeader
|
|
99
|
+
reason: RequestHeaderReason
|
|
100
|
+
/** A changed header also begins a distinct model-message series. */
|
|
101
|
+
startsSeries?: true
|
|
102
|
+
}
|
|
96
103
|
/**
|
|
97
104
|
* Route metadata for the next request, logged only when the route or capacity
|
|
98
105
|
* changes. It does not participate in request reconstruction or header equality.
|
|
@@ -126,34 +133,11 @@ interface SessionEventMap {
|
|
|
126
133
|
|
|
127
134
|
`UserMessage` 是普通提示词、注入上下文、steering(中途引导)与实时收件箱事件共享的带标识且冻结的 user-role 值。事件包装层只会增加事件本地的位置或结果事实;条目待处理期间,loop 只额外附加驱动器自有的路由状态。
|
|
128
135
|
|
|
129
|
-
### `TodoItem`:一条待办项
|
|
130
|
-
|
|
131
|
-
这是 `todo/write` 事件全量列表快照中的单元。它有意保持精简:一行 `content` 加一个三态 `status`(没有 id、优先级或 `activeForm`);列表在每次写入时整体替换,因此条目无需稳定标识。见 [todo_write Agent Note](../../.agents/notes/implemented/feature/2026-06-29-todo-write-tool.md)。
|
|
132
|
-
|
|
133
|
-
```ts type-equiv
|
|
134
|
-
/**
|
|
135
|
-
* One entry in an agent's todo list — the unit of the `todo/write`
|
|
136
|
-
* {@link SessionEventMap} event's whole-list snapshot.
|
|
137
|
-
*
|
|
138
|
-
* Deliberately minimal: a human-readable `content` line and a three-state
|
|
139
|
-
* `status`. No id, priority, or `activeForm` — the list is replaced wholesale
|
|
140
|
-
* on every write (last-write-wins), so entries need no stable identity. The
|
|
141
|
-
* three statuses describe the complete portable lifecycle needed by model and
|
|
142
|
-
* UI consumers.
|
|
143
|
-
*/
|
|
144
|
-
interface TodoItem {
|
|
145
|
-
/** What this task is — a short imperative line shown in the UI. */
|
|
146
|
-
content: string
|
|
147
|
-
/** Lifecycle state. `in_progress` marks a task being worked now; parallel work may mark several. */
|
|
148
|
-
status: 'pending' | 'in_progress' | 'completed'
|
|
149
|
-
}
|
|
150
|
-
```
|
|
151
|
-
|
|
152
136
|
<a id="the-request-header-event-requestheader"></a>
|
|
153
137
|
|
|
154
138
|
### 请求头事件:`request/header`
|
|
155
139
|
|
|
156
|
-
请求信封(即 `EpochHeader`:调用配置 + 适配器所提供默认值的标记 + 渲染后的系统提示词 + 已组装的工具 schema)会作为会话状态写入日志,因此每个对话请求都是日志的纯函数(见可重建性 Agent Note)。带有 reason `'initial'` 或 `'resume'` 的完整 `request/header` 快照记录每个 agent loop
|
|
140
|
+
请求信封(即 `EpochHeader`:调用配置 + 适配器所提供默认值的标记 + 渲染后的系统提示词 + 已组装的工具 schema)会作为会话状态写入日志,因此每个对话请求都是日志的纯函数(见可重建性 Agent Note)。带有 reason `'initial'` 或 `'resume'` 的完整 `request/header` 快照记录每个 agent loop 实例的边界;请求变化时会追加 reason 为 `'change'` 的快照;未变的信封显式开启消息序列或跟随 surface 替换时,会追加 reason 为 `'series'` 的快照。如果发生变化的快照所属请求同时开启序列,它会携带 `startsSeries: true`。普通的仅追加后续 Turn,以及同一模型消息序列内的后续 Step 与重试沿用最新快照。`foldRequestHeader(events)` 通过选择最新快照重建请求头。该事件不是 `SurfaceEventType`,不产生 LLM 消息。
|
|
157
141
|
|
|
158
142
|
```ts type-equiv
|
|
159
143
|
/**
|
|
@@ -217,6 +201,17 @@ type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
217
201
|
/** Unix epoch milliseconds. */
|
|
218
202
|
time: number
|
|
219
203
|
data: SessionEventMap[K]
|
|
204
|
+
/**
|
|
205
|
+
* Marks an event a reader may safely skip when it does not recognize
|
|
206
|
+
* `type`. Absent means required: a reader meeting an unrecognized type
|
|
207
|
+
* without this marker MUST refuse to reconstruct the session instead of
|
|
208
|
+
* silently dropping the event, because an unrecognized required event may
|
|
209
|
+
* change how the rest of the log is interpreted. A writer sets `true` only
|
|
210
|
+
* on purely informational records whose loss cannot affect reconstruction;
|
|
211
|
+
* defaulting to required means a forgotten marker over-refuses (an
|
|
212
|
+
* inconvenience) rather than silently resuming a gutted session.
|
|
213
|
+
*/
|
|
214
|
+
ignorable?: true
|
|
220
215
|
} & (K extends SurfaceEventType ? {
|
|
221
216
|
/**
|
|
222
217
|
* Seq numbers of earlier events that this event cites as sources
|
|
@@ -237,9 +232,11 @@ type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
237
232
|
|
|
238
233
|
对于 `assistant/message`,存在的 `sourceEventSeqs: []` 表示提供方流已知且完整地为空;旧格式或外部事件缺少该字段时,没有记录这条消息由哪些早期事件产生。agent loop 会为每次成功的模型调用写入该字段;其他 surface 事件只要包含该字段,其列表就必须非空。
|
|
239
234
|
|
|
235
|
+
<a id="surface-types"></a>
|
|
236
|
+
|
|
240
237
|
## Surface 类型
|
|
241
238
|
|
|
242
|
-
三种产生消息的类型(`SurfaceEventType`:`user/message`、`assistant/message`、`tool/result`)携带 surface 元数据,用来声明它们如何加入有序的派生 surface。见 [session surface Agent Note](../../.agents/notes/implemented/architecture/2026-06-18-session-surface.md)。
|
|
239
|
+
三种产生消息的类型(`SurfaceEventType`:`user/message`、`assistant/message`、`tool/result`)携带 surface 元数据,用来声明它们如何加入有序的派生 surface。见 [session surface Agent Note](../../.agents/notes/implemented/architecture/2026-06-18-session-surface.zh.md)。
|
|
243
240
|
|
|
244
241
|
### `SurfaceEventType`:事件类型中产生消息的子集
|
|
245
242
|
|
|
@@ -297,7 +294,7 @@ interface SurfaceIntent {
|
|
|
297
294
|
}
|
|
298
295
|
```
|
|
299
296
|
|
|
300
|
-
对 `SurfaceEventType` 事件必填:每个产生消息的事件都必须声明它如何加入 surface(派生模型历史的唯一来源)。面向人类的 transcript(文本记录)是另一个投影,读取的是日志中追加来源的事件,因为 surface 会有意遮蔽替换所概括的范围(见 [dsh-session](../../packages/core/session/README.md) 的 `isAppendSurfaceEvent`)。非 surface 类型在编译期拒绝此参数。
|
|
297
|
+
对 `SurfaceEventType` 事件必填:每个产生消息的事件都必须声明它如何加入 surface(派生模型历史的唯一来源)。面向人类的 transcript(文本记录)是另一个投影,读取的是日志中追加来源的事件,因为 surface 会有意遮蔽替换所概括的范围(见 [dsh-session](../../packages/core/session/README.zh.md) 的 `isAppendSurfaceEvent`)。非 surface 类型在编译期拒绝此参数。
|
|
301
298
|
|
|
302
299
|
只有 `assistant/message` 可以携带存在但为空的 `sourceEventSeqs`;字段不存在时,该事件没有记录这条消息由哪些早期事件产生,但提供方仍可能发出过分片。
|
|
303
300
|
|
|
@@ -450,7 +447,7 @@ declare class Session {
|
|
|
450
447
|
* Map/Set/Date/class instance), or when the candidate violates the
|
|
451
448
|
* canonical surface contract (marker shape and eligibility, unique
|
|
452
449
|
* earlier source-event references, positional replacement validity, and complete
|
|
453
|
-
* shadowed-node coverage). One
|
|
450
|
+
* shadowed-node coverage). One iterative pass reads, validates, and
|
|
454
451
|
* copies each nested value once, so a stateful getter cannot supply one value
|
|
455
452
|
* to validation and another to storage. The event log is the durable source
|
|
456
453
|
* of truth, so a bad event fails at the append site rather than later during
|
|
@@ -530,7 +527,7 @@ declare class Session {
|
|
|
530
527
|
|
|
531
528
|
## 轮次的结束原因:`TurnEndReasonMap`
|
|
532
529
|
|
|
533
|
-
`turn/start` 没有 trigger 字段。已进入的 `user/message` 批次记录进入每个步骤的内容,`llm/retry` 记录请求恢复,idle 注入则保持待处理,直到唤醒交付抵达后续 pre-step。实时轮次会保留停止驱动器的类型化 [`AgentCancelCause`](core.md#the-agent-handle);只有在导入受支持的粗粒度取消记录且记录未保存调用方时,持久化才使用额外的 `{ kind: 'legacy' }` 原因。
|
|
530
|
+
`turn/start` 没有 trigger 字段。已进入的 `user/message` 批次记录进入每个步骤的内容,`llm/retry` 记录请求恢复,idle 注入则保持待处理,直到唤醒交付抵达后续 pre-step。实时轮次会保留停止驱动器的类型化 [`AgentCancelCause`](core.zh.md#the-agent-handle);只有在导入受支持的粗粒度取消记录且记录未保存调用方时,持久化才使用额外的 `{ kind: 'legacy' }` 原因。
|
|
534
531
|
|
|
535
532
|
```ts type-equiv
|
|
536
533
|
/** Durable cancellation cause, including imports whose original coarse record carried no cause. */
|
|
@@ -563,13 +560,13 @@ interface TurnEndReasonMap {
|
|
|
563
560
|
}
|
|
564
561
|
```
|
|
565
562
|
|
|
566
|
-
`max-tokens` 与模型调用中同名的 `FinishReason` 对应:只要轮次内有任何步骤以 `max-tokens` 结束,整个轮次就以 `max-tokens` 而不是 `completed` 结束(即使之后继续执行,截断事实仍优先),让消费方能够区分正常停止和截断停止。取消和错误仍是不同的结果。`interrupted` 是唯一不会由任何 loop 发出的原因:它由崩溃恢复合成(见 [persistence.md](persistence.md))。该 map 可通过合并扩展。
|
|
563
|
+
`max-tokens` 与模型调用中同名的 `FinishReason` 对应:只要轮次内有任何步骤以 `max-tokens` 结束,整个轮次就以 `max-tokens` 而不是 `completed` 结束(即使之后继续执行,截断事实仍优先),让消费方能够区分正常停止和截断停止。取消和错误仍是不同的结果。`interrupted` 是唯一不会由任何 loop 发出的原因:它由崩溃恢复合成(见 [persistence.md](persistence.zh.md))。该 map 可通过合并扩展。
|
|
567
564
|
|
|
568
565
|
## 执行封闭与独立事件
|
|
569
566
|
|
|
570
567
|
一个轮次包围一次模型循环执行,而不是整个会话日志。AgentLoop 只会在轮次内进入 pre-step 批次时记录注入的 `user/message` 事件;插件所属的纯日志事件仍可出现在 `turn/end` 与下一个 `turn/start` 之间,占用事件 seq 但不递增轮次编号。持久化会将每个连续且已接受的事件纳入有界持久化批次,而崩溃修复只关闭确实仍处于开放状态的尾部轮次。需要即时持久性屏障的生产方会显式等待 `ctx.sessions.flush(session)`。
|
|
571
568
|
|
|
572
|
-
可选的 `dsh-session/invariant` 配套插件会强制核心拥有的关系:轮次与步骤编号、执行事件封闭,以及同一步骤内的工具调用/结果配对。可合并扩展事件的关系由声明它的插件拥有,因此核心不会仅因没有开放轮次就拒绝未知事件。见[独立事件决策](../../.agents/notes/implemented/simplification/2026-07-28-remove-synthetic-log-only-turns.md)。
|
|
569
|
+
可选的 `dsh-session/invariant` 配套插件会强制核心拥有的关系:轮次与步骤编号、执行事件封闭,以及同一步骤内的工具调用/结果配对。可合并扩展事件的关系由声明它的插件拥有,因此核心不会仅因没有开放轮次就拒绝未知事件。见[独立事件决策](../../.agents/notes/implemented/simplification/2026-07-28-remove-synthetic-log-only-turns.zh.md)。
|
|
573
570
|
|
|
574
571
|
## 种子结束边界:`session/end-seed`
|
|
575
572
|
|
|
@@ -583,17 +580,23 @@ interface TurnEndReasonMap {
|
|
|
583
580
|
|
|
584
581
|
## 插件贡献的仅日志事件
|
|
585
582
|
|
|
586
|
-
插件可以通过 declaration merging 添加额外的 `SessionEventMap` 类型。这些是**仅日志**事件:不是 `SurfaceEventType`(不携带 `surfaceOp`,不参与派生历史)。事件所有方决定它们属于一个开放的执行轮次,还是可以独立位于轮次之间,并在自己的不变量配套插件中强制所需关系。生成的[持久化日志事件目录](../persistence-catalog.md)
|
|
583
|
+
插件可以通过 declaration merging 添加额外的 `SessionEventMap` 类型。这些是**仅日志**事件:不是 `SurfaceEventType`(不携带 `surfaceOp`,不参与派生历史)。事件所有方决定它们属于一个开放的执行轮次,还是可以独立位于轮次之间,并在自己的不变量配套插件中强制所需关系。生成的[持久化日志事件目录](../persistence-catalog.zh.md)会列出每个核心或插件贡献的事件;压缩 seam 的 `compaction/*` 语义在 [compaction.md](compaction.zh.md) 中讨论。
|
|
587
584
|
|
|
588
|
-
如果同一个插件事件族中的多条事件要组装成一个 Web Client Conversation Node,该事件族中的每条 start、update、result、resource 或 interruption 事件都必须携带或独立推导出同一个稳定业务 id。此要求只约束需要关联的 Node 事件族,并不要求每条 Session 事件都有业务 id;Client 因此无须根据相邻关系猜测归属,也无须扫描历史。参见 [Conversation
|
|
585
|
+
如果同一个插件事件族中的多条事件要组装成一个 Web Client Conversation Node,该事件族中的每条 start、update、result、resource 或 interruption 事件都必须携带或独立推导出同一个稳定业务 id。此要求只约束需要关联的 Node 事件族,并不要求每条 Session 事件都有业务 id;Client 因此无须根据相邻关系猜测归属,也无须扫描历史。参见 [Conversation 子系统](conversation.zh.md)。
|
|
589
586
|
|
|
590
|
-
钩子桥接层的 `hook/invoked` / `hook/result` 对(来自 `@deepseek-ai/dsh-hook-protocol`)通过 `handlerId` 关联。`UserPromptSubmit`、`PreToolUse`、`PostToolUse` 与 `Stop` 在 loop 已打开的轮次内触发,因此其 `hook/*` 记录天然位于轮次之内。`SessionStart` 不生成 `hook/*` 记录,因为它在轮次 1 之前运行;其上下文会在 inbox 中保持待处理,直到唤醒交付打开一个轮次(见[钩子桥接 Agent Note](../../.agents/notes/implemented/feature/2026-06-30-hook-bridges.md))。
|
|
587
|
+
钩子桥接层的 `hook/invoked` / `hook/result` 对(来自 `@deepseek-ai/dsh-hook-protocol`)通过 `handlerId` 关联。`UserPromptSubmit`、`PreToolUse`、`PostToolUse` 与 `Stop` 在 loop 已打开的轮次内触发,因此其 `hook/*` 记录天然位于轮次之内。`SessionStart` 不生成 `hook/*` 记录,因为它在轮次 1 之前运行;其上下文会在 inbox 中保持待处理,直到唤醒交付打开一个轮次(见[钩子桥接 Agent Note](../../.agents/notes/implemented/feature/2026-06-30-hook-bridges.zh.md))。
|
|
591
588
|
|
|
592
589
|
## 持久性约定
|
|
593
590
|
|
|
594
|
-
持久化后端依赖的约定如下:持久日志无损保存每个事件,**包括** `assistant/chunk`;`seq` 必须连续,因此不能从规范日志中过滤分片。后端可以为事件批次选择自己的存储编码,只要 `load` 返回与追加时完全一致的事件即可(JSONL 后端默认启用的打包分片行就是此类编码;见 [persistence.md](persistence.md))。所有 `event.data` 都必须可序列化为 JSON;`Session.append` 会从源头强制这一要求(遇到不可序列化数据时抛出),因此错误事件绝不会进入日志,`session.events` 始终与后端可持久化的内容一致。新增会携带不可序列化数据、破坏核心执行嵌套或违反事件所有方声明关系的事件类型,都会构成磁盘格式的破坏性变更。
|
|
591
|
+
持久化后端依赖的约定如下:持久日志无损保存每个事件,**包括** `assistant/chunk`;`seq` 必须连续,因此不能从规范日志中过滤分片。后端可以为事件批次选择自己的存储编码,只要 `load` 返回与追加时完全一致的事件即可(JSONL 后端默认启用的打包分片行就是此类编码;见 [persistence.md](persistence.zh.md))。所有 `event.data` 都必须可序列化为 JSON;`Session.append` 会从源头强制这一要求(遇到不可序列化数据时抛出),因此错误事件绝不会进入日志,`session.events` 始终与后端可持久化的内容一致。新增会携带不可序列化数据、破坏核心执行嵌套或违反事件所有方声明关系的事件类型,都会构成磁盘格式的破坏性变更。
|
|
592
|
+
|
|
593
|
+
消费此约定的后端见 [persistence.md](persistence.zh.md)。
|
|
595
594
|
|
|
596
|
-
|
|
595
|
+
## Remote 目录与 workspace 打开
|
|
596
|
+
|
|
597
|
+
`ModelCatalog` 是 `session/modelCatalog` 返回的 Host generation 模型目录:它携带部署默认值、可路由 provider id、成功的 provider 分组与相互隔离的 provider 失败。它不由某个 Session 派生,因此与 Session projection 分开保存。
|
|
598
|
+
|
|
599
|
+
`SessionOpenWorkspacePathRequest` 携带绝对路径或已按 workspace 解析的 `path`。`SessionOpenWorkspacePathValue` 确认 Host 已接受原生交接。Session-aware Client 会在已知当前 Session cwd 时据此解析相对路径;controller 将路径原样交给打开器,并通过 Session Remote 错误词汇表报告无效请求、取消与打开器失败。
|
|
597
600
|
|
|
598
601
|
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
|
|
599
602
|
|
|
@@ -601,7 +604,151 @@ interface TurnEndReasonMap {
|
|
|
601
604
|
|
|
602
605
|
## Cordis API
|
|
603
606
|
|
|
604
|
-
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`) —
|
|
607
|
+
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).
|
|
608
|
+
|
|
609
|
+
<a id="ctxsessioncontroller--sessioncontroller"></a>
|
|
610
|
+
|
|
611
|
+
### `ctx.sessionController` — `SessionController`
|
|
612
|
+
|
|
613
|
+
Host service backing the generated `ctx.remote.session` namespace.
|
|
614
|
+
|
|
615
|
+
```ts cordis-catalog
|
|
616
|
+
/**
|
|
617
|
+
* Resolve or resume one ordinary Session for another Host API domain.
|
|
618
|
+
* @param sessionId - Session identity whose Agent owns the operation.
|
|
619
|
+
* @returns the live Agent or the stable Session-domain failure.
|
|
620
|
+
*/
|
|
621
|
+
resolveAgent(sessionId: SessionId): Promise<ApiSessionAgentResult>
|
|
622
|
+
|
|
623
|
+
/**
|
|
624
|
+
* Inspect one attached or persisted Session without activating its Agent.
|
|
625
|
+
* @param sessionId - durable Session identity.
|
|
626
|
+
* @param signal - optional caller cancellation for persistence reads.
|
|
627
|
+
* @returns the current attached state or persisted header and event prefix.
|
|
628
|
+
*/
|
|
629
|
+
inspect( sessionId: SessionId, signal?: AbortSignal, ): Promise<{ meta: SessionHeader; events: SessionEvent[] }>
|
|
630
|
+
|
|
631
|
+
/**
|
|
632
|
+
* Read all visible Session rows without resuming an Agent.
|
|
633
|
+
* @param _request - reserved empty list request.
|
|
634
|
+
* @param signal - cancellation for persistence reads.
|
|
635
|
+
* @returns visible Session summaries ordered by activity.
|
|
636
|
+
*/
|
|
637
|
+
@Remote('list') async list(_request: SessionListRequest, signal: AbortSignal): Promise<SessionListValue>
|
|
638
|
+
|
|
639
|
+
/**
|
|
640
|
+
* Search visible Session content without resuming an Agent.
|
|
641
|
+
* @param request - literal message-content query.
|
|
642
|
+
* @param signal - cancellation for list and search reads.
|
|
643
|
+
* @returns authorized bounded Session search results.
|
|
644
|
+
*/
|
|
645
|
+
@Remote('search') search(request: SessionSearchRequest, signal: AbortSignal): Promise<SessionSearchValue>
|
|
646
|
+
|
|
647
|
+
/**
|
|
648
|
+
* Create or idempotently adopt one ordinary Session.
|
|
649
|
+
* @param request - requested identity, location, and Agent preset.
|
|
650
|
+
* @returns the Session identity and resolved preset when configured.
|
|
651
|
+
*/
|
|
652
|
+
@Remote('create') create(request: SessionCreateRequest): Promise<SessionCreateValue>
|
|
653
|
+
|
|
654
|
+
/**
|
|
655
|
+
* Select one Session-local model after explicitly resuming the Session.
|
|
656
|
+
* @param request - Session identity and requested model selection.
|
|
657
|
+
* @returns the normalized selection installed for the Session.
|
|
658
|
+
*/
|
|
659
|
+
@Remote('selectModel') selectModel(request: SessionSelectModelRequest): Promise<SessionSelectModelValue>
|
|
660
|
+
|
|
661
|
+
/**
|
|
662
|
+
* Describe every currently routable model for Host-generation selectors.
|
|
663
|
+
* @returns provider-grouped models, the deployment default, and isolated provider failures.
|
|
664
|
+
*/
|
|
665
|
+
@Remote('modelCatalog') modelCatalog(): Promise<ModelCatalog>
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
* Report whether this deployment can hand a Session workspace path to a native desktop.
|
|
669
|
+
* @returns true when the matching open operation is available.
|
|
670
|
+
*/
|
|
671
|
+
@Remote canOpenWorkspacePath(): boolean
|
|
672
|
+
|
|
673
|
+
/**
|
|
674
|
+
* Open one path prepared by a Session-aware caller on the Host desktop.
|
|
675
|
+
* @param request - path after best-effort Session workspace resolution.
|
|
676
|
+
* @param signal - caller lifetime; abort terminates the native command.
|
|
677
|
+
* @returns confirmation after the native opener accepts the path.
|
|
678
|
+
* @throws RemoteError when the request is invalid, cancelled, or the opener fails.
|
|
679
|
+
*/
|
|
680
|
+
@Remote('openWorkspacePath') async openWorkspacePath( request: SessionOpenWorkspacePathRequest, signal: AbortSignal, ): Promise<SessionOpenWorkspacePathValue>
|
|
681
|
+
|
|
682
|
+
/**
|
|
683
|
+
* Rename one Session after explicitly resuming it.
|
|
684
|
+
* @param request - Session identity and proposed title.
|
|
685
|
+
* @returns the accepted title and durable event sequence.
|
|
686
|
+
*/
|
|
687
|
+
@Remote('rename') rename(request: SessionRenameRequest): Promise<SessionRenameValue>
|
|
688
|
+
|
|
689
|
+
/**
|
|
690
|
+
* Fork one cold-readable completed-turn prefix into a new Session.
|
|
691
|
+
* @param request - source Session and optional event anchor.
|
|
692
|
+
* @returns the new Session identity.
|
|
693
|
+
*/
|
|
694
|
+
@Remote('fork') fork(request: SessionForkRequest): Promise<SessionForkValue>
|
|
695
|
+
|
|
696
|
+
/**
|
|
697
|
+
* Admit one prompt after explicitly resuming its Session.
|
|
698
|
+
* @param request - Session identity, prompt content, source metadata, and delivery mode.
|
|
699
|
+
* @param signal - caller cancellation before prompt admission begins.
|
|
700
|
+
* @returns acknowledgement that the Agent accepted the prompt.
|
|
701
|
+
*/
|
|
702
|
+
@Remote('prompt') prompt(request: SessionPromptRequest, signal: AbortSignal): Promise<SessionPromptValue>
|
|
703
|
+
|
|
704
|
+
/**
|
|
705
|
+
* Read one image proven reachable from the addressed Session log.
|
|
706
|
+
* @param request - Session and attachment identities used for authorization.
|
|
707
|
+
* @returns the durable attachment reference and base64-encoded bytes.
|
|
708
|
+
*/
|
|
709
|
+
@Remote('attachment') attachment(request: SessionAttachmentRequest): Promise<SessionAttachmentValue>
|
|
710
|
+
|
|
711
|
+
/**
|
|
712
|
+
* Mutate one still-pending queue occurrence on a live Agent.
|
|
713
|
+
* @param request - Session, queue item, and requested mutation.
|
|
714
|
+
* @returns acknowledgement that the queue mutation was applied.
|
|
715
|
+
*/
|
|
716
|
+
@Remote('updateQueue') updateQueue(request: SessionUpdateQueueRequest): SessionUpdateQueueValue
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
* Cancel one active Agent turn without dropping its pending inbox.
|
|
720
|
+
* @param request - Session whose active Agent turn is cancelled.
|
|
721
|
+
* @returns acknowledgement that cancellation was requested.
|
|
722
|
+
*/
|
|
723
|
+
@Remote('cancel') cancel(request: SessionCancelRequest): SessionCancelValue
|
|
724
|
+
|
|
725
|
+
/**
|
|
726
|
+
* Read one cold-safe, message-aligned Session history page.
|
|
727
|
+
* @param request - durable address, backward cursor, and page budget.
|
|
728
|
+
* @param signal - cancellation for persistence reads.
|
|
729
|
+
* @returns one chronological page.
|
|
730
|
+
*/
|
|
731
|
+
@Remote('page') page(request: SessionPageRequest, signal: AbortSignal): Promise<SessionPage>
|
|
732
|
+
|
|
733
|
+
/**
|
|
734
|
+
* Follow one Session log from its opening or resume cursor.
|
|
735
|
+
* @param request - durable address and last committed sequence already held by the caller.
|
|
736
|
+
* @param signal - cancellation owned by the Remote stream carrier.
|
|
737
|
+
* @returns a complete opening snapshot followed by gap-free event frames.
|
|
738
|
+
*/
|
|
739
|
+
@Remote({ mode: 'stream' }) follow(request: SessionFollowRequest, signal: AbortSignal): AsyncIterable<SessionFollowFrame>
|
|
740
|
+
|
|
741
|
+
/**
|
|
742
|
+
* Stream a complete live-control baseline followed by replacement frames.
|
|
743
|
+
* @param signal - cancellation owned by the Remote stream carrier.
|
|
744
|
+
* @returns one complete baseline followed by live replacement frames.
|
|
745
|
+
*/
|
|
746
|
+
@Remote({ mode: 'stream' }) control(signal: AbortSignal): AsyncIterable<SessionControlFrame>
|
|
747
|
+
```
|
|
748
|
+
|
|
749
|
+
Types: [SessionHeader](persistence.zh.md) · [SessionId](core.zh.md) · [SessionSearchRequest](session-query.zh.md)
|
|
750
|
+
|
|
751
|
+
Source: [`packages/api/session-controller/src/index.ts`](../../packages/api/session-controller/src/index.ts)
|
|
605
752
|
|
|
606
753
|
<a id="ctxsessions--sessionstore"></a>
|
|
607
754
|
|
|
@@ -735,9 +882,109 @@ list(): Session[]
|
|
|
735
882
|
fork(source: SessionForkSource, boundary?: number, childSessionId?: SessionId): Session
|
|
736
883
|
```
|
|
737
884
|
|
|
738
|
-
Types: [CreateSessionOptions](persistence.md) · [PrepareSessionOptions](persistence.md) · [SessionId](core.md)
|
|
885
|
+
Types: [CreateSessionOptions](persistence.zh.md) · [PrepareSessionOptions](persistence.zh.md) · [SessionId](core.zh.md)
|
|
886
|
+
|
|
887
|
+
Source: [`packages/core/session/src/index.ts`](../../packages/core/session/src/index.ts)
|
|
888
|
+
|
|
889
|
+
<a id="api-session-events"></a>
|
|
890
|
+
|
|
891
|
+
### `api-session/*` events
|
|
892
|
+
|
|
893
|
+
<a id="api-sessionactivity--emit"></a>
|
|
894
|
+
|
|
895
|
+
#### `api-session/activity` — emit
|
|
896
|
+
|
|
897
|
+
One user-authored durable message advanced Session list activity.
|
|
898
|
+
|
|
899
|
+
```ts cordis-catalog
|
|
900
|
+
/**
|
|
901
|
+
* One user-authored durable message advanced Session list activity.
|
|
902
|
+
* @mode emit
|
|
903
|
+
* @param sessionId - addressed Session identity.
|
|
904
|
+
* @param updatedAt - durable message time used for list ordering.
|
|
905
|
+
*/
|
|
906
|
+
'api-session/activity'(sessionId: SessionId, updatedAt: number): void
|
|
907
|
+
```
|
|
908
|
+
|
|
909
|
+
Types: [SessionId](core.zh.md)
|
|
910
|
+
|
|
911
|
+
Source: [`packages/api/session-controller/src/types.ts`](../../packages/api/session-controller/src/types.ts)
|
|
912
|
+
|
|
913
|
+
<a id="api-sessionadded--emit"></a>
|
|
914
|
+
|
|
915
|
+
#### `api-session/added` — emit
|
|
916
|
+
|
|
917
|
+
A Session became visible to Session list consumers.
|
|
918
|
+
|
|
919
|
+
```ts cordis-catalog
|
|
920
|
+
/**
|
|
921
|
+
* A Session became visible to Session list consumers.
|
|
922
|
+
* @mode emit
|
|
923
|
+
* @param summary - initial list row for the Session.
|
|
924
|
+
*/
|
|
925
|
+
'api-session/added'(summary: SessionSummary): void
|
|
926
|
+
```
|
|
927
|
+
|
|
928
|
+
Source: [`packages/api/session-controller/src/types.ts`](../../packages/api/session-controller/src/types.ts)
|
|
929
|
+
|
|
930
|
+
<a id="api-sessionerror--emit"></a>
|
|
931
|
+
|
|
932
|
+
#### `api-session/error` — emit
|
|
933
|
+
|
|
934
|
+
One Agent failed outside a durable turn position.
|
|
935
|
+
|
|
936
|
+
```ts cordis-catalog
|
|
937
|
+
/**
|
|
938
|
+
* One Agent failed outside a durable turn position.
|
|
939
|
+
* @mode emit
|
|
940
|
+
* @param sessionId - Agent and Session identity.
|
|
941
|
+
* @param message - user-safe failure chain.
|
|
942
|
+
*/
|
|
943
|
+
'api-session/error'(sessionId: SessionId, message: string): void
|
|
944
|
+
```
|
|
945
|
+
|
|
946
|
+
Types: [SessionId](core.zh.md)
|
|
947
|
+
|
|
948
|
+
Source: [`packages/api/session-controller/src/types.ts`](../../packages/api/session-controller/src/types.ts)
|
|
949
|
+
|
|
950
|
+
<a id="api-sessionremoved--emit"></a>
|
|
951
|
+
|
|
952
|
+
#### `api-session/removed` — emit
|
|
953
|
+
|
|
954
|
+
A Session left the live Host registry.
|
|
955
|
+
|
|
956
|
+
```ts cordis-catalog
|
|
957
|
+
/**
|
|
958
|
+
* A Session left the live Host registry.
|
|
959
|
+
* @mode emit
|
|
960
|
+
* @param sessionId - removed Session identity.
|
|
961
|
+
*/
|
|
962
|
+
'api-session/removed'(sessionId: SessionId): void
|
|
963
|
+
```
|
|
964
|
+
|
|
965
|
+
Types: [SessionId](core.zh.md)
|
|
966
|
+
|
|
967
|
+
Source: [`packages/api/session-controller/src/types.ts`](../../packages/api/session-controller/src/types.ts)
|
|
968
|
+
|
|
969
|
+
<a id="api-sessionstatus--emit"></a>
|
|
970
|
+
|
|
971
|
+
#### `api-session/status` — emit
|
|
972
|
+
|
|
973
|
+
One Agent changed running state.
|
|
974
|
+
|
|
975
|
+
```ts cordis-catalog
|
|
976
|
+
/**
|
|
977
|
+
* One Agent changed running state.
|
|
978
|
+
* @mode emit
|
|
979
|
+
* @param sessionId - Agent and Session identity.
|
|
980
|
+
* @param running - whether the Agent is running.
|
|
981
|
+
*/
|
|
982
|
+
'api-session/status'(sessionId: SessionId, running: boolean): void
|
|
983
|
+
```
|
|
984
|
+
|
|
985
|
+
Types: [SessionId](core.zh.md)
|
|
739
986
|
|
|
740
|
-
Source: [`packages/
|
|
987
|
+
Source: [`packages/api/session-controller/src/types.ts`](../../packages/api/session-controller/src/types.ts)
|
|
741
988
|
|
|
742
989
|
<a id="session-events"></a>
|
|
743
990
|
|
|
@@ -764,9 +1011,9 @@ Creation announcement during session publication. A synchronous throw vetoes and
|
|
|
764
1011
|
'session/created'(this: Scoped<Session>, session: Session): void
|
|
765
1012
|
```
|
|
766
1013
|
|
|
767
|
-
Types: [Scoped](scope.md)
|
|
1014
|
+
Types: [Scoped](scope.zh.md)
|
|
768
1015
|
|
|
769
|
-
Source: [`packages/core/session/src/index.ts
|
|
1016
|
+
Source: [`packages/core/session/src/index.ts`](../../packages/core/session/src/index.ts)
|
|
770
1017
|
|
|
771
1018
|
<a id="sessiondisposed--emit"></a>
|
|
772
1019
|
|
|
@@ -787,9 +1034,9 @@ Emitted once when an announced session leaves the store, including publication r
|
|
|
787
1034
|
'session/disposed'(this: Scoped<Session>, session: Session): void
|
|
788
1035
|
```
|
|
789
1036
|
|
|
790
|
-
Types: [Scoped](scope.md)
|
|
1037
|
+
Types: [Scoped](scope.zh.md)
|
|
791
1038
|
|
|
792
|
-
Source: [`packages/core/session/src/index.ts
|
|
1039
|
+
Source: [`packages/core/session/src/index.ts`](../../packages/core/session/src/index.ts)
|
|
793
1040
|
|
|
794
1041
|
<a id="sessionevent--emit"></a>
|
|
795
1042
|
|
|
@@ -812,9 +1059,9 @@ Post-commit, fire-and-forget append feed. The listener snapshot resolves before
|
|
|
812
1059
|
'session/event'(this: Scoped<Session>, session: Session, event: SessionEvent): void
|
|
813
1060
|
```
|
|
814
1061
|
|
|
815
|
-
Types: [Scoped](scope.md)
|
|
1062
|
+
Types: [Scoped](scope.zh.md)
|
|
816
1063
|
|
|
817
|
-
Source: [`packages/core/session/src/index.ts
|
|
1064
|
+
Source: [`packages/core/session/src/index.ts`](../../packages/core/session/src/index.ts)
|
|
818
1065
|
|
|
819
1066
|
<a id="sessionflush--parallel"></a>
|
|
820
1067
|
|
|
@@ -834,7 +1081,7 @@ Awaited parallel durability checkpoint: every listener runs and the caller await
|
|
|
834
1081
|
'session/flush'(this: Scoped<Session>, session: Session): Promise<void> | void
|
|
835
1082
|
```
|
|
836
1083
|
|
|
837
|
-
Types: [Scoped](scope.md)
|
|
1084
|
+
Types: [Scoped](scope.zh.md)
|
|
838
1085
|
|
|
839
|
-
Source: [`packages/core/session/src/index.ts
|
|
1086
|
+
Source: [`packages/core/session/src/index.ts`](../../packages/core/session/src/index.ts)
|
|
840
1087
|
<!-- 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/settings.md
|
|
5
|
-
settings.md:
|
|
6
|
-
settings.zh.md:
|
|
5
|
+
settings.md: d8e3cbc46eb697315d4938b696e921a0c2e11828
|
|
6
|
+
settings.zh.md: 772fd7832ff80cab9444c16c9a1dc7ae1875d51e
|