dsh-plugin-dev-kb 1.5.2 → 1.8.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 +51 -0
- package/README.en.md +31 -9
- package/README.md +42 -14
- package/kb/INDEX.md +3 -3
- package/kb/README.md +9 -4
- package/kb/extra/AGENTS.md +1 -1
- package/kb/extra/cli-help.md +15 -7
- package/kb/extra/cli-help.zh.md +15 -7
- package/kb/extra/cookbook/adding-a-plugin-preview.md +18 -25
- package/kb/extra/cookbook/adding-a-plugin-preview.zh.md +18 -25
- package/kb/extra/cookbook/reviewing-persistence-type-changes.md +1 -1
- package/kb/extra/cookbook/reviewing-persistence-type-changes.zh.md +1 -1
- package/kb/extra/cookbook/reviewing-ui-design.md +166 -0
- package/kb/extra/cookbook/reviewing-ui-design.zh.md +166 -0
- package/kb/extra/deepseek-llm-api-wire-extensions.md +2 -2
- package/kb/extra/deepseek-llm-api-wire-extensions.zh.md +2 -2
- package/kb/extra/defensive-patterns/conversation-and-session.md +2 -2
- package/kb/extra/defensive-patterns/conversation-and-session.zh.md +2 -2
- package/kb/extra/defensive-patterns/general.md +2 -0
- package/kb/extra/defensive-patterns/general.zh.md +2 -0
- package/kb/extra/defensive-patterns/package-surface.md +1 -0
- package/kb/extra/defensive-patterns/package-surface.zh.md +1 -0
- package/kb/extra/defensive-patterns/remote-and-api.md +5 -3
- package/kb/extra/defensive-patterns/remote-and-api.zh.md +5 -3
- package/kb/extra/development.md +16 -9
- package/kb/extra/development.zh.md +16 -9
- package/kb/extra/event-producer-consumer.md +64 -51
- package/kb/extra/event-producer-consumer.zh.md +64 -51
- package/kb/extra/i18n/README.md +2 -0
- package/kb/extra/i18n/README.zh.md +2 -0
- package/kb/extra/module-graph.md +204 -92
- package/kb/extra/module-graph.zh.md +204 -92
- package/kb/extra/persistence-changes/2026-10-13-liveshare-share-viewer-principal.md +60 -0
- package/kb/extra/persistence-changes/2026-10-13-liveshare-share-viewer-principal.zh.md +60 -0
- package/kb/extra/persistence-changes/2026-10-19-session-team-mode.md +48 -0
- package/kb/extra/persistence-changes/2026-10-19-session-team-mode.zh.md +48 -0
- package/kb/extra/persistence-changes/2026-10-22-action-card-status.md +60 -0
- package/kb/extra/persistence-changes/2026-10-22-action-card-status.zh.md +60 -0
- package/kb/extra/persistence-changes/2026-10-25-skill-catalog-incomplete.md +60 -0
- package/kb/extra/persistence-changes/2026-10-25-skill-catalog-incomplete.zh.md +60 -0
- package/kb/extra/persistence-changes/2026-10-27-retry-control-input.md +60 -0
- package/kb/extra/persistence-changes/2026-10-27-retry-control-input.zh.md +60 -0
- package/kb/extra/persistence-changes/2026-10-27-subagent-settlement-attribution.md +60 -0
- package/kb/extra/persistence-changes/2026-10-27-subagent-settlement-attribution.zh.md +60 -0
- package/kb/extra/persistence-changes/2026-11-02-subagent-catalog-names.md +48 -0
- package/kb/extra/persistence-changes/2026-11-02-subagent-catalog-names.zh.md +48 -0
- package/kb/extra/persistence-changes/2026-11-02-team-task-owner-names.md +48 -0
- package/kb/extra/persistence-changes/2026-11-02-team-task-owner-names.zh.md +48 -0
- package/kb/extra/persistence-changes/README.md +2 -0
- package/kb/extra/persistence-changes/README.zh.md +2 -0
- 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/rescope.md +7 -5
- package/kb/extra/rescope.zh.md +7 -5
- package/kb/extra/subsystems/agent-team.md +38 -75
- package/kb/extra/subsystems/agent-team.zh.md +38 -75
- package/kb/extra/subsystems/attachment.md +36 -13
- package/kb/extra/subsystems/attachment.zh.md +36 -13
- package/kb/extra/subsystems/boot.md +179 -5
- package/kb/extra/subsystems/boot.zh.md +179 -5
- package/kb/extra/subsystems/computer-use.md +78 -0
- package/kb/extra/subsystems/computer-use.zh.md +78 -0
- package/kb/extra/subsystems/deliverables.md +2 -0
- package/kb/extra/subsystems/deliverables.zh.md +2 -0
- package/kb/extra/subsystems/forge.md +1226 -0
- package/kb/extra/subsystems/forge.zh.md +1226 -0
- package/kb/extra/subsystems/liveshare.md +158 -0
- package/kb/extra/subsystems/liveshare.zh.md +158 -0
- package/kb/extra/subsystems/mcp.md +96 -1
- package/kb/extra/subsystems/mcp.zh.md +96 -1
- package/kb/extra/subsystems/worktrees.md +54 -3
- package/kb/extra/subsystems/worktrees.zh.md +54 -3
- package/kb/extra/testing.md +1 -1
- package/kb/extra/testing.zh.md +1 -1
- package/kb/extra/ui-design-review-cases.md +445 -0
- package/kb/extra/ui-design-review-cases.zh.md +445 -0
- package/kb/extra/ui-radius.md +3 -1
- package/kb/extra/ui-radius.zh.md +3 -1
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/team-direct-inbox/guide.md +1 -1
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/team-direct-inbox/guide.zh.md +1 -1
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/cordis-timer-wrappers/guide.md +24 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/cordis-timer-wrappers/guide.zh.md +24 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/plugin-manager-view-fields/guide.md +25 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.2/plugin-manager-view-fields/guide.zh.md +25 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.4/model-switch-compaction/guide.md +30 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.4/model-switch-compaction/guide.zh.md +30 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.4/session-model-selection/guide.md +28 -0
- package/kb/extra/upgrade-guide/v0.2.1-alpha.4/session-model-selection/guide.zh.md +28 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.1/agent-instructions-chain-budgets/guide.md +24 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.1/agent-instructions-chain-budgets/guide.zh.md +24 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.1/subagent-control-tools/guide.md +23 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.1/subagent-control-tools/guide.zh.md +23 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/agent-runtime-owner/guide.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/agent-runtime-owner/guide.zh.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/agent-team-subagents/guide.md +31 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/agent-team-subagents/guide.zh.md +31 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/approval-projection-dependency/guide.md +34 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/approval-projection-dependency/guide.zh.md +34 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/auto-review-shutdown/guide.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/auto-review-shutdown/guide.zh.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/auto-review-user-sources/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/auto-review-user-sources/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/built-in-japanese/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/built-in-japanese/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/conditional-tools/guide.md +25 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/conditional-tools/guide.zh.md +25 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/context-menu-services/guide.md +23 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/context-menu-services/guide.zh.md +23 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/cua-consent-storage/guide.md +22 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/cua-consent-storage/guide.zh.md +22 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/cua-preset-scope/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/cua-preset-scope/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/cua-relative-coordinates/guide.md +17 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/cua-relative-coordinates/guide.zh.md +17 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/file-drag-callbacks/guide.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/file-drag-callbacks/guide.zh.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/headless-policy-composition/guide.md +27 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/headless-policy-composition/guide.zh.md +27 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/model-badge-package-removal/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/model-badge-package-removal/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/new-session-blank-reuse/guide.md +22 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/new-session-blank-reuse/guide.zh.md +22 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/node-24/guide.md +17 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/node-24/guide.zh.md +17 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/official-bundle-lists/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/official-bundle-lists/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/persistent-terminal-controls/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/persistent-terminal-controls/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/pi-ai-default-capacities/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/pi-ai-default-capacities/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/pi-ai-model-catalog/guide.md +53 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/pi-ai-model-catalog/guide.zh.md +53 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/pi-ai-protocol-replay/guide.md +30 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/pi-ai-protocol-replay/guide.zh.md +30 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/ptc-script-format/guide.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/ptc-script-format/guide.zh.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/sdk-desktop-context/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/sdk-desktop-context/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/sdk-minimal-checkpoints/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/sdk-minimal-checkpoints/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/session-projection-handles/guide.md +24 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/session-projection-handles/guide.zh.md +24 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/session-store-writes/guide.md +25 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/session-store-writes/guide.zh.md +25 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/session-team-mode/guide.md +22 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/session-team-mode/guide.zh.md +22 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/subagent-activation-options/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/subagent-activation-options/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/subagent-service-methods/guide.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/subagent-service-methods/guide.zh.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/subagent-user-controls/guide.md +26 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/subagent-user-controls/guide.zh.md +26 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/tool-executor-plugins/guide.md +35 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/tool-executor-plugins/guide.zh.md +35 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/web-fetch-private-destinations/guide.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/web-fetch-private-destinations/guide.zh.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/webserver-index-peer/guide.md +17 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.2/webserver-index-peer/guide.zh.md +17 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.3/attachment-read-access/guide.md +23 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.3/attachment-read-access/guide.zh.md +23 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.3/computer-use-helper-permissions/guide.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.3/computer-use-helper-permissions/guide.zh.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.3/cua-bundle-id-consent/guide.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.3/cua-bundle-id-consent/guide.zh.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.3/generated-worktree-names/guide.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.3/generated-worktree-names/guide.zh.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.3/inbox-only-agent-wait/guide.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.3/inbox-only-agent-wait/guide.zh.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.3/independent-session-forks/guide.md +23 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.3/independent-session-forks/guide.zh.md +23 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.3/ptc-caller-cancellation/guide.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.3/ptc-caller-cancellation/guide.zh.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.3/session-follow-activation/guide.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.3/session-follow-activation/guide.zh.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.3/subagent-runtime-ownership/guide.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.3/subagent-runtime-ownership/guide.zh.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.3/team-mode-menu/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.3/team-mode-menu/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.3/team-projection/guide.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.3/team-projection/guide.zh.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.3/web-file-downloads/guide.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.3/web-file-downloads/guide.zh.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.3/web-search-defaults/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.3/web-search-defaults/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.4/model-listing-refresh/guide.md +22 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.4/model-listing-refresh/guide.zh.md +22 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.4/reasoning-body-props/guide.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.4/reasoning-body-props/guide.zh.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/context-menu-target/guide.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/context-menu-target/guide.zh.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/cordis-loader-entry-trees/guide.md +24 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/cordis-loader-entry-trees/guide.zh.md +24 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/css-anchored-menus/guide.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/css-anchored-menus/guide.zh.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/cua-source-dev-helper/guide.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/cua-source-dev-helper/guide.zh.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/desktop-stable-channel/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/desktop-stable-channel/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/forge-git-permissions/guide.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/forge-git-permissions/guide.zh.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/forge-worktree-entry/guide.md +29 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/forge-worktree-entry/guide.zh.md +29 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/fs-observation-policy-default-off/guide.md +29 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/fs-observation-policy-default-off/guide.zh.md +29 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/llm-request-purpose-declarations/guide.md +29 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/llm-request-purpose-declarations/guide.zh.md +29 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/pi-ai-request-image-count/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/pi-ai-request-image-count/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/projection-event-frames/guide.md +32 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/projection-event-frames/guide.zh.md +32 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/projection-released-checkpoint/guide.md +30 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/projection-released-checkpoint/guide.zh.md +30 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/projection-snapshot-scope/guide.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/projection-snapshot-scope/guide.zh.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/retained-ptc-timeout/guide.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/retained-ptc-timeout/guide.zh.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/schedule-agent-tools/guide.md +37 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/schedule-agent-tools/guide.zh.md +37 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/schedule-remote-host-tasks/guide.md +22 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/schedule-remote-host-tasks/guide.zh.md +22 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/sdk-run-commands/guide.md +24 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/sdk-run-commands/guide.zh.md +24 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/session-header-menu/guide.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/session-header-menu/guide.zh.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/subagent-explicit-reasoning/guide.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/subagent-explicit-reasoning/guide.zh.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/web-search-credential-modes/guide.md +17 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/web-search-credential-modes/guide.zh.md +17 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/web-search-default-provider/guide.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/web-search-default-provider/guide.zh.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.3/chat-process-activity-context/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.3/chat-process-activity-context/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.3/subagent-names/guide.md +29 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.3/subagent-names/guide.zh.md +29 -0
- package/kb/extra/web-styling.md +19 -1
- package/kb/extra/web-styling.zh.md +19 -1
- package/kb/meta/search-index.json +1272 -1098
- package/kb/meta/source.json +8 -4
- package/kb/site/develop/cordis-tutorial/04-events.md +1 -1
- package/kb/site/develop/cordis-tutorial/07-into-the-harness.md +5 -4
- package/kb/site/develop/framework/events.md +1 -1
- package/kb/site/develop/practice/dynamic-cordis.md +1 -1
- package/kb/site/en/develop/cordis-tutorial/04-events.md +1 -1
- package/kb/site/en/develop/cordis-tutorial/07-into-the-harness.md +5 -4
- package/kb/site/en/develop/framework/events.md +1 -1
- package/kb/site/en/develop/practice/dynamic-cordis.md +1 -1
- package/kb/site/en/guide/network-proxy.md +1 -1
- package/kb/site/en/guide/plugin-market.md +10 -10
- package/kb/site/en/guide/providers.md +5 -1
- package/kb/site/en/guide/python-sdk.md +17 -2
- package/kb/site/en/guide/schedule.md +45 -26
- package/kb/site/en/reference/agent-lifecycle.md +3 -1
- package/kb/site/en/reference/api-gateway.md +4 -4
- package/kb/site/en/reference/capability-seams.md +65 -17
- package/kb/site/en/reference/config-catalog.md +560 -238
- package/kb/site/en/reference/cookbook/adding-a-package.md +4 -2
- package/kb/site/en/reference/cookbook/extension-cookbook.md +1 -1
- package/kb/site/en/reference/cordis-api/context.md +1 -1
- package/kb/site/en/reference/cordis-api/events.md +9 -9
- package/kb/site/en/reference/cordis-api/fiber.md +85 -32
- package/kb/site/en/reference/cordis-api/inherited.md +10 -9
- package/kb/site/en/reference/experimental-persistence-catalog.md +3 -0
- package/kb/site/en/reference/index.md +14 -8
- package/kb/site/en/reference/persistence-catalog.md +532 -246
- package/kb/site/en/reference/subsystems/client-modules.md +19 -11
- package/kb/site/en/reference/subsystems/compaction.md +1 -1
- package/kb/site/en/reference/subsystems/conversation.md +2 -0
- package/kb/site/en/reference/subsystems/core.md +119 -65
- package/kb/site/en/reference/subsystems/filesystem.md +202 -28
- package/kb/site/en/reference/subsystems/index.md +3 -1
- package/kb/site/en/reference/subsystems/llm-streaming.md +92 -4
- package/kb/site/en/reference/subsystems/persistence.md +17 -7
- package/kb/site/en/reference/subsystems/plan.md +4 -4
- package/kb/site/en/reference/subsystems/ptc-runtime.md +12 -5
- package/kb/site/en/reference/subsystems/sandbox.md +11 -4
- package/kb/site/en/reference/subsystems/schedule.md +194 -430
- package/kb/site/en/reference/subsystems/session-projection.md +186 -44
- package/kb/site/en/reference/subsystems/session-reference.md +4 -3
- package/kb/site/en/reference/subsystems/session.md +119 -31
- package/kb/site/en/reference/subsystems/sidebar-right.md +12 -11
- package/kb/site/en/reference/subsystems/skills.md +4 -4
- package/kb/site/en/reference/subsystems/slots.md +30 -3
- package/kb/site/en/reference/subsystems/storage.md +26 -9
- package/kb/site/en/reference/subsystems/subagent.md +119 -102
- package/kb/site/en/reference/subsystems/system-prompt.md +13 -11
- package/kb/site/en/reference/subsystems/token-meter.md +45 -0
- package/kb/site/en/reference/subsystems/tools.md +222 -82
- package/kb/site/en/reference/subsystems/typert.md +21 -11
- package/kb/site/en/reference/subsystems/user-questions.md +22 -6
- package/kb/site/en/reference/subsystems/web-client.md +1 -1
- package/kb/site/en/reference/subsystems/web-server.md +68 -23
- package/kb/site/en/reference/subsystems/web.md +79 -21
- package/kb/site/en/reference/tool-catalog.md +270 -395
- package/kb/site/en/reference/tool-execution-pipeline.md +5 -4
- package/kb/site/guide/network-proxy.md +1 -1
- package/kb/site/guide/plugin-market.md +10 -10
- package/kb/site/guide/providers.md +5 -1
- package/kb/site/guide/python-sdk.md +17 -2
- package/kb/site/guide/schedule.md +45 -26
- package/kb/site/reference/agent-lifecycle.md +3 -1
- package/kb/site/reference/api-gateway.md +4 -4
- package/kb/site/reference/capability-seams.md +65 -17
- package/kb/site/reference/config-catalog.md +560 -238
- package/kb/site/reference/cookbook/adding-a-package.md +4 -2
- package/kb/site/reference/cookbook/extension-cookbook.md +1 -1
- package/kb/site/reference/cordis-api/context.md +1 -1
- package/kb/site/reference/cordis-api/events.md +9 -9
- package/kb/site/reference/cordis-api/fiber.md +87 -32
- package/kb/site/reference/cordis-api/inherited.md +10 -9
- package/kb/site/reference/experimental-persistence-catalog.md +3 -0
- package/kb/site/reference/index.md +14 -8
- package/kb/site/reference/persistence-catalog.md +532 -246
- package/kb/site/reference/subsystems/client-modules.md +19 -11
- package/kb/site/reference/subsystems/compaction.md +1 -1
- package/kb/site/reference/subsystems/conversation.md +4 -0
- package/kb/site/reference/subsystems/core.md +119 -65
- package/kb/site/reference/subsystems/filesystem.md +202 -28
- package/kb/site/reference/subsystems/index.md +3 -1
- package/kb/site/reference/subsystems/llm-streaming.md +92 -4
- package/kb/site/reference/subsystems/persistence.md +17 -7
- package/kb/site/reference/subsystems/plan.md +4 -4
- package/kb/site/reference/subsystems/ptc-runtime.md +12 -5
- package/kb/site/reference/subsystems/sandbox.md +11 -4
- package/kb/site/reference/subsystems/schedule.md +197 -433
- package/kb/site/reference/subsystems/session-projection.md +186 -44
- package/kb/site/reference/subsystems/session-reference.md +4 -3
- package/kb/site/reference/subsystems/session.md +119 -31
- package/kb/site/reference/subsystems/sidebar-right.md +12 -11
- package/kb/site/reference/subsystems/skills.md +4 -4
- package/kb/site/reference/subsystems/slots.md +30 -3
- package/kb/site/reference/subsystems/storage.md +26 -9
- package/kb/site/reference/subsystems/subagent.md +119 -102
- package/kb/site/reference/subsystems/system-prompt.md +13 -11
- package/kb/site/reference/subsystems/token-meter.md +45 -0
- package/kb/site/reference/subsystems/tools.md +222 -82
- package/kb/site/reference/subsystems/typert.md +21 -11
- package/kb/site/reference/subsystems/user-questions.md +22 -6
- package/kb/site/reference/subsystems/web-client.md +1 -1
- package/kb/site/reference/subsystems/web-server.md +68 -23
- package/kb/site/reference/subsystems/web.md +79 -21
- package/kb/site/reference/tool-catalog.md +273 -399
- package/kb/site/reference/tool-execution-pipeline.md +4 -3
- package/lib/index.js +268 -11
- package/lib/kb-search.js +261 -0
- package/lib/kb-version.js +118 -0
- package/package.json +5 -3
- package/scripts/refresh-kb.mjs +153 -0
- package/scripts/selfcheck.mjs +28 -0
- package/scripts/smoke.mjs +77 -0
- package/skills/dsh-plugin-dev-kb.md +8 -7
- package/skills/dsh-plugin-starter.md +65 -0
- package/skills/dsh-upgrade-assistant.md +62 -0
- package/kb/extra/agent-lifecycle.md +0 -91
- package/kb/extra/agent-lifecycle.zh.md +0 -93
- package/kb/extra/api-gateway.md +0 -172
- package/kb/extra/api-gateway.zh.md +0 -178
- package/kb/extra/architecture.md +0 -165
- package/kb/extra/architecture.zh.md +0 -169
- package/kb/extra/capability-seams.md +0 -714
- package/kb/extra/capability-seams.zh.md +0 -716
- package/kb/extra/config-catalog.md +0 -4801
- package/kb/extra/config-catalog.zh.md +0 -4803
- package/kb/extra/cookbook/adding-a-package.md +0 -170
- package/kb/extra/cookbook/adding-a-package.zh.md +0 -170
- package/kb/extra/cookbook/adding-a-settings-card.md +0 -72
- package/kb/extra/cookbook/adding-a-settings-card.zh.md +0 -72
- package/kb/extra/cookbook/adding-a-tool.md +0 -101
- package/kb/extra/cookbook/adding-a-tool.zh.md +0 -103
- package/kb/extra/cookbook/adding-an-llm-adapter.md +0 -43
- package/kb/extra/cookbook/adding-an-llm-adapter.zh.md +0 -43
- package/kb/extra/cookbook/extension-cookbook.md +0 -132
- package/kb/extra/cookbook/extension-cookbook.zh.md +0 -136
- package/kb/extra/cordis-api/context.md +0 -364
- package/kb/extra/cordis-api/context.zh.md +0 -366
- package/kb/extra/cordis-api/events.md +0 -207
- package/kb/extra/cordis-api/events.zh.md +0 -209
- package/kb/extra/cordis-api/fiber.md +0 -375
- package/kb/extra/cordis-api/fiber.zh.md +0 -377
- package/kb/extra/cordis-api/inherited.md +0 -38
- package/kb/extra/cordis-api/registry.md +0 -152
- package/kb/extra/cordis-api/registry.zh.md +0 -154
- package/kb/extra/cordis-api/service.md +0 -102
- package/kb/extra/cordis-api/service.zh.md +0 -104
- package/kb/extra/cordis-tutorial/01-first-plugin.md +0 -95
- package/kb/extra/cordis-tutorial/01-first-plugin.zh.md +0 -95
- package/kb/extra/cordis-tutorial/02-lifecycle-and-effects.md +0 -98
- package/kb/extra/cordis-tutorial/02-lifecycle-and-effects.zh.md +0 -98
- package/kb/extra/cordis-tutorial/03-services.md +0 -98
- package/kb/extra/cordis-tutorial/03-services.zh.md +0 -98
- package/kb/extra/cordis-tutorial/04-events.md +0 -144
- package/kb/extra/cordis-tutorial/04-events.zh.md +0 -144
- package/kb/extra/cordis-tutorial/05-config.md +0 -111
- package/kb/extra/cordis-tutorial/05-config.zh.md +0 -111
- package/kb/extra/cordis-tutorial/06-composition-and-hmr.md +0 -113
- package/kb/extra/cordis-tutorial/06-composition-and-hmr.zh.md +0 -113
- package/kb/extra/cordis-tutorial/07-into-the-harness.md +0 -108
- package/kb/extra/cordis-tutorial/07-into-the-harness.zh.md +0 -108
- package/kb/extra/cordis-tutorial/index.md +0 -60
- package/kb/extra/cordis-tutorial/index.zh.md +0 -62
- package/kb/extra/experimental-persistence-catalog.md +0 -17
- package/kb/extra/experimental-persistence-catalog.zh.md +0 -17
- package/kb/extra/persistence-catalog.md +0 -9140
- package/kb/extra/persistence-catalog.zh.md +0 -9142
- package/kb/extra/subsystems/README.md +0 -76
- package/kb/extra/subsystems/README.zh.md +0 -76
- package/kb/extra/subsystems/approval.md +0 -170
- package/kb/extra/subsystems/approval.zh.md +0 -170
- package/kb/extra/subsystems/client-modules.md +0 -198
- package/kb/extra/subsystems/client-modules.zh.md +0 -198
- package/kb/extra/subsystems/client-resources.md +0 -92
- package/kb/extra/subsystems/client-resources.zh.md +0 -92
- package/kb/extra/subsystems/commands.md +0 -223
- package/kb/extra/subsystems/commands.zh.md +0 -223
- package/kb/extra/subsystems/compaction.md +0 -284
- package/kb/extra/subsystems/compaction.zh.md +0 -284
- package/kb/extra/subsystems/conversation.md +0 -301
- package/kb/extra/subsystems/conversation.zh.md +0 -303
- package/kb/extra/subsystems/core.md +0 -1113
- package/kb/extra/subsystems/core.zh.md +0 -1125
- package/kb/extra/subsystems/credentials.md +0 -493
- package/kb/extra/subsystems/credentials.zh.md +0 -493
- package/kb/extra/subsystems/filesystem.md +0 -530
- package/kb/extra/subsystems/filesystem.zh.md +0 -530
- package/kb/extra/subsystems/goal.md +0 -313
- package/kb/extra/subsystems/goal.zh.md +0 -313
- package/kb/extra/subsystems/jobs.md +0 -554
- package/kb/extra/subsystems/jobs.zh.md +0 -554
- package/kb/extra/subsystems/llm-streaming.md +0 -1196
- package/kb/extra/subsystems/llm-streaming.zh.md +0 -1202
- package/kb/extra/subsystems/lsp.md +0 -202
- package/kb/extra/subsystems/lsp.zh.md +0 -202
- package/kb/extra/subsystems/permission-presets.md +0 -167
- package/kb/extra/subsystems/permission-presets.zh.md +0 -167
- package/kb/extra/subsystems/persistence.md +0 -418
- package/kb/extra/subsystems/persistence.zh.md +0 -418
- package/kb/extra/subsystems/plan.md +0 -87
- package/kb/extra/subsystems/plan.zh.md +0 -87
- package/kb/extra/subsystems/ptc-runtime.md +0 -250
- package/kb/extra/subsystems/ptc-runtime.zh.md +0 -250
- package/kb/extra/subsystems/sandbox.md +0 -221
- package/kb/extra/subsystems/sandbox.zh.md +0 -221
- package/kb/extra/subsystems/schedule.md +0 -550
- package/kb/extra/subsystems/schedule.zh.md +0 -550
- package/kb/extra/subsystems/scope.md +0 -59
- package/kb/extra/subsystems/scope.zh.md +0 -61
- package/kb/extra/subsystems/session-projection.md +0 -356
- package/kb/extra/subsystems/session-projection.zh.md +0 -356
- package/kb/extra/subsystems/session-query.md +0 -511
- package/kb/extra/subsystems/session-query.zh.md +0 -511
- package/kb/extra/subsystems/session-reference.md +0 -224
- package/kb/extra/subsystems/session-reference.zh.md +0 -224
- package/kb/extra/subsystems/session-telemetry.md +0 -212
- package/kb/extra/subsystems/session-telemetry.zh.md +0 -212
- package/kb/extra/subsystems/session-title.md +0 -213
- package/kb/extra/subsystems/session-title.zh.md +0 -213
- package/kb/extra/subsystems/session.md +0 -1339
- package/kb/extra/subsystems/session.zh.md +0 -1343
- package/kb/extra/subsystems/settings.md +0 -155
- package/kb/extra/subsystems/settings.zh.md +0 -155
- package/kb/extra/subsystems/shell.md +0 -314
- package/kb/extra/subsystems/shell.zh.md +0 -314
- package/kb/extra/subsystems/sidebar-right.md +0 -160
- package/kb/extra/subsystems/sidebar-right.zh.md +0 -160
- package/kb/extra/subsystems/skills.md +0 -352
- package/kb/extra/subsystems/skills.zh.md +0 -352
- package/kb/extra/subsystems/slots.md +0 -200
- package/kb/extra/subsystems/slots.zh.md +0 -204
- package/kb/extra/subsystems/spill.md +0 -124
- package/kb/extra/subsystems/spill.zh.md +0 -124
- package/kb/extra/subsystems/storage.md +0 -259
- package/kb/extra/subsystems/storage.zh.md +0 -259
- package/kb/extra/subsystems/subagent.md +0 -686
- package/kb/extra/subsystems/subagent.zh.md +0 -688
- package/kb/extra/subsystems/subprocess.md +0 -321
- package/kb/extra/subsystems/subprocess.zh.md +0 -321
- package/kb/extra/subsystems/system-prompt.md +0 -254
- package/kb/extra/subsystems/system-prompt.zh.md +0 -254
- package/kb/extra/subsystems/terminal.md +0 -184
- package/kb/extra/subsystems/terminal.zh.md +0 -184
- package/kb/extra/subsystems/token-meter.md +0 -106
- package/kb/extra/subsystems/token-meter.zh.md +0 -106
- package/kb/extra/subsystems/tools.md +0 -747
- package/kb/extra/subsystems/tools.zh.md +0 -747
- package/kb/extra/subsystems/typert.md +0 -690
- package/kb/extra/subsystems/typert.zh.md +0 -690
- package/kb/extra/subsystems/user-questions.md +0 -307
- package/kb/extra/subsystems/user-questions.zh.md +0 -307
- package/kb/extra/subsystems/web-client.md +0 -100
- package/kb/extra/subsystems/web-client.zh.md +0 -100
- package/kb/extra/subsystems/web-server.md +0 -302
- package/kb/extra/subsystems/web-server.zh.md +0 -302
- package/kb/extra/subsystems/web.md +0 -206
- package/kb/extra/subsystems/web.zh.md +0 -206
- package/kb/extra/subsystems/workflow.md +0 -278
- package/kb/extra/subsystems/workflow.zh.md +0 -278
- package/kb/extra/subsystems/workspace.md +0 -647
- package/kb/extra/subsystems/workspace.zh.md +0 -647
- package/kb/extra/tool-catalog.md +0 -2824
- package/kb/extra/tool-catalog.zh.md +0 -2832
- package/kb/extra/tool-execution-pipeline.md +0 -65
- package/kb/extra/tool-execution-pipeline.zh.md +0 -67
|
@@ -6,9 +6,9 @@ outline: [2,3]
|
|
|
6
6
|
|
|
7
7
|
# 文件系统
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
可选的文件系统能力由以下角色组成:[dsh-fs](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/fs/fs) 拥有 `ctx.fs` 和受防护的文件变更操作;[dsh-fs-local](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/fs/fs-local) 实现本地磁盘后端;[dsh-fs-observation-policy](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/fs/fs-observation-policy) 记录观测到的存在或缺失状态,并通过事件(而非服务)添加新鲜度规则;[dsh-tool-fs](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/fs/tool-fs) 直接执行面向模型的 read/write/edit 调用并渲染窗口。它位于 agent loop(智能体循环)主干之外;替换后端不会改变策略或工具 schema。纯库 [dsh-fs-patch](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/fs/fs-patch/README.zh.md) 提供补丁解析与文本应用。
|
|
10
10
|
|
|
11
|
-
`dsh-fs-observation-policy` 是可选插件。没有该插件时,`FileSystem` 服务定义、一个提供方和 `dsh-tool-fs` 消费方组成完整且不受约束的文件系统 seam:`write` 无条件创建或覆盖,`edit` 无条件替换字面文本。策略插件通过裁决 `fs/*` waterfall(瀑布式事件)来改变这些操作。移除该插件不会破坏工具,因为工具调用 `ctx.fs`
|
|
11
|
+
`dsh-fs-observation-policy` 是可选插件。没有该插件时,`FileSystem` 服务定义、一个提供方和 `dsh-tool-fs` 消费方组成完整且不受约束的文件系统 seam:`write` 无条件创建或覆盖,`edit` 无条件替换字面文本。策略插件通过裁决 `fs/*` waterfall(瀑布式事件)来改变这些操作。移除该插件不会破坏工具,因为工具调用 `ctx.fs` 并分发事件,而不调用策略方法。随发行版交付的组合不启用它:`dsh-base` 中的 `fs-observation-policy` 行写着 `disabled: true`,需要「先读后写/编辑」的部署把该行改为 `disabled: false`。
|
|
12
12
|
|
|
13
13
|
提供方源码:[`packages/fs/fs/src/types.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/fs/fs/src/types.ts) 与 [`packages/fs/fs/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/fs/fs/src/index.ts)。策略源码:[`packages/fs/fs-observation-policy/src/types.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/fs/fs-observation-policy/src/types.ts)。读取渲染源码:[`packages/fs/tool-fs/src/read-render.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/fs/tool-fs/src/read-render.ts)。
|
|
14
14
|
|
|
@@ -34,7 +34,7 @@ interface FsTarget {
|
|
|
34
34
|
}
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
后端拥有文件版本 token
|
|
37
|
+
后端拥有文件版本 token,即变更所守卫的新鲜度 token。策略插件存储它们以进行陈旧检查;消费方不解释其内容。两个 id 都是品牌化的不透明字符串。
|
|
38
38
|
|
|
39
39
|
```ts type-equiv
|
|
40
40
|
/**
|
|
@@ -115,8 +115,114 @@ interface FsDirEntry {
|
|
|
115
115
|
}
|
|
116
116
|
```
|
|
117
117
|
|
|
118
|
+
<a id="patch-syntax-records"></a>
|
|
119
|
+
## 补丁语法记录
|
|
120
|
+
|
|
121
|
+
[dsh-fs-patch](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/fs/fs-patch/README.zh.md) 将完整补丁文本解析为可序列化的操作,路径保持为未解析的字符串;`applyHunks` 将 hunk 应用于调用方提供的 LF 规范化文本,返回完整新文本或结构化匹配失败。固定的解析与匹配规则由包 README 维护。
|
|
122
|
+
|
|
123
|
+
```ts type-equiv
|
|
124
|
+
/** One contiguous update. */
|
|
125
|
+
interface PatchHunk {
|
|
126
|
+
/** One-based input line containing the marker or first implicit hunk line. */
|
|
127
|
+
lineNumber: number
|
|
128
|
+
/** Text following `@@ `, used as a search anchor by the text matcher. */
|
|
129
|
+
context?: string
|
|
130
|
+
/** Context and removed lines, without patch prefixes or line endings. */
|
|
131
|
+
oldLines: string[]
|
|
132
|
+
/** Context and added lines, without patch prefixes or line endings. */
|
|
133
|
+
newLines: string[]
|
|
134
|
+
/** Whether `*** End of File` follows this hunk. */
|
|
135
|
+
isEndOfFile: boolean
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
```ts type-equiv
|
|
141
|
+
/** Ordered file operation; a move is an update with a destination path. */
|
|
142
|
+
type PatchOperation =
|
|
143
|
+
| {
|
|
144
|
+
kind: 'add'
|
|
145
|
+
path: string
|
|
146
|
+
lineNumber: number
|
|
147
|
+
/** Added lines joined with LF, including a final LF for every added line. */
|
|
148
|
+
content: string
|
|
149
|
+
}
|
|
150
|
+
| {
|
|
151
|
+
kind: 'delete'
|
|
152
|
+
path: string
|
|
153
|
+
lineNumber: number
|
|
154
|
+
}
|
|
155
|
+
| {
|
|
156
|
+
kind: 'update'
|
|
157
|
+
path: string
|
|
158
|
+
lineNumber: number
|
|
159
|
+
moveTo?: string
|
|
160
|
+
hunks: PatchHunk[]
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
```ts type-equiv
|
|
165
|
+
/** The first hunk whose anchor or old lines could not be located in the original text. */
|
|
166
|
+
interface HunkApplyFailure {
|
|
167
|
+
/** One-based line of the failing hunk in the patch input. */
|
|
168
|
+
hunkLineNumber: number
|
|
169
|
+
/** The failed anchor or old-content search. */
|
|
170
|
+
stage: 'context' | 'oldLines'
|
|
171
|
+
/** Zero-based sequential search cursor; EOF searches override it with the tail candidate. */
|
|
172
|
+
searchStart: number
|
|
173
|
+
/** Original anchor or old lines, including any trailing empty line retried without its sentinel. */
|
|
174
|
+
pattern: string[]
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
```ts type-equiv
|
|
180
|
+
/** Complete new text or a match failure; failures contain no partially updated text. */
|
|
181
|
+
type ApplyHunksResult =
|
|
182
|
+
| { ok: true; after: string }
|
|
183
|
+
| { ok: false; failure: HunkApplyFailure }
|
|
184
|
+
```
|
|
185
|
+
|
|
118
186
|
## 写入与编辑守卫(提供方约定)
|
|
119
187
|
|
|
188
|
+
相同的可选防护规则也覆盖补丁、删除和移动。提供方不记录观察;调用方分派意图并记录已完成的结果。
|
|
189
|
+
|
|
190
|
+
| 操作 | 意图 | 成功观察 |
|
|
191
|
+
|---|---|---|
|
|
192
|
+
| `patchText` | `fs/edit-intent` | 目标存在于返回的版本。 |
|
|
193
|
+
| `deleteFile` | `fs/delete-intent` | 源缺失。 |
|
|
194
|
+
| `moveFile` 源 | `fs/edit-intent` | 仅在 `sourceDeleted` 为 true 时记录源缺失。 |
|
|
195
|
+
| `moveFile` 目标 | `fs/write-intent` | 目标存在于 `destination.version`。 |
|
|
196
|
+
|
|
197
|
+
补丁、删除和移动的源必须是普通文件;源缺失或版本陈旧报告 `FS_STALE_VERSION`。补丁在变更锁内对 LF 规范化文本匹配,不匹配报告 `FS_PATCH_MISMATCH`,包含补丁 hunk 行号与阶段。移动以 `FS_SAME_TARGET` 拒绝相同目标 key,对目标使用写入防护,并保留源的行尾风格与模式。删除、移动源和被覆盖目标的基线是有界、可空的 LF 文本。移动是两个效果:目标可能已发布而源删除失败。本地移动在暂存目标前检查取消;随后提供方完成两端效果并报告结果。
|
|
198
|
+
|
|
199
|
+
目标已跟随符号链接,因此拒绝符号链接源的调用方在 `resolve` 前用 `lstat` 检查路径。
|
|
200
|
+
|
|
201
|
+
```ts type-equiv
|
|
202
|
+
/** Outcome of a guarded delete; the bounded basis follows FsWriteOutcome.before. */
|
|
203
|
+
interface FsDeleteOutcome {
|
|
204
|
+
/** LF-normalized removed content, or null for an unavailable, binary, or over-limit basis. */
|
|
205
|
+
before: string | null
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
```ts type-equiv
|
|
210
|
+
/** Serializable failure after a move has published its destination but retained its source. */
|
|
211
|
+
interface FsMoveSourceFailure {
|
|
212
|
+
/** Filesystem failure code for source removal. */
|
|
213
|
+
code: FsErrorCode
|
|
214
|
+
/** Diagnostic identifying the source and the failed removal. */
|
|
215
|
+
message: string
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
```ts type-equiv
|
|
220
|
+
/** Published destination and removal status; sourceBefore is the bounded LF source basis captured under the move lock. */
|
|
221
|
+
type FsMoveOutcome =
|
|
222
|
+
| { sourceBefore: string | null; destination: FsWriteOutcome; sourceDeleted: true }
|
|
223
|
+
| { sourceBefore: string | null; destination: FsWriteOutcome; sourceDeleted: false; sourceFailure: FsMoveSourceFailure }
|
|
224
|
+
```
|
|
225
|
+
|
|
120
226
|
`writeText` 和 `editText` 的版本守卫都是可选的:省略守卫时执行无条件的裸提供方变更,提供守卫时则执行相应的条件检查。`writeText` 的守卫是 `FsWriteIntent`:`createIfAbsent` 在目标缺失时创建,目标已存在时以 `FS_NOT_OBSERVED` 拒绝;即使目标在提供方初始探测后才出现,也必须拒绝,因为发布操作本身不得替换。`replaceIfVersion` 仅在目标存在且版本匹配时替换,否则报 `FS_STALE_VERSION`。省略 `expected` 则无条件创建或覆盖。联合类型本身只包含两种有守卫的意图;「无守卫」通过省略表达,因此 write 和 edit 都使用同一个可选的 `expected` 字段。
|
|
121
227
|
|
|
122
228
|
```ts type-equiv
|
|
@@ -184,9 +290,9 @@ interface FsEditOutcome {
|
|
|
184
290
|
|
|
185
291
|
## fs 策略事件(提供方约定词汇)
|
|
186
292
|
|
|
187
|
-
`dsh-fs`
|
|
293
|
+
`dsh-fs` 为变更消费方与观察策略定义四个事件。消费方在操作前分发意图,并记录已完成的效果,无需依赖策略插件。它们只携带 `dsh-fs` 词汇加一个不透明的 `object` actor,不含面向模型的概念,也不含 agent/会话所有者结构。
|
|
188
294
|
|
|
189
|
-
`fs/write-intent` 与 `fs/
|
|
295
|
+
`fs/write-intent`、`fs/edit-intent` 与 `fs/delete-intent` 是**单槽决策 waterfall**:工具分发时附带一个默认 thunk(返回 `undefined`,即裸提供方),监听方完全决策而不调用 `next()`。该 slot 按注册顺序先到先得——由策略插件占据是部署约定,而非强制不变式。`fs/observed` 是一个即发即弃的记录事件,携带 `FsObservation`:存在于某个版本,或确认缺失。该事件通过普通 `ctx.emit` 分发;其监听方必须是同步的、仅产生副作用,因为工具不会捕获该 emit 抛出的异常——抛出异常的监听方可能取代读取操作原本待返回的错误,或使工具在变更已经成功后返回 `isError` 结果。下方生成的 [cordis surface](#cordis-surface) 展示确切签名。
|
|
190
296
|
|
|
191
297
|
```ts type-equiv
|
|
192
298
|
/**
|
|
@@ -243,35 +349,37 @@ interface FileReadOutcome {
|
|
|
243
349
|
|
|
244
350
|
## 已观测文件状态(策略插件)
|
|
245
351
|
|
|
246
|
-
已观测状态是 `dsh-fs-observation-policy` 插件内部持有的 `WeakMap<owner, Map<targetKey, FsObservation>>`。映射中没有条目表示未见;`{ kind: 'absent' }` 表示 `read` 的元数据未命中,或 `str_replace_editor` 的 `view`、`str_replace`、`insert` 命令发生元数据未命中,从而确认缺失;`{ kind: 'present', version }` 表示 read、write 或 edit 观测到该版本。写入决策把未见和缺失映射到 `createIfAbsent`,把存在映射到 `replaceIfVersion
|
|
352
|
+
已观测状态是 `dsh-fs-observation-policy` 插件内部持有的 `WeakMap<owner, Map<targetKey, FsObservation>>`。映射中没有条目表示未见;`{ kind: 'absent' }` 表示 `read` 的元数据未命中,或 `str_replace_editor` 的 `view`、`str_replace`、`insert` 命令发生元数据未命中,从而确认缺失;`{ kind: 'present', version }` 表示 read、write 或 edit 观测到该版本。写入决策把未见和缺失映射到 `createIfAbsent`,把存在映射到 `replaceIfVersion`;编辑/删除决策把未见映射到 `FS_NOT_OBSERVED`,把缺失映射到 `FS_NOT_FOUND`,把存在映射到其版本守卫。所有者从事件 actor 推导(通常是 `exec.agent.session`),被视为不透明且从不读取。dispose(资源释放)时丢弃全部数据(HMR(热模块替换)安全),策略不执行任何文件系统 I/O。
|
|
353
|
+
|
|
354
|
+
## 补丁执行(消费方)
|
|
355
|
+
|
|
356
|
+
内部 [tool-fs 补丁执行器](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/fs/tool-fs/README.zh.md#understand-the-implementation) 在预检时分发意图决策而不发出观察、模拟前序操作,并在每次提交时重新取得防护。沙箱围栏与 `write`、`edit` 一样由提供方在提交时判断。提供方结果决定记录哪些效果;执行器细节与失败保证由包 README 维护。
|
|
357
|
+
|
|
358
|
+
| 操作 | 首次使用目标的预检意图 | 提交意图 | 成功观察 |
|
|
359
|
+
|---|---|---|---|
|
|
360
|
+
| add | `fs/write-intent` | `fs/write-intent` | 目标 present(version) |
|
|
361
|
+
| update | `fs/edit-intent` | `fs/edit-intent` | 目标 present(version) |
|
|
362
|
+
| delete | `fs/delete-intent` | `fs/delete-intent` | 目标 absent |
|
|
363
|
+
| move | 源 `fs/edit-intent`;目标 `fs/write-intent` | 重新分发同一组意图 | 目标 present(version);仅在源删除成功时记录 absent |
|
|
364
|
+
|
|
365
|
+
`apply_patch` 工具返回严格的提交值,包含各操作诊断及用于渲染的完整文本变更输入;持久化元数据只保留基于提供方有界基线的 diff hunk 与停止标志。语法和预检拒绝为 `isError: true`;停止的提交报告仍为 `isError: false`,确保已知部分 diff 进入 Session 展示,但被取消的调用与其他工具一样收到工具注册表的中止结果。[工具 README](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/fs/tool-fs/README.zh.md#use-this-package) 维护格式与恢复规则。
|
|
247
366
|
|
|
248
367
|
## 错误分类体系(提供方约定)
|
|
249
368
|
|
|
250
369
|
文件系统故障使用稳定的 `FsErrorCode` 字符串,由 `FsError`(`HarnessError`)携带。工具注册表在错误结果上保留 `{ name, code }`,使重试、权限和 UI 层可以按 code 分支而无需解析文本。
|
|
251
370
|
|
|
371
|
+
`FS_PATCH_MISMATCH` 表示 hunk 在提供方提交阶段未匹配;消息标明补丁行号与失败的搜索阶段。`FS_SAME_TARGET` 表示移动源与目标共享已解析身份。删除意图遵循编辑意图:未见为 `FS_NOT_OBSERVED`,观察到缺失为 `FS_NOT_FOUND`,存在状态提供版本。提供方收到缺失的补丁/删除/移动源时,即使没有防护也使用 `FS_STALE_VERSION`。
|
|
372
|
+
|
|
373
|
+
```ts
|
|
374
|
+
import { FS_ERROR_CODES } from '@deepseek-ai/dsh-fs'
|
|
375
|
+
```
|
|
376
|
+
|
|
252
377
|
```ts type-equiv
|
|
253
|
-
/**
|
|
254
|
-
|
|
255
|
-
* {@link FsError}; the tool registry exposes `{ name, code }` on `isError`
|
|
256
|
-
* results so retry/permission/UI layers can branch without parsing messages.
|
|
257
|
-
*/
|
|
258
|
-
type FsErrorCode =
|
|
259
|
-
| 'FS_NOT_FOUND'
|
|
260
|
-
| 'FS_NOT_DIRECTORY'
|
|
261
|
-
| 'FS_NOT_TEXT'
|
|
262
|
-
| 'FS_NOT_REGULAR_FILE'
|
|
263
|
-
| 'FS_TOO_LARGE'
|
|
264
|
-
| 'FS_PERMISSION_DENIED'
|
|
265
|
-
| 'FS_SANDBOX_DENIED'
|
|
266
|
-
| 'FS_IO_ERROR'
|
|
267
|
-
| 'FS_STALE_VERSION'
|
|
268
|
-
| 'FS_NOT_OBSERVED'
|
|
269
|
-
| 'FS_AMBIGUOUS_EDIT'
|
|
270
|
-
| 'FS_EDIT_NOT_FOUND'
|
|
271
|
-
| 'FS_ABORTED'
|
|
378
|
+
/** One machine-routable filesystem failure code from FS_ERROR_CODES. */
|
|
379
|
+
type FsErrorCode = typeof FS_ERROR_CODES[number]
|
|
272
380
|
```
|
|
273
381
|
|
|
274
|
-
目录列表使用 `FS_NOT_DIRECTORY`、`FS_PERMISSION_DENIED` 与 `FS_IO_ERROR` 区分已存在但并非目录的目标、被拒绝的列表操作和意外的后端 I/O 失败。`FS_SANDBOX_DENIED` 是强制执行沙箱的后端(`dsh-fs-sandbox
|
|
382
|
+
目录列表使用 `FS_NOT_DIRECTORY`、`FS_PERMISSION_DENIED` 与 `FS_IO_ERROR` 区分已存在但并非目录的目标、被拒绝的列表操作和意外的后端 I/O 失败。`FS_SANDBOX_DENIED` 是强制执行沙箱的后端(`dsh-fs-sandbox`)所作的策略拒绝——模式边界拒绝了变更——与 `FS_PERMISSION_DENIED`(宿主内核拒绝)不同。`FS_NOT_OBSERVED` 表示策略插件没有此所有者的先前观测记录(或 `createIfAbsent` 遇到了现有文件)。`FS_NOT_FOUND` 也表示策略因确认缺失而拒绝 edit。`FS_STALE_VERSION` 表示后端版本不再与观测到的版本匹配(或提供方本身收到针对缺失目标的 edit)。新鲜度授权没有部分/完整之分,因此不存在 `FS_PARTIAL_OBSERVATION`。
|
|
275
383
|
|
|
276
384
|
## 文件 IO 不设超时
|
|
277
385
|
|
|
@@ -279,7 +387,7 @@ type FsErrorCode =
|
|
|
279
387
|
|
|
280
388
|
## 服务与插件
|
|
281
389
|
|
|
282
|
-
`FileSystem`(`ctx.fs`,abstract)拥有提供方原语:`resolve`、`processPath`、`processPathFromHostPath`、`fileUrl`、`contains`、`stat`、`lstat`、`readText`、`streamText`、`readBytes`、`listDir`、`writeText` 与 `
|
|
390
|
+
`FileSystem`(`ctx.fs`,abstract)拥有提供方原语:`resolve`、`processPath`、`processPathFromHostPath`、`fileUrl`、`contains`、`stat`、`lstat`、`readText`、`streamText`、`readBytes`、`listDir`、`writeText`、`editText`、`patchText`、`deleteFile` 与 `moveFile`。`dsh-fs-observation-policy` **不注册服务**。它通过 `fs/*` 事件门禁添加策略,根据未见、缺失或存在状态对写入、编辑与删除意图 waterfall 作出决策,并记录 `FsObservation` 值。执行器是 `dsh-tool-fs`:它通过 `ctx.fs` 读取、写入或编辑,分发 waterfall,并 emit 记录事件。下方生成的 [`ctx.fs` 小节](#ctxfs--filesystem-abstract-seam) 展示确切的 `ctx.fs` 签名。
|
|
283
391
|
|
|
284
392
|
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
|
|
285
393
|
|
|
@@ -293,7 +401,7 @@ Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnp
|
|
|
293
401
|
|
|
294
402
|
### `ctx.fs` — `FileSystem` (abstract seam)
|
|
295
403
|
|
|
296
|
-
Abstract filesystem provider. Targets must preserve identity across aliases; reads expose regular UTF-8 text or typed errors, listings are stable and content-free, and
|
|
404
|
+
Abstract filesystem provider. Targets must preserve identity across aliases; reads expose regular UTF-8 text or typed errors, listings are stable and content-free, and single-file publication is atomic. Moves can retain their source after publishing the destination. Optional guards add stale protection without changing the unguarded provider contract.
|
|
297
405
|
|
|
298
406
|
```ts cordis-catalog
|
|
299
407
|
/**
|
|
@@ -462,6 +570,53 @@ abstract writeText( target: FsTarget, content: string, expected?: FsWriteIntent,
|
|
|
462
570
|
* @returns the outcome, including the version the edit produced.
|
|
463
571
|
*/
|
|
464
572
|
abstract editText( target: FsTarget, edit: FsEditRequest, expected?: { version: FsVersion }, signal?: AbortSignal, sandboxPolicy?: SandboxExecutionPolicy, ): Promise<FsEditOutcome>
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* Atomically apply parsed hunks to the LF-normalized text and restore the
|
|
576
|
+
* stored line-ending style. A missing or stale target reports
|
|
577
|
+
* `FS_STALE_VERSION`; an unmatched hunk reports `FS_PATCH_MISMATCH`.
|
|
578
|
+
* @param target - the resolved regular file to patch.
|
|
579
|
+
* @param hunks - ordered hunks from `parsePatch`.
|
|
580
|
+
* @param expected - the version guard; omit for an unconditional patch.
|
|
581
|
+
* @param signal - aborts before atomic publication takes effect.
|
|
582
|
+
* @param sandboxPolicy - the per-call mode and workspace root this patch runs
|
|
583
|
+
* under; a sandboxing backend fences the patch by it, the bare backend
|
|
584
|
+
* ignores it. Omit to leave the backend its own default.
|
|
585
|
+
* @returns the outcome, including the version the patch produced.
|
|
586
|
+
*/
|
|
587
|
+
abstract patchText( target: FsTarget, hunks: readonly PatchHunk[], expected?: { version: FsVersion }, signal?: AbortSignal, sandboxPolicy?: SandboxExecutionPolicy, ): Promise<FsEditOutcome>
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* Remove a regular file. A missing or stale target reports `FS_STALE_VERSION`;
|
|
591
|
+
* a directory or other non-file reports `FS_NOT_REGULAR_FILE`. Resolution has
|
|
592
|
+
* already followed symlinks, so the target is the real file.
|
|
593
|
+
* @param target - the resolved file to remove.
|
|
594
|
+
* @param expected - the version guard; omit for an unconditional removal.
|
|
595
|
+
* @param signal - aborts before removal.
|
|
596
|
+
* @param sandboxPolicy - the per-call mode and workspace root this removal
|
|
597
|
+
* runs under; a sandboxing backend fences it, the bare backend ignores it.
|
|
598
|
+
* Omit to leave the backend its own default.
|
|
599
|
+
* @returns the bounded LF-normalized removed text, or null when no basis is available.
|
|
600
|
+
*/
|
|
601
|
+
abstract deleteFile( target: FsTarget, expected?: { version: FsVersion }, signal?: AbortSignal, sandboxPolicy?: SandboxExecutionPolicy, ): Promise<FsDeleteOutcome>
|
|
602
|
+
|
|
603
|
+
/**
|
|
604
|
+
* Publish the source text, optionally patched, at the destination, then remove
|
|
605
|
+
* the source. Both targets stay locked in canonical order. Identical targets
|
|
606
|
+
* report `FS_SAME_TARGET`; the source guard follows `patchText` and the
|
|
607
|
+
* destination guard follows `writeText`. The two effects are separate: a
|
|
608
|
+
* published destination with a retained source is a final outcome reported
|
|
609
|
+
* through `sourceDeleted: false`.
|
|
610
|
+
* @param source - the resolved regular source; its line-ending style and mode carry over.
|
|
611
|
+
* @param destination - the resolved destination within the same provider.
|
|
612
|
+
* @param options - optional hunks and the source/destination guards; an omitted guard is unconditional.
|
|
613
|
+
* @param signal - checked before destination staging; the commit then completes both effects.
|
|
614
|
+
* @param sandboxPolicy - the per-call mode and workspace root both paths run
|
|
615
|
+
* under; a sandboxing backend fences them, the bare backend ignores it.
|
|
616
|
+
* Omit to leave the backend its own default.
|
|
617
|
+
* @returns the bounded LF source basis, the destination outcome, and the source-removal status.
|
|
618
|
+
*/
|
|
619
|
+
abstract moveFile( source: FsTarget, destination: FsTarget, options: { hunks?: readonly PatchHunk[] expectedSource?: { version: FsVersion } expectedDestination?: FsWriteIntent }, signal?: AbortSignal, sandboxPolicy?: SandboxExecutionPolicy, ): Promise<FsMoveOutcome>
|
|
465
620
|
```
|
|
466
621
|
|
|
467
622
|
Types: [SandboxExecutionPolicy](./sandbox.md)
|
|
@@ -472,6 +627,25 @@ Source: [`packages/fs/fs/src/index.ts`](https://github.com/deepseek-ai/deepseek-
|
|
|
472
627
|
|
|
473
628
|
### `fs/*` events
|
|
474
629
|
|
|
630
|
+
<a id="fsdelete-intent--waterfall"></a>
|
|
631
|
+
|
|
632
|
+
#### `fs/delete-intent` — waterfall
|
|
633
|
+
|
|
634
|
+
Single-slot decision for FileSystem.deleteFile; the first returned guard wins. Calling next() delegates to an unconditional deletion.
|
|
635
|
+
|
|
636
|
+
```ts cordis-catalog
|
|
637
|
+
/**
|
|
638
|
+
* Single-slot decision for FileSystem.deleteFile; the first returned guard wins.
|
|
639
|
+
* Calling next() delegates to an unconditional deletion.
|
|
640
|
+
* @param target - the resolved source about to be removed.
|
|
641
|
+
* @param actor - the opaque tool-execution context used to select observed state.
|
|
642
|
+
* @mode waterfall
|
|
643
|
+
*/
|
|
644
|
+
'fs/delete-intent'(target: FsTarget, actor: object | undefined, next: () => { version: FsVersion } | undefined | Promise<{ version: FsVersion } | undefined>): Promise<{ version: FsVersion } | undefined>
|
|
645
|
+
```
|
|
646
|
+
|
|
647
|
+
Source: [`packages/fs/fs/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/fs/fs/src/index.ts)
|
|
648
|
+
|
|
475
649
|
<a id="fsedit-intent--waterfall"></a>
|
|
476
650
|
|
|
477
651
|
#### `fs/edit-intent` — waterfall
|
|
@@ -24,6 +24,7 @@ outline: [2,3]
|
|
|
24
24
|
| [session.md](./session.md) | 完整的 `SessionEventMap` 变体目录、`TurnEndReason`、`deriveMessages()`、执行封闭与独立事件 |
|
|
25
25
|
| [working-directory.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/working-directory.zh.md) | Session 执行目录、持久化变更、恢复与用户上下文 |
|
|
26
26
|
| [worktrees.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/worktrees.zh.md) | 现有权限下的实验性 Git 分支与检出目录创建 |
|
|
27
|
+
| [forge.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/forge.zh.md) | 实验性代码托管变更请求:提供方契约、共享状态轮询与 Session 绑定 |
|
|
27
28
|
| [persistence.md](./persistence.md) | 持久性 seam:`SessionPersistence`、JSONL 提供方、`session/flush`、崩溃恢复、`SessionHeader` |
|
|
28
29
|
| [settings.md](./settings.md) | 用户设置 seam:`SettingsNamespace` 注册、分层解析(默认值 → 组合 `base` → 用户文档)、owner scope、热提交 |
|
|
29
30
|
| [credentials.md](./credentials.md) | 凭据 seam:配置中的 `CredentialRef` 引用(绝不含值)、按操作解析、对 UI 安全的 `CredentialInfo`、提供方来源层 |
|
|
@@ -54,7 +55,8 @@ outline: [2,3]
|
|
|
54
55
|
| [subagent.md](./subagent.md) | subagent seam:命名提供方注册表、`SubagentStartRequest`/`Result`/`Run`、启动时与运行时能力拆分 |
|
|
55
56
|
| [voice-input.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/voice-input.zh.md) | 实验性具名语音识别、临时音频和受版本保护的草稿插入 |
|
|
56
57
|
| [translation.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/translation.zh.md) | 实验性免登录文本翻译与显式 Provider 请求 |
|
|
57
|
-
| [agent-team.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/agent-team.zh.md) | Agent Teams
|
|
58
|
+
| [agent-team.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/agent-team.zh.md) | Agent Teams:子代理树共享的任务 DAG 与任务归属 |
|
|
59
|
+
| [liveshare.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/liveshare.zh.md) | 可选的 LiveShare bundle:嵌套分享模式、fork 的上限与持久性、上限安装,以及共享会话外部驱动轮次所受的约束 |
|
|
58
60
|
| [claude-code-mods.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/claude-code-mods.zh.md) | 经实验性桥接运行的 Claude Code 模组:与 Claude Code 不同的每个事件、`$` 成员、链规则、绘制特性与示例模组 |
|
|
59
61
|
| [web.md](./web.md) | Web 访问 seam:`WebSearchRequest`/`Result`、`WebFetchRequest`/`Result`、`WebFetchBody`、提供方可用性、`WebError` |
|
|
60
62
|
| [spill.md](./spill.md) | spill 存储 seam:`SaveTextSpill`、`SpillOwner`/`SpillSource`、`SpillRef`、品牌类型 `SpillLocator` |
|
|
@@ -535,6 +535,26 @@ interface LlmNativeAuth {
|
|
|
535
535
|
}
|
|
536
536
|
```
|
|
537
537
|
|
|
538
|
+
目录条目可以携带提供方编写的 `badge`,供选择器显示在模型名称旁。它只是展示数据:`resolveModelInfo` 不返回它,模型请求也不携带它。
|
|
539
|
+
|
|
540
|
+
```ts type-equiv
|
|
541
|
+
/**
|
|
542
|
+
* Emphasis of a model badge: `neutral` states a plain fact, `info` highlights
|
|
543
|
+
* the model, `success` marks a benefit, and `warning` asks for attention.
|
|
544
|
+
*/
|
|
545
|
+
type LlmModelBadgeTone = 'neutral' | 'info' | 'success' | 'warning'
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
```ts type-equiv
|
|
549
|
+
/** Short provider-authored label a selector shows beside one advertised model name. */
|
|
550
|
+
interface LlmModelBadge {
|
|
551
|
+
/** One literal, or translations keyed by lowercase language id with a required English entry. */
|
|
552
|
+
text: LocalizedText
|
|
553
|
+
/** Emphasis of the label. */
|
|
554
|
+
tone: LlmModelBadgeTone
|
|
555
|
+
}
|
|
556
|
+
```
|
|
557
|
+
|
|
538
558
|
```ts type-equiv
|
|
539
559
|
/** One adapter-discovered model; catalog membership is advisory, not request validation. */
|
|
540
560
|
interface LlmModelInfo {
|
|
@@ -548,6 +568,11 @@ interface LlmModelInfo {
|
|
|
548
568
|
description?: string
|
|
549
569
|
/** Accepted request modalities; absent means unknown, while an explicit omission is negative capability. */
|
|
550
570
|
inputModalities?: readonly ModelModality[]
|
|
571
|
+
/**
|
|
572
|
+
* Selector label advertised by catalog discovery; exact-route resolution
|
|
573
|
+
* omits it, and no model request or Session event carries it.
|
|
574
|
+
*/
|
|
575
|
+
badge?: LlmModelBadge
|
|
551
576
|
}
|
|
552
577
|
```
|
|
553
578
|
|
|
@@ -627,8 +652,21 @@ type RequestMessage = Message | RequestUserInput
|
|
|
627
652
|
```
|
|
628
653
|
|
|
629
654
|
```ts type-equiv
|
|
630
|
-
/**
|
|
631
|
-
interface
|
|
655
|
+
/** Auxiliary request purposes declared by their producer packages. */
|
|
656
|
+
interface LlmRequestPurposeMap {}
|
|
657
|
+
```
|
|
658
|
+
|
|
659
|
+
```ts type-equiv
|
|
660
|
+
/** Declared auxiliary request purpose; ordinary conversation requests leave it absent. */
|
|
661
|
+
type LlmRequestPurpose = Extract<keyof LlmRequestPurposeMap, string>
|
|
662
|
+
```
|
|
663
|
+
|
|
664
|
+
```ts type-equiv
|
|
665
|
+
/**
|
|
666
|
+
* A single model request, fully assembled.
|
|
667
|
+
* @typeParam Purpose - declared purpose keys for callers; forwarding adapters may accept `string`.
|
|
668
|
+
*/
|
|
669
|
+
interface GenerateOptions<Purpose extends string = LlmRequestPurpose> {
|
|
632
670
|
/** Registered provider route selecting the adapter instance. */
|
|
633
671
|
provider: string
|
|
634
672
|
model: string
|
|
@@ -669,7 +707,7 @@ interface GenerateOptions {
|
|
|
669
707
|
* map the purpose to model-hidden transport metadata. Ordinary conversation
|
|
670
708
|
* requests leave it unset.
|
|
671
709
|
*/
|
|
672
|
-
purpose?:
|
|
710
|
+
purpose?: Purpose
|
|
673
711
|
}
|
|
674
712
|
```
|
|
675
713
|
|
|
@@ -770,7 +808,7 @@ interface LlmDiscoveredModel {
|
|
|
770
808
|
|
|
771
809
|
循环从已记录状态构建每个请求。`EpochHeader` 记录调用配置,标记由适配器默认值提供的字段,并通过完整的 `request/header` 快照记录权威返回工具顺序(由 `toolOrder` 配置;未配置时按字典序)。渲染后的提示词是派生历史——surface 第 0 号节点上的 `system/message`,加上 `in-history` 路由追加的任何后续系统节点——因此请求头与派生历史共同使请求可由会话日志重建。见 [session.md](./session.md#the-request-header-event-requestheader) 与[可重建性 Agent Note](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/architecture/2026-07-05-reconstructable-requests.zh.md)。
|
|
772
810
|
|
|
773
|
-
`agent/request`
|
|
811
|
+
已弃用的 `agent/request` hook 仍可供现有监听器使用。新代码通过 [Session 模型选择](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/agent/README.zh.md#use-this-package) 设置模型与推理强度。该 hook 收到基于步骤已捕获模型选择的冻结调用配置初值,可以替换采样等控制参数。替换值必须保留提供方、模型及可选的显式推理强度;要改变这些选择,需在下一个步骤之前记录新的 Session 选择。waterfall(瀑布式事件)开始前,循环会移除标记为适配器默认值的值,使确切模型准备过程填入所选路由的当前值;未带标记的显式设置仍保留在提议中。waterfall 结束后,准备过程会在轮次信号控制下拒绝显式指定但不受支持的推理强度 ID(不自动调整),并记录生效配置以及由适配器默认值提供的字段。步骤准入时,该 waterfall 与准备过程在组装和 `step/start` 之后、系统提示词与已接纳用户批次提交之前运行;在任一阶段取消都不会提交这两者。已准备调用的能力决定提示词协调,调用直至分派完成始终持有同一项适配器注册。到达 `llm/stream` 的请求会被深度冻结,因此变更会抛异常;请求还携带进程本地循环标识,使观察者不会把单独记录的冻结辅助调用误认成对话请求。
|
|
774
812
|
|
|
775
813
|
在协议中,循环构建的请求只有派生历史:渲染后的提示词作为开头的 `system` 角色消息(surface 第 0 号节点,即一个 `system/message` 事件)传输,并且当已准备调用声明 `systemPromptUpdate: 'in-history'` 时,变化后的非空提示词可以作为后续的 `system` 角色消息跟在已缓存历史之后,由模型读作有效提示词;请求的 `system` 字段不设置——`GenerateOptions.system` 服务于标题提供方等直接单次调用方。空渲染文本使派生历史不包含任何系统消息,即使先前请求保留了多个提示词版本。已记录的请求会以最新的 `user/message`(轮次首步)或上一步的工具结果(后续步骤)结尾。
|
|
776
814
|
|
|
@@ -832,6 +870,10 @@ interface LlmCallConfigAdapterDefaults {
|
|
|
832
870
|
|
|
833
871
|
[协议参考](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/deepseek-llm-api-wire-extensions.zh.md)定义确切的请求标头、扩展事务、字段版本和接收方义务。随附组合会将 [`dsh_session_log`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/session/session-log-deepseek/README.zh.md) 注册为无损增量权威日志后缀,并将 [`dsh_plugin_packages`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/llm/plugin-package-inventory-deepseek/README.zh.md) 注册为完整存活 Loader 包集合。这些字段仍位于模型消息之外,也不会进入 pi-ai 适配器路径。
|
|
834
872
|
|
|
873
|
+
## Pi-ai 请求头
|
|
874
|
+
|
|
875
|
+
`PiAiRequestHeaderContext` 包含已准备调用的 provider、model、解析后的模型 `baseURL`,以及可选 Session id 和辅助用途。它不可变且不含消息或认证字段,与本次请求独有的 `Headers` 一起传入同步的 `llm-pi-ai/request-headers` waterfall。[适配器的请求头文档](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/llm/llm-pi-ai/README.zh.md#request-headers)定义贡献的所有权、应用标识的优先级与失败行为。此扩展点仅适用于 pi-ai 推理请求。
|
|
876
|
+
|
|
835
877
|
## 服务与提供方约定
|
|
836
878
|
|
|
837
879
|
`LlmAdapter` 是提供方约定:创建子类、实现 `stream()`,再用 `ctx.llm.registerAdapter(providers, adapter)` 注册一个适配器实例。`GenerateOptions.provider` 选择已注册适配器;`GenerateOptions.model` 会传给该适配器,无需在生命周期启动时注册。重复提供方路由会原子失败。可选的 `providerRetryPolicy()` 会按路由捕获并填入 normal 默认值,`providerInfo()` 与异步 `listModels()` 方法则为 `LlmRuntime.listProviders()` / `listModels()` 提供分离的 selector 元数据。该目录仅供参考,不是请求白名单:适配器仍是权威,并可接受未列出的模型 id。单次异步 `resolveModel()` 查询返回确切模型身份,以及可选的对正确性敏感的上下文容量、适配器配置的 `defaultMaxTokens`、由模型持有的有序推理强度 ID 和可选的部署默认值;字段缺失表示元数据不可用或保留提供方持有的行为,而不表示目录成员关系无效。解析器会接收可选的取消信号,并且必须在信号中止后迅速完成结算。`LlmRuntime.resolveModelInfo()` 会校验聚合结果并返回分离值。在最终适配器边界,`resolveCallConfig()` 仅在 `maxTokens` 缺失时填入输出默认值,并校验和填入推理强度,因此直接调用也无法绕过任何一项已配置行为;直接分派会在等待解析前捕获一项适配器注册。agent loop 则使用 `prepareCall()`,使模型解析、请求头持久记录和分派全程使用同一项注册,保留来自同一次查询的分离上下文元数据,并报告适配器填入的配置字段。适配器查找发生在 `llm/stream` waterfall 的终端 continuation,因此 listener 可以在查找前短路调用,或路由一个可变的一次性请求。AgentLoop 在外层 waterfall 返回流句柄时观察到一次请求尝试;这个有限边界不能证明惰性终端适配器已构造完成或开始提供方 I/O。`block-start` / `block-end` 的 `index` 关联与 assembler 共同意味着适配器只需 emit 格式正确的分片——块重组不是每个适配器各自的问题。`ctx.llm.stream()` 与 `llm/stream` waterfall 在一个轮次中的位置见 [architecture.md](../index.md#turn-flow)。
|
|
@@ -1180,6 +1222,23 @@ The provider topology changed: an adapter registered or unregistered routes, or
|
|
|
1180
1222
|
|
|
1181
1223
|
Source: [`packages/llm/llm/src/types.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/llm/llm/src/types.ts)
|
|
1182
1224
|
|
|
1225
|
+
<a id="llmmodels-updated--emit"></a>
|
|
1226
|
+
|
|
1227
|
+
#### `llm/models-updated` — emit
|
|
1228
|
+
|
|
1229
|
+
A provider's advertised models or display metadata changed; consumers reload `listModels()`.
|
|
1230
|
+
|
|
1231
|
+
```ts cordis-catalog
|
|
1232
|
+
/**
|
|
1233
|
+
* A provider's advertised models or display metadata changed; consumers reload `listModels()`.
|
|
1234
|
+
* @mode emit
|
|
1235
|
+
* @param provider - route whose model catalog changed.
|
|
1236
|
+
*/
|
|
1237
|
+
'llm/models-updated'(provider: string): void
|
|
1238
|
+
```
|
|
1239
|
+
|
|
1240
|
+
Source: [`packages/llm/llm/src/types.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/llm/llm/src/types.ts)
|
|
1241
|
+
|
|
1183
1242
|
<a id="llmstream--waterfall"></a>
|
|
1184
1243
|
|
|
1185
1244
|
#### `llm/stream` — waterfall
|
|
@@ -1203,4 +1262,33 @@ Waterfall around every streaming model call (retry, replay, routing). Bound to t
|
|
|
1203
1262
|
```
|
|
1204
1263
|
|
|
1205
1264
|
Source: [`packages/llm/llm/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/llm/llm/src/index.ts)
|
|
1265
|
+
|
|
1266
|
+
<a id="llm-pi-ai-events"></a>
|
|
1267
|
+
|
|
1268
|
+
### `llm-pi-ai/*` events
|
|
1269
|
+
|
|
1270
|
+
<a id="llm-pi-airequest-headers--waterfall"></a>
|
|
1271
|
+
|
|
1272
|
+
#### `llm-pi-ai/request-headers` — waterfall
|
|
1273
|
+
|
|
1274
|
+
Prepare headers for one pi-ai inference call, excluding model discovery. Listeners run synchronously and must call next(); they may edit only the request-owned headers and must not retain them. Throws fail the call with REQUEST_HEADERS before inference I/O. Harness attribution wins afterward. Non-TypeError messages are user-visible and must exclude secrets. TypeError details and non-Error values are replaced with safe guidance.
|
|
1275
|
+
|
|
1276
|
+
```ts cordis-catalog
|
|
1277
|
+
/**
|
|
1278
|
+
* Prepare headers for one pi-ai inference call, excluding model discovery.
|
|
1279
|
+
* Listeners run synchronously and must call next(); they may edit only the
|
|
1280
|
+
* request-owned headers and must not retain them. Throws fail the call with
|
|
1281
|
+
* REQUEST_HEADERS before inference I/O. Harness attribution wins afterward.
|
|
1282
|
+
* Non-TypeError messages are user-visible and must exclude secrets. TypeError
|
|
1283
|
+
* details and non-Error values are replaced with safe guidance.
|
|
1284
|
+
* @mode waterfall
|
|
1285
|
+
* @param request - immutable routing metadata from the exact prepared call.
|
|
1286
|
+
* @param headers - fresh profile headers, shared only within this dispatch.
|
|
1287
|
+
* @param next - continue header preparation through the remaining listeners.
|
|
1288
|
+
* @returns headers passed to pi-ai after Harness attribution is applied.
|
|
1289
|
+
*/
|
|
1290
|
+
'llm-pi-ai/request-headers'(request: PiAiRequestHeaderContext, headers: Headers, next: () => Headers): Headers
|
|
1291
|
+
```
|
|
1292
|
+
|
|
1293
|
+
Source: [`packages/llm/llm-pi-ai/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/llm/llm-pi-ai/src/index.ts)
|
|
1206
1294
|
<!-- END GENERATED cordis-surface -->
|
|
@@ -117,16 +117,16 @@ interface SessionHandle extends AsyncDisposable {
|
|
|
117
117
|
|
|
118
118
|
只读观察即 `open(id, 'read')`:句柄提供经过验证的连续前缀切片,绝不返回撕裂尾部,且同一句柄上的重复读取绝不会观察到比先前读取更旧的状态。持久化侧不存在已准备 Session 缓存:session-query 拥有自己的冷读缓存,按 `stat().revision` 变更令牌为每个 id 缓存一个已配平的冷 Session,仅在令牌变化时重新读取。该生命周期由[基于句柄的持久化 Agent Note](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/architecture/2026-08-27-handle-based-session-persistence.zh.md)定义;已归档的 [Session 准备阶段记录](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/archived/architecture/2026-08-05-session-preparation.md)记载了发布边界 `SessionPreparation` 最初的决策。
|
|
119
119
|
|
|
120
|
-
## `SessionLocation
|
|
120
|
+
## `SessionLocation`——每一 Session 的产物元数据
|
|
121
121
|
|
|
122
|
-
`SessionLocation`
|
|
122
|
+
`SessionLocation` 用于诊断与导出的观察元数据;日志访问仍走会话句柄的 `read`。已物化的持久化快照携带选中产物路径,`SessionFormatUnsupportedError` 也能指出本构建拒绝解读的原始日志。JSONL 提供其项目/会话目录内 transcript(文本记录)的绝对路径;没有逐会话工件的后端则不提供。
|
|
123
123
|
|
|
124
124
|
```ts type-equiv
|
|
125
125
|
/**
|
|
126
|
-
* A backend-resolved, per-
|
|
127
|
-
* refusal diagnostics
|
|
128
|
-
*
|
|
129
|
-
*
|
|
126
|
+
* A backend-resolved, per-Session local artifact path used by observational
|
|
127
|
+
* snapshots and refusal diagnostics. It names a backend target for the Session
|
|
128
|
+
* and does not authorize reads; log access still goes through a session
|
|
129
|
+
* handle's `read`. It is not persisted Session content.
|
|
130
130
|
*/
|
|
131
131
|
interface SessionLocation {
|
|
132
132
|
/** Backend-specific artifact kind, for example `jsonl`. */
|
|
@@ -160,7 +160,11 @@ interface SessionHeader {
|
|
|
160
160
|
readonly createdAt: number
|
|
161
161
|
/** Absolute working directory the session was created in (if any). */
|
|
162
162
|
readonly cwd?: string
|
|
163
|
-
/**
|
|
163
|
+
/**
|
|
164
|
+
* Direct creator of a subagent Session. Ordinary forks omit this field;
|
|
165
|
+
* historical ordinary forks may retain their source id here. Presence alone
|
|
166
|
+
* does not classify a Session as a subagent; use `origin` for that distinction.
|
|
167
|
+
*/
|
|
164
168
|
readonly parentSession?: SessionId
|
|
165
169
|
/**
|
|
166
170
|
* Whether this Session contains a fork-inherited event prefix. The exact prefix
|
|
@@ -323,6 +327,12 @@ interface SessionPersistenceSnapshot {
|
|
|
323
327
|
readonly eventCount?: number
|
|
324
328
|
/** Physical artifact byte size, when the backend can provide it cheaply (JSONL); otherwise absent. */
|
|
325
329
|
readonly sizeBytes?: number
|
|
330
|
+
/**
|
|
331
|
+
* Backend-resolved location of the selected materialized per-Session
|
|
332
|
+
* artifact, for diagnostics and export. Absent when the backend has no
|
|
333
|
+
* materialized per-Session file, including an unmaterialized pending Session.
|
|
334
|
+
*/
|
|
335
|
+
readonly location?: SessionLocation
|
|
326
336
|
}
|
|
327
337
|
```
|
|
328
338
|
|
|
@@ -12,7 +12,7 @@ outline: [2,3]
|
|
|
12
12
|
|
|
13
13
|
## 已记录状态与恢复
|
|
14
14
|
|
|
15
|
-
`plan/mode`(`{ active: boolean }`)是仅记日志、整值替换的[会话事件](./session.md):持久且可回放,绝不进入模型 transcript
|
|
15
|
+
`plan/mode`(`{ active: boolean }`)是仅记日志、整值替换的[会话事件](./session.md):持久且可回放,绝不进入模型 transcript(文本记录)。`plan` 单元折叠已提交模式、命令结算结果和最近一次请求头记录的模式。`ctx.planMode` 要求注册表存在,并在激活期间等待 `plan` 和 `turnBoundary` 注册完成,之后通过保留的句柄读取状态。客户端只接收 `{ active, pending }`;恢复、fork 与压缩(compaction)都能从日志恢复两者。完整事件声明见[持久化日志事件目录](../persistence-catalog.md)。
|
|
16
16
|
|
|
17
17
|
## 待生效选择与 pre-step 追加
|
|
18
18
|
|
|
@@ -34,13 +34,13 @@ interface PlanModeConfig {
|
|
|
34
34
|
|
|
35
35
|
## 退出工具与 `/plan` 命令
|
|
36
36
|
|
|
37
|
-
[`exit_plan_mode`](../tool-catalog.md#deepseek-aidsh-plan-mode)
|
|
37
|
+
[`exit_plan_mode`](../tool-catalog.md#deepseek-aidsh-plan-mode) 采用渐进式披露:从已选计划状态首次为激活的步骤起准入,并在会话剩余部分保持准入,因此首次进入计划模式时它进入请求的工具声明,之后的切换只改变计划指引。原生与 PTC 执行使用同一准入集合;首次进入之前调用返回 `UNKNOWN_TOOL`,计划模式未提交时调用会失败。在计划模式中,它要求一份以 `#` 标题开头的完整 markdown 计划,并通过[用户交互 seam](./user-questions.md) 呈交评审。批准返回 `{ approved: true }`,并记录一个静默(不叙述)的待生效退出,由下一个被接受的轮内 pre-step 追加。因此,计划指引在 assistant 当前这批工具调用的剩余部分继续生效,而工具结果本身会报告这次转换。「继续规划」则是一次携带用户反馈的失败调用,模型据此修订并再次呈交。放弃评审返回 `{ approved: false }` 并结束当前轮次,计划模式保持激活,直到用户发出下一条消息。评审期间交互通道缺失或服务重载同样使调用失败,而不是静默离开计划模式。
|
|
38
38
|
|
|
39
39
|
当 [`ctx.commands`](./commands.md) 被组合时,插件注册 `/plan [off|message]`:单独的 `/plan` 选择计划模式;任何其他非空消息先选择计划模式,再通过 `agent.steer()` 提交该文本,使其在计划指引下成为下一步骤的普通已记录用户消息;确切参数 `off` 选择未激活,这还会在待生效条目被追加并对请求可见之前将其取消。
|
|
40
40
|
|
|
41
41
|
## 服务
|
|
42
42
|
|
|
43
|
-
`ctx.planMode` 拥有已记录的计划状态,在步骤开始时应用并叙述选中的状态,还拥有 `plan:policy` 段落、`/plan`
|
|
43
|
+
`ctx.planMode` 拥有已记录的计划状态,在步骤开始时应用并叙述选中的状态,还拥有 `plan:policy` 段落、`/plan` 命令和按条件准入的退出工具;`get`/`set` 签名见生成的[服务目录](#ctxplanmode--planmodecontroller)。
|
|
44
44
|
|
|
45
45
|
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
|
|
46
46
|
|
|
@@ -54,7 +54,7 @@ Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnp
|
|
|
54
54
|
|
|
55
55
|
### `ctx.planMode` — `PlanModeController`
|
|
56
56
|
|
|
57
|
-
`ctx.planMode`: owns logged plan state, applies and narrates selected state at step start, the `plan:policy` section, the `/plan` command, and the
|
|
57
|
+
`ctx.planMode`: owns logged plan state, applies and narrates selected state at step start, the `plan:policy` section, the `/plan` command, and the conditional exit tool. Client carriers expose the projection's cropped `{ active, pending }` view. Agent prompt assembly fails while the projection reader is not ready; callers must await plugin activation before running an agent.
|
|
58
58
|
|
|
59
59
|
```ts cordis-catalog
|
|
60
60
|
/**
|
|
@@ -23,9 +23,11 @@ interface PtcRunRequest {
|
|
|
23
23
|
/**
|
|
24
24
|
* The program source, in the runtime's {@link ../index.ts | language}. It
|
|
25
25
|
* follows the provider's programFormat: an async function body supports
|
|
26
|
-
* top-level `await` and `return`;
|
|
27
|
-
* `await`, and a final expression
|
|
28
|
-
*
|
|
26
|
+
* top-level `await` and `return`; REPL and Script programs support top-level
|
|
27
|
+
* declarations, `await`, and a final expression, but not top-level `return`.
|
|
28
|
+
* The Script provider lowers top-level await; its executionInstructions and
|
|
29
|
+
* documentation define retained-binding semantics. The completion value
|
|
30
|
+
* becomes {@link PtcRunResult.value}.
|
|
29
31
|
*/
|
|
30
32
|
program: string
|
|
31
33
|
/**
|
|
@@ -88,7 +90,7 @@ interface PtcRunResult {
|
|
|
88
90
|
/** Applied file policy and observed denial, when the provider enforces file policy. */
|
|
89
91
|
sandbox?: PtcRunSandbox
|
|
90
92
|
/**
|
|
91
|
-
* The program's completion value (a return or final REPL expression), when it ran to
|
|
93
|
+
* The program's completion value (a return or final REPL/Script expression), when it ran to
|
|
92
94
|
* completion and the value crossed the runtime's lossless-JSON boundary.
|
|
93
95
|
* Invalid or over-limit completions fail the run instead of substituting a
|
|
94
96
|
* rendered string; a failed or value-less run leaves this absent.
|
|
@@ -105,7 +107,12 @@ interface PtcRunResult {
|
|
|
105
107
|
}
|
|
106
108
|
```
|
|
107
109
|
|
|
108
|
-
|
|
110
|
+
```ts type-equiv
|
|
111
|
+
/** Source evaluation form, independent of retained program state. */
|
|
112
|
+
type PtcProgramFormat = 'function-body' | 'repl' | 'script'
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
`programFormat` 区分异步函数体、REPL 语句与脚本。REPL 与 Script 程序接受顶层 `await`、声明和末尾表达式,不支持顶层 `return`。Node Script 提供方转换顶层 await 并等待完成值;其[声明限制](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/ptc-runtime/ptc-runtime-node/README.zh.md#known-limitations-and-deferred-work)适用于转换后的程序。`retainsState` 独立于源码语法报告是否保留内存。`stateOwner` 是标识可选保留内存的进程内对象身份;不同对象相互隔离。消费者在所有者结束时等待 `release(owner)`;清理失败时该调用拒绝。省略所有者时仅执行一次,无状态提供方忽略所有权。[持久 Node 提供方](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/ptc-runtime/ptc-runtime-node/README.zh.md#persistent-repl)定义重置和恢复行为;保留对象不会进入持久 Session 格式。
|
|
109
116
|
|
|
110
117
|
## 绑定:宿主函数作为程序全局变量
|
|
111
118
|
|