@toddzheng024/dscode-desktop 0.0.0-stage → 0.7.33
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/LICENSE +21 -0
- package/README.md +120 -2
- package/THIRD_PARTY_NOTICES.md +30 -0
- package/bin/apply_patch +9 -0
- package/cordis.patch.yml +433 -0
- package/docs/CHANGELOG.md +641 -0
- package/docs/account-login.md +44 -0
- package/docs/auto-review.md +128 -0
- package/docs/browser-use.md +783 -0
- package/docs/computer-use.md +81 -0
- package/docs/custom-providers.md +88 -0
- package/docs/demo.md +76 -0
- package/docs/distribution.md +58 -0
- package/docs/dscode-ultra.md +75 -0
- package/docs/email.md +296 -0
- package/docs/exec.md +40 -0
- package/docs/hub-distribution.md +190 -0
- package/docs/memory.md +121 -0
- package/docs/opencode-go.md +61 -0
- package/docs/plugin-hub.md +68 -0
- package/docs/releases/0.2.0.md +28 -0
- package/docs/releases/0.3.0.md +21 -0
- package/docs/releases/0.4.0.md +20 -0
- package/docs/releases/0.5.0.md +19 -0
- package/docs/releases/0.6.0.md +20 -0
- package/docs/releases/0.7.0.md +22 -0
- package/docs/releases/0.7.1.md +20 -0
- package/docs/releases/0.7.10.md +10 -0
- package/docs/releases/0.7.11.md +17 -0
- package/docs/releases/0.7.12.md +11 -0
- package/docs/releases/0.7.13.md +12 -0
- package/docs/releases/0.7.14.md +11 -0
- package/docs/releases/0.7.15.md +11 -0
- package/docs/releases/0.7.16.md +10 -0
- package/docs/releases/0.7.17.md +12 -0
- package/docs/releases/0.7.18.md +13 -0
- package/docs/releases/0.7.19.md +8 -0
- package/docs/releases/0.7.2.md +19 -0
- package/docs/releases/0.7.20.md +10 -0
- package/docs/releases/0.7.21.md +9 -0
- package/docs/releases/0.7.22.md +11 -0
- package/docs/releases/0.7.23.md +14 -0
- package/docs/releases/0.7.24.md +11 -0
- package/docs/releases/0.7.25.md +8 -0
- package/docs/releases/0.7.26.md +18 -0
- package/docs/releases/0.7.27.md +8 -0
- package/docs/releases/0.7.28.md +22 -0
- package/docs/releases/0.7.29.md +12 -0
- package/docs/releases/0.7.3.md +23 -0
- package/docs/releases/0.7.30.md +19 -0
- package/docs/releases/0.7.31.md +14 -0
- package/docs/releases/0.7.32.md +14 -0
- package/docs/releases/0.7.33.md +30 -0
- package/docs/releases/0.7.4.md +16 -0
- package/docs/releases/0.7.5.md +18 -0
- package/docs/releases/0.7.6.md +29 -0
- package/docs/releases/0.7.7.md +36 -0
- package/docs/releases/0.7.8.md +14 -0
- package/docs/releases/0.7.9.md +15 -0
- package/docs/session-bridge.md +80 -0
- package/docs/session-cards.md +53 -0
- package/docs/session-communication.md +186 -0
- package/docs/session-metrics.md +41 -0
- package/docs/skills.md +81 -0
- package/docs/triggers.md +338 -0
- package/docs/tui-commands.md +204 -0
- package/extensions/browser/manifest.json +22 -0
- package/extensions/browser/popup.css +6 -0
- package/extensions/browser/popup.html +11 -0
- package/extensions/browser/popup.mjs +47 -0
- package/extensions/browser/protocol.mjs +168 -0
- package/extensions/browser/worker.mjs +94 -0
- package/icon.svg +7 -0
- package/locale/en.json +6 -0
- package/locale/zh-cn.json +6 -0
- package/node_modules/@deepseek-ai/node-addon-system/LICENSE +21 -0
- package/node_modules/@deepseek-ai/node-addon-system/README.i18n.yaml +6 -0
- package/node_modules/@deepseek-ai/node-addon-system/README.md +15 -0
- package/node_modules/@deepseek-ai/node-addon-system/README.zh.md +15 -0
- package/node_modules/@deepseek-ai/node-addon-system/lib/flock.d.ts +13 -0
- package/node_modules/@deepseek-ai/node-addon-system/lib/flock.js +51 -0
- package/node_modules/@deepseek-ai/node-addon-system/lib/index.d.ts +73 -0
- package/node_modules/@deepseek-ai/node-addon-system/lib/index.js +98 -0
- package/node_modules/@deepseek-ai/node-addon-system/package.json +45 -0
- package/node_modules/@deepseek-ai/node-addon-system/src/flock.c +164 -0
- package/node_modules/@deepseek-ai/node-addon-system/src/main.c +298 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/LICENSE +28 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/README.i18n.yaml +6 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/README.md +9 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/README.zh.md +9 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/bin/system.node +0 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/package.json +31 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/prebuilds.json +6 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-x64/LICENSE +28 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-x64/README.i18n.yaml +6 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-x64/README.md +9 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-x64/README.zh.md +9 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-x64/bin/system.node +0 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-x64/package.json +31 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-x64/prebuilds.json +6 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/LICENSE +28 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/README.i18n.yaml +6 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/README.md +11 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/README.zh.md +11 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/bin/glibc/system.node +0 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/bin/landlock-run +0 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/bin/musl/system.node +0 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/package.json +31 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/prebuilds.json +24 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-x64/LICENSE +28 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-x64/README.i18n.yaml +6 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-x64/README.md +11 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-x64/README.zh.md +11 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-x64/bin/glibc/system.node +0 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-x64/bin/landlock-run +0 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-x64/bin/musl/system.node +0 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-x64/package.json +31 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-x64/prebuilds.json +24 -0
- package/package.json +156 -4
- package/plugins/account/index.mjs +178 -0
- package/plugins/account/state.mjs +123 -0
- package/plugins/auto-review/audit.mjs +24 -0
- package/plugins/auto-review/index.mjs +267 -0
- package/plugins/auto-review/policy.mjs +92 -0
- package/plugins/browser/SKILL.md +158 -0
- package/plugins/browser/access.mjs +143 -0
- package/plugins/browser/config.mjs +60 -0
- package/plugins/browser/connection.mjs +385 -0
- package/plugins/browser/desktop-client.mjs +282 -0
- package/plugins/browser/desktop-host.mjs +74 -0
- package/plugins/browser/document-identity.mjs +57 -0
- package/plugins/browser/extension-relay.mjs +66 -0
- package/plugins/browser/files.mjs +32 -0
- package/plugins/browser/index.mjs +235 -0
- package/plugins/browser/mcp-entry.mjs +18 -0
- package/plugins/browser/mcp-tools.mjs +21 -0
- package/plugins/browser/presentation.mjs +45 -0
- package/plugins/browser/preview.mjs +77 -0
- package/plugins/browser/review.mjs +20 -0
- package/plugins/browser/screenshots.mjs +35 -0
- package/plugins/clipboard-image/clipboard-image.swift +56 -0
- package/plugins/clipboard-image/index.mjs +70 -0
- package/plugins/code-review/baseline.mjs +143 -0
- package/plugins/code-review/git.mjs +163 -0
- package/plugins/code-review/index.mjs +236 -0
- package/plugins/compaction/engine.mjs +304 -0
- package/plugins/compaction/tetris.mjs +65 -0
- package/plugins/compaction/threshold.mjs +98 -0
- package/plugins/computer-use/DESKTOP-SKILL.md +64 -0
- package/plugins/computer-use/desktop-host.mjs +75 -0
- package/plugins/computer-use/desktop-skill.mjs +28 -0
- package/plugins/computer-use/desktop-upstream.mjs +3 -0
- package/plugins/computer-use/index.mjs +37 -0
- package/plugins/cordis-config/plain.mjs +31 -0
- package/plugins/credentials/index.mjs +73 -0
- package/plugins/custom/adapter.mjs +110 -0
- package/plugins/custom/config.mjs +85 -0
- package/plugins/custom/desktop-client.mjs +150 -0
- package/plugins/custom/desktop-host.mjs +78 -0
- package/plugins/custom/images.mjs +32 -0
- package/plugins/custom/index.mjs +145 -0
- package/plugins/custom/wire.mjs +179 -0
- package/plugins/desktop/client.mjs +1041 -0
- package/plugins/desktop/index.mjs +10 -0
- package/plugins/desktop/shell-environment.mjs +9 -0
- package/plugins/desktop-workspace/hooks.mjs +29 -0
- package/plugins/desktop-workspace/index.mjs +37 -0
- package/plugins/dscode/board.mjs +260 -0
- package/plugins/dscode/child-target.mjs +11 -0
- package/plugins/dscode/control.mjs +17 -0
- package/plugins/dscode/desktop-client.mjs +55 -0
- package/plugins/dscode/desktop-host.mjs +37 -0
- package/plugins/dscode/index.mjs +270 -0
- package/plugins/email/cli.mjs +32 -0
- package/plugins/email/contacts.mjs +36 -0
- package/plugins/email/desktop-client.mjs +117 -0
- package/plugins/email/desktop-host.mjs +54 -0
- package/plugins/email/desktop-service.mjs +106 -0
- package/plugins/email/gmail-oauth.mjs +69 -0
- package/plugins/email/gmail-store.mjs +2 -0
- package/plugins/email/gmail.mjs +194 -0
- package/plugins/email/imap.mjs +136 -0
- package/plugins/email/inbox.d.mts +25 -0
- package/plugins/email/inbox.mjs +76 -0
- package/plugins/email/smtp.mjs +70 -0
- package/plugins/email/store.mjs +32 -0
- package/plugins/email-tools/index.mjs +46 -0
- package/plugins/exec/cli.mjs +64 -0
- package/plugins/exec/index.mjs +112 -0
- package/plugins/grok/adapter.mjs +114 -0
- package/plugins/grok/auth.mjs +76 -0
- package/plugins/grok/billing.mjs +146 -0
- package/plugins/grok/index.mjs +122 -0
- package/plugins/grok/models.mjs +129 -0
- package/plugins/grok/status.mjs +28 -0
- package/plugins/grok/wire.mjs +268 -0
- package/plugins/hub/catalog.mjs +82 -0
- package/plugins/hub/desktop-client.mjs +114 -0
- package/plugins/hub/desktop-host.mjs +129 -0
- package/plugins/i18n/messages.d.mts +21 -0
- package/plugins/i18n/messages.mjs +537 -0
- package/plugins/jev/approval.mjs +131 -0
- package/plugins/jev/client.mjs +74 -0
- package/plugins/jev/index.mjs +99 -0
- package/plugins/memory/content.mjs +57 -0
- package/plugins/memory/desktop-host.mjs +3 -0
- package/plugins/memory/index.mjs +168 -0
- package/plugins/memory/pipeline.mjs +79 -0
- package/plugins/memory/store.mjs +93 -0
- package/plugins/message-source/kind.mjs +20 -0
- package/plugins/opencode-go/adapter.mjs +96 -0
- package/plugins/opencode-go/command.mjs +128 -0
- package/plugins/opencode-go/index.mjs +120 -0
- package/plugins/opencode-go/models.mjs +58 -0
- package/plugins/opencode-go/oauth.mjs +194 -0
- package/plugins/opencode-go/search.mjs +86 -0
- package/plugins/opencode-go/usage.mjs +119 -0
- package/plugins/opencode-go/version.mjs +10 -0
- package/plugins/opencode-go/wire.mjs +73 -0
- package/plugins/openrouter/adapter.mjs +232 -0
- package/plugins/openrouter/index.mjs +123 -0
- package/plugins/openrouter/models.mjs +157 -0
- package/plugins/openrouter/search.mjs +113 -0
- package/plugins/openrouter/wire.mjs +101 -0
- package/plugins/providers/catalog.mjs +160 -0
- package/plugins/providers/chat-messages.mjs +120 -0
- package/plugins/providers/chat-stream.mjs +174 -0
- package/plugins/providers/desktop-client.mjs +84 -0
- package/plugins/providers/desktop-host.mjs +63 -0
- package/plugins/providers/effort.mjs +35 -0
- package/plugins/providers/http-errors.mjs +50 -0
- package/plugins/providers/openrouter-account.mjs +171 -0
- package/plugins/session-bridge/client.mjs +106 -0
- package/plugins/session-bridge/communication.mjs +260 -0
- package/plugins/session-bridge/index.mjs +68 -0
- package/plugins/session-bridge/mailbox.mjs +267 -0
- package/plugins/session-bridge/paths.mjs +21 -0
- package/plugins/session-bridge/server.mjs +172 -0
- package/plugins/session-bridge/tasks.mjs +229 -0
- package/plugins/session-cards/content.mjs +64 -0
- package/plugins/session-cards/index.mjs +38 -0
- package/plugins/session-cards/manager.mjs +140 -0
- package/plugins/session-metrics/attribution.mjs +30 -0
- package/plugins/session-metrics/balance.mjs +81 -0
- package/plugins/session-metrics/desktop-client.mjs +62 -0
- package/plugins/session-metrics/desktop-host.mjs +46 -0
- package/plugins/session-metrics/index.mjs +96 -0
- package/plugins/session-metrics/pricing.mjs +84 -0
- package/plugins/session-metrics/rate.mjs +59 -0
- package/plugins/session-metrics/store.mjs +75 -0
- package/plugins/session-metrics/turns.mjs +134 -0
- package/plugins/session-metrics/view.mjs +271 -0
- package/plugins/time-marks/desktop-host.mjs +2 -0
- package/plugins/time-marks/index.mjs +116 -0
- package/plugins/time-marks/marks.mjs +152 -0
- package/plugins/triggers/cli.mjs +558 -0
- package/plugins/triggers/commands.mjs +143 -0
- package/plugins/triggers/config.mjs +264 -0
- package/plugins/triggers/desktop-client.mjs +155 -0
- package/plugins/triggers/desktop-host.mjs +88 -0
- package/plugins/triggers/desktop-management.mjs +97 -0
- package/plugins/triggers/desktop-scheduler.mjs +125 -0
- package/plugins/triggers/host.mjs +24 -0
- package/plugins/triggers/index.mjs +27 -0
- package/plugins/triggers/job-cli.mjs +110 -0
- package/plugins/triggers/jobs.mjs +156 -0
- package/plugins/triggers/launchd.mjs +101 -0
- package/plugins/triggers/lease.mjs +24 -0
- package/plugins/triggers/log.mjs +104 -0
- package/plugins/triggers/management.mjs +181 -0
- package/plugins/triggers/options.mjs +117 -0
- package/plugins/triggers/overlay.mjs +7 -0
- package/plugins/triggers/poll.mjs +65 -0
- package/plugins/triggers/run.mjs +157 -0
- package/plugins/triggers/schedule.mjs +40 -0
- package/plugins/triggers/scheduler-service.mjs +46 -0
- package/plugins/triggers/scheduler.mjs +92 -0
- package/plugins/triggers/session-run.mjs +125 -0
- package/plugins/triggers/session.mjs +48 -0
- package/plugins/triggers/source-emit.mjs +19 -0
- package/plugins/triggers/source-host.mjs +78 -0
- package/plugins/triggers/source-ingress.mjs +70 -0
- package/plugins/triggers/source-sandbox.mjs +35 -0
- package/plugins/triggers/sources.mjs +45 -0
- package/plugins/triggers/spool.mjs +145 -0
- package/plugins/triggers/tools.mjs +67 -0
- package/plugins/triggers/unattended.mjs +18 -0
- package/plugins/tui-tools/composition.mjs +28 -0
- package/plugins/tui-tools/desktop-host.mjs +2 -0
- package/plugins/tui-tools/doctor-cli.mjs +22 -0
- package/plugins/tui-tools/doctor.mjs +148 -0
- package/plugins/tui-tools/hook-sources.mjs +113 -0
- package/plugins/tui-tools/hooks.mjs +23 -0
- package/plugins/tui-tools/index.mjs +268 -0
- package/plugins/tui-tools/sandbox-runner.mjs +123 -0
- package/plugins/tui-tools/shell.mjs +27 -0
- package/plugins/tui-tools/update.mjs +111 -0
- package/plugins/tui-tools/workspace-discovery.mjs +129 -0
- package/plugins/ultra/policy.mjs +42 -0
- package/plugins/worktree-subagent/worktree.mjs +56 -0
- package/runtime-sources.json +94 -0
- package/vendor/bash/LICENSE +21 -0
- package/vendor/bash/index.js +717 -0
- package/vendor/bash/types/background.d.ts +50 -0
- package/vendor/bash/types/index.d.ts +38 -0
- package/vendor/bash/types/render.d.ts +57 -0
- package/vendor/command-goal/LICENSE +21 -0
- package/vendor/command-goal/index.js +210 -0
- package/vendor/command-goal/types/index.d.ts +10 -0
- package/vendor/computer-use/LICENSE +21 -0
- package/vendor/computer-use/lib/approval-policy.js +12 -0
- package/vendor/computer-use/lib/approval-policy.js.map +1 -0
- package/vendor/computer-use/lib/artifacts.js +79 -0
- package/vendor/computer-use/lib/artifacts.js.map +1 -0
- package/vendor/computer-use/lib/backend.js +3 -0
- package/vendor/computer-use/lib/backend.js.map +1 -0
- package/vendor/computer-use/lib/client.js +369 -0
- package/vendor/computer-use/lib/client.js.map +1 -0
- package/vendor/computer-use/lib/config.js +159 -0
- package/vendor/computer-use/lib/config.js.map +1 -0
- package/vendor/computer-use/lib/confirmations.js +99 -0
- package/vendor/computer-use/lib/confirmations.js.map +1 -0
- package/vendor/computer-use/lib/diff.js +58 -0
- package/vendor/computer-use/lib/diff.js.map +1 -0
- package/vendor/computer-use/lib/errors.js +22 -0
- package/vendor/computer-use/lib/errors.js.map +1 -0
- package/vendor/computer-use/lib/exposure.js +244 -0
- package/vendor/computer-use/lib/exposure.js.map +1 -0
- package/vendor/computer-use/lib/index.js +66 -0
- package/vendor/computer-use/lib/index.js.map +1 -0
- package/vendor/computer-use/lib/leases.js +262 -0
- package/vendor/computer-use/lib/leases.js.map +1 -0
- package/vendor/computer-use/lib/providers/macos.js +243 -0
- package/vendor/computer-use/lib/providers/macos.js.map +1 -0
- package/vendor/computer-use/lib/providers/native-helper.js +726 -0
- package/vendor/computer-use/lib/providers/native-helper.js.map +1 -0
- package/vendor/computer-use/lib/providers/unsupported.js +51 -0
- package/vendor/computer-use/lib/providers/unsupported.js.map +1 -0
- package/vendor/computer-use/lib/service.js +608 -0
- package/vendor/computer-use/lib/service.js.map +1 -0
- package/vendor/computer-use/lib/skill.js +136 -0
- package/vendor/computer-use/lib/skill.js.map +1 -0
- package/vendor/computer-use/lib/target-resolver.js +180 -0
- package/vendor/computer-use/lib/target-resolver.js.map +1 -0
- package/vendor/computer-use/lib/tools.js +511 -0
- package/vendor/computer-use/lib/tools.js.map +1 -0
- package/vendor/computer-use/lib/types/approval-policy.d.ts +13 -0
- package/vendor/computer-use/lib/types/approval-policy.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/artifacts.d.ts +10 -0
- package/vendor/computer-use/lib/types/artifacts.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/backend.d.ts +124 -0
- package/vendor/computer-use/lib/types/backend.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/client/index.d.ts +83 -0
- package/vendor/computer-use/lib/types/client/index.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/config.d.ts +94 -0
- package/vendor/computer-use/lib/types/config.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/confirmations.d.ts +23 -0
- package/vendor/computer-use/lib/types/confirmations.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/diff.d.ts +5 -0
- package/vendor/computer-use/lib/types/diff.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/errors.d.ts +15 -0
- package/vendor/computer-use/lib/types/errors.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/exposure.d.ts +30 -0
- package/vendor/computer-use/lib/types/exposure.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/index.d.ts +21 -0
- package/vendor/computer-use/lib/types/index.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/leases.d.ts +81 -0
- package/vendor/computer-use/lib/types/leases.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/providers/macos.d.ts +39 -0
- package/vendor/computer-use/lib/types/providers/macos.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/providers/native-helper.d.ts +48 -0
- package/vendor/computer-use/lib/types/providers/native-helper.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/providers/unsupported.d.ts +23 -0
- package/vendor/computer-use/lib/types/providers/unsupported.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/service.d.ts +58 -0
- package/vendor/computer-use/lib/types/service.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/skill.d.ts +14 -0
- package/vendor/computer-use/lib/types/skill.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/target-resolver.d.ts +38 -0
- package/vendor/computer-use/lib/types/target-resolver.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/tools.d.ts +6 -0
- package/vendor/computer-use/lib/types/tools.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/types.d.ts +270 -0
- package/vendor/computer-use/lib/types/types.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/web.d.ts +33 -0
- package/vendor/computer-use/lib/types/web.d.ts.map +1 -0
- package/vendor/computer-use/lib/types.js +9 -0
- package/vendor/computer-use/lib/types.js.map +1 -0
- package/vendor/computer-use/lib/web.js +188 -0
- package/vendor/computer-use/lib/web.js.map +1 -0
- package/vendor/computer-use/native/macos/Sources/Fixture/main.swift +412 -0
- package/vendor/computer-use/native/macos/Sources/Helper/CursorImage.swift +11 -0
- package/vendor/computer-use/native/macos/Sources/Helper/CursorMotion.swift +67 -0
- package/vendor/computer-use/native/macos/Sources/Helper/CursorOverlay.swift +840 -0
- package/vendor/computer-use/native/macos/Sources/Helper/TargetedPointer.swift +327 -0
- package/vendor/computer-use/native/macos/Sources/Helper/WindowNumberMatcher.swift +29 -0
- package/vendor/computer-use/native/macos/Sources/Helper/main.swift +1244 -0
- package/vendor/computer-use/native/macos/Sources/Monitor/main.swift +153 -0
- package/vendor/computer-use/native/macos/bin/dsh-computer-use-helper +0 -0
- package/vendor/computer-use/native/macos/manifest.json +14 -0
- package/vendor/persistent/LICENSE +21 -0
- package/vendor/persistent/index.js +411 -0
- package/vendor/persistent/types/index.d.ts +24 -0
- package/vendor/subagent/LICENSE +21 -0
- package/vendor/subagent/index.js +694 -0
- package/vendor/subagent/invariant.js +52 -0
- package/vendor/subagent/model-selection-settings.js +68 -0
- package/vendor/subagent/types/index.d.ts +82 -0
- package/vendor/subagent/types/invariant.d.ts +16 -0
- package/vendor/subagent/types/list-models.d.ts +10 -0
- package/vendor/subagent/types/model-selection-settings.d.ts +45 -0
- package/vendor/subagent/types/model-selection-state.d.ts +48 -0
- package/vendor/subagent/types/model-selection.d.ts +81 -0
- package/vendor/subagent-core/LICENSE +21 -0
- package/vendor/subagent-core/index.js +3202 -0
- package/vendor/subagent-core/invariant.js +76 -0
- package/vendor/subagent-core/typert.host.d.ts +3 -0
- package/vendor/subagent-core/typert.host.js +978 -0
- package/vendor/subagent-core/typert.remote-client.d.ts +25 -0
- package/vendor/subagent-core/typert.remote-client.js +114 -0
- package/vendor/subagent-core/types/archive-admission.d.ts +16 -0
- package/vendor/subagent-core/types/archive-admission.js +151 -0
- package/vendor/subagent-core/types/assistant-output.d.ts +48 -0
- package/vendor/subagent-core/types/assistant-output.js +73 -0
- package/vendor/subagent-core/types/catalog.d.ts +84 -0
- package/vendor/subagent-core/types/catalog.js +109 -0
- package/vendor/subagent-core/types/child-agent.d.ts +156 -0
- package/vendor/subagent-core/types/child-agent.js +213 -0
- package/vendor/subagent-core/types/client.d.ts +8 -0
- package/vendor/subagent-core/types/client.js +7 -0
- package/vendor/subagent-core/types/continuation-activation.d.ts +267 -0
- package/vendor/subagent-core/types/continuation-activation.js +700 -0
- package/vendor/subagent-core/types/continuation-messages.d.ts +62 -0
- package/vendor/subagent-core/types/continuation-messages.js +106 -0
- package/vendor/subagent-core/types/continuation.d.ts +124 -0
- package/vendor/subagent-core/types/continuation.js +455 -0
- package/vendor/subagent-core/types/control-types.d.ts +135 -0
- package/vendor/subagent-core/types/control-types.js +8 -0
- package/vendor/subagent-core/types/control.d.ts +45 -0
- package/vendor/subagent-core/types/control.js +79 -0
- package/vendor/subagent-core/types/depth.d.ts +31 -0
- package/vendor/subagent-core/types/depth.js +39 -0
- package/vendor/subagent-core/types/descriptor.d.ts +144 -0
- package/vendor/subagent-core/types/descriptor.js +193 -0
- package/vendor/subagent-core/types/error.d.ts +11 -0
- package/vendor/subagent-core/types/error.js +14 -0
- package/vendor/subagent-core/types/inbox.d.ts +43 -0
- package/vendor/subagent-core/types/inbox.js +61 -0
- package/vendor/subagent-core/types/index.d.ts +320 -0
- package/vendor/subagent-core/types/index.js +475 -0
- package/vendor/subagent-core/types/internal.d.ts +58 -0
- package/vendor/subagent-core/types/internal.js +58 -0
- package/vendor/subagent-core/types/invariant.d.ts +13 -0
- package/vendor/subagent-core/types/invariant.js +91 -0
- package/vendor/subagent-core/types/lifecycle.d.ts +113 -0
- package/vendor/subagent-core/types/lifecycle.js +180 -0
- package/vendor/subagent-core/types/list-children.d.ts +36 -0
- package/vendor/subagent-core/types/list-children.js +166 -0
- package/vendor/subagent-core/types/out-of-process.d.ts +118 -0
- package/vendor/subagent-core/types/out-of-process.js +219 -0
- package/vendor/subagent-core/types/projection-types.d.ts +82 -0
- package/vendor/subagent-core/types/projection-types.js +7 -0
- package/vendor/subagent-core/types/projection.d.ts +100 -0
- package/vendor/subagent-core/types/projection.js +157 -0
- package/vendor/subagent-core/types/run-settlement.d.ts +17 -0
- package/vendor/subagent-core/types/run-settlement.js +70 -0
- package/vendor/subagent-core/types/types.d.ts +377 -0
- package/vendor/subagent-core/types/types.js +19 -0
- package/vendor/subagent-driver/LICENSE +21 -0
- package/vendor/subagent-driver/index.js +255 -0
- package/vendor/subagent-driver/types/index.d.ts +33 -0
- package/vendor/subagent-driver/types/structured.d.ts +42 -0
- package/vendor/subagent-fork/LICENSE +21 -0
- package/vendor/subagent-fork/index.js +61 -0
- package/vendor/subagent-fork/types/index.d.ts +20 -0
- package/vendor/subagent-spawn/LICENSE +21 -0
- package/vendor/subagent-spawn/index.js +45 -0
- package/vendor/subagent-spawn/types/index.d.ts +19 -0
- package/vendor/terminal/LICENSE +21 -0
- package/vendor/terminal/index.js +1093 -0
- package/vendor/terminal/types/config.d.ts +82 -0
- package/vendor/terminal/types/index.d.ts +36 -0
- package/vendor/terminal/types/sanitize.d.ts +47 -0
- package/vendor/terminal/types/session.d.ts +87 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { spawn, spawnSync } from 'node:child_process';
|
|
2
|
+
import { existsSync, mkdirSync, appendFileSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { dirname, join, resolve } from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
|
|
6
|
+
// DSCODE update surface for the TUI: the `/update` command schedules this module as a
|
|
7
|
+
// detached helper, which waits for the interactive session to exit and then runs the
|
|
8
|
+
// same `dscode update` entry the CLI uses (npm/Hub launcher or tar/source self-update).
|
|
9
|
+
|
|
10
|
+
export const LAUNCHER_PACKAGE = '@toddzheng024/dscode';
|
|
11
|
+
export const REGISTRY_URL = `https://registry.npmjs.org/${LAUNCHER_PACKAGE}/latest`;
|
|
12
|
+
export const VERSION_PATTERN = /^\d+\.\d+\.\d+(?:-[\w.-]+)?$/;
|
|
13
|
+
|
|
14
|
+
/** Whether `candidate` is newer than `current`; a prerelease sorts below its release. */
|
|
15
|
+
export function newerVersion(candidate, current) {
|
|
16
|
+
const split = value => {
|
|
17
|
+
const text = String(value);
|
|
18
|
+
const at = text.indexOf('-');
|
|
19
|
+
return { core: (at === -1 ? text : text.slice(0, at)).split('.').map(Number), pre: at === -1 ? '' : text.slice(at + 1) };
|
|
20
|
+
};
|
|
21
|
+
const left = split(candidate), right = split(current);
|
|
22
|
+
for (let index = 0; index < Math.max(left.core.length, right.core.length); index++) {
|
|
23
|
+
const x = left.core[index] ?? 0, y = right.core[index] ?? 0;
|
|
24
|
+
if (x !== y) return x > y;
|
|
25
|
+
}
|
|
26
|
+
if (left.pre === right.pre) return false;
|
|
27
|
+
if (left.pre === '') return true;
|
|
28
|
+
if (right.pre === '') return false;
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Newest launcher version on npm, or undefined when the registry cannot be read. */
|
|
33
|
+
export async function fetchLatestVersion({ fetchImpl = fetch, timeoutMs = 8000 } = {}) {
|
|
34
|
+
const controller = new AbortController();
|
|
35
|
+
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
36
|
+
try {
|
|
37
|
+
// Plain JSON: the registry answers 406 for the abbreviated metadata type on the
|
|
38
|
+
// `/latest` dist-tag endpoint.
|
|
39
|
+
const response = await fetchImpl(REGISTRY_URL, { headers: { accept: 'application/json' }, signal: controller.signal });
|
|
40
|
+
if (!response.ok) return undefined;
|
|
41
|
+
const version = (await response.json())?.version;
|
|
42
|
+
return typeof version === 'string' && VERSION_PATTERN.test(version) ? version : undefined;
|
|
43
|
+
} catch { return undefined; }
|
|
44
|
+
finally { clearTimeout(timer); }
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** State directory shared by every install shape, matching the launcher's own default. */
|
|
48
|
+
export function stateHome(env = process.env, home = process.env.HOME) {
|
|
49
|
+
return resolve(env.DSH_HOME || env.DSCODE_HOME || join(home ?? '.', '.local/share/dscode-hub'));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The command that upgrades this installation once no session is running: a sibling
|
|
54
|
+
* `bin/dscode.mjs` for tar and source trees, otherwise the npm launcher from PATH.
|
|
55
|
+
*/
|
|
56
|
+
export function planUpdate({ moduleUrl, version = 'latest', execPath = process.execPath } = {}) {
|
|
57
|
+
const root = resolve(dirname(fileURLToPath(moduleUrl)), '..', '..');
|
|
58
|
+
const entry = join(root, 'bin/dscode.mjs');
|
|
59
|
+
if (existsSync(entry)) return { label: `tar/source ${root}`, command: execPath, args: [entry, 'update', version] };
|
|
60
|
+
if (existsSync(join(root, 'node_modules', LAUNCHER_PACKAGE, 'cli.mjs'))) return { label: 'npm launcher (bundle tree)', command: execPath, args: [join(root, 'node_modules', LAUNCHER_PACKAGE, 'cli.mjs'), 'update', version] };
|
|
61
|
+
return { label: 'npm/Hub launcher from PATH', command: 'dscode', args: ['update', version] };
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** Start the detached helper that finishes the update once `pid` (the TUI) exits. */
|
|
65
|
+
export function scheduleUpdate({ helperModuleUrl, pid, version = 'latest', env = process.env, spawnImpl = spawn, execPath = process.execPath }) {
|
|
66
|
+
const helper = fileURLToPath(helperModuleUrl);
|
|
67
|
+
const child = spawnImpl(execPath, [helper, String(pid), version], { detached: true, stdio: 'ignore', env });
|
|
68
|
+
child.unref();
|
|
69
|
+
return { helper, log: logPath(stateHome(env)) };
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function logPath(home) {
|
|
73
|
+
return join(home, 'update.log');
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function append(log, text) {
|
|
77
|
+
mkdirSync(dirname(log), { recursive: true, mode: 0o700 });
|
|
78
|
+
appendFileSync(log, text.endsWith('\n') ? text : `${text}\n`, { mode: 0o600 });
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export async function runUpdateAfterExit({ pid, version = 'latest', home, moduleUrl = import.meta.url, spawnImpl, now = Date.now, sleep = ms => new Promise(resolvePromise => setTimeout(resolvePromise, ms)), maxWaitMs = 12 * 3600000 } = {}) {
|
|
82
|
+
const log = logPath(home);
|
|
83
|
+
const started = now();
|
|
84
|
+
append(log, `${new Date(started).toISOString()} scheduled: pid ${pid} exit, then ${version}`);
|
|
85
|
+
while (now() - started < maxWaitMs) {
|
|
86
|
+
let alive = true;
|
|
87
|
+
try { process.kill(pid, 0); } catch { alive = false; }
|
|
88
|
+
if (!alive) break;
|
|
89
|
+
await sleep(1000);
|
|
90
|
+
}
|
|
91
|
+
await sleep(1500);
|
|
92
|
+
const plan = planUpdate({ moduleUrl, version });
|
|
93
|
+
append(log, `${new Date().toISOString()} running: ${plan.command} ${plan.args.join(' ')} (${plan.label})`);
|
|
94
|
+
const result = await spawnImpl(plan.command, plan.args, { stdio: ['ignore', 'pipe', 'pipe'], env: process.env });
|
|
95
|
+
const output = `${result.stdout ?? ''}${result.stderr ?? ''}`.trim();
|
|
96
|
+
if (output) append(log, output);
|
|
97
|
+
const ok = result.status === 0;
|
|
98
|
+
append(log, `${new Date().toISOString()} ${ok ? 'finished' : `failed with ${result.status ?? result.signal}`}`);
|
|
99
|
+
writeFileSync(join(home, 'update-result.json'), `${JSON.stringify({ version, status: ok ? 'done' : 'failed', code: result.status ?? null, at: new Date().toISOString(), log }, null, 2)}\n`, { mode: 0o600 });
|
|
100
|
+
return { status: ok ? 'done' : 'failed', log };
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
async function main(argv) {
|
|
104
|
+
const [pid, version = 'latest'] = argv;
|
|
105
|
+
const home = stateHome();
|
|
106
|
+
await runUpdateAfterExit({ pid: Number(pid), version, home, moduleUrl: import.meta.url,
|
|
107
|
+
spawnImpl: (command, args, options) => spawnSync(command, args, { ...options, encoding: 'utf8' }) });
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const isEntry = process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url);
|
|
111
|
+
if (isEntry) main(process.argv.slice(2)).catch(error => { try { append(logPath(stateHome()), `${new Date().toISOString()} helper failed: ${error.message}`); } catch { /* best effort */ } });
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, realpathSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, join, resolve, sep } from 'node:path';
|
|
3
|
+
|
|
4
|
+
// Discovery above the project root, bounded at the home directory rather than the
|
|
5
|
+
// filesystem root: a shared workspace directory such as ~/Workspace can contribute
|
|
6
|
+
// skills and instructions to every project below it, while nothing outside the
|
|
7
|
+
// operator's own tree can.
|
|
8
|
+
export const ancestorSkillRoots = Object.freeze(['.dsh/skills', '.agents/skills', '.claude/skills']);
|
|
9
|
+
export const instructionFileCandidates = Object.freeze(['AGENTS.md', 'CLAUDE.md']);
|
|
10
|
+
export const projectRootMarkers = Object.freeze(['.git']);
|
|
11
|
+
|
|
12
|
+
export const ENABLED_VALUES = Object.freeze(['1', 'true', 'on', 'yes']);
|
|
13
|
+
// Fail closed: only the documented enable spellings read as on, so an operator
|
|
14
|
+
// writing "no", "none" or "disable" cannot accidentally arm a feature that reads
|
|
15
|
+
// untrusted project content.
|
|
16
|
+
export const enabledFlag = (value) => ENABLED_VALUES.includes(String(value ?? '').trim().toLowerCase());
|
|
17
|
+
// Ancestor skill discovery defaults to on, so its switch is the inverse: only an
|
|
18
|
+
// explicit off spelling disables it and an unrecognised value keeps the default.
|
|
19
|
+
export const DISABLED_VALUES = Object.freeze(['0', 'false', 'off', 'no', 'none', 'disable']);
|
|
20
|
+
export const disabledFlag = (value) => DISABLED_VALUES.includes(String(value ?? '').trim().toLowerCase());
|
|
21
|
+
export const skillAncestorsEnabled = (env = process.env) => !disabledFlag(env.DSCODE_SKILL_ANCESTORS);
|
|
22
|
+
|
|
23
|
+
// A symlinked $HOME (or a /Volumes mount) must not break the boundary test: the
|
|
24
|
+
// launcher passes an already-resolved session directory while os.homedir() returns
|
|
25
|
+
// whatever $HOME says, so the comparison canonicalizes both sides. The chain itself
|
|
26
|
+
// keeps the caller's logical paths, which is what the skill and instruction probes
|
|
27
|
+
// then stat.
|
|
28
|
+
const canonical = path => { try { return realpathSync(path); } catch { return resolve(path); } };
|
|
29
|
+
|
|
30
|
+
// Every directory from the working directory up to home, nearest first. An empty
|
|
31
|
+
// list means home is not an ancestor, and the mode then contributes nothing.
|
|
32
|
+
export function ancestorChain({ cwd, home }) {
|
|
33
|
+
const start = resolve(cwd);
|
|
34
|
+
const stop = resolve(home);
|
|
35
|
+
const canonicalStop = canonical(stop);
|
|
36
|
+
const canonicalStart = canonical(start);
|
|
37
|
+
if (canonicalStart !== canonicalStop && !canonicalStart.startsWith(canonicalStop + sep)) return [];
|
|
38
|
+
const chain = [];
|
|
39
|
+
for (let current = start; ;) {
|
|
40
|
+
chain.push(current);
|
|
41
|
+
if (canonical(current) === canonicalStop) break;
|
|
42
|
+
const parent = dirname(current);
|
|
43
|
+
if (parent === current) break;
|
|
44
|
+
current = parent;
|
|
45
|
+
}
|
|
46
|
+
return chain;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function projectRootOf({ cwd, markers = projectRootMarkers }) {
|
|
50
|
+
const start = resolve(cwd);
|
|
51
|
+
for (let current = start; ;) {
|
|
52
|
+
if (markers.some(marker => existsSync(join(current, marker)))) return current;
|
|
53
|
+
const parent = dirname(current);
|
|
54
|
+
if (parent === current) return start;
|
|
55
|
+
current = parent;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Nearest first, which is also precedence: the provider scans `customSkillDirs` in
|
|
60
|
+
// order and the first definition of a duplicate name wins. The provider's own rank
|
|
61
|
+
// 100/200 roots at the project root still outrank everything registered here.
|
|
62
|
+
export function ancestorSkillDirs({ cwd, home, env = process.env }) {
|
|
63
|
+
if (!skillAncestorsEnabled(env)) return [];
|
|
64
|
+
const projectRoot = projectRootOf({ cwd });
|
|
65
|
+
const dirs = [];
|
|
66
|
+
for (const dir of ancestorChain({ cwd, home })) {
|
|
67
|
+
for (const root of ancestorSkillRoots) {
|
|
68
|
+
// The provider already scans these two at rank 100/200 for the owning project.
|
|
69
|
+
if (dir === projectRoot && (root === '.dsh/skills' || root === '.agents/skills')) continue;
|
|
70
|
+
const path = join(dir, root);
|
|
71
|
+
if (existsSync(path) && !dirs.includes(path)) dirs.push(path);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return dirs;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Instruction files strictly above the project root, farthest first so the chain
|
|
78
|
+
// still reads broad to specific. The project chain itself stays upstream's job.
|
|
79
|
+
export function ancestorInstructionFiles({ cwd, home }) {
|
|
80
|
+
const chain = ancestorChain({ cwd, home });
|
|
81
|
+
// The chain runs from the working directory outward, so everything after the
|
|
82
|
+
// project root is above it; reversing restores broad-to-specific order.
|
|
83
|
+
const stop = chain.indexOf(projectRootOf({ cwd }));
|
|
84
|
+
const above = (stop === -1 ? chain : chain.slice(stop + 1)).reverse();
|
|
85
|
+
const files = [];
|
|
86
|
+
for (const dir of above) {
|
|
87
|
+
for (const name of instructionFileCandidates) {
|
|
88
|
+
const path = join(dir, name);
|
|
89
|
+
if (existsSync(path)) files.push(path);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return files;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// The provider ignores a source file that cannot fit its render budget, and the
|
|
96
|
+
// aggregate below occupies the broadest (user-global) slot: without a bound, one
|
|
97
|
+
// oversized ancestor file would take the user-global instructions down with it.
|
|
98
|
+
// Stay under the preset's 64 KiB maxBytes with headroom.
|
|
99
|
+
export const AGGREGATE_BUDGET_BYTES = 60 * 1024;
|
|
100
|
+
|
|
101
|
+
// The upstream provider owns exactly one user-global instruction file, so ancestor
|
|
102
|
+
// files are folded in behind it. With no ancestor file this writes nothing and
|
|
103
|
+
// changes nothing: the provider keeps reading $DSH_HOME/AGENTS.md where it always did.
|
|
104
|
+
// The user-global file is always written: dropping it in favour of its descendants
|
|
105
|
+
// would silently replace what the user wrote with what the project wrote. Ancestors
|
|
106
|
+
// are then added nearest-first while the budget allows, and a source that would
|
|
107
|
+
// overflow is skipped whole rather than truncated mid-file.
|
|
108
|
+
export function writeWorkspaceInstructions({ cwd, home, stateDir, outputDir = join(stateDir, 'workspace-instructions') }) {
|
|
109
|
+
const files = ancestorInstructionFiles({ cwd, home });
|
|
110
|
+
if (!files.length) return undefined;
|
|
111
|
+
const userGlobal = join(stateDir, 'AGENTS.md');
|
|
112
|
+
const texts = new Map();
|
|
113
|
+
if (existsSync(userGlobal)) texts.set(userGlobal, readFileSync(userGlobal, 'utf8').trim());
|
|
114
|
+
for (const file of files) texts.set(file, readFileSync(file, 'utf8').trim());
|
|
115
|
+
const written = [...texts.keys()];
|
|
116
|
+
const priority = written[0] === userGlobal ? [userGlobal, ...written.slice(1).reverse()] : [...written].reverse();
|
|
117
|
+
const kept = new Set();
|
|
118
|
+
let bytes = 0;
|
|
119
|
+
for (const source of priority) {
|
|
120
|
+
const size = Buffer.byteLength(texts.get(source), 'utf8') + 2;
|
|
121
|
+
if (kept.size > 0 && bytes + size > AGGREGATE_BUDGET_BYTES) continue;
|
|
122
|
+
kept.add(source);
|
|
123
|
+
bytes += size;
|
|
124
|
+
}
|
|
125
|
+
const directory = outputDir;
|
|
126
|
+
mkdirSync(directory, { recursive: true });
|
|
127
|
+
writeFileSync(join(directory, 'AGENTS.md'), written.filter(source => kept.has(source)).map(source => texts.get(source)).join('\n\n') + '\n', { mode: 0o600 });
|
|
128
|
+
return directory;
|
|
129
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export const ULTRA_POLICY = `DSCODE ULTRA — max reasoning with task-proportional execution.
|
|
2
|
+
Use the depth needed to resolve actual uncertainty. Ultra is capability available on demand, not a requirement to maximize investigation, planning, delegation or verification. Briefly choose the smallest sufficient approach, then act. Do not repeatedly reassess a decision without new evidence.
|
|
3
|
+
For a bounded task such as adding a unit test, a small bug fix or a local edit: work directly in the parent. Read the target implementation, applicable instructions and a nearby relevant example; make the requested change; run the focused test and required project checks; fix observed failures; then report the result and stop. Do not scan the whole repository, add a formal plan, launch reviewers, broaden coverage or refactor unrelated code unless concrete evidence makes it necessary. Once acceptance criteria and required checks pass, do not invent additional work or rerun passing checks without a relevant change. If the task turns out to involve an unclear contract, a broad regression or a shared interface, expand only to resolve that specific uncertainty.
|
|
4
|
+
When delegating, explicitly choose reasoning_effort for each child instead of automatically propagating ultra. Prefer low for bounded implementation, unit tests and factual lookup; high for nontrivial debugging or review; max for exceptional uncertainty or complex design. These are guidelines, not a substitute for judging the task. Use only efforts supported by the child model. Omission inherits the parent; choosing a child effort never changes the parent effort. Both subagent and subagent_fork support effort-only selection.
|
|
5
|
+
For substantial tasks, delegate only independent work that is likely to shorten completion or resolve meaningful uncertainty. Before delegating, identify the independent boundary, concrete wall-clock benefit, and useful work you will do while the child runs. Give each child a bounded objective, relevant context, file ownership and acceptance criteria. Give each child a unique name (1-10 characters, letters, digits and underscores, starting and ending with a letter, such as read_code) and address it as /name in send_message and interrupt_agent; a child addresses you as /. Prefer subagent_fork when established conversation history is relevant; use fresh subagent for self-contained work that does not benefit from that history. Fork excludes the current unfinished turn, so always give a self-contained assignment. Keep useful work for yourself while children run. For read-only work or tasks needing the parent's uncommitted files, omit worktree and assign disjoint files if writing. For independent parallel edits on a clean repository, set worktree: true; the child starts at HEAD in an isolated checkout. Never have multiple agents edit the same files in a shared workspace. Inspect and integrate worktree changes before removing the checkout.
|
|
6
|
+
In ultra use subagent/subagent_fork and send_message for delegation, not workflow or ralph. Use at most twenty child agents concurrently across this root session; start only as many as have genuinely independent work. Children complete their assigned work themselves and cannot delegate again; do not duplicate investigations across agents. The parent owns integration, verifies child claims, resolves conflicts and runs appropriate checks. Seek independent review of substantial changes when useful; do not add a review round merely because ultra is enabled. Parent/child messages are available; sibling direct messaging is not. Preserve the user's permission policy: ultra grants no extra authority. Reuse findings and stop delegating when coordination costs outweigh value. If progress stalls, name the concrete blocker and take the next diagnostic step rather than silently extending deliberation.`;
|
|
7
|
+
|
|
8
|
+
export const FLASH_POLICY = `DSCODE DeepSeek Flash — use task-proportional effort. For a simple question, answer directly. For a bounded coding change, read the relevant code, make the change, run the focused check, and stop when it passes. Avoid repeated planning, broad repository scans, speculative edge cases, extra review rounds, or repeated tests unless a concrete failure or uncertainty calls for them. Keep explanations concise while reporting the result and any real limitation.`;
|
|
9
|
+
|
|
10
|
+
export function flashRequest(options, messages) {
|
|
11
|
+
if (options.model !== 'deepseek-flash' || options.purpose || !options.sessionId) return messages;
|
|
12
|
+
const copy = messages.map(m => ({ ...m }));
|
|
13
|
+
const system = copy.findLast(m => m.role === 'system' && typeof m.content === 'string');
|
|
14
|
+
if (system) system.content += '\n\n' + FLASH_POLICY;
|
|
15
|
+
else copy.unshift({ role: 'system', content: FLASH_POLICY });
|
|
16
|
+
return copy;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function ultraRequest(options, messages) {
|
|
20
|
+
if (options.reasoningEffort !== 'ultra' || options.purpose || !options.tools?.some(t => t.name === 'subagent' || t.name === 'subagent_fork')) return messages;
|
|
21
|
+
const copy = messages.map(m => ({ ...m }));
|
|
22
|
+
const system = copy.findLast(m => m.role === 'system' && typeof m.content === 'string');
|
|
23
|
+
if (system) system.content += '\n\n' + ULTRA_POLICY;
|
|
24
|
+
else copy.unshift({ role: 'system', content: ULTRA_POLICY });
|
|
25
|
+
return copy;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* DSH 0.1.7 rewrote the DeepSeek adapter onto the Messages API, where the system
|
|
30
|
+
* prompt is a request field rather than a leading message. These two carry the same
|
|
31
|
+
* gates as the message-shaped pair above, which the OpenRouter, Grok and OpenCode Go adapters
|
|
32
|
+
* still use, and stay self-contained: `patch-runtime` embeds them by `toString()`.
|
|
33
|
+
*/
|
|
34
|
+
export function ultraSystem(options, system) {
|
|
35
|
+
if (options.reasoningEffort !== 'ultra' || options.purpose || !options.tools?.some(t => t.name === 'subagent' || t.name === 'subagent_fork')) return system;
|
|
36
|
+
return system.length === 0 ? ULTRA_POLICY : system + '\n\n' + ULTRA_POLICY;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function flashSystem(options, system) {
|
|
40
|
+
if (options.model !== 'deepseek-flash' || options.purpose || !options.sessionId) return system;
|
|
41
|
+
return system.length === 0 ? FLASH_POLICY : system + '\n\n' + FLASH_POLICY;
|
|
42
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { execFile } from 'node:child_process';
|
|
3
|
+
import { appendFileSync, existsSync, lstatSync, mkdirSync, readFileSync, realpathSync } from 'node:fs';
|
|
4
|
+
import { isAbsolute, join, resolve } from 'node:path';
|
|
5
|
+
import { promisify } from 'node:util';
|
|
6
|
+
|
|
7
|
+
const execFileAsync = promisify(execFile);
|
|
8
|
+
async function git(cwd, args, signal, timeout = 60000) {
|
|
9
|
+
try {
|
|
10
|
+
const { stdout } = await execFileAsync('git', ['-C', cwd, ...args], { encoding: 'utf8', maxBuffer: 1024 * 1024, timeout, signal });
|
|
11
|
+
return stdout.trim();
|
|
12
|
+
} catch (error) {
|
|
13
|
+
if (signal?.aborted) throw error;
|
|
14
|
+
throw new Error((error.stderr || error.stdout || error.message).trim(), { cause: error });
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** The parent's Git root, once it can host child worktrees: an absolute, clean repository root. */
|
|
19
|
+
export async function worktreeBase(parentCwd, signal) {
|
|
20
|
+
if (typeof parentCwd !== 'string' || !isAbsolute(parentCwd)) throw new Error('Subagent worktree requires an absolute parent workspace.');
|
|
21
|
+
const root = realpathSync(await git(parentCwd, ['rev-parse', '--show-toplevel'], signal));
|
|
22
|
+
if (root !== realpathSync(parentCwd)) throw new Error('Subagent worktree requires the parent session to start at its Git repository root.');
|
|
23
|
+
const status = await git(root, ['status', '--porcelain=v1', '--untracked-files=all'], signal);
|
|
24
|
+
if (status) throw new Error('Subagent worktree starts at HEAD, but the parent workspace has uncommitted changes. Use the shared workspace for work that needs those changes, or commit/stash them first.');
|
|
25
|
+
return root;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export async function createChildWorktree(parentCwd, signal) {
|
|
29
|
+
const root = await worktreeBase(parentCwd, signal);
|
|
30
|
+
const directory = join(root, '.dscode-worktrees');
|
|
31
|
+
if (await git(root, ['ls-files', '--', '.dscode-worktrees'], signal)) throw new Error('The repository tracks .dscode-worktrees; choose a different workspace before delegating.');
|
|
32
|
+
if (lstatSync(directory, { throwIfNoEntry: false })?.isSymbolicLink()) throw new Error('Refusing a symlinked .dscode-worktrees directory.');
|
|
33
|
+
const excludePath = resolve(root, await git(root, ['rev-parse', '--git-path', 'info/exclude'], signal));
|
|
34
|
+
const exclude = existsSync(excludePath) ? readFileSync(excludePath, 'utf8') : '';
|
|
35
|
+
if (!exclude.split(/\r?\n/).includes('/.dscode-worktrees/')) {
|
|
36
|
+
mkdirSync(resolve(excludePath, '..'), { recursive: true });
|
|
37
|
+
appendFileSync(excludePath, `${exclude && !exclude.endsWith('\n') ? '\n' : ''}/.dscode-worktrees/\n`);
|
|
38
|
+
}
|
|
39
|
+
mkdirSync(directory, { recursive: true });
|
|
40
|
+
const path = join(directory, randomUUID());
|
|
41
|
+
signal?.throwIfAborted();
|
|
42
|
+
try { await git(root, ['worktree', 'add', '--detach', path, 'HEAD'], signal); }
|
|
43
|
+
catch (error) {
|
|
44
|
+
try { await git(root, ['worktree', 'remove', '--force', path], undefined, 1500); } catch { /* Git may already have cleaned up. */ }
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
return { cwd: path, parentCwd: root };
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export async function discardCleanChildWorktree(worktree) {
|
|
51
|
+
try {
|
|
52
|
+
if (await git(worktree.cwd, ['status', '--porcelain=v1', '--untracked-files=all'])) return false;
|
|
53
|
+
await git(worktree.parentCwd, ['worktree', 'remove', worktree.cwd]);
|
|
54
|
+
return true;
|
|
55
|
+
} catch { return false; }
|
|
56
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
{
|
|
2
|
+
"runtime": "0.2.0-rc.2",
|
|
3
|
+
"sources": [
|
|
4
|
+
{
|
|
5
|
+
"package": "@deepseek-ai/dsh-tool-bash",
|
|
6
|
+
"version": "0.2.0-rc.2",
|
|
7
|
+
"entrySha256": "0c63a09e4b80ec22db256eac4ecab6f7de3a342e16ec590348a40c5f356eff1a"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"package": "@deepseek-ai/dsh-tool-bash-persistent",
|
|
11
|
+
"version": "0.2.0-rc.2",
|
|
12
|
+
"entrySha256": "2cc6627cc2e02ab65960e124f8c249045024fffe2563ab3507f7fbed9872acdc"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"package": "@deepseek-ai/dsh-terminal-bash",
|
|
16
|
+
"version": "0.2.0-rc.2",
|
|
17
|
+
"entrySha256": "24df85fc9a410308c3f145bd773e517e9fd86623eb60c3228703a803513c9c00"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"package": "@deepseek-ai/dsh-tool-subagent",
|
|
21
|
+
"version": "0.2.0-rc.2",
|
|
22
|
+
"entrySha256": "26a1e804aab4c6f9cb53a670c63b817fc8d9409569e6d68eda6fda33b966a840"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"package": "@deepseek-ai/dsh-subagent",
|
|
26
|
+
"version": "0.2.0-rc.2",
|
|
27
|
+
"entrySha256": "75b50b1c9452a6aeb10d1c859e3f45b05e062ea1fad6ed3bcd9577f2bc912541"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"package": "@deepseek-ai/dsh-subagent-in-process-driver",
|
|
31
|
+
"version": "0.2.0-rc.2",
|
|
32
|
+
"entrySha256": "a169b6dac8f9fd0ef6e8db4ec0d2c009580c5c10b6d561e6d214cbe9b89521d1"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"package": "@deepseek-ai/dsh-subagent-spawn-in-process",
|
|
36
|
+
"version": "0.2.0-rc.2",
|
|
37
|
+
"entrySha256": "11c92108dd145957f8251a81fc9bfb8a30e7f6f25d96e34a5cb8581a4be4be06"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"package": "@deepseek-ai/dsh-subagent-fork-in-process",
|
|
41
|
+
"version": "0.2.0-rc.2",
|
|
42
|
+
"entrySha256": "03ba69c10e8da1053f3997bfe6845cc72dfedd1b8f4d795e4b039f8659cfe620"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"package": "@deepseek-ai/dsh-command-goal",
|
|
46
|
+
"version": "0.2.0-rc.2",
|
|
47
|
+
"entrySha256": "ba117f69b62db6ae1d8e546515f1f3309ed4a5ce246223e70315475396f9e5c1"
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"nativePackages": [
|
|
51
|
+
{
|
|
52
|
+
"name": "@deepseek-ai/node-addon-system",
|
|
53
|
+
"version": "0.1.2",
|
|
54
|
+
"integrity": "sha512-EFn8K+mXIXiw6s3rxX+cgp2hZTEAQdVIsURhrXnBxycSXvtQ1EQpsSVzoNKtKAQI0I0VqkEcVEjHzS/PeaGsvw==",
|
|
55
|
+
"resolved": "https://registry.npmjs.org/@deepseek-ai/node-addon-system/-/node-addon-system-0.1.2.tgz"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "@deepseek-ai/node-addon-system-darwin-arm64",
|
|
59
|
+
"version": "0.1.2",
|
|
60
|
+
"integrity": "sha512-IR0cx8um19mLCZaJ+H5PLblKr6Eg3PWvVo8eTQBr/SwH2nh5tM9CD9/5fHweNS9Pjt15UdFlGqnvLSd/w+O6Rw==",
|
|
61
|
+
"resolved": "https://registry.npmjs.org/@deepseek-ai/node-addon-system-darwin-arm64/-/node-addon-system-darwin-arm64-0.1.2.tgz"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "@deepseek-ai/node-addon-system-darwin-x64",
|
|
65
|
+
"version": "0.1.2",
|
|
66
|
+
"integrity": "sha512-XDbmquNapk9aT28y4EKn9lbONVr9YNs1NM/GKH1Gi5gUhjOT9wgRaTv72FJdNaVIInbPAYbPoyn7/y+MzQMNNg==",
|
|
67
|
+
"resolved": "https://registry.npmjs.org/@deepseek-ai/node-addon-system-darwin-x64/-/node-addon-system-darwin-x64-0.1.2.tgz"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"name": "@deepseek-ai/node-addon-system-linux-arm64",
|
|
71
|
+
"version": "0.1.2",
|
|
72
|
+
"integrity": "sha512-Z/DQtqgEYzjBzb2ocHGjMzx51W7xDILkJKKj89nyErr8gZMNiLs+JNL1uKzJqc3VLZB+vYCPaHGyQ3oX6EzEmA==",
|
|
73
|
+
"resolved": "https://registry.npmjs.org/@deepseek-ai/node-addon-system-linux-arm64/-/node-addon-system-linux-arm64-0.1.2.tgz"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"name": "@deepseek-ai/node-addon-system-linux-x64",
|
|
77
|
+
"version": "0.1.2",
|
|
78
|
+
"integrity": "sha512-S2aPVHvYCpNCppCFyNlooMYuTB7ucK5lvD9oXQQ42v5Z2s5AoaiCdjz9r2l+ED2rI5oS1x0cUZmKjJH2dxV0pg==",
|
|
79
|
+
"resolved": "https://registry.npmjs.org/@deepseek-ai/node-addon-system-linux-x64/-/node-addon-system-linux-x64-0.1.2.tgz"
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
"computerUse": {
|
|
83
|
+
"package": "@anionex/dsh-computer-use",
|
|
84
|
+
"version": "0.3.3",
|
|
85
|
+
"license": "MIT",
|
|
86
|
+
"helperSha256": "55325e0008d755bf2b1d408bcfd5cdb80842ec2a0fa5312da6961eb65d7d6dd3",
|
|
87
|
+
"architectures": [
|
|
88
|
+
"arm64",
|
|
89
|
+
"x86_64"
|
|
90
|
+
],
|
|
91
|
+
"minimumMacOS": "14.0",
|
|
92
|
+
"toolsEntrySha256": "89693a230ad82d59d10d36cc6957c8f281c7b844573d491343f6482f47a73a69"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 DeepSeek
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|