@songtonyli/dsh-cli 0.1.76 → 0.1.78
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/README.md +1 -1
- package/bin/dsh.mjs +1 -1
- package/node_modules/@deepseek-ai/cordis/package.json +4 -4
- package/node_modules/@deepseek-ai/cordis-plugin-group/package.json +3 -3
- package/node_modules/@deepseek-ai/cordis-plugin-include/package.json +4 -4
- package/node_modules/@deepseek-ai/cordis-plugin-loader/package.json +4 -4
- package/node_modules/@deepseek-ai/cordis-plugin-timer/package.json +3 -3
- package/node_modules/@deepseek-ai/cosmokit/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh/package.json +122 -121
- package/node_modules/@deepseek-ai/dsh-acp/package.json +26 -26
- package/node_modules/@deepseek-ai/dsh-acp-app/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-agent/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-agent-default-model/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-agent-instructions/package.json +28 -28
- package/node_modules/@deepseek-ai/dsh-agent-loop/package.json +25 -25
- package/node_modules/@deepseek-ai/dsh-agent-preset/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-agent-preset/skills/cordis-composition-reference/references/packages.md +5 -1
- package/node_modules/@deepseek-ai/dsh-agent-preset-registry/package.json +34 -34
- package/node_modules/@deepseek-ai/dsh-agent-tool-presentation/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-anonymous-user-id/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-api-account-controller/lib/typert.host.js +7 -6
- package/node_modules/@deepseek-ai/dsh-api-account-controller/lib/typert.remote-client.js +7 -6
- package/node_modules/@deepseek-ai/dsh-api-account-controller/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-api-authorization-controller/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-api-gateway/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-api-job-controller/package.json +12 -13
- package/node_modules/@deepseek-ai/dsh-api-remote-access/package.json +9 -10
- package/node_modules/@deepseek-ai/dsh-api-remotes/lib/client.js +490 -62
- package/node_modules/@deepseek-ai/dsh-api-remotes/lib/index.js +4 -0
- package/node_modules/@deepseek-ai/dsh-api-remotes/lib/types/client/index.js +3 -1
- package/node_modules/@deepseek-ai/dsh-api-remotes/lib/types/remote-events.js +1 -0
- package/node_modules/@deepseek-ai/dsh-api-remotes/package.json +44 -43
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.host.js +1 -1
- package/node_modules/@deepseek-ai/dsh-api-session-controller/package.json +75 -76
- package/node_modules/@deepseek-ai/dsh-api-settings-controller/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-api-terminal-controller/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-api-terminal-controller/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-api-terminal-controller/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-api-terminal-controller/lib/client.js +166 -21
- package/node_modules/@deepseek-ai/dsh-api-terminal-controller/lib/types/client/index.js +36 -9
- package/node_modules/@deepseek-ai/dsh-api-terminal-controller/lib/types/client/inventory.js +101 -0
- package/node_modules/@deepseek-ai/dsh-api-terminal-controller/lib/types/client/model.js +23 -7
- package/node_modules/@deepseek-ai/dsh-api-terminal-controller/package.json +22 -22
- package/node_modules/@deepseek-ai/dsh-api-workspace-controller/package.json +21 -22
- package/node_modules/@deepseek-ai/dsh-api-workspace-files/package.json +15 -16
- package/node_modules/@deepseek-ai/dsh-app-boot/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-app-boot/README.md +2 -2
- package/node_modules/@deepseek-ai/dsh-app-boot/README.zh.md +2 -2
- package/node_modules/@deepseek-ai/dsh-app-boot/lib/index.js +40 -26
- package/node_modules/@deepseek-ai/dsh-app-boot/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-atomic-write/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-attachment/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-attachment-local/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-authorization/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-base/cordis.patch.yml +8 -1
- package/node_modules/@deepseek-ai/dsh-base/package.json +98 -97
- package/node_modules/@deepseek-ai/dsh-bash-local/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-bash-sandbox/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-brand/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-chunked-list/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-client-connection/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-client-file-upload/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-client-hmr/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-hmr/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-hmr/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-hmr/lib/client.js +237 -11
- package/node_modules/@deepseek-ai/dsh-client-hmr/package.json +8 -7
- package/node_modules/@deepseek-ai/dsh-client-locale/package.json +10 -13
- package/node_modules/@deepseek-ai/dsh-client-modules/README.i18n.yaml +10 -7
- package/node_modules/@deepseek-ai/dsh-client-modules/README.md +8 -2
- package/node_modules/@deepseek-ai/dsh-client-modules/README.zh.md +9 -2
- package/node_modules/@deepseek-ai/dsh-client-modules/lib/client.js +136 -6
- package/node_modules/@deepseek-ai/dsh-client-modules/lib/index.js +25 -6
- package/node_modules/@deepseek-ai/dsh-client-modules/package.json +6 -7
- package/node_modules/@deepseek-ai/dsh-client-product-analytics/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-client-product-analytics/README.md +22 -4
- package/node_modules/@deepseek-ai/dsh-client-product-analytics/README.zh.md +22 -4
- package/node_modules/@deepseek-ai/dsh-client-product-analytics/lib/index.js +238 -6
- package/node_modules/@deepseek-ai/dsh-client-product-analytics/lib/typert.host.js +6 -6
- package/node_modules/@deepseek-ai/dsh-client-product-analytics/lib/typert.remote-client.js +4 -4
- package/node_modules/@deepseek-ai/dsh-client-product-analytics/package.json +16 -15
- package/node_modules/@deepseek-ai/dsh-client-resources/package.json +5 -7
- package/node_modules/@deepseek-ai/dsh-client-shortcuts/package.json +9 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-agent-preset/package.json +16 -19
- package/node_modules/@deepseek-ai/dsh-client-ui-approval/package.json +13 -15
- package/node_modules/@deepseek-ai/dsh-client-ui-attachment/package.json +10 -12
- package/node_modules/@deepseek-ai/dsh-client-ui-brand-official/package.json +5 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/package.json +37 -40
- package/node_modules/@deepseek-ai/dsh-client-ui-commands/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-commands/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-commands/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-commands/lib/client.js +16 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-commands/package.json +14 -17
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.md +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.zh.md +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/client.js +356 -124
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/package.json +33 -36
- package/node_modules/@deepseek-ai/dsh-client-ui-cordis/package.json +13 -15
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/README.i18n.yaml +37 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/README.md +91 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/README.zh.md +91 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/lib/client.js +75 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/lib/index.js +6 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-deepseek-model-label-1017/package.json +59 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/package.json +27 -30
- package/node_modules/@deepseek-ai/dsh-client-ui-directory-picker-browse/package.json +7 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-directory-picker-native/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-goal/package.json +14 -16
- package/node_modules/@deepseek-ai/dsh-client-ui-input-trigger/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-input-trigger/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-input-trigger/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-input-trigger/lib/client.js +18 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-input-trigger/package.json +11 -14
- package/node_modules/@deepseek-ai/dsh-client-ui-jobs/package.json +10 -12
- package/node_modules/@deepseek-ai/dsh-client-ui-layout/package.json +9 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-message-feedback/package.json +15 -18
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/README.i18n.yaml +3 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/README.md +8 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/README.zh.md +8 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/lib/client.js +34 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/package.json +15 -18
- package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/package.json +18 -21
- package/node_modules/@deepseek-ai/dsh-client-ui-permission-presets/package.json +14 -17
- package/node_modules/@deepseek-ai/dsh-client-ui-plan/package.json +19 -22
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/README.i18n.yaml +5 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/README.md +4 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/README.zh.md +4 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/client.js +314 -85
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/package.json +16 -19
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-market/README.i18n.yaml +34 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-market/README.md +72 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-market/README.zh.md +72 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-market/lib/client.js +1637 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-market/lib/index.js +6 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-market/package.json +62 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-reference/package.json +15 -17
- package/node_modules/@deepseek-ai/dsh-client-ui-renderer/package.json +3 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-schedule/package.json +19 -21
- package/node_modules/@deepseek-ai/dsh-client-ui-secret-mask/package.json +6 -7
- package/node_modules/@deepseek-ai/dsh-client-ui-session/package.json +9 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-settings/package.json +7 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-account/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-account/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-account/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/client.js +117 -66
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-account/package.json +16 -19
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-agent-loop/package.json +8 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/README.i18n.yaml +5 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/README.md +6 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/README.zh.md +6 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/client.js +176 -39
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/package.json +18 -17
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/README.md +3 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/README.zh.md +3 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/lib/client.js +324 -36
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/package.json +11 -14
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugin-inventory/package.json +11 -14
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/package.json +7 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-session-log/package.json +8 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-shell/package.json +8 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-signin/package.json +6 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-subagent/package.json +8 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/README.i18n.yaml +10 -10
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/README.md +9 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/README.zh.md +9 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/lib/client.js +266 -63
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/lib/index.js +3 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/package.json +8 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-shortcuts/package.json +9 -12
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/package.json +11 -14
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-browser/package.json +10 -13
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/package.json +18 -21
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/package.json +13 -16
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/package.json +14 -17
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-terminal/package.json +14 -17
- package/node_modules/@deepseek-ai/dsh-client-ui-skill/README.i18n.yaml +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-skill/README.md +5 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-skill/README.zh.md +5 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-skill/lib/client.js +1 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-skill/package.json +16 -17
- package/node_modules/@deepseek-ai/dsh-client-ui-subagent/package.json +17 -19
- package/node_modules/@deepseek-ai/dsh-client-ui-theme/package.json +12 -15
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/lib/client.js +75 -25
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/package.json +27 -29
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/package.json +16 -19
- package/node_modules/@deepseek-ai/dsh-client-ui-user-questions/package.json +20 -23
- package/node_modules/@deepseek-ai/dsh-client-ui-workflow-run/package.json +13 -16
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/package.json +25 -28
- package/node_modules/@deepseek-ai/dsh-cmdline/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-command-compact/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-command-feedback/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-command-goal/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-commands/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-compaction/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-compaction-basic/package.json +26 -26
- package/node_modules/@deepseek-ai/dsh-compaction-image-offload/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-compaction-tool-result-pruner/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-config-editor/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-cordis-client-runner/lib/client.js +95 -8
- package/node_modules/@deepseek-ai/dsh-cordis-client-runner/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-cordis-host-runner/package.json +22 -22
- package/node_modules/@deepseek-ai/dsh-credentials/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-credentials-local/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-deepseek-account/package.json +11 -9
- package/node_modules/@deepseek-ai/dsh-deepseek-account-platform/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-deepseek-account-platform/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-deepseek-account-platform/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-deepseek-account-platform/lib/index.js +15 -13
- package/node_modules/@deepseek-ai/dsh-deepseek-account-platform/lib/types/details.js +10 -4
- package/node_modules/@deepseek-ai/dsh-deepseek-account-platform/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-deepseek-llm-api-extensions/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-deque/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/package.json +22 -22
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-experimental-api-speech-to-text/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/package.json +43 -43
- package/node_modules/@deepseek-ai/dsh-experimental-badge-skill-bundle/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-agent-team/package.json +11 -24
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-cot-translation/package.json +21 -29
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-voice-input/package.json +15 -33
- package/node_modules/@deepseek-ai/dsh-experimental-cot-translation-bundle/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/index.js +70 -17
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/lib/worker.js +16 -12
- package/node_modules/@deepseek-ai/dsh-experimental-inspector/package.json +18 -24
- package/node_modules/@deepseek-ai/dsh-experimental-inspector-profile/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/README.i18n.yaml +34 -0
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/README.md +68 -0
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/README.zh.md +68 -0
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/cordis.patch.yml +10 -0
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/icon.svg +9 -0
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/lib/index.js +1 -0
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-plugin-market-bundle/package.json +50 -0
- package/node_modules/@deepseek-ai/dsh-experimental-ralph-bundle/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-experimental-session-inspector/package.json +12 -15
- package/node_modules/@deepseek-ai/dsh-experimental-session-search/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-experimental-session-titles-bundle/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text-sensevoice/lib/worker.js +26 -12
- package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text-sensevoice/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-experimental-terminal-bundle/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-experimental-tool-agent-team/package.json +25 -25
- package/node_modules/@deepseek-ai/dsh-experimental-tool-worktree/package.json +22 -22
- package/node_modules/@deepseek-ai/dsh-experimental-translator/package.json +29 -29
- package/node_modules/@deepseek-ai/dsh-experimental-voice-input-bundle/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-experimental-worktree/package.json +24 -24
- package/node_modules/@deepseek-ai/dsh-file-reference/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-file-reference-local/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-fs/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-fs-local/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-fs-observation-policy/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-fs-sandbox/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-goal/package.json +23 -23
- package/node_modules/@deepseek-ai/dsh-goal-round-driver/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-harness-dev-context/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-headless/package.json +24 -24
- package/node_modules/@deepseek-ai/dsh-hmr/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-home-paths/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-host-directory-picker/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-auto/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-browse/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-native/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-host-frontend-static/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-host-open-in-app/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-host-plugin-inventory/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-host-product-telemetry-otel/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-host-webserver/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-http-proxy/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-jobs/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-jobs-local/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-launch-environment/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-lazy-require/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-llm/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-llm-cursor/package.json +25 -25
- package/node_modules/@deepseek-ai/dsh-llm-deepseek/package.json +44 -44
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-account/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-api-key/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-llm-pi-ai/package.json +26 -26
- package/node_modules/@deepseek-ai/dsh-llm-retry/package.json +24 -24
- package/node_modules/@deepseek-ai/dsh-mcp-client/package.json +23 -23
- package/node_modules/@deepseek-ai/dsh-mcp-resources/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-message-feedback/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-native-command/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-no-progress-reminder/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-office-to-pdf/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-otel/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-output-retention/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-package-manifest/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-permission-presets/package.json +21 -21
- package/node_modules/@deepseek-ai/dsh-persona/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-plan-mode/package.json +22 -22
- package/node_modules/@deepseek-ai/dsh-plugin-manager/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-plugin-manager/README.md +2 -2
- package/node_modules/@deepseek-ai/dsh-plugin-manager/README.zh.md +2 -2
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/index.js +4 -3
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/typert.host.js +14 -14
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/typert.remote-client.js +13 -13
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/failure.js +2 -2
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/operations.js +3 -3
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/tools.js +1 -1
- package/node_modules/@deepseek-ai/dsh-plugin-manager/package.json +33 -33
- package/node_modules/@deepseek-ai/dsh-plugin-market/README.i18n.yaml +43 -0
- package/node_modules/@deepseek-ai/dsh-plugin-market/README.md +117 -0
- package/node_modules/@deepseek-ai/dsh-plugin-market/README.zh.md +117 -0
- package/node_modules/@deepseek-ai/dsh-plugin-market/lib/index.js +661 -0
- package/node_modules/@deepseek-ai/dsh-plugin-market/lib/typert.host.js +407 -0
- package/node_modules/@deepseek-ai/dsh-plugin-market/lib/typert.remote-client.js +259 -0
- package/node_modules/@deepseek-ai/dsh-plugin-market/lib/types/index-url.js +27 -0
- package/node_modules/@deepseek-ai/dsh-plugin-market/lib/types/index.js +351 -0
- package/node_modules/@deepseek-ai/dsh-plugin-market/lib/types/parse-thread.js +61 -0
- package/node_modules/@deepseek-ai/dsh-plugin-market/lib/types/parse.js +36 -0
- package/node_modules/@deepseek-ai/dsh-plugin-market/lib/types/search.js +135 -0
- package/node_modules/@deepseek-ai/dsh-plugin-market/lib/types/tools.js +128 -0
- package/node_modules/@deepseek-ai/dsh-plugin-market/lib/types/types.js +2 -0
- package/node_modules/@deepseek-ai/dsh-plugin-market/lib/types/worker.js +8 -0
- package/node_modules/@deepseek-ai/dsh-plugin-market/lib/worker.cjs +1759 -0
- package/node_modules/@deepseek-ai/dsh-plugin-market/package.json +89 -0
- package/node_modules/@deepseek-ai/dsh-plugin-market-index/README.i18n.yaml +34 -0
- package/node_modules/@deepseek-ai/dsh-plugin-market-index/README.md +74 -0
- package/node_modules/@deepseek-ai/dsh-plugin-market-index/README.zh.md +74 -0
- package/node_modules/@deepseek-ai/dsh-plugin-market-index/lib/index.js +320 -0
- package/node_modules/@deepseek-ai/{dsh-client-ui-slots → dsh-plugin-market-index}/package.json +15 -12
- package/node_modules/@deepseek-ai/dsh-plugin-package-inventory-deepseek/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-ptc-runtime/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/package.json +23 -23
- package/node_modules/@deepseek-ai/dsh-pwsh-local/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-pwsh-sandbox/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-repeat-tool-reminder/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-sandbox/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-sandbox-apple-container/package.json +25 -25
- package/node_modules/@deepseek-ai/dsh-sandbox-local/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-sandbox-policy/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-schedule/package.json +34 -34
- package/node_modules/@deepseek-ai/dsh-scope/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-sdk-app/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-sdk-app/README.md +2 -2
- package/node_modules/@deepseek-ai/dsh-sdk-app/README.zh.md +2 -2
- package/node_modules/@deepseek-ai/dsh-sdk-app/cordis.patch.yml +5 -0
- package/node_modules/@deepseek-ai/dsh-sdk-app/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/package.json +27 -27
- package/node_modules/@deepseek-ai/dsh-sdk-minimal/package.json +37 -37
- package/node_modules/@deepseek-ai/dsh-sdk-protocol/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-session/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-session-checkpoint-policy/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-session-format/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-session-format-catalog/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-session-format-v0-to-v1/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-session-format-v1-to-v2/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-session-format-v2-to-v3/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-session-format-v3-to-v4/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-session-log-deepseek/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-session-log-export/package.json +22 -25
- package/node_modules/@deepseek-ai/dsh-session-persistence/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-session-projection/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-session-projection-cache/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-session-query/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-session-query-sqlite/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-session-reference/package.json +40 -40
- package/node_modules/@deepseek-ai/dsh-session-stats/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-session-telemetry/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-session-telemetry-otel/package.json +25 -25
- package/node_modules/@deepseek-ai/dsh-session-title/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-session-title-all-prompts-llm/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-session-title-first-prompt-llm/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-session-title-llm/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-session-turn-outline/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-settings/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-shell/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-shell-env/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-skill/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-skill-badge/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-skill-filesystem/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-skill-office/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-skill-office/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-skill-office/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-skill-office/assets/office-export-pdf/SKILL.md +1 -1
- package/node_modules/@deepseek-ai/dsh-skill-office/assets/office-render/SKILL.md +1 -1
- package/node_modules/@deepseek-ai/dsh-skill-office/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-spill/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-spill-local/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-spill-policy/package.json +33 -33
- package/node_modules/@deepseek-ai/dsh-storage/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-storage-domain/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-storage-json/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-subagent/package.json +51 -51
- package/node_modules/@deepseek-ai/dsh-subagent-acp/package.json +24 -24
- package/node_modules/@deepseek-ai/dsh-subagent-fork-in-process/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-subagent-spawn-in-process/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-subprocess/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-subprocess-local/README.i18n.yaml +4 -4
- package/node_modules/@deepseek-ai/dsh-subprocess-local/README.md +3 -3
- package/node_modules/@deepseek-ai/dsh-subprocess-local/README.zh.md +3 -3
- package/node_modules/@deepseek-ai/dsh-subprocess-local/lib/index.js +252 -47
- package/node_modules/@deepseek-ai/dsh-subprocess-local/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-system-prompt/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-terminal/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-terminal-bash/package.json +22 -22
- package/node_modules/@deepseek-ai/dsh-time-context/package.json +21 -21
- package/node_modules/@deepseek-ai/dsh-timeout/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-tmux-context/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-token-meter/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-tool-ask-user/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-tool-bash/package.json +35 -35
- package/node_modules/@deepseek-ai/dsh-tool-bash-persistent/package.json +26 -26
- package/node_modules/@deepseek-ai/dsh-tool-call-timeout-policy/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/api-catalog.js +125 -4
- package/node_modules/@deepseek-ai/dsh-tool-cordis/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-tool-fs/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-fs/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-fs/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-fs/package.json +34 -34
- package/node_modules/@deepseek-ai/dsh-tool-fs-search/package.json +30 -30
- package/node_modules/@deepseek-ai/dsh-tool-goal/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-tool-jobs/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-tool-present/package.json +22 -22
- package/node_modules/@deepseek-ai/dsh-tool-pwsh/package.json +34 -34
- package/node_modules/@deepseek-ai/dsh-tool-pwsh-persistent/package.json +27 -27
- package/node_modules/@deepseek-ai/dsh-tool-ralph/package.json +23 -23
- package/node_modules/@deepseek-ai/dsh-tool-schedule/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-tool-session-query/package.json +27 -27
- package/node_modules/@deepseek-ai/dsh-tool-skill/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-tool-str-replace-editor/package.json +22 -22
- package/node_modules/@deepseek-ai/dsh-tool-subagent/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-subagent/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-subagent/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-subagent/package.json +26 -26
- package/node_modules/@deepseek-ai/dsh-tool-subagent-control/package.json +21 -21
- package/node_modules/@deepseek-ai/dsh-tool-terminal/package.json +30 -30
- package/node_modules/@deepseek-ai/dsh-tool-todo/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-tool-web/package.json +22 -22
- package/node_modules/@deepseek-ai/dsh-tool-workflow/package.json +23 -23
- package/node_modules/@deepseek-ai/dsh-tool-working-directory/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-tool-workspace-dependencies/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-tools/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-tools/README.md +3 -3
- package/node_modules/@deepseek-ai/dsh-tools/README.zh.md +3 -3
- package/node_modules/@deepseek-ai/dsh-tools/lib/index.js +45 -26
- package/node_modules/@deepseek-ai/dsh-tools/lib/types/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-tools/lib/types/ptc.js +20 -10
- package/node_modules/@deepseek-ai/dsh-tools/lib/types/py-types.js +1 -1
- package/node_modules/@deepseek-ai/dsh-tools/lib/types/ts-types.js +26 -9
- package/node_modules/@deepseek-ai/dsh-tools/package.json +27 -27
- package/node_modules/@deepseek-ai/dsh-tui-app/package.json +84 -84
- package/node_modules/@deepseek-ai/dsh-typert-loader/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-typert-protocol/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-typert-registry/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-user-approval/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-user-questions/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-util-code-language/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-util-crypto/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-util-time/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-util-values/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-util-workspace-path/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-web/lib/index.js +13 -9
- package/node_modules/@deepseek-ai/dsh-web/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-web-app/cordis.patch.yml +3 -0
- package/node_modules/@deepseek-ai/dsh-web-app/package.json +147 -145
- package/node_modules/@deepseek-ai/dsh-web-app/presets/cordis.patch.yml +3 -0
- package/node_modules/@deepseek-ai/dsh-web-app/presets/ptc.patch.yml +3 -0
- package/node_modules/@deepseek-ai/dsh-web-app/presets/standard.patch.yml +3 -0
- package/node_modules/@deepseek-ai/dsh-web-deepseek-api/README.i18n.yaml +49 -0
- package/node_modules/@deepseek-ai/dsh-web-deepseek-api/README.md +106 -0
- package/node_modules/@deepseek-ai/dsh-web-deepseek-api/README.zh.md +106 -0
- package/node_modules/@deepseek-ai/dsh-web-deepseek-api/lib/index.js +392 -0
- package/node_modules/@deepseek-ai/dsh-web-deepseek-api/locale/en.json +5 -0
- package/node_modules/@deepseek-ai/dsh-web-deepseek-api/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-web-deepseek-api/package.json +59 -0
- package/node_modules/@deepseek-ai/dsh-web-fetch-http/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-web-frontend/package.json +19 -21
- package/node_modules/@deepseek-ai/dsh-web-search-deepseek/README.i18n.yaml +15 -15
- package/node_modules/@deepseek-ai/dsh-web-search-deepseek/README.md +9 -9
- package/node_modules/@deepseek-ai/dsh-web-search-deepseek/README.zh.md +9 -9
- package/node_modules/@deepseek-ai/dsh-web-search-deepseek/lib/index.js +3 -2
- package/node_modules/@deepseek-ai/dsh-web-search-deepseek/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-web-search-exa/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-web-search-perplexity/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-win32-process/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-workflow/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-workflow-ptc/package.json +39 -39
- package/node_modules/@deepseek-ai/dsh-working-directory/package.json +21 -21
- package/node_modules/@deepseek-ai/dsh-workspace/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-workspace-changes/package.json +23 -23
- package/node_modules/@deepseek-ai/schemastery/package.json +2 -2
- package/node_modules/@earendil-works/pi-ai/README.md +5 -34
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +59 -54
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +16 -18
- package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +29 -27
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js +15 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +21 -4
- package/node_modules/@earendil-works/pi-ai/dist/api/transform-messages.js +28 -15
- package/node_modules/@earendil-works/pi-ai/dist/index.js +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/compat-schema.js +8 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/anthropic.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/google-vertex.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/google.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/kimi-coding.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/meta.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/nvidia.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai-codex.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/radius.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-ams.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-cn.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-sgp.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.js +3 -3
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/json-parse.js +26 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +5 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/validation.js +3 -0
- package/node_modules/@earendil-works/pi-ai/package.json +2 -2
- package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/node_modules/minisearch/LICENSE.txt +7 -0
- package/node_modules/minisearch/README.md +347 -0
- package/node_modules/minisearch/dist/cjs/SearchableMap.cjs +549 -0
- package/node_modules/minisearch/dist/cjs/index.cjs +2007 -0
- package/node_modules/minisearch/dist/es/SearchableMap.js +547 -0
- package/node_modules/minisearch/dist/es/index.js +2005 -0
- package/node_modules/minisearch/dist/umd/SearchableMap.js +555 -0
- package/node_modules/minisearch/dist/umd/index.js +2013 -0
- package/node_modules/minisearch/package.json +90 -0
- package/node_modules/minisearch/src/MiniSearch.test.js +1997 -0
- package/node_modules/minisearch/src/MiniSearch.ts +2261 -0
- package/node_modules/minisearch/src/SearchableMap/SearchableMap.test.js +314 -0
- package/node_modules/minisearch/src/SearchableMap/SearchableMap.ts +424 -0
- package/node_modules/minisearch/src/SearchableMap/TreeIterator.ts +103 -0
- package/node_modules/minisearch/src/SearchableMap/fuzzySearch.ts +130 -0
- package/node_modules/minisearch/src/SearchableMap/types.ts +18 -0
- package/node_modules/minisearch/src/index.ts +4 -0
- package/node_modules/minisearch/src/testSetup/jest.js +1 -0
- package/package.json +316 -308
- package/node_modules/@deepseek-ai/dsh-client-store/LICENSE +0 -21
- package/node_modules/@deepseek-ai/dsh-client-store/README.i18n.yaml +0 -28
- package/node_modules/@deepseek-ai/dsh-client-store/README.md +0 -46
- package/node_modules/@deepseek-ai/dsh-client-store/README.zh.md +0 -46
- package/node_modules/@deepseek-ai/dsh-client-store/lib/index.js +0 -180
- package/node_modules/@deepseek-ai/dsh-client-store/lib/types/contract.d.ts +0 -121
- package/node_modules/@deepseek-ai/dsh-client-store/lib/types/index.d.ts +0 -92
- package/node_modules/@deepseek-ai/dsh-client-store/package.json +0 -37
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/LICENSE +0 -21
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/README.i18n.yaml +0 -61
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/README.md +0 -221
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/README.zh.md +0 -221
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/Button.module.css +0 -77
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/Checkbox.module.css +0 -28
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/CodeCard.module.css +0 -83
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/CommandText.module.css +0 -12
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/ConnectionIndicator.module.css +0 -118
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/DiffBlock.module.css +0 -80
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/DisclosureRow.module.css +0 -111
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/FileTypeIcon.module.css +0 -50
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/HoverCard.module.css +0 -90
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/ImageLightbox.module.css +0 -54
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/ImagePreview.module.css +0 -24
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/InlineEditor.module.css +0 -23
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/Input.module.css +0 -38
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/JsonTree.module.css +0 -345
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/Menu.module.css +0 -285
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/MenuGroup.module.css +0 -37
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/MenuSurface.module.css +0 -49
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/Modal.module.css +0 -129
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/OnboardingSurface.module.css +0 -28
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/PathLabel.module.css +0 -28
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/Pill.module.css +0 -28
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/ReadBlock.module.css +0 -43
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/RiskConfirmation.module.css +0 -73
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/SearchBlock.module.css +0 -112
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/SegmentedControl.module.css +0 -76
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/SegmentedTabs.module.css +0 -55
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/ShortcutKeys.module.css +0 -33
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/StateDot.module.css +0 -100
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/Switch.module.css +0 -49
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/Tag.module.css +0 -57
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/TerminalBlock.module.css +0 -205
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/TextShimmer.module.css +0 -88
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/Toast.module.css +0 -101
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/Tooltip.module.css +0 -63
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/WebBlock.module.css +0 -141
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/index.js +0 -12583
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/markdown/CodeBlock.module.css +0 -145
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/markdown/JsonBlock.module.css +0 -32
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/markdown/MarkdownText.module.css +0 -467
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/settings-form/SettingsForm.module.css +0 -53
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/settings-form/fields.module.css +0 -145
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/BrandWordmark.d.ts +0 -15
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/Button.d.ts +0 -19
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/Checkbox.d.ts +0 -20
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/CodeFileIcon.d.ts +0 -12
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/CodeToolbar.d.ts +0 -30
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/CommandText.d.ts +0 -16
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/ConfigField.d.ts +0 -33
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/ConnectionIndicator.d.ts +0 -26
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/DiffBlock.d.ts +0 -52
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/DisclosureRow.d.ts +0 -38
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/FileTypeIcon.d.ts +0 -43
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/FishLogo.d.ts +0 -16
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/FoldToggle.d.ts +0 -20
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/HoverCard.d.ts +0 -40
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/HoverCardGroup.d.ts +0 -23
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/ImageLightbox.d.ts +0 -27
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/ImagePreview.d.ts +0 -12
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/InlineEditor.d.ts +0 -23
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/Input.d.ts +0 -12
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/JsonTree.d.ts +0 -59
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/LinkIcon.d.ts +0 -34
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/Menu.d.ts +0 -143
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/MenuGroup.d.ts +0 -22
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/MenuSurface.d.ts +0 -16
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/Modal.d.ts +0 -44
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/OnboardingSurface.d.ts +0 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/PathLabel.d.ts +0 -13
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/PermissionIcon.d.ts +0 -51
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/Pill.d.ts +0 -13
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/ReadBlock.d.ts +0 -48
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/ReferenceIcon.d.ts +0 -21
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/RiskConfirmation.d.ts +0 -20
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/SearchBlock.d.ts +0 -72
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/SegmentedControl.d.ts +0 -35
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/SegmentedTabs.d.ts +0 -26
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/ShortcutKeys.d.ts +0 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/SiteGlyph.d.ts +0 -25
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/StateDot.d.ts +0 -20
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/Switch.d.ts +0 -20
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/Tag.d.ts +0 -32
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/TerminalBlock.d.ts +0 -86
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/TextShimmer.d.ts +0 -22
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/Toast.d.ts +0 -49
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/Tooltip.d.ts +0 -63
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/WebBlock.d.ts +0 -61
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/ansi.d.ts +0 -17
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/clipboard.d.ts +0 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/code-file-icon-artwork.d.ts +0 -54
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/code-file-types.d.ts +0 -30
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/code-highlighting.d.ts +0 -12
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/darwin-desktop.d.ts +0 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/file-size.d.ts +0 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/focus.d.ts +0 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/guide-artwork.d.ts +0 -15
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/head-tail-cap.d.ts +0 -23
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/icons/index.d.ts +0 -385
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/icons/props.d.ts +0 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/icons/shared-artwork.d.ts +0 -43
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/index.d.ts +0 -102
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/input-modality.d.ts +0 -19
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/keyboard-composition.d.ts +0 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/markdown/CodeBlock.d.ts +0 -35
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/markdown/JsonBlock.d.ts +0 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/markdown/MarkdownDelegate.d.ts +0 -46
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/markdown/MarkdownText.d.ts +0 -49
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/markdown/cjkFriendlyStrong.d.ts +0 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/markdown/file-link.d.ts +0 -13
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/markdown/highlight.d.ts +0 -148
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/markdown/incremental.d.ts +0 -80
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/markdown/katex.d.ts +0 -27
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/markdown/local-image-syntax.d.ts +0 -10
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/markdown/mathCompatibility.d.ts +0 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/markdown/parse.d.ts +0 -25
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/markdown/plain-text.d.ts +0 -22
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/markdown/render.d.ts +0 -141
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/markdown/useViewportHighlighting.d.ts +0 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/overlay-top-margin.d.ts +0 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/plugin-artwork.d.ts +0 -17
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/pointer-grace.d.ts +0 -22
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/rank-by-name.d.ts +0 -22
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/relative-time.d.ts +0 -23
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/settings-form/SettingsForm.d.ts +0 -46
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/settings-form/fields.d.ts +0 -70
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/settings-form/form-model.d.ts +0 -214
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/use-copy-feedback.d.ts +0 -14
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/useAnchoredMaxHeight.d.ts +0 -14
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/useAnchoredPosition.d.ts +0 -36
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/useDismissOnOutsidePointer.d.ts +0 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/useModalLayer.d.ts +0 -27
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/user-text.d.ts +0 -29
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/user-text.module.css +0 -46
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/package.json +0 -61
- package/node_modules/@deepseek-ai/dsh-client-ui-slots/LICENSE +0 -21
- package/node_modules/@deepseek-ai/dsh-client-ui-slots/README.i18n.yaml +0 -55
- package/node_modules/@deepseek-ai/dsh-client-ui-slots/README.md +0 -111
- package/node_modules/@deepseek-ai/dsh-client-ui-slots/README.zh.md +0 -111
- package/node_modules/@deepseek-ai/dsh-client-ui-slots/lib/index.js +0 -577
- package/node_modules/@deepseek-ai/dsh-client-ui-slots/lib/types/index.d.ts +0 -955
- package/node_modules/@deepseek-ai/dsh-client-ui-slots/lib/types/renderer.d.ts +0 -271
- package/node_modules/@deepseek-ai/dsh-client-ui-slots/lib/types/store.d.ts +0 -3
- package/node_modules/@earendil-works/pi-ai/dist/utils/assistant-message-frame.js +0 -425
|
@@ -0,0 +1,661 @@
|
|
|
1
|
+
import z from "@deepseek-ai/schemastery";
|
|
2
|
+
import semver from "semver";
|
|
3
|
+
import { evaluatePluginCompatibility, getDshRuntimeVersion } from "@deepseek-ai/dsh-app-boot";
|
|
4
|
+
import { marketInstallTarget } from "@deepseek-ai/dsh-plugin-market-index";
|
|
5
|
+
import { MAX_TIMER_DELAY_MS } from "@deepseek-ai/dsh-timeout";
|
|
6
|
+
import { Remote, RemoteError, TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
|
|
7
|
+
import { Worker } from "node:worker_threads";
|
|
8
|
+
import MiniSearch from "minisearch";
|
|
9
|
+
import { assertNever } from "@deepseek-ai/dsh-util-values";
|
|
10
|
+
//#region lib/types/index-url.js
|
|
11
|
+
/** Index source URL validation shared by `setIndexes` and the per-use check of configured sources. */
|
|
12
|
+
/**
|
|
13
|
+
* Validate and normalize one index source URL.
|
|
14
|
+
* @param text - URL as configured or entered.
|
|
15
|
+
* @returns the URL's serialization.
|
|
16
|
+
* @throws {RemoteError} `plugin-market/invalid-index-url` for anything but an http(s) URL without credentials or
|
|
17
|
+
* fragment.
|
|
18
|
+
*/
|
|
19
|
+
function normalizeIndexUrl(text) {
|
|
20
|
+
let url;
|
|
21
|
+
try {
|
|
22
|
+
url = new URL(text.trim());
|
|
23
|
+
} catch {
|
|
24
|
+
throw new RemoteError("plugin-market/invalid-index-url", `Not an absolute URL: ${text}`, {
|
|
25
|
+
url: text,
|
|
26
|
+
reason: "not-absolute"
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
if (url.protocol !== "https:" && url.protocol !== "http:") throw new RemoteError("plugin-market/invalid-index-url", `Index URLs use http or https: ${text}`, {
|
|
30
|
+
url: text,
|
|
31
|
+
reason: "scheme"
|
|
32
|
+
});
|
|
33
|
+
if (url.username !== "" || url.password !== "" || url.href.includes("#")) throw new RemoteError("plugin-market/invalid-index-url", `Index URLs carry no credentials or fragment: ${text}`, {
|
|
34
|
+
url: text,
|
|
35
|
+
reason: "credentials-or-fragment"
|
|
36
|
+
});
|
|
37
|
+
return url.href;
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region lib/types/parse-thread.js
|
|
41
|
+
/** Runs index parsing in a fresh Worker Thread, so a large index does not block the Host event loop. */
|
|
42
|
+
function workerSpawn() {
|
|
43
|
+
/* v8 ignore next -- built-artifact runs own the bundled path. */
|
|
44
|
+
if (!import.meta.url.endsWith(".ts")) return {
|
|
45
|
+
entry: new URL("./worker.cjs", import.meta.url),
|
|
46
|
+
options: { execArgv: [] }
|
|
47
|
+
};
|
|
48
|
+
const bootstrap = [
|
|
49
|
+
`import { register as registerEsm } from ${JSON.stringify(import.meta.resolve("tsx/esm/api"))}`,
|
|
50
|
+
`import { register as registerCjs } from ${JSON.stringify(import.meta.resolve("tsx/cjs/api"))}`,
|
|
51
|
+
"registerCjs()",
|
|
52
|
+
"registerEsm()",
|
|
53
|
+
`await import(${JSON.stringify(new URL("./worker.ts", import.meta.url).href)})`
|
|
54
|
+
].join("\n");
|
|
55
|
+
return {
|
|
56
|
+
entry: new URL(`data:text/javascript,${encodeURIComponent(bootstrap)}`),
|
|
57
|
+
options: { execArgv: [] }
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/** Whether a Worker message is a parse result: an index object, or a violation's path, reason, and message. */
|
|
61
|
+
function isResult(value) {
|
|
62
|
+
if (typeof value !== "object" || value === null) return false;
|
|
63
|
+
const result = value;
|
|
64
|
+
return result.ok === true ? typeof result.index === "object" && result.index !== null : result.ok === false && [
|
|
65
|
+
result.path,
|
|
66
|
+
result.reason,
|
|
67
|
+
result.message
|
|
68
|
+
].every((field) => typeof field === "string");
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Run `parseIndexBody` in a fresh Worker Thread. The body's buffer is transferred to the Worker and is unusable
|
|
72
|
+
* afterwards; the result is copied back by structured clone.
|
|
73
|
+
* @param body - the complete response body; it must own its whole buffer.
|
|
74
|
+
* @param url - the index URL.
|
|
75
|
+
* @param signal - terminates the Worker and rejects with the signal's reason.
|
|
76
|
+
* @returns the Worker's result.
|
|
77
|
+
* @throws the abort reason, or an Error when the Worker fails, exits without a result, or reports an unexpected value.
|
|
78
|
+
*/
|
|
79
|
+
async function parseIndexInWorker(body, url, signal) {
|
|
80
|
+
signal.throwIfAborted();
|
|
81
|
+
const { entry, options } = workerSpawn();
|
|
82
|
+
const request = {
|
|
83
|
+
body,
|
|
84
|
+
url
|
|
85
|
+
};
|
|
86
|
+
const worker = new Worker(entry, {
|
|
87
|
+
...options,
|
|
88
|
+
workerData: request,
|
|
89
|
+
transferList: [body.buffer]
|
|
90
|
+
});
|
|
91
|
+
return await new Promise((resolve, reject) => {
|
|
92
|
+
let settled = false;
|
|
93
|
+
const settle = (finish) => {
|
|
94
|
+
if (settled) return;
|
|
95
|
+
settled = true;
|
|
96
|
+
signal.removeEventListener("abort", abort);
|
|
97
|
+
worker.terminate().then(finish, finish);
|
|
98
|
+
};
|
|
99
|
+
const abort = () => {
|
|
100
|
+
settle(() => {
|
|
101
|
+
reject(signal.reason);
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
105
|
+
worker.once("message", (value) => {
|
|
106
|
+
settle(() => {
|
|
107
|
+
if (isResult(value)) resolve(value);
|
|
108
|
+
else reject(/* @__PURE__ */ new Error("index parser reported an unexpected value"));
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
worker.once("error", (error) => {
|
|
112
|
+
settle(() => {
|
|
113
|
+
reject(error);
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
worker.once("exit", (code) => {
|
|
117
|
+
settle(() => {
|
|
118
|
+
reject(/* @__PURE__ */ new Error(`index parser exited before reporting a result (code ${String(code)})`));
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region lib/types/search.js
|
|
125
|
+
/** Filtering, fuzzy text matching, and ordering of one validated index's plugins. */
|
|
126
|
+
/**
|
|
127
|
+
* Letters, marks, and digits used by CJK scripts, which write words without spaces between them; script extensions
|
|
128
|
+
* include shared characters such as the prolonged sound mark ー and the iteration mark 々.
|
|
129
|
+
*/
|
|
130
|
+
const CJK = String.raw`[[\p{scx=Han}\p{scx=Hira}\p{scx=Kana}\p{scx=Hang}]&&[\p{L}\p{M}\p{N}]]`;
|
|
131
|
+
/** A run of CJK characters, or a run of other letters, marks, and digits. */
|
|
132
|
+
const RUN = new RegExp(String.raw`${CJK}+|[[\p{L}\p{M}\p{N}]--${CJK}]+`, "gv");
|
|
133
|
+
const CJK_START = new RegExp(String.raw`^${CJK}`, "v");
|
|
134
|
+
/**
|
|
135
|
+
* Split NFKC-normalized text into search terms, so composed and decomposed forms, half-width kana, and compatibility
|
|
136
|
+
* characters yield the same terms. A CJK run yields its overlapping character pairs and its last character, so a query
|
|
137
|
+
* matches without word segmentation and every character of the run starts some term.
|
|
138
|
+
* @param text - indexed or queried text.
|
|
139
|
+
* @returns the terms in text order, not yet lowercased.
|
|
140
|
+
*/
|
|
141
|
+
function searchTerms(text) {
|
|
142
|
+
return [...text.normalize("NFKC").matchAll(RUN)].flatMap(([run]) => {
|
|
143
|
+
if (!CJK_START.test(run)) return [run];
|
|
144
|
+
const chars = Array.from(run);
|
|
145
|
+
return [...chars.slice(1).map((char, position) => `${chars[position]}${char}`), chars.at(-1)];
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
/** Every language variant of a localized text. */
|
|
149
|
+
function variants(text) {
|
|
150
|
+
if (text === void 0) return [];
|
|
151
|
+
return typeof text === "string" ? [text] : Object.values(text);
|
|
152
|
+
}
|
|
153
|
+
/** Plugins indexed per event-loop turn while the text index is built. */
|
|
154
|
+
const BUILD_CHUNK = 500;
|
|
155
|
+
/** Matches queries against one index; the text index is built on the first query with text, yielding between chunks. */
|
|
156
|
+
var MarketSearch = class {
|
|
157
|
+
index;
|
|
158
|
+
engine;
|
|
159
|
+
/** @param index - the validated index to search. */
|
|
160
|
+
constructor(index) {
|
|
161
|
+
this.index = index;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Select and order the plugins matching a query.
|
|
165
|
+
* @param selection - text, filters, and order.
|
|
166
|
+
* @returns every matching plugin in result order.
|
|
167
|
+
*/
|
|
168
|
+
async select(selection) {
|
|
169
|
+
const plugins = this.index.plugins;
|
|
170
|
+
const text = selection.text ?? "";
|
|
171
|
+
const scores = /* @__PURE__ */ new Map();
|
|
172
|
+
let positions;
|
|
173
|
+
if (searchTerms(text).length === 0) positions = plugins.map((_plugin, position) => position);
|
|
174
|
+
else {
|
|
175
|
+
for (const result of await this.search(text)) scores.set(result.id, result.score);
|
|
176
|
+
positions = [...scores.keys()].sort((a, b) => a - b);
|
|
177
|
+
}
|
|
178
|
+
const labels = selection.labels ?? [];
|
|
179
|
+
const matching = positions.filter((position) => {
|
|
180
|
+
const { metadata } = plugins[position];
|
|
181
|
+
return (selection.category === void 0 || metadata.category === selection.category) && labels.every((label) => metadata.labels.includes(label));
|
|
182
|
+
});
|
|
183
|
+
return this.order(matching, selection.sort, scores).map((position) => plugins[position]);
|
|
184
|
+
}
|
|
185
|
+
async search(text) {
|
|
186
|
+
this.engine ??= this.build();
|
|
187
|
+
return (await this.engine).search(text);
|
|
188
|
+
}
|
|
189
|
+
async build() {
|
|
190
|
+
const { categories, labels } = this.index.metadata;
|
|
191
|
+
const engine = new MiniSearch({
|
|
192
|
+
fields: [
|
|
193
|
+
"name",
|
|
194
|
+
"title",
|
|
195
|
+
"keywords",
|
|
196
|
+
"description",
|
|
197
|
+
"author",
|
|
198
|
+
"taxonomy"
|
|
199
|
+
],
|
|
200
|
+
storeFields: [],
|
|
201
|
+
tokenize: searchTerms,
|
|
202
|
+
processTerm: (term) => term.toLowerCase(),
|
|
203
|
+
searchOptions: {
|
|
204
|
+
boost: {
|
|
205
|
+
name: 3,
|
|
206
|
+
title: 3,
|
|
207
|
+
keywords: 2
|
|
208
|
+
},
|
|
209
|
+
prefix: true,
|
|
210
|
+
fuzzy: (term) => term.length >= 4 ? .2 : false,
|
|
211
|
+
maxFuzzy: 2,
|
|
212
|
+
combineWith: "AND"
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
await engine.addAllAsync(this.index.plugins.map((plugin, id) => {
|
|
216
|
+
const { category, keywords } = plugin.metadata;
|
|
217
|
+
const title = (declarations, id) => variants(declarations[id].title);
|
|
218
|
+
const taxonomy = [...category === void 0 ? [] : title(categories, category), ...plugin.metadata.labels.flatMap((label) => title(labels, label))];
|
|
219
|
+
return {
|
|
220
|
+
id,
|
|
221
|
+
name: plugin.name,
|
|
222
|
+
title: variants(plugin.title).join("\n"),
|
|
223
|
+
keywords: keywords.join("\n"),
|
|
224
|
+
description: variants(plugin.description).join("\n"),
|
|
225
|
+
author: plugin.author ?? "",
|
|
226
|
+
taxonomy: taxonomy.join("\n")
|
|
227
|
+
};
|
|
228
|
+
}), { chunkSize: BUILD_CHUNK });
|
|
229
|
+
return engine;
|
|
230
|
+
}
|
|
231
|
+
order(positions, sort, scores) {
|
|
232
|
+
switch (sort.kind) {
|
|
233
|
+
case "index": return positions;
|
|
234
|
+
case "relevance": return positions.sort((a, b) => (scores.get(b) ?? 0) - (scores.get(a) ?? 0) || a - b);
|
|
235
|
+
case "published":
|
|
236
|
+
case "key": {
|
|
237
|
+
const value = (position) => {
|
|
238
|
+
const plugin = this.index.plugins[position];
|
|
239
|
+
if (sort.kind === "published") return Math.max(...plugin.versions.map((version) => version.publishTimestamp));
|
|
240
|
+
return Object.hasOwn(plugin.metadata.sortKeys, sort.id) ? plugin.metadata.sortKeys[sort.id] : void 0;
|
|
241
|
+
};
|
|
242
|
+
const sign = sort.direction === "asc" ? 1 : -1;
|
|
243
|
+
return positions.map((position) => ({
|
|
244
|
+
position,
|
|
245
|
+
value: value(position)
|
|
246
|
+
})).sort((a, b) => {
|
|
247
|
+
if (a.value === void 0 || b.value === void 0) return a.value === b.value ? a.position - b.position : a.value === void 0 ? 1 : -1;
|
|
248
|
+
return (a.value - b.value) * sign || a.position - b.position;
|
|
249
|
+
}).map((item) => item.position);
|
|
250
|
+
}
|
|
251
|
+
/* v8 ignore next -- the Gateway validates `sort` against the closed union */
|
|
252
|
+
default: return assertNever(sort);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
//#endregion
|
|
257
|
+
//#region lib/types/index.js
|
|
258
|
+
/** Host reader of configured plugin market indexes for the Discover page and the `plugin_market` tool. */
|
|
259
|
+
var __runInitializers = function(thisArg, initializers, value) {
|
|
260
|
+
var useValue = arguments.length > 2;
|
|
261
|
+
for (var i = 0; i < initializers.length; i++) value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
262
|
+
return useValue ? value : void 0;
|
|
263
|
+
};
|
|
264
|
+
var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
265
|
+
function accept(f) {
|
|
266
|
+
if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
|
|
267
|
+
return f;
|
|
268
|
+
}
|
|
269
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
270
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
271
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
272
|
+
var _, done = false;
|
|
273
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
274
|
+
var context = {};
|
|
275
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
276
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
277
|
+
context.addInitializer = function(f) {
|
|
278
|
+
if (done) throw new TypeError("Cannot add initializers after decoration has completed");
|
|
279
|
+
extraInitializers.push(accept(f || null));
|
|
280
|
+
};
|
|
281
|
+
var result = (0, decorators[i])(kind === "accessor" ? {
|
|
282
|
+
get: descriptor.get,
|
|
283
|
+
set: descriptor.set
|
|
284
|
+
} : descriptor[key], context);
|
|
285
|
+
if (kind === "accessor") {
|
|
286
|
+
if (result === void 0) continue;
|
|
287
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
288
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
289
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
290
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
291
|
+
} else if (_ = accept(result)) if (kind === "field") initializers.unshift(_);
|
|
292
|
+
else descriptor[key] = _;
|
|
293
|
+
}
|
|
294
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
295
|
+
done = true;
|
|
296
|
+
};
|
|
297
|
+
/** The exact diagnostic of a failure, including a non-Error rejection. */
|
|
298
|
+
function messageOf(error) {
|
|
299
|
+
return error instanceof Error ? error.message : String(error);
|
|
300
|
+
}
|
|
301
|
+
/** Causes followed below a rejection; a deeper or cyclic chain is cut there. */
|
|
302
|
+
const MAX_CAUSES = 4;
|
|
303
|
+
/** A rejection with its cause chain: a Node `fetch` failure is a bare `fetch failed` whose reason is its cause. */
|
|
304
|
+
function causeChainOf(error, depth = 0) {
|
|
305
|
+
return error instanceof Error && error.cause !== void 0 && depth < MAX_CAUSES ? `${error.message}: ${causeChainOf(error.cause, depth + 1)}` : messageOf(error);
|
|
306
|
+
}
|
|
307
|
+
/** Largest page `search` returns. */
|
|
308
|
+
const MAX_LIMIT = 100;
|
|
309
|
+
let PluginMarket = (() => {
|
|
310
|
+
let _classSuper = TypertRemoteService;
|
|
311
|
+
let _instanceExtraInitializers = [];
|
|
312
|
+
let _listIndexes_decorators;
|
|
313
|
+
let _setIndexes_decorators;
|
|
314
|
+
let _search_decorators;
|
|
315
|
+
return class PluginMarket extends _classSuper {
|
|
316
|
+
static {
|
|
317
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
318
|
+
_listIndexes_decorators = [Remote];
|
|
319
|
+
_setIndexes_decorators = [Remote];
|
|
320
|
+
_search_decorators = [Remote];
|
|
321
|
+
__esDecorate(this, null, _listIndexes_decorators, {
|
|
322
|
+
kind: "method",
|
|
323
|
+
name: "listIndexes",
|
|
324
|
+
static: false,
|
|
325
|
+
private: false,
|
|
326
|
+
access: {
|
|
327
|
+
has: (obj) => "listIndexes" in obj,
|
|
328
|
+
get: (obj) => obj.listIndexes
|
|
329
|
+
},
|
|
330
|
+
metadata: _metadata
|
|
331
|
+
}, null, _instanceExtraInitializers);
|
|
332
|
+
__esDecorate(this, null, _setIndexes_decorators, {
|
|
333
|
+
kind: "method",
|
|
334
|
+
name: "setIndexes",
|
|
335
|
+
static: false,
|
|
336
|
+
private: false,
|
|
337
|
+
access: {
|
|
338
|
+
has: (obj) => "setIndexes" in obj,
|
|
339
|
+
get: (obj) => obj.setIndexes
|
|
340
|
+
},
|
|
341
|
+
metadata: _metadata
|
|
342
|
+
}, null, _instanceExtraInitializers);
|
|
343
|
+
__esDecorate(this, null, _search_decorators, {
|
|
344
|
+
kind: "method",
|
|
345
|
+
name: "search",
|
|
346
|
+
static: false,
|
|
347
|
+
private: false,
|
|
348
|
+
access: {
|
|
349
|
+
has: (obj) => "search" in obj,
|
|
350
|
+
get: (obj) => obj.search
|
|
351
|
+
},
|
|
352
|
+
metadata: _metadata
|
|
353
|
+
}, null, _instanceExtraInitializers);
|
|
354
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, {
|
|
355
|
+
enumerable: true,
|
|
356
|
+
configurable: true,
|
|
357
|
+
writable: true,
|
|
358
|
+
value: _metadata
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
config = __runInitializers(this, _instanceExtraInitializers);
|
|
362
|
+
static inject = ["pluginManager"];
|
|
363
|
+
static Config = z.object({
|
|
364
|
+
indexes: z.array(z.string().pattern(/^https?:\/\/\S+$/u)).default([]).volatile(),
|
|
365
|
+
fetchTimeoutMs: z.natural().min(1).max(MAX_TIMER_DELAY_MS).default(15e3),
|
|
366
|
+
maxBytes: z.natural().min(1).default(128 * 1024 * 1024),
|
|
367
|
+
cacheTtlMs: z.natural().default(6e5)
|
|
368
|
+
});
|
|
369
|
+
lifetime = new AbortController();
|
|
370
|
+
cache = /* @__PURE__ */ new Map();
|
|
371
|
+
pending = /* @__PURE__ */ new Map();
|
|
372
|
+
errors = /* @__PURE__ */ new Map();
|
|
373
|
+
entryId;
|
|
374
|
+
constructor(ctx, config) {
|
|
375
|
+
super(ctx, "pluginMarket");
|
|
376
|
+
this.config = config;
|
|
377
|
+
this.entryId = ctx.fiber.entry?.options.id;
|
|
378
|
+
ctx.on("loader/volatile-update", () => {
|
|
379
|
+
const configured = new Set(this.sources().flatMap((source) => source.error === void 0 ? [source.url] : []));
|
|
380
|
+
for (const url of [...this.cache.keys(), ...this.errors.keys()]) if (!configured.has(url)) {
|
|
381
|
+
this.cache.delete(url);
|
|
382
|
+
this.errors.delete(url);
|
|
383
|
+
}
|
|
384
|
+
ctx.emit("plugin-market/changed");
|
|
385
|
+
});
|
|
386
|
+
ctx.effect(() => async () => {
|
|
387
|
+
this.lifetime.abort(/* @__PURE__ */ new Error("Plugin market disposed"));
|
|
388
|
+
await Promise.allSettled(this.pending.values());
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* List the configured index sources without fetching them.
|
|
393
|
+
* @returns every source in order, with the title of its last successful read and, when the last read failed, its error.
|
|
394
|
+
*/
|
|
395
|
+
listIndexes() {
|
|
396
|
+
return this.sources().map(({ url, error: invalid }) => {
|
|
397
|
+
const index = this.cache.get(url)?.document.index;
|
|
398
|
+
const error = invalid ?? this.errors.get(url);
|
|
399
|
+
return {
|
|
400
|
+
url,
|
|
401
|
+
...index === void 0 ? {} : {
|
|
402
|
+
title: index.title,
|
|
403
|
+
...index.description === void 0 ? {} : { description: index.description }
|
|
404
|
+
},
|
|
405
|
+
...error === void 0 ? {} : { error }
|
|
406
|
+
};
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Replace the configured index sources through Settings, without remounting this service.
|
|
411
|
+
* `plugin-market/changed` announces the committed list. A URL already configured is kept as written, so a client can
|
|
412
|
+
* add or remove sources beside one that `listIndexes` reports as unusable.
|
|
413
|
+
* @param urls - index URLs in display order.
|
|
414
|
+
* @throws {RemoteError} `plugin-market/invalid-index-url` for an invalid new URL or a repeated URL;
|
|
415
|
+
* `plugin-market/settings-unavailable` without Settings or a profile entry.
|
|
416
|
+
*/
|
|
417
|
+
async setIndexes(urls) {
|
|
418
|
+
const configured = new Set(this.config.indexes.get());
|
|
419
|
+
const normalized = urls.map((url) => configured.has(url) ? url : normalizeIndexUrl(url));
|
|
420
|
+
const keys = normalized.map((url) => URL.canParse(url) ? new URL(url).href : url);
|
|
421
|
+
const repeated = normalized.find((_url, position) => keys.indexOf(keys[position]) !== position);
|
|
422
|
+
if (repeated !== void 0) throw new RemoteError("plugin-market/invalid-index-url", `Index source listed twice: ${repeated}`, {
|
|
423
|
+
url: repeated,
|
|
424
|
+
reason: "duplicate"
|
|
425
|
+
});
|
|
426
|
+
const settings = this.ctx.get("settings");
|
|
427
|
+
if (settings === void 0 || this.entryId === void 0) throw new RemoteError("plugin-market/settings-unavailable", "Index sources require the settings service and a profile entry", {});
|
|
428
|
+
await settings.update(this.entryId, { indexes: normalized });
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Return one page of the plugins of a configured index that match a query. Concurrent reads of a URL share one
|
|
432
|
+
* fetch; a successful document is reused for `cacheTtlMs` unless `refresh` is set. Matching and ordering read only
|
|
433
|
+
* the document; installation status and compatibility are computed for the returned page on every call.
|
|
434
|
+
* @param url - a configured index URL.
|
|
435
|
+
* @param query - text, filters, order, page, and whether to bypass the cached document.
|
|
436
|
+
* @returns the index header, the page's plugins with each plugin's default version and installation status and each
|
|
437
|
+
* version's compatibility and install arguments, the number of matches, and the next page's offset.
|
|
438
|
+
* @throws {RemoteError} `plugin-market/invalid-query`, `plugin-market/unknown-index`, `plugin-market/invalid-index-url`,
|
|
439
|
+
* `plugin-market/fetch-failed`, or `plugin-market/invalid-index`.
|
|
440
|
+
*/
|
|
441
|
+
async search(url, query) {
|
|
442
|
+
if (!Number.isSafeInteger(query.offset) || query.offset < 0) throw new RemoteError("plugin-market/invalid-query", "offset must be a non-negative integer", {
|
|
443
|
+
field: "offset",
|
|
444
|
+
reason: "range"
|
|
445
|
+
});
|
|
446
|
+
if (!Number.isInteger(query.limit) || query.limit < 1 || query.limit > MAX_LIMIT) throw new RemoteError("plugin-market/invalid-query", `limit must be an integer from 1 to ${String(MAX_LIMIT)}`, {
|
|
447
|
+
field: "limit",
|
|
448
|
+
reason: "range"
|
|
449
|
+
});
|
|
450
|
+
const document = await this.document(url, query.refresh === true, query.fetchedAt);
|
|
451
|
+
const matching = await document.search.select(query);
|
|
452
|
+
const page = matching.slice(query.offset, query.offset + query.limit);
|
|
453
|
+
const listing = await this.annotator();
|
|
454
|
+
const next = query.offset + page.length;
|
|
455
|
+
const { index } = document;
|
|
456
|
+
return {
|
|
457
|
+
url,
|
|
458
|
+
title: index.title,
|
|
459
|
+
...index.description === void 0 ? {} : { description: index.description },
|
|
460
|
+
metadata: index.metadata,
|
|
461
|
+
fetchedAt: document.fetchedAt,
|
|
462
|
+
entries: page.map(listing),
|
|
463
|
+
total: matching.length,
|
|
464
|
+
nextOffset: next < matching.length ? next : null
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* Read one plugin of a configured index, using the cached document as `search` does.
|
|
469
|
+
* @param url - a configured index URL.
|
|
470
|
+
* @param name - the plugin's package name.
|
|
471
|
+
* @returns the plugin with its default version, installation status, and annotated versions; undefined when the
|
|
472
|
+
* index does not list it.
|
|
473
|
+
* @throws {RemoteError} `plugin-market/unknown-index`, `plugin-market/invalid-index-url`, `plugin-market/fetch-failed`,
|
|
474
|
+
* or `plugin-market/invalid-index`.
|
|
475
|
+
*/
|
|
476
|
+
async entry(url, name) {
|
|
477
|
+
const plugin = (await this.document(url, false)).index.plugins.find((candidate) => candidate.name === name);
|
|
478
|
+
return plugin === void 0 ? void 0 : (await this.annotator())(plugin);
|
|
479
|
+
}
|
|
480
|
+
async document(url, refresh, fetchedAt) {
|
|
481
|
+
const source = this.sources().find((candidate) => candidate.url === url);
|
|
482
|
+
if (source === void 0) throw new RemoteError("plugin-market/unknown-index", `Not a configured index source: ${url}`, { url });
|
|
483
|
+
if (source.error !== void 0) throw new RemoteError("plugin-market/invalid-index-url", source.error, {
|
|
484
|
+
url,
|
|
485
|
+
reason: "configured"
|
|
486
|
+
});
|
|
487
|
+
const cached = this.cache.get(url);
|
|
488
|
+
const usable = cached !== void 0 && (cached.expiresAt > Date.now() || cached.document.fetchedAt === fetchedAt);
|
|
489
|
+
return !refresh && usable ? cached.document : await this.fetchShared(url);
|
|
490
|
+
}
|
|
491
|
+
/** Annotate plugins with the profile's bundles and exemptions as they are now. */
|
|
492
|
+
async annotator() {
|
|
493
|
+
const [bundles, { exemptions }] = [await this.ctx.pluginManager.listBundles(), this.ctx.pluginManager.listVersionExemptions()];
|
|
494
|
+
const runtimeVersion = getDshRuntimeVersion();
|
|
495
|
+
return (plugin) => listingOf(plugin, bundles, exemptions, runtimeVersion);
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* The configured sources as written, each with the refusal that makes it unusable. Settings and profile files can
|
|
499
|
+
* write any http(s) string, so every use validates instead of the schema; an unusable source is listed with its error
|
|
500
|
+
* and never fetched, and a repeated URL counts once.
|
|
501
|
+
*/
|
|
502
|
+
sources() {
|
|
503
|
+
const seen = /* @__PURE__ */ new Set();
|
|
504
|
+
return this.config.indexes.get().flatMap((url) => {
|
|
505
|
+
if (seen.has(url)) return [];
|
|
506
|
+
seen.add(url);
|
|
507
|
+
try {
|
|
508
|
+
return normalizeIndexUrl(url) === url ? [{ url }] : [{
|
|
509
|
+
url,
|
|
510
|
+
error: `Index URL is not in canonical form; use ${normalizeIndexUrl(url)}`
|
|
511
|
+
}];
|
|
512
|
+
} catch (error) {
|
|
513
|
+
return [{
|
|
514
|
+
url,
|
|
515
|
+
error: messageOf(error)
|
|
516
|
+
}];
|
|
517
|
+
}
|
|
518
|
+
});
|
|
519
|
+
}
|
|
520
|
+
configured(url) {
|
|
521
|
+
return this.sources().some((source) => source.url === url && source.error === void 0);
|
|
522
|
+
}
|
|
523
|
+
fetchShared(url) {
|
|
524
|
+
let pending = this.pending.get(url);
|
|
525
|
+
if (pending === void 0) {
|
|
526
|
+
pending = this.fetchIndex(url).then((index) => {
|
|
527
|
+
const document = {
|
|
528
|
+
index,
|
|
529
|
+
fetchedAt: Math.max(Date.now(), (this.cache.get(url)?.document.fetchedAt ?? 0) + 1),
|
|
530
|
+
search: new MarketSearch(index)
|
|
531
|
+
};
|
|
532
|
+
if (this.configured(url)) {
|
|
533
|
+
this.cache.set(url, {
|
|
534
|
+
document,
|
|
535
|
+
expiresAt: Date.now() + this.config.cacheTtlMs
|
|
536
|
+
});
|
|
537
|
+
this.errors.delete(url);
|
|
538
|
+
}
|
|
539
|
+
return document;
|
|
540
|
+
}, (error) => {
|
|
541
|
+
if (this.configured(url)) this.errors.set(url, messageOf(error));
|
|
542
|
+
throw error;
|
|
543
|
+
}).finally(() => {
|
|
544
|
+
this.pending.delete(url);
|
|
545
|
+
});
|
|
546
|
+
this.pending.set(url, pending);
|
|
547
|
+
}
|
|
548
|
+
return pending;
|
|
549
|
+
}
|
|
550
|
+
async fetchIndex(url) {
|
|
551
|
+
const signal = AbortSignal.any([this.lifetime.signal, AbortSignal.timeout(this.config.fetchTimeoutMs)]);
|
|
552
|
+
const failed = (reason, cause) => new RemoteError("plugin-market/fetch-failed", `Could not fetch ${url}: ${reason}`, {
|
|
553
|
+
url,
|
|
554
|
+
reason
|
|
555
|
+
}, { cause });
|
|
556
|
+
let response;
|
|
557
|
+
try {
|
|
558
|
+
response = await fetch(url, {
|
|
559
|
+
signal,
|
|
560
|
+
redirect: "error",
|
|
561
|
+
headers: { accept: "application/json" }
|
|
562
|
+
});
|
|
563
|
+
} catch (error) {
|
|
564
|
+
throw failed(causeChainOf(error), error);
|
|
565
|
+
}
|
|
566
|
+
if (!response.ok) {
|
|
567
|
+
await response.body?.cancel();
|
|
568
|
+
throw failed(`HTTP ${String(response.status)}`);
|
|
569
|
+
}
|
|
570
|
+
const result = await parseIndexInWorker(await this.readBody(response, failed), url, this.lifetime.signal).catch((error) => {
|
|
571
|
+
throw failed(messageOf(error), error);
|
|
572
|
+
});
|
|
573
|
+
if (result.ok) return result.index;
|
|
574
|
+
throw new RemoteError("plugin-market/invalid-index", `${url}: ${result.message}`, {
|
|
575
|
+
url,
|
|
576
|
+
path: result.path,
|
|
577
|
+
reason: result.reason
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
/** Read the whole body, refusing it as soon as it exceeds `maxBytes`. */
|
|
581
|
+
async readBody(response, failed) {
|
|
582
|
+
const limit = this.config.maxBytes;
|
|
583
|
+
const tooLarge = `body exceeds ${String(limit)} bytes`;
|
|
584
|
+
if (Number(response.headers.get("content-length") ?? 0) > limit) {
|
|
585
|
+
await response.body?.cancel();
|
|
586
|
+
throw failed(tooLarge);
|
|
587
|
+
}
|
|
588
|
+
const chunks = [];
|
|
589
|
+
let size = 0;
|
|
590
|
+
try {
|
|
591
|
+
for await (const chunk of response.body ?? []) {
|
|
592
|
+
size += chunk.byteLength;
|
|
593
|
+
if (size > limit) throw failed(tooLarge);
|
|
594
|
+
chunks.push(chunk);
|
|
595
|
+
}
|
|
596
|
+
} catch (error) {
|
|
597
|
+
if (error instanceof RemoteError) throw error;
|
|
598
|
+
throw failed(messageOf(error), error);
|
|
599
|
+
}
|
|
600
|
+
const body = new Uint8Array(size);
|
|
601
|
+
let offset = 0;
|
|
602
|
+
for (const chunk of chunks) {
|
|
603
|
+
body.set(chunk, offset);
|
|
604
|
+
offset += chunk.byteLength;
|
|
605
|
+
}
|
|
606
|
+
return body;
|
|
607
|
+
}
|
|
608
|
+
};
|
|
609
|
+
})();
|
|
610
|
+
function listingOf(plugin, bundles, exemptions, runtimeVersion) {
|
|
611
|
+
const versions = plugin.versions.map((version) => ({
|
|
612
|
+
...version,
|
|
613
|
+
install: marketInstallTarget(plugin.name, version),
|
|
614
|
+
compatibility: compatibilityOf(plugin.name, version, exemptions, runtimeVersion)
|
|
615
|
+
}));
|
|
616
|
+
const compatible = versions.filter((version) => version.compatibility.compatible);
|
|
617
|
+
const stable = plugin.versions.some((version) => semver.prerelease(version.version) === null);
|
|
618
|
+
const defaultVersion = compatible.find((version) => !stable || semver.prerelease(version.version) === null)?.version;
|
|
619
|
+
/* v8 ignore next -- parseMarketIndex guarantees a non-empty version list */
|
|
620
|
+
const measured = defaultVersion ?? versions[0]?.version ?? "";
|
|
621
|
+
return {
|
|
622
|
+
...plugin,
|
|
623
|
+
versions,
|
|
624
|
+
...defaultVersion === void 0 ? {} : { defaultVersion },
|
|
625
|
+
installation: installationOf(plugin.name, measured, bundles)
|
|
626
|
+
};
|
|
627
|
+
}
|
|
628
|
+
function installationOf(name, version, bundles) {
|
|
629
|
+
const bundle = bundles.find((candidate) => candidate.name === name);
|
|
630
|
+
if (bundle === void 0 || !bundle.installed && bundle.availability !== "installation") return { status: "not-installed" };
|
|
631
|
+
if (!bundle.installed) return {
|
|
632
|
+
status: "provided",
|
|
633
|
+
...bundle.version === void 0 ? {} : { installedVersion: bundle.version }
|
|
634
|
+
};
|
|
635
|
+
if (bundle.version === void 0) return { status: "different-version" };
|
|
636
|
+
const installedVersion = bundle.version;
|
|
637
|
+
if (installedVersion === version) return {
|
|
638
|
+
status: "installed",
|
|
639
|
+
installedVersion
|
|
640
|
+
};
|
|
641
|
+
return {
|
|
642
|
+
status: semver.valid(installedVersion) !== null && semver.gt(version, installedVersion) ? "update-available" : "different-version",
|
|
643
|
+
installedVersion
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
function compatibilityOf(name, version, exemptions, runtimeVersion) {
|
|
647
|
+
const issue = evaluatePluginCompatibility({
|
|
648
|
+
name,
|
|
649
|
+
version: version.version,
|
|
650
|
+
...version.engines.dsh === void 0 ? {} : { engines: { dsh: version.engines.dsh } }
|
|
651
|
+
}, exemptions, runtimeVersion);
|
|
652
|
+
if (issue === void 0) return { compatible: true };
|
|
653
|
+
return {
|
|
654
|
+
compatible: false,
|
|
655
|
+
runtimeVersion: issue.runtimeVersion,
|
|
656
|
+
requirements: issue.requirements,
|
|
657
|
+
exempted: issue.exempted
|
|
658
|
+
};
|
|
659
|
+
}
|
|
660
|
+
//#endregion
|
|
661
|
+
export { PluginMarket as default };
|