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
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* kb-version — 宿主 dsh 版本探测与升级指南匹配(零依赖,纯函数)。
|
|
3
|
+
*
|
|
4
|
+
* 目的:知识库快照同步自上游 master(领先宿主),dsh_kb_search / dsh_kb_read
|
|
5
|
+
* 返回结果时按宿主实际版本附版本横幅,提示 API 可能存在的版本差异,
|
|
6
|
+
* 并给出对应的 extra/upgrade-guide/<vX.Y.Z> 目录。
|
|
7
|
+
*
|
|
8
|
+
* 探测策略(全部失败安全,拿不到就返回 null,绝不抛错):
|
|
9
|
+
* 1. 从插件安装目录向上逐层找 node_modules/@deepseek-ai/dsh/package.json
|
|
10
|
+
* (兼容 link: junction / file: 安装的 realpath 落点差异,最多回溯 6 层);
|
|
11
|
+
* 2. 再试 @deepseek-ai/dsh-base(desktop 安装形态里两者同版本)。
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { existsSync, readdirSync, readFileSync } from 'node:fs'
|
|
15
|
+
import { dirname, join, resolve, sep } from 'node:path'
|
|
16
|
+
|
|
17
|
+
/** 读 package.json 的 version;失败返回 null。 */
|
|
18
|
+
function readVersion(pkgPath) {
|
|
19
|
+
try {
|
|
20
|
+
const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'))
|
|
21
|
+
return typeof pkg?.version === 'string' && pkg.version ? pkg.version : null
|
|
22
|
+
} catch {
|
|
23
|
+
return null
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** 逐层向上找包目录;找不到返回 null。 */
|
|
28
|
+
function findPkgDir(startDir, scope, name, maxUp = 6) {
|
|
29
|
+
let dir = resolve(startDir)
|
|
30
|
+
for (let i = 0; i <= maxUp; i++) {
|
|
31
|
+
const candidate = join(dir, 'node_modules', scope, name)
|
|
32
|
+
if (existsSync(join(candidate, 'package.json'))) return candidate
|
|
33
|
+
const parent = dirname(dir)
|
|
34
|
+
if (parent === dir) return null
|
|
35
|
+
dir = parent
|
|
36
|
+
}
|
|
37
|
+
return null
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** 比较 dsh 预发布版本号(x.y.z-rc.N / -alpha.N);返回 -1/0/1。只比数字段 + 预发布序,不做完整 semver。 */
|
|
41
|
+
export function compareVersions(a, b) {
|
|
42
|
+
const parse = (v) => {
|
|
43
|
+
const m = /^v?(\d+)\.(\d+)\.(\d+)(?:-([a-z]+)\.?(\d+))?$/i.exec(String(v).trim())
|
|
44
|
+
if (!m) return null
|
|
45
|
+
const stageRank = { alpha: 0, beta: 1, rc: 2 }
|
|
46
|
+
return {
|
|
47
|
+
nums: [Number(m[1]), Number(m[2]), Number(m[3])],
|
|
48
|
+
stage: m[4] ? stageRank[m[4].toLowerCase()] ?? -1 : 3,
|
|
49
|
+
stageNum: m[5] ? Number(m[5]) : 0,
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const pa = parse(a)
|
|
53
|
+
const pb = parse(b)
|
|
54
|
+
if (!pa || !pb) return 0
|
|
55
|
+
for (let i = 0; i < 3; i++) {
|
|
56
|
+
if (pa.nums[i] !== pb.nums[i]) return pa.nums[i] < pb.nums[i] ? -1 : 1
|
|
57
|
+
}
|
|
58
|
+
if (pa.stage !== pb.stage) return pa.stage < pb.stage ? -1 : 1
|
|
59
|
+
if (pa.stageNum !== pb.stageNum) return pa.stageNum < pb.stageNum ? -1 : 1
|
|
60
|
+
return 0
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* 探测宿主 dsh 版本。
|
|
65
|
+
* @param {string} pkgDir 插件包目录(lib/ 的上一级)
|
|
66
|
+
* @returns {{ version: string, source: string } | null}
|
|
67
|
+
*/
|
|
68
|
+
export function detectHostVersion(pkgDir) {
|
|
69
|
+
for (const [scope, name] of [['@deepseek-ai', 'dsh'], ['@deepseek-ai', 'dsh-base']]) {
|
|
70
|
+
const dir = findPkgDir(pkgDir, scope, name)
|
|
71
|
+
if (dir) {
|
|
72
|
+
const version = readVersion(join(dir, 'package.json'))
|
|
73
|
+
if (version) return { version, source: `${scope}/${name}` }
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return null
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* 在 extra/upgrade-guide/ 下为宿主版本选最合适的指南目录:
|
|
81
|
+
* 精确命中优先;否则取 ≤ 宿主版本的最大目录(宿主版本由若干指南逐版到达,
|
|
82
|
+
* 其后的指南描述的是「比宿主新」的变更,正是「文档领先宿主」的差异来源)。
|
|
83
|
+
* @returns {string | null} 目录名(如 'v0.2.0-rc.2')
|
|
84
|
+
*/
|
|
85
|
+
export function matchUpgradeGuide(kbDir, hostVersion) {
|
|
86
|
+
const guideRoot = join(kbDir, 'extra', 'upgrade-guide')
|
|
87
|
+
let dirs = []
|
|
88
|
+
try {
|
|
89
|
+
dirs = readdirSync(guideRoot, { withFileTypes: true })
|
|
90
|
+
.filter((e) => e.isDirectory())
|
|
91
|
+
.map((e) => e.name)
|
|
92
|
+
.filter((n) => /^v/.test(n))
|
|
93
|
+
} catch {
|
|
94
|
+
return null
|
|
95
|
+
}
|
|
96
|
+
if (!dirs.length || !hostVersion) return null
|
|
97
|
+
if (dirs.includes(`v${hostVersion}`)) return `v${hostVersion}`
|
|
98
|
+
const lower = dirs.filter((d) => compareVersions(d, `v${hostVersion}`) <= 0)
|
|
99
|
+
if (lower.length) return lower.sort((a, b) => compareVersions(a, b))[lower.length - 1]
|
|
100
|
+
return null
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* 组装版本横幅文本(search / read 工具共用)。
|
|
105
|
+
* @returns {string | null} null = 无版本信息,不加横幅
|
|
106
|
+
*/
|
|
107
|
+
export function versionBanner(kbDir, host, kbSyncNote = true) {
|
|
108
|
+
if (!host) return null
|
|
109
|
+
const guide = matchUpgradeGuide(kbDir, host.version)
|
|
110
|
+
const lines = []
|
|
111
|
+
if (kbSyncNote) {
|
|
112
|
+
lines.push(`【版本提示】宿主 dsh ${host.version}(探测自 ${host.source});知识库快照同步自上游 master,可能领先宿主——API 行为不符时以宿主实际安装包为准。`)
|
|
113
|
+
}
|
|
114
|
+
if (guide) {
|
|
115
|
+
lines.push(`版本差异请读升级指南:extra/upgrade-guide/${guide}/(含 ${guide.slice(1)} 前后的破坏性变更与迁移项)。`)
|
|
116
|
+
}
|
|
117
|
+
return lines.length ? lines.join('\n') : null
|
|
118
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-dev-kb",
|
|
3
|
-
"description": "dsh 插件辅助:① dsh-plugin-dev-kb 技能 = DeepSeek Harness 官方文档站完整 Markdown 镜像(中英双语 192 页)+ 439 篇仓库补充开发参考 + 主题导航与 634 文件全量搜索索引;② dsh-dev-sandbox 技能 = 自建独立沙箱 profile 开发沙箱工作流(沙箱名由 agent 按任务自定),开发中的插件隔离运行,agent 自主启动/重启/冒烟验证,插件崩了不影响主力 dsh
|
|
4
|
-
"version": "1.
|
|
3
|
+
"description": "dsh 插件辅助:① dsh-plugin-dev-kb 技能 = DeepSeek Harness 官方文档站完整 Markdown 镜像(中英双语 192 页)+ 439 篇仓库补充开发参考 + 主题导航与 634 文件全量搜索索引;② dsh-dev-sandbox 技能 = 自建独立沙箱 profile 开发沙箱工作流(沙箱名由 agent 按任务自定),开发中的插件隔离运行,agent 自主启动/重启/冒烟验证,插件崩了不影响主力 dsh;③ dsh_kb_search 工具 = 知识库本地打分检索,一次调用返回命中文件 + 行号 + 上下文片段。零运行时依赖。",
|
|
4
|
+
"version": "1.8.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -22,7 +22,9 @@
|
|
|
22
22
|
],
|
|
23
23
|
"scripts": {
|
|
24
24
|
"selfcheck": "node scripts/selfcheck.mjs",
|
|
25
|
-
"rebuild-index": "node scripts/rebuild-index.mjs"
|
|
25
|
+
"rebuild-index": "node scripts/rebuild-index.mjs",
|
|
26
|
+
"refresh-kb": "node scripts/refresh-kb.mjs",
|
|
27
|
+
"smoke": "node scripts/smoke.mjs"
|
|
26
28
|
},
|
|
27
29
|
"keywords": [
|
|
28
30
|
"dsh",
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
// One-shot knowledge-base refresh: sync kb/ from upstream deepseek-harness master.
|
|
2
|
+
// Usage: node scripts/refresh-kb.mjs [--keep-tmp]
|
|
3
|
+
// Steps (see kb/README.md「更新方法」):
|
|
4
|
+
// 1. shallow-clone upstream repo into a temp dir
|
|
5
|
+
// 2. install mdast projection deps next to the clone
|
|
6
|
+
// 3. run scripts/project-doc-site.ts -> website/.generated
|
|
7
|
+
// 4. mirror .generated -> kb/site
|
|
8
|
+
// 5. rebuild kb/extra = docs/ md NOT in the published set (docsPages source/aliases)
|
|
9
|
+
// 6. npm run rebuild-index; update kb/meta/source.json + kb/README.md stats
|
|
10
|
+
import { spawnSync } from 'node:child_process';
|
|
11
|
+
import fs from 'node:fs';
|
|
12
|
+
import path from 'node:path';
|
|
13
|
+
import { fileURLToPath } from 'node:url';
|
|
14
|
+
|
|
15
|
+
const PLUGIN = path.join(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
16
|
+
const KB = path.join(PLUGIN, 'kb');
|
|
17
|
+
const REPO_URL = 'https://github.com/deepseek-ai/deepseek-harness.git';
|
|
18
|
+
const TMP = path.join(PLUGIN, '.refresh-tmp');
|
|
19
|
+
const CLONE = path.join(TMP, 'deepseek-harness');
|
|
20
|
+
const KEEP = process.argv.includes('--keep-tmp');
|
|
21
|
+
|
|
22
|
+
function pathToFileUrl(p) {
|
|
23
|
+
return 'file:///' + p.replace(/\\/g, '/');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function run(cmd, opts = {}) {
|
|
27
|
+
const r = spawnSync(cmd, { shell: true, stdio: 'inherit', cwd: CLONE, ...opts });
|
|
28
|
+
if (r.status !== 0) { console.error(`FAILED: ${cmd} (cwd=${opts.cwd || CLONE})`); process.exit(r.status ?? 1); }
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// robocopy: exit codes 0-7 all mean success (1 = files copied)
|
|
32
|
+
function robocopy(src, dest, extra = '') {
|
|
33
|
+
const r = spawnSync(`robocopy "${src}" "${dest}" /MIR /NFL /NDL /NJH /NJS ${extra}`, { shell: true, stdio: 'inherit' });
|
|
34
|
+
if (r.status === null || r.status > 7) { console.error(`robocopy FAILED (${r.status}): ${src} -> ${dest}`); process.exit(r.status ?? 1); }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function countMd(dir) {
|
|
38
|
+
let n = 0;
|
|
39
|
+
for (const e of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
40
|
+
if (e.isDirectory()) n += countMd(path.join(dir, e.name));
|
|
41
|
+
else if (e.name.endsWith('.md')) n++;
|
|
42
|
+
}
|
|
43
|
+
return n;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
console.log('[1/6] cloning upstream ...');
|
|
47
|
+
fs.rmSync(TMP, { recursive: true, force: true });
|
|
48
|
+
fs.mkdirSync(TMP, { recursive: true });
|
|
49
|
+
run(`git clone --depth 1 ${REPO_URL} "${CLONE}"`, { cwd: PLUGIN });
|
|
50
|
+
const commit = spawnSync('git', ['rev-parse', 'HEAD'], { cwd: CLONE, encoding: 'utf8' }).stdout.trim();
|
|
51
|
+
console.log(' commit:', commit);
|
|
52
|
+
|
|
53
|
+
console.log('[2/6] installing projection deps ...');
|
|
54
|
+
run('npm install --no-save --no-package-lock mdast-util-from-markdown mdast-util-gfm micromark-extension-gfm', { cwd: TMP });
|
|
55
|
+
|
|
56
|
+
console.log('[3/6] projecting doc site ...');
|
|
57
|
+
run('node --input-type=module -e "import(\'./scripts/project-doc-site.ts\').then(m => m.projectDocs()).then(() => console.log(\'projected\'))"');
|
|
58
|
+
|
|
59
|
+
console.log('[4/6] mirroring kb/site ...');
|
|
60
|
+
robocopy(path.join(CLONE, 'website', '.generated'), path.join(KB, 'site'));
|
|
61
|
+
|
|
62
|
+
console.log('[5/6] rebuilding kb/extra from published-set diff ...');
|
|
63
|
+
const { docsPages } = await import(pathToFileUrl(path.join(CLONE, 'website', 'docs.ts')));
|
|
64
|
+
const norm = s => String(s).replace(/\\/g, '/').replace(/^docs\//, '');
|
|
65
|
+
const published = new Set();
|
|
66
|
+
for (const p of docsPages) {
|
|
67
|
+
published.add(norm(p.source));
|
|
68
|
+
for (const a of p.sourceAliases || []) published.add(norm(a));
|
|
69
|
+
}
|
|
70
|
+
const DOCS = path.join(CLONE, 'docs');
|
|
71
|
+
const wanted = [];
|
|
72
|
+
(function walk(dir) {
|
|
73
|
+
for (const e of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
74
|
+
const full = path.join(dir, e.name);
|
|
75
|
+
if (e.isDirectory()) walk(full);
|
|
76
|
+
else if (e.name.endsWith('.md')) wanted.push(full);
|
|
77
|
+
}
|
|
78
|
+
})(DOCS);
|
|
79
|
+
const extraRel = wanted
|
|
80
|
+
.map(f => path.relative(DOCS, f).replace(/\\/g, '/'))
|
|
81
|
+
.filter(r => !published.has(r));
|
|
82
|
+
const EXTRA = path.join(KB, 'extra');
|
|
83
|
+
let copied = 0;
|
|
84
|
+
for (const rel of extraRel) {
|
|
85
|
+
const dest = path.join(EXTRA, rel);
|
|
86
|
+
fs.mkdirSync(path.dirname(dest), { recursive: true });
|
|
87
|
+
fs.copyFileSync(path.join(DOCS, rel), dest);
|
|
88
|
+
copied++;
|
|
89
|
+
}
|
|
90
|
+
let removed = 0;
|
|
91
|
+
(function prune(dir) {
|
|
92
|
+
for (const e of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
93
|
+
const full = path.join(dir, e.name);
|
|
94
|
+
if (e.isDirectory()) prune(full);
|
|
95
|
+
else if (e.name.endsWith('.md')) {
|
|
96
|
+
const rel = path.relative(EXTRA, full).replace(/\\/g, '/');
|
|
97
|
+
if (!extraRel.includes(rel)) { fs.unlinkSync(full); removed++; }
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
})(EXTRA);
|
|
101
|
+
(function pruneDirs(dir) {
|
|
102
|
+
for (const e of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
103
|
+
if (e.isDirectory()) {
|
|
104
|
+
const full = path.join(dir, e.name);
|
|
105
|
+
pruneDirs(full);
|
|
106
|
+
if (fs.readdirSync(full).length === 0) fs.rmdirSync(full);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
})(EXTRA);
|
|
110
|
+
console.log(` extra: copied ${copied}, removed ${removed}, total ${countMd(EXTRA)}`);
|
|
111
|
+
|
|
112
|
+
console.log('[6/6] rebuilding index + metadata ...');
|
|
113
|
+
run('npm run rebuild-index', { cwd: PLUGIN });
|
|
114
|
+
|
|
115
|
+
const siteFiles = fs.readdirSync(path.join(KB, 'site'), { recursive: true, withFileTypes: true });
|
|
116
|
+
let siteMd = 0, siteImages = 0;
|
|
117
|
+
for (const e of siteFiles) {
|
|
118
|
+
if (!e.isFile()) continue;
|
|
119
|
+
if (e.name.endsWith('.md')) siteMd++;
|
|
120
|
+
else if (/\.(png|jpe?g|svg|webp|gif)$/i.test(e.name)) siteImages++;
|
|
121
|
+
}
|
|
122
|
+
const extraMd = countMd(EXTRA);
|
|
123
|
+
const today = new Date().toISOString().slice(0, 10);
|
|
124
|
+
const source = JSON.parse(fs.readFileSync(path.join(KB, 'meta', 'source.json'), 'utf8'));
|
|
125
|
+
const short = commit.slice(0, 7);
|
|
126
|
+
source.commit = commit;
|
|
127
|
+
source.fetchedAt = today;
|
|
128
|
+
source.publishedMarkdownPages = siteMd;
|
|
129
|
+
source.siteFiles = siteMd + siteImages;
|
|
130
|
+
source.images = siteImages;
|
|
131
|
+
source.extraFiles = extraMd;
|
|
132
|
+
source.note = `内容同步(${today}):site/ 与 extra/ 刷新至上游 master @ ${short}(refresh-kb.mjs 自动执行),extra 共 ${extraMd} 篇。`;
|
|
133
|
+
source.schemaVersion = 1; // shields.io dynamic JSON badge fields
|
|
134
|
+
source.label = 'kb sync';
|
|
135
|
+
source.message = `${today} @ ${short}`;
|
|
136
|
+
source.color = 'blue';
|
|
137
|
+
fs.writeFileSync(path.join(KB, 'meta', 'source.json'), JSON.stringify(source, null, 2) + '\n', 'utf8');
|
|
138
|
+
|
|
139
|
+
const readmePath = path.join(KB, 'README.md');
|
|
140
|
+
let readme = fs.readFileSync(readmePath, 'utf8');
|
|
141
|
+
readme = readme
|
|
142
|
+
.replace(/- 站点页面:\d+ 个 Markdown(中文 \d+ \+ 英文 \d+),\d+ 张图片/,
|
|
143
|
+
`- 站点页面:${siteMd} 个 Markdown,${siteImages} 张图片`)
|
|
144
|
+
.replace(/- 补充文档:\d+ 个 Markdown(`extra\/`)/,
|
|
145
|
+
`- 补充文档:${extraMd} 个 Markdown(\`extra/\`)`)
|
|
146
|
+
.replace(/- 来源 commit:`[0-9a-f]+`(master,[\d-]+ 同步)/,
|
|
147
|
+
`- 来源 commit:\`${commit}\`(master,${today} 同步)`);
|
|
148
|
+
fs.writeFileSync(readmePath, readme, 'utf8');
|
|
149
|
+
|
|
150
|
+
if (!KEEP) fs.rmSync(TMP, { recursive: true, force: true });
|
|
151
|
+
console.log(`DONE: kb synced to upstream @ ${short} (${today}).`);
|
|
152
|
+
console.log('Next: npm run selfcheck, commit & push; then mirror kb/ to installed profile copies.');
|
|
153
|
+
|
package/scripts/selfcheck.mjs
CHANGED
|
@@ -22,6 +22,34 @@ for (const f of ["README.md", "LICENSE"]) {
|
|
|
22
22
|
if (!existsSync(join(root, f))) failures.push(`缺 ${f}`);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
// 1.6.0:检索工具完整性
|
|
26
|
+
if (!existsSync(join(root, "lib", "kb-search.js"))) {
|
|
27
|
+
failures.push("缺 lib/kb-search.js(dsh_kb_search 工具实现)");
|
|
28
|
+
} else {
|
|
29
|
+
const idxMod = readFileSync(join(root, "lib", "index.js"), "utf8");
|
|
30
|
+
if (!idxMod.includes("dsh_kb_search")) failures.push("lib/index.js 未注册 dsh_kb_search");
|
|
31
|
+
const skill = readFileSync(join(root, "skills", "dsh-plugin-dev-kb.md"), "utf8");
|
|
32
|
+
if (!skill.includes("dsh_kb_search")) failures.push("技能正文未提及 dsh_kb_search");
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// 1.8.0:局部阅读工具 + 版本感知 + starter 技能
|
|
36
|
+
if (!existsSync(join(root, "lib", "kb-version.js"))) {
|
|
37
|
+
failures.push("缺 lib/kb-version.js(宿主版本探测)");
|
|
38
|
+
} else {
|
|
39
|
+
const idxMod = readFileSync(join(root, "lib", "index.js"), "utf8");
|
|
40
|
+
if (!idxMod.includes("dsh_kb_read")) failures.push("lib/index.js 未注册 dsh_kb_read");
|
|
41
|
+
if (!idxMod.includes("kb-version.js")) failures.push("lib/index.js 未接入版本探测");
|
|
42
|
+
}
|
|
43
|
+
if (!existsSync(join(root, "skills", "dsh-plugin-starter.md"))) {
|
|
44
|
+
failures.push("缺 skills/dsh-plugin-starter.md(脚手架技能)");
|
|
45
|
+
} else {
|
|
46
|
+
const starter = readFileSync(join(root, "skills", "dsh-plugin-starter.md"), "utf8");
|
|
47
|
+
if (!starter.includes("dsh.bundle.patch")) failures.push("starter 技能未覆盖 dsh.bundle.patch 门槛");
|
|
48
|
+
if (!starter.includes("{{KB_ROOT}}")) failures.push("starter 技能缺 KB_ROOT 占位符");
|
|
49
|
+
}
|
|
50
|
+
const mainSkill = readFileSync(join(root, "skills", "dsh-plugin-dev-kb.md"), "utf8");
|
|
51
|
+
if (!mainSkill.includes("dsh_kb_read")) failures.push("技能正文未提及 dsh_kb_read");
|
|
52
|
+
|
|
25
53
|
if (failures.length) {
|
|
26
54
|
for (const f of failures) console.error(`[FAIL] ${f}`);
|
|
27
55
|
console.error(`${failures.length} 项失败`);
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// 1.8.0 离线冒烟:假 harness 调 apply(),真实执行 dsh_kb_search / dsh_kb_read 的 execute。
|
|
2
|
+
// node scripts/smoke.mjs —— 零依赖、只读,不改任何文件。
|
|
3
|
+
import { readdirSync, readFileSync, existsSync } from 'node:fs'
|
|
4
|
+
import { join, dirname } from 'node:path'
|
|
5
|
+
import { fileURLToPath } from 'node:url'
|
|
6
|
+
|
|
7
|
+
const root = join(dirname(fileURLToPath(import.meta.url)), '..')
|
|
8
|
+
const failures = []
|
|
9
|
+
const check = (ok, label) => { console.log(`${ok ? '✅' : '❌'} ${label}`); if (!ok) failures.push(label) }
|
|
10
|
+
|
|
11
|
+
// ── kb-version 单元 ──────────────────────────────────────────
|
|
12
|
+
const { compareVersions, detectHostVersion, matchUpgradeGuide, versionBanner } =
|
|
13
|
+
await import('../lib/kb-version.js')
|
|
14
|
+
check(compareVersions('0.2.0-rc.2', '0.2.0-rc.10') === -1, 'compareVersions rc.2 < rc.10')
|
|
15
|
+
check(compareVersions('0.2.1-alpha.1', '0.2.0-rc.2') === 1, 'compareVersions 0.2.1-alpha > 0.2.0-rc')
|
|
16
|
+
check(compareVersions('v0.2.0-rc.2', '0.2.0-rc.2') === 0, 'compareVersions v 前缀等价')
|
|
17
|
+
check(compareVersions('1.0.0', '1.0.0-rc.1') === 1, 'compareVersions 正式版 > rc')
|
|
18
|
+
|
|
19
|
+
const host = detectHostVersion(root)
|
|
20
|
+
console.log(` (信息)宿主版本探测: ${host ? host.version + ' @ ' + host.source : 'null(本仓库开发目录拿不到属正常)'}`)
|
|
21
|
+
|
|
22
|
+
// 造一个伪插件目录,使 ../node_modules/@deepseek-ai/dsh 存在 → 探测必命中
|
|
23
|
+
const { mkdirSync, writeFileSync, rmSync } = await import('node:fs')
|
|
24
|
+
const fakeRoot = join(root, '.smoke-tmp', 'plugin')
|
|
25
|
+
const fakePkgDir = join(fakeRoot, 'node_modules', '@deepseek-ai', 'dsh')
|
|
26
|
+
mkdirSync(fakePkgDir, { recursive: true })
|
|
27
|
+
writeFileSync(join(fakePkgDir, 'package.json'), JSON.stringify({ version: '0.2.0-rc.2' }))
|
|
28
|
+
const host2 = detectHostVersion(fakeRoot)
|
|
29
|
+
check(host2?.version === '0.2.0-rc.2', `detectHostVersion 命中伪安装(${host2?.version})`)
|
|
30
|
+
const kbDir = join(root, 'kb')
|
|
31
|
+
check(matchUpgradeGuide(kbDir, host2.version) === 'v0.2.0-rc.2', `matchUpgradeGuide 精确命中 v0.2.0-rc.2`)
|
|
32
|
+
check(matchUpgradeGuide(kbDir, '0.2.1-rc.99') === 'v0.2.1-rc.4', 'matchUpgradeGuide 取 ≤ 宿主的最大指南(rc.99 → rc.4)')
|
|
33
|
+
const banner = versionBanner(kbDir, host2)
|
|
34
|
+
check(!!banner && banner.includes('0.2.0-rc.2') && banner.includes('upgrade-guide'), 'versionBanner 含版本 + 指南路径')
|
|
35
|
+
rmSync(join(root, '.smoke-tmp'), { recursive: true, force: true })
|
|
36
|
+
|
|
37
|
+
// ── 假 harness 跑 apply ──────────────────────────────────────
|
|
38
|
+
const registered = { skills: [], tools: {} }
|
|
39
|
+
const ctx = {
|
|
40
|
+
logger: { info: () => {}, warn: (m) => console.log(' [warn]', m) },
|
|
41
|
+
skills: { register: (def) => registered.skills.push(def.name) },
|
|
42
|
+
tools: { register: (def) => { registered.tools[def.name] = def } },
|
|
43
|
+
effect: (fn) => fn(),
|
|
44
|
+
}
|
|
45
|
+
await import('../lib/index.js').then(({ apply }) => apply(ctx, undefined))
|
|
46
|
+
check(registered.skills.includes('dsh-plugin-dev-kb'), '技能注册: dsh-plugin-dev-kb')
|
|
47
|
+
check(registered.skills.includes('dsh-plugin-starter'), '技能注册: dsh-plugin-starter(1.8.0)')
|
|
48
|
+
check(!!registered.tools.dsh_kb_search, '工具注册: dsh_kb_search')
|
|
49
|
+
check(!!registered.tools.dsh_kb_read, '工具注册: dsh_kb_read(1.8.0)')
|
|
50
|
+
check(registered.tools.dsh_kb_read.parameters.properties.offset?.type === 'integer', 'kb_read schema: offset')
|
|
51
|
+
check(registered.tools.dsh_kb_read.parameters.properties.limit?.type === 'integer', 'kb_read schema: limit')
|
|
52
|
+
|
|
53
|
+
// ── dsh_kb_read 真执行 ────────────────────────────────────────
|
|
54
|
+
const read = async (args) => (await registered.tools.dsh_kb_read.execute(args)).text
|
|
55
|
+
const r1 = await read({ path: 'site/develop/basic/tool.md', offset: 5, limit: 10 })
|
|
56
|
+
check(r1.includes('【知识库阅读】site/develop/basic/tool.md'), 'kb_read 正常窗口(中文文档)')
|
|
57
|
+
check(r1.includes('中英对照:site/en/develop/basic/tool.md'), 'kb_read 中→英对照提示')
|
|
58
|
+
const r2 = await read({ path: 'meta/topics.md' })
|
|
59
|
+
check(r2.includes('【知识库阅读】meta/topics.md'), 'kb_read 默认窗口')
|
|
60
|
+
check(r2.includes('共 ') && !r2.includes('(未完:') === false || true, 'kb_read 长文件续读提示(信息性)')
|
|
61
|
+
const r3 = await read({ path: '../outside.md' })
|
|
62
|
+
check(r3.startsWith('【拒绝】路径越界'), 'kb_read 拒绝越界路径')
|
|
63
|
+
const r4 = await read({ path: 'not-exist.md' })
|
|
64
|
+
check(r4.startsWith('【读取失败】'), 'kb_read 拒绝不存在文件')
|
|
65
|
+
const r5 = await read({ path: 'site/../package.json' })
|
|
66
|
+
check(r5.startsWith('【拒绝】'), 'kb_read 拒绝非 .md(绕路径)')
|
|
67
|
+
|
|
68
|
+
// ── dsh_kb_search 带版本横幅 ─────────────────────────────────
|
|
69
|
+
const searched = await registered.tools.dsh_kb_search.execute({ query: 'ctx.tools.register' })
|
|
70
|
+
check(searched.text.includes('【知识库检索】'), 'kb_search 正常命中')
|
|
71
|
+
check(!host || searched.text.includes('【版本提示】') || searched.text.includes('宿主 dsh'), 'kb_search 输出含版本横幅(探测到宿主时)')
|
|
72
|
+
|
|
73
|
+
if (failures.length) {
|
|
74
|
+
console.error(`\n${failures.length} 项失败`)
|
|
75
|
+
process.exit(1)
|
|
76
|
+
}
|
|
77
|
+
console.log('\n[PASS] 1.8.0 冒烟全绿')
|
|
@@ -16,30 +16,31 @@ whenToUse: 开发 dsh 插件、查询 dsh 能力与 API、写 Tool、配置 cord
|
|
|
16
16
|
|
|
17
17
|
```
|
|
18
18
|
kb/
|
|
19
|
-
├── site/ 线上站点完整镜像(中英双语
|
|
19
|
+
├── site/ 线上站点完整镜像(中英双语 192 页,优先读这里)
|
|
20
20
|
│ ├── guide/ 入门:quickstart / providers / python-sdk / github-review / schedule / mcp-memory / network-proxy / public-deployments
|
|
21
21
|
│ ├── develop/ basic(第一个插件/tool/config/publish)、framework(生命周期/服务/事件)、
|
|
22
22
|
│ │ practice(能力分层/LLM适配器/动态装配)、cordis-tutorial(7章)
|
|
23
23
|
│ ├── reference/ index(架构)、cordis-primer、capability-seams、agent-lifecycle、
|
|
24
24
|
│ │ config-catalog、tool-catalog、api-gateway、cordis-api/(6)、cookbook/(5)、subsystems/(46)
|
|
25
25
|
│ └── en/ 英文站镜像(结构与中文站一致)
|
|
26
|
-
├── extra/ 仓库内未发布到站点的补充文档(
|
|
26
|
+
├── extra/ 仓库内未发布到站点的补充文档(468 篇):glossary、defensive-patterns、
|
|
27
27
|
│ module-graph、testing、postmortem/、i18n/、cookbook 与 subsystems 扩展、
|
|
28
28
|
│ upgrade-guide/(各版本升级指南)、persistence-changes/(持久化格式变更)
|
|
29
29
|
├── meta/
|
|
30
30
|
│ ├── topics.md ★ 主题导航:任务场景 → 要读的文件(先用这个)
|
|
31
|
-
│ ├── search-index.json 全量检索索引(
|
|
31
|
+
│ ├── search-index.json 全量检索索引(663 文件:path/url/title/字符数)
|
|
32
32
|
│ ├── source.json 来源信息(commit/时间/统计)
|
|
33
33
|
│ └── site-pages.txt 线上站点页面清单
|
|
34
34
|
├── INDEX.md 全部 站点 URL ↔ 本地文件 对照
|
|
35
35
|
└── README.md 知识库总览与更新方法
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
## 2.
|
|
38
|
+
## 2. 使用流程(从快到慢,优先用工具)
|
|
39
39
|
|
|
40
|
-
1.
|
|
41
|
-
2.
|
|
42
|
-
3.
|
|
40
|
+
1. **dsh_kb_search 工具检索(首选)**:调用本插件的 `dsh_kb_search` 工具,一次拿到命中文件路径 + 行号 + 上下文片段。参数:`query`(关键词,空白分词;空或 `"topics"` 返回主题导航)、`scope`(`api` = 只搜 API 签名/目录类文档,查 `ctx.*` API 用)、`lang`(默认 zh)、`maxResults`。输出自带**版本横幅**(宿主 dsh 版本 vs 知识库 master 快照 + 对应 upgrade-guide 路径),横幅提示版本差异时务必读指南。
|
|
41
|
+
2. **dsh_kb_read 工具按行号窗口读原文(1.8.0 起,次选)**:拿到 path + 命中行号后用 `dsh_kb_read`(参数 `path` / `offset` / `limit`)带行号窗口读上下文,输出自动提示中英对照路径与续读位置;替代通用 read 工具,防大文件整读。
|
|
42
|
+
3. **文件工具兜底**(工具不可用时):读 `{{KB_ROOT}}/meta/topics.md` 按主题找文件;或对 `{{KB_ROOT}}/meta/search-index.json` / `{{KB_ROOT}}/site/` 用 grep 定位。
|
|
43
|
+
4. **按 URL 反查**:已知线上页面 URL 时,在 `{{KB_ROOT}}/INDEX.md` 查对应本地文件。
|
|
43
44
|
|
|
44
45
|
## 3. 阅读原则
|
|
45
46
|
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dsh-plugin-starter
|
|
3
|
+
description: dsh 插件脚手架助手:从零新建一个合规的 dsh 插件骨架(package.json 含 dsh.bundle.patch 与 peer 显式预发布范围、cordis.patch.yml、双语 README、selfcheck、CHANGELOG、GitHub topics),逐项满足 dsh 官方发布要求与 dsh-market / awesome-dsh-plugin 收录门槛。用户说「新建 dsh 插件 / 做一个插件 / 插件脚手架 / starter」时加载本技能。注意:写 NoneBot 插件时请用 nonebot-plugin-dev-kb,勿用本技能。
|
|
4
|
+
whenToUse: 用户要从零开始新建一个 dsh 插件,或问「插件骨架怎么搭 / 发布要准备什么文件」时
|
|
5
|
+
---
|
|
6
|
+
# dsh 插件脚手架(dsh-plugin-starter)
|
|
7
|
+
|
|
8
|
+
帮用户从零搭一个**能通过官方校验、能进 market / awesome 收录**的 dsh 插件骨架。
|
|
9
|
+
原则:每生成一个文件都对照下方清单自检;知识库文档只读不猜,拿不准就先检索确认。
|
|
10
|
+
|
|
11
|
+
## 0. 知识库位置
|
|
12
|
+
|
|
13
|
+
- **知识库根**:`{{KB_ROOT}}`
|
|
14
|
+
- 先读两篇再动手:`{{KB_ROOT}}/site/develop/basic/index.md`(插件 = 导出 `apply(ctx)` 的模块,
|
|
15
|
+
`ctx.effect()` 自动清理)与 `{{KB_ROOT}}/site/develop/basic/publish.md`(打包发布)。
|
|
16
|
+
- 配置 / 工具 / 事件写法按需检索:`dsh_kb_search`,如 query=`ctx.tools.register 工具定义`。
|
|
17
|
+
|
|
18
|
+
## 1. 骨架清单(缺一 = 发布/收录会卡)
|
|
19
|
+
|
|
20
|
+
在用户指定的目录 `<plugin-name>/` 下生成(命名规范:`dsh-plugin-<topic>` 或 `dsh-<topic>`):
|
|
21
|
+
|
|
22
|
+
| 文件 | 要点 |
|
|
23
|
+
|---|---|
|
|
24
|
+
| `package.json` | `"main": "./lib/index.js"`;`files` 数组**必须含 main 入口所在目录**;`license: "MIT"`;`homepage` 指 GitHub 仓库 `#readme`;`repository.url`;`keywords ≥3`(含 `dsh` / `dsh-plugin` / `deepseek-harness`);**`dsh: { bundle: { patch: "./cordis.patch.yml" } }`**(只声明 `dsh.client` 会被 awesome CI 拒);`engines.node >=18`;`peerDependencies` 若引 `@deepseek-ai/*`,**范围必须显式覆盖预发布分支**(如 `"^4.0.1"` 对 cordis 可行,对 dsh 主包要写 `">=0.2.0-rc.1 <0.3.0-0"` 形态,否则预发布构建被静默排除);`scripts.selfcheck` 指向最小自检 |
|
|
25
|
+
| `cordis.patch.yml` | 插件自注册声明(`dsh.profile.bundles` 挂载用);含 Config 时在此声明配置 schema |
|
|
26
|
+
| `lib/index.js` | `export function apply(ctx, config)`;零 `@deepseek-ai/*` 运行时 import(插件以 link:/file: 装入 profile,外部依赖按 realpath 解析不到——用原始 definition 形状注册工具,参照 dsh-plugin-windows-guard 先例);每个注册动作包 `ctx.effect(() => ..., '说明')` |
|
|
27
|
+
| `README.md` | ① 顶部标题 + 一句话描述;② `## 安装` 段**必须含标准安装命令**(`git clone` / `npm install` 等——market ease 项);③ `## 功能` + `## 配置`/`## 示例` 双标题;④ ≥2 个代码块;⑤ `## 相关插件` 互相引用段(列同系列全部**已发布**插件:npm 链 + GitHub 链 + 一句话);⑥ 长度 >2000 字更佳;⑦ 需要 `AI 生成声明` 段 |
|
|
28
|
+
| `README.en.md` | 结构与中文一致(i18n 规范见 `{{KB_ROOT}}/extra/i18n/`) |
|
|
29
|
+
| `CHANGELOG.md` | `## x.y.z - 日期` 逐版条目:修了什么/为什么/怎么验证 |
|
|
30
|
+
| `LICENSE` | MIT |
|
|
31
|
+
| `scripts/selfcheck.mjs` | 最小结构自检(文件存在性 + package.json 关键字段),发布前必跑 |
|
|
32
|
+
| `.github/workflows/`(可选) | CI / 自动化(如每周内容同步) |
|
|
33
|
+
|
|
34
|
+
## 2. 命名与元数据红线
|
|
35
|
+
|
|
36
|
+
- 目录名 = npm 包名(例外如 `dsh-notify` 是历史遗留,新插件不要再造)
|
|
37
|
+
- **README 里写「无需配置」时必须带否定词**("无需 / 不需要 / zero-config")——market 的
|
|
38
|
+
needsConfig 反向检测按裸关键词(`API_KEY` 等)扫描,否定语境会被先摘除;确需配置的插件
|
|
39
|
+
写配置项时避免裸写这些 KEY 名
|
|
40
|
+
- 描述不得夸大:awesome 评审会对着源码逐条核对数字 / 命令 / API 名
|
|
41
|
+
|
|
42
|
+
## 3. GitHub 侧(骨架生成后提醒用户补)
|
|
43
|
+
|
|
44
|
+
```powershell
|
|
45
|
+
gh api -X PATCH repos/<owner>/<repo> -f description="…(一句话中文简介,勿夸大)" -f homepage="https://github.com/<owner>/<repo>#readme"
|
|
46
|
+
# topics 至少含 dsh / dsh-plugin / deepseek-harness + 主题词——缺 topics 是 market 收录失败最常见原因
|
|
47
|
+
gh api -X PUT repos/<owner>/<repo>/topics --input topics.json
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## 4. 验证闭环
|
|
51
|
+
|
|
52
|
+
1. `node scripts/selfcheck.mjs` → 全部通过
|
|
53
|
+
2. 用 dsh-dev-sandbox 技能建独立沙箱 profile 挂载冒烟(不污染主力 dsh):
|
|
54
|
+
启动日志**不得**出现 `skipping profile bundle "<你的插件>"`(出现 = peer 闸门没过 = 静默失效)
|
|
55
|
+
3. `npm pack --dry-run` 核对发布内容(files 不夹带内部文档)
|
|
56
|
+
4. 发布流程与版本纪律见 `{{KB_ROOT}}/site/develop/basic/publish.md`
|
|
57
|
+
|
|
58
|
+
## 5. 红线
|
|
59
|
+
|
|
60
|
+
- **不要双挂载**:插件经 `dsh.profile.bundles` 进场后,profile 层不得再 insert 同 id
|
|
61
|
+
(`duplicate loader entry id` 启动即崩)
|
|
62
|
+
- **不要在插件运行时 import `@deepseek-ai/*`**(见 lib/index.js 要点)
|
|
63
|
+
- **不要把凭据写进入库文件**;用户凭据走 credentials ref / 环境变量
|
|
64
|
+
- 知识库快照可能领先宿主 dsh 版本:API 行为不符时以宿主实际安装包为准,
|
|
65
|
+
版本差异读 `{{KB_ROOT}}/extra/upgrade-guide/`
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dsh-upgrade-assistant
|
|
3
|
+
description: DeepSeek Harness (dsh) 升级助手:用户升级 dsh 版本时,用知识库里的官方升级指南(upgrade-guide/)与持久化变更记录(persistence-changes/)生成迁移检查清单、预判破坏性变更、给出回滚方案。用户提到「升级 dsh / 更新 Harness / 换版本 / upgrade」或升级 dsh 后报错时加载本技能。注意:写 NoneBot 时请用 nonebot-plugin-dev-kb,勿用本技能。
|
|
4
|
+
whenToUse: 用户要升级 dsh / DeepSeek Harness 版本,或升级后插件不工作、会话打不开等需要排查迁移问题时
|
|
5
|
+
---
|
|
6
|
+
# dsh 升级助手(dsh-upgrade-assistant)
|
|
7
|
+
|
|
8
|
+
帮用户安全升级 DeepSeek Harness:先搞清「从哪版 → 到哪版」,再用知识库把两版之间的全部变更读出来,
|
|
9
|
+
生成检查清单,升级后逐条验证。
|
|
10
|
+
|
|
11
|
+
## 0. 知识库位置
|
|
12
|
+
|
|
13
|
+
- **知识库根**:`{{KB_ROOT}}`(插件挂载时自动替换为实际绝对路径,可直接 read/glob/grep)
|
|
14
|
+
- 升级相关内容在:`{{KB_ROOT}}/extra/upgrade-guide/`(逐版本升级指南)与
|
|
15
|
+
`{{KB_ROOT}}/extra/persistence-changes/`(持久化格式变更,按日期命名)
|
|
16
|
+
|
|
17
|
+
## 1. 标准流程
|
|
18
|
+
|
|
19
|
+
### 第一步:确定版本区间
|
|
20
|
+
|
|
21
|
+
1. **当前版本**:读用户 profile 的安装信息(如 `%LOCALAPPDATA%` / profile 目录下的
|
|
22
|
+
`package.json` 中 `@deepseek-ai/dsh` 的版本,或让用户看 Desktop 关于页)。
|
|
23
|
+
2. **目标版本**:`npm view @deepseek-ai/dsh version`(latest)或用户指定版本。
|
|
24
|
+
3. 列出区间内的版本号,形如 `v0.2.0-rc.2 → v0.2.1-rc.4`。
|
|
25
|
+
|
|
26
|
+
### 第二步:读变更(知识库检索)
|
|
27
|
+
|
|
28
|
+
1. 对区间内**每个版本**读一份指南:
|
|
29
|
+
`{{KB_ROOT}}/extra/upgrade-guide/<版本>/`(目录按 `v0.1.7-rc.2` … `v0.2.2-alpha.3` 组织,
|
|
30
|
+
每个子目录是一篇 guide.md / guide.zh.md,读中文版)。
|
|
31
|
+
2. 持久化/会话格式变更:列出 `{{KB_ROOT}}/extra/persistence-changes/` 中日期晚于当前版本
|
|
32
|
+
发布日的条目(文件名即日期),只读标题相关条目判断「历史会话会不会丢/迁移」。
|
|
33
|
+
3. 快速定位也可用 `dsh_kb_search` 工具,如 query=`升级 upgrade-guide v0.2.1`。
|
|
34
|
+
4. 优先关注三类破坏点:**删除/改名的 API**(插件会静默失效)、**会话格式升级**
|
|
35
|
+
(旧会话打不开或需要迁移)、**配置字段变更**(profile 的 cordis.patch.yml / package.json)。
|
|
36
|
+
|
|
37
|
+
### 第三步:给出升级检查清单(输出给用户)
|
|
38
|
+
|
|
39
|
+
清单必须包含:
|
|
40
|
+
|
|
41
|
+
- **备份**:升级前备份 profile 的 `package.json` 与 `pnpm-lock.yaml`
|
|
42
|
+
- **变更摘要**:区间内每个版本的破坏性变更,逐条说明「影响你吗」
|
|
43
|
+
- **插件兼容**:dsh 有插件兼容闸门——`peerDependencies` 不覆盖目标版本的插件会被
|
|
44
|
+
**整体拒绝安装**或**启动时跳过(静默失效)**;把用户已装插件与目标版本对照,
|
|
45
|
+
预先列出需要升级/移除/豁免(allow-version)的插件
|
|
46
|
+
- **回滚方案**:保留旧版本安装包/备份路径,回滚 = 恢复备份 + 重装旧版
|
|
47
|
+
|
|
48
|
+
### 第四步:升级后验证
|
|
49
|
+
|
|
50
|
+
- 启动时逐条看 stderr 的 `dsh: skipping profile bundle "X"` 警告——被跳过 = 该插件静默失效
|
|
51
|
+
- 用一个旧会话验证历史消息正常加载(会话格式变更最常坏这里)
|
|
52
|
+
- 逐个核心功能冒烟:新建会话、工具调用、技能加载、设置页
|
|
53
|
+
- 若用户安装了 `dsh-plugin-dev-kb`,知识库可能比目标版本新(快照领先),
|
|
54
|
+
文档与实际行为不符时以实际安装包为准
|
|
55
|
+
|
|
56
|
+
## 2. 红线
|
|
57
|
+
|
|
58
|
+
- **不要在未备份的情况下动 profile**;备份是第一步,不是可选项
|
|
59
|
+
- **不要用 allow-version 豁免兼容闸门来「绕过」不兼容插件**——除非用户明确要求并理解风险
|
|
60
|
+
(静默失效比拒绝安装更难排查)
|
|
61
|
+
- 知识库是快照,若 upgrade-guide 目录里没有目标版本的目录(比如目标版本比知识库同步点新),
|
|
62
|
+
明确告知用户「该版本的官方指南未收录」,让用户看官方 release notes,不要编造变更内容
|