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,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[English](permission-presets.md) | 中文
|
|
4
4
|
|
|
5
|
-
[dsh-permission-presets](../../packages/interaction/permission-presets) 的权限预设层(`ctx.permissionPresets`,`PermissionPresetService`)把两个相互独立的强制执行 knob,即[沙箱模式](sandbox.md)(`sandbox/mode`)与[审批策略](approval.md)(`approval/policy`),捆绑成具名预设,供客户端作为单个权限(Permissions)选择器提供。它是一项可选能力,不属于 agent loop(智能体循环)主干,也不拥有任何强制执行:执行、提示词叙述与回放仍然读取各自 knob的折叠结果,预设切换只记录意图,并通过每个 knob各自的规范 setter 写入。[包 README](../../packages/interaction/permission-presets/README.md) 负责组合状态与限制;[沙箱切换设计](../../.agents/notes/implemented/feature/2026-07-06-sandbox.md)负责决策依据。
|
|
5
|
+
[dsh-permission-presets](../../packages/interaction/permission-presets) 的权限预设层(`ctx.permissionPresets`,`PermissionPresetService`)把两个相互独立的强制执行 knob,即[沙箱模式](sandbox.zh.md)(`sandbox/mode`)与[审批策略](approval.zh.md)(`approval/policy`),捆绑成具名预设,供客户端作为单个权限(Permissions)选择器提供。它是一项可选能力,不属于 agent loop(智能体循环)主干,也不拥有任何强制执行:执行、提示词叙述与回放仍然读取各自 knob的折叠结果,预设切换只记录意图,并通过每个 knob各自的规范 setter 写入。[包 README](../../packages/interaction/permission-presets/README.zh.md) 负责组合状态与限制;[沙箱切换设计](../../.agents/notes/implemented/feature/2026-07-06-sandbox.zh.md)负责决策依据。
|
|
6
6
|
|
|
7
7
|
源码:[`packages/interaction/permission-presets/src/index.ts`](../../packages/interaction/permission-presets/src/index.ts)
|
|
8
8
|
|
|
@@ -45,7 +45,7 @@ interface Config {
|
|
|
45
45
|
|
|
46
46
|
## 当前预设与派生的 `custom`
|
|
47
47
|
|
|
48
|
-
`current(
|
|
48
|
+
`current(session)` 从可选注册的 `permissions` 投影派生实际生效的预设。该单元折叠会话的沙箱模式、审批策略和已记录选择;状态内部的缺失值回退到执行器配置的模式与审批服务配置,最后回退到 `ask`。注册表或投影 key 缺失时会显式失败。服务优先取仍然匹配的选择,其次取声明顺序中第一个匹配的表项,否则返回 `CUSTOM_PRESET`(`'custom'`)。`custom` 只是派生值:客户端可以把它显示为当前值,但它绝不是切换目标,也绝不出现在事件 payload 中。
|
|
49
49
|
|
|
50
50
|
`names` 按预设表声明顺序列出可切换的预设;`optionOf(name)` 为某个表键(label 回退为该键)或 `custom` 构建客户端渲染的选项,传入其他任何名称都会抛出异常。
|
|
51
51
|
|
|
@@ -65,7 +65,7 @@ interface PresetOption {
|
|
|
65
65
|
|
|
66
66
|
`set(session, name)` 解析预设(未知名称抛出异常),在 `name` 尚不是生效预设时追加一条仅记日志的 `permission/preset` 事件,然后通过各旋钮自己的 setter([dsh-sandbox-policy](../../packages/sandbox/sandbox-policy) 的 `setSandboxMode` 与 [dsh-user-approval](../../packages/interaction/user-approval) 的 `setApprovalPolicy`)写入,且仅当该 knob的生效值发生变化时才写。同一轮次内,选择事件先于旋钮事件出现;重新选择当前生效的预设则什么都不追加。
|
|
67
67
|
|
|
68
|
-
`permission/preset` 是持久、仅记日志的用户意图:它不进入模型 transcript(文本记录),模型可见的后果由 knob 事件经各自消费方承担;它存在是为了在两个预设共享同一个旋钮组合时,让 `current()`
|
|
68
|
+
`permission/preset` 是持久、仅记日志的用户意图:它不进入模型 transcript(文本记录),模型可见的后果由 knob 事件经各自消费方承担;它存在是为了在两个预设共享同一个旋钮组合时,让 `current()` 仍能保住用户选择的究竟是哪一个预设。`permissions` 投影把该选择与两个 knob 事件一同折叠,并保留用于区分空恢复 seed 与新会话的 `session/end-seed` 边界;回放不需要任何追赶状态或原始日志重扫。完整事件声明见[持久化日志事件目录](../persistence-catalog.zh.md);方法签名见生成的[服务目录](#ctxpermissionpresets--permissionpresetservice)。
|
|
69
69
|
|
|
70
70
|
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
|
|
71
71
|
|
|
@@ -73,7 +73,7 @@ interface PresetOption {
|
|
|
73
73
|
|
|
74
74
|
## Cordis API
|
|
75
75
|
|
|
76
|
-
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`) —
|
|
76
|
+
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).
|
|
77
77
|
|
|
78
78
|
<a id="ctxpermissionpresets--permissionpresetservice"></a>
|
|
79
79
|
|
|
@@ -86,10 +86,10 @@ Owns the deployment's permission presets and their write path. Requires a confin
|
|
|
86
86
|
* Resolve the preset matching the effective knob values. A still-matching
|
|
87
87
|
* last selection wins shared-bundle ties; otherwise the first table match
|
|
88
88
|
* wins, or {@link CUSTOM_PRESET} when no entry matches.
|
|
89
|
-
* @param
|
|
89
|
+
* @param session - the session whose knob state is read.
|
|
90
90
|
* @returns the effective preset name, or `custom` when nothing matches.
|
|
91
91
|
*/
|
|
92
|
-
current(
|
|
92
|
+
current(session: Session): string
|
|
93
93
|
|
|
94
94
|
/**
|
|
95
95
|
* Build the whole select value for one folded knob state: every table
|
|
@@ -125,7 +125,7 @@ optionOf(name: string): PresetOption
|
|
|
125
125
|
set(session: Session, name: string): void
|
|
126
126
|
```
|
|
127
127
|
|
|
128
|
-
Types: [Session](session.
|
|
128
|
+
Types: [Session](session.zh.md)
|
|
129
129
|
|
|
130
|
-
Source: [`packages/interaction/permission-presets/src/index.ts
|
|
130
|
+
Source: [`packages/interaction/permission-presets/src/index.ts`](../../packages/interaction/permission-presets/src/index.ts)
|
|
131
131
|
<!-- 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/persistence.md
|
|
5
|
-
persistence.md:
|
|
6
|
-
persistence.zh.md:
|
|
5
|
+
persistence.md: cd7eaa126ea16b17526223498d1fa1591792747c
|
|
6
|
+
persistence.zh.md: c96aa87f738e5607c699dfa97e6d2b237767b76d
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
English | [中文](persistence.zh.md)
|
|
4
4
|
|
|
5
|
-
The **durability seam** for the event log. [session.md](session.md) describes the in-memory `Session` — the append-only `SessionEvent` log that is the source of truth. This page describes how that log is made durable: the abstract `SessionPersistence` service, its
|
|
5
|
+
The **durability seam** for the event log. [session.md](session.md) describes the in-memory `Session` — the append-only `SessionEvent` log that is the source of truth. This page describes how that log is made durable: the abstract `SessionPersistence` service, its provider model and shipped JSONL backend, the flush checkpoint, crash recovery, and the metadata header that travels alongside the log. The event vocabulary the log carries is enumerated, member by member, in the generated [persistence log event catalog](../persistence-catalog.md).
|
|
6
6
|
|
|
7
|
-
The seam is a [capability seam](../../.agents/notes/implemented/architecture/2026-06-13-capability-seams.md): one abstract service ([dsh-session-persistence](../../packages/session/session-persistence), `ctx.sessionPersistence`)
|
|
7
|
+
The seam is a [capability seam](../../.agents/notes/implemented/architecture/2026-06-13-capability-seams.md): one abstract service ([dsh-session-persistence](../../packages/session/session-persistence), `ctx.sessionPersistence`) defines locate/create/append, reusable Session preparation, logical load/inspect, physical suffix reads, and lightweight list/snapshot observation over the existing `SessionEvent` — **no parallel persisted event type**. The repository ships [dsh-session-persistence-jsonl](../../packages/session/session-persistence-jsonl) as its provider; out-of-tree providers may implement the same service contract. See the [session-persistence Agent Note](../../.agents/notes/implemented/architecture/2026-06-14-session-persistence.md).
|
|
8
8
|
|
|
9
9
|
## The flush checkpoint
|
|
10
10
|
|
|
@@ -20,7 +20,7 @@ Repair applies only to cold sessions. For a live id, `SessionPersistence.load(id
|
|
|
20
20
|
|
|
21
21
|
## `SessionLocation` — optional per-session artifact target
|
|
22
22
|
|
|
23
|
-
`SessionPersistence.locate(meta)` synchronously resolves a backend-owned independent artifact without reading, creating, or flushing it. JSONL returns the absolute transcript path inside its project/session directory;
|
|
23
|
+
`SessionPersistence.locate(meta)` synchronously resolves a backend-owned independent artifact without reading, creating, or flushing it. JSONL returns the absolute transcript path inside its project/session directory; a backend without one independent artifact per session returns `undefined`. A returned path can therefore name a file that does not yet exist or lacks the current unflushed turn; it is a location hint, not authorization or a freshness guarantee.
|
|
24
24
|
|
|
25
25
|
```ts type-equiv
|
|
26
26
|
/**
|
|
@@ -91,7 +91,7 @@ interface SessionHeader {
|
|
|
91
91
|
|
|
92
92
|
## Format refusal — logs a build cannot faithfully read
|
|
93
93
|
|
|
94
|
-
A backend refuses a log it cannot faithfully interpret with `SessionFormatUnsupportedError`, distinct from `SessionPersistenceCorruptionError` because nothing is damaged. A header `version` ahead of `SESSION_FORMAT_VERSION` names the direction ("written by a newer harness — upgrade the harness to open it"); one behind it states that this build ships no upgrade path. After legacy-shape normalization, an event type outside this build's generated
|
|
94
|
+
A backend refuses a log it cannot faithfully interpret with `SessionFormatUnsupportedError`, distinct from `SessionPersistenceCorruptionError` because nothing is damaged. A header `version` ahead of `SESSION_FORMAT_VERSION` names the direction ("written by a newer harness — upgrade the harness to open it"); one behind it states that this build ships no upgrade path. After legacy-shape normalization, an event type outside this build's generated vocabulary (`KNOWN_SESSION_EVENT_TYPES`, emitted by `gen-persistence-catalog`) refuses the same way unless the event's envelope carries `ignorable: true` — silently skipping an unrecognized required event could change how the rest of the log must be read. The message appends the raw log path when the backend keeps one artifact per session, so the refused text stays reachable. The JSONL backend refuses a foreign version straight from the raw header line, before validating this format version's header shape or decoding any event row — a structurally different future format still reports the upgrade direction, never "corrupt". An out-of-tree backend must enforce the equivalent direction-aware refusal at its own physical-format boundary. Design rationale and the deferred upgrader chain live in the [session-log-version-mechanism note](../../.agents/notes/implemented/architecture/2026-08-10-session-log-version-mechanism.md).
|
|
95
95
|
|
|
96
96
|
## `CreateSessionOptions` — seeding and metadata
|
|
97
97
|
|
|
@@ -126,7 +126,7 @@ Replay/fork is therefore `ctx.sessions.create(id, { seed: seedEvents })`; resumi
|
|
|
126
126
|
|
|
127
127
|
## `SessionRawArtifact` — verbatim stored artifact text
|
|
128
128
|
|
|
129
|
-
A backend's own artifact text for one session, byte-identical to what it durably wrote (decoded from its physical encoding). `readRaw` returns it without reconstructing from parsed events, so backend-specific serialization (chunk packing, key order, line breaks) survives. Consumers first test `supportsRawArtifacts`: `false` means the backend does not provide this capability
|
|
129
|
+
A backend's own artifact text for one session, byte-identical to what it durably wrote (decoded from its physical encoding). `readRaw` returns it without reconstructing from parsed events, so backend-specific serialization (chunk packing, key order, line breaks) survives. Consumers first test `supportsRawArtifacts`: `false` means the backend does not provide this capability, while `readRaw(...) === undefined` means a supported backend has no materialized artifact for that session.
|
|
130
130
|
|
|
131
131
|
```ts type-equiv
|
|
132
132
|
/** A backend's own raw artifact text for one session, verbatim. */
|
|
@@ -228,12 +228,11 @@ interface SessionPersistenceSnapshot {
|
|
|
228
228
|
}
|
|
229
229
|
```
|
|
230
230
|
|
|
231
|
-
## The
|
|
231
|
+
## The backend
|
|
232
232
|
|
|
233
|
-
|
|
233
|
+
The shipped provider implements the abstract `SessionPersistence` contract (locate/create/append/prepare/load/inspect/readFrom/list/listSnapshots over `SessionEvent`, with optional cancellation on observation methods) and passes the shared `runPersistenceContract` suite:
|
|
234
234
|
|
|
235
235
|
- **[dsh-session-persistence-jsonl](../../packages/session/session-persistence-jsonl)** — an append-only logical JSONL log per session, stored as checksummed concatenated Zstandard frames by default or raw lines by configuration, with crash-safe atomic writes, interrupted-turn recovery, and a read/replay path.
|
|
236
|
-
- **[dsh-session-persistence-sqlite](../../packages/session/session-persistence-sqlite)** — `node:sqlite`, one row per `SessionEvent`. The row fields `(session_id, seq, type, time, data, source_event_seqs, surface_op)` map 1:1 onto the event, including optional surface metadata, so there is no parallel persisted schema to keep in sync.
|
|
237
236
|
|
|
238
237
|
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
|
|
239
238
|
|
|
@@ -241,7 +240,7 @@ Both implement the same abstract `SessionPersistence` (locate/create/append/prep
|
|
|
241
240
|
|
|
242
241
|
## Cordis API
|
|
243
242
|
|
|
244
|
-
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`) —
|
|
243
|
+
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).
|
|
245
244
|
|
|
246
245
|
<a id="ctxsessionpersistence--sessionpersistence-abstract-seam"></a>
|
|
247
246
|
|
|
@@ -252,8 +251,8 @@ Durable append-only session storage. Implementations preserve contiguous, lossle
|
|
|
252
251
|
```ts cordis-catalog
|
|
253
252
|
/**
|
|
254
253
|
* Resolve this backend's independent local artifact for a session without
|
|
255
|
-
* reading, creating, flushing, or otherwise materializing it.
|
|
256
|
-
*
|
|
254
|
+
* reading, creating, flushing, or otherwise materializing it. A backend
|
|
255
|
+
* that does not own one artifact per Session returns `undefined`.
|
|
257
256
|
* @param meta - the immutable session header whose artifact is requested.
|
|
258
257
|
* @returns the backend-specific absolute location, when one exists.
|
|
259
258
|
*/
|
|
@@ -285,6 +284,14 @@ readRaw(_id: SessionId, signal?: AbortSignal): Promise<SessionRawArtifact | unde
|
|
|
285
284
|
*/
|
|
286
285
|
abstract create(meta: SessionHeader): Promise<void>
|
|
287
286
|
|
|
287
|
+
/**
|
|
288
|
+
* Ensure a live session has a durable header even when it has no events.
|
|
289
|
+
* Ordinary sessions remain lazily materialized; lifecycle frontends call
|
|
290
|
+
* this only when an empty session itself is a durable resumable resource.
|
|
291
|
+
* @param _session - exact live session whose registered header is materialized.
|
|
292
|
+
*/
|
|
293
|
+
ensureMaterialized(_session: Session): Promise<void>
|
|
294
|
+
|
|
288
295
|
/**
|
|
289
296
|
* Durably persist a batch of events. Honors the append-only and contiguous-
|
|
290
297
|
* seq contracts: the first event's `seq` MUST equal the stored next-seq
|
|
@@ -339,6 +346,17 @@ abstract load(id: SessionId): Promise<SessionInspection>
|
|
|
339
346
|
*/
|
|
340
347
|
abstract inspect(id: SessionId, signal?: AbortSignal): Promise<SessionInspection>
|
|
341
348
|
|
|
349
|
+
/**
|
|
350
|
+
* Borrow one exact inspection while retaining any reusable prepared source.
|
|
351
|
+
* A cold observation must pin the exact prepared Session that a later
|
|
352
|
+
* {@link prepare} reserves. Implementations must not degrade this operation
|
|
353
|
+
* to a detached {@link inspect} result.
|
|
354
|
+
* @param id - persisted session to observe.
|
|
355
|
+
* @param signal - optional cancellation for preparation work.
|
|
356
|
+
* @returns a disposable immutable observation.
|
|
357
|
+
*/
|
|
358
|
+
abstract borrowSession(id: SessionId, signal?: AbortSignal): Promise<BorrowedSessionSource>
|
|
359
|
+
|
|
342
360
|
/**
|
|
343
361
|
* Read the stored events from `fromSeq` onward — the read-from-seq
|
|
344
362
|
* primitive for read models that resume from a watermark (e.g. a persisted
|
|
@@ -348,10 +366,10 @@ abstract inspect(id: SessionId, signal?: AbortSignal): Promise<SessionInspection
|
|
|
348
366
|
* publication. Only events from the valid contiguous stored prefix are
|
|
349
367
|
* returned, so a torn fragment never reaches the caller. `fromSeq` at or
|
|
350
368
|
* beyond the stored prefix returns an empty event list (never an error).
|
|
351
|
-
*
|
|
352
|
-
*
|
|
353
|
-
*
|
|
354
|
-
*
|
|
369
|
+
* A backend whose medium can seek by seq may read only the suffix;
|
|
370
|
+
* sequential media such as JSONL still parse the whole artifact and skip
|
|
371
|
+
* forward. The primitive bounds what is returned and refolded, not every
|
|
372
|
+
* backend's physical read.
|
|
355
373
|
* @param id - the persisted session to read.
|
|
356
374
|
* @param fromSeq - first event seq to include; a non-negative safe integer.
|
|
357
375
|
* @param signal - optional cancellation for queued and backend read work.
|
|
@@ -379,7 +397,7 @@ abstract list(signal?: AbortSignal): Promise<SessionHeader[]>
|
|
|
379
397
|
abstract listSnapshots(signal?: AbortSignal): Promise<SessionPersistenceSnapshot[]>
|
|
380
398
|
```
|
|
381
399
|
|
|
382
|
-
Types: [SessionEvent](session.md) · [SessionId](core.md)
|
|
400
|
+
Types: [Session](session.md) · [SessionEvent](session.md) · [SessionId](core.md)
|
|
383
401
|
|
|
384
|
-
Source: [`packages/session/session-persistence/src/index.ts
|
|
402
|
+
Source: [`packages/session/session-persistence/src/index.ts`](../../packages/session/session-persistence/src/index.ts)
|
|
385
403
|
<!-- END GENERATED cordis-surface -->
|
|
@@ -2,25 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
[English](persistence.md) | 中文
|
|
4
4
|
|
|
5
|
-
事件日志的**持久性 seam**。[session.md](session.md) 描述了内存中的 `Session`:仅追加的 `SessionEvent` 日志即为真源。本页描述如何使该日志持久化:抽象的 `SessionPersistence`
|
|
5
|
+
事件日志的**持久性 seam**。[session.md](session.zh.md) 描述了内存中的 `Session`:仅追加的 `SessionEvent` 日志即为真源。本页描述如何使该日志持久化:抽象的 `SessionPersistence` 服务、它的提供方模型与随产品交付的 JSONL 后端、flush 检查点、崩溃恢复,以及随日志一同存储的元数据头。日志承载的事件词汇在生成的[持久化日志事件目录](../persistence-catalog.zh.md)中逐项列举。
|
|
6
6
|
|
|
7
|
-
该 seam 是一个[能力 seam](../../.agents/notes/implemented/architecture/2026-06-13-capability-seams.md):一个抽象服务([dsh-session-persistence](../../packages/session/session-persistence),`ctx.sessionPersistence`)在现有 `SessionEvent` 上定义 locate/create/append、可复用的 Session 准备流程、逻辑 load/inspect、物理后缀读取,以及轻量的 list/snapshot
|
|
7
|
+
该 seam 是一个[能力 seam](../../.agents/notes/implemented/architecture/2026-06-13-capability-seams.zh.md):一个抽象服务([dsh-session-persistence](../../packages/session/session-persistence),`ctx.sessionPersistence`)在现有 `SessionEvent` 上定义 locate/create/append、可复用的 Session 准备流程、逻辑 load/inspect、物理后缀读取,以及轻量的 list/snapshot 观察——**没有平行的持久化事件类型**。仓库随产品交付 [dsh-session-persistence-jsonl](../../packages/session/session-persistence-jsonl) 作为提供方;仓库外提供方可以实现同一服务约定。见 [session-persistence Agent Note](../../.agents/notes/implemented/architecture/2026-06-14-session-persistence.zh.md)。
|
|
8
8
|
|
|
9
9
|
## flush 检查点
|
|
10
10
|
|
|
11
|
-
`session/event` 是一个*同步*通知;持久化插件会将事件复制到逐会话控制器,而不阻塞生产方。第一个待处理事件会开启固定批处理窗口,后续事件会加入但不会重置截止时间。窗口到期后会启动一个持久化批次;该次写入期间接纳的事件会获得自己的截止时间,并形成后续批次。`session/flush` 会取消等待并排空至完全停稳,因此循环仍将其用作在领取下一个普通轮次之前的顺序与错误观察检查点。后台写入被拒绝时会保留对应事件并暂停自动重试;新事件会开启新的固定窗口,而显式 flush 会立即重试,并通过 `agent/error` 和 logger 报告失败,绝不会把失败记录成已关闭轮次之后的会话事件。dispose(资源释放)会执行同样的最终排空。配置的最大值只限制有意的批处理等待,不限制事件循环调度或后端完成持久化的延迟([决策](../../.agents/notes/implemented/architecture/2026-08-08-bounded-session-persistence-write-batching.md))。
|
|
11
|
+
`session/event` 是一个*同步*通知;持久化插件会将事件复制到逐会话控制器,而不阻塞生产方。第一个待处理事件会开启固定批处理窗口,后续事件会加入但不会重置截止时间。窗口到期后会启动一个持久化批次;该次写入期间接纳的事件会获得自己的截止时间,并形成后续批次。`session/flush` 会取消等待并排空至完全停稳,因此循环仍将其用作在领取下一个普通轮次之前的顺序与错误观察检查点。后台写入被拒绝时会保留对应事件并暂停自动重试;新事件会开启新的固定窗口,而显式 flush 会立即重试,并通过 `agent/error` 和 logger 报告失败,绝不会把失败记录成已关闭轮次之后的会话事件。dispose(资源释放)会执行同样的最终排空。配置的最大值只限制有意的批处理等待,不限制事件循环调度或后端完成持久化的延迟([决策](../../.agents/notes/implemented/architecture/2026-08-08-bounded-session-persistence-write-batching.zh.md))。
|
|
12
12
|
|
|
13
13
|
## 崩溃恢复保留被中断的轮次
|
|
14
14
|
|
|
15
|
-
后端重新加载一个在轮次中途崩溃的日志时,会发现一个已打开的 `turn/start` 却没有 `turn/end`。它**不会**截断日志:在长周期任务中,单个轮次可能非常庞大(许多步骤、大量工具输出),而这些事件在崩溃前已被持久追加。后端改为用一个合成的 `turn/end { reason: { kind: 'interrupted' } }` 关闭这个遗留轮次,在不改变其前后任何独立事件的情况下配平被中断的执行。`interrupted` 是唯一一个不由循环发出的 `TurnEndReason`(见 [session.md](session.md#why-a-turn-ended-turnendreasonmap))。
|
|
15
|
+
后端重新加载一个在轮次中途崩溃的日志时,会发现一个已打开的 `turn/start` 却没有 `turn/end`。它**不会**截断日志:在长周期任务中,单个轮次可能非常庞大(许多步骤、大量工具输出),而这些事件在崩溃前已被持久追加。后端改为用一个合成的 `turn/end { reason: { kind: 'interrupted' } }` 关闭这个遗留轮次,在不改变其前后任何独立事件的情况下配平被中断的执行。`interrupted` 是唯一一个不由循环发出的 `TurnEndReason`(见 [session.md](session.zh.md#why-a-turn-ended-turnendreasonmap))。
|
|
16
16
|
|
|
17
17
|
修复仅适用于冷会话。对于活跃 id,`SessionPersistence.load(id)` 会等待权威内存快照完成持久化,并且只在日志平衡时返回;若活跃轮次仍未闭合,则拒绝操作,而不是添加合成的中断边界。HMR(热模块替换)会接管活跃前缀,而不会关闭其中正在进行的轮次。
|
|
18
18
|
|
|
19
|
-
`SessionPersistence.inspect(id)` 会构造一个不可变的逻辑 Session,但不发布它,也不写入恢复内容。冷检查会在内存中配平中断的轮次,同时保持撕裂的物理尾部不变;检查已处于活跃状态的 Session 则借用其当前不可变快照,因此可能包含未闭合的轮次。使用协调器的实现会在有界 LRU 中保留这个精确的冷未发布 Session,因此重复历史读取与后续 `prepare(id)` 可复用同一次读取、解压、验证、冻结及 Session 构造。`prepare(id)` 会预留该 Session、提交待处理修复并返回可 dispose 的发布句柄;`load(id)` 使用相同机制提交修复,但不会发布 Session。该生命周期由 [Session 准备阶段决策](../../.agents/notes/implemented/architecture/2026-08-05-session-preparation.md)定义。
|
|
19
|
+
`SessionPersistence.inspect(id)` 会构造一个不可变的逻辑 Session,但不发布它,也不写入恢复内容。冷检查会在内存中配平中断的轮次,同时保持撕裂的物理尾部不变;检查已处于活跃状态的 Session 则借用其当前不可变快照,因此可能包含未闭合的轮次。使用协调器的实现会在有界 LRU 中保留这个精确的冷未发布 Session,因此重复历史读取与后续 `prepare(id)` 可复用同一次读取、解压、验证、冻结及 Session 构造。`prepare(id)` 会预留该 Session、提交待处理修复并返回可 dispose 的发布句柄;`load(id)` 使用相同机制提交修复,但不会发布 Session。该生命周期由 [Session 准备阶段决策](../../.agents/notes/implemented/architecture/2026-08-05-session-preparation.zh.md)定义。
|
|
20
20
|
|
|
21
21
|
## `SessionLocation`——可选的逐会话产物目标
|
|
22
22
|
|
|
23
|
-
`SessionPersistence.locate(meta)` 会同步解析一个归后端所有的独立产物,而不会读取、创建或 flush 它。JSONL 返回其项目/会话目录内 transcript
|
|
23
|
+
`SessionPersistence.locate(meta)` 会同步解析一个归后端所有的独立产物,而不会读取、创建或 flush 它。JSONL 返回其项目/会话目录内 transcript(文本记录)的绝对路径;不为每个会话各自拥有独立产物的后端返回 `undefined`。因此,返回的路径可能指向尚不存在的文件,或指向还不包含当前尚未 flush 轮次的文件;它是位置提示,不是授权或新鲜度保证。
|
|
24
24
|
|
|
25
25
|
```ts type-equiv
|
|
26
26
|
/**
|
|
@@ -91,7 +91,7 @@ interface SessionHeader {
|
|
|
91
91
|
|
|
92
92
|
## 格式拒绝:本构建无法可靠读取的日志
|
|
93
93
|
|
|
94
|
-
后端用 `SessionFormatUnsupportedError` 拒绝无法可靠解读的日志,它与 `SessionPersistenceCorruptionError` 区分,因为数据没有损坏。header 的 `version` 比 `SESSION_FORMAT_VERSION` 新时,消息说明方向("由更新的 harness 写入,请升级 harness 后打开");比它旧时说明本构建没有升级路径。经过 legacy
|
|
94
|
+
后端用 `SessionFormatUnsupportedError` 拒绝无法可靠解读的日志,它与 `SessionPersistenceCorruptionError` 区分,因为数据没有损坏。header 的 `version` 比 `SESSION_FORMAT_VERSION` 新时,消息说明方向("由更新的 harness 写入,请升级 harness 后打开");比它旧时说明本构建没有升级路径。经过 legacy 形状归一化后,本构建生成词汇表(`KNOWN_SESSION_EVENT_TYPES`,由 `gen-persistence-catalog` 生成)之外的事件类型同样被拒绝,除非该事件的信封带 `ignorable: true`:静默跳过一个不认识的必需事件可能改变日志其余部分的解读方式。后端为每个会话保留独立文件时,消息附上原始日志路径,被拒绝的文本仍然可读。JSONL 后端直接从原始 header 行拒绝外来版本,先于本格式版本的 header 形状校验和任何事件行解码,因此结构完全不同的未来格式仍会报告升级方向,绝不会报"损坏"。仓库外后端必须在自己的物理格式入口执行等价的方向感知拒绝。设计理由与推迟建设的升级器链见 [session-log 版本机制 Agent Note](../../.agents/notes/implemented/architecture/2026-08-10-session-log-version-mechanism.zh.md)。
|
|
95
95
|
|
|
96
96
|
## `CreateSessionOptions`:seed 与元数据
|
|
97
97
|
|
|
@@ -126,7 +126,7 @@ interface CreateSessionOptions {
|
|
|
126
126
|
|
|
127
127
|
## `SessionRawArtifact`——逐字存储工件文本
|
|
128
128
|
|
|
129
|
-
后端为单个会话自持的工件文本,与其持久化写入的字节逐字一致(按物理编码解码)。`readRaw` 返回它而不从解析后事件重建,因此后端特定的序列化(chunk 打包、键序、换行)得以保留。Consumer 须先检查 `supportsRawArtifacts`:`false`
|
|
129
|
+
后端为单个会话自持的工件文本,与其持久化写入的字节逐字一致(按物理编码解码)。`readRaw` 返回它而不从解析后事件重建,因此后端特定的序列化(chunk 打包、键序、换行)得以保留。Consumer 须先检查 `supportsRawArtifacts`:`false` 表示后端不提供此能力,而 `readRaw(...) === undefined` 表示受支持的后端没有该会话的已实体化工件。
|
|
130
130
|
|
|
131
131
|
```ts type-equiv
|
|
132
132
|
/** A backend's own raw artifact text for one session, verbatim. */
|
|
@@ -230,10 +230,9 @@ interface SessionPersistenceSnapshot {
|
|
|
230
230
|
|
|
231
231
|
## 后端
|
|
232
232
|
|
|
233
|
-
|
|
233
|
+
随产品交付的 provider 实现抽象 `SessionPersistence` 约定(在 `SessionEvent` 上执行 locate/create/append/prepare/load/inspect/readFrom/list/listSnapshots,观察方法可选支持取消),并通过共享的 `runPersistenceContract` 套件:
|
|
234
234
|
|
|
235
|
-
- **[dsh-session-persistence-jsonl](../../packages/session/session-persistence-jsonl)
|
|
236
|
-
- **[dsh-session-persistence-sqlite](../../packages/session/session-persistence-sqlite)**:基于 `node:sqlite`,每个 `SessionEvent` 一行。行字段 `(session_id, seq, type, time, data, source_event_seqs, surface_op)` 与事件 1:1 映射(包含可选的 surface 元数据),因此没有需要保持同步的并行持久化 schema。
|
|
235
|
+
- **[dsh-session-persistence-jsonl](../../packages/session/session-persistence-jsonl)**——逐会话仅追加的逻辑 JSONL 日志,默认存储为带 checksum 的连续 Zstandard frame,也可配置为原始行;支持崩溃安全的原子写入、被中断轮次的恢复以及读取/回放路径。
|
|
237
236
|
|
|
238
237
|
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
|
|
239
238
|
|
|
@@ -241,7 +240,7 @@ interface SessionPersistenceSnapshot {
|
|
|
241
240
|
|
|
242
241
|
## Cordis API
|
|
243
242
|
|
|
244
|
-
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`) —
|
|
243
|
+
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).
|
|
245
244
|
|
|
246
245
|
<a id="ctxsessionpersistence--sessionpersistence-abstract-seam"></a>
|
|
247
246
|
|
|
@@ -252,8 +251,8 @@ Durable append-only session storage. Implementations preserve contiguous, lossle
|
|
|
252
251
|
```ts cordis-catalog
|
|
253
252
|
/**
|
|
254
253
|
* Resolve this backend's independent local artifact for a session without
|
|
255
|
-
* reading, creating, flushing, or otherwise materializing it.
|
|
256
|
-
*
|
|
254
|
+
* reading, creating, flushing, or otherwise materializing it. A backend
|
|
255
|
+
* that does not own one artifact per Session returns `undefined`.
|
|
257
256
|
* @param meta - the immutable session header whose artifact is requested.
|
|
258
257
|
* @returns the backend-specific absolute location, when one exists.
|
|
259
258
|
*/
|
|
@@ -285,6 +284,14 @@ readRaw(_id: SessionId, signal?: AbortSignal): Promise<SessionRawArtifact | unde
|
|
|
285
284
|
*/
|
|
286
285
|
abstract create(meta: SessionHeader): Promise<void>
|
|
287
286
|
|
|
287
|
+
/**
|
|
288
|
+
* Ensure a live session has a durable header even when it has no events.
|
|
289
|
+
* Ordinary sessions remain lazily materialized; lifecycle frontends call
|
|
290
|
+
* this only when an empty session itself is a durable resumable resource.
|
|
291
|
+
* @param _session - exact live session whose registered header is materialized.
|
|
292
|
+
*/
|
|
293
|
+
ensureMaterialized(_session: Session): Promise<void>
|
|
294
|
+
|
|
288
295
|
/**
|
|
289
296
|
* Durably persist a batch of events. Honors the append-only and contiguous-
|
|
290
297
|
* seq contracts: the first event's `seq` MUST equal the stored next-seq
|
|
@@ -339,6 +346,17 @@ abstract load(id: SessionId): Promise<SessionInspection>
|
|
|
339
346
|
*/
|
|
340
347
|
abstract inspect(id: SessionId, signal?: AbortSignal): Promise<SessionInspection>
|
|
341
348
|
|
|
349
|
+
/**
|
|
350
|
+
* Borrow one exact inspection while retaining any reusable prepared source.
|
|
351
|
+
* A cold observation must pin the exact prepared Session that a later
|
|
352
|
+
* {@link prepare} reserves. Implementations must not degrade this operation
|
|
353
|
+
* to a detached {@link inspect} result.
|
|
354
|
+
* @param id - persisted session to observe.
|
|
355
|
+
* @param signal - optional cancellation for preparation work.
|
|
356
|
+
* @returns a disposable immutable observation.
|
|
357
|
+
*/
|
|
358
|
+
abstract borrowSession(id: SessionId, signal?: AbortSignal): Promise<BorrowedSessionSource>
|
|
359
|
+
|
|
342
360
|
/**
|
|
343
361
|
* Read the stored events from `fromSeq` onward — the read-from-seq
|
|
344
362
|
* primitive for read models that resume from a watermark (e.g. a persisted
|
|
@@ -348,10 +366,10 @@ abstract inspect(id: SessionId, signal?: AbortSignal): Promise<SessionInspection
|
|
|
348
366
|
* publication. Only events from the valid contiguous stored prefix are
|
|
349
367
|
* returned, so a torn fragment never reaches the caller. `fromSeq` at or
|
|
350
368
|
* beyond the stored prefix returns an empty event list (never an error).
|
|
351
|
-
*
|
|
352
|
-
*
|
|
353
|
-
*
|
|
354
|
-
*
|
|
369
|
+
* A backend whose medium can seek by seq may read only the suffix;
|
|
370
|
+
* sequential media such as JSONL still parse the whole artifact and skip
|
|
371
|
+
* forward. The primitive bounds what is returned and refolded, not every
|
|
372
|
+
* backend's physical read.
|
|
355
373
|
* @param id - the persisted session to read.
|
|
356
374
|
* @param fromSeq - first event seq to include; a non-negative safe integer.
|
|
357
375
|
* @param signal - optional cancellation for queued and backend read work.
|
|
@@ -379,7 +397,7 @@ abstract list(signal?: AbortSignal): Promise<SessionHeader[]>
|
|
|
379
397
|
abstract listSnapshots(signal?: AbortSignal): Promise<SessionPersistenceSnapshot[]>
|
|
380
398
|
```
|
|
381
399
|
|
|
382
|
-
Types: [SessionEvent](session.md) · [SessionId](core.md)
|
|
400
|
+
Types: [Session](session.zh.md) · [SessionEvent](session.zh.md) · [SessionId](core.zh.md)
|
|
383
401
|
|
|
384
|
-
Source: [`packages/session/session-persistence/src/index.ts
|
|
402
|
+
Source: [`packages/session/session-persistence/src/index.ts`](../../packages/session/session-persistence/src/index.ts)
|
|
385
403
|
<!-- 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/plan.md
|
|
5
|
-
plan.md:
|
|
6
|
-
plan.zh.md:
|
|
5
|
+
plan.md: 913a5acb45d0a0be684795cf1ff294ca9d464df1
|
|
6
|
+
plan.zh.md: 98e926346b66a97695fae9516bd87818e764ba01
|
|
@@ -8,7 +8,7 @@ Source: [`packages/plan/plan-mode/src/index.ts`](../../packages/plan/plan-mode/s
|
|
|
8
8
|
|
|
9
9
|
## Logged state and recovery
|
|
10
10
|
|
|
11
|
-
`plan/mode` (`{ active: boolean }`) is a log-only, whole-value-replace [session event](session.md): durable and replayable, never in the model transcript. `
|
|
11
|
+
`plan/mode` (`{ active: boolean }`) is a log-only, whole-value-replace [session event](session.md): durable and replayable, never in the model transcript. The optionally registered `plan` unit folds committed mode, command settlement, and the mode recorded at the latest request header. `ctx.planMode` reads that state through `stateOf()`; the first dependent access fails if the registry, `plan` key, or `turnBoundary` key is absent. Clients receive only `{ active, pending }`; resume, fork, and compaction recover both from the log. The complete event declaration is in the [persistence log event catalog](../persistence-catalog.md).
|
|
12
12
|
|
|
13
13
|
## Pending selections and the pre-step append
|
|
14
14
|
|
|
@@ -44,13 +44,13 @@ When [`ctx.commands`](commands.md) is composed, the plugin registers `/plan [off
|
|
|
44
44
|
|
|
45
45
|
## Cordis API
|
|
46
46
|
|
|
47
|
-
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`) —
|
|
47
|
+
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).
|
|
48
48
|
|
|
49
49
|
<a id="ctxplanmode--planmodecontroller"></a>
|
|
50
50
|
|
|
51
51
|
### `ctx.planMode` — `PlanModeController`
|
|
52
52
|
|
|
53
|
-
`ctx.planMode`: owns logged plan state, applies and narrates selected state at step start, the `plan:policy` section, the `/plan` command, and the stable exit tool.
|
|
53
|
+
`ctx.planMode`: owns logged plan state, applies and narrates selected state at step start, the `plan:policy` section, the `/plan` command, and the stable exit tool. Client carriers expose the projection's cropped `{ active, pending }` view.
|
|
54
54
|
|
|
55
55
|
```ts cordis-catalog
|
|
56
56
|
/**
|
|
@@ -83,5 +83,5 @@ set(agent: Agent, active: boolean): 'committed' | 'queued' | 'cancelled' | 'noop
|
|
|
83
83
|
|
|
84
84
|
Types: [Agent](core.md)
|
|
85
85
|
|
|
86
|
-
Source: [`packages/plan/plan-mode/src/index.ts
|
|
86
|
+
Source: [`packages/plan/plan-mode/src/index.ts`](../../packages/plan/plan-mode/src/index.ts)
|
|
87
87
|
<!-- END GENERATED cordis-surface -->
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
[English](plan.md) | 中文
|
|
4
4
|
|
|
5
|
-
计划模式是 [dsh-plan-mode](../../packages/plan/plan-mode) 拥有的、记录到日志的逐 agent(智能体)协作状态(`ctx.planMode`,`PlanModeController`):激活期间,每个模型请求都会包含一段部署持有的指引。计划模式是**软性指引**。[沙箱模式](sandbox.md)与[审批策略](approval.md)分别强制限制;两者都不读写计划状态,因此部署需要分别配置它们。该包是可选项,agent loop(智能体循环)不依赖它。它贡献 `plan:policy` 提示词段落,并注册 `exit_plan_mode` 工具和 `/plan` 命令。[设计说明](../../.agents/notes/implemented/simplification/2026-07-22-plan-specific-collaboration-state.md)负责决策依据;[包 README](../../packages/plan/plan-mode/README.md)负责模型体验与限制细节。
|
|
5
|
+
计划模式是 [dsh-plan-mode](../../packages/plan/plan-mode) 拥有的、记录到日志的逐 agent(智能体)协作状态(`ctx.planMode`,`PlanModeController`):激活期间,每个模型请求都会包含一段部署持有的指引。计划模式是**软性指引**。[沙箱模式](sandbox.zh.md)与[审批策略](approval.zh.md)分别强制限制;两者都不读写计划状态,因此部署需要分别配置它们。该包是可选项,agent loop(智能体循环)不依赖它。它贡献 `plan:policy` 提示词段落,并注册 `exit_plan_mode` 工具和 `/plan` 命令。[设计说明](../../.agents/notes/implemented/simplification/2026-07-22-plan-specific-collaboration-state.zh.md)负责决策依据;[包 README](../../packages/plan/plan-mode/README.zh.md)负责模型体验与限制细节。
|
|
6
6
|
|
|
7
7
|
源码:[`packages/plan/plan-mode/src/index.ts`](../../packages/plan/plan-mode/src/index.ts)
|
|
8
8
|
|
|
9
9
|
## 已记录状态与恢复
|
|
10
10
|
|
|
11
|
-
`plan/mode`(`{ active: boolean }`)是仅记日志、整值替换的[会话事件](session.md):持久且可回放,绝不进入模型 transcript
|
|
11
|
+
`plan/mode`(`{ active: boolean }`)是仅记日志、整值替换的[会话事件](session.zh.md):持久且可回放,绝不进入模型 transcript(文本记录)。可选注册的 `plan` 单元折叠已提交模式、命令结算结果和最近一次请求头记录的模式。`ctx.planMode` 通过 `stateOf()` 读取该状态;注册表、`plan` key 或 `turnBoundary` key 缺失时,第一次依赖它们的访问会失败。客户端只接收 `{ active, pending }`;恢复、fork 与压缩(compaction)都能从日志恢复两者。完整事件声明见[持久化日志事件目录](../persistence-catalog.zh.md)。
|
|
12
12
|
|
|
13
13
|
## 待生效选择与 pre-step 追加
|
|
14
14
|
|
|
15
15
|
由于每个会话事件都位于轮次之内,用户选择会保持待生效状态,直到下一个被接受的轮内 pre-step 在派生请求之前追加该选择,无论该 pre-step 位于哪个轮次。选择不会强制续行,因此在某轮最后一个被接受的 pre-step 之后作出的选择会在之后的轮次追加。`set(agent, active)` 记录待生效选择(目标值与已记录或已在等待的状态相同时不做任何事),`get(agent)` 返回 `{ active: boolean; pending?: boolean }`:用于组装当前步骤的已记录状态,以及等待追加的已选状态。
|
|
16
16
|
|
|
17
|
-
agent 运行时,唯一的追加点是前置(prepend)注册的 `agent/pre-step` 监听器。它会观察每个候选请求步骤,包括第 1 轮第 1 步和请求恢复重试;它先调用下游监听器,只在下游接受该步骤后追加。提示词准入发生在轮次开启之前,无法追加 `plan/mode`,因此在提示词处作出的选择由它开启的轮次内第一个被接受的 pre-step 追加。追加失败不能阻塞轮次,且该选择会继续等待之后被接受的轮内 pre-step。追加用户选择时还会记录一条插件来源的 `user/message` 通知,但仅当最后记录的请求头描述的是另一种状态时才记录,因此模型恰好在上下文变化时收到通知,且绝不重复。在某轮最后一个被接受的 pre-step 之后作出的选择只存在于进程内;如果进程在另一个被接受的轮内 pre-step 之前退出,该选择会丢失([README 限制](../../packages/plan/plan-mode/README.md#known-limitations-and-deferred-work))。
|
|
17
|
+
agent 运行时,唯一的追加点是前置(prepend)注册的 `agent/pre-step` 监听器。它会观察每个候选请求步骤,包括第 1 轮第 1 步和请求恢复重试;它先调用下游监听器,只在下游接受该步骤后追加。提示词准入发生在轮次开启之前,无法追加 `plan/mode`,因此在提示词处作出的选择由它开启的轮次内第一个被接受的 pre-step 追加。追加失败不能阻塞轮次,且该选择会继续等待之后被接受的轮内 pre-step。追加用户选择时还会记录一条插件来源的 `user/message` 通知,但仅当最后记录的请求头描述的是另一种状态时才记录,因此模型恰好在上下文变化时收到通知,且绝不重复。在某轮最后一个被接受的 pre-step 之后作出的选择只存在于进程内;如果进程在另一个被接受的轮内 pre-step 之前退出,该选择会丢失([README 限制](../../packages/plan/plan-mode/README.zh.md#known-limitations-and-deferred-work))。
|
|
18
18
|
|
|
19
19
|
## 配置
|
|
20
20
|
|
|
@@ -26,13 +26,13 @@ interface PlanModeConfig {
|
|
|
26
26
|
}
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
`section` 缺失、为空白或不是字符串,以及任何未知键,都会在插件加载时失败,而不是被忽略。计划模式激活期间,确切的 `section` 文本以 order 50 渲染为 `plan:policy` [系统提示词段落](system-prompt.md);未激活的计划模式不贡献任何文本。
|
|
29
|
+
`section` 缺失、为空白或不是字符串,以及任何未知键,都会在插件加载时失败,而不是被忽略。计划模式激活期间,确切的 `section` 文本以 order 50 渲染为 `plan:policy` [系统提示词段落](system-prompt.zh.md);未激活的计划模式不贡献任何文本。
|
|
30
30
|
|
|
31
31
|
## 退出工具与 `/plan` 命令
|
|
32
32
|
|
|
33
|
-
[`exit_plan_mode`](../tool-catalog.md#deepseek-aidsh-plan-mode) 在计划模式未激活时仍保持注册,因此进入或离开计划模式只改变提示词段落,绝不改变请求的工具目录;在计划模式之外执行会失败。在计划模式中,它要求一份以 `#` 标题开头的完整 markdown 计划,并通过[用户交互 seam](user-questions.md) 呈交评审。批准返回 `{ approved: true }`,并记录一个静默(不叙述)的待生效退出,由下一个被接受的轮内 pre-step 追加。因此,计划指引在 assistant 当前这批工具调用的剩余部分继续生效,而工具结果本身会报告这次转换。「继续规划」则是一次携带用户反馈的失败调用,模型据此修订并再次呈交;评审期间交互通道缺失或服务重载同样使调用失败,而不是静默离开计划模式。
|
|
33
|
+
[`exit_plan_mode`](../tool-catalog.zh.md#deepseek-aidsh-plan-mode) 在计划模式未激活时仍保持注册,因此进入或离开计划模式只改变提示词段落,绝不改变请求的工具目录;在计划模式之外执行会失败。在计划模式中,它要求一份以 `#` 标题开头的完整 markdown 计划,并通过[用户交互 seam](user-questions.zh.md) 呈交评审。批准返回 `{ approved: true }`,并记录一个静默(不叙述)的待生效退出,由下一个被接受的轮内 pre-step 追加。因此,计划指引在 assistant 当前这批工具调用的剩余部分继续生效,而工具结果本身会报告这次转换。「继续规划」则是一次携带用户反馈的失败调用,模型据此修订并再次呈交;评审期间交互通道缺失或服务重载同样使调用失败,而不是静默离开计划模式。
|
|
34
34
|
|
|
35
|
-
当 [`ctx.commands`](commands.md) 被组合时,插件注册 `/plan [off|message]`:单独的 `/plan` 选择计划模式;任何其他非空消息先选择计划模式,再通过 `agent.steer()` 提交该文本,使其在计划指引下成为下一步骤的普通已记录用户消息;确切参数 `off` 选择未激活,这还会在待生效条目被追加并对请求可见之前将其取消。
|
|
35
|
+
当 [`ctx.commands`](commands.zh.md) 被组合时,插件注册 `/plan [off|message]`:单独的 `/plan` 选择计划模式;任何其他非空消息先选择计划模式,再通过 `agent.steer()` 提交该文本,使其在计划指引下成为下一步骤的普通已记录用户消息;确切参数 `off` 选择未激活,这还会在待生效条目被追加并对请求可见之前将其取消。
|
|
36
36
|
|
|
37
37
|
## 服务
|
|
38
38
|
|
|
@@ -44,13 +44,13 @@ interface PlanModeConfig {
|
|
|
44
44
|
|
|
45
45
|
## Cordis API
|
|
46
46
|
|
|
47
|
-
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`) —
|
|
47
|
+
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).
|
|
48
48
|
|
|
49
49
|
<a id="ctxplanmode--planmodecontroller"></a>
|
|
50
50
|
|
|
51
51
|
### `ctx.planMode` — `PlanModeController`
|
|
52
52
|
|
|
53
|
-
`ctx.planMode`: owns logged plan state, applies and narrates selected state at step start, the `plan:policy` section, the `/plan` command, and the stable exit tool.
|
|
53
|
+
`ctx.planMode`: owns logged plan state, applies and narrates selected state at step start, the `plan:policy` section, the `/plan` command, and the stable exit tool. Client carriers expose the projection's cropped `{ active, pending }` view.
|
|
54
54
|
|
|
55
55
|
```ts cordis-catalog
|
|
56
56
|
/**
|
|
@@ -81,7 +81,7 @@ get(agent: Agent): { active: boolean; pending?: boolean }
|
|
|
81
81
|
set(agent: Agent, active: boolean): 'committed' | 'queued' | 'cancelled' | 'noop'
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
-
Types: [Agent](core.md)
|
|
84
|
+
Types: [Agent](core.zh.md)
|
|
85
85
|
|
|
86
|
-
Source: [`packages/plan/plan-mode/src/index.ts
|
|
86
|
+
Source: [`packages/plan/plan-mode/src/index.ts`](../../packages/plan/plan-mode/src/index.ts)
|
|
87
87
|
<!-- 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/sandbox.md
|
|
5
|
-
sandbox.md:
|
|
6
|
-
sandbox.zh.md:
|
|
5
|
+
sandbox.md: 7160ac699a21a319c991ae70262a8bf61da86b0c
|
|
6
|
+
sandbox.zh.md: 6d2b10d63a0e180bc0fe39cc47930e66dee72466
|
|
@@ -93,6 +93,8 @@ interface SandboxPolicy extends SandboxExecutionPolicy {
|
|
|
93
93
|
}
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
+
<a id="wrapped-argv-and-classification-dialects"></a>
|
|
97
|
+
|
|
96
98
|
## Wrapped argv and classification dialects
|
|
97
99
|
|
|
98
100
|
`RunnerFailureRule` combines evidence that a runner failed before executing the command. A consumer requires a nonzero exit, the optional allowed-exit-code gate, and a case-insensitive fatal signature within one remaining stderr line. Case-insensitive exact full-line informational exclusions are removed first, so a benign runner notice cannot prove failure by itself. The matched line remains available as error detail; classification does not rewrite stderr.
|
|
@@ -161,7 +163,7 @@ Provider selection, probing, caching, and backend-specific enforcement reports b
|
|
|
161
163
|
|
|
162
164
|
## Cordis API
|
|
163
165
|
|
|
164
|
-
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`) —
|
|
166
|
+
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).
|
|
165
167
|
|
|
166
168
|
<a id="ctxsandbox--sandboxprovider-abstract-seam"></a>
|
|
167
169
|
|
|
@@ -184,7 +186,7 @@ Abstract process-sandbox service. confine must return enforcing argv or fail clo
|
|
|
184
186
|
abstract confine(argv: readonly string[], policy: SandboxPolicy): ConfinedArgv
|
|
185
187
|
```
|
|
186
188
|
|
|
187
|
-
Source: [`packages/sandbox/sandbox/src/index.ts
|
|
189
|
+
Source: [`packages/sandbox/sandbox/src/index.ts`](../../packages/sandbox/sandbox/src/index.ts)
|
|
188
190
|
|
|
189
191
|
<a id="ctxsandboxpolicy--sandboxpolicyservice"></a>
|
|
190
192
|
|
|
@@ -214,5 +216,5 @@ overrideOf(session: Session): SandboxMode | undefined
|
|
|
214
216
|
|
|
215
217
|
Types: [Session](session.md)
|
|
216
218
|
|
|
217
|
-
Source: [`packages/sandbox/sandbox-policy/src/index.ts
|
|
219
|
+
Source: [`packages/sandbox/sandbox-policy/src/index.ts`](../../packages/sandbox/sandbox-policy/src/index.ts)
|
|
218
220
|
<!-- END GENERATED cordis-surface -->
|
|
@@ -93,6 +93,8 @@ interface SandboxPolicy extends SandboxExecutionPolicy {
|
|
|
93
93
|
}
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
+
<a id="wrapped-argv-and-classification-dialects"></a>
|
|
97
|
+
|
|
96
98
|
## 包装后的 argv 与分类方言
|
|
97
99
|
|
|
98
100
|
`RunnerFailureRule` 汇集用于判定 runner 在执行命令前失败的证据。消费方要求进程以非零状态退出,并同时满足可选的允许退出码门控,以及余下某一 stderr 行中不区分大小写的致命签名。系统会先按不区分大小写的整行精确匹配移除信息性排除项,因此无害的 runner 通知本身不能证明失败。匹配到的行仍可用作错误详情;分类过程不会重写 stderr。
|
|
@@ -147,13 +149,13 @@ interface ConfinedArgv {
|
|
|
147
149
|
}
|
|
148
150
|
```
|
|
149
151
|
|
|
150
|
-
[本地提供方](../../packages/sandbox/sandbox-local/README.md)拥有运维配置,并将其 runner 方言映射到这些规则。[沙箱化 bash 消费方](../../packages/shell/bash-sandbox/README.md)拥有 spawn 与结果归因。
|
|
152
|
+
[本地提供方](../../packages/sandbox/sandbox-local/README.zh.md)拥有运维配置,并将其 runner 方言映射到这些规则。[沙箱化 bash 消费方](../../packages/shell/bash-sandbox/README.zh.md)拥有 spawn 与结果归因。
|
|
151
153
|
|
|
152
154
|
## 提供方与 fail-closed 错误
|
|
153
155
|
|
|
154
156
|
`ctx.sandbox.confine(argv, policy)` 返回一个 `ConfinedArgv`,或在没有可用后端时抛出 `SandboxUnavailableError`(错误码 `SANDBOX_UNAVAILABLE`)。消费方也可以在 spawn 或观察所返回的 argv 时对失败进行分类;该归因属于消费方约定。对于受限策略,静默的无隔离透传永远不合法。
|
|
155
157
|
|
|
156
|
-
提供方选择、探测、缓存和后端特定的强制执行报告归[本地提供方](../../packages/sandbox/sandbox-local/README.md)所有。
|
|
158
|
+
提供方选择、探测、缓存和后端特定的强制执行报告归[本地提供方](../../packages/sandbox/sandbox-local/README.zh.md)所有。
|
|
157
159
|
|
|
158
160
|
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
|
|
159
161
|
|
|
@@ -161,7 +163,7 @@ interface ConfinedArgv {
|
|
|
161
163
|
|
|
162
164
|
## Cordis API
|
|
163
165
|
|
|
164
|
-
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`) —
|
|
166
|
+
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).
|
|
165
167
|
|
|
166
168
|
<a id="ctxsandbox--sandboxprovider-abstract-seam"></a>
|
|
167
169
|
|
|
@@ -184,7 +186,7 @@ Abstract process-sandbox service. confine must return enforcing argv or fail clo
|
|
|
184
186
|
abstract confine(argv: readonly string[], policy: SandboxPolicy): ConfinedArgv
|
|
185
187
|
```
|
|
186
188
|
|
|
187
|
-
Source: [`packages/sandbox/sandbox/src/index.ts
|
|
189
|
+
Source: [`packages/sandbox/sandbox/src/index.ts`](../../packages/sandbox/sandbox/src/index.ts)
|
|
188
190
|
|
|
189
191
|
<a id="ctxsandboxpolicy--sandboxpolicyservice"></a>
|
|
190
192
|
|
|
@@ -212,7 +214,7 @@ resolve(request: SandboxPolicyRequest = {}): SandboxExecutionPolicy
|
|
|
212
214
|
overrideOf(session: Session): SandboxMode | undefined
|
|
213
215
|
```
|
|
214
216
|
|
|
215
|
-
Types: [Session](session.md)
|
|
217
|
+
Types: [Session](session.zh.md)
|
|
216
218
|
|
|
217
|
-
Source: [`packages/sandbox/sandbox-policy/src/index.ts
|
|
219
|
+
Source: [`packages/sandbox/sandbox-policy/src/index.ts`](../../packages/sandbox/sandbox-policy/src/index.ts)
|
|
218
220
|
<!-- END GENERATED cordis-surface -->
|