dsh-plugin-dev-kb 1.4.0 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/README.en.md +6 -6
- package/README.md +10 -5
- package/kb/INDEX.md +8 -4
- package/kb/extra/AGENTS.md +4 -3
- package/kb/extra/agent-lifecycle.md +91 -0
- package/kb/extra/agent-lifecycle.zh.md +93 -0
- package/kb/extra/api-gateway.md +172 -0
- package/kb/extra/api-gateway.zh.md +178 -0
- package/kb/extra/architecture.md +165 -0
- package/kb/extra/architecture.zh.md +169 -0
- package/kb/extra/capability-seams.md +714 -0
- package/kb/extra/capability-seams.zh.md +716 -0
- package/kb/extra/cli-help.md +203 -0
- package/kb/extra/cli-help.zh.md +205 -0
- package/kb/extra/config-catalog.md +4801 -0
- package/kb/extra/config-catalog.zh.md +4803 -0
- package/kb/extra/cookbook/adding-a-package.md +170 -0
- package/kb/extra/cookbook/adding-a-package.zh.md +170 -0
- package/kb/extra/cookbook/adding-a-plugin-preview.md +52 -0
- package/kb/extra/cookbook/adding-a-plugin-preview.zh.md +52 -0
- package/kb/extra/cookbook/adding-a-session-format-version.md +7 -5
- package/kb/extra/cookbook/adding-a-session-format-version.zh.md +7 -5
- package/kb/extra/cookbook/adding-a-settings-card.md +72 -0
- package/kb/extra/cookbook/adding-a-settings-card.zh.md +72 -0
- package/kb/extra/cookbook/adding-a-tool.md +101 -0
- package/kb/extra/cookbook/adding-a-tool.zh.md +103 -0
- package/kb/extra/cookbook/adding-an-llm-adapter.md +43 -0
- package/kb/extra/cookbook/adding-an-llm-adapter.zh.md +43 -0
- package/kb/extra/cookbook/extension-cookbook.md +132 -0
- package/kb/extra/cookbook/extension-cookbook.zh.md +136 -0
- package/kb/extra/cookbook/reviewing-persistence-type-changes.md +11 -9
- package/kb/extra/cookbook/reviewing-persistence-type-changes.zh.md +11 -9
- package/kb/extra/cordis-api/context.md +364 -0
- package/kb/extra/cordis-api/context.zh.md +366 -0
- package/kb/extra/cordis-api/events.md +207 -0
- package/kb/extra/cordis-api/events.zh.md +209 -0
- package/kb/extra/cordis-api/fiber.md +375 -0
- package/kb/extra/cordis-api/fiber.zh.md +377 -0
- package/kb/extra/cordis-api/inherited.md +38 -0
- package/kb/extra/cordis-api/registry.md +152 -0
- package/kb/extra/cordis-api/registry.zh.md +154 -0
- package/kb/extra/cordis-api/service.md +102 -0
- package/kb/extra/cordis-api/service.zh.md +104 -0
- package/kb/extra/cordis-tutorial/01-first-plugin.md +95 -0
- package/kb/extra/cordis-tutorial/01-first-plugin.zh.md +95 -0
- package/kb/extra/cordis-tutorial/02-lifecycle-and-effects.md +98 -0
- package/kb/extra/cordis-tutorial/02-lifecycle-and-effects.zh.md +98 -0
- package/kb/extra/cordis-tutorial/03-services.md +98 -0
- package/kb/extra/cordis-tutorial/03-services.zh.md +98 -0
- package/kb/extra/cordis-tutorial/04-events.md +144 -0
- package/kb/extra/cordis-tutorial/04-events.zh.md +144 -0
- package/kb/extra/cordis-tutorial/05-config.md +111 -0
- package/kb/extra/cordis-tutorial/05-config.zh.md +111 -0
- package/kb/extra/cordis-tutorial/06-composition-and-hmr.md +113 -0
- package/kb/extra/cordis-tutorial/06-composition-and-hmr.zh.md +113 -0
- package/kb/extra/cordis-tutorial/07-into-the-harness.md +108 -0
- package/kb/extra/cordis-tutorial/07-into-the-harness.zh.md +108 -0
- package/kb/extra/cordis-tutorial/index.md +60 -0
- package/kb/extra/cordis-tutorial/index.zh.md +62 -0
- package/kb/extra/deepseek-llm-api-wire-extensions.md +5 -5
- package/kb/extra/deepseek-llm-api-wire-extensions.zh.md +5 -5
- package/kb/extra/defensive-patterns/README.md +25 -0
- package/kb/extra/defensive-patterns/README.zh.md +27 -0
- package/kb/extra/defensive-patterns/client-components.md +493 -0
- package/kb/extra/defensive-patterns/client-components.zh.md +495 -0
- package/kb/extra/defensive-patterns/conversation-and-session.md +316 -0
- package/kb/extra/defensive-patterns/conversation-and-session.zh.md +316 -0
- package/kb/extra/defensive-patterns/general.md +222 -0
- package/kb/extra/defensive-patterns/general.zh.md +252 -0
- package/kb/extra/defensive-patterns/package-surface.md +231 -0
- package/kb/extra/defensive-patterns/package-surface.zh.md +231 -0
- package/kb/extra/defensive-patterns/remote-and-api.md +115 -0
- package/kb/extra/defensive-patterns/remote-and-api.zh.md +115 -0
- package/kb/extra/development.md +31 -11
- package/kb/extra/development.zh.md +32 -11
- package/kb/extra/event-producer-consumer.md +40 -39
- package/kb/extra/event-producer-consumer.zh.md +40 -39
- package/kb/extra/experimental-persistence-catalog.md +17 -0
- package/kb/extra/experimental-persistence-catalog.zh.md +17 -0
- package/kb/extra/glossary.md +1 -0
- package/kb/extra/glossary.zh.md +1 -0
- package/kb/extra/i18n/style-samples.md +2 -2
- package/kb/extra/i18n/terminology.md +1 -0
- package/kb/extra/module-graph.md +274 -195
- package/kb/extra/module-graph.zh.md +274 -195
- package/kb/extra/persistence-catalog.md +9140 -0
- package/kb/extra/persistence-catalog.zh.md +9142 -0
- package/kb/extra/persistence-changes/2026-09-13-working-directory.md +48 -0
- package/kb/extra/persistence-changes/2026-09-13-working-directory.zh.md +48 -0
- package/kb/extra/persistence-changes/2026-09-16-session-format-v4.md +2 -2
- package/kb/extra/persistence-changes/2026-09-16-session-format-v4.zh.md +2 -2
- package/kb/extra/persistence-changes/2026-09-19-external-subagent-catalog.md +48 -0
- package/kb/extra/persistence-changes/2026-09-19-external-subagent-catalog.zh.md +48 -0
- package/kb/extra/persistence-changes/2026-09-30-job-session-lifecycle.md +52 -0
- package/kb/extra/persistence-changes/2026-09-30-job-session-lifecycle.zh.md +52 -0
- package/kb/extra/persistence-changes/2026-10-05-ptc-operation-metadata.md +48 -0
- package/kb/extra/persistence-changes/2026-10-05-ptc-operation-metadata.zh.md +48 -0
- package/kb/extra/persistence-changes/2026-10-05-working-directory-attribution.md +60 -0
- package/kb/extra/persistence-changes/2026-10-05-working-directory-attribution.zh.md +60 -0
- package/kb/extra/persistence-changes/2026-10-07-title-reasoning-effort.md +48 -0
- package/kb/extra/persistence-changes/2026-10-07-title-reasoning-effort.zh.md +48 -0
- package/kb/extra/persistence-changes/2026-10-13-deepseek-search-thinking.md +48 -0
- package/kb/extra/persistence-changes/2026-10-13-deepseek-search-thinking.zh.md +48 -0
- package/kb/extra/persistence-changes/2026-10-13-user-rpc-principal.md +60 -0
- package/kb/extra/persistence-changes/2026-10-13-user-rpc-principal.zh.md +60 -0
- package/kb/extra/persistence-changes/README.md +12 -10
- package/kb/extra/persistence-changes/README.zh.md +12 -10
- package/kb/extra/persistence-changes/historical-formats/README.md +1 -1
- package/kb/extra/persistence-changes/historical-formats/README.zh.md +1 -1
- package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.2.md +50 -50
- package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.2.zh.md +50 -50
- package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.3.md +14 -14
- package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.3.zh.md +14 -14
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.7.md +3 -3
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.7.zh.md +3 -3
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.8.md +10 -10
- package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.8.zh.md +10 -10
- package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.1.md +3 -3
- package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.1.zh.md +3 -3
- package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.2.md +13 -13
- package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.2.zh.md +13 -13
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.1.md +63 -63
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.1.zh.md +63 -63
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.2.md +54 -54
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.2.zh.md +54 -54
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.4.md +7 -7
- package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.4.zh.md +7 -7
- package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.1.md +27 -27
- package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.1.zh.md +27 -27
- package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.2.md +4 -4
- package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.2.zh.md +4 -4
- package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.1.md +27 -27
- package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.1.zh.md +27 -27
- package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.2.md +7 -7
- package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.2.zh.md +7 -7
- package/kb/extra/session-format-status.md +6 -6
- package/kb/extra/session-format-status.zh.md +6 -6
- package/kb/extra/subsystems/README.md +76 -0
- package/kb/extra/subsystems/README.zh.md +76 -0
- package/kb/extra/subsystems/agent-team.md +10 -10
- package/kb/extra/subsystems/agent-team.zh.md +10 -10
- package/kb/extra/subsystems/approval.md +170 -0
- package/kb/extra/subsystems/approval.zh.md +170 -0
- package/kb/extra/subsystems/boot.md +128 -4
- package/kb/extra/subsystems/boot.zh.md +128 -4
- package/kb/extra/subsystems/claude-code-mods.md +1 -1
- package/kb/extra/subsystems/claude-code-mods.zh.md +1 -1
- package/kb/extra/subsystems/client-modules.md +198 -0
- package/kb/extra/subsystems/client-modules.zh.md +198 -0
- package/kb/extra/subsystems/client-resources.md +92 -0
- package/kb/extra/subsystems/client-resources.zh.md +92 -0
- package/kb/extra/subsystems/commands.md +223 -0
- package/kb/extra/subsystems/commands.zh.md +223 -0
- package/kb/extra/subsystems/compaction.md +284 -0
- package/kb/extra/subsystems/compaction.zh.md +284 -0
- package/kb/extra/subsystems/computer-use.md +3 -0
- package/kb/extra/subsystems/computer-use.zh.md +3 -0
- package/kb/extra/subsystems/conversation.md +301 -0
- package/kb/extra/subsystems/conversation.zh.md +303 -0
- package/kb/extra/subsystems/core.md +1113 -0
- package/kb/extra/subsystems/core.zh.md +1125 -0
- package/kb/extra/subsystems/credentials.md +493 -0
- package/kb/extra/subsystems/credentials.zh.md +493 -0
- package/kb/extra/subsystems/filesystem.md +530 -0
- package/kb/extra/subsystems/filesystem.zh.md +530 -0
- package/kb/extra/subsystems/goal.md +313 -0
- package/kb/extra/subsystems/goal.zh.md +313 -0
- package/kb/extra/subsystems/jobs.md +554 -0
- package/kb/extra/subsystems/jobs.zh.md +554 -0
- package/kb/extra/subsystems/llm-streaming.md +1196 -0
- package/kb/extra/subsystems/llm-streaming.zh.md +1202 -0
- package/kb/extra/subsystems/lsp.md +202 -0
- package/kb/extra/subsystems/lsp.zh.md +202 -0
- package/kb/extra/subsystems/permission-presets.md +167 -0
- package/kb/extra/subsystems/permission-presets.zh.md +167 -0
- package/kb/extra/subsystems/persistence.md +418 -0
- package/kb/extra/subsystems/persistence.zh.md +418 -0
- package/kb/extra/subsystems/plan.md +87 -0
- package/kb/extra/subsystems/plan.zh.md +87 -0
- package/kb/extra/subsystems/product-telemetry.md +4 -2
- package/kb/extra/subsystems/product-telemetry.zh.md +4 -2
- package/kb/extra/subsystems/ptc-runtime.md +250 -0
- package/kb/extra/subsystems/ptc-runtime.zh.md +250 -0
- package/kb/extra/subsystems/sandbox.md +221 -0
- package/kb/extra/subsystems/sandbox.zh.md +221 -0
- package/kb/extra/subsystems/schedule.md +550 -0
- package/kb/extra/subsystems/schedule.zh.md +550 -0
- package/kb/extra/subsystems/scope.md +59 -0
- package/kb/extra/subsystems/scope.zh.md +61 -0
- package/kb/extra/subsystems/session-projection.md +356 -0
- package/kb/extra/subsystems/session-projection.zh.md +356 -0
- package/kb/extra/subsystems/session-query.md +511 -0
- package/kb/extra/subsystems/session-query.zh.md +511 -0
- package/kb/extra/subsystems/session-reference.md +224 -0
- package/kb/extra/subsystems/session-reference.zh.md +224 -0
- package/kb/extra/subsystems/session-telemetry.md +212 -0
- package/kb/extra/subsystems/session-telemetry.zh.md +212 -0
- package/kb/extra/subsystems/session-title.md +213 -0
- package/kb/extra/subsystems/session-title.zh.md +213 -0
- package/kb/extra/subsystems/session.md +1339 -0
- package/kb/extra/subsystems/session.zh.md +1343 -0
- package/kb/extra/subsystems/settings.md +155 -0
- package/kb/extra/subsystems/settings.zh.md +155 -0
- package/kb/extra/subsystems/shell.md +314 -0
- package/kb/extra/subsystems/shell.zh.md +314 -0
- package/kb/extra/subsystems/sidebar-right.md +160 -0
- package/kb/extra/subsystems/sidebar-right.zh.md +160 -0
- package/kb/extra/subsystems/skills.md +352 -0
- package/kb/extra/subsystems/skills.zh.md +352 -0
- package/kb/extra/subsystems/slots.md +200 -0
- package/kb/extra/subsystems/slots.zh.md +204 -0
- package/kb/extra/subsystems/spill.md +124 -0
- package/kb/extra/subsystems/spill.zh.md +124 -0
- package/kb/extra/subsystems/ssh.md +22 -11
- package/kb/extra/subsystems/ssh.zh.md +22 -11
- package/kb/extra/subsystems/storage.md +259 -0
- package/kb/extra/subsystems/storage.zh.md +259 -0
- package/kb/extra/subsystems/subagent.md +686 -0
- package/kb/extra/subsystems/subagent.zh.md +688 -0
- package/kb/extra/subsystems/subprocess.md +321 -0
- package/kb/extra/subsystems/subprocess.zh.md +321 -0
- package/kb/extra/subsystems/system-prompt.md +254 -0
- package/kb/extra/subsystems/system-prompt.zh.md +254 -0
- package/kb/extra/subsystems/terminal.md +184 -0
- package/kb/extra/subsystems/terminal.zh.md +184 -0
- package/kb/extra/subsystems/token-meter.md +106 -0
- package/kb/extra/subsystems/token-meter.zh.md +106 -0
- package/kb/extra/subsystems/tools.md +747 -0
- package/kb/extra/subsystems/tools.zh.md +747 -0
- package/kb/extra/subsystems/translation.md +103 -0
- package/kb/extra/subsystems/translation.zh.md +103 -0
- package/kb/extra/subsystems/typert.md +690 -0
- package/kb/extra/subsystems/typert.zh.md +690 -0
- package/kb/extra/subsystems/user-questions.md +307 -0
- package/kb/extra/subsystems/user-questions.zh.md +307 -0
- package/kb/extra/subsystems/web-client.md +100 -0
- package/kb/extra/subsystems/web-client.zh.md +100 -0
- package/kb/extra/subsystems/web-server.md +302 -0
- package/kb/extra/subsystems/web-server.zh.md +302 -0
- package/kb/extra/subsystems/web.md +206 -0
- package/kb/extra/subsystems/web.zh.md +206 -0
- package/kb/extra/subsystems/webhook.md +1 -1
- package/kb/extra/subsystems/webhook.zh.md +1 -1
- package/kb/extra/subsystems/workflow.md +278 -0
- package/kb/extra/subsystems/workflow.zh.md +278 -0
- package/kb/extra/subsystems/working-directory.md +64 -0
- package/kb/extra/subsystems/working-directory.zh.md +64 -0
- package/kb/extra/subsystems/workspace.md +647 -0
- package/kb/extra/subsystems/workspace.zh.md +647 -0
- package/kb/extra/subsystems/worktrees.md +76 -0
- package/kb/extra/subsystems/worktrees.zh.md +76 -0
- package/kb/extra/testing.md +1 -1
- package/kb/extra/testing.zh.md +1 -1
- package/kb/extra/tool-catalog.md +2824 -0
- package/kb/extra/tool-catalog.zh.md +2832 -0
- package/kb/extra/tool-execution-pipeline.md +65 -0
- package/kb/extra/tool-execution-pipeline.zh.md +67 -0
- package/kb/extra/ui-radius.md +6 -4
- package/kb/extra/ui-radius.zh.md +6 -4
- package/kb/extra/upgrade-guide/v0.2.0-rc.2/bundled-python-tests/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.0-rc.2/bundled-python-tests/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.0-rc.2/primary-runtime-python-aliases/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.0-rc.2/primary-runtime-python-aliases/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/deepseek-model-discovery/guide.md +17 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/deepseek-model-discovery/guide.zh.md +17 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/desktop-test-auth-popup/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/desktop-test-auth-popup/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/experimental-package-composition/guide.md +28 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/experimental-package-composition/guide.zh.md +28 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/instruction-home-override/guide.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/instruction-home-override/guide.zh.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/job-id-identity/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/job-id-identity/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/jsonl-persistence-plugin/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/jsonl-persistence-plugin/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/mock-messages-events/guide.md +17 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/mock-messages-events/guide.zh.md +17 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/native-subagent-bundle-tools/guide.md +31 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/native-subagent-bundle-tools/guide.zh.md +31 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/new-session-generations/guide.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/new-session-generations/guide.zh.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/plugin-option-placement/guide.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/plugin-option-placement/guide.zh.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/python-optional-resources/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/python-optional-resources/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/python-ptc-sandbox/guide.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/python-ptc-sandbox/guide.zh.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/session-title-adapters/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/session-title-adapters/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/session-title-provider-strategy/guide.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/session-title-provider-strategy/guide.zh.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/ssh-helper-launch/guide.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/ssh-helper-launch/guide.zh.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/subagent-activations/guide.md +59 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/subagent-activations/guide.zh.md +59 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/subagent-preset-composition/guide.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/subagent-preset-composition/guide.zh.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/team-direct-inbox/guide.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/team-direct-inbox/guide.zh.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/terminal-command-labels/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/terminal-command-labels/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/tool-presentation-mode/guide.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/tool-presentation-mode/guide.zh.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/web-listener-trust-config/guide.md +36 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/web-listener-trust-config/guide.zh.md +36 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/working-directory/guide.md +25 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/working-directory/guide.zh.md +25 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/deepseek-account-identity-watch/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/deepseek-account-identity-watch/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/deepseek-account-model-catalog/guide.md +27 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/deepseek-account-model-catalog/guide.zh.md +27 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/desktop-font-size-shortcuts/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/desktop-font-size-shortcuts/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/from-default-profile-replaces-target/guide.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/from-default-profile-replaces-target/guide.zh.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/operator-connect/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/operator-connect/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/pi-ai-azure-provider/guide.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/pi-ai-azure-provider/guide.zh.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/pi-ai-model-discovery/guide.md +17 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/pi-ai-model-discovery/guide.zh.md +17 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/plugin-install-over-installed/guide.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/plugin-install-over-installed/guide.zh.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/sdk-minimal-image-compaction/guide.md +32 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/sdk-minimal-image-compaction/guide.zh.md +32 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/stored-credentials-precedence/guide.md +25 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/stored-credentials-precedence/guide.zh.md +25 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.3/plugin-engines-dsh/guide.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.3/plugin-engines-dsh/guide.zh.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.4/account-notification-fields/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.4/account-notification-fields/guide.zh.md +18 -0
- package/kb/meta/search-index.json +1932 -366
- package/kb/meta/source.json +9 -8
- package/kb/site/develop/basic/publish.md +3 -1
- package/kb/site/en/develop/basic/publish.md +3 -1
- package/kb/site/en/guide/github-review.md +7 -10
- package/kb/site/en/guide/plugin-market.md +151 -0
- package/kb/site/en/guide/providers.md +27 -4
- package/kb/site/en/guide/public-deployments.md +10 -6
- package/kb/site/en/guide/python-sdk.md +8 -9
- package/kb/site/en/reference/api-gateway.md +10 -3
- package/kb/site/en/reference/capability-seams.md +71 -24
- package/kb/site/en/reference/config-catalog.md +452 -191
- package/kb/site/en/reference/experimental-persistence-catalog.md +20 -0
- package/kb/site/en/reference/index.md +11 -12
- package/kb/site/en/reference/persistence-catalog.md +552 -192
- package/kb/site/en/reference/subsystems/client-modules.md +14 -0
- package/kb/site/en/reference/subsystems/conversation.md +14 -0
- package/kb/site/en/reference/subsystems/core.md +3 -1
- package/kb/site/en/reference/subsystems/credentials.md +13 -12
- package/kb/site/en/reference/subsystems/index.md +4 -1
- package/kb/site/en/reference/subsystems/jobs.md +62 -7
- package/kb/site/en/reference/subsystems/llm-streaming.md +82 -15
- package/kb/site/en/reference/subsystems/persistence.md +2 -0
- package/kb/site/en/reference/subsystems/plan.md +1 -1
- package/kb/site/en/reference/subsystems/ptc-runtime.md +24 -6
- package/kb/site/en/reference/subsystems/session-query.md +2 -0
- package/kb/site/en/reference/subsystems/session-title.md +14 -5
- package/kb/site/en/reference/subsystems/session.md +59 -14
- package/kb/site/en/reference/subsystems/sidebar-right.md +2 -0
- package/kb/site/en/reference/subsystems/skills.md +2 -2
- package/kb/site/en/reference/subsystems/slots.md +80 -83
- package/kb/site/en/reference/subsystems/subagent.md +175 -247
- package/kb/site/en/reference/subsystems/system-prompt.md +32 -2
- package/kb/site/en/reference/subsystems/tools.md +3 -3
- package/kb/site/en/reference/subsystems/typert.md +222 -17
- package/kb/site/en/reference/subsystems/web-client.md +1 -1
- package/kb/site/en/reference/subsystems/web-server.md +87 -11
- package/kb/site/en/reference/subsystems/web.md +2 -2
- package/kb/site/en/reference/subsystems/workflow.md +1 -1
- package/kb/site/en/reference/subsystems/workspace.md +25 -37
- package/kb/site/en/reference/tool-catalog.md +156 -51
- package/kb/site/guide/github-review.md +7 -10
- package/kb/site/guide/plugin-market.md +151 -0
- package/kb/site/guide/providers.md +27 -4
- package/kb/site/guide/public-deployments.md +10 -6
- package/kb/site/guide/python-sdk.md +8 -9
- package/kb/site/reference/api-gateway.md +16 -3
- package/kb/site/reference/capability-seams.md +71 -24
- package/kb/site/reference/config-catalog.md +452 -191
- package/kb/site/reference/experimental-persistence-catalog.md +20 -0
- package/kb/site/reference/index.md +11 -12
- package/kb/site/reference/persistence-catalog.md +552 -192
- package/kb/site/reference/subsystems/client-modules.md +14 -0
- package/kb/site/reference/subsystems/conversation.md +16 -0
- package/kb/site/reference/subsystems/core.md +5 -1
- package/kb/site/reference/subsystems/credentials.md +13 -12
- package/kb/site/reference/subsystems/index.md +4 -1
- package/kb/site/reference/subsystems/jobs.md +62 -7
- package/kb/site/reference/subsystems/llm-streaming.md +82 -15
- package/kb/site/reference/subsystems/persistence.md +2 -0
- package/kb/site/reference/subsystems/plan.md +1 -1
- package/kb/site/reference/subsystems/ptc-runtime.md +24 -6
- package/kb/site/reference/subsystems/scope.md +2 -0
- package/kb/site/reference/subsystems/session-query.md +2 -0
- package/kb/site/reference/subsystems/session-title.md +14 -5
- package/kb/site/reference/subsystems/session.md +59 -14
- package/kb/site/reference/subsystems/sidebar-right.md +2 -0
- package/kb/site/reference/subsystems/skills.md +2 -2
- package/kb/site/reference/subsystems/slots.md +84 -83
- package/kb/site/reference/subsystems/subagent.md +177 -251
- package/kb/site/reference/subsystems/system-prompt.md +32 -2
- package/kb/site/reference/subsystems/tools.md +3 -3
- package/kb/site/reference/subsystems/typert.md +222 -17
- package/kb/site/reference/subsystems/web-client.md +1 -1
- package/kb/site/reference/subsystems/web-server.md +87 -11
- package/kb/site/reference/subsystems/web.md +2 -2
- package/kb/site/reference/subsystems/workflow.md +1 -1
- package/kb/site/reference/subsystems/workspace.md +25 -37
- package/kb/site/reference/tool-catalog.md +160 -55
- package/package.json +2 -2
- package/skills/dsh-dev-sandbox.md +70 -0
- package/kb/extra/defensive-patterns.md +0 -33
- package/kb/extra/defensive-patterns.zh.md +0 -35
|
@@ -86,8 +86,26 @@ interface PromptContext {
|
|
|
86
86
|
readonly name: string
|
|
87
87
|
/** Contexts are joined in ascending order. */
|
|
88
88
|
readonly order: number
|
|
89
|
-
/** Static text or a provider evaluated
|
|
89
|
+
/** Static text or a provider evaluated at assembly and admission refresh. Empty text contributes nothing. */
|
|
90
90
|
readonly text: string | ((context: AssembleContext) => string)
|
|
91
|
+
/** Whether to interpolate prompt variables. Defaults to true; false preserves literal text. */
|
|
92
|
+
readonly interpolate?: boolean
|
|
93
|
+
/** Keep this operational context when optional runtime context is disabled. */
|
|
94
|
+
readonly required?: boolean
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
`required: true` 在可选运行时上下文被抑制时保留操作所需的贡献。`interpolate: false` 原样保留文本,包括看起来像变量的目录名。`AssembledContext` 将已求值文本及其插值选择传给渲染过程。
|
|
99
|
+
|
|
100
|
+
```ts type-equiv
|
|
101
|
+
/** One resolved dynamic context contribution. */
|
|
102
|
+
interface AssembledContext {
|
|
103
|
+
/** The contributing context's unique name. */
|
|
104
|
+
name: string
|
|
105
|
+
/** The resolved text before variable interpolation. */
|
|
106
|
+
text: string
|
|
107
|
+
/** Whether to interpolate prompt variables. Defaults to true; false preserves literal text. */
|
|
108
|
+
interpolate?: boolean
|
|
91
109
|
}
|
|
92
110
|
```
|
|
93
111
|
|
|
@@ -139,7 +157,7 @@ getContextOrder(name: PromptContextOrderName): number
|
|
|
139
157
|
context(context: PromptContext): () => void
|
|
140
158
|
|
|
141
159
|
/**
|
|
142
|
-
* Suppress
|
|
160
|
+
* Suppress optional dynamic runtime-context contributions in the calling
|
|
143
161
|
* context's scope without changing the services that own or enforce those
|
|
144
162
|
* facts. Multiple suppressors remain independently disposable.
|
|
145
163
|
* @returns the exact Cordis effect disposer.
|
|
@@ -165,6 +183,18 @@ tools(provider: (context: AssembleContext) => ToolProviderResult): () => void
|
|
|
165
183
|
*/
|
|
166
184
|
variable(name: string, provider: (context: AssembleContext) => string | undefined): () => void
|
|
167
185
|
|
|
186
|
+
/**
|
|
187
|
+
* Refresh accepted registered runtime facts for request admission. Contexts
|
|
188
|
+
* added only by the assembly waterfall retain their accepted values. Current
|
|
189
|
+
* suppression removes optional contexts, and missing required registrations
|
|
190
|
+
* are restored in registry order. Sections, tools, and interpolation variables
|
|
191
|
+
* retain the accepted assembly; their providers and waterfall do not rerun.
|
|
192
|
+
* @param assembly - accepted assembly for this scope and step.
|
|
193
|
+
* @param context - the same scope and current plugin-defined assembly fields.
|
|
194
|
+
* @returns the accepted assembly with current runtime-context provider text.
|
|
195
|
+
*/
|
|
196
|
+
refreshContext(assembly: PromptAssembly, context: AssembleContext = {}): PromptAssembly
|
|
197
|
+
|
|
168
198
|
/**
|
|
169
199
|
* Assemble global and scoped providers, detach tool parameters, apply
|
|
170
200
|
* canonical ordering, then run the assembly waterfall. Scoped sections and
|
|
@@ -21,7 +21,7 @@ interface ToolOutputDefinition {
|
|
|
21
21
|
readonly schema: JsonSchemaNode
|
|
22
22
|
/** Pure projection from validated arguments and value to Native/model content. */
|
|
23
23
|
render(args: unknown, value: JsonValue): ContentBlock[]
|
|
24
|
-
/** Pure replayable presentation projection
|
|
24
|
+
/** Pure replayable presentation projection for native and nested calls. */
|
|
25
25
|
presentationMeta?(args: unknown, value: JsonValue): JsonValue
|
|
26
26
|
}
|
|
27
27
|
```
|
|
@@ -393,9 +393,9 @@ interface ToolErrorInfo {
|
|
|
393
393
|
}
|
|
394
394
|
```
|
|
395
395
|
|
|
396
|
-
结果仅承载产出。调用身份保留在不可变的 `ToolExecution` 上,后者伴随结果经过每个钩子,并出现在持久化的 `tool/call` / `tool/result` 会话事件上,因此包装层无法创建第二个相互矛盾的身份。规范的 `value` 仅存在于执行期间:循环只持久化 `content`、`error` 和 `meta`,`tool/ptc-dispatch` 则存储子调用渲染后的 `content`、`isError`
|
|
396
|
+
结果仅承载产出。调用身份保留在不可变的 `ToolExecution` 上,后者伴随结果经过每个钩子,并出现在持久化的 `tool/call` / `tool/result` 会话事件上,因此包装层无法创建第二个相互矛盾的身份。规范的 `value` 仅存在于执行期间:循环只持久化 `content`、`error` 和 `meta`,`tool/ptc-dispatch` 则存储子调用渲染后的 `content`、`isError`、可选结构化 `error` 和展示 `meta`。回放可以重现展示,却无法重建规范的中间值。可选的 `ToolErrorInfo.reason` 保留面向用户的原始详情,不将其加入模型可见内容。
|
|
397
397
|
|
|
398
|
-
|
|
398
|
+
成功时,注册表会快照并校验函数体返回值,将其冻结,然后调用纯渲染器,并为原生与嵌套调用执行可选的展示元数据投影器。注册表会在 `tools/result` 之前另行物化持久展示字段;无效值、渲染器/投影器失败或非 JSON 展示都会转为 JSON 安全的 `isError`。因此,最终实时观察者能看到精确的执行期值,以及可安全用于后续持久追加的字段。
|
|
399
399
|
|
|
400
400
|
在得到最终内容之前,注册表会物化候选结果;若内容、结构化错误、附加上下文或展示元数据无法物化,则会转为仍可到达 `finalizeContent` 的 JSON 安全 `isError` 结果。注册表恰好调用该回调一次,随后在 `tools/result` 之前立即物化并冻结已接受的结果,因此实时观察到的产出可安全用于后续持久化的 `tool/result` 追加。
|
|
401
401
|
|
|
@@ -44,27 +44,31 @@ interface TypertLookupDefinition {
|
|
|
44
44
|
|
|
45
45
|
`InvocationDescriptor` 是本地反射信息,不是 wire message。Host 与消费方构建会生成彼此对应的 descriptor;请求只发送 endpoint 与具名 `args`。strict codec 携带生成的 schema factory,SRC codec 则在不恢复结构类型的前提下强制要求输入为 JSON 安全值。一元结果 codec 可提供 `encode()` 处理含字节的子树,并通过 `decode()` 递归校验原生字节;Client 声明将每个 `Uint8Array` 限定为以 `ArrayBuffer` 为底层缓冲区。纯 JSON 结果无需字节识别或 Client 解码。取消通过带外 carrier signal 表达:它在业务参数之后注入,绝不进入 `args`。
|
|
46
46
|
|
|
47
|
+
`createTypertRemoteInfo` 返回实现 `TypertRemoteInfo` 的惰性类实例,后者扩展可挂载的 `TypertRemoteContribution`。其 `methods` 索引引用 `descriptors` 中的直接方法对象:每个 `TypertRemoteMethod` 增加具名 `input(options?)` 和 `invoke`,在方法及参数上保留文档,并以 `result` 作为唯一输出 codec。一元 `mode` 缺省;流式 `mode` 为 `'stream'`。仅使用 Context 接收器的方法保留在描述符和作用域声明中。Registry 查询返回基础描述符;`isTypertRemoteMethod` 收窄生成的直接调用能力,但不会恢复各端点的精确泛型。
|
|
48
|
+
|
|
49
|
+
`TypertSchema` 保证解析能力,不保证任意 Zod 操作,尽管原始 factory spec 要求 Zod factory。缺少文档或不支持可选的 JSON Schema 投影,不会使普通方法失效。info 索引与每种输入策略的视图、解析器和派生投影都独立惰性求值并缓存;读取元数据或 schema 绝不发起网络调用。[协议参考](<https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/typert/protocol/README.zh.md>)定义这些 API,[生成器参考](<https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/typert/generator/README.zh.md#ordinary-remote-metadata>)定义它们彼此分离的 Host `./typert`、消费方 `./remote` 和 Client `./client/typert` 产物。
|
|
50
|
+
|
|
51
|
+
`TypertRemoteSpec` 保存包名与按端点键控的 `TypertRemoteMethodSpec`。每个有序 `TypertRemoteParameterSpec` 条目都包含从同一 checker 解析后类型模型生成的普通 `codec` 和 `strictCodec` factory;运行时派生标识、默认 wire 名称和具名调用视图。`TypertRemoteInputOptions` 仅包含 `strict?: boolean`;`method.input(options?)` 选择缓存的 `TypertRemoteValue<T>`,提供匹配的解析及可选文档/投影,而不改变 Host 分发或 `result`。`RemoteDecoded<T>` 则描述 carrier 重建的一元结果,不会收窄任意解析器输出。
|
|
52
|
+
|
|
47
53
|
```ts type-equiv
|
|
48
54
|
/** Codec attached to one invocation parameter or result. */
|
|
49
|
-
type TypertCodec =
|
|
50
|
-
| {
|
|
55
|
+
type TypertCodec<Value = unknown> =
|
|
56
|
+
| TypertRemoteValue<Value> & {
|
|
51
57
|
readonly mode: 'strict'
|
|
52
58
|
readonly typeSymbol: string
|
|
53
|
-
/** Materialize and return the process-realm schema on first boundary use. */
|
|
54
|
-
readonly create: () => TypertSchema
|
|
55
59
|
/**
|
|
56
60
|
* Decode a unary result whose fields require type-specific handling.
|
|
57
61
|
* @param value - result reconstructed by the RPC carrier.
|
|
58
62
|
* @returns the validated result, retaining native byte views.
|
|
59
63
|
*/
|
|
60
|
-
readonly decode?: (value: unknown) => unknown
|
|
64
|
+
readonly decode?: ((value: unknown) => unknown) | undefined
|
|
61
65
|
/**
|
|
62
66
|
* Project typed binary fields into RPC result attachments.
|
|
63
67
|
* @param value - native unary result.
|
|
64
68
|
* @param writeBytes - records a byte view at its result-relative path and returns its JSON placeholder.
|
|
65
69
|
* @returns JSON metadata with untouched JSON subtrees retained.
|
|
66
70
|
*/
|
|
67
|
-
readonly encode?: (value: unknown, writeBytes: (bytes: Uint8Array, path: readonly (string | number)[]) => null) => unknown
|
|
71
|
+
readonly encode?: ((value: unknown, writeBytes: (bytes: Uint8Array, path: readonly (string | number)[]) => null) => unknown) | undefined
|
|
68
72
|
}
|
|
69
73
|
| {
|
|
70
74
|
readonly mode: 'src-json'
|
|
@@ -76,6 +80,8 @@ type TypertCodec =
|
|
|
76
80
|
interface InvocationParameterDescriptor {
|
|
77
81
|
/** Source-level parameter name. */
|
|
78
82
|
readonly name: string
|
|
83
|
+
/** Source parameter documentation, independent of JSON Schema support. */
|
|
84
|
+
readonly description?: string
|
|
79
85
|
/** Required key in the wire `args` object. */
|
|
80
86
|
readonly wire: string
|
|
81
87
|
/** Whether the value is JSON or requires a registered Host lookup. */
|
|
@@ -139,6 +145,8 @@ interface InvocationDescriptor {
|
|
|
139
145
|
}
|
|
140
146
|
/** Codec for the unary result or each yielded stream item. */
|
|
141
147
|
readonly result: TypertCodec
|
|
148
|
+
/** Source-owned method documentation; ordinary methods need not have JSDoc. */
|
|
149
|
+
readonly description?: string
|
|
142
150
|
/** Source declaration used only for diagnostics. */
|
|
143
151
|
readonly sourceLocation?: InvocationSourceLocation
|
|
144
152
|
}
|
|
@@ -196,13 +204,37 @@ interface RemoteStreamHandle<Out, In> extends AsyncIterable<Out> {
|
|
|
196
204
|
|
|
197
205
|
```ts type-equiv
|
|
198
206
|
/**
|
|
199
|
-
*
|
|
207
|
+
* Merge-extensible caller identities. Each driver declares its own entry.
|
|
208
|
+
* Every entry is a JSON value with a unique literal `kind`, carries no
|
|
209
|
+
* credential, and is safe to persist in a Session log.
|
|
210
|
+
*/
|
|
211
|
+
interface PrincipalMap {
|
|
212
|
+
/** The local user who owns this Host. */
|
|
213
|
+
owner: { readonly kind: 'owner' }
|
|
214
|
+
}
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
```ts type-equiv
|
|
218
|
+
/** One caller identity; the authorization layer reads only this. */
|
|
219
|
+
type Principal = PrincipalMap[keyof PrincipalMap]
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
```ts type-equiv
|
|
223
|
+
/**
|
|
224
|
+
* One Peer's session on this Host. Its creator owns it: `ctx` is the Cordis
|
|
200
225
|
* scope that owns connection-lifetime registrations and is disposed with the
|
|
201
|
-
* Peer
|
|
226
|
+
* Peer, and `principal` is the caller identity fixed when the Peer was created.
|
|
202
227
|
*/
|
|
203
228
|
interface PeerScope {
|
|
204
229
|
readonly id: PeerId
|
|
230
|
+
/** Connection-lifetime registrations; disposed with the Peer. */
|
|
205
231
|
readonly ctx: Context
|
|
232
|
+
/** Caller identity fixed at creation by in-process Host code; no wire field can set it. */
|
|
233
|
+
readonly principal: Principal
|
|
234
|
+
/** Aborted once the Peer is disposed; Remote streams that speak for the Peer end with it. */
|
|
235
|
+
readonly signal: AbortSignal
|
|
236
|
+
/** Whether the Peer may open a forwarded-event stream; this does not grant business permissions. */
|
|
237
|
+
readonly interactions: 'answer' | 'none'
|
|
206
238
|
/**
|
|
207
239
|
* Tear down every registration made through `ctx`.
|
|
208
240
|
* @returns settles once the scope has quiesced; racing calls share one completion.
|
|
@@ -211,6 +243,16 @@ interface PeerScope {
|
|
|
211
243
|
}
|
|
212
244
|
```
|
|
213
245
|
|
|
246
|
+
```ts type-equiv
|
|
247
|
+
/** Carrier capacity for buffered uplink frames of one logical stream. */
|
|
248
|
+
interface RemoteUplinkWindow {
|
|
249
|
+
/** Maximum complete encoded frame bytes waiting for the Host consumer. */
|
|
250
|
+
readonly maxBytes: number
|
|
251
|
+
/** UTF-8 envelope bytes added to a compact JSON item with a present value field. */
|
|
252
|
+
readonly frameOverheadBytes: number
|
|
253
|
+
}
|
|
254
|
+
```
|
|
255
|
+
|
|
214
256
|
```ts type-equiv
|
|
215
257
|
/**
|
|
216
258
|
* The context of one Remote call, reachable inside the receiving method as
|
|
@@ -225,10 +267,12 @@ interface RemoteInvocation {
|
|
|
225
267
|
}
|
|
226
268
|
/** Cordis service key of the receiving Service. */
|
|
227
269
|
readonly service: string
|
|
228
|
-
/** Peer the call speaks for;
|
|
270
|
+
/** Peer the call speaks for; every carrier names it explicitly. */
|
|
229
271
|
readonly peer: PeerScope
|
|
230
272
|
/** Carrier cancellation: Client cancel, socket close, or an uplink failure. */
|
|
231
273
|
readonly signal: AbortSignal
|
|
274
|
+
/** Carrier frame capacity; absent when the carrier imposes no encoded-frame inbox limit. */
|
|
275
|
+
readonly uplinkWindow?: RemoteUplinkWindow | undefined
|
|
232
276
|
/**
|
|
233
277
|
* The Client's uplink items for this call. Available once; a second call
|
|
234
278
|
* throws. With an uplink codec on the descriptor every item is decoded to
|
|
@@ -244,9 +288,81 @@ interface RemoteInvocation {
|
|
|
244
288
|
}
|
|
245
289
|
```
|
|
246
290
|
|
|
291
|
+
## Remote 访问资源
|
|
292
|
+
|
|
293
|
+
每个 Remote 方法都受 [`dsh-api-remote-access`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/api/remote-access/README.zh.md) 的访问控制:只有当该 principal 种类的 policy 在调用访问的每个资源上都绑定了列出该端点 action 的 role 时,非 owner 调用才被放行。拥有某个身份类型的包把其资源种类声明合并进 `TypertResourceMap`;内置的无身份资源 `global` 从不是其中的种类。Gateway 从 `@Remote({ resources })` 或 `@RemoteScope(key, { resources })` 的 `resources` 读取函数读取某个种类的身份,其次是把该种类声明为 `resource` 的 lookup 参数或作用域 Context,再次是在 `typert.resources` 中登记的默认字段;不指向任何资源的调用访问 `global`。决策由 [Peer 身份属性 Agent Note](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/architecture/2026-10-12-peer-principal-and-remote-access.zh.md) 负责。
|
|
294
|
+
|
|
295
|
+
```ts type-equiv
|
|
296
|
+
/**
|
|
297
|
+
* Merge-extensible resource kinds whose identities a Remote call or forwarded
|
|
298
|
+
* event may carry. The package that owns an identity type declares its kind;
|
|
299
|
+
* the value is that kind's identity type, a string type such as a branded id.
|
|
300
|
+
* `global` names the built-in identity-less resource and is never a kind here.
|
|
301
|
+
*/
|
|
302
|
+
interface TypertResourceMap {}
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
```ts type-equiv
|
|
306
|
+
/** One resource kind: the built-in `global` kind or a declared kind. */
|
|
307
|
+
type RemoteAccessResourceKind = 'global' | TypertResourceKind
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
```ts type-equiv
|
|
311
|
+
/**
|
|
312
|
+
* One resource a call or forwarded event touches: `global`, or one identity
|
|
313
|
+
* of a declared kind. Identities are wire values, read before any lookup
|
|
314
|
+
* resolves or validates them.
|
|
315
|
+
*/
|
|
316
|
+
type RemoteAccessResource =
|
|
317
|
+
| { readonly kind: 'global' }
|
|
318
|
+
| {
|
|
319
|
+
[Kind in TypertResourceKind]: { readonly kind: Kind; readonly id: TypertResourceId<TypertResourceMap[Kind]> }
|
|
320
|
+
}[TypertResourceKind]
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
```ts type-equiv
|
|
324
|
+
/**
|
|
325
|
+
* Explicit endpoint and resource choices for one Remote Scope method.
|
|
326
|
+
* @template WireArgs - the decorated method's positional parameters as the
|
|
327
|
+
* wire carries them; the default `never` admits readers of any tuple.
|
|
328
|
+
*/
|
|
329
|
+
interface RemoteScopeOptions<WireArgs extends readonly unknown[] = never> {
|
|
330
|
+
/** Exported endpoint method; omission retains the implementation member name. */
|
|
331
|
+
readonly name?: string
|
|
332
|
+
/**
|
|
333
|
+
* Per-kind readers of the resources one call touches. Each receives the
|
|
334
|
+
* method's arguments as its own parameters, JSON arguments as their Typert
|
|
335
|
+
* codecs validated them, a lookup parameter as its wire identity and a
|
|
336
|
+
* cancellation parameter as the call's signal, so it performs plain reads
|
|
337
|
+
* only, and returns one identity, several, or `undefined` for none. A
|
|
338
|
+
* throw, an empty list, or an identity other than a non-empty string
|
|
339
|
+
* refuses the call. For a kind without a reader, the Gateway reads the
|
|
340
|
+
* identity of a scoped Context whose Host adapter declares that `resource`
|
|
341
|
+
* and of lookup parameters declaring it, else the field registered in
|
|
342
|
+
* `typert.resources`: a top-level argument or, failing that, the first
|
|
343
|
+
* object argument. A call that carries no identity touches `global`. The
|
|
344
|
+
* readers and these defaults together must name every resource the method
|
|
345
|
+
* accesses: access control never checks a resource they omit.
|
|
346
|
+
*/
|
|
347
|
+
readonly resources?: TypertResourceReaders<WireArgs>
|
|
348
|
+
}
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
```ts type-equiv
|
|
352
|
+
/**
|
|
353
|
+
* Explicit endpoint, stream, and resource choices for one direct Remote method.
|
|
354
|
+
* @template WireArgs - the decorated method's positional parameters as the
|
|
355
|
+
* wire carries them; the default `never` admits readers of any tuple.
|
|
356
|
+
*/
|
|
357
|
+
interface RemoteMethodOptions<WireArgs extends readonly unknown[] = never> extends RemoteScopeOptions<WireArgs> {
|
|
358
|
+
/** `stream`: deliver each Iterable item over the shared logical-stream carrier. */
|
|
359
|
+
readonly mode?: 'stream'
|
|
360
|
+
}
|
|
361
|
+
```
|
|
362
|
+
|
|
247
363
|
## Typert 注册表
|
|
248
364
|
|
|
249
|
-
`ctx.typert` 分开保存当前环境的 descriptor、显式选择的 Remote contribution、lookup
|
|
365
|
+
`ctx.typert` 分开保存当前环境的 descriptor、显式选择的 Remote contribution、lookup 提供方、作用域上下文提供方与资源种类的默认字段。lookup 提供方拥有稳定 wire 声明和默认 resolver;Host 组合可以为同一个 key 配置 effect-scoped 同步或异步 resolver,配置卸载后恢复默认策略。各项注册都是由 Cordis 持有的 effect,并返回可等待的 disposer。
|
|
250
366
|
|
|
251
367
|
```ts type-equiv
|
|
252
368
|
/** Minimal Typert runtime consumed through dependency inversion. */
|
|
@@ -255,6 +371,7 @@ interface TypertRegistryContract {
|
|
|
255
371
|
readonly remotes: TypertRemoteRegistry
|
|
256
372
|
readonly lookups: TypertLookupRegistry
|
|
257
373
|
readonly contexts: TypertContextRegistry
|
|
374
|
+
readonly resources: TypertResourceRegistry
|
|
258
375
|
}
|
|
259
376
|
```
|
|
260
377
|
|
|
@@ -267,7 +384,7 @@ interface TypertRemoteNamespaceMap {}
|
|
|
267
384
|
|
|
268
385
|
## Host Gateway
|
|
269
386
|
|
|
270
|
-
Connection 会先解码 carrier envelope,再调用 `ctx.typertGateway`。请求将精确的具名 wire
|
|
387
|
+
Connection 会先解码 carrier envelope,再调用 `ctx.typertGateway`。请求将精确的具名 wire 字段、carrier 的取消 signal 与本次调用代表的 Peer 分开携带;每个载体与进程内调用方都显式给出该 Peer,Gateway 以 `gateway/peer-disposed` 拒绝已 dispose 的 Peer。对非 owner 调用,Gateway 在参数校验之后、任何 lookup 或 Context 解析之前解析其资源并询问 `ctx.remoteAccess.decide()`;基础设施与边界失败由 `TypertGatewayError` 承载,其 `gateway/*` 码就是普通的 `RemoteError` 码,因此 RPC 适配器会把每个经结构识别的 `RemoteError` 连同其 code 与 details 原样放行,只把无法识别的异常归并为 `gateway/internal`。
|
|
271
388
|
|
|
272
389
|
```ts type-equiv
|
|
273
390
|
/** One Remote method request after a carrier has decoded its envelope. */
|
|
@@ -283,8 +400,10 @@ interface InvokeRemoteRequest {
|
|
|
283
400
|
* `invocation.uplink()`; absent means an immediately ended iterable.
|
|
284
401
|
*/
|
|
285
402
|
readonly uplink?: AsyncIterable<unknown>
|
|
286
|
-
/**
|
|
287
|
-
readonly
|
|
403
|
+
/** Carrier-provided frame capacity; absent for carriers without an encoded-frame inbox limit. */
|
|
404
|
+
readonly uplinkWindow?: RemoteUplinkWindow | undefined
|
|
405
|
+
/** Peer the call speaks for; every carrier and in-process caller names it explicitly. */
|
|
406
|
+
readonly peer: PeerScope
|
|
288
407
|
/** Carrier or direct-caller cancellation injected only into cancellation-aware methods. */
|
|
289
408
|
readonly signal?: AbortSignal
|
|
290
409
|
}
|
|
@@ -301,11 +420,13 @@ type TypertGatewayErrorCode =
|
|
|
301
420
|
| 'gateway/context-unavailable'
|
|
302
421
|
| 'gateway/definition-unavailable'
|
|
303
422
|
| 'gateway/input-invalid'
|
|
423
|
+
| 'gateway/interactions-forbidden'
|
|
304
424
|
| 'gateway/invocation-unavailable'
|
|
305
425
|
| 'gateway/lookup-failed'
|
|
306
426
|
| 'gateway/lookup-not-found'
|
|
307
427
|
| 'gateway/lookup-unavailable'
|
|
308
428
|
| 'gateway/method-unavailable'
|
|
429
|
+
| 'gateway/peer-disposed'
|
|
309
430
|
| 'gateway/protocol'
|
|
310
431
|
| 'gateway/provider-mismatch'
|
|
311
432
|
| 'gateway/result-invalid'
|
|
@@ -320,8 +441,8 @@ interface TypertGateway {
|
|
|
320
441
|
/** Carrier adapter shared by WebSocket and in-process transports. */
|
|
321
442
|
readonly wireStream: TypertGatewayWireStream
|
|
322
443
|
/**
|
|
323
|
-
* Check for an active Client event stream.
|
|
324
|
-
* @returns whether
|
|
444
|
+
* Check for an active owner Client event stream, the only kind that can answer forwarded waterfalls.
|
|
445
|
+
* @returns whether an owner stream is open and has not been cancelled.
|
|
325
446
|
*/
|
|
326
447
|
hasLiveClient(): boolean
|
|
327
448
|
/**
|
|
@@ -354,6 +475,8 @@ interface TypertGateway {
|
|
|
354
475
|
|
|
355
476
|
`ctx.remote` 只暴露由已导入 `/remote` 产物贡献的 namespace。`$mount()` 会把生成的 descriptor 与具体方法作为一项由 fiber 持有的操作统一注册。每个 namespace 都是可追踪的 `remote.<namespace>` Cordis 子服务,其生命周期覆盖已挂载的方法;JavaScript Proxy 与 Host 业务服务类型都不会进入消费方。
|
|
356
477
|
|
|
478
|
+
元数据所有权与连接所有权相互独立;[注册表参考](<https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/typert/registry/README.zh.md>)说明离线注册与挂载生命周期。
|
|
479
|
+
|
|
357
480
|
```ts type-equiv
|
|
358
481
|
/** Client Remote capability implemented by the Gateway and consumed by Remote assemblies. */
|
|
359
482
|
interface TypertClientRemote extends TypertRemoteNamespaceMap {
|
|
@@ -384,6 +507,88 @@ interface TypertClientRemote extends TypertRemoteNamespaceMap {
|
|
|
384
507
|
|
|
385
508
|
Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — the language sides differ only in locale-specific paired document paths. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
|
|
386
509
|
|
|
510
|
+
<a id="ctxremoteaccess--remoteaccessservice"></a>
|
|
511
|
+
|
|
512
|
+
### `ctx.remoteAccess` — `RemoteAccessService`
|
|
513
|
+
|
|
514
|
+
Registry of access policies, the Gateway's access decisions, list filtering, and the per-Peer access snapshot. Every composition that mounts the Gateway mounts this service too.
|
|
515
|
+
|
|
516
|
+
```ts cordis-catalog
|
|
517
|
+
/**
|
|
518
|
+
* Register the policy of one non-owner principal kind in the caller's
|
|
519
|
+
* fiber; open snapshots are recomputed on registration and removal.
|
|
520
|
+
* @param kind - the principal kind the policy serves; never `owner`.
|
|
521
|
+
* @param policy - business-owned bindings and refusal reasons for principals of `kind`.
|
|
522
|
+
* @returns disposer removing this policy.
|
|
523
|
+
* @throws Error when `kind` already has a policy.
|
|
524
|
+
*/
|
|
525
|
+
registerPolicy<K extends Exclude<keyof PrincipalMap, 'owner'>>(kind: K, policy: RemoteAccessPolicy<PrincipalMap[K]>): () => void
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* Report that the bindings or condition answers for `principal` may have
|
|
529
|
+
* changed. Business packages call this on every grant, revocation, mode
|
|
530
|
+
* change, and expiry; open snapshots re-push, and the next failure of each
|
|
531
|
+
* policy is logged again.
|
|
532
|
+
* @param principal - affected principal; omitted for every principal.
|
|
533
|
+
*/
|
|
534
|
+
invalidate(principal?: Principal): void
|
|
535
|
+
|
|
536
|
+
/**
|
|
537
|
+
* Gateway-only: decide one request whose resources the Gateway resolved.
|
|
538
|
+
* The owner is allowed, and so is `remoteAccess/follow`: every Peer reads
|
|
539
|
+
* its own snapshot. Otherwise the action is allowed only when, on every
|
|
540
|
+
* listed resource, some binding of the principal's policy names that
|
|
541
|
+
* resource, has a role listing the action, and has no condition or a
|
|
542
|
+
* condition that allows. `bindings()` is called once per decision.
|
|
543
|
+
* @param request - the caller or recipient, the action, the resources it
|
|
544
|
+
* touches, and a call's arguments.
|
|
545
|
+
* @returns `allow`; or `deny` with `no-allow` when the principal kind has
|
|
546
|
+
* no policy, the first refusing condition's reason on the first resource
|
|
547
|
+
* no binding allows, else `explain()`'s reason, else `no-allow`;
|
|
548
|
+
* `policy-failed` when `bindings()`, a condition, or `explain()` throws,
|
|
549
|
+
* logged once per policy until the next `invalidate()`. The Gateway
|
|
550
|
+
* throws `remote-access/denied` for a denied call and drops a denied event.
|
|
551
|
+
*/
|
|
552
|
+
decide(request: RemoteAccessRequest<Principal>): RemoteAccessDecision
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* Filter items inside a Remote method. The invocation is read from the
|
|
556
|
+
* Context that accessed this service, so call it as
|
|
557
|
+
* `this.ctx.remoteAccess.allows(resource)` from the Remote method. Each
|
|
558
|
+
* check reads the policy's bindings again, so a long-running stream sees
|
|
559
|
+
* binding changes from the next check on.
|
|
560
|
+
* @param resource - resource of one result item.
|
|
561
|
+
* @returns true for the owner and outside a Remote call; otherwise whether
|
|
562
|
+
* the invocation's endpoint action is allowed on `resource` without call
|
|
563
|
+
* arguments, false when the policy is absent or fails.
|
|
564
|
+
*/
|
|
565
|
+
allows(resource: RemoteAccessResource): boolean
|
|
566
|
+
|
|
567
|
+
/**
|
|
568
|
+
* The baseline a page opens with before its snapshot stream connects. A
|
|
569
|
+
* business package rendering a non-owner page assigns this value to
|
|
570
|
+
* {@link REMOTE_ACCESS_SNAPSHOT_KEY} after every index injection row,
|
|
571
|
+
* replacing the owner baseline the webServer index carries.
|
|
572
|
+
* @param principal - the page's caller identity.
|
|
573
|
+
* @returns the owner baseline for the owner; otherwise the principal's current grants.
|
|
574
|
+
*/
|
|
575
|
+
snapshotFor(principal: Principal): RemoteAccessBaseline
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* Stream the calling Peer's access snapshot: one baseline, then `upsert`
|
|
579
|
+
* and `remove` frames after each `invalidate()` and each policy
|
|
580
|
+
* registration or removal that changes a grant. The owner receives only
|
|
581
|
+
* `{ owner: true }`. The generation ends when `signal` aborts or this
|
|
582
|
+
* service unloads, so a reloaded service starts every reader from a fresh
|
|
583
|
+
* baseline.
|
|
584
|
+
* @param signal - generation cancellation.
|
|
585
|
+
* @returns the access frames of one generation.
|
|
586
|
+
*/
|
|
587
|
+
@Remote({ mode: 'stream' }) async *follow(signal: AbortSignal): AsyncIterable<RemoteAccessFrame>
|
|
588
|
+
```
|
|
589
|
+
|
|
590
|
+
Source: [`packages/api/remote-access/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/api/remote-access/src/index.ts)
|
|
591
|
+
|
|
387
592
|
<a id="ctxtypert--typertregistry"></a>
|
|
388
593
|
|
|
389
594
|
### `ctx.typert` — `TypertRegistry`
|
|
@@ -456,8 +661,8 @@ Resolve strict generated definitions or conservative SRC markers against current
|
|
|
456
661
|
|
|
457
662
|
```ts cordis-catalog
|
|
458
663
|
/**
|
|
459
|
-
* Check for an active Client event stream.
|
|
460
|
-
* @returns whether
|
|
664
|
+
* Check for an active owner Client event stream, the only kind that can answer forwarded waterfalls.
|
|
665
|
+
* @returns whether an owner stream is open and has not been cancelled.
|
|
461
666
|
*/
|
|
462
667
|
hasLiveClient(): boolean
|
|
463
668
|
|
|
@@ -61,7 +61,7 @@ Connection 拥有请求 URL 解析、request correlation、`/api` carrier、trus
|
|
|
61
61
|
|
|
62
62
|
Web 和桌面端共享[代码工作工具偏好](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/client/ui-settings/README.zh.md#use-this-package)。它控制诊断 View、[可用的预设选项](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/client/ui-agent-preset/README.zh.md)、改动文件卡片和内置 HTML 预览策略,不改变 Session 记录。
|
|
63
63
|
|
|
64
|
-
`ui-session` 安装 Session scope adapter
|
|
64
|
+
`ui-session` 安装 Session scope adapter,并在 [remote-access](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/api/remote-access/README.zh.md) Client 服务之上提供 `useSessions`、`useSessionStatus`、`useSessionRetainInfo`、`useSessionAccess`、`useSession`、`sessionId`、`useProjection` 和会话作用域的 `useAccess`。`SessionProvider` 可以继承外围 binding,也可以绑定显式 `SessionReference`,因此并存子树可以指向不同 Session。领域 adapter 可以继续添加标准 source,但不会把 React hook 放进 model object。
|
|
65
65
|
|
|
66
66
|
`ui-conversation` 对每个 `SessionBinding.eventSource` 只绑定一次。它的 event registry 把持久 Session event 与 Client-only `assistant/live-chunk` update 关联成稳定的业务 Context,view registry 则 materialize target snapshot。Chat Assistant、Trajectory Assistant 与 Turn Tail 同时解释 live chunk 和持久 settlement 中嵌入的紧凑 stream,因此重连与分页历史无需持久 token 行即可复现相同 Assistant 状态。`ui-chat` 与 `ui-trajectory` 分别注册自己的 Definition 和 builder:它们可以解释同一 event family,但不会导入或共享彼此的最终 display model。Shell 选择一个已注册 view,再通过标准 hook 与 Slot 交付其 snapshot。[Conversation](./conversation.md)定义 Context identity、replay、Location data、target builder 与 keyed renderer。
|
|
67
67
|
|
|
@@ -6,7 +6,7 @@ outline: [2,3]
|
|
|
6
6
|
|
|
7
7
|
# HTTP 服务器
|
|
8
8
|
|
|
9
|
-
[dsh-host-webserver](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/host/webserver) 是 GUI Host 的浏览器 HTTP
|
|
9
|
+
[dsh-host-webserver](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/host/webserver) 是 GUI Host 的浏览器 HTTP 载体:一个 `node:http` 服务器——配置 `tls` 时改用 `node:https`——提供 `ctx.webServer`、具名路由注册表、可选的 gzip 响应压缩、index.html 转换回调,以及一个可由插件认领的回退处理器。它不属于 agent loop(智能体循环),也不是能力 seam;它不了解任何 harness 概念。其他插件负责注册所有功能路由,包括 `/api` 桥接、插件 bundle 和 HMR(热模块替换)事件流([分层说明](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/boot/app-boot/README.zh.md))。该服务器只服务浏览器:Electron 通过 `file://` 加载已构建文件,并经 IPC 桥接发送 fetch 请求,不使用本服务器。
|
|
10
10
|
|
|
11
11
|
源码:[`packages/host/webserver/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/host/webserver/src/index.ts)
|
|
12
12
|
|
|
@@ -30,15 +30,34 @@ interface WebRoute {
|
|
|
30
30
|
|
|
31
31
|
匹配顺序固定:先查 exact 表,再取最长匹配前缀,最后落到已注册的回退。注册顺序不携带任何面向请求的语义:具名路由在组合上互不相交,任何未被具名路由认领的请求都由回退席位应答;席位只有一个所有者,第二次注册会抛出异常。发布的 Web 组合用 [`dsh-host-frontend-static`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/host/frontend-static/src/index.ts) 认领席位,即遵循固定语义的 SPA dist 服务器:Connection 在读取 dist 根目录和配置 index 的 HTML 前完成认证;非 index 资产保持公开;非 GET/HEAD 返回 405,越出 dist 根目录的遍历返回 403,现有文件直接提供,缺失或不是文件的目标返回空的 404,未知扩展名按 octet-stream 发送。
|
|
32
32
|
|
|
33
|
+
<a id="config"></a>
|
|
34
|
+
|
|
33
35
|
## 配置
|
|
34
36
|
|
|
35
37
|
```ts type-equiv
|
|
36
|
-
/** Web server listen and response-compression config. */
|
|
38
|
+
/** Web server listen, TLS, and response-compression config. */
|
|
37
39
|
interface Config {
|
|
38
|
-
/**
|
|
39
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Listen address: a concrete IPv4 or IPv6 literal of one local interface,
|
|
42
|
+
* for example the container's own Pod address from `hostname -i`. A loopback
|
|
43
|
+
* literal (any address in 127/8, `::1`, or a mapped form of either) keeps the
|
|
44
|
+
* server on this machine; any other literal serves the network that address
|
|
45
|
+
* belongs to, over plain HTTP unless `tls` is set. The unspecified address —
|
|
46
|
+
* IPv4 any, IPv6 any, and the IPv4-mapped forms of IPv4 any — is rejected at
|
|
47
|
+
* load: it would expose the port on every interface at once.
|
|
48
|
+
*/
|
|
49
|
+
host: string
|
|
40
50
|
/** Listen port; zero requests an OS-assigned port. */
|
|
41
51
|
port: number
|
|
52
|
+
/**
|
|
53
|
+
* Serve HTTPS with this certificate and key instead of plain HTTP. Both files
|
|
54
|
+
* are read once, before the listener binds: an unreadable or empty file,
|
|
55
|
+
* invalid PEM, or a key that does not match the certificate rejects
|
|
56
|
+
* initialization rather than falling back to HTTP. The material is never
|
|
57
|
+
* re-read, so replacing a certificate takes a reload. Omitted or null listens
|
|
58
|
+
* over plain HTTP.
|
|
59
|
+
*/
|
|
60
|
+
tls?: TlsConfig
|
|
42
61
|
/** Response compression for socket-backed HTTP requests. @default 'none' */
|
|
43
62
|
compression?: 'none' | 'gzip'
|
|
44
63
|
/** Gzip DEFLATE level from 0 through 9. @default 1 */
|
|
@@ -48,13 +67,27 @@ interface Config {
|
|
|
48
67
|
}
|
|
49
68
|
```
|
|
50
69
|
|
|
51
|
-
|
|
70
|
+
```ts type-equiv
|
|
71
|
+
/**
|
|
72
|
+
* TLS material for the HTTPS listener: one certificate chain file and the
|
|
73
|
+
* private key file it pairs with. Both hold PEM text and both resolve against
|
|
74
|
+
* the process working directory.
|
|
75
|
+
*/
|
|
76
|
+
interface TlsConfig {
|
|
77
|
+
/** Certificate chain file, leaf certificate first, PEM, no passphrase. */
|
|
78
|
+
certFile: string
|
|
79
|
+
/** Private key file for the chain's leaf certificate; unencrypted PEM. */
|
|
80
|
+
keyFile: string
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
没有组合能一次性绑定所有网络接口:未指定地址在加载时即被拒绝。导出的 `isWildcardHost` 与 `isLoopbackHost` 按解析后的地址值分类,IPv6 的 `%zone` 会保留给 `listen`,而分类只读取地址本身。载体不拥有认证或 Origin 策略,并且除非 `tls` 提供证书与密钥,否则以明文 HTTP 提供服务。`compression` 默认为 `none`;随附的 Web 组合选择 gzip level 1 和 1024 字节阈值。随附的 `dsh web` 命令默认选择 loopback 并接受一个具体的 `--host` 地址,非 loopback 绑定以明文 HTTP 提供服务时会在启动时警告;其 Connection 插件为每个 Host API route 与 stream 提供 Host/Origin 校验和浏览器会话认证,绑定地址加 `--trusted-host` 决定接受哪个浏览器 Host;`--public-url` 只改变公告的 URL。其他组合自行拥有绑定与路由认证策略。dist 位置是认领席位的前端插件的组装事实。
|
|
52
85
|
|
|
53
86
|
## 服务
|
|
54
87
|
|
|
55
|
-
`WebServer`(`ctx.webServer`)在激活时立即监听;监听失败(EADDRINUSE 等)会使初始化被拒绝,启动进程会报告失败的 fiber。`register(route)` 添加一条具名路由并返回其 disposer;重复的 `(kind, path)` 抛出异常,因为路由模式是组合层约定,冲突即配置错误。Gzip 在服务器内部包装符合条件且基于 socket 的响应,因此 route handler 继续直接持有 `ServerResponse`,服务也不新增响应写出 API。已有内容编码、`Cache-Control: no-transform`、范围响应、SSE、ZIP 与打包后的 `.gz` Worker 镜像均保持 identity 响应。`collectIndexInjections()` 经一次 `webserver/index-inject` emit 收集结构化 `IndexInjection` 行,`renderIndex(html)` 把它们渲染进成功的根路径和配置 index 响应,随后再按注册顺序应用原始的 `tapIndex(transform)` 逃生口转换;[dsh-client-modules](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/client/modules) 以启动 manifest(元数据清单)行回应该事件。`port` 读取监听端口,包括 `config.port` 为 0
|
|
88
|
+
`WebServer`(`ctx.webServer`)在激活时立即监听;监听失败(EADDRINUSE 等)会使初始化被拒绝,启动进程会报告失败的 fiber。`tls` 证书对在监听器绑定前读取一次;文件不可读、为空或二者不匹配时同样会使初始化被拒绝,而不是回退到 HTTP。`register(route)` 添加一条具名路由并返回其 disposer;重复的 `(kind, path)` 抛出异常,因为路由模式是组合层约定,冲突即配置错误。Gzip 在服务器内部包装符合条件且基于 socket 的响应,因此 route handler 继续直接持有 `ServerResponse`,服务也不新增响应写出 API。已有内容编码、`Cache-Control: no-transform`、范围响应、SSE、ZIP 与打包后的 `.gz` Worker 镜像均保持 identity 响应。`collectIndexInjections()` 经一次 `webserver/index-inject` emit 收集结构化 `IndexInjection` 行,`renderIndex(html)` 把它们渲染进成功的根路径和配置 index 响应,随后再按注册顺序应用原始的 `tapIndex(transform)` 逃生口转换;[dsh-client-modules](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/client/modules) 以启动 manifest(元数据清单)行回应该事件。`port` 读取监听端口,包括 `config.port` 为 0 时操作系统分配的端口,`protocol` 则报告监听器提供的协议(`http:` 或 `https:`)。
|
|
56
89
|
|
|
57
|
-
处理过程中抛出异常的请求(畸形的 % 转义撞上 `decodeURIComponent`、客户端在请求体中途断开)会记录为警告并应答 400(响应头已发出时则销毁 socket),绝不导致进程退出。dispose(资源释放)把 `close()` 与 `closeAllConnections()` 配对使用,因为处理器可能像 SSE(Server-Sent Events
|
|
90
|
+
处理过程中抛出异常的请求(畸形的 % 转义撞上 `decodeURIComponent`、客户端在请求体中途断开)会记录为警告并应答 400(响应头已发出时则销毁 socket),绝不导致进程退出。dispose(资源释放)把 `close()` 与 `closeAllConnections()` 配对使用,因为处理器可能像 SSE(Server-Sent Events)那样保持响应打开,而这类连接永远不会自行结束;没有强制关闭,拆卸就会挂起。TLS socket 只有完成握手后才计入连接,因此服务器会把原始 TLS socket 与升级后的 socket 一并跟踪,并在 dispose 时销毁两者。该包从不打印输出:URL 行归 shell 所有。逐包运维细节(含开发模式的 bundle 监视流水线)留在 [README](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/host/webserver/README.zh.md) 中。
|
|
58
91
|
|
|
59
92
|
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
|
|
60
93
|
|
|
@@ -87,15 +120,32 @@ createSharedFetchHandler(channel: '/api'): ConnectionFetchHandler
|
|
|
87
120
|
requestRejection(request: ConnectionTrustRequest): ConnectionRequestRejection
|
|
88
121
|
|
|
89
122
|
/**
|
|
90
|
-
* Admit
|
|
91
|
-
* operator, or it is refused with that status.
|
|
123
|
+
* Admit an HTTP request against its signed browser or API credential and live Peer.
|
|
92
124
|
* @param request - request headers from the HTTP or upgrade request.
|
|
93
|
-
* @returns the
|
|
125
|
+
* @returns the credential's Peer, or the rejection status.
|
|
94
126
|
*/
|
|
95
127
|
admit(request: ConnectionTrustRequest): PeerAdmission
|
|
96
128
|
|
|
129
|
+
/**
|
|
130
|
+
* Create an independent in-process Peer, disposed with the Context that read `ctx.connection`.
|
|
131
|
+
* @param options - fixed principal and optional interaction participation (default `answer`).
|
|
132
|
+
* @returns a new Peer distinct from every other Peer.
|
|
133
|
+
*/
|
|
134
|
+
createPeer(options: { readonly principal: Principal; readonly interactions?: 'answer' | 'none' }): PeerScope
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Claim a physical socket for an API Peer; browser sockets share their owner Peer.
|
|
138
|
+
* @param request - authenticated upgrade request headers.
|
|
139
|
+
* @returns the Peer and idempotent release, or 409 for duplicate API ownership.
|
|
140
|
+
* The carrier releases on socket termination or failed upgrade; release removes
|
|
141
|
+
* API admission synchronously without cancelling independent HTTP calls.
|
|
142
|
+
*/
|
|
143
|
+
admitConnection(request: ConnectionTrustRequest): ConnectionAdmission
|
|
144
|
+
|
|
97
145
|
/**
|
|
98
146
|
* Authenticate one frontend index request, owning a token redirect or 401.
|
|
147
|
+
* The cookie this mints is `Secure` when the mounted Web carrier serves TLS,
|
|
148
|
+
* which only that listener's protocol decides.
|
|
99
149
|
* @param request - root or configured-index HTTP request.
|
|
100
150
|
* @param response - response owned when the result is false.
|
|
101
151
|
* @returns true only when the frontend may serve index.html.
|
|
@@ -110,15 +160,41 @@ authorizeIndex(request: ConnectionIndexRequest, response: ConnectionIndexRespons
|
|
|
110
160
|
authenticatedUrl(baseUrl: string): string
|
|
111
161
|
```
|
|
112
162
|
|
|
163
|
+
Types: [Principal](./typert.md)
|
|
164
|
+
|
|
113
165
|
Source: [`packages/client/connection/src/rpc.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/client/connection/src/rpc.ts)
|
|
114
166
|
|
|
167
|
+
<a id="ctxwebapp--webapp"></a>
|
|
168
|
+
|
|
169
|
+
### `ctx.webApp` — `WebApp`
|
|
170
|
+
|
|
171
|
+
The Web GUI this process serves, provided by the `web-runtime` row.
|
|
172
|
+
|
|
173
|
+
```ts cordis-catalog
|
|
174
|
+
/**
|
|
175
|
+
* The URL this GUI advertises, also used for `DSH_WEB_URL` and the startup URL line.
|
|
176
|
+
* @returns the configured `publicUrl`, otherwise the listener origin.
|
|
177
|
+
*/
|
|
178
|
+
getAdvertisedUrl(): string
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Source: [`packages/bundle/web-app/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/bundle/web-app/src/index.ts)
|
|
182
|
+
|
|
115
183
|
<a id="ctxwebserver--webserver"></a>
|
|
116
184
|
|
|
117
185
|
### `ctx.webServer` — `WebServer`
|
|
118
186
|
|
|
119
|
-
The browser HTTP carrier service. Activation listens immediately. Route registration order does not affect requests because configured named routes must be distinct, and the fallback handler answers anything not yet claimed during startup with 404 until its owner registers.
|
|
187
|
+
The browser HTTP carrier service. Activation loads any configured TLS material, then listens immediately; a material or listen failure rejects initialization, and the boot process reports the failed fiber. Route registration order does not affect requests because configured named routes must be distinct, and the fallback handler answers anything not yet claimed during startup with 404 until its owner registers.
|
|
120
188
|
|
|
121
189
|
```ts cordis-catalog
|
|
190
|
+
/**
|
|
191
|
+
* The root URL local clients use to reach the bound listener: the protocol,
|
|
192
|
+
* the {@link bindUrlHost} form of the bind address, and the listening port.
|
|
193
|
+
* @returns the origin, for example `http://127.0.0.1:3080`.
|
|
194
|
+
* @throws before `listen` binds a port, or when the bind address has no URL form.
|
|
195
|
+
*/
|
|
196
|
+
getOrigin(): string
|
|
197
|
+
|
|
122
198
|
/**
|
|
123
199
|
* Register a named route. Duplicate (kind, path) throws — route patterns are
|
|
124
200
|
* a composition-level contract, so a collision is a misconfiguration.
|