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
|
@@ -14,18 +14,23 @@
|
|
|
14
14
|
- [4. 更新当前版本消费方](#current-version-consumers)
|
|
15
15
|
- [5. 创建快照后继代际](#snapshot-successors)
|
|
16
16
|
- [6. 验证集成结果](#validate)
|
|
17
|
+
- [开发者 V4 日志集试迁移](#v4-corpus-trial)
|
|
17
18
|
- [开发备注](#dev-note)
|
|
18
19
|
|
|
19
20
|
<a id="choose-the-version"></a>
|
|
20
21
|
## 1. 选择版本与发布基线
|
|
21
22
|
|
|
22
|
-
当 header
|
|
23
|
+
当 header、事件信封、核心事件语义或表面重建发生结构性变更时,提升格式版本。向后兼容的变更可以通过新的确认记录保留当前版本;遵循[版本规则](../../.agents/notes/implemented/architecture/2026-08-10-session-log-version-mechanism.zh.md)与[类型变更规则](../persistence-changes/README.zh.md#compatibility-rules)。区分 Session 格式整数与包发布版本、SQLite schema 版本、投影单元版本及协议包装层版本。
|
|
24
|
+
|
|
25
|
+
规划下一次破坏性变更时,N 取[版本/状态](../session-format-status.zh.md)中的已接受或已发布版本。因此,即使尚未记录 V4 发布,已接受 V4 之后的破坏性变更也需要 V5;兼容新增不需要这一步。
|
|
23
26
|
|
|
24
27
|
为 N+1 使用共享的 `release/*` 集成基线。基线变更添加写入器、codec、catalog 接线、恒等迁移与验证。从该基线创建各个独立子分支,并将其 PR(Pull Request)的目标设为发布分支,而非另一个独立子分支。每个子分支在同一个相邻迁移包内添加自身的结构变换、校验器、消费方和测试。不要只为表示评审顺序而分配额外版本。通过 PR 将评审后的子分支合入发布分支,并在发布前验证组合结果。遵守发布分支的强制推送与删除保护;不要强制同步该分支。
|
|
25
28
|
|
|
26
|
-
已发布 codec
|
|
29
|
+
已发布 codec 和已接受的目标格式含义保持稳定。N+1 发布后,N→N+1 转换器仍可修复或增加历史场景支持;只要输出仍兼容 N+1,就不必提高版本。转换器修复只影响之后的转换,不会重新处理已有 N+1 后继文件。记录对原先已接纳映射的修改,以及已有输出如何继续得到支持。不兼容地改变既定目标表示或解释语义需要下一版本。
|
|
30
|
+
|
|
31
|
+
N+1 尚处于开放集成阶段时,应使用可丢弃、相互隔离的 Harness home。中间版本产生的 N+1 文件已标为目标写入器版本,因此后续对 N→N+1 的修改不会再次迁移该文件。请在全新测试 home 中从未变更的历史输入重新运行;绝不通过改写已提交代际或复用真实用户 home 来修复这个问题。
|
|
27
32
|
|
|
28
|
-
|
|
33
|
+
变更写入器之前,使用[归档命令](../persistence-changes/historical-formats/README.zh.md#maintenance)保留其完整持久化 schema,再在 `docs/persistence-changes/historical-formats/vN.*` 下添加双语格式参考。保留所有更早的记录。格式覆盖检查要求低于新写入器的每个整数版本都有独立文档;当前生成的目录只覆盖新写入器。
|
|
29
34
|
|
|
30
35
|
<a id="add-an-identity-edge"></a>
|
|
31
36
|
## 2. 添加恒等迁移边
|
|
@@ -53,12 +58,20 @@ pnpm run gen-session-format-catalog
|
|
|
53
58
|
|
|
54
59
|
显式定义新迁移边的事件准入与变换规则。[V2 到 V3 源审计](../../packages/session/session-format-v2-to-v3/README.zh.md#source-audit)和 [Alpha V0→V1 规则](../../.agents/notes/implemented/architecture/2026-08-31-alpha-historical-unknown-event-refusal.zh.md)分别负责对应已发布迁移边的策略,而非新迁移边的策略。不要将任一策略推广到所有迁移边。结构或事件位置变化时,必须分类源事件、载荷成员与引用,并显式判断不透明数据能否保持有效。[同版本保留](../../.agents/notes/implemented/architecture/2026-08-30-retain-ignorable-external-session-events.zh.md)本身不能证明结构变换安全。校验目标语义,并为每个新增可接受案例提供一个被拒绝的反例;绝不放宽旧迁移边来掩盖不受支持的转换。
|
|
55
60
|
|
|
61
|
+
以原生 writer 输出作为转换对照:用相同录制的 LLM 消息、工具输出和其他输入回放旧 writer 与目标 writer。任何格式归一化 helper 运行前,比较迁移后的旧输出与目标原始输出,只屏蔽已说明的易变字段。V4 的普通工具结果变为包含普通内容块的平铺 tool-role 消息。旧类型理论上允许某种结构,本身不足以支持新增核心内容类型。
|
|
62
|
+
|
|
63
|
+
Alpha 转换器可以明确拒绝尚无已实现、有证据映射的历史场景,包括原本有效的日志。源文件保持不变,且不发布部分 successor。扩展支持时优先使用真实语料和可复现 writer;只读检查用户语料,并创建脱敏回归 fixture。
|
|
64
|
+
|
|
65
|
+
在迁移边 README 中只记录目标格式所需的标识符与字段映射,并逐项说明原因。不要仅因可扩展就给直接 source kind 或普通 metadata 添加命名空间。保留不透明嵌套数据。Alpha 转换器可以拒绝在目标格式中会获得新语义的意外源字段,而不是为其虚构解释。
|
|
66
|
+
|
|
67
|
+
参照 [V2 到 V3 规范](../../packages/session/session-format-v2-to-v3/README.zh.md#v2-to-v3-specification),将新迁移边的 README 维护为唯一完整的转换与接纳目录。枚举每个被转换的 header、事件、消息槽和载荷字段,精确重命名或冲突规则,保留的 id、坐标、引用与继承截点,外部前置证据,拒绝与不透明数据策略,以及不支持或延后的行为。将历史源转换与原生目标接纳分开,说明每项检查由哪个 codec、restorer、已安装校验器和恢复策略执行。记录刻意窄于声明 schema 的校验范围。代码变更必须同时更新此目录;生成的 schema 库存或 PR 描述不能替代它。
|
|
68
|
+
|
|
56
69
|
通过 `sessionFormatCatalog.createRestore(header, { recovery: 'strict', validation: 'current' })` 验证严格恢复,按顺序传入各行并调用 `finish()`。这会执行物理解码、完整迁移链与已安装当前 Session 校验。生产环境的 recoverable/transformed 策略不能替代 fixture(测试前置数据)和发布验证所需的严格校验。保留已记录的历史校验例外,不要宣称源校验比迁移边实际执行的更严格。
|
|
57
70
|
|
|
58
71
|
<a id="current-version-consumers"></a>
|
|
59
72
|
## 4. 更新当前版本消费方
|
|
60
73
|
|
|
61
|
-
追踪每个当前版本消费方,包括 Session 创建与恢复、JSONL 文件名选择与发布、catalog
|
|
74
|
+
追踪每个当前版本消费方,包括 Session 创建与恢复、JSONL 文件名选择与发布、catalog 的当前编码器与恢复器、投影缓存的代际身份、回放与快照归一化、[物理 fixture 布局校验](../../scripts/session-fixture-layout.ts),以及 TypeScript/Python SDK 录制。当值表示当前版本时使用写入器常量;在已发布 codec 和历史 fixture 中保留字面历史版本。通过各自所有者更新当前文档与生成参考。
|
|
62
75
|
|
|
63
76
|
不要自动提升无关版本。请求包装层的 `sessionFormatVersion` 标识嵌入的 Session 代际;外层 schema 版本有自己的含义。投影单元状态版本同样不能替代缓存的 Session 代际身份。
|
|
64
77
|
|
|
@@ -67,7 +80,7 @@ pnpm run gen-session-format-catalog
|
|
|
67
80
|
<a id="snapshot-successors"></a>
|
|
68
81
|
## 5. 创建快照后继代际
|
|
69
82
|
|
|
70
|
-
阅读[快照所有权](../../snapshots/AGENTS.md)和[快照库](../../packages/test-support/session-snapshot/README.zh.md)
|
|
83
|
+
阅读[快照所有权](../../snapshots/AGENTS.md)和[快照库](../../packages/test-support/session-snapshot/README.zh.md)。[语料策略](../../scripts/session-snapshot-corpus-policy.ts)保留其声明的 baseline 作为回放输入,让升级实际经过相邻迁移链;提高 writer 版本不要求 refresh 该语料。需要当前代际后继时,选择拥有数据的场景,保留每份历史文件,并使用目标版本的规范父子文件名。绝不将前代重命名为目标文件名,或仅修改其 header。
|
|
71
84
|
|
|
72
85
|
如果回放输入不变,在所有者上执行无密钥 refresh,再执行不写回的 replay。以下 SDK 命令使用 `text-turn` 和工作区的写入器版本。先实现并接入 N+1,才能用它们生成该版本;功能变更应选择实际受影响的所有者:
|
|
73
86
|
|
|
@@ -78,7 +91,7 @@ pnpm run test:snapshot snapshots/sdk/sdk.snapshot.ts -t text-turn
|
|
|
78
91
|
|
|
79
92
|
一起审查新代际、请求伴随文件与协议输出。验证每个前代的字节保持相同,且父子角色连续。选择规则采用数值最高的代际,因此应将共享引用更新为所有者选中的父代际。不要把 packed 布局迁移器当作版本升级器。如果模型 transcript(文本记录)必须变化,由场景所有者按照[测试策略](../testing.zh.md)使用所需提供方密钥进行实时录制。
|
|
80
93
|
|
|
81
|
-
通过 `snapshot.yml` 的 `sessionFormat.version` 与受支持的 `coverage`
|
|
94
|
+
通过 `snapshot.yml` 的 `sessionFormat.version` 与受支持的 `coverage` 名称显式保留早于 baseline 的案例;record 和 refresh 不改动已 pin 的 Session fixture。更新[语料策略](../../scripts/session-snapshot-corpus-policy.ts)以采用当前代际,同时保留聚焦的直接迁移边、多跳、packed row、重试/失败及交付 profile 覆盖。检查语料和两个 SDK 投影;不要仅为消除校验失败而批量 refresh 无关场景。
|
|
82
95
|
|
|
83
96
|
<a id="validate"></a>
|
|
84
97
|
## 6. 验证集成结果
|
|
@@ -103,6 +116,35 @@ pnpm run lint
|
|
|
103
116
|
git diff --check
|
|
104
117
|
```
|
|
105
118
|
|
|
119
|
+
<a id="v4-corpus-trial"></a>
|
|
120
|
+
### 开发者 V4 日志集试迁移
|
|
121
|
+
|
|
122
|
+
在已安装依赖、写入器为 V4 的贡献者工作区中使用这个一次性[迁移脚本](../../scripts/migrate-sessions-to-v4.ts)。开始前停止使用目标根目录的 DSH 进程,避免写入锁及变化中的子日志阻止迁移。在仓库根目录运行:
|
|
123
|
+
|
|
124
|
+
```sh
|
|
125
|
+
pnpm run migrate:sessions-to-v4
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
默认根目录是 `~/.dsh/sessions`。可用 `--sessions-dir /path/to/sessions-copy` 指定其他日志集,或用 `--help` 查看用法。默认并发数取可用 CPU 数且最多为 16;`--jobs N` 接受任意正安全整数,专家用户可指定更大的值,`--jobs 1` 则串行运行。有界队列只同时打开指定数量的 Session,不随日志集大小增加。每个历史 Session 都通过正常的加锁、校验和发布流程,在未修改的源文件旁创建 V4 后继。已有 V4 Session 仅以只读方式打开;重复运行不会重新转换它们。脚本不发起模型请求,也不改变转换或拒绝规则。
|
|
129
|
+
|
|
130
|
+
终端逐个报告 Session 选中的文件、版本、进度、结果和耗时。单个错误不会阻止后续 Session。最终摘要列出全部失败项及系统临时目录中的完整诊断日志;存在任何失败时返回非零退出状态。同时打印 JSON,并把相同报告保存为 `migration.log` 旁的 `summary.json`:包含按源版本和结果统计的数量、失败原因分组、逐项诊断、运行时信息和两份报告路径。已知诊断提取事件类型、非预期字段、是否涉及子日志及序号;未知错误保留消息,不推断原因。报告迁移问题时,请附上这些报告。本次转换成功的 Session 与运行前已为 V4 的 Session 分开统计。
|
|
131
|
+
|
|
132
|
+
并发转换时,子 Session 发布 V4 可能使父 Session 使用的子日志证据失效。只有这种源变化错误会在全部首次任务结束后串行重试一次;损坏、不支持的格式和已持有的写入锁会立即报告。完成行保留原始输入编号,并单独显示已完成数量,使乱序结果仍易于阅读。
|
|
133
|
+
|
|
134
|
+
<a id="final-v3-vocabulary"></a>
|
|
135
|
+
### 发布 V4 前确认最终 V3 事件词汇
|
|
136
|
+
|
|
137
|
+
当已发布格式仍为 V3、集成写入方为 V4 时,master 仍可能新增有效的 V3 事件类型。每次集成 master 后及首次发布 V4 前,都要把迁移所有的 `RELEASED_V3_EVENT_TYPES` 与该次刷新使用的最新 V3 写入方提交比较。在已于本地核验的 `origin/master` 仍写入 V3 时,记录其完整、不可变的提交 id:
|
|
138
|
+
|
|
139
|
+
```sh
|
|
140
|
+
V3_SOURCE_REF="$(git rev-parse --verify 'origin/master^{commit}')"
|
|
141
|
+
pnpm run verify-v3-event-vocabulary --source-ref "$V3_SOURCE_REF"
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
校验器只读取该本地提交,并要求事件名完全一致。它拒绝遗漏的 V3 名称、额外复制的名称,以及不写入 V3 的源提交。尤其不能把 V4 专有的 `developer/message` 放入冻结的 V3 集合。逐项核对 V3 payload、必要转换、目标接纳及消费方;只添加名称不能证明迁移完整。接受新源事件前要补上相应迁移回归。
|
|
145
|
+
|
|
146
|
+
此命令不会 fetch,也不能证明远端新鲜度。发布操作者必须确认所选提交是此次集成包含的最新 V3 写入方;陈旧的远端跟踪 ref 或旧 pin 的通过结果均不足。把核验过的 id 记入发布验证。如果 master 已写入 V4,应复用已记录的最终 V3 提交,而不再解析当前 master。V4 发布后,V3 词汇仍绑定该历史源码;后续 V4 事件新增不更新它。常规静态 CI 不依赖可变的 master ref。
|
|
147
|
+
|
|
106
148
|
<a id="dev-note"></a>
|
|
107
149
|
## 开发备注
|
|
108
150
|
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Generate, acknowledge, and verify Session persistence-type changes locally before opening a pull request."
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Cookbook: reviewing persistence-type changes
|
|
6
|
+
|
|
7
|
+
English | [中文](reviewing-persistence-type-changes.zh.md)
|
|
8
|
+
|
|
9
|
+
## Summary
|
|
10
|
+
|
|
11
|
+
Use this tutorial after changing a declared Session persistence type in a contributor checkout with dependencies installed. Supply a bilingual compatibility explanation, then let one command classify the change and generate its records. The [record reference](../persistence-changes/README.md) explains the files and automatic rules. All comparison inputs live in the checkout; no base branch or network access is required.
|
|
12
|
+
|
|
13
|
+
## Table of Contents
|
|
14
|
+
|
|
15
|
+
- [Optional: inspect the change](#generate)
|
|
16
|
+
- [1. Record the change](#acknowledge)
|
|
17
|
+
- [2. Check, commit, and push](#verify)
|
|
18
|
+
- [Update an unaccepted record](#competing-records)
|
|
19
|
+
- [Dev Note](#dev-note)
|
|
20
|
+
|
|
21
|
+
-----
|
|
22
|
+
|
|
23
|
+
<a id="generate"></a>
|
|
24
|
+
## Optional: inspect the change
|
|
25
|
+
|
|
26
|
+
For a preview before recording, run from the repository root:
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
pnpm --silent run verify-persistence-changes --json
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Use `--silent` when consuming JSON: pnpm otherwise appends lifecycle failure text to stdout. Failed commands still exit with code 1.
|
|
33
|
+
|
|
34
|
+
Read the reported root, path, change kind, and version requirement. A referenced type can affect several event digests; inspect every affected root. Until the history covers the new schemas, verification fails. A stale generated inventory also fails verification; the recording command refreshes it. If `changes` is empty after reordering fields or union alternatives, run `pnpm run gen-persistence-catalog` and repeat the check. An unchanged digest needs no new acknowledgement even when copied declarations or source locations produce a catalog diff.
|
|
35
|
+
|
|
36
|
+
To review a PR independently of its acknowledgement history, save the base and head inventories as local JSON files and run:
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
pnpm --silent run persistence-review --before .artifacts/base.schema.json --after docs/persistence-schema.json
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Record the commits supplying those files with the report. Add `--json` for structured output. This read-only comparison groups shared changes with their affected roots and uses actual literal `kind`/`form` values instead of union positions. Ambiguous alternatives remain separate additions and removals. Its compatibility section copies every root's authoritative classifier result; the structural explanation does not replace acknowledgement checks. Current catalog labels and declaration names are descriptive metadata; structural anchors and fingerprints identify types.
|
|
43
|
+
|
|
44
|
+
The current machine inventory stores complete graphs in `roots`. A `types` entry contains `digest`, `names`, and `sources`, plus an explicit `schema` when roots cannot reconstruct that graph exactly. Readers resolve omitted graphs from root subgraphs by digest and validate explicit graphs directly, preserving every type and its metadata. Historical full entries remain readable. `formatVersion` identifies normalization rules; storage compaction does not change root fingerprints or require an acknowledgement.
|
|
45
|
+
|
|
46
|
+
<a id="acknowledge"></a>
|
|
47
|
+
## 1. Record the change
|
|
48
|
+
|
|
49
|
+
Check the [accepted baseline](../session-format-status.md#finalization-record) first. Preserve its locked records. Record backward-compatible evolution in a new same-version acknowledgement; implement a higher writer version before recording a breaking change.
|
|
50
|
+
|
|
51
|
+
Write a local JSON file containing `en` and `zh`, each with `summary`, `compatibility`, and `verification` strings. The following input describes an exercised required-to-optional hook audit field change. Replace the explanation and test evidence with facts about your change; the CLI does not establish these claims.
|
|
52
|
+
|
|
53
|
+
Save the input as `.artifacts/persistence-change.prose.json`, creating the ignored directory if needed:
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"en": {
|
|
58
|
+
"summary": "Makes the persisted hook audit decision optional.",
|
|
59
|
+
"compatibility": "Existing records remain valid. Hook execution consumes HookOutput instead of replaying this audit field. Producers still write decisions, and absence does not imply pass.",
|
|
60
|
+
"verification": "pnpm exec vitest run packages/hooks/hook-protocol/tests/events.spec.ts: 10 tests passed."
|
|
61
|
+
},
|
|
62
|
+
"zh": {
|
|
63
|
+
"summary": "将持久化的钩子审计决策改为可选。",
|
|
64
|
+
"compatibility": "已有记录仍然有效。钩子执行消费 HookOutput,不回放此审计字段。写入方仍然记录决策,缺失不代表 pass。",
|
|
65
|
+
"verification": "pnpm exec vitest run packages/hooks/hook-protocol/tests/events.spec.ts:10 个测试通过。"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Use a date and descriptive slug in place of this example id:
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
pnpm --silent run persistence-changes --record 2026-09-11-poc-optional --prose .artifacts/persistence-change.prose.json --json
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The command validates the history and paired prose, infers the minimum version decision, and checks any required header increase before writing. It generates the record pair, complete after schemas, both catalogs, the machine inventory, and pairing records. Review the explanations and returned `changes`, `roots`, and `files` before committing. Omitting `--prose` creates unfinished drafts that verification rejects until their explanations are completed.
|
|
77
|
+
|
|
78
|
+
Inference follows the [fixed compatibility rules](../persistence-changes/README.md#compatibility-rules); it never changes source or relaxes them. If a bump is required, first follow [adding a Session format version](adding-a-session-format-version.md). The record must include its own increasing `SessionHeader.version` transition; an unrelated historical bump cannot authorize it. Routine changes never create another baseline.
|
|
79
|
+
|
|
80
|
+
<a id="verify"></a>
|
|
81
|
+
## 2. Check, commit, and push
|
|
82
|
+
|
|
83
|
+
Select the changed owner's behavior checks through the [testing policy](../testing.md), then run the documentation checks:
|
|
84
|
+
|
|
85
|
+
```sh
|
|
86
|
+
pnpm run doc-sync
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
`doc-sync` checks persistence inventory and catalog freshness, the complete history, and bilingual pairing. A recording command's `ok: true` does not replace these checks or the owner's behavior and migration tests. JSON failures retain `ok: false`, a diagnostic `code`, and exit code 1. Structured changes include stable kinds and per-root before/after digests, so automation need not parse descriptions.
|
|
90
|
+
|
|
91
|
+
Record generation owns its catalog and record pairs; edits to a package README or other bilingual page still follow their normal pairing workflow. Review and stage the intended diff, then commit and push normally. The staged lint, pairing, and whitespace hooks and the pre-push Host/Client typecheck still apply.
|
|
92
|
+
|
|
93
|
+
<a id="competing-records"></a>
|
|
94
|
+
## Update an unaccepted record
|
|
95
|
+
|
|
96
|
+
If source changes after recording, review the compatibility explanation and refresh the same unaccepted terminal record:
|
|
97
|
+
|
|
98
|
+
```sh
|
|
99
|
+
pnpm --silent run persistence-changes --update 2026-09-11-poc-optional --prose .artifacts/persistence-change.prose.json --json
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
The command refreshes the machine declaration, schemas, catalogs, and pairing. Without `--prose`, it preserves the existing explanation. Update refuses the initial baseline, records that another record depends on, and finalized checkpoint records. Outside finalized checkpoints, the tree does not infer review acceptance: preserve accepted history and create a successor instead.
|
|
103
|
+
|
|
104
|
+
When integration creates competing terminal records, update the unaccepted record against the remaining history, then reassess the resulting diff. An unrelated root's acknowledgement does not need refreshing. The [mechanism decision](../../.agents/notes/implemented/process/2026-09-11-persistence-type-history.md) explains why complete snapshots and per-root predecessors are retained.
|
|
105
|
+
|
|
106
|
+
An explicit `--decision` remains a checked assertion. For an existing property's value-type change, the following deliberately wrong assertion fails before writing:
|
|
107
|
+
|
|
108
|
+
```sh
|
|
109
|
+
pnpm --silent run persistence-changes --update 2026-09-11-poc-optional --decision same-version --json
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
<a id="dev-note"></a>
|
|
113
|
+
## Dev Note
|
|
114
|
+
|
|
115
|
+
<details>
|
|
116
|
+
<summary>Working context for maintainers — click to expand</summary>
|
|
117
|
+
|
|
118
|
+
None.
|
|
119
|
+
|
|
120
|
+
</details>
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "在创建 PR 前,本地生成、确认并验证会话持久化类型变更。"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# 实操手册:审阅持久化类型变更
|
|
6
|
+
|
|
7
|
+
[English](reviewing-persistence-type-changes.md) | 中文
|
|
8
|
+
|
|
9
|
+
## 概述
|
|
10
|
+
|
|
11
|
+
在已安装依赖的贡献者检出目录中修改会话持久化类型声明后,使用本教程。提供双语兼容性说明,再用一条命令分类变更并生成记录。[记录参考](../persistence-changes/README.zh.md)解释文件和自动规则。所有比较输入都在检出目录中;不需要基线分支或网络访问。
|
|
12
|
+
|
|
13
|
+
## 目录
|
|
14
|
+
|
|
15
|
+
- [可选:检查变更](#generate)
|
|
16
|
+
- [1. 记录变更](#acknowledge)
|
|
17
|
+
- [2. 检查、提交并推送](#verify)
|
|
18
|
+
- [更新尚未接受的记录](#competing-records)
|
|
19
|
+
- [开发备注](#dev-note)
|
|
20
|
+
|
|
21
|
+
-----
|
|
22
|
+
|
|
23
|
+
<a id="generate"></a>
|
|
24
|
+
## 可选:检查变更
|
|
25
|
+
|
|
26
|
+
若需在记录前预览,在仓库根目录运行:
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
pnpm --silent run verify-persistence-changes --json
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
消费 JSON 时使用 `--silent`:否则 pnpm 会把生命周期失败文本追加到标准输出。失败命令仍以退出码 1 结束。
|
|
33
|
+
|
|
34
|
+
阅读报告中的根、路径、变更种类和版本要求。被引用类型可能影响多个事件摘要;检查每个受影响的根。在历史覆盖新 schema 之前,验证会失败。陈旧生成清单也会导致验证失败;记录命令会刷新它。若重排字段或联合类型分支后 `changes` 为空,运行 `pnpm run gen-persistence-catalog` 并重新检查。即使复制的声明或源码位置产生目录 diff,未变的摘要也无需新增确认记录。
|
|
35
|
+
|
|
36
|
+
要独立于确认历史评审 PR,先将 base 和 head 的目录保存为本地 JSON 文件,再运行:
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
pnpm --silent run persistence-review --before .artifacts/base.schema.json --after docs/persistence-schema.json
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
在报告旁记录这些文件对应的 commit。添加 `--json` 可获取结构化输出。此只读比较将共享变更与受影响的根类型归组,使用实际字面量 `kind`/`form` 值代替联合类型位置。无法唯一匹配的候选项保留为独立的新增与删除。兼容性部分复制每个根类型的权威分类结果;结构说明不替代确认检查。当前目录标签和声明名称是描述元数据;结构锚点和指纹标识类型。
|
|
43
|
+
|
|
44
|
+
当前机器清单在 `roots` 中保存完整图。每个 `types` 条目包含 `digest`、`names` 和 `sources`;若根无法精确重建该图,条目还会保存显式 `schema`。读取器按摘要从根的子图恢复省略的图,并直接验证显式图,保留每个类型及其元数据。历史完整条目仍然可读。`formatVersion` 标识规范化规则;存储压缩不改变根指纹,也不需要确认记录。
|
|
45
|
+
|
|
46
|
+
<a id="acknowledge"></a>
|
|
47
|
+
## 1. 记录变更
|
|
48
|
+
|
|
49
|
+
先检查[已接受基线](../session-format-status.zh.md#finalization-record),保留其锁定记录。向后兼容的演进使用新的同版本确认记录;记录破坏性变更之前,先实现更高的写入器版本。
|
|
50
|
+
|
|
51
|
+
编写包含 `en` 和 `zh` 的本地 JSON 文件,两者分别包含 `summary`、`compatibility` 和 `verification` 字符串。以下输入描述一个经过验证的钩子审计字段从必选改为可选的变更。用你所做变更的事实替换说明和测试证据;CLI(命令行界面)不会证明这些声明。
|
|
52
|
+
|
|
53
|
+
将输入保存为 `.artifacts/persistence-change.prose.json`,必要时创建该被忽略的目录:
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"en": {
|
|
58
|
+
"summary": "Makes the persisted hook audit decision optional.",
|
|
59
|
+
"compatibility": "Existing records remain valid. Hook execution consumes HookOutput instead of replaying this audit field. Producers still write decisions, and absence does not imply pass.",
|
|
60
|
+
"verification": "pnpm exec vitest run packages/hooks/hook-protocol/tests/events.spec.ts: 10 tests passed."
|
|
61
|
+
},
|
|
62
|
+
"zh": {
|
|
63
|
+
"summary": "将持久化的钩子审计决策改为可选。",
|
|
64
|
+
"compatibility": "已有记录仍然有效。钩子执行消费 HookOutput,不回放此审计字段。写入方仍然记录决策,缺失不代表 pass。",
|
|
65
|
+
"verification": "pnpm exec vitest run packages/hooks/hook-protocol/tests/events.spec.ts:10 个测试通过。"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
用日期和描述性短名替换示例 id:
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
pnpm --silent run persistence-changes --record 2026-09-11-poc-optional --prose .artifacts/persistence-change.prose.json --json
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
命令在写入前验证历史和双语说明、推断最低版本决策,并检查所需的头部版本递增。它生成记录对、完整的变更后 schema、两份目录、机器清单和配对记录。提交前审阅说明及返回的 `changes`、`roots` 和 `files`。省略 `--prose` 会创建未完成草稿,验证将拒绝它们,直到说明补齐。
|
|
77
|
+
|
|
78
|
+
推断遵循[固定兼容性规则](../persistence-changes/README.zh.md#compatibility-rules),不会更改源码或放宽规则。需要升版本时,先遵循[添加会话格式版本](adding-a-session-format-version.zh.md)。记录必须包含其自身的 `SessionHeader.version` 递增转换;无关的历史升版本不能授权它。日常变更不创建另一条基线。
|
|
79
|
+
|
|
80
|
+
<a id="verify"></a>
|
|
81
|
+
## 2. 检查、提交并推送
|
|
82
|
+
|
|
83
|
+
根据[测试政策](../testing.zh.md)选择变更所属模块的行为检查,再运行文档检查:
|
|
84
|
+
|
|
85
|
+
```sh
|
|
86
|
+
pnpm run doc-sync
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
`doc-sync` 检查持久化清单和目录新鲜度、完整历史及双语配对。记录命令的 `ok: true` 不能替代这些检查,也不能替代所属模块的行为与迁移测试。JSON 失败响应保留 `ok: false`、诊断 `code` 和退出码 1。结构化变更包含稳定种类和逐根的变更前后摘要,自动化无需解析描述文本。
|
|
90
|
+
|
|
91
|
+
记录生成负责其目录和记录的双语对;包 README 或其他双语页面的编辑仍遵循常规配对流程。审阅并暂存预期差异,然后正常提交和推送。暂存 lint、配对、空白 hooks,以及 pre-push Host/Client 类型检查仍须执行。
|
|
92
|
+
|
|
93
|
+
<a id="competing-records"></a>
|
|
94
|
+
## 更新尚未接受的记录
|
|
95
|
+
|
|
96
|
+
记录后源码再次变化时,审阅兼容性说明,并刷新同一条尚未接受的末端记录:
|
|
97
|
+
|
|
98
|
+
```sh
|
|
99
|
+
pnpm --silent run persistence-changes --update 2026-09-11-poc-optional --prose .artifacts/persistence-change.prose.json --json
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
命令刷新机器声明、schema、目录和配对。没有 `--prose` 时,它保留已有说明。更新会拒绝初始基线、其他记录所依赖的记录,以及已被定稿检查点锁定的记录。定稿检查点之外,目录不会推断审阅接受状态:保留已接受历史,并创建后继。
|
|
103
|
+
|
|
104
|
+
集成产生竞争末端记录时,根据剩余历史更新尚未接受的记录,再重新评估最终差异。无关根的确认无需刷新。[机制决策](../../.agents/notes/implemented/process/2026-09-11-persistence-type-history.zh.md)解释为何保留完整快照和逐根前驱。
|
|
105
|
+
|
|
106
|
+
显式 `--decision` 仍是受检查的断言。若已有属性的值类型发生变化,下面这个故意错误的断言会在写入前失败:
|
|
107
|
+
|
|
108
|
+
```sh
|
|
109
|
+
pnpm --silent run persistence-changes --update 2026-09-11-poc-optional --decision same-version --json
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
<a id="dev-note"></a>
|
|
113
|
+
## 开发备注
|
|
114
|
+
|
|
115
|
+
<details>
|
|
116
|
+
<summary>维护者的工作上下文——点击展开</summary>
|
|
117
|
+
|
|
118
|
+
无。
|
|
119
|
+
|
|
120
|
+
</details>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
English | [中文](deepseek-llm-api-wire-extensions.zh.md)
|
|
4
4
|
|
|
5
|
-
This reference defines every DeepSeek Harness-specific HTTP header and additive JSON field sent by [`@deepseek-ai/dsh-llm-deepseek`](../packages/llm/llm-deepseek/README.md) on `deepseek-official`
|
|
5
|
+
This reference defines every DeepSeek Harness-specific HTTP header and additive JSON field sent by [`@deepseek-ai/dsh-llm-deepseek`](../packages/llm/llm-deepseek/README.md) on `deepseek-official` Messages requests. It does not redefine fields owned by the upstream DeepSeek API. The provider-neutral LLM interface and `llm-pi-ai` do not implement these additions.
|
|
6
6
|
|
|
7
7
|
The adapter sends the additions to its resolved `baseURL`, including a configured gateway. They remain outside `messages`, system prompts, and tool schemas, so they do not add model-input tokens or alter the model-visible prefix.
|
|
8
8
|
|
|
@@ -24,9 +24,9 @@ The [`DeepSeekLlmApiExtensionRegistry`](../packages/llm/deepseek-llm-api-extensi
|
|
|
24
24
|
| Header | Presence | Value |
|
|
25
25
|
|---|---|---|
|
|
26
26
|
| `user-agent` | Every provider HTTP request, including Files API operations | Application identity in `product/version (+url)` form; the default product is `deepseek-harness` |
|
|
27
|
-
| `x-deepseek-harness-user-id` | Every authorized
|
|
28
|
-
| `x-deepseek-harness-session-id` |
|
|
29
|
-
| `x-deepseek-harness-compact` |
|
|
27
|
+
| `x-deepseek-harness-user-id` | Every authorized model request | The stable anonymous UUID for the resolved Harness home |
|
|
28
|
+
| `x-deepseek-harness-session-id` | Model requests carrying a Session id | The exact request `sessionId` string |
|
|
29
|
+
| `x-deepseek-harness-compact` | Model requests whose purpose is `compaction` | The literal string `1` |
|
|
30
30
|
|
|
31
31
|
Credential failure happens before anonymous-user-id resolution, so an unauthorized request neither sends these headers nor creates the identity file. A direct request without a Session omits `x-deepseek-harness-session-id`. Session-title requests have no additional purpose header; the ordinary Session-id rule still applies when one carries a `sessionId`.
|
|
32
32
|
|
|
@@ -34,7 +34,7 @@ Credential failure happens before anonymous-user-id resolution, so an unauthoriz
|
|
|
34
34
|
|
|
35
35
|
The adapter serializes the complete base body, including the exact `messages`, before it asks registered providers to prepare fields. A provider receives that immutable body, the request cancellation signal, and optional `sessionId` and auxiliary-call `purpose`. Returning `undefined` omits that provider's field for the request.
|
|
36
36
|
|
|
37
|
-
Prepared JSON values are detached from provider-owned state, merged as top-level siblings of the base fields, and serialized in the same HTTP body. Preparation or collision failure prevents the request. A composition without the registry sends the unextended base body.
|
|
37
|
+
Prepared JSON values are detached from provider-owned state, merged as top-level siblings of the base fields, and serialized in the same HTTP body. Preparation or collision failure prevents the request. If the merged body fails to serialize, the adapter sends the base body without any extension field, skips the acceptance transaction so contributors resend their state on a later request, and logs the omitted field names. A composition without the registry sends the unextended base body.
|
|
38
38
|
|
|
39
39
|
After the configured endpoint returns HTTP 2xx, the adapter runs the prepared `accept()` transaction before reading the SSE response body. Transport failures and non-2xx responses do not accept any contribution. An acceptance failure fails the model request even though the endpoint returned 2xx. Acceptance records endpoint-level HTTP success; it does not assert that an SSE stream completed or that the endpoint persisted an extension.
|
|
40
40
|
|
|
@@ -67,24 +67,23 @@ Every request re-reads active non-group Loader entries from the host tree and, w
|
|
|
67
67
|
|
|
68
68
|
The sender deduplicates exact `(name, version)` pairs and sorts first by `name`, then by `version`, with a locale-independent text comparison. Simultaneously active versions of one package remain separate entries. Receivers must not collapse the array by package name or infer package activation from array order.
|
|
69
69
|
|
|
70
|
-
Disabled, pending, failed, unloading, disposed, and structural Loader entries are absent. Ordinary dependencies, loose modules without a named owning package, programmatically mounted child fibers, and in-memory dynamic plugins are also absent because they have no authoritative Loader package
|
|
70
|
+
Disabled, pending, failed, unloading, disposed, and structural Loader entries are absent. Ordinary dependencies, loose modules without a named owning package, programmatically mounted child fibers, and in-memory dynamic plugins are also absent because they have no authoritative Loader-backed package identity.
|
|
71
71
|
|
|
72
72
|
An enabled inventory with no qualifying entries sends `packages: []`; disabling the contributor omits the entire `dsh_plugin_packages` field. Package identities are provider metadata and never enter model input.
|
|
73
73
|
|
|
74
74
|
## `dsh_session_log`
|
|
75
75
|
|
|
76
|
-
[`@deepseek-ai/dsh-session-log-deepseek`](../packages/session/session-log-deepseek/README.md) contributes one contiguous suffix of the canonical Session log. The field is
|
|
76
|
+
[`@deepseek-ai/dsh-session-log-deepseek`](../packages/session/session-log-deepseek/README.md) contributes one contiguous suffix of the canonical Session log. The field is enabled by default. It applies to a request with a live Session and at least one event; a direct request, a stale Session id, or an empty log omits the field, as does a request whose first pending event alone exceeds `maxBytes` or cannot be serialized; a composition disables it with `enabled: false`. The examples below use logical Session format 2 only to illustrate the wire fields; they do not identify the [current writer format](session-format-status.md).
|
|
77
77
|
|
|
78
78
|
```json
|
|
79
79
|
{
|
|
80
80
|
"dsh_session_log": {
|
|
81
|
-
"version":
|
|
81
|
+
"version": 1,
|
|
82
82
|
"sessionFormatVersion": 2,
|
|
83
83
|
"session": {
|
|
84
84
|
"version": 2,
|
|
85
85
|
"id": "session-id",
|
|
86
|
-
"createdAt": 1780000000000
|
|
87
|
-
"isSeeded": false
|
|
86
|
+
"createdAt": 1780000000000
|
|
88
87
|
},
|
|
89
88
|
"afterSeq": -1,
|
|
90
89
|
"throughSeq": 0,
|
|
@@ -104,18 +103,18 @@ An enabled inventory with no qualifying entries sends `packages: []`; disabling
|
|
|
104
103
|
|
|
105
104
|
| Member | Type | Meaning |
|
|
106
105
|
|---|---|---|
|
|
107
|
-
| `version` | `
|
|
106
|
+
| `version` | `1` | Schema version for `dsh_session_log` |
|
|
108
107
|
| `sessionFormatVersion` | non-negative integer | Session format generation represented by this suffix |
|
|
109
108
|
| `session` | object | Immutable wire projection of the current Session header |
|
|
110
109
|
| `afterSeq` | integer | Greatest sequence recorded as accepted before this request, or `-1` |
|
|
111
110
|
| `throughSeq` | non-negative integer | Greatest sequence represented by this request |
|
|
112
111
|
| `events` | array | Contiguous events from `afterSeq + 1` through `throughSeq` |
|
|
113
112
|
|
|
114
|
-
The first upload uses `afterSeq: -1
|
|
113
|
+
The first upload uses `afterSeq: -1`, and each later upload starts after the greatest accepted watermark for the same Session id. Each upload carries the longest contiguous run from that point whose serialized field fits `maxBytes`, 8 MiB by default and counted in UTF-8 bytes including the header and numeric fields, so a backlog above the limit spans several accepted requests. The sender snapshots the event array once per request; appends after that snapshot belong to a later request.
|
|
115
114
|
|
|
116
115
|
### Wire Session header
|
|
117
116
|
|
|
118
|
-
The `session` member projects
|
|
117
|
+
The `session` member projects logical Session metadata to raw JSON primitives. A seeded Session sends its exact `Session.inheritedEventCount` as `seedLength`; an unseeded Session omits that field. The logical `isSeeded` flag does not appear on this wire. The outer `dsh_session_log.version` selects this extension schema, while `session.version` selects the logical Session format. Changing the Session header projection requires an extension-schema bump even when the embedded logical format also changes.
|
|
119
118
|
|
|
120
119
|
| Member | Presence | Meaning |
|
|
121
120
|
|---|---|---|
|
|
@@ -124,14 +123,14 @@ The `session` member projects `Session.header`, not a complete runtime Session o
|
|
|
124
123
|
| `createdAt` | required | Non-negative safe-integer Unix epoch milliseconds |
|
|
125
124
|
| `cwd` | optional | Absolute working directory recorded at Session creation |
|
|
126
125
|
| `parentSession` | optional | Parent Session id for a fork |
|
|
127
|
-
| `
|
|
126
|
+
| `seedLength` | seeded Sessions only | Exact inherited event count, including zero for an empty inherited prefix |
|
|
128
127
|
| `origin` | optional | Literal `subagent` for a subagent child |
|
|
129
128
|
| `delegationDepth` | optional | Non-negative persisted subagent delegation depth |
|
|
130
129
|
| `agentPreset` | optional | Agent preset id used to compose this Session |
|
|
131
130
|
|
|
132
131
|
### Canonical event envelopes
|
|
133
132
|
|
|
134
|
-
Each `events` item
|
|
133
|
+
Each `events` item carries a canonical event as raw JSON primitives, independently of every other request field. Every event includes `type`, numeric `seq`, `time`, and `data`, with `ignorable: true` preserved when present. Surface events require `surfaceOp`; replacement ranges use numeric `startSeq` and `endSeq`, and system, user, and tool events may also carry numeric `sourceEventSeqs`. Assistant provider metadata remains in its embedded stream. Known log-only events omit surface metadata; restored unknown ignorable records preserve opaque metadata without treating it as a surface operation.
|
|
135
134
|
|
|
136
135
|
### Acceptance watermark and at-least-once delivery
|
|
137
136
|
|
|
@@ -152,12 +151,12 @@ After the endpoint returns HTTP 2xx, the contribution appends this canonical eve
|
|
|
152
151
|
|
|
153
152
|
`delivery-accepted` means that the configured endpoint returned HTTP 2xx for the containing LLM request. It does not assert SSE completion or remote persistence. The event's `throughSeq` must identify an earlier event, its `sessionId` identifies the Session whose suffix was sent, and `sessionFormatVersion` binds the watermark to that exact logical generation. Absence means historical format v0.
|
|
154
153
|
|
|
155
|
-
The sender folds the greatest matching `throughSeq` for the current Session id and format generation, so concurrent accepted requests cannot move the cursor backward and a watermark from another generation cannot authorize the current suffix. A resumed process rebuilds the cursor from the durable log. A fork ignores inherited watermarks that name another Session, and therefore
|
|
154
|
+
The sender folds the greatest matching `throughSeq` for the current Session id and format generation, so concurrent accepted requests cannot move the cursor backward and a watermark from another generation cannot authorize the current suffix. A resumed process rebuilds the cursor from the durable log. A fork ignores inherited watermarks that name another Session, and therefore uploads its own inherited prefix from sequence zero, in requests bounded by `maxBytes`, before advancing under the child id. The watermark event itself belongs to the next unsent suffix.
|
|
156
155
|
|
|
157
|
-
Transport
|
|
156
|
+
Transport failures, non-2xx responses, and requests sent without extension fields after a serialization failure append no watermark. A crash after endpoint acceptance but before local persistence may resend an already accepted range; uncertainty produces duplicates, never a sequence gap. There is no independent upload store or truncation path; `maxBytes` bounds each request's field instead.
|
|
158
157
|
|
|
159
158
|
## Exposure and receiver requirements
|
|
160
159
|
|
|
161
|
-
The request headers expose the Harness application version, one anonymous Harness-home identity, and an optional Session identity. `dsh_plugin_packages` exposes active npm package names and versions.
|
|
160
|
+
The request headers expose the Harness application version, one anonymous Harness-home identity, and an optional Session identity. `dsh_plugin_packages` exposes active npm package names and versions. Unless a composition disables it, `dsh_session_log` may expose the Session working directory, system-prompt snapshots, user and Assistant content, embedded Assistant streams, failed-attempt output, tool arguments and results, compaction summaries, feedback, and plugin-owned events. Adapter API keys are not Session events and therefore do not enter the field. A gateway selected through `baseURL` receives the same values as the official endpoint.
|
|
162
161
|
|
|
163
|
-
Receivers address extension fields by name, dispatch each field by its own `version`, preserve distinct package versions, and ignore JSON member ordering. A session-log receiver validates the contiguous sequence range before interpreting event types. An unrecognized canonical event without `ignorable: true` prevents lossless reconstruction. The base request remains usable without either the registry or a particular contribution; field absence means that contribution did not apply to that request.
|
|
162
|
+
Receivers address extension fields by name, dispatch each field by its own `version`, preserve distinct package versions, and ignore JSON member ordering. A session-log receiver validates the contiguous sequence range before interpreting event types. An unrecognized canonical event without `ignorable: true` prevents lossless reconstruction. The base request remains usable without either the registry or a particular contribution; field absence means that contribution did not apply to that request. While a session-log backlog drains, `throughSeq` trails the Session's latest event, so a 2xx does not show that the receiver holds the current log.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[English](deepseek-llm-api-wire-extensions.md) | 中文
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
本参考定义 [`@deepseek-ai/dsh-llm-deepseek`](../packages/llm/llm-deepseek/README.zh.md) 在 `deepseek-official` Messages 请求中发送的全部 DeepSeek Harness 专用 HTTP 标头与附加 JSON 字段。它不重新定义上游 DeepSeek API 自有字段。提供方无关的 LLM 接口与 `llm-pi-ai` 不实现这些扩展。
|
|
6
6
|
|
|
7
7
|
适配器将这些扩展发送至已解析的 `baseURL`,包括已配置的网关。扩展位于 `messages`、系统提示词和工具 schema 之外,因此不会增加模型输入 token,也不会改变模型可见前缀。
|
|
8
8
|
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
| 标头 | 出现条件 | 值 |
|
|
25
25
|
|---|---|---|
|
|
26
26
|
| `user-agent` | 每个提供方 HTTP 请求,包括 Files API 操作 | 采用 `product/version (+url)` 形式的应用身份;默认产品为 `deepseek-harness` |
|
|
27
|
-
| `x-deepseek-harness-user-id` |
|
|
28
|
-
| `x-deepseek-harness-session-id` | 携带会话 id
|
|
29
|
-
| `x-deepseek-harness-compact` | 用途为 `compaction`
|
|
27
|
+
| `x-deepseek-harness-user-id` | 每个已授权的模型请求 | 已解析 Harness home 的稳定匿名 UUID |
|
|
28
|
+
| `x-deepseek-harness-session-id` | 携带会话 id 的模型请求 | 确切的请求 `sessionId` 字符串 |
|
|
29
|
+
| `x-deepseek-harness-compact` | 用途为 `compaction` 的模型请求 | 字面字符串 `1` |
|
|
30
30
|
|
|
31
31
|
凭据失败发生在解析匿名用户 id 之前,因此未授权请求既不会发送这些标头,也不会创建身份文件。没有会话的直接请求会省略 `x-deepseek-harness-session-id`。会话标题请求没有额外的用途标头;请求携带 `sessionId` 时,仍然适用普通的会话 id 规则。
|
|
32
32
|
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
|
|
35
35
|
适配器先序列化包括确切 `messages` 在内的完整基础正文,再让已注册提供方准备字段。提供方会收到该不可变正文、请求取消信号,以及可选的 `sessionId` 和辅助调用 `purpose`。提供方返回 `undefined` 时,本次请求会省略其字段。
|
|
36
36
|
|
|
37
|
-
系统将已准备的 JSON 值与提供方持有的状态分离,再将其作为基础字段的顶层同级成员合并,并序列化到同一个 HTTP
|
|
37
|
+
系统将已准备的 JSON 值与提供方持有的状态分离,再将其作为基础字段的顶层同级成员合并,并序列化到同一个 HTTP 正文中。准备失败或冲突会阻止请求。合并后的正文无法序列化时,适配器发送不含任何扩展字段的基础正文,跳过接受事务,让贡献方在之后的请求中重发自身状态,并记录被省略的字段名。组合未挂载注册表时,适配器发送未经扩展的基础正文。
|
|
38
38
|
|
|
39
39
|
已配置端点返回 HTTP 2xx 后,适配器会在读取 SSE 正文之前运行已准备的 `accept()` 事务。传输失败和非 2xx 响应不会接受任何贡献。即使端点返回 2xx,接受失败仍会使模型请求失败。接受仅记录端点级 HTTP 成功,不表示 SSE 流已完整结束,也不表示端点已持久化扩展。
|
|
40
40
|
|
|
@@ -73,18 +73,17 @@
|
|
|
73
73
|
|
|
74
74
|
## `dsh_session_log`
|
|
75
75
|
|
|
76
|
-
[`@deepseek-ai/dsh-session-log-deepseek`](../packages/session/session-log-deepseek/README.zh.md)
|
|
76
|
+
[`@deepseek-ai/dsh-session-log-deepseek`](../packages/session/session-log-deepseek/README.zh.md) 贡献权威会话日志的一段连续后缀。该字段默认启用。它适用于携带存活会话且至少存在一个事件的请求;直接请求、陈旧会话 id 或空日志会省略该字段,第一条待发事件本身超过 `maxBytes` 或无法序列化的请求也会省略该字段;组合可用 `enabled: false` 禁用它。下方示例使用逻辑 Session 格式 2 仅为说明协议字段,并不标识[当前写入格式](session-format-status.zh.md)。
|
|
77
77
|
|
|
78
78
|
```json
|
|
79
79
|
{
|
|
80
80
|
"dsh_session_log": {
|
|
81
|
-
"version":
|
|
81
|
+
"version": 1,
|
|
82
82
|
"sessionFormatVersion": 2,
|
|
83
83
|
"session": {
|
|
84
84
|
"version": 2,
|
|
85
85
|
"id": "session-id",
|
|
86
|
-
"createdAt": 1780000000000
|
|
87
|
-
"isSeeded": false
|
|
86
|
+
"createdAt": 1780000000000
|
|
88
87
|
},
|
|
89
88
|
"afterSeq": -1,
|
|
90
89
|
"throughSeq": 0,
|
|
@@ -104,18 +103,18 @@
|
|
|
104
103
|
|
|
105
104
|
| 成员 | 类型 | 含义 |
|
|
106
105
|
|---|---|---|
|
|
107
|
-
| `version` | `
|
|
106
|
+
| `version` | `1` | `dsh_session_log` 的 schema 版本 |
|
|
108
107
|
| `sessionFormatVersion` | 非负整数 | 该后缀所表示的 Session 格式 generation |
|
|
109
108
|
| `session` | 对象 | 当前 Session header 的不可变协议投影 |
|
|
110
109
|
| `afterSeq` | 整数 | 本次请求前记录为已接受的最大序号,或 `-1` |
|
|
111
110
|
| `throughSeq` | 非负整数 | 本次请求所表示的最大序号 |
|
|
112
111
|
| `events` | 数组 | 从 `afterSeq + 1` 到 `throughSeq` 的连续事件 |
|
|
113
112
|
|
|
114
|
-
首次上传使用 `afterSeq: -1
|
|
113
|
+
首次上传使用 `afterSeq: -1`,此后每次上传都从同一会话 id 的最大已接受水位(watermark)之后开始。每次上传携带从该位置起、序列化后能放进 `maxBytes` 的最长连续事件段;`maxBytes` 默认 8 MiB,按 UTF-8 字节计算,包括 header 与数值字段,因此超过上限的积压会分多次已接受的请求传完。发送方为每次请求仅快照一次事件数组;快照后的追加内容属于后续请求。
|
|
115
114
|
|
|
116
115
|
### Session 协议 header
|
|
117
116
|
|
|
118
|
-
`session`
|
|
117
|
+
`session` 成员将逻辑 Session 元数据投影为原始 JSON 基元。seeded Session 以 `seedLength` 发送确切的 `Session.inheritedEventCount`;未 seeded 的 Session 省略该字段。逻辑 `isSeeded` 标志不出现在此协议中。外层 `dsh_session_log.version` 选择本扩展 schema,`session.version` 则选择逻辑 Session 格式。即使嵌入的逻辑格式同时变化,只要 Session header 投影变化,扩展 schema 也必须升版。
|
|
119
118
|
|
|
120
119
|
| 成员 | 出现条件 | 含义 |
|
|
121
120
|
|---|---|---|
|
|
@@ -124,14 +123,14 @@
|
|
|
124
123
|
| `createdAt` | 必需 | 非负安全整数 Unix epoch 毫秒数 |
|
|
125
124
|
| `cwd` | 可选 | 创建会话时记录的绝对工作目录 |
|
|
126
125
|
| `parentSession` | 可选 | fork 的父会话 id |
|
|
127
|
-
| `
|
|
126
|
+
| `seedLength` | 仅 seeded Session | 确切的继承事件数量;空的继承前缀使用零 |
|
|
128
127
|
| `origin` | 可选 | subagent 子项使用的字面值 `subagent` |
|
|
129
128
|
| `delegationDepth` | 可选 | 持久化的非负 subagent 委派深度 |
|
|
130
129
|
| `agentPreset` | 可选 | 用于组合该会话的 agent preset id |
|
|
131
130
|
|
|
132
131
|
### 权威事件信封
|
|
133
132
|
|
|
134
|
-
每个 `events`
|
|
133
|
+
每个 `events` 元素以原始 JSON 基元承载规范事件,不依赖任何其他请求字段。每个事件包含 `type`、数值型 `seq`、`time` 与 `data`,存在 `ignorable: true` 时保留该值。表层事件必须携带 `surfaceOp`;替换范围使用数值型 `startSeq` 与 `endSeq`,system、user 和 tool 事件还可携带数值型 `sourceEventSeqs`。assistant 的提供方元数据保留在内嵌流中。已知的仅日志事件省略表层元数据;恢复的未知可忽略记录保留不透明元数据,但不将其解释为表层操作。
|
|
135
134
|
|
|
136
135
|
### 接受水位与至少一次交付
|
|
137
136
|
|
|
@@ -152,12 +151,12 @@
|
|
|
152
151
|
|
|
153
152
|
`delivery-accepted` 表示已配置端点为包含该字段的 LLM 请求返回 HTTP 2xx。它不表示 SSE 已完整结束,也不表示远端已经持久化。该事件的 `throughSeq` 必须标识一项更早的事件,`sessionId` 标识已发送后缀所属的 Session,`sessionFormatVersion` 则把水位绑定到该逻辑 generation。缺少该字段表示历史格式 v0。
|
|
154
153
|
|
|
155
|
-
发送方只会为当前 Session id 与格式 generation 折叠最大的匹配 `throughSeq`,因此并发已接受请求无法使游标倒退,其他 generation 的水位也不能授权当前后缀。恢复后的进程会从持久日志重建游标。fork 会忽略命名其他 Session
|
|
154
|
+
发送方只会为当前 Session id 与格式 generation 折叠最大的匹配 `throughSeq`,因此并发已接受请求无法使游标倒退,其他 generation 的水位也不能授权当前后缀。恢复后的进程会从持久日志重建游标。fork 会忽略命名其他 Session 的继承水位,因此从序号零开始、按 `maxBytes` 分多次请求上传自身的继承前缀,再以子会话 id 推进。水位事件自身属于下一段未发送后缀。
|
|
156
155
|
|
|
157
|
-
|
|
156
|
+
传输失败、非 2xx 响应,以及序列化失败后不带扩展字段发出的请求,都不会追加水位。端点接受后、本地持久化前发生崩溃时,系统可能重新发送已接受范围;不确定性只会产生重复,绝不会产生序号缺口。系统没有独立上传存储或截断路径;`maxBytes` 负责限制每次请求的字段大小。
|
|
158
157
|
|
|
159
158
|
## 暴露内容与接收方要求
|
|
160
159
|
|
|
161
|
-
请求标头会暴露 Harness 应用版本、一个匿名 Harness-home 身份和可选的会话身份。`dsh_plugin_packages` 会暴露存活 npm
|
|
160
|
+
请求标头会暴露 Harness 应用版本、一个匿名 Harness-home 身份和可选的会话身份。`dsh_plugin_packages` 会暴露存活 npm 包的名称与版本。除非组合禁用该字段,`dsh_session_log` 可能暴露会话工作目录、系统提示词快照、用户与 Assistant 内容、嵌入式 Assistant stream、失败 attempt 输出、工具参数与结果、压缩摘要、反馈和插件持有的事件。适配器 API key 不是会话事件,因此不会进入该字段。通过 `baseURL` 选择的网关会收到与官方端点相同的值。
|
|
162
161
|
|
|
163
|
-
接收方按名称定位扩展字段,按各字段自己的 `version` 分派,保留不同的包版本,并忽略 JSON 成员顺序。会话日志接收方必须先校验连续序号范围,再解释事件类型。遇到不带 `ignorable: true`
|
|
162
|
+
接收方按名称定位扩展字段,按各字段自己的 `version` 分派,保留不同的包版本,并忽略 JSON 成员顺序。会话日志接收方必须先校验连续序号范围,再解释事件类型。遇到不带 `ignorable: true` 的未知权威事件时,接收方无法进行无损重建。即使缺少注册表或某项贡献,基础请求仍然可用;字段缺失表示该项贡献不适用于本次请求。会话日志积压补传期间,`throughSeq` 落后于会话的最新事件,因此 2xx 并不表示接收方已持有当前完整日志。
|