dsh-plugin-guide 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.es.md +1 -1
- package/README.hi.md +1 -1
- package/README.md +1 -1
- package/README.pt.md +1 -1
- package/README.zh.md +1 -1
- package/SKILL.md +1 -1
- package/dist/dsh-plugin-dev.js +5 -5
- package/guide/links.md +1 -1
- package/guide/plugin-dev-guide.md +1 -1
- package/guide/quick-reference.es.md +2 -2
- package/guide/quick-reference.hi.md +1 -1
- package/guide/quick-reference.md +2 -2
- package/guide/quick-reference.pt.md +2 -2
- package/guide/quick-reference.zh-CN.md +2 -2
- package/package.json +3 -3
- package/references/cordis-paper-and-community.md +1 -1
- package/references/official-docs/AGENTS.md +28 -23
- package/references/official-docs/README.i18n.yaml +2 -2
- package/references/official-docs/README.md +1 -1
- package/references/official-docs/README.zh.md +19 -9
- package/references/official-docs/SNAPSHOT.md +5 -5
- package/references/official-docs/THIRD_PARTY_NOTICES.md +36 -13
- package/references/official-docs/docs/AGENTS.md +4 -4
- package/references/official-docs/docs/agent-lifecycle.i18n.yaml +2 -2
- package/references/official-docs/docs/agent-lifecycle.md +1 -1
- package/references/official-docs/docs/agent-lifecycle.zh.md +2 -2
- package/references/official-docs/docs/api-gateway.i18n.yaml +2 -2
- package/references/official-docs/docs/api-gateway.md +8 -8
- package/references/official-docs/docs/api-gateway.zh.md +8 -8
- package/references/official-docs/docs/architecture.i18n.yaml +2 -2
- package/references/official-docs/docs/architecture.md +25 -8
- package/references/official-docs/docs/architecture.zh.md +38 -21
- package/references/official-docs/docs/capability-seams.i18n.yaml +2 -2
- package/references/official-docs/docs/capability-seams.md +134 -67
- package/references/official-docs/docs/capability-seams.zh.md +134 -67
- package/references/official-docs/docs/config-catalog.i18n.yaml +2 -2
- package/references/official-docs/docs/config-catalog.md +731 -403
- package/references/official-docs/docs/config-catalog.zh.md +747 -419
- package/references/official-docs/docs/cookbook/adding-a-package.i18n.yaml +2 -2
- package/references/official-docs/docs/cookbook/adding-a-package.md +3 -4
- package/references/official-docs/docs/cookbook/adding-a-package.zh.md +9 -8
- package/references/official-docs/docs/cookbook/{adding-a-conversation-node.i18n.yaml → adding-a-remote-api.i18n.yaml} +3 -3
- package/references/official-docs/docs/cookbook/adding-a-remote-api.md +197 -0
- package/references/official-docs/docs/cookbook/adding-a-remote-api.zh.md +197 -0
- package/references/official-docs/docs/cookbook/adding-a-settings-card.i18n.yaml +6 -0
- package/references/official-docs/docs/cookbook/adding-a-settings-card.md +102 -0
- package/references/official-docs/docs/cookbook/adding-a-settings-card.zh.md +102 -0
- package/references/official-docs/docs/cookbook/adding-a-tool.i18n.yaml +2 -2
- package/references/official-docs/docs/cookbook/adding-a-tool.md +11 -4
- package/references/official-docs/docs/cookbook/adding-a-tool.zh.md +16 -9
- package/references/official-docs/docs/cookbook/adding-a-vendored-package.i18n.yaml +2 -2
- package/references/official-docs/docs/cookbook/adding-a-vendored-package.md +2 -2
- package/references/official-docs/docs/cookbook/adding-a-vendored-package.zh.md +4 -4
- package/references/official-docs/docs/cookbook/adding-an-llm-adapter.i18n.yaml +2 -2
- package/references/official-docs/docs/cookbook/adding-an-llm-adapter.md +1 -1
- package/references/official-docs/docs/cookbook/adding-an-llm-adapter.zh.md +3 -3
- package/references/official-docs/docs/cookbook/extension-cookbook.i18n.yaml +2 -2
- package/references/official-docs/docs/cookbook/extension-cookbook.md +9 -8
- package/references/official-docs/docs/cookbook/extension-cookbook.zh.md +17 -14
- package/references/official-docs/docs/cookbook/maintaining-dsh-code-review.i18n.yaml +1 -1
- package/references/official-docs/docs/cookbook/maintaining-dsh-code-review.zh.md +1 -1
- package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.i18n.yaml +1 -1
- package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.zh.md +1 -1
- package/references/official-docs/docs/cordis-api/context.i18n.yaml +1 -1
- package/references/official-docs/docs/cordis-api/context.zh.md +1 -1
- package/references/official-docs/docs/cordis-api/events.i18n.yaml +1 -1
- package/references/official-docs/docs/cordis-api/events.zh.md +1 -1
- package/references/official-docs/docs/cordis-api/inherited.md +1 -1
- package/references/official-docs/docs/cordis-primer.i18n.yaml +2 -2
- package/references/official-docs/docs/cordis-primer.md +2 -1
- package/references/official-docs/docs/cordis-primer.zh.md +3 -2
- package/references/official-docs/docs/cordis-tutorial/01-first-plugin.i18n.yaml +1 -1
- package/references/official-docs/docs/cordis-tutorial/01-first-plugin.zh.md +4 -4
- package/references/official-docs/docs/cordis-tutorial/02-lifecycle-and-effects.i18n.yaml +1 -1
- package/references/official-docs/docs/cordis-tutorial/02-lifecycle-and-effects.zh.md +4 -4
- package/references/official-docs/docs/cordis-tutorial/03-services.i18n.yaml +1 -1
- package/references/official-docs/docs/cordis-tutorial/03-services.zh.md +4 -4
- package/references/official-docs/docs/cordis-tutorial/04-events.i18n.yaml +1 -1
- package/references/official-docs/docs/cordis-tutorial/04-events.zh.md +4 -4
- package/references/official-docs/docs/cordis-tutorial/05-config.i18n.yaml +1 -1
- package/references/official-docs/docs/cordis-tutorial/05-config.zh.md +2 -2
- package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.i18n.yaml +1 -1
- package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.zh.md +3 -3
- package/references/official-docs/docs/cordis-tutorial/07-into-the-harness.i18n.yaml +2 -2
- package/references/official-docs/docs/cordis-tutorial/07-into-the-harness.md +5 -4
- package/references/official-docs/docs/cordis-tutorial/07-into-the-harness.zh.md +11 -10
- package/references/official-docs/docs/cordis-tutorial/index.i18n.yaml +1 -1
- package/references/official-docs/docs/cordis-tutorial/index.zh.md +10 -10
- package/references/official-docs/docs/deepseek-llm-api-wire-extensions.i18n.yaml +6 -0
- package/references/official-docs/docs/deepseek-llm-api-wire-extensions.md +159 -0
- package/references/official-docs/docs/deepseek-llm-api-wire-extensions.zh.md +159 -0
- package/references/official-docs/docs/defensive-patterns.i18n.yaml +1 -1
- package/references/official-docs/docs/defensive-patterns.zh.md +3 -1
- package/references/official-docs/docs/development.i18n.yaml +2 -2
- package/references/official-docs/docs/development.md +9 -13
- package/references/official-docs/docs/development.zh.md +23 -21
- package/references/official-docs/docs/event-producer-consumer.i18n.yaml +2 -2
- package/references/official-docs/docs/event-producer-consumer.md +55 -46
- package/references/official-docs/docs/event-producer-consumer.zh.md +55 -46
- package/references/official-docs/docs/glossary.i18n.yaml +2 -2
- package/references/official-docs/docs/glossary.md +1 -1
- package/references/official-docs/docs/glossary.zh.md +1 -1
- package/references/official-docs/docs/graph-atlas.i18n.yaml +2 -2
- package/references/official-docs/docs/graph-atlas.md +0 -2
- package/references/official-docs/docs/graph-atlas.zh.md +7 -9
- package/references/official-docs/docs/i18n/README.i18n.yaml +2 -2
- package/references/official-docs/docs/i18n/README.md +7 -7
- package/references/official-docs/docs/i18n/README.zh.md +11 -9
- package/references/official-docs/docs/i18n/style-samples.md +3 -3
- package/references/official-docs/docs/i18n/translation-prompt.md +3 -3
- package/references/official-docs/docs/i18n/translation-rules.i18n.yaml +2 -2
- package/references/official-docs/docs/i18n/translation-rules.md +2 -2
- package/references/official-docs/docs/i18n/translation-rules.zh.md +3 -3
- package/references/official-docs/docs/module-graph.i18n.yaml +2 -2
- package/references/official-docs/docs/module-graph.md +660 -909
- package/references/official-docs/docs/module-graph.zh.md +662 -911
- package/references/official-docs/docs/persistence-catalog.i18n.yaml +2 -2
- package/references/official-docs/docs/persistence-catalog.md +185 -53
- package/references/official-docs/docs/persistence-catalog.zh.md +193 -61
- package/references/official-docs/docs/postmortem/0001-acp-default-export-drops-inject.i18n.yaml +2 -2
- package/references/official-docs/docs/postmortem/0001-acp-default-export-drops-inject.md +2 -2
- package/references/official-docs/docs/postmortem/0001-acp-default-export-drops-inject.zh.md +3 -3
- package/references/official-docs/docs/postmortem/0002-js-expression-disabled-filesystem-tools.i18n.yaml +2 -2
- package/references/official-docs/docs/postmortem/0002-js-expression-disabled-filesystem-tools.md +2 -2
- package/references/official-docs/docs/postmortem/0002-js-expression-disabled-filesystem-tools.zh.md +2 -2
- package/references/official-docs/docs/postmortem/0003-web-agent-gui-feedback-loop.i18n.yaml +2 -2
- package/references/official-docs/docs/postmortem/0003-web-agent-gui-feedback-loop.md +2 -2
- package/references/official-docs/docs/postmortem/0003-web-agent-gui-feedback-loop.zh.md +2 -2
- package/references/official-docs/docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.i18n.yaml +2 -2
- package/references/official-docs/docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.md +1 -1
- package/references/official-docs/docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.zh.md +2 -2
- package/references/official-docs/docs/postmortem/README.i18n.yaml +1 -1
- package/references/official-docs/docs/postmortem/README.zh.md +5 -5
- package/references/official-docs/docs/rescope.i18n.yaml +2 -2
- package/references/official-docs/docs/rescope.md +2 -2
- package/references/official-docs/docs/rescope.zh.md +3 -3
- package/references/official-docs/docs/subsystems/README.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/README.md +8 -2
- package/references/official-docs/docs/subsystems/README.zh.md +53 -47
- package/references/official-docs/docs/subsystems/agent-team.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/agent-team.md +207 -0
- package/references/official-docs/docs/subsystems/agent-team.zh.md +207 -0
- package/references/official-docs/docs/subsystems/approval.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/approval.md +12 -12
- package/references/official-docs/docs/subsystems/approval.zh.md +13 -13
- package/references/official-docs/docs/subsystems/attachment.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/attachment.md +90 -7
- package/references/official-docs/docs/subsystems/attachment.zh.md +90 -7
- package/references/official-docs/docs/subsystems/client-modules.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/client-modules.md +69 -19
- package/references/official-docs/docs/subsystems/client-modules.zh.md +69 -19
- package/references/official-docs/docs/subsystems/code-runtime.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/code-runtime.md +12 -8
- package/references/official-docs/docs/subsystems/code-runtime.zh.md +13 -9
- package/references/official-docs/docs/subsystems/commands.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/commands.md +30 -7
- package/references/official-docs/docs/subsystems/commands.zh.md +31 -8
- package/references/official-docs/docs/subsystems/compaction.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/compaction.md +14 -14
- package/references/official-docs/docs/subsystems/compaction.zh.md +19 -19
- package/references/official-docs/docs/subsystems/conversation.i18n.yaml +6 -0
- package/references/official-docs/docs/{cookbook/adding-a-conversation-node.md → subsystems/conversation.md} +49 -24
- package/references/official-docs/docs/{cookbook/adding-a-conversation-node.zh.md → subsystems/conversation.zh.md} +49 -24
- package/references/official-docs/docs/subsystems/core.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/core.md +114 -36
- package/references/official-docs/docs/subsystems/core.zh.md +145 -65
- package/references/official-docs/docs/subsystems/credentials.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/credentials.md +207 -11
- package/references/official-docs/docs/subsystems/credentials.zh.md +207 -11
- package/references/official-docs/docs/subsystems/extensions.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/extensions.md +27 -9
- package/references/official-docs/docs/subsystems/extensions.zh.md +30 -12
- package/references/official-docs/docs/subsystems/feedback.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/feedback.md +6 -6
- package/references/official-docs/docs/subsystems/feedback.zh.md +6 -6
- package/references/official-docs/docs/subsystems/filesystem.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/filesystem.md +17 -7
- package/references/official-docs/docs/subsystems/filesystem.zh.md +19 -9
- package/references/official-docs/docs/subsystems/goal.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/goal.md +4 -4
- package/references/official-docs/docs/subsystems/goal.zh.md +8 -8
- package/references/official-docs/docs/subsystems/invariants.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/invariants.md +2 -2
- package/references/official-docs/docs/subsystems/invariants.zh.md +5 -5
- package/references/official-docs/docs/subsystems/jobs.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/jobs.md +3 -3
- package/references/official-docs/docs/subsystems/jobs.zh.md +6 -6
- package/references/official-docs/docs/subsystems/llm-streaming.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/llm-streaming.md +193 -22
- package/references/official-docs/docs/subsystems/llm-streaming.zh.md +199 -28
- package/references/official-docs/docs/subsystems/lsp.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/lsp.md +2 -2
- package/references/official-docs/docs/subsystems/lsp.zh.md +3 -3
- package/references/official-docs/docs/subsystems/permission-presets.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/permission-presets.md +8 -8
- package/references/official-docs/docs/subsystems/permission-presets.zh.md +8 -8
- package/references/official-docs/docs/subsystems/persistence.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/persistence.md +183 -173
- package/references/official-docs/docs/subsystems/persistence.zh.md +182 -172
- package/references/official-docs/docs/subsystems/plan.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/plan.md +4 -4
- package/references/official-docs/docs/subsystems/plan.zh.md +10 -10
- package/references/official-docs/docs/subsystems/sandbox.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/sandbox.md +5 -3
- package/references/official-docs/docs/subsystems/sandbox.zh.md +8 -6
- package/references/official-docs/docs/subsystems/schedule.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/schedule.md +9 -3
- package/references/official-docs/docs/subsystems/schedule.zh.md +11 -5
- package/references/official-docs/docs/subsystems/scope.i18n.yaml +1 -1
- package/references/official-docs/docs/subsystems/scope.zh.md +1 -1
- package/references/official-docs/docs/subsystems/session-projection.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/session-projection.md +148 -75
- package/references/official-docs/docs/subsystems/session-projection.zh.md +148 -75
- package/references/official-docs/docs/subsystems/session-query.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/session-query.md +30 -16
- package/references/official-docs/docs/subsystems/session-query.zh.md +31 -17
- package/references/official-docs/docs/subsystems/session-reference.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/session-reference.md +94 -7
- package/references/official-docs/docs/subsystems/session-reference.zh.md +95 -8
- package/references/official-docs/docs/subsystems/session-telemetry.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/session-telemetry.md +5 -6
- package/references/official-docs/docs/subsystems/session-telemetry.zh.md +9 -10
- package/references/official-docs/docs/subsystems/session-title.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/session-title.md +8 -8
- package/references/official-docs/docs/subsystems/session-title.zh.md +10 -10
- package/references/official-docs/docs/subsystems/session.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/session.md +376 -71
- package/references/official-docs/docs/subsystems/session.zh.md +392 -85
- package/references/official-docs/docs/subsystems/settings.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/settings.md +105 -10
- package/references/official-docs/docs/subsystems/settings.zh.md +105 -10
- package/references/official-docs/docs/subsystems/shell.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/shell.md +3 -3
- package/references/official-docs/docs/subsystems/shell.zh.md +11 -11
- package/references/official-docs/docs/subsystems/skills.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/skills.md +26 -3
- package/references/official-docs/docs/subsystems/skills.zh.md +29 -6
- package/references/official-docs/docs/subsystems/slots.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/slots.md +175 -0
- package/references/official-docs/docs/subsystems/slots.zh.md +175 -0
- package/references/official-docs/docs/subsystems/spill.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/spill.md +4 -4
- package/references/official-docs/docs/subsystems/spill.zh.md +6 -6
- package/references/official-docs/docs/subsystems/storage.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/storage.md +38 -7
- package/references/official-docs/docs/subsystems/storage.zh.md +41 -10
- package/references/official-docs/docs/subsystems/subagent.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/subagent.md +148 -116
- package/references/official-docs/docs/subsystems/subagent.zh.md +158 -124
- package/references/official-docs/docs/subsystems/subprocess.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/subprocess.md +3 -3
- package/references/official-docs/docs/subsystems/subprocess.zh.md +5 -5
- package/references/official-docs/docs/subsystems/system-prompt.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/system-prompt.md +21 -8
- package/references/official-docs/docs/subsystems/system-prompt.zh.md +23 -10
- package/references/official-docs/docs/subsystems/terminal.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/terminal.md +2 -2
- package/references/official-docs/docs/subsystems/terminal.zh.md +4 -4
- package/references/official-docs/docs/subsystems/todo.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/todo.md +32 -0
- package/references/official-docs/docs/subsystems/todo.zh.md +32 -0
- package/references/official-docs/docs/subsystems/token-meter.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/token-meter.md +29 -14
- package/references/official-docs/docs/subsystems/token-meter.zh.md +30 -15
- package/references/official-docs/docs/subsystems/tools.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/tools.md +46 -46
- package/references/official-docs/docs/subsystems/tools.zh.md +54 -54
- package/references/official-docs/docs/subsystems/typert.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/typert.md +65 -58
- package/references/official-docs/docs/subsystems/typert.zh.md +67 -60
- package/references/official-docs/docs/subsystems/user-questions.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/user-questions.md +35 -35
- package/references/official-docs/docs/subsystems/user-questions.zh.md +35 -35
- package/references/official-docs/docs/subsystems/web-client.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/web-client.md +95 -0
- package/references/official-docs/docs/subsystems/web-client.zh.md +95 -0
- package/references/official-docs/docs/subsystems/web-server.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/web-server.md +55 -9
- package/references/official-docs/docs/subsystems/web-server.zh.md +56 -10
- package/references/official-docs/docs/subsystems/web.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/web.md +14 -7
- package/references/official-docs/docs/subsystems/web.zh.md +16 -9
- package/references/official-docs/docs/subsystems/webhook.i18n.yaml +6 -0
- package/references/official-docs/docs/subsystems/webhook.md +70 -0
- package/references/official-docs/docs/subsystems/webhook.zh.md +70 -0
- package/references/official-docs/docs/subsystems/workflow.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/workflow.md +8 -8
- package/references/official-docs/docs/subsystems/workflow.zh.md +13 -13
- package/references/official-docs/docs/subsystems/workspace.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/workspace.md +98 -5
- package/references/official-docs/docs/subsystems/workspace.zh.md +102 -9
- package/references/official-docs/docs/testing.i18n.yaml +2 -2
- package/references/official-docs/docs/testing.md +15 -10
- package/references/official-docs/docs/testing.zh.md +15 -10
- package/references/official-docs/docs/tool-catalog.i18n.yaml +2 -2
- package/references/official-docs/docs/tool-catalog.md +413 -61
- package/references/official-docs/docs/tool-catalog.zh.md +418 -63
- package/references/official-docs/docs/tool-execution-pipeline.i18n.yaml +2 -2
- package/references/official-docs/docs/tool-execution-pipeline.md +1 -1
- package/references/official-docs/docs/tool-execution-pipeline.zh.md +1 -1
- package/references/official-docs/docs/user/develop/basic/config.i18n.yaml +2 -2
- package/references/official-docs/docs/user/develop/basic/config.md +1 -1
- package/references/official-docs/docs/user/develop/basic/config.zh.md +4 -4
- package/references/official-docs/docs/user/develop/basic/index.i18n.yaml +1 -1
- package/references/official-docs/docs/user/develop/basic/index.zh.md +5 -5
- package/references/official-docs/docs/user/develop/basic/publish.i18n.yaml +2 -2
- package/references/official-docs/docs/user/develop/basic/publish.md +3 -3
- package/references/official-docs/docs/user/develop/basic/publish.zh.md +7 -7
- package/references/official-docs/docs/user/develop/basic/tool.i18n.yaml +2 -2
- package/references/official-docs/docs/user/develop/basic/tool.md +3 -3
- package/references/official-docs/docs/user/develop/basic/tool.zh.md +4 -4
- package/references/official-docs/docs/user/develop/framework/events.i18n.yaml +2 -2
- package/references/official-docs/docs/user/develop/framework/events.md +2 -2
- package/references/official-docs/docs/user/develop/framework/events.zh.md +3 -3
- package/references/official-docs/docs/user/develop/framework/index.i18n.yaml +1 -1
- package/references/official-docs/docs/user/develop/framework/index.zh.md +3 -3
- package/references/official-docs/docs/user/develop/framework/service.i18n.yaml +2 -2
- package/references/official-docs/docs/user/develop/framework/service.md +1 -1
- package/references/official-docs/docs/user/develop/framework/service.zh.md +3 -3
- package/references/official-docs/docs/user/develop/practice/dynamic-cordis.i18n.yaml +6 -0
- package/references/official-docs/docs/user/develop/practice/dynamic-cordis.md +15 -0
- package/references/official-docs/docs/user/develop/practice/dynamic-cordis.zh.md +15 -0
- package/references/official-docs/docs/user/develop/practice/index.i18n.yaml +2 -2
- package/references/official-docs/docs/user/develop/practice/index.md +1 -1
- package/references/official-docs/docs/user/develop/practice/index.zh.md +3 -3
- package/references/official-docs/docs/user/develop/practice/llm-adapter.i18n.yaml +2 -2
- package/references/official-docs/docs/user/develop/practice/llm-adapter.md +4 -3
- package/references/official-docs/docs/user/develop/practice/llm-adapter.zh.md +4 -3
- package/references/official-docs/docs/user/guide/github-review.i18n.yaml +6 -0
- package/references/official-docs/docs/user/guide/github-review.md +102 -0
- package/references/official-docs/docs/user/guide/github-review.zh.md +102 -0
- package/references/official-docs/docs/user/guide/index.i18n.yaml +2 -2
- package/references/official-docs/docs/user/guide/index.md +2 -2
- package/references/official-docs/docs/user/guide/index.zh.md +8 -8
- package/references/official-docs/docs/user/guide/mcp-memory.i18n.yaml +6 -0
- package/references/official-docs/docs/user/guide/mcp-memory.md +101 -0
- package/references/official-docs/docs/user/guide/mcp-memory.zh.md +101 -0
- package/references/official-docs/docs/user/guide/providers.i18n.yaml +2 -2
- package/references/official-docs/docs/user/guide/providers.md +40 -1
- package/references/official-docs/docs/user/guide/providers.zh.md +41 -2
- package/references/official-docs/docs/user/guide/python-sdk.i18n.yaml +2 -2
- package/references/official-docs/docs/user/guide/python-sdk.md +80 -34
- package/references/official-docs/docs/user/guide/python-sdk.zh.md +87 -41
- package/references/official-docs/docs/user/guide/schedule.i18n.yaml +6 -0
- package/references/official-docs/docs/user/guide/schedule.md +21 -0
- package/references/official-docs/docs/user/guide/schedule.zh.md +21 -0
- package/references/official-docs/docs/web-styling.i18n.yaml +2 -2
- package/references/official-docs/docs/web-styling.md +3 -0
- package/references/official-docs/docs/web-styling.zh.md +5 -2
- package/references/official-docs/packages/AGENTS.md +4 -3
- package/references/official-docs/packages/README.md +104 -59
- package/references/official-docs/vendor/README.md +1 -0
- package/references/official-docs/website-docs.ts +52 -11
- package/references/sources.md +2 -2
- package/references/website-pages.md +3 -3
- package/scripts/download-sources.ps1 +1 -1
- package/scripts/sync-official-docs.ps1 +19 -11
- package/scripts/verify-kit.ps1 +0 -4
- package/templates/js/README.es.md +1 -1
- package/templates/js/README.hi.md +1 -1
- package/templates/js/README.md +1 -1
- package/templates/js/README.pt.md +1 -1
- package/templates/js/README.zh.md +1 -1
- package/templates/js/package.json +4 -4
- package/templates/ts/README.es.md +1 -1
- package/templates/ts/README.hi.md +1 -1
- package/templates/ts/README.md +1 -1
- package/templates/ts/README.pt.md +1 -1
- package/templates/ts/README.zh.md +1 -1
- package/templates/ts/package.json +4 -4
- package/references/official-docs/examples/AGENTS.md +0 -20
|
@@ -2,33 +2,38 @@
|
|
|
2
2
|
|
|
3
3
|
[English](session-projection.md) | 中文
|
|
4
4
|
|
|
5
|
-
会话投影 seam 是一项[能力 seam](../capability-seams.md):领域 host 插件经由它向客户端载体供给按会话的日志派生状态的当前全量值;三方分别是 Service Definition 与注册表([dsh-session-projection](../../packages/session/session-projection),`ctx.sessionProjections`)、领域贡献方(每个领域注册一个纯单元)与载体([dsh-
|
|
5
|
+
会话投影 seam 是一项[能力 seam](../capability-seams.zh.md):领域 host 插件经由它向客户端载体供给按会话的日志派生状态的当前全量值;三方分别是 Service Definition 与注册表([dsh-session-projection](../../packages/session/session-projection),`ctx.sessionProjections`)、领域贡献方(每个领域注册一个纯单元)与载体([dsh-session-controller](../../packages/api/session-controller) 的历史尾页与 `session/projection` 推送帧)。它是一项可选能力,不属于 agent loop(智能体循环)主干。框架负责驱动,领域负责计算:注册表只订阅一次 `session/event`,并把每个已提交事件折叠进每个单元;领域不持有任何订阅,客户端也从不折叠领域事件——它们收到的是成品值。设计权威:[session-projection RFC](../../.agents/notes/proposed/architecture/2026-07-27-session-projection-and-command-log.zh.md);驱动、缓存与变更流约定:[包 README](../../packages/session/session-projection/README.zh.md)。
|
|
6
6
|
|
|
7
7
|
源码:[`packages/session/session-projection/src/index.ts`](../../packages/session/session-projection/src/index.ts)
|
|
8
8
|
|
|
9
9
|
## 投影单元
|
|
10
10
|
|
|
11
|
-
`
|
|
11
|
+
`SessionProjectionStateMap` 是 host 侧折叠状态的 merge-extensible 类型表,`SessionProjectionMap` 则继续表示客户端可见的全量值。领域为每个状态 key 贡献一个 `ProjectionDefinition`;`wire` 块使该 key 对客户端可见,渲染归 slot 体系管,永远不归本层:
|
|
12
12
|
|
|
13
13
|
```ts type-equiv
|
|
14
14
|
/**
|
|
15
|
-
* One domain's state-driven computation unit:
|
|
16
|
-
*
|
|
15
|
+
* One domain's state-driven computation unit: a pure synchronous fold plus
|
|
16
|
+
* declarations and an optional client view — never an opaque getter. The framework drives
|
|
17
17
|
* `apply` on every committed session event; the domain holds no
|
|
18
|
-
* subscriptions and owns only the
|
|
19
|
-
* synchronous (an async unit would tear the carriers' consistency cut) and
|
|
18
|
+
* subscriptions and owns only the computation. All functions MUST be
|
|
19
|
+
* synchronous (an async unit would tear the carriers' consistency cut), and
|
|
20
20
|
* `state` MUST be plain JSON (the persisted-cache precondition).
|
|
21
21
|
*/
|
|
22
|
-
interface ProjectionDefinition<
|
|
23
|
-
|
|
22
|
+
interface ProjectionDefinition<
|
|
23
|
+
K extends keyof SessionProjectionStateMap,
|
|
24
|
+
S extends SessionProjectionStateMap[K] = SessionProjectionStateMap[K],
|
|
25
|
+
> {
|
|
26
|
+
/** The projection key this unit owns (its `SessionProjectionStateMap` entry). */
|
|
24
27
|
key: K
|
|
25
|
-
/** Validates
|
|
26
|
-
|
|
28
|
+
/** Validates persisted state before it seeds a fold. */
|
|
29
|
+
stateSchema: ZodType<S>
|
|
27
30
|
/**
|
|
28
|
-
* State for the empty log.
|
|
31
|
+
* State for the empty log and its immutable Session metadata.
|
|
32
|
+
* @param header - immutable metadata for the Session being projected.
|
|
33
|
+
* @param inheritedEventCount - exact fork-inherited prefix length.
|
|
29
34
|
* @returns the initial state.
|
|
30
35
|
*/
|
|
31
|
-
init(): S
|
|
36
|
+
init(header: SessionHeader, inheritedEventCount: SessionLogOffset): NoInfer<S>
|
|
32
37
|
/**
|
|
33
38
|
* Pure transition: previous state + one committed event → next state. A
|
|
34
39
|
* unit uninterested in an event MUST return the same state reference — an
|
|
@@ -37,13 +42,21 @@ interface ProjectionDefinition<K extends keyof SessionProjectionMap, S> {
|
|
|
37
42
|
* @param event - the next committed session event.
|
|
38
43
|
* @returns the next state (same reference when the event is not the unit's).
|
|
39
44
|
*/
|
|
40
|
-
apply(state: S
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
apply(state: NoInfer<S>, event: SessionEvent): NoInfer<S>
|
|
46
|
+
/** Client view. Omit for host-only units. */
|
|
47
|
+
wire?: K extends keyof SessionProjectionMap ? {
|
|
48
|
+
/** Validates the wire payload before it leaves the host. */
|
|
49
|
+
viewSchema: ZodType<SessionProjectionMap[K]>
|
|
50
|
+
/**
|
|
51
|
+
* State → wire payload (the read-side projection). The live drive keeps
|
|
52
|
+
* the two latest raw results and compares them with `Object.is`; an
|
|
53
|
+
* object-valued view must reuse its reference to suppress publication
|
|
54
|
+
* across internal-only state changes.
|
|
55
|
+
* @param state - the current state.
|
|
56
|
+
* @returns the whole current value for this unit's key.
|
|
57
|
+
*/
|
|
58
|
+
view(state: NoInfer<S>): SessionProjectionMap[K]
|
|
59
|
+
} : never
|
|
47
60
|
/**
|
|
48
61
|
* Persisted-cache invalidation version: bump whenever the serialized state fields or the
|
|
49
62
|
* fold semantics change, so persisted `(sessionId, key, ver, seq, val)`
|
|
@@ -60,37 +73,37 @@ interface ProjectionDefinition<K extends keyof SessionProjectionMap, S> {
|
|
|
60
73
|
|
|
61
74
|
```ts type-equiv
|
|
62
75
|
/**
|
|
63
|
-
* One consistent read cut over every registered unit for one session.
|
|
76
|
+
* One consistent read cut over every registered client-visible unit for one session.
|
|
64
77
|
* `asOfSeq` is the shared watermark — the seq of the last event every value
|
|
65
|
-
* reflects (`-1` for an empty log
|
|
78
|
+
* reflects (`-1` for an empty log).
|
|
66
79
|
*/
|
|
67
80
|
interface ProjectionSnapshot {
|
|
68
81
|
/** Seq of the last event the values reflect; -1 for an empty log. */
|
|
69
|
-
asOfSeq:
|
|
70
|
-
/** Whole current value per registered key. */
|
|
82
|
+
asOfSeq: SessionSeqCursor
|
|
83
|
+
/** Whole current client value per registered key. */
|
|
71
84
|
values: Partial<SessionProjectionMap>
|
|
72
85
|
}
|
|
73
86
|
```
|
|
74
87
|
|
|
75
88
|
```ts type-equiv
|
|
76
89
|
/**
|
|
77
|
-
* Change-feed listener: one unit's
|
|
78
|
-
* the schema-validated
|
|
79
|
-
* emission (the seq of the event that caused the change).
|
|
90
|
+
* Change-feed listener: one unit's raw `view` result changed by `Object.is`
|
|
91
|
+
* for one session. `value` is the schema-validated output; `seq` is the
|
|
92
|
+
* unit's watermark at emission (the seq of the event that caused the change).
|
|
80
93
|
*/
|
|
81
94
|
type ProjectionChangeListener = (
|
|
82
95
|
session: Session,
|
|
83
96
|
key: Extract<keyof SessionProjectionMap, string>,
|
|
84
97
|
value: unknown,
|
|
85
|
-
seq:
|
|
98
|
+
seq: SessionSeq,
|
|
86
99
|
) => void
|
|
87
100
|
```
|
|
88
101
|
|
|
89
|
-
`snapshot(session)` 完全同步:载体在切出页面切片的同一 tick 内读取它,因此 `asOfSeq`
|
|
102
|
+
`snapshot(session)` 完全同步:载体在切出页面切片的同一 tick 内读取它,因此 `asOfSeq` 使两次读取使用同一个序号。它只返回客户端视图,并在返回前通过各单元的 `viewSchema` 校验。`stateOf(session, key)` 可在不计算无关视图的情况下读取一份实时 host 状态;调用方不得修改这一借用引用。state 引用变化时,注册表计算并缓存一次原始 view;只有该结果通过 `Object.is` 判定为变化时才触发变更流,对象 view 若要在仅内部 state 变化时抑制发布就必须保留引用。
|
|
90
103
|
|
|
91
104
|
## 注册表:`ctx.sessionProjections`
|
|
92
105
|
|
|
93
|
-
`SessionProjectionRegistry`([签名](#ctxsessionprojections--sessionprojectionregistry))拥有驱动权:一份 `session/event` 订阅、对每个已注册单元即时调用 `apply`,以及每会话每单元的水位线(watermark)cell。cell 惰性构建:在事件流过之后才注册的单元,或比注册表更早的会话,都在首次触达(事件或读取)时从 `init` 出发在内存日志上折叠。注册是一个 effect,其 disposer 随调用方 fiber 走:领域插件卸载后,其 key(连同缓存的 cell)从后续驱动与快照中消失,客户端将其读作能力缺失;key
|
|
106
|
+
`SessionProjectionRegistry`([签名](#ctxsessionprojections--sessionprojectionregistry))拥有驱动权:一份 `session/event` 订阅、对每个已注册单元即时调用 `apply`,以及每会话每单元的水位线(watermark)cell。cell 惰性构建:在事件流过之后才注册的单元,或比注册表更早的会话,都在首次触达(事件或读取)时从 `init` 出发在内存日志上折叠。注册是一个 effect,其 disposer 随调用方 fiber 走:领域插件卸载后,其 key(连同缓存的 cell)从后续驱动与快照中消失,客户端将其读作能力缺失;key 以不同 `stateVersion` 重复时直接 throw,同版本注册方则共享一个单元并被计数。领域插件在 `ctx.inject(['sessionProjections'], …)` 下注册,因此不带注册表的 headless 组装完全不受影响。
|
|
94
107
|
|
|
95
108
|
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
|
|
96
109
|
|
|
@@ -98,63 +111,79 @@ type ProjectionChangeListener = (
|
|
|
98
111
|
|
|
99
112
|
## Cordis API
|
|
100
113
|
|
|
101
|
-
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`) —
|
|
114
|
+
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).
|
|
102
115
|
|
|
103
116
|
<a id="ctxsessionprojectioncache--sessionprojectioncache"></a>
|
|
104
117
|
|
|
105
118
|
### `ctx.sessionProjectionCache` — `SessionProjectionCache`
|
|
106
119
|
|
|
107
|
-
The persisted projection cache service. Opens the `session_projcache` domain at init, checkpoints live sessions on a throttled write-behind (count/interval triggers from Config) plus
|
|
120
|
+
The persisted projection cache service. Opens the `session_projcache` domain at init, checkpoints live sessions on a throttled write-behind (count/interval triggers from Config) plus three mandatory points — session creation, `turn/end`, and session disposal (the live-to-cold moment) — and serves the cached rows for a session header. Every durable write is fail-soft: failures log a warning and the cache self-heals on the next write.
|
|
108
121
|
|
|
109
122
|
```ts cordis-catalog
|
|
110
123
|
/**
|
|
111
124
|
* The zero-I/O listing read: whole values viewed straight from the stored
|
|
112
|
-
* rows (version-matching keys only), each cut carried with its watermark
|
|
113
|
-
*
|
|
114
|
-
*
|
|
125
|
+
* rows (version-matching keys only), each cut carried with its watermark so
|
|
126
|
+
* a client value store can seed under its higher-seq-wins rule — as stale
|
|
127
|
+
* as the last durable checkpoint but never wrong, and never from an
|
|
115
128
|
* unrelated log (the caller's header is the identity witness). Fresher
|
|
116
|
-
* paths (the history tail baseline
|
|
117
|
-
*
|
|
129
|
+
* paths (the history tail baseline) supersede these values whenever a
|
|
130
|
+
* session is actually opened.
|
|
118
131
|
* @param meta - the listed session's header (identity witness; no log read).
|
|
132
|
+
* @param inheritedEventCount - exact inherited prefix length that completes
|
|
133
|
+
* the checkpoint identity.
|
|
134
|
+
* @param keys - optional projection keys required by the caller's audience.
|
|
119
135
|
* @returns the cut (`asOfSeq` = lowest served-row watermark), or
|
|
120
136
|
* `undefined` when no usable row exists for this lifecycle.
|
|
121
137
|
*/
|
|
122
|
-
cachedSnapshot(meta: SessionHeader): ProjectionSnapshot | undefined
|
|
138
|
+
cachedSnapshot( meta: SessionHeader, inheritedEventCount: SessionLogOffset, keys?: readonly Extract<keyof SessionProjectionMap, string>[], ): ProjectionSnapshot | undefined
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Hydrate projection cells for an already-prepared Session without another
|
|
142
|
+
* persistence read. The cache seeds matching rows; the supplied exact log
|
|
143
|
+
* advances every unit to the observation cut. No checkpoint is written
|
|
144
|
+
* because the logical observation may contain recovery events not yet durable.
|
|
145
|
+
* @param session - exact unpublished Session retained by persistence.
|
|
146
|
+
* @param events - exact logical event prefix represented by the observation.
|
|
147
|
+
* @returns all projection values at the event cut.
|
|
148
|
+
*/
|
|
149
|
+
hydratePrepared( session: Session, events: readonly SessionEvent[], ): ProjectionSnapshot
|
|
123
150
|
|
|
124
151
|
/**
|
|
125
|
-
* Durably checkpoint one live session NOW (
|
|
152
|
+
* Durably checkpoint one live session NOW (all mandatory points call
|
|
126
153
|
* this; tests and carriers may too). The registry cut is snapshotted at
|
|
127
|
-
* this boundary (states are live references), then the
|
|
128
|
-
* replaced. NOT fail-soft — callers on the
|
|
154
|
+
* this boundary (states are live references), then the session's record is
|
|
155
|
+
* replaced on the domain's write chain. NOT fail-soft — callers on the
|
|
156
|
+
* fail-soft paths contain it.
|
|
129
157
|
* @param session - the live session to checkpoint.
|
|
130
158
|
* @returns resolution after durability and event emission.
|
|
131
159
|
*/
|
|
132
160
|
async write(session: Session): Promise<void>
|
|
133
161
|
|
|
134
162
|
/**
|
|
135
|
-
* Cold-read one
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
* @param
|
|
143
|
-
* @param
|
|
144
|
-
* @
|
|
163
|
+
* Cold-read one session's projections from its complete log. Each unit is
|
|
164
|
+
* seeded from the identity-checked cached rows — the registry skips `apply`
|
|
165
|
+
* for the already-folded prefix (events at or below the row's `seq`) — and
|
|
166
|
+
* the refreshed checkpoint is written back (fail-soft, fire-and-forget), so
|
|
167
|
+
* the first cold read creates the cache row and later ones seed from it.
|
|
168
|
+
* The caller supplies the complete log in seq order: this service never
|
|
169
|
+
* consults the persistence layer.
|
|
170
|
+
* @param meta - the stored session header (identity witness).
|
|
171
|
+
* @param inheritedEventCount - exact inherited prefix length for projection initialization and identity.
|
|
172
|
+
* @param events - the session's complete log, in seq order.
|
|
173
|
+
* @returns the projection cut at the log end.
|
|
145
174
|
*/
|
|
146
|
-
|
|
175
|
+
coldSnapshot( meta: SessionHeader, inheritedEventCount: SessionLogOffset, events: readonly SessionEvent[], ): ProjectionSnapshot
|
|
147
176
|
```
|
|
148
177
|
|
|
149
|
-
Types: [Session](session.md) · [SessionHeader](persistence.md) · [
|
|
178
|
+
Types: [Session](session.zh.md) · [SessionEvent](session.zh.md) · [SessionHeader](persistence.zh.md) · [SessionLogOffset](session.zh.md)
|
|
150
179
|
|
|
151
|
-
Source: [`packages/session/session-projection-cache/src/index.ts
|
|
180
|
+
Source: [`packages/session/session-projection-cache/src/index.ts`](../../packages/session/session-projection-cache/src/index.ts)
|
|
152
181
|
|
|
153
182
|
<a id="ctxsessionprojections--sessionprojectionregistry"></a>
|
|
154
183
|
|
|
155
184
|
### `ctx.sessionProjections` — `SessionProjectionRegistry`
|
|
156
185
|
|
|
157
|
-
`ctx.sessionProjections`: the projection unit table and its drive. The service subscribes to `session/event` once; every committed event passes every registered unit's `apply` (eager drive)
|
|
186
|
+
`ctx.sessionProjections`: the projection unit table and its drive. The service subscribes to `session/event` once; every committed event passes every registered unit's `apply` (eager drive). A changed state reference computes the next client view; the change feed is notified only when its raw result changes by `Object.is`. Cells build lazily — a unit registered after events flowed, or a session older than the registry, folds `init` over the in-memory log on first touch (event or read). Registration is an effect (disposer rides the calling fiber): an unloaded domain plugin's key disappears from snapshots and clients read it as capability absence. A host reader either declares `sessionProjections` in its plugin `inject` or fails explicitly when the registry or required key is absent. Contributors may preserve optional registration through `ctx.inject(['sessionProjections'], ...)`. Registrants sharing a key share one unit and are counted: the same tool package mounted in N agent presets registers N times, and the key survives until the last one unloads.
|
|
158
187
|
|
|
159
188
|
```ts cordis-catalog
|
|
160
189
|
/**
|
|
@@ -165,28 +194,57 @@ Source: [`packages/session/session-projection-cache/src/index.ts:71`](../../pack
|
|
|
165
194
|
* @param definition - key, state schema, pure unit functions, and stateVersion.
|
|
166
195
|
* @returns the exact disposer that unregisters this unit.
|
|
167
196
|
*/
|
|
168
|
-
register<K extends keyof SessionProjectionMap, S>(definition: ProjectionDefinition<K, S>): () => void
|
|
197
|
+
register< K extends keyof SessionProjectionMap, S extends SessionProjectionStateMap[K], >( definition: Omit<ProjectionDefinition<K, S>, 'wire'> & { wire: NonNullable<ProjectionDefinition<K, S>['wire']> }, ): () => void
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Register one host-only unit. Its state is omitted from client snapshots
|
|
201
|
+
* and always checkpointed like every other unit.
|
|
202
|
+
* @param definition - key, state schema, pure unit functions, and stateVersion.
|
|
203
|
+
* @returns the exact disposer that unregisters this unit.
|
|
204
|
+
*/
|
|
205
|
+
register< K extends Exclude<keyof SessionProjectionStateMap, keyof SessionProjectionMap>, S extends SessionProjectionStateMap[K], >( definition: Omit<ProjectionDefinition<K, S>, 'wire'>, ): () => void
|
|
169
206
|
|
|
170
207
|
/**
|
|
171
208
|
* Subscribe to the change feed. The registration is an effect on the
|
|
172
209
|
* calling context's fiber.
|
|
173
|
-
* @param listener - called once per unit whose
|
|
210
|
+
* @param listener - called once per client-visible unit whose raw view changed by `Object.is`, per committed event.
|
|
174
211
|
* @returns the exact disposer that unsubscribes.
|
|
175
212
|
*/
|
|
176
213
|
onChanged(listener: ProjectionChangeListener): () => void
|
|
177
214
|
|
|
178
215
|
/**
|
|
179
|
-
*
|
|
216
|
+
* Read one unit's current host state after materializing every registered
|
|
217
|
+
* unit at the Session cursor. Unrelated wire views are not produced.
|
|
218
|
+
* The returned value is live; callers must not mutate it.
|
|
219
|
+
* @param session - the session whose state is read.
|
|
220
|
+
* @param key - the registered unit key.
|
|
221
|
+
* @returns current state, or `undefined` when the key is not registered.
|
|
222
|
+
*/
|
|
223
|
+
stateOf<K extends keyof SessionProjectionStateMap>( session: Session, key: K, ): SessionProjectionStateMap[K] | undefined
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* One consistent cut over every registered client-visible unit for one session, read from
|
|
180
227
|
* the watermark cache (missing cells fold lazily over the in-memory log).
|
|
181
228
|
* Fully synchronous — every value and `asOfSeq` reflect the same log
|
|
182
|
-
* position. Each value passes its unit's
|
|
229
|
+
* position. Each value passes its unit's `viewSchema` before leaving.
|
|
183
230
|
* @param session - the session whose projection values are read.
|
|
184
|
-
* @
|
|
231
|
+
* @param keys - optional client-visible outputs; state materialization remains complete.
|
|
232
|
+
* @returns the snapshot; `values` is empty when no selected client-visible unit is registered.
|
|
185
233
|
*/
|
|
186
|
-
snapshot(session: Session): ProjectionSnapshot
|
|
234
|
+
snapshot( session: Session, keys?: readonly Extract<keyof SessionProjectionMap, string>[], ): ProjectionSnapshot
|
|
187
235
|
|
|
188
236
|
/**
|
|
189
|
-
*
|
|
237
|
+
* Read only already-materialized client-visible cells without folding history.
|
|
238
|
+
* Values may trail the live Session and are therefore hints, not a complete
|
|
239
|
+
* baseline. Missing cells are omitted.
|
|
240
|
+
* @param session - attached Session whose cached cells are inspected.
|
|
241
|
+
* @param keys - optional wire keys to view.
|
|
242
|
+
* @returns the lowest common cached cut, or `undefined` when no wire cell exists.
|
|
243
|
+
*/
|
|
244
|
+
cachedSnapshot( session: Session, keys?: readonly Extract<keyof SessionProjectionMap, string>[], ): ProjectionSnapshot | undefined
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* State-level checkpoint of every persisted unit for one session, read
|
|
190
248
|
* from the watermark cache (missing cells fold lazily over the in-memory
|
|
191
249
|
* log). This is the write side of the persisted projection cache: the
|
|
192
250
|
* returned rows are the `(key → {ver, seq, val})` part of the durable
|
|
@@ -197,7 +255,7 @@ snapshot(session: Session): ProjectionSnapshot
|
|
|
197
255
|
* every subsequent snapshot and frame through it (plain JSON by the unit
|
|
198
256
|
* contract, so the clone is total).
|
|
199
257
|
* @param session - the session whose unit states are checkpointed.
|
|
200
|
-
* @returns one row per registered key
|
|
258
|
+
* @returns one row per registered key.
|
|
201
259
|
*/
|
|
202
260
|
checkpoint(session: Session): ProjectionCheckpoint
|
|
203
261
|
|
|
@@ -213,30 +271,31 @@ checkpoint(session: Session): ProjectionCheckpoint
|
|
|
213
271
|
* yields an end below every watermark and the restore rejects for a full
|
|
214
272
|
* re-read.
|
|
215
273
|
* @param checkpoint - persisted rows for one session (possibly stale or empty).
|
|
216
|
-
* @returns the
|
|
217
|
-
* when no unit is registered (no read needed —
|
|
218
|
-
* serve empty values regardless).
|
|
274
|
+
* @returns the offset for the stored-log suffix read (`SessionHandle.read`),
|
|
275
|
+
* or `undefined` when no unit is registered (no read needed —
|
|
276
|
+
* {@link restore} would serve empty values regardless).
|
|
219
277
|
*/
|
|
220
|
-
restoreFloor(checkpoint: ProjectionCheckpoint):
|
|
278
|
+
restoreFloor(checkpoint: ProjectionCheckpoint): SessionLogOffset | undefined
|
|
221
279
|
|
|
222
280
|
/**
|
|
223
281
|
* View a checkpoint's rows without any log read: for every registered
|
|
224
|
-
* unit whose row's `ver` matches, serve the schema-validated
|
|
225
|
-
* `view` of the stored state; mismatched or absent rows leave their key
|
|
282
|
+
* client-visible unit whose row's `ver` matches, serve the schema-validated
|
|
283
|
+
* `view` of the schema-validated stored state; mismatched, malformed, or absent rows leave their key
|
|
226
284
|
* absent (a cold or listing consumer treats it as not-yet-available and a
|
|
227
285
|
* fuller read path refolds it). The zero-I/O rung of the read ladder —
|
|
228
286
|
* values are as stale as their rows, never wrong.
|
|
229
287
|
* @param checkpoint - persisted rows for one session (possibly stale or empty).
|
|
288
|
+
* @param keys - optional wire keys to view.
|
|
230
289
|
* @returns whole values per key with a usable row; empty when none.
|
|
231
290
|
*/
|
|
232
|
-
viewCheckpoint(checkpoint: ProjectionCheckpoint): Partial<SessionProjectionMap>
|
|
291
|
+
viewCheckpoint( checkpoint: ProjectionCheckpoint, keys?: readonly Extract<keyof SessionProjectionMap, string>[], ): Partial<SessionProjectionMap>
|
|
233
292
|
|
|
234
293
|
/**
|
|
235
|
-
* Cold read: fold every
|
|
294
|
+
* Cold read: fold every persisted unit over a stored log suffix, seeding
|
|
236
295
|
* each from its checkpoint row when usable — the one read recipe (cached
|
|
237
296
|
* state + forward tail replay + `view`) applied without a live `Session`.
|
|
238
|
-
* Call with the events
|
|
239
|
-
* `
|
|
297
|
+
* Call with the stored events at or past `restoreFloor(checkpoint)` (a
|
|
298
|
+
* `SessionHandle.read` slice) and that same floor as
|
|
240
299
|
* `baseSeq`; the floor's one-below anchor makes the supplied end honest,
|
|
241
300
|
* so a shrunk log is detected here. A row is usable iff its
|
|
242
301
|
* `ver` matches the live unit's `stateVersion`, it does not predate `baseSeq`
|
|
@@ -249,14 +308,28 @@ viewCheckpoint(checkpoint: ProjectionCheckpoint): Partial<SessionProjectionMap>
|
|
|
249
308
|
* @param checkpoint - persisted rows for one session (possibly stale or empty).
|
|
250
309
|
* @param events - the stored events with `seq >= baseSeq`, in seq order.
|
|
251
310
|
* @param baseSeq - the seq `events` starts at (its first event's seq when non-empty).
|
|
311
|
+
* @param header - immutable metadata for the Session being restored.
|
|
312
|
+
* @param inheritedEventCount - exact fork-inherited prefix length supplied to unit initialization.
|
|
252
313
|
* @returns the snapshot cut at the supplied log end (`asOfSeq` is the last
|
|
253
314
|
* supplied event's seq, `baseSeq - 1` for an empty tail) plus the
|
|
254
315
|
* refreshed checkpoint rows at that cut, ready for a durable write-back.
|
|
255
316
|
*/
|
|
256
|
-
restore(checkpoint: ProjectionCheckpoint, events: readonly SessionEvent[], baseSeq:
|
|
317
|
+
restore( checkpoint: ProjectionCheckpoint, events: readonly SessionEvent[], baseSeq: SessionLogOffset, header: SessionHeader, inheritedEventCount: SessionLogOffset, ): { snapshot: ProjectionSnapshot; checkpoint: ProjectionCheckpoint }
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Restore an exact cut and install its states on the supplied prepared Session.
|
|
321
|
+
* A later publication reuses these cells; ordinary live reads and event drive
|
|
322
|
+
* advance any constructor-owned suffix exactly once.
|
|
323
|
+
* @param session - exact prepared Session that owns the restored log prefix.
|
|
324
|
+
* @param checkpoint - persisted rows for this Session lifecycle.
|
|
325
|
+
* @param events - exact events at the observation cut.
|
|
326
|
+
* @param baseSeq - first supplied event sequence.
|
|
327
|
+
* @returns all projection values at the supplied cut.
|
|
328
|
+
*/
|
|
329
|
+
hydrate( session: Session, checkpoint: ProjectionCheckpoint, events: readonly SessionEvent[], baseSeq: SessionLogOffset, ): ProjectionSnapshot
|
|
257
330
|
```
|
|
258
331
|
|
|
259
|
-
Types: [Session](session.md) · [SessionEvent](session.md)
|
|
332
|
+
Types: [Session](session.zh.md) · [SessionEvent](session.zh.md) · [SessionHeader](persistence.zh.md) · [SessionLogOffset](session.zh.md)
|
|
260
333
|
|
|
261
|
-
Source: [`packages/session/session-projection/src/index.ts
|
|
334
|
+
Source: [`packages/session/session-projection/src/index.ts`](../../packages/session/session-projection/src/index.ts)
|
|
262
335
|
<!-- 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/session-query.md
|
|
5
|
-
session-query.md:
|
|
6
|
-
session-query.zh.md:
|
|
5
|
+
session-query.md: 1cf3dff325db76485a0afca4ca1a882a4ff175b8
|
|
6
|
+
session-query.zh.md: 2b8504dfb9ec8ee25d925135dbc99fa7beaede98
|
|
@@ -22,7 +22,7 @@ interface SessionRecord {
|
|
|
22
22
|
header: SessionHeader
|
|
23
23
|
/** Whether the id currently exists in `ctx.sessions`. */
|
|
24
24
|
live: boolean
|
|
25
|
-
/** Whether the active persistence backend currently
|
|
25
|
+
/** Whether the active persistence backend currently lists the id, including a created-but-unmaterialized session it already observes. */
|
|
26
26
|
persisted: boolean
|
|
27
27
|
}
|
|
28
28
|
```
|
|
@@ -34,7 +34,9 @@ interface SessionRecord {
|
|
|
34
34
|
interface SessionLogSnapshot {
|
|
35
35
|
/** Cloned session header selected from the same observation as `events`. */
|
|
36
36
|
session: SessionHeader
|
|
37
|
-
/**
|
|
37
|
+
/** Exact number of fork-inherited events in the observed log. */
|
|
38
|
+
inheritedEventCount: SessionLogOffset
|
|
39
|
+
/** Cloned contiguous raw events after in-memory interrupted-turn balancing and replay validation. */
|
|
38
40
|
events: SessionEvent[]
|
|
39
41
|
}
|
|
40
42
|
```
|
|
@@ -44,8 +46,10 @@ interface SessionLogSnapshot {
|
|
|
44
46
|
interface SessionSurfaceSnapshot {
|
|
45
47
|
/** Cloned session header selected from the same corpus observation as `events`. */
|
|
46
48
|
session: SessionHeader
|
|
49
|
+
/** Exact number of fork-inherited events in the observed log. */
|
|
50
|
+
inheritedEventCount: SessionLogOffset
|
|
47
51
|
/** Highest raw-log seq included in the observation, or `null` for an empty log. */
|
|
48
|
-
capturedThroughSeq:
|
|
52
|
+
capturedThroughSeq: OptionalSessionSeq
|
|
49
53
|
/** Cloned current surface events in model-history order. */
|
|
50
54
|
events: SurfaceEvent[]
|
|
51
55
|
}
|
|
@@ -90,7 +94,7 @@ interface SessionEventRecord {
|
|
|
90
94
|
/** Session that owns the event. */
|
|
91
95
|
sessionId: SessionId
|
|
92
96
|
/** Monotonic event seq within the session. */
|
|
93
|
-
seq:
|
|
97
|
+
seq: SessionSeq
|
|
94
98
|
/** Discriminant of the session event. */
|
|
95
99
|
type: SessionEventType
|
|
96
100
|
/** Event timestamp in Unix epoch milliseconds. */
|
|
@@ -138,7 +142,7 @@ interface SessionEventSearchDocument extends SessionEventRecord {
|
|
|
138
142
|
}
|
|
139
143
|
```
|
|
140
144
|
|
|
141
|
-
`ctx.sessionQuery.filterSessions(filters)` applies `SessionResultFilter` to the complete logical corpus; `ctx.sessionQuery.filterEvents(sessionId, filters)` returns matching documents in ascending seq order. Messages,
|
|
145
|
+
`ctx.sessionQuery.filterSessions(filters)` applies `SessionResultFilter` to the complete logical corpus; `ctx.sessionQuery.filterEvents(sessionId, filters)` returns matching documents in ascending seq order. Messages, tool calls/results, todos, and failure/status detail contribute semantic text; reasoning blocks, blocked prompts, structural events, and stream chunks do not.
|
|
142
146
|
|
|
143
147
|
## Full-text search pages
|
|
144
148
|
|
|
@@ -266,7 +270,7 @@ interface SessionEventReadRequest {
|
|
|
266
270
|
/** Session that owns the target event. */
|
|
267
271
|
sessionId: SessionId
|
|
268
272
|
/** Target event seq. */
|
|
269
|
-
seq:
|
|
273
|
+
seq: SessionSeq
|
|
270
274
|
/** Number of preceding raw events to include. */
|
|
271
275
|
before?: number
|
|
272
276
|
/** Number of following raw events to include. */
|
|
@@ -279,14 +283,16 @@ interface SessionEventReadRequest {
|
|
|
279
283
|
interface SessionEventWindow {
|
|
280
284
|
/** Cloned header for the live-preferred source read. */
|
|
281
285
|
session: SessionHeader
|
|
286
|
+
/** Exact number of fork-inherited events in the observed log. */
|
|
287
|
+
inheritedEventCount: SessionLogOffset
|
|
282
288
|
/** Full cloned target event. */
|
|
283
289
|
target: SessionEvent
|
|
284
290
|
/** Full cloned events from `startSeq` through `endSeq`. */
|
|
285
291
|
events: SessionEvent[]
|
|
286
292
|
/** First seq included in `events`. */
|
|
287
|
-
startSeq:
|
|
293
|
+
startSeq: SessionSeq
|
|
288
294
|
/** Last seq included in `events`. */
|
|
289
|
-
endSeq:
|
|
295
|
+
endSeq: SessionSeq
|
|
290
296
|
}
|
|
291
297
|
```
|
|
292
298
|
|
|
@@ -300,7 +306,7 @@ interface SessionEventTraceRequest {
|
|
|
300
306
|
/** Session that owns the target event. */
|
|
301
307
|
sessionId: SessionId
|
|
302
308
|
/** Target event seq. */
|
|
303
|
-
seq:
|
|
309
|
+
seq: SessionSeq
|
|
304
310
|
}
|
|
305
311
|
```
|
|
306
312
|
|
|
@@ -310,15 +316,15 @@ interface SessionEventTrace {
|
|
|
310
316
|
/** Lightweight target record. */
|
|
311
317
|
target: SessionEventRecord
|
|
312
318
|
/** Immediate positional replacement event, when the target was shadowed. */
|
|
313
|
-
replacedBy?:
|
|
319
|
+
replacedBy?: SessionSeq
|
|
314
320
|
/** Positional replacers from the immediate replacement to the final replacement. */
|
|
315
|
-
replacementChain:
|
|
321
|
+
replacementChain: SessionSeq[]
|
|
316
322
|
/** Surface nodes directly removed when the target itself performed a replacement. */
|
|
317
|
-
replacedEventSeqs:
|
|
323
|
+
replacedEventSeqs: SessionSeq[]
|
|
318
324
|
/** Earlier events cited directly as sources, in their recorded order. */
|
|
319
|
-
sourceEventSeqs:
|
|
325
|
+
sourceEventSeqs: SessionSeq[]
|
|
320
326
|
/** Later events that directly cite the target as a source, in log order. */
|
|
321
|
-
derivedEventSeqs:
|
|
327
|
+
derivedEventSeqs: SessionSeq[]
|
|
322
328
|
}
|
|
323
329
|
```
|
|
324
330
|
|
|
@@ -362,7 +368,7 @@ type SessionQueryErrorCode =
|
|
|
362
368
|
|
|
363
369
|
## Cordis API
|
|
364
370
|
|
|
365
|
-
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`) —
|
|
371
|
+
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).
|
|
366
372
|
|
|
367
373
|
<a id="ctxsessionquery--sessionqueryengine-abstract-seam"></a>
|
|
368
374
|
|
|
@@ -373,6 +379,14 @@ Unified live-preferred session query service.
|
|
|
373
379
|
Exact reads, filters, and traces are backend-independent concrete behavior. A backend implements full-text observation, reconciliation, ranking, cursor generations, and query execution on the same `ctx.sessionQuery` service.
|
|
374
380
|
|
|
375
381
|
```ts cordis-catalog
|
|
382
|
+
/**
|
|
383
|
+
* Observe one exact live or prepared Session without a persistence listing preflight.
|
|
384
|
+
* @param sessionId - logical Session identity.
|
|
385
|
+
* @param options - cancellation and projection selection for this read.
|
|
386
|
+
* @returns a caller-owned observation lease.
|
|
387
|
+
*/
|
|
388
|
+
observeSession( sessionId: SessionId, options: SessionObservationOptions = {}, ): Promise<SessionObservation>
|
|
389
|
+
|
|
376
390
|
/**
|
|
377
391
|
* Search the live-preferred logical corpus and group by session.
|
|
378
392
|
* @param request - query text, metadata filters, page size, and cursor.
|
|
@@ -491,5 +505,5 @@ async readEvent(request: SessionEventReadRequest, signal?: AbortSignal): Promise
|
|
|
491
505
|
|
|
492
506
|
Types: [SessionId](core.md) · [SessionTitleSnapshot](session-title.md)
|
|
493
507
|
|
|
494
|
-
Source: [`packages/session-query/session-query/src/index.ts
|
|
508
|
+
Source: [`packages/session-query/session-query/src/index.ts`](../../packages/session-query/session-query/src/index.ts)
|
|
495
509
|
<!-- END GENERATED cordis-surface -->
|