dsh-plugin-dev-kb 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.en.md +4 -4
- package/README.md +5 -5
- package/kb/INDEX.md +18 -18
- package/kb/README.md +6 -4
- package/kb/extra/AGENTS.md +11 -10
- package/kb/extra/cookbook/adding-a-remote-api.md +2 -2
- package/kb/extra/cookbook/adding-a-remote-api.zh.md +2 -2
- package/kb/extra/cookbook/adding-a-session-format-version.md +48 -6
- package/kb/extra/cookbook/adding-a-session-format-version.zh.md +48 -6
- package/kb/extra/cookbook/reviewing-persistence-type-changes.md +120 -0
- package/kb/extra/cookbook/reviewing-persistence-type-changes.zh.md +120 -0
- package/kb/extra/deepseek-llm-api-wire-extensions.md +18 -19
- package/kb/extra/deepseek-llm-api-wire-extensions.zh.md +17 -18
- package/kb/extra/development.md +27 -10
- package/kb/extra/development.zh.md +27 -10
- package/kb/extra/event-producer-consumer.md +89 -68
- package/kb/extra/event-producer-consumer.zh.md +90 -69
- package/kb/extra/glossary.md +1 -1
- package/kb/extra/glossary.zh.md +1 -1
- package/kb/extra/i18n/README.md +15 -7
- package/kb/extra/i18n/README.zh.md +15 -7
- package/kb/extra/i18n/terminology.md +4 -4
- package/kb/extra/i18n/translation-prompt.md +2 -2
- package/kb/extra/module-graph.md +574 -326
- package/kb/extra/module-graph.zh.md +574 -326
- package/kb/extra/persistence-changes/2026-09-11-initial.md +280 -0
- package/kb/extra/persistence-changes/2026-09-11-initial.zh.md +280 -0
- package/kb/extra/persistence-changes/2026-09-12-auto-review-error-metadata.md +52 -0
- package/kb/extra/persistence-changes/2026-09-12-auto-review-error-metadata.zh.md +52 -0
- package/kb/extra/persistence-changes/2026-09-14-image-offload.md +96 -0
- package/kb/extra/persistence-changes/2026-09-14-image-offload.zh.md +96 -0
- package/kb/extra/persistence-changes/2026-09-14-workspace-changes-event.md +48 -0
- package/kb/extra/persistence-changes/2026-09-14-workspace-changes-event.zh.md +48 -0
- package/kb/extra/persistence-changes/2026-09-16-session-format-v4.md +120 -0
- package/kb/extra/persistence-changes/2026-09-16-session-format-v4.zh.md +120 -0
- package/kb/extra/persistence-changes/2026-09-18-schedule-optional-title.md +48 -0
- package/kb/extra/persistence-changes/2026-09-18-schedule-optional-title.zh.md +48 -0
- package/kb/extra/persistence-changes/2026-09-20-unknown-child-catalog.md +48 -0
- package/kb/extra/persistence-changes/2026-09-20-unknown-child-catalog.zh.md +48 -0
- package/kb/extra/persistence-changes/2026-09-21-user-question-reply.md +60 -0
- package/kb/extra/persistence-changes/2026-09-21-user-question-reply.zh.md +60 -0
- package/kb/extra/persistence-changes/README.md +88 -0
- package/kb/extra/persistence-changes/README.zh.md +88 -0
- package/kb/extra/persistence-changes/historical-formats/README.md +75 -0
- package/kb/extra/persistence-changes/historical-formats/README.zh.md +75 -0
- package/kb/extra/persistence-changes/historical-formats/v0.md +5105 -0
- package/kb/extra/persistence-changes/historical-formats/v0.zh.md +5105 -0
- package/kb/extra/persistence-changes/historical-formats/v1.md +5107 -0
- package/kb/extra/persistence-changes/historical-formats/v1.zh.md +5107 -0
- package/kb/extra/persistence-changes/historical-formats/v2.md +5362 -0
- package/kb/extra/persistence-changes/historical-formats/v2.zh.md +5362 -0
- package/kb/extra/persistence-changes/historical-formats/v3.md +5634 -0
- package/kb/extra/persistence-changes/historical-formats/v3.zh.md +5634 -0
- package/kb/extra/persistence-changes/releases/README.md +103 -0
- package/kb/extra/persistence-changes/releases/README.zh.md +103 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.1.md +201 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.1.zh.md +201 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.2.md +261 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.2.zh.md +261 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.3.md +126 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.3.zh.md +126 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.4.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.4.zh.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.5.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.5.zh.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.1.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.1.zh.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.2.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.2.zh.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.3.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.3.zh.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.5.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.5.zh.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.6.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.6.zh.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.7.md +82 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.7.zh.md +82 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.8.md +110 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.8.zh.md +110 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.1.md +82 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.1.zh.md +82 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.2.md +119 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.2.zh.md +119 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.1.md +295 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.1.zh.md +295 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.2.md +286 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.2.zh.md +286 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.3.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.3.zh.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.4.md +95 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.4.zh.md +95 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.5.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.5.zh.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-rc.1.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-rc.1.zh.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.1.md +154 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.1.zh.md +154 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.2.md +86 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.2.zh.md +86 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.1.md +139 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.1.zh.md +139 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.2.md +95 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.2.zh.md +95 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.5-rc.1.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.5-rc.1.zh.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.5-rc.2.md +75 -0
- package/kb/extra/persistence-changes/releases/dsh-v0.1.5-rc.2.zh.md +75 -0
- package/kb/extra/rescope.md +1 -1
- package/kb/extra/rescope.zh.md +1 -1
- package/kb/extra/session-format-status.md +22 -6
- package/kb/extra/session-format-status.zh.md +22 -6
- package/kb/extra/subsystems/agent-team.md +52 -28
- package/kb/extra/subsystems/agent-team.zh.md +52 -28
- package/kb/extra/subsystems/attachment.md +19 -9
- package/kb/extra/subsystems/attachment.zh.md +19 -9
- package/kb/extra/subsystems/boot.md +323 -0
- package/kb/extra/subsystems/boot.zh.md +323 -0
- package/kb/extra/subsystems/browser-use.md +67 -0
- package/kb/extra/subsystems/browser-use.zh.md +67 -0
- package/kb/extra/subsystems/claude-code-mods.md +146 -0
- package/kb/extra/subsystems/claude-code-mods.zh.md +146 -0
- package/kb/extra/subsystems/computer-use.md +56 -0
- package/kb/extra/subsystems/computer-use.zh.md +56 -0
- package/kb/extra/subsystems/deliverables.md +178 -0
- package/kb/extra/subsystems/deliverables.zh.md +178 -0
- package/kb/extra/subsystems/extensions.md +6 -4
- package/kb/extra/subsystems/extensions.zh.md +6 -4
- package/kb/extra/subsystems/feedback.md +4 -4
- package/kb/extra/subsystems/feedback.zh.md +4 -4
- package/kb/extra/subsystems/mcp.md +139 -0
- package/kb/extra/subsystems/mcp.zh.md +139 -0
- package/kb/extra/subsystems/office-to-pdf.md +87 -0
- package/kb/extra/subsystems/office-to-pdf.zh.md +87 -0
- package/kb/extra/subsystems/otel.md +44 -0
- package/kb/extra/subsystems/otel.zh.md +44 -0
- package/kb/extra/subsystems/product-telemetry.md +79 -0
- package/kb/extra/subsystems/product-telemetry.zh.md +79 -0
- package/kb/extra/subsystems/ssh.md +135 -0
- package/kb/extra/subsystems/ssh.zh.md +135 -0
- package/kb/extra/subsystems/todo.md +3 -3
- package/kb/extra/subsystems/todo.zh.md +3 -3
- package/kb/extra/subsystems/voice-input.md +164 -0
- package/kb/extra/subsystems/voice-input.zh.md +164 -0
- package/kb/extra/subsystems/webhook.md +3 -3
- package/kb/extra/subsystems/webhook.zh.md +1 -1
- package/kb/extra/testing.md +3 -3
- package/kb/extra/testing.zh.md +3 -3
- package/kb/extra/ui-radius.md +115 -0
- package/kb/extra/ui-radius.zh.md +115 -0
- package/kb/extra/upgrade-guide/v0.1.7-rc.2/schedule-optional-bundle/guide.md +22 -0
- package/kb/extra/upgrade-guide/v0.1.7-rc.2/schedule-optional-bundle/guide.zh.md +22 -0
- package/kb/extra/upgrade-guide/v0.1.7-rc.2/transcript-view-legacy-normal/guide.md +25 -0
- package/kb/extra/upgrade-guide/v0.1.7-rc.2/transcript-view-legacy-normal/guide.zh.md +25 -0
- package/kb/extra/upgrade-guide/v0.2.0-rc.2/account-sign-in-errors/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.0-rc.2/account-sign-in-errors/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.0-rc.2/remove-runtime-invariants/guide.md +23 -0
- package/kb/extra/upgrade-guide/v0.2.0-rc.2/remove-runtime-invariants/guide.zh.md +23 -0
- package/kb/extra/upgrade-guide/v0.2.0-rc.2/schedule-bundle-retired/guide.md +22 -0
- package/kb/extra/upgrade-guide/v0.2.0-rc.2/schedule-bundle-retired/guide.zh.md +22 -0
- package/kb/extra/upgrade-guide/v0.2.0-rc.2/subpath-plugin-display-manifest/guide.md +27 -0
- package/kb/extra/upgrade-guide/v0.2.0-rc.2/subpath-plugin-display-manifest/guide.zh.md +27 -0
- package/kb/extra/web-styling.md +12 -3
- package/kb/extra/web-styling.zh.md +12 -3
- package/kb/meta/search-index.json +976 -256
- package/kb/meta/site-pages.txt +188 -188
- package/kb/meta/source.json +6 -6
- package/kb/meta/topics.md +10 -6
- package/kb/site/develop/basic/config.md +1 -0
- package/kb/site/develop/basic/index.md +1 -0
- package/kb/site/develop/basic/publish.md +9 -2
- package/kb/site/develop/basic/tool.md +1 -0
- package/kb/site/develop/cordis-tutorial/01-first-plugin.md +1 -0
- package/kb/site/develop/cordis-tutorial/02-lifecycle-and-effects.md +1 -0
- package/kb/site/develop/cordis-tutorial/03-services.md +1 -0
- package/kb/site/develop/cordis-tutorial/04-events.md +1 -0
- package/kb/site/develop/cordis-tutorial/05-config.md +28 -0
- package/kb/site/develop/cordis-tutorial/06-composition-and-hmr.md +3 -2
- package/kb/site/develop/cordis-tutorial/07-into-the-harness.md +1 -0
- package/kb/site/develop/cordis-tutorial/index.md +1 -0
- package/kb/site/develop/framework/events.md +1 -0
- package/kb/site/develop/framework/index.md +2 -1
- package/kb/site/develop/framework/service.md +1 -0
- package/kb/site/develop/practice/dynamic-cordis.md +9 -8
- package/kb/site/develop/practice/index.md +1 -0
- package/kb/site/develop/practice/llm-adapter.md +2 -1
- package/kb/site/en/develop/basic/config.md +1 -0
- package/kb/site/en/develop/basic/index.md +1 -0
- package/kb/site/en/develop/basic/publish.md +9 -2
- package/kb/site/en/develop/basic/tool.md +1 -0
- package/kb/site/en/develop/cordis-tutorial/01-first-plugin.md +1 -0
- package/kb/site/en/develop/cordis-tutorial/02-lifecycle-and-effects.md +1 -0
- package/kb/site/en/develop/cordis-tutorial/03-services.md +1 -0
- package/kb/site/en/develop/cordis-tutorial/04-events.md +1 -0
- package/kb/site/en/develop/cordis-tutorial/05-config.md +28 -0
- package/kb/site/en/develop/cordis-tutorial/06-composition-and-hmr.md +3 -2
- package/kb/site/en/develop/cordis-tutorial/07-into-the-harness.md +1 -0
- package/kb/site/en/develop/cordis-tutorial/index.md +1 -0
- package/kb/site/en/develop/framework/events.md +1 -0
- package/kb/site/en/develop/framework/index.md +2 -1
- package/kb/site/en/develop/framework/service.md +1 -0
- package/kb/site/en/develop/practice/dynamic-cordis.md +9 -8
- package/kb/site/en/develop/practice/index.md +1 -0
- package/kb/site/en/develop/practice/llm-adapter.md +2 -1
- package/kb/site/en/guide/github-review.md +1 -0
- package/kb/site/en/guide/mcp-memory.md +1 -0
- package/kb/site/en/guide/network-proxy.md +2 -1
- package/kb/site/en/guide/providers-custom-form.png +0 -0
- package/kb/site/en/guide/providers-models-page.png +0 -0
- package/kb/site/en/guide/providers.md +97 -82
- package/kb/site/en/guide/public-deployments.md +36 -0
- package/kb/site/en/guide/python-sdk.md +42 -21
- package/kb/site/en/guide/quickstart.md +2 -0
- package/kb/site/en/guide/schedule.md +70 -11
- package/kb/site/en/reference/agent-lifecycle.md +1 -0
- package/kb/site/en/reference/api-gateway.md +13 -11
- package/kb/site/en/reference/capability-seams.md +177 -59
- package/kb/site/en/reference/config-catalog.md +1758 -821
- package/kb/site/en/reference/cookbook/adding-a-package.md +57 -3
- package/kb/site/en/reference/cookbook/adding-a-settings-card.md +35 -64
- package/kb/site/en/reference/cookbook/adding-a-tool.md +4 -3
- package/kb/site/en/reference/cookbook/adding-an-llm-adapter.md +1 -0
- package/kb/site/en/reference/cookbook/extension-cookbook.md +6 -5
- package/kb/site/en/reference/cordis-api/context.md +1 -0
- package/kb/site/en/reference/cordis-api/events.md +1 -0
- package/kb/site/en/reference/cordis-api/fiber.md +4 -3
- package/kb/site/en/reference/cordis-api/inherited.md +16 -16
- package/kb/site/en/reference/cordis-api/registry.md +1 -0
- package/kb/site/en/reference/cordis-api/service.md +1 -0
- package/kb/site/en/reference/cordis-primer.md +1 -0
- package/kb/site/en/reference/index.md +18 -11
- package/kb/site/en/reference/persistence-catalog.md +7687 -54
- package/kb/site/en/reference/subsystems/approval.md +2 -1
- package/kb/site/en/reference/subsystems/client-modules.md +23 -15
- package/kb/site/en/reference/subsystems/client-resources.md +3 -1
- package/kb/site/en/reference/subsystems/commands.md +6 -1
- package/kb/site/en/reference/subsystems/compaction.md +50 -3
- package/kb/site/en/reference/subsystems/conversation.md +36 -6
- package/kb/site/en/reference/subsystems/core.md +97 -257
- package/kb/site/en/reference/subsystems/credentials.md +169 -5
- package/kb/site/en/reference/subsystems/filesystem.md +11 -0
- package/kb/site/en/reference/subsystems/goal.md +2 -1
- package/kb/site/en/reference/subsystems/index.md +16 -5
- package/kb/site/en/reference/subsystems/jobs.md +337 -127
- package/kb/site/en/reference/subsystems/llm-streaming.md +76 -36
- package/kb/site/en/reference/subsystems/lsp.md +1 -0
- package/kb/site/en/reference/subsystems/permission-presets.md +66 -29
- package/kb/site/en/reference/subsystems/persistence.md +4 -3
- package/kb/site/en/reference/subsystems/plan.md +2 -1
- package/kb/site/en/reference/subsystems/ptc-runtime.md +236 -0
- package/kb/site/en/reference/subsystems/sandbox.md +7 -5
- package/kb/site/en/reference/subsystems/schedule.md +392 -33
- package/kb/site/en/reference/subsystems/scope.md +2 -1
- package/kb/site/en/reference/subsystems/session-projection.md +22 -19
- package/kb/site/en/reference/subsystems/session-query.md +1 -0
- package/kb/site/en/reference/subsystems/session-reference.md +8 -6
- package/kb/site/en/reference/subsystems/session-telemetry.md +7 -4
- package/kb/site/en/reference/subsystems/session-title.md +6 -5
- package/kb/site/en/reference/subsystems/session.md +199 -81
- package/kb/site/en/reference/subsystems/settings.md +43 -292
- package/kb/site/en/reference/subsystems/shell.md +37 -28
- package/kb/site/en/reference/subsystems/sidebar-right.md +23 -12
- package/kb/site/en/reference/subsystems/skills.md +5 -6
- package/kb/site/en/reference/subsystems/slots.md +34 -13
- package/kb/site/en/reference/subsystems/spill.md +4 -3
- package/kb/site/en/reference/subsystems/storage.md +2 -2
- package/kb/site/en/reference/subsystems/subagent.md +50 -64
- package/kb/site/en/reference/subsystems/subprocess.md +17 -18
- package/kb/site/en/reference/subsystems/system-prompt.md +4 -1
- package/kb/site/en/reference/subsystems/terminal.md +1 -0
- package/kb/site/en/reference/subsystems/token-meter.md +1 -0
- package/kb/site/en/reference/subsystems/tools.md +40 -12
- package/kb/site/en/reference/subsystems/typert.md +153 -10
- package/kb/site/en/reference/subsystems/user-questions.md +131 -1
- package/kb/site/en/reference/subsystems/web-client.md +15 -9
- package/kb/site/en/reference/subsystems/web-server.md +74 -1
- package/kb/site/en/reference/subsystems/web.md +1 -0
- package/kb/site/en/reference/subsystems/workflow.md +10 -9
- package/kb/site/en/reference/subsystems/workspace.md +294 -34
- package/kb/site/en/reference/tool-catalog.md +782 -331
- package/kb/site/en/reference/tool-execution-pipeline.md +7 -3
- package/kb/site/guide/github-review.md +1 -0
- package/kb/site/guide/mcp-memory.md +1 -0
- package/kb/site/guide/network-proxy.md +2 -1
- package/kb/site/guide/providers-custom-form.zh.png +0 -0
- package/kb/site/guide/providers-models-page.zh.png +0 -0
- package/kb/site/guide/providers.md +109 -94
- package/kb/site/guide/public-deployments.md +36 -0
- package/kb/site/guide/python-sdk.md +42 -21
- package/kb/site/guide/quickstart.md +2 -0
- package/kb/site/guide/schedule.md +70 -11
- package/kb/site/reference/agent-lifecycle.md +1 -0
- package/kb/site/reference/api-gateway.md +13 -11
- package/kb/site/reference/capability-seams.md +177 -59
- package/kb/site/reference/config-catalog.md +1760 -822
- package/kb/site/reference/cookbook/adding-a-package.md +55 -3
- package/kb/site/reference/cookbook/adding-a-settings-card.md +35 -64
- package/kb/site/reference/cookbook/adding-a-tool.md +4 -3
- package/kb/site/reference/cookbook/adding-an-llm-adapter.md +1 -0
- package/kb/site/reference/cookbook/extension-cookbook.md +6 -5
- package/kb/site/reference/cordis-api/context.md +1 -0
- package/kb/site/reference/cordis-api/events.md +1 -0
- package/kb/site/reference/cordis-api/fiber.md +4 -3
- package/kb/site/reference/cordis-api/inherited.md +16 -16
- package/kb/site/reference/cordis-api/registry.md +1 -0
- package/kb/site/reference/cordis-api/service.md +1 -0
- package/kb/site/reference/cordis-primer.md +1 -0
- package/kb/site/reference/index.md +18 -11
- package/kb/site/reference/persistence-catalog.md +7693 -60
- package/kb/site/reference/subsystems/approval.md +2 -1
- package/kb/site/reference/subsystems/client-modules.md +23 -15
- package/kb/site/reference/subsystems/client-resources.md +3 -1
- package/kb/site/reference/subsystems/commands.md +6 -1
- package/kb/site/reference/subsystems/compaction.md +50 -3
- package/kb/site/reference/subsystems/conversation.md +35 -5
- package/kb/site/reference/subsystems/core.md +97 -257
- package/kb/site/reference/subsystems/credentials.md +169 -5
- package/kb/site/reference/subsystems/filesystem.md +11 -0
- package/kb/site/reference/subsystems/goal.md +2 -1
- package/kb/site/reference/subsystems/index.md +16 -5
- package/kb/site/reference/subsystems/jobs.md +336 -126
- package/kb/site/reference/subsystems/llm-streaming.md +76 -36
- package/kb/site/reference/subsystems/lsp.md +1 -0
- package/kb/site/reference/subsystems/permission-presets.md +66 -29
- package/kb/site/reference/subsystems/persistence.md +4 -3
- package/kb/site/reference/subsystems/plan.md +2 -1
- package/kb/site/reference/subsystems/ptc-runtime.md +236 -0
- package/kb/site/reference/subsystems/sandbox.md +7 -5
- package/kb/site/reference/subsystems/schedule.md +392 -33
- package/kb/site/reference/subsystems/scope.md +2 -1
- package/kb/site/reference/subsystems/session-projection.md +22 -19
- package/kb/site/reference/subsystems/session-query.md +1 -0
- package/kb/site/reference/subsystems/session-reference.md +8 -6
- package/kb/site/reference/subsystems/session-telemetry.md +7 -4
- package/kb/site/reference/subsystems/session-title.md +6 -5
- package/kb/site/reference/subsystems/session.md +199 -81
- package/kb/site/reference/subsystems/settings.md +43 -292
- package/kb/site/reference/subsystems/shell.md +37 -28
- package/kb/site/reference/subsystems/sidebar-right.md +23 -12
- package/kb/site/reference/subsystems/skills.md +5 -6
- package/kb/site/reference/subsystems/slots.md +34 -13
- package/kb/site/reference/subsystems/spill.md +3 -2
- package/kb/site/reference/subsystems/storage.md +2 -2
- package/kb/site/reference/subsystems/subagent.md +49 -63
- package/kb/site/reference/subsystems/subprocess.md +17 -18
- package/kb/site/reference/subsystems/system-prompt.md +4 -1
- package/kb/site/reference/subsystems/terminal.md +1 -0
- package/kb/site/reference/subsystems/token-meter.md +1 -0
- package/kb/site/reference/subsystems/tools.md +40 -12
- package/kb/site/reference/subsystems/typert.md +153 -10
- package/kb/site/reference/subsystems/user-questions.md +132 -2
- package/kb/site/reference/subsystems/web-client.md +15 -9
- package/kb/site/reference/subsystems/web-server.md +74 -1
- package/kb/site/reference/subsystems/web.md +1 -0
- package/kb/site/reference/subsystems/workflow.md +10 -9
- package/kb/site/reference/subsystems/workspace.md +294 -34
- package/kb/site/reference/tool-catalog.md +784 -333
- package/kb/site/reference/tool-execution-pipeline.md +7 -3
- package/package.json +2 -2
- package/skills/dsh-plugin-dev-kb.md +5 -4
- package/kb/site/en/reference/subsystems/code-runtime.md +0 -198
- package/kb/site/en/reference/subsystems/invariants.md +0 -91
- package/kb/site/reference/subsystems/code-runtime.md +0 -198
- package/kb/site/reference/subsystems/invariants.md +0 -91
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
editSource: "docs/subsystems/session.zh.md"
|
|
3
|
+
rawMarkdownPath: "reference/subsystems/session.md"
|
|
3
4
|
outline: [2,3]
|
|
4
5
|
---
|
|
5
6
|
|
|
@@ -14,8 +15,8 @@ outline: [2,3]
|
|
|
14
15
|
仅追加的事件类型。可通过声明合并扩展:插件通过 declaration merging 声明额外的事件类型。例如[压缩(compaction) seam](./compaction.md) 添加了 `compaction/start` / `compaction/summary` / `compaction/end`,`@deepseek-ai/dsh-hook-protocol` 为钩子桥接添加了仅记录日志的 `hook/invoked` / `hook/result` 记录。与 `compaction/*` 一样,这些都不是 `SurfaceEventType`(没有 `surfaceOp`)。生成的[持久化日志事件目录](../persistence-catalog.md)列举了所有成员(核心与合并扩展的),包含其 payload、surface 标记与声明位置。
|
|
15
16
|
|
|
16
17
|
```ts type-equiv
|
|
17
|
-
/** A user-role specialization of the
|
|
18
|
-
interface UserMessage extends
|
|
18
|
+
/** A user-role specialization of the shared message representation. */
|
|
19
|
+
interface UserMessage extends MessageBase {
|
|
19
20
|
readonly role: 'user'
|
|
20
21
|
}
|
|
21
22
|
```
|
|
@@ -56,6 +57,14 @@ interface SessionEventMap {
|
|
|
56
57
|
* project their `content` verbatim; `source` tells them apart.
|
|
57
58
|
*/
|
|
58
59
|
'user/message': UserMessage
|
|
60
|
+
/** An incremental agent session change admitted at the named turn and step. */
|
|
61
|
+
'developer/message': {
|
|
62
|
+
turn: number
|
|
63
|
+
step: number
|
|
64
|
+
message: DeveloperMessage
|
|
65
|
+
/** Earlier request/header defining every tool addition; required exactly when additions are present. */
|
|
66
|
+
headerSeq?: SessionSeq
|
|
67
|
+
}
|
|
59
68
|
/**
|
|
60
69
|
* The rendered system prompt on the model-visible surface. The loop appends
|
|
61
70
|
* the first one as surface node 0 before the step's first `user/message`.
|
|
@@ -102,7 +111,9 @@ interface SessionEventMap {
|
|
|
102
111
|
'tool/call': { turn: number; step: number; callId: ToolCallId; name: string; arguments: string }
|
|
103
112
|
/**
|
|
104
113
|
* A completed tool call's model-facing result, optional internal failure
|
|
105
|
-
* identity, and optional tool-private `meta`
|
|
114
|
+
* identity and user-facing reason, and optional tool-private `meta`
|
|
115
|
+
* presentation payload. The reason remains outside the model-facing message.
|
|
116
|
+
* `meta` is
|
|
106
117
|
* opaque to the core (the producing tool owns its shape and reads it back in
|
|
107
118
|
* `presentResult`) but MUST be JSON-serializable: `Session.append`
|
|
108
119
|
* runtime-validates all event data with `isJsonValue`, so a non-serializable
|
|
@@ -115,8 +126,11 @@ interface SessionEventMap {
|
|
|
115
126
|
turn: number
|
|
116
127
|
step: number
|
|
117
128
|
message: ToolResultMessage
|
|
118
|
-
/**
|
|
119
|
-
|
|
129
|
+
/**
|
|
130
|
+
* Optional failure identity and raw user-facing reason, outside model content;
|
|
131
|
+
* allowed only when the message has `isError: true`.
|
|
132
|
+
*/
|
|
133
|
+
error?: { name: string; code: string; reason?: string }
|
|
120
134
|
meta?: JsonValue
|
|
121
135
|
}
|
|
122
136
|
/**
|
|
@@ -126,7 +140,7 @@ interface SessionEventMap {
|
|
|
126
140
|
'request/header': {
|
|
127
141
|
header: EpochHeader
|
|
128
142
|
reason: RequestHeaderReason
|
|
129
|
-
/**
|
|
143
|
+
/** This request begins a distinct model-message series, independently of the header reason. */
|
|
130
144
|
startsSeries?: true
|
|
131
145
|
}
|
|
132
146
|
/**
|
|
@@ -137,18 +151,20 @@ interface SessionEventMap {
|
|
|
137
151
|
*/
|
|
138
152
|
'request/context': RequestContext
|
|
139
153
|
/**
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
154
|
+
* Separates inherited or restored history from later lifecycle-owned work.
|
|
155
|
+
* This log-only marker need not be at {@link Session.firstLiveSeq}: a fork
|
|
156
|
+
* seed can already contain its tagged marker and child-owned synthetic
|
|
157
|
+
* closers before construction.
|
|
144
158
|
*
|
|
145
159
|
* A fresh fork child owns one `{ inherited: true }` marker at its exact
|
|
146
160
|
* inherited-prefix cut, even when that prefix ends in an ancestor marker.
|
|
147
|
-
*
|
|
148
|
-
*
|
|
161
|
+
* `buildForkSeed` appends that marker before any synthetic closers; the
|
|
162
|
+
* `Session` constructor supplies it when given only the inherited prefix.
|
|
163
|
+
* The last tagged marker is the current Session's cut; untagged markers
|
|
164
|
+
* keep ordinary restore and replay lifecycle boundaries.
|
|
149
165
|
*
|
|
150
|
-
* `Session`
|
|
151
|
-
*
|
|
166
|
+
* Only the `Session` constructor and `buildForkSeed` may create this marker.
|
|
167
|
+
* Session append does not reject other writers, so a plugin appending one
|
|
152
168
|
* would silently classify every live bracket before it as seed history.
|
|
153
169
|
*
|
|
154
170
|
* An owner of a standalone open/close bracket (`compaction/start` …
|
|
@@ -168,7 +184,7 @@ interface SessionEventMap {
|
|
|
168
184
|
|
|
169
185
|
### 请求头事件:`request/header`
|
|
170
186
|
|
|
171
|
-
请求信封(即 `EpochHeader`:调用配置 + 适配器所提供默认值的标记 + 已组装的工具 schema)会作为会话状态写入日志,因此每个对话请求都是日志的纯函数(见可重建性 Agent Note)。渲染后的系统提示词不属于请求头:它是派生历史,即 surface 第 0 号节点上的 `system/message` 事件以及任何后续的历史内系统节点([决策](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/architecture/2026-09-02-system-prompt-as-surface-node.zh.md)),因此提示词变更替换或追加一个系统节点,而请求头保持不变。带有 reason `'initial'` 或 `'resume'` 的完整 `request/header` 快照记录每个 agent loop 实例的边界;请求变化时会追加 reason 为 `'change'` 的快照;未变的信封显式开启消息序列或跟随 surface 替换时,会追加 reason 为 `'series'`
|
|
187
|
+
请求信封(即 `EpochHeader`:调用配置 + 适配器所提供默认值的标记 + 已组装的工具 schema)会作为会话状态写入日志,因此每个对话请求都是日志的纯函数(见可重建性 Agent Note)。渲染后的系统提示词不属于请求头:它是派生历史,即 surface 第 0 号节点上的 `system/message` 事件以及任何后续的历史内系统节点([决策](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/architecture/2026-09-02-system-prompt-as-surface-node.zh.md)),因此提示词变更替换或追加一个系统节点,而请求头保持不变。带有 reason `'initial'` 或 `'resume'` 的完整 `request/header` 快照记录每个 agent loop 实例的边界;请求变化时会追加 reason 为 `'change'` 的快照;未变的信封显式开启消息序列或跟随 surface 替换时,会追加 reason 为 `'series'` 的快照。如果 `'initial'`、`'resume'` 或 `'change'` 快照所属请求同时开启序列,它会携带 `startsSeries: true`;reason `'series'` 已记录这一事实。普通的仅追加后续 Turn,以及同一模型消息序列内的后续 Step 与重试沿用最新快照。`foldRequestHeader(events)` 通过选择最新快照重建请求头。该事件不是 `SurfaceEventType`,不产生 LLM 消息。
|
|
172
188
|
|
|
173
189
|
```ts type-equiv
|
|
174
190
|
/**
|
|
@@ -184,6 +200,10 @@ interface EpochHeader {
|
|
|
184
200
|
adapterDefaults?: LlmCallConfigAdapterDefaults
|
|
185
201
|
/** Assembled tool schemas; absent for a tool-less request. */
|
|
186
202
|
tools?: ToolSchema[]
|
|
203
|
+
/** Retired request text; system prompts belong to system/message events.
|
|
204
|
+
* @persistenceReserved
|
|
205
|
+
*/
|
|
206
|
+
system?: never
|
|
187
207
|
}
|
|
188
208
|
```
|
|
189
209
|
|
|
@@ -191,7 +211,7 @@ interface EpochHeader {
|
|
|
191
211
|
|
|
192
212
|
### 路由容量事件:`request/context`
|
|
193
213
|
|
|
194
|
-
请求所解析到的路由的上下文元数据是独立的已记录状态,在同一步骤内紧随 `request/header` 追加,且仅在提供方、模型、容量或 `systemPromptUpdate` 模式与上一条记录不同时追加。它保持在 `EpochHeader` 之外,因为该类型是 `headerEquals` 逐字段比较的重建约定。容量与更新模式描述的是路由,不是请求输入,把它们折叠进去会让一次路由变化被登记为请求信封的 `change`,也会把适配器元数据拉进 loop
|
|
214
|
+
请求所解析到的路由的上下文元数据是独立的已记录状态,在同一步骤内紧随 `request/header` 追加,且仅在提供方、模型、容量或 `systemPromptUpdate` 模式与上一条记录不同时追加。它保持在 `EpochHeader` 之外,因为该类型是 `headerEquals` 逐字段比较的重建约定。容量与更新模式描述的是路由,不是请求输入,把它们折叠进去会让一次路由变化被登记为请求信封的 `change`,也会把适配器元数据拉进 loop 的请求重建。与 `request/header` 一样,它不是 `SurfaceEventType`,也不产生 LLM 消息。`session.requestContext()` 以增量方式归并最新一条记录;agent loop 在决定变化后的系统提示词是替换最新的系统节点还是追加到已缓存历史之后时,读取该记录的 `systemPromptUpdate`([决策规则](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/agent-loop/README.zh.md#understand-the-implementation))。适配器不公布容量的路由会以缺失 `contextWindow` 的形式记录,因此新记录可以清除较早路由的容量;未声明更新模式的路由同样会清除较早路由的 `systemPromptUpdate`。
|
|
195
215
|
|
|
196
216
|
```ts type-equiv
|
|
197
217
|
/** Registration-bound metadata for one resolved model route. */
|
|
@@ -275,13 +295,13 @@ type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
275
295
|
|
|
276
296
|
`SessionEventType = keyof SessionEventMap`。由于 `SessionEventMap` 可通过合并扩展,对 `SessionEvent` 的 switch 语句禁止使用 `assertNever`:插件添加的变体是合法的未知值;处理已知 case 后在 `default` 中放行。
|
|
277
297
|
|
|
278
|
-
每个 surface 事件都要求 `surfaceOp`;已知仅日志事件禁止两个 surface 元数据字段。原生未知或已退役的可忽略信封保持不透明。`assistant/message` 嵌入其提供方 stream,并禁止 `sourceEventSeqs`。System、user 与 tool surface
|
|
298
|
+
每个 surface 事件都要求 `surfaceOp`;已知仅日志事件禁止两个 surface 元数据字段。原生未知或已退役的可忽略信封保持不透明。`assistant/message` 嵌入其提供方 stream,并禁止 `sourceEventSeqs`。System、user 与 tool surface 事件可以在来源归属或替换覆盖需要时引用完整、非空且唯一的较早事件集合。`tool/result` 仅在消息带有 `isError: true` 时可以携带 `data.error`;失败结果的失败身份仍可省略。
|
|
279
299
|
|
|
280
300
|
<a id="surface-types"></a>
|
|
281
301
|
|
|
282
302
|
## Surface 类型
|
|
283
303
|
|
|
284
|
-
|
|
304
|
+
产生消息的类型(`SurfaceEventType`:`system/message`、`developer/message`、`user/message`、`assistant/message`、`tool/result`)携带 surface 元数据,用来声明它们如何加入有序的派生 surface。`system/message` 承载渲染后的系统提示词:循环把第一条追加为 surface 第 0 号节点,并在提示词变化时恰好替换最新的系统节点,或在历史内路由上追加一条新的;surface 折叠拒绝任何其他覆盖第 0 号节点 `system/message` 的替换,而后续系统节点是普通历史,压缩替换可以遮蔽它。见 [session surface Agent Note](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/architecture/2026-06-18-session-surface.zh.md)。
|
|
285
305
|
|
|
286
306
|
### `SurfaceEventType`:事件类型中产生消息的子集
|
|
287
307
|
|
|
@@ -294,6 +314,7 @@ type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
294
314
|
*/
|
|
295
315
|
type SurfaceEventType =
|
|
296
316
|
| 'system/message'
|
|
317
|
+
| 'developer/message'
|
|
297
318
|
| 'user/message'
|
|
298
319
|
| 'assistant/message'
|
|
299
320
|
| 'tool/result'
|
|
@@ -344,11 +365,47 @@ type SurfaceIntent<T extends SurfaceEventType = SurfaceEventType> = {
|
|
|
344
365
|
|
|
345
366
|
`assistant/message` 不能携带 `sourceEventSeqs`;它的 `stream` 拥有精确 provider 证据。其他 surface event 不引用较早 event 时省略该字段,需要引用时使用完整非空 list。
|
|
346
367
|
|
|
368
|
+
<a id="plugin-owned-message-projections"></a>
|
|
369
|
+
### 插件拥有的消息投影
|
|
370
|
+
|
|
371
|
+
修改内容的插件用 `@messageProjection` 标记事件声明,并通过 `ctx.sessions.registerMessageProjection()` 注册纯处理器。Session 在提交前通过处理器校验完整决策,应用其不可变消息更新,并推进 `contentGeneration`。缺少处理器时拒绝操作,包括恢复和独立折叠,卸载已经使用的处理器后也会拒绝读取缓存。独立读取器将处理器显式传给 `foldSurface(events, projections)`,并通过 `deriveEventMessage()` 应用 `projectedMessages`。当前格式目录为离线读取器装配第一方处理器。[图片省略插件](./compaction.md#image-offload)拥有图片专用的事件及解释逻辑。
|
|
372
|
+
|
|
373
|
+
```ts type-equiv
|
|
374
|
+
/** Readonly history immediately before a message-projection event. */
|
|
375
|
+
interface SessionMessageProjectionContext {
|
|
376
|
+
/** Current message-producing event sequences in model-visible order. */
|
|
377
|
+
nodes: readonly SessionSeq[]
|
|
378
|
+
/** Contiguous event window; entries at or beyond the candidate seq are not committed inputs. */
|
|
379
|
+
events: readonly SessionEvent[]
|
|
380
|
+
/** Absolute sequence of the window's first event. */
|
|
381
|
+
baseSeq: SessionLogOffset
|
|
382
|
+
/** Previously projected messages keyed by their original event sequences. */
|
|
383
|
+
messages: ReadonlyMap<SessionSeq, Message>
|
|
384
|
+
}
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
```ts type-equiv
|
|
388
|
+
/** Pure interpretation of one plugin-owned event that changes existing message content. */
|
|
389
|
+
interface SessionMessageProjection<T extends SessionEventType = SessionEventType> {
|
|
390
|
+
/** Event interpreted by this definition; declare it with `@messageProjection` in SessionEventMap. */
|
|
391
|
+
type: T
|
|
392
|
+
/**
|
|
393
|
+
* Validate the complete durable decision before returning any updates. Preserve
|
|
394
|
+
* message identities and publish immutable copies without mutating the input.
|
|
395
|
+
* @param event - candidate event, not yet applied to the supplied history.
|
|
396
|
+
* @param context - history preceding this decision.
|
|
397
|
+
* @returns changed current messages keyed by their original sequences.
|
|
398
|
+
* @throws when the durable decision cannot be applied to this history.
|
|
399
|
+
*/
|
|
400
|
+
project(event: SessionEvent<T>, context: SessionMessageProjectionContext): ReadonlyMap<SessionSeq, Message>
|
|
401
|
+
}
|
|
402
|
+
```
|
|
403
|
+
|
|
347
404
|
### `SessionSurface`:实时只读 surface 投影
|
|
348
405
|
|
|
349
406
|
`Session.surface` 返回会话稳定的 `SessionSurface` 视图。同一个增量管理器在提交前校验追加候选事件,并根据已提交事件推进该投影;调用方可以观察成员关系和替换代次,但不能调用校验。
|
|
350
407
|
|
|
351
|
-
`SurfaceManager(log, baseSeq?)` 也可以折叠一个连续的已加载窗口,其第一个事件的绝对序号为 `baseSeq`。每个事件在该绝对序号空间中仍保持连续;如果替换跨过窗口头部,由于其声明的范围并不存在,该替换会失败。
|
|
408
|
+
`SurfaceManager(log, baseSeq?, projections?)` 也可以折叠一个连续的已加载窗口,其第一个事件的绝对序号为 `baseSeq`。每个事件在该绝对序号空间中仍保持连续;如果替换跨过窗口头部,由于其声明的范围并不存在,该替换会失败。
|
|
352
409
|
|
|
353
410
|
```ts type-equiv
|
|
354
411
|
/** Readonly live projection of the message-producing session events. */
|
|
@@ -357,12 +414,14 @@ interface SessionSurface {
|
|
|
357
414
|
readonly nodes: readonly SessionSeq[]
|
|
358
415
|
/** Monotonic count of committed positional replacements. */
|
|
359
416
|
readonly replaceGeneration: number
|
|
417
|
+
/** Monotonic count of committed replacements and plugin-owned message changes. */
|
|
418
|
+
readonly contentGeneration: number
|
|
360
419
|
}
|
|
361
420
|
```
|
|
362
421
|
|
|
363
422
|
### `SurfaceFoldReplacement` 与 `SurfaceFoldResult`:完整的 surface 回放
|
|
364
423
|
|
|
365
|
-
`foldSurface(events)` 返回一份独立的当前事件 seq 列表,以及每个声明的替换范围实际遮蔽的 seq。实时管理器复用同一套状态转换,但不保留替换历史。每提交一次替换,其 `replaceGeneration` 就递增一次,使增量消费方能够区分纯尾部增长与重写。
|
|
424
|
+
`foldSurface(events, projections)` 返回一份独立的当前事件 seq 列表,以及每个声明的替换范围实际遮蔽的 seq。实时管理器复用同一套状态转换,但不保留替换历史。每提交一次替换,其 `replaceGeneration` 就递增一次,使增量消费方能够区分纯尾部增长与重写。
|
|
366
425
|
|
|
367
426
|
```ts type-equiv
|
|
368
427
|
/** One replacement operation observed while folding a session surface. */
|
|
@@ -385,6 +444,8 @@ interface SurfaceFoldResult {
|
|
|
385
444
|
nodes: SessionSeq[]
|
|
386
445
|
/** Replacement operations in event order. */
|
|
387
446
|
replacements: SurfaceFoldReplacement[]
|
|
447
|
+
/** Immutable projected messages, keyed by their original event sequences. */
|
|
448
|
+
projectedMessages: ReadonlyMap<SessionSeq, Message>
|
|
388
449
|
}
|
|
389
450
|
```
|
|
390
451
|
|
|
@@ -418,29 +479,26 @@ declare class Session {
|
|
|
418
479
|
/** The session identity, derived from its durable header's single copy. */
|
|
419
480
|
get id(): SessionId;
|
|
420
481
|
/**
|
|
421
|
-
* The
|
|
422
|
-
*
|
|
423
|
-
*
|
|
424
|
-
*
|
|
425
|
-
* the constructor-input boundary for lifecycle ownership and persistence
|
|
426
|
-
* adoption; consumers that need complete canonical history still start at
|
|
427
|
-
* seq 0. Distinct from {@link inheritedEventCount}, the DURABLE
|
|
428
|
-
* fork-lineage cut: a resumed session's constructor seed is its full stored
|
|
429
|
-
* log, while the inherited count keeps the original fork value — this field is the
|
|
430
|
-
* in-process construction fact.
|
|
431
|
-
*
|
|
432
|
-
* Not persisted itself: a seeded session projects it into the log as the
|
|
433
|
-
* `session/end-seed` event, which is what a consumer reading STORED history
|
|
434
|
-
* reads. Locate the LAST such event, not necessarily one at this seq — a
|
|
435
|
-
* seed already ending in one is not re-marked, so reopening an untouched
|
|
436
|
-
* session leaves that event at a smaller seq than `firstLiveSeq`. Prefer
|
|
437
|
-
* this field in-process: it is exact before the marker reaches storage.
|
|
482
|
+
* The constructor seed length (0 without one), before any marker appended
|
|
483
|
+
* during construction. Seed events never publish on `session/event`. A
|
|
484
|
+
* marker appended before the store attaches occupies this seq without
|
|
485
|
+
* publishing either; otherwise this seq is available for the next append.
|
|
438
486
|
*
|
|
439
|
-
*
|
|
440
|
-
*
|
|
441
|
-
*
|
|
442
|
-
|
|
487
|
+
* This in-process offset is not persisted. A fork seed can already contain
|
|
488
|
+
* the child's inherited marker and synthetic closers, so its child-owned
|
|
489
|
+
* history starts at {@link inheritedEventCount}, before this offset. A
|
|
490
|
+
* resumed Session's seed contains its full stored log, while its inherited
|
|
491
|
+
* count keeps the durable fork cut. Consumers needing complete canonical
|
|
492
|
+
* history start at seq 0.
|
|
493
|
+
*/
|
|
443
494
|
readonly firstLiveSeq: SessionLogOffset;
|
|
495
|
+
/**
|
|
496
|
+
* First event produced for this object lifecycle. A new fork includes its
|
|
497
|
+
* child-owned seed marker and closers; a restored Session starts after its
|
|
498
|
+
* complete stored prefix. This in-process capture offset is not persisted.
|
|
499
|
+
*/
|
|
500
|
+
readonly firstLifecycleSeq: SessionLogOffset;
|
|
501
|
+
|
|
444
502
|
/**
|
|
445
503
|
* Create a detached session by validating and snapshotting borrowed seed
|
|
446
504
|
* events and storage metadata.
|
|
@@ -448,14 +506,17 @@ declare class Session {
|
|
|
448
506
|
* @param seed - optional borrowed replay or fork events.
|
|
449
507
|
* @param header - optional borrowed storage metadata.
|
|
450
508
|
* @param inheritedEventCount - exact fork-inherited prefix length for a seeded header.
|
|
509
|
+
* @param projections - pure interpreters for plugin-owned message changes.
|
|
451
510
|
* @returns a detached session.
|
|
511
|
+
* @throws when a seed event requires a missing message interpreter or fails validation.
|
|
452
512
|
*/
|
|
453
513
|
static create(
|
|
454
514
|
id: SessionId,
|
|
455
515
|
seed?: readonly SessionEvent[],
|
|
456
516
|
header?: SessionHeader,
|
|
457
517
|
inheritedEventCount?: SessionLogOffset,
|
|
458
|
-
|
|
518
|
+
projections?: readonly SessionMessageProjection[],
|
|
519
|
+
): Session;
|
|
459
520
|
/**
|
|
460
521
|
* Restore a detached session by adopting an independently owned or deeply frozen seed.
|
|
461
522
|
* Runtime-required event fields, event envelopes, sequence continuity, surface
|
|
@@ -467,7 +528,9 @@ declare class Session {
|
|
|
467
528
|
* @param header - independently owned storage metadata.
|
|
468
529
|
* @param inheritedEventCount - exact fork-inherited prefix length decoded from storage.
|
|
469
530
|
* @param eventState - aliasing state carried from the operation that produced the seed.
|
|
531
|
+
* @param projections - pure interpreters for plugin-owned message changes.
|
|
470
532
|
* @returns a restored detached session.
|
|
533
|
+
* @throws when a seed event requires a missing message interpreter or fails validation.
|
|
471
534
|
*/
|
|
472
535
|
static fromRestore(
|
|
473
536
|
id: SessionId,
|
|
@@ -475,9 +538,12 @@ declare class Session {
|
|
|
475
538
|
header: SessionHeader,
|
|
476
539
|
inheritedEventCount: SessionLogOffset,
|
|
477
540
|
eventState: SessionSeedEventState,
|
|
478
|
-
|
|
541
|
+
projections?: readonly SessionMessageProjection[],
|
|
542
|
+
): Session;
|
|
479
543
|
/**
|
|
480
544
|
* Return the immutable event stored at one exact sequence number.
|
|
545
|
+
* @deprecated Existing logic may remain unmigrated for now, but new calls are prohibited.
|
|
546
|
+
* See the [Agent Note](../../../../.agents/notes/implemented/architecture/2026-09-09-deprecate-synchronous-session-event-reads.md).
|
|
481
547
|
* @param seq - event sequence number.
|
|
482
548
|
* @returns the accepted event, or undefined when the log does not contain it.
|
|
483
549
|
*/
|
|
@@ -486,6 +552,8 @@ declare class Session {
|
|
|
486
552
|
* Materialize an immutable snapshot of a half-open event sequence range.
|
|
487
553
|
* A full current snapshot is reused until the next append; every previously
|
|
488
554
|
* returned snapshot remains stable after later appends.
|
|
555
|
+
* @deprecated Existing logic may remain unmigrated for now, but new calls are prohibited.
|
|
556
|
+
* See the [Agent Note](../../../../.agents/notes/implemented/architecture/2026-09-09-deprecate-synchronous-session-event-reads.md).
|
|
489
557
|
* @param fromSeq - non-negative inclusive sequence number; defaults to the log start.
|
|
490
558
|
* @param toSeqExclusive - non-negative exclusive sequence number; defaults to the current end.
|
|
491
559
|
* @returns a frozen array of the selected deeply frozen events.
|
|
@@ -493,9 +561,11 @@ declare class Session {
|
|
|
493
561
|
snapshotEvents(
|
|
494
562
|
fromSeq: SessionLogOffset = SessionLogOffset(0),
|
|
495
563
|
toSeqExclusive: SessionLogOffset = this.seq,
|
|
496
|
-
|
|
564
|
+
): readonly SessionEvent[];
|
|
497
565
|
/**
|
|
498
566
|
* Return this Session's events after its fork-inherited prefix.
|
|
567
|
+
* @deprecated Existing logic may remain unmigrated for now, but new calls are prohibited.
|
|
568
|
+
* See the [Agent Note](../../../../.agents/notes/implemented/architecture/2026-09-09-deprecate-synchronous-session-event-reads.md).
|
|
499
569
|
* @returns a fresh array containing child-owned events in log order.
|
|
500
570
|
*/
|
|
501
571
|
ownEvents(): readonly SessionEvent[];
|
|
@@ -548,7 +618,7 @@ declare class Session {
|
|
|
548
618
|
type: T,
|
|
549
619
|
data: SessionEventMap[T],
|
|
550
620
|
...opts: T extends SurfaceEventType ? [opts: SurfaceIntent<T>] : []
|
|
551
|
-
|
|
621
|
+
): SessionEvent<T>;
|
|
552
622
|
/**
|
|
553
623
|
* The {@link EpochHeader} in force after the log's last header event — the
|
|
554
624
|
* header the NEXT request will be compared against — or undefined before
|
|
@@ -564,6 +634,12 @@ declare class Session {
|
|
|
564
634
|
* @returns the latest immutable route metadata.
|
|
565
635
|
*/
|
|
566
636
|
requestContext(): RequestContext | undefined;
|
|
637
|
+
/**
|
|
638
|
+
* Fold unseen committed events into capability-independent tool history.
|
|
639
|
+
* Initial access reconstructs inherited history; later reads consume only new events.
|
|
640
|
+
* @returns an immutable snapshot for LLM request projection, including historical addition definitions.
|
|
641
|
+
*/
|
|
642
|
+
toolHistory(): ToolHistory;
|
|
567
643
|
/**
|
|
568
644
|
* Derive the LLM message history by walking the ordered sequences of
|
|
569
645
|
* message-producing events maintained by `surfaceOp` markers. The
|
|
@@ -571,21 +647,21 @@ declare class Session {
|
|
|
571
647
|
* append records its `surfaceOp`, so a raw event with no marker (a chunk, a
|
|
572
648
|
* turn boundary) is correctly absent, and a compaction `replace` deletes the
|
|
573
649
|
* shadowed nodes from the derivation. The projection rules are
|
|
574
|
-
* {@link deriveEventMessage},
|
|
650
|
+
* {@link deriveEventMessage}, with logged message projections applied
|
|
651
|
+
* without changing node membership or message identity.
|
|
575
652
|
*
|
|
576
|
-
* CACHED:
|
|
577
|
-
*
|
|
578
|
-
* {@link SessionSurface.replaceGeneration}) rebuilds. The returned array is
|
|
653
|
+
* CACHED: pure tail growth costs O(new nodes); a replacement or message projection
|
|
654
|
+
* ({@link SessionSurface.contentGeneration}) rebuilds. The returned array is
|
|
579
655
|
* a fresh snapshot per call (later appends never grow an array a caller
|
|
580
656
|
* already holds); the `Message` objects in it are SHARED and **deep-frozen**.
|
|
581
|
-
*
|
|
582
|
-
*
|
|
657
|
+
* Unchanged content reuses frozen event data; projected blocks are frozen
|
|
658
|
+
* derived copies. Consumers cannot mutate the log through either form.
|
|
583
659
|
* @returns a fresh array of the shared, frozen derived history.
|
|
584
660
|
*/
|
|
585
661
|
deriveMessages(): Message[];
|
|
586
662
|
/**
|
|
587
|
-
*
|
|
588
|
-
*
|
|
663
|
+
* Project one event with all committed message projections applied.
|
|
664
|
+
* The original durable event remains unchanged.
|
|
589
665
|
* @param event - the event to project.
|
|
590
666
|
* @returns the derived message, or null when the event produces none.
|
|
591
667
|
*/
|
|
@@ -595,11 +671,11 @@ declare class Session {
|
|
|
595
671
|
|
|
596
672
|
## 派生历史:`deriveMessages()` 与 `deriveEventMessage()`
|
|
597
673
|
|
|
598
|
-
`Session.deriveMessages()` 将事件日志投影为模型看到的 `Message[]`。它是缓存的(每个 surface 节点在首次出现时投影一次;surface 重写触发重建)且冻结的(每次调用返回一个新数组,引用共享的深冻结消息,因此通过投影修改已记录的历史在类型上不可表达)。`deriveEventMessage(event)`
|
|
674
|
+
`Session.deriveMessages()` 将事件日志投影为模型看到的 `Message[]`。它是缓存的(每个 surface 节点在首次出现时投影一次;surface 重写触发重建)且冻结的(每次调用返回一个新数组,引用共享的深冻结消息,因此通过投影修改已记录的历史在类型上不可表达)。`deriveEventMessage(event)` 是折叠所应用的逐节点纯函数,公开暴露以便外部重建器能以完全相同的规则投影日志前缀,不会与缓存产生分歧。投影规则:
|
|
599
675
|
|
|
600
676
|
- `user/message` → 一条携带确切 `content` 的 user 消息;可选 envelope 仅作为日志中的展示元数据保留。
|
|
601
677
|
- `assistant/message` → 一条 assistant 消息,包含生成它的提供方和模型,以及可选的适配器私有回放状态。其嵌入式紧凑 stream 是回放、usage 与 UI 证据,而不是第二条 message。**内容为空的** `assistant/message` 也会跳过:因 max-tokens 而截断且无内容的步骤仍会记录一条 `assistant/message` 来保存 stream、usage、提供方和模型,但无内容的 assistant 轮次不得进入提供方 transcript(文本记录)。
|
|
602
|
-
- `tool/result` →
|
|
678
|
+
- `tool/result` → 一条一等 tool-role 消息,携带结果内容与工具调用标识。
|
|
603
679
|
- `user/message`(注入上下文,即非 `user` 来源)→ 按时间顺序在相应位置生成一条 user-role 消息,并原样承载其 `content`;其类型化 source 标明生产方,并携带所有生产方专用数据。
|
|
604
680
|
|
|
605
681
|
其余所有事件(`turn/*`、`step/*`、`assistant/attempt`、插件所属的 `llm/retry`)均为结构信息,不会投影为消息。token 记账会展开每个 `assistant/message` 或 `assistant/attempt` 的嵌入式 stream,message 顶层 `usage` 存在时仍是已提交 message 的权威。失败的模型请求 attempt 因此可以保留提供方 usage,而无需虚构 assistant message。当前逻辑校验会拒绝没有提供方/模型的 request header 和 assistant 消息,而不会猜测路由;受支持的历史表示会在当前 Session 存在前,由其相邻格式迁移边归一化并校验。
|
|
@@ -610,7 +686,7 @@ declare class Session {
|
|
|
610
686
|
|
|
611
687
|
- `fork(source, boundary?, childSessionId?)` 接受一个活跃的 `Session` 对象或活跃的 `SessionId`,选取到 `SessionSeq` boundary(含)为止的源事件(默认为当前最后一个事件),要求所选前缀结束时没有开放轮次,然后创建一个活跃的子会话,包含深克隆的 seed event、`parentSession`、`isSeeded: true`、精确 `inheritedEventCount` 及继承的 `cwd`。
|
|
612
688
|
|
|
613
|
-
显式 `boundary` 允许调用者从任意稳定的轮次间位置 fork,包括之前的 `turn/end` 或更晚的独立纯日志事件,即使源会话有更新的事件或正在进行的轮次。API
|
|
689
|
+
显式 `boundary` 允许调用者从任意稳定的轮次间位置 fork,包括之前的 `turn/end` 或更晚的独立纯日志事件,即使源会话有更新的事件或正在进行的轮次。API 拒绝结束于开放轮次内的前缀,而不是静默截断。`dsh-subagent-fork-in-process` 保留其已完成前缀截断逻辑,因为工具调用时的委托通常在父轮次仍然打开时启动;普通的会话分支应显式指定请求的 boundary。
|
|
614
690
|
|
|
615
691
|
<a id="why-a-turn-ended-turnendreasonmap"></a>
|
|
616
692
|
|
|
@@ -648,20 +724,27 @@ interface TurnEndReasonMap {
|
|
|
648
724
|
* the events recorded before the crash remain intact.
|
|
649
725
|
*/
|
|
650
726
|
interrupted: { kind: 'interrupted' }
|
|
727
|
+
/**
|
|
728
|
+
* Fork-seed construction closed a turn that was still open at the fork
|
|
729
|
+
* boundary in the source session. Only fork seeds carry this marker — the
|
|
730
|
+
* loop never emits it — and the source events before the boundary remain
|
|
731
|
+
* intact in the child.
|
|
732
|
+
*/
|
|
733
|
+
forked: { kind: 'forked' }
|
|
651
734
|
}
|
|
652
735
|
```
|
|
653
736
|
|
|
654
|
-
`max-tokens` 与模型调用中同名的 `FinishReason` 对应:只要轮次内有任何步骤以 `max-tokens` 结束,整个轮次就以 `max-tokens` 而不是 `completed`
|
|
737
|
+
`max-tokens` 与模型调用中同名的 `FinishReason` 对应:只要轮次内有任何步骤以 `max-tokens` 结束,整个轮次就以 `max-tokens` 而不是 `completed` 结束(即使之后继续执行,截断事实仍优先),让消费方能够区分正常停止和截断停止。取消和错误仍是不同的结果。loop 不会实时发出 `interrupted` 或 `forked`:崩溃恢复合成 `interrupted`(见 [persistence.md](./persistence.md)),而 fork 种子构造合成 `forked`。该 map 可通过合并扩展。
|
|
655
738
|
|
|
656
739
|
## 执行封闭与独立事件
|
|
657
740
|
|
|
658
741
|
一个轮次包围一次模型循环执行,而不是整个会话日志。AgentLoop 只会在轮次内进入 pre-step 批次时记录注入的 `user/message` 事件;插件所属的纯日志事件仍可出现在 `turn/end` 与下一个 `turn/start` 之间,占用事件 seq 但不递增轮次编号。持久化会将每个连续且已接受的事件纳入有界持久化批次,而崩溃修复只关闭确实仍处于开放状态的尾部轮次。需要即时持久性屏障的生产方会显式等待 `ctx.sessions.flush(session)`。
|
|
659
742
|
|
|
660
|
-
|
|
743
|
+
可合并扩展事件的关系由声明它的插件拥有,因此核心不会仅因没有开放轮次就拒绝未知事件。见[独立事件决策](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/simplification/2026-07-28-remove-synthetic-log-only-turns.zh.md)。
|
|
661
744
|
|
|
662
745
|
## 种子结束边界:`session/end-seed`
|
|
663
746
|
|
|
664
|
-
|
|
747
|
+
`buildForkSeed` 在精确的 inherited-prefix cut 追加 `session/end-seed { inherited: true }`,然后添加合成的 fork 结束事件。`Session` constructor 保留该预先构造的 marker,或在 seed 仅含 inherited prefix 时追加 marker。restore 保留 tagged marker,并且只在完整 stored seed 尚未以 marker 结尾时追加普通 `session/end-seed {}`。两种形式都只进入 log 且不产生 message;只有 constructor 和 `buildForkSeed` 可以创建它们。
|
|
665
748
|
|
|
666
749
|
对于 fork lineage,定位 payload 携带 `inherited: true` 的最后一个 marker;当前格式 decoding 只在 `SessionHeader.isSeeded` 为 true 时要求该 marker,并从其 seq 推导 `inheritedEventCount`。对于 lifecycle ownership,定位任一形式的最后一个 `session/end-seed`。重新打开已经以任一 marker 结尾的 seed 时,不会再追加普通 marker。
|
|
667
750
|
|
|
@@ -671,7 +754,7 @@ interface TurnEndReasonMap {
|
|
|
671
754
|
|
|
672
755
|
## 插件贡献的仅日志事件
|
|
673
756
|
|
|
674
|
-
插件可以通过 declaration merging 添加额外的 `SessionEventMap` 类型。这些是**仅日志**事件:不是 `SurfaceEventType`(不携带 `surfaceOp
|
|
757
|
+
插件可以通过 declaration merging 添加额外的 `SessionEventMap` 类型。这些是**仅日志**事件:不是 `SurfaceEventType`(不携带 `surfaceOp`,不参与派生历史)。事件所有方决定它们属于一个开放的执行轮次,还是可以独立位于轮次之间。生成的[持久化日志事件目录](../persistence-catalog.md)会列出每个核心或插件贡献的事件;压缩 seam 的 `compaction/*` 语义在 [compaction.md](./compaction.md) 中讨论。
|
|
675
758
|
|
|
676
759
|
如果同一个插件事件族中的多条事件要组装成一个 Web Client Conversation Node,该事件族中的每条 start、update、result、resource 或 interruption 事件都必须携带或独立推导出同一个稳定业务 id。此要求只约束需要关联的 Node 事件族,并不要求每条 Session 事件都有业务 id;Client 因此无须根据相邻关系猜测归属,也无须扫描历史。参见 [Conversation 子系统](./conversation.md)。
|
|
677
760
|
|
|
@@ -689,6 +772,8 @@ interface TurnEndReasonMap {
|
|
|
689
772
|
|
|
690
773
|
`SessionOpenWorkspacePathRequest` 携带绝对路径或已按 workspace 解析的 `path`。`SessionOpenWorkspacePathValue` 确认 Host 已接受原生交接。Session-aware Client 会在已知当前 Session cwd 时据此解析相对路径;controller 将路径原样交给打开器,并通过 Session Remote 错误词汇表报告无效请求、取消与打开器失败。 可选的 `action: "reveal"` 选择文件管理器导航;省略时使用默认应用打开。
|
|
691
774
|
|
|
775
|
+
可选的 `application` 指定文件关联应用,不修改系统默认值;`workspacePathApplications({ path })` 在校验 Host 路径后返回当前关联应用、名称、图标和默认项。
|
|
776
|
+
|
|
692
777
|
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
|
|
693
778
|
|
|
694
779
|
<a id="cordis-surface"></a>
|
|
@@ -722,7 +807,7 @@ inspect( sessionId: SessionId, signal?: AbortSignal, ): Promise<SessionInspectio
|
|
|
722
807
|
/**
|
|
723
808
|
* Read all visible Session rows without resuming an Agent.
|
|
724
809
|
* @param _request - reserved empty list request.
|
|
725
|
-
* @param signal - cancellation for persistence reads.
|
|
810
|
+
* @param signal - cancellation for persistence reads and summary generation.
|
|
726
811
|
* @returns visible Session summaries ordered by activity.
|
|
727
812
|
*/
|
|
728
813
|
@Remote('list') async list(_request: SessionListRequest, signal: AbortSignal): Promise<SessionListValue>
|
|
@@ -743,12 +828,18 @@ inspect( sessionId: SessionId, signal?: AbortSignal, ): Promise<SessionInspectio
|
|
|
743
828
|
@Remote('create') create(request: SessionCreateRequest): Promise<SessionCreateValue>
|
|
744
829
|
|
|
745
830
|
/**
|
|
746
|
-
* Select one Session-local model after explicitly resuming the Session.
|
|
831
|
+
* Select one Session-local model after explicitly resuming the Session; save the default in the background.
|
|
747
832
|
* @param request - Session identity and requested model selection.
|
|
748
|
-
* @returns the normalized selection installed for the Session.
|
|
833
|
+
* @returns the normalized selection installed for the Session, without waiting for default persistence.
|
|
749
834
|
*/
|
|
750
835
|
@Remote('selectModel') selectModel(request: SessionSelectModelRequest): Promise<SessionSelectModelValue>
|
|
751
836
|
|
|
837
|
+
/**
|
|
838
|
+
* Select the first available account model after login when no provider API key is configured.
|
|
839
|
+
* @returns after saving the first available model or retaining the existing default.
|
|
840
|
+
*/
|
|
841
|
+
@Remote async initializeDefaultModel(): Promise<void>
|
|
842
|
+
|
|
752
843
|
/**
|
|
753
844
|
* Describe every currently routable model for Host-generation selectors.
|
|
754
845
|
* @returns provider-grouped models, the deployment default, and isolated provider failures.
|
|
@@ -768,14 +859,23 @@ inspect( sessionId: SessionId, signal?: AbortSignal, ): Promise<SessionInspectio
|
|
|
768
859
|
workspaceDesktop(): { name: string; available: boolean; fileManager: 'finder' | 'explorer' | 'directory' | null }
|
|
769
860
|
|
|
770
861
|
/**
|
|
771
|
-
*
|
|
862
|
+
* Verify one path through the composed filesystem and open it on the Host desktop.
|
|
772
863
|
* @param request - path after best-effort Session workspace resolution.
|
|
773
864
|
* @param signal - caller lifetime; abort terminates the native command.
|
|
774
865
|
* @returns confirmation after the native opener accepts the path.
|
|
775
|
-
* @throws RemoteError when the request is invalid, cancelled, or the opener fails.
|
|
866
|
+
* @throws RemoteError when the request is invalid, has no verified Host mapping, is cancelled, or the opener fails.
|
|
776
867
|
*/
|
|
777
868
|
@Remote('openWorkspacePath') async openWorkspacePath( request: SessionOpenWorkspacePathRequest, signal: AbortSignal, ): Promise<SessionOpenWorkspacePathValue>
|
|
778
869
|
|
|
870
|
+
/**
|
|
871
|
+
* Query current file handlers on the serving desktop without activating an Agent.
|
|
872
|
+
* @param request - file path in Host filesystem syntax.
|
|
873
|
+
* @param signal - caller lifetime, propagated to filesystem and desktop queries.
|
|
874
|
+
* @returns OS application names, icons, and default selection; empty when desktop opening is unavailable.
|
|
875
|
+
* @throws RemoteError when the path is invalid, the query is cancelled, or native discovery fails.
|
|
876
|
+
*/
|
|
877
|
+
@Remote('workspacePathApplications') async workspacePathApplications( request: { readonly path: string }, signal: AbortSignal, ): Promise<readonly SessionWorkspacePathApplication[]>
|
|
878
|
+
|
|
779
879
|
/**
|
|
780
880
|
* Rename one Session after explicitly resuming it.
|
|
781
881
|
* @param request - Session identity and proposed title.
|
|
@@ -784,8 +884,10 @@ workspaceDesktop(): { name: string; available: boolean; fileManager: 'finder' |
|
|
|
784
884
|
@Remote('rename') rename(request: SessionRenameRequest): Promise<SessionRenameValue>
|
|
785
885
|
|
|
786
886
|
/**
|
|
787
|
-
* Fork one cold-readable
|
|
788
|
-
*
|
|
887
|
+
* Fork one cold-readable exact event prefix into a new Session. An omitted
|
|
888
|
+
* boundary selects the latest completed-turn prefix; an open cut receives
|
|
889
|
+
* synthetic fork closers.
|
|
890
|
+
* @param request - source Session and optional exact inclusive event boundary.
|
|
789
891
|
* @returns the new Session identity.
|
|
790
892
|
*/
|
|
791
893
|
@Remote('fork') fork(request: SessionForkRequest): Promise<SessionForkValue>
|
|
@@ -806,11 +908,11 @@ workspaceDesktop(): { name: string; available: boolean; fileManager: 'finder' |
|
|
|
806
908
|
@Remote('attachment') attachment(request: SessionAttachmentRequest): Promise<SessionAttachmentValue>
|
|
807
909
|
|
|
808
910
|
/**
|
|
809
|
-
* Mutate one still-pending queue occurrence
|
|
911
|
+
* Mutate one still-pending queue occurrence, resuming a cold Agent first.
|
|
810
912
|
* @param request - Session, queue item, and requested mutation.
|
|
811
913
|
* @returns acknowledgement that the queue mutation was applied.
|
|
812
914
|
*/
|
|
813
|
-
@Remote('updateQueue') updateQueue(request: SessionUpdateQueueRequest): SessionUpdateQueueValue
|
|
915
|
+
@Remote('updateQueue') updateQueue(request: SessionUpdateQueueRequest): Promise<SessionUpdateQueueValue>
|
|
814
916
|
|
|
815
917
|
/**
|
|
816
918
|
* Cancel one active Agent turn without dropping its pending inbox.
|
|
@@ -836,6 +938,14 @@ workspaceDesktop(): { name: string; available: boolean; fileManager: 'finder' |
|
|
|
836
938
|
*/
|
|
837
939
|
@Remote({ mode: 'stream' }) follow(request: SessionFollowRequest, signal: AbortSignal): AsyncIterable<SessionFollowFrame>
|
|
838
940
|
|
|
941
|
+
/**
|
|
942
|
+
* Read all registered projections without activating an Agent.
|
|
943
|
+
* @param request - Session whose current values are required.
|
|
944
|
+
* @param signal - cancellation for the Session observation.
|
|
945
|
+
* @returns complete baseline, or null when the Session does not exist.
|
|
946
|
+
*/
|
|
947
|
+
@Remote('projections') async projections(request: SessionProjectionsRequest, signal: AbortSignal): Promise<SessionProjectionsValue>
|
|
948
|
+
|
|
839
949
|
/**
|
|
840
950
|
* Stream a complete live-control baseline followed by replacement frames.
|
|
841
951
|
* @param signal - cancellation owned by the Remote stream carrier.
|
|
@@ -857,6 +967,15 @@ In-memory session store (`ctx.sessions`).
|
|
|
857
967
|
Persistence is intentionally not implemented here — the agent lifecycle attaches a session-log writer to each published session's write handle; a session published outside that lifecycle persists nothing.
|
|
858
968
|
|
|
859
969
|
```ts cordis-catalog
|
|
970
|
+
/**
|
|
971
|
+
* Register one event interpreter for live creation, restore, and fork.
|
|
972
|
+
* Disposing the contribution makes sessions that used it refuse further derivation.
|
|
973
|
+
* @param projection - pure definition owned by the event's plugin.
|
|
974
|
+
* @returns the fiber-owned disposer.
|
|
975
|
+
* @throws when another definition already owns this event type.
|
|
976
|
+
*/
|
|
977
|
+
registerMessageProjection(projection: SessionMessageProjection): () => Promise<void>
|
|
978
|
+
|
|
860
979
|
/**
|
|
861
980
|
* Create a session owned by the calling fiber: disposing that fiber stops
|
|
862
981
|
* event notification and removes the session from the store. `options.seed`
|
|
@@ -940,8 +1059,8 @@ announce(session: Session): void
|
|
|
940
1059
|
* store owns the carrier, so callers (the checkpoint policy's per-request
|
|
941
1060
|
* barrier, goal-round-driver's idle checkpoint, teardown drains, and consumers
|
|
942
1061
|
* that flush themselves before reading storage) must come through here
|
|
943
|
-
* rather than dispatch a raw `ctx.parallel('session/flush', …)` — one owner
|
|
944
|
-
* one spelling
|
|
1062
|
+
* rather than dispatch a raw `ctx.parallel('session/flush', …)` — one owner
|
|
1063
|
+
* and one spelling.
|
|
945
1064
|
* @param session - the session whose buffered events must reach durable storage.
|
|
946
1065
|
* @returns whether at least one durability listener participated, after every
|
|
947
1066
|
* listener has settled successfully.
|
|
@@ -963,10 +1082,12 @@ get(id: SessionId): Session | undefined
|
|
|
963
1082
|
list(): Session[]
|
|
964
1083
|
|
|
965
1084
|
/**
|
|
966
|
-
* Create a live child session from
|
|
1085
|
+
* Create a live child session from an exact prefix of a live source.
|
|
967
1086
|
* `boundary` is an inclusive source event seq; omitted means the source's
|
|
968
|
-
* current last event.
|
|
969
|
-
*
|
|
1087
|
+
* current last event. An open tail receives synthetic tool results and
|
|
1088
|
+
* step/turn closers with the forked cause. Closed steps and turns remain
|
|
1089
|
+
* unchanged, including any failed tool calls already missing results.
|
|
1090
|
+
* `inheritedEventCount` counts only copied source events, excluding these closers.
|
|
970
1091
|
*
|
|
971
1092
|
* @param source - Live source session object or id.
|
|
972
1093
|
* @param boundary - Inclusive source event seq to fork through; omitted means
|
|
@@ -1011,13 +1132,14 @@ Source: [`packages/api/session-controller/src/types.ts`](https://github.com/deep
|
|
|
1011
1132
|
|
|
1012
1133
|
#### `api-session/added` — emit
|
|
1013
1134
|
|
|
1014
|
-
A Session became visible
|
|
1135
|
+
A Session became visible or its Agent was created or disposed. Consumers upsert the summary and replace its current running and availability state.
|
|
1015
1136
|
|
|
1016
1137
|
```ts cordis-catalog
|
|
1017
1138
|
/**
|
|
1018
|
-
* A Session became visible
|
|
1139
|
+
* A Session became visible or its Agent was created or disposed.
|
|
1140
|
+
* Consumers upsert the summary and replace its current running and availability state.
|
|
1019
1141
|
* @mode emit
|
|
1020
|
-
* @param summary -
|
|
1142
|
+
* @param summary - current list row for the Session.
|
|
1021
1143
|
*/
|
|
1022
1144
|
'api-session/added'(summary: SessionSummary): void
|
|
1023
1145
|
```
|
|
@@ -1102,7 +1224,6 @@ Creation announcement during session publication. A synchronous throw vetoes and
|
|
|
1102
1224
|
* Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners
|
|
1103
1225
|
* receive only sessions entered through that agent's context.
|
|
1104
1226
|
* @param session - the session just entered and announced.
|
|
1105
|
-
* @dshScopeScan unsupported
|
|
1106
1227
|
* @mode emit
|
|
1107
1228
|
*/
|
|
1108
1229
|
'session/created'(this: Scoped<Session>, session: Session): void
|
|
@@ -1125,7 +1246,6 @@ Emitted once when an announced session leaves the store, including publication r
|
|
|
1125
1246
|
* did not begin. Listener failures are logged and contained.
|
|
1126
1247
|
* Scope-filtered dispatch (`@deepseek-ai/dsh-scope`) reuses the owner scope.
|
|
1127
1248
|
* @param session - the session that is no longer live in the store.
|
|
1128
|
-
* @dshScopeScan unsupported
|
|
1129
1249
|
* @mode emit
|
|
1130
1250
|
*/
|
|
1131
1251
|
'session/disposed'(this: Scoped<Session>, session: Session): void
|
|
@@ -1150,7 +1270,6 @@ Post-commit, fire-and-forget append feed. The listener snapshot resolves before
|
|
|
1150
1270
|
* receive only events from sessions entered through that agent's context.
|
|
1151
1271
|
* @param session - the session whose log grew.
|
|
1152
1272
|
* @param event - the appended event, exactly as recorded.
|
|
1153
|
-
* @dshScopeScan unsupported
|
|
1154
1273
|
* @mode emit
|
|
1155
1274
|
*/
|
|
1156
1275
|
'session/event'(this: Scoped<Session>, session: Session, event: SessionEvent): void
|
|
@@ -1172,7 +1291,6 @@ Awaited parallel durability checkpoint: every listener runs and the caller await
|
|
|
1172
1291
|
* caller awaits all of them, with no waterfall veto. Scope-filtered dispatch
|
|
1173
1292
|
* (`@deepseek-ai/dsh-scope`) reuses the session's owner scope.
|
|
1174
1293
|
* @param session - the session whose buffered events must reach durable storage.
|
|
1175
|
-
* @dshScopeScan unsupported
|
|
1176
1294
|
* @mode parallel
|
|
1177
1295
|
*/
|
|
1178
1296
|
'session/flush'(this: Scoped<Session>, session: Session): Promise<void> | void
|