@toddzheng024/dscode-desktop 0.0.0-stage → 0.7.34
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 +649 -0
- package/docs/account-login.md +44 -0
- package/docs/auto-review.md +128 -0
- package/docs/browser-use.md +784 -0
- package/docs/computer-use.md +81 -0
- package/docs/custom-providers.md +88 -0
- package/docs/demo.md +158 -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 +212 -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 +37 -0
- package/docs/releases/0.7.34.md +24 -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 +99 -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 +147 -0
- package/plugins/grok/index.mjs +123 -0
- package/plugins/grok/models.mjs +129 -0
- package/plugins/grok/status.mjs +29 -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 +100 -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 +121 -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 +120 -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 +124 -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 +67 -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 +97 -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 +272 -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 +149 -0
- package/plugins/tui-tools/hook-sources.mjs +113 -0
- package/plugins/tui-tools/hooks.mjs +23 -0
- package/plugins/tui-tools/index.mjs +269 -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,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic-job adaptation for bash process handles: the terminal outcome the
|
|
3
|
+
* registry records, the pull sources it pumps, and the ring read a foreground
|
|
4
|
+
* call renders when it stops waiting.
|
|
5
|
+
*
|
|
6
|
+
* @module @deepseek-ai/dsh-tool-bash/background
|
|
7
|
+
*/
|
|
8
|
+
import type { SandboxMode } from '@deepseek-ai/dsh-sandbox';
|
|
9
|
+
import type { ShellProcess } from '@deepseek-ai/dsh-shell';
|
|
10
|
+
import type { JobChunk, JobHooks, JobOutcome, JobOutputSource } from '@deepseek-ai/dsh-jobs';
|
|
11
|
+
/**
|
|
12
|
+
* Map a settled background process onto the generic job-outcome vocabulary:
|
|
13
|
+
* `killed` stays `killed` (detail: the signal when one is known), everything
|
|
14
|
+
* else is `completed` with the exit code as detail. A nonzero command exit is
|
|
15
|
+
* reported, not failed, exactly like the foreground rendering. Sandbox facts
|
|
16
|
+
* join the detail, since a job's terminal reason is the one line every
|
|
17
|
+
* reader — the model's status line, the roster row — shows.
|
|
18
|
+
* @param proc - the settled process handle.
|
|
19
|
+
* @param escalationModes - escalation targets advertised by this composition.
|
|
20
|
+
* @returns the outcome for the `ctx.jobs` registration.
|
|
21
|
+
*/
|
|
22
|
+
export declare function processOutcome(proc: ShellProcess, escalationModes?: readonly SandboxMode[]): JobOutcome;
|
|
23
|
+
/**
|
|
24
|
+
* The process's non-consuming stream readers as registry pull sources. They
|
|
25
|
+
* bind lazily because the process is spawned inside the starter, after the
|
|
26
|
+
* registry admitted the job; a read before the spawn yields nothing, and the
|
|
27
|
+
* pump keeps the model's consuming cursor untouched. A rejected spawn's
|
|
28
|
+
* stderr reader carries the provider's `subprocess failed before reporting an
|
|
29
|
+
* outcome: …` note.
|
|
30
|
+
* @param proc - the started process's observed streams, once the starter has spawned it.
|
|
31
|
+
* @returns one source per stream, stdout first.
|
|
32
|
+
*/
|
|
33
|
+
export declare function processSources(proc: () => Pick<ShellProcess, 'observed'> | undefined): JobOutputSource[];
|
|
34
|
+
/**
|
|
35
|
+
* The ring chunks of one consuming registry read as the shell tools render a
|
|
36
|
+
* process read: stdout chunks in order, then every stderr chunk in one
|
|
37
|
+
* `[stderr]` section, so the output a foreground call hands over when it
|
|
38
|
+
* stops waiting reads exactly like the `job_output` reads that follow it.
|
|
39
|
+
* @param chunks - the chunks since the model cursor, in offset order.
|
|
40
|
+
* @returns the delta text, possibly empty.
|
|
41
|
+
*/
|
|
42
|
+
export declare function ringDelta(chunks: readonly JobChunk[]): string;
|
|
43
|
+
/**
|
|
44
|
+
* Adapt asynchronous shell preparation after job admission without exposing a partial process.
|
|
45
|
+
* @param start - starts the process with job-owned cancellation.
|
|
46
|
+
* @param outcome - projects the settled process into the job outcome.
|
|
47
|
+
* @returns synchronous job hooks whose completion includes preparation and process settlement.
|
|
48
|
+
*/
|
|
49
|
+
export declare function processJob(start: (signal: AbortSignal) => Promise<ShellProcess>, outcome: (process: ShellProcess) => JobOutcome): JobHooks;
|
|
50
|
+
//# sourceMappingURL=background.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model-facing Consumer of the `ctx.shell` capability seam. While a job
|
|
3
|
+
* registry is composed, every call registers its process with `ctx.jobs` as
|
|
4
|
+
* it starts: `run_in_background` returns the id at once, and a foreground call
|
|
5
|
+
* waits on its job until the command finishes or the wait times out, at which
|
|
6
|
+
* point it returns the same id. Without a registry the tool is foreground-only
|
|
7
|
+
* and the executor's deadline kills the command.
|
|
8
|
+
*
|
|
9
|
+
* TODO(permissions): deployment policy belongs in `tools/pre-execute` and
|
|
10
|
+
* sandboxing executors; see docs/architecture.md § Where new behavior goes.
|
|
11
|
+
* @module @deepseek-ai/dsh-tool-bash
|
|
12
|
+
*/
|
|
13
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
14
|
+
import z from '@deepseek-ai/schemastery';
|
|
15
|
+
export declare const name = "tool-bash";
|
|
16
|
+
export declare const inject: string[];
|
|
17
|
+
/** Configuration for the bash tool. */
|
|
18
|
+
export interface Config {
|
|
19
|
+
/**
|
|
20
|
+
* Expose `run_in_background` while a job registry is composed (default
|
|
21
|
+
* true); disabled calls are also rejected. Without a registry the tool is
|
|
22
|
+
* foreground-only regardless.
|
|
23
|
+
*/
|
|
24
|
+
enableRunInBackground?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Keep a foreground command that reaches its timeout running as a
|
|
27
|
+
* background job instead of killing it (default true). Applies only while
|
|
28
|
+
* background execution is available: with `enableRunInBackground` false or
|
|
29
|
+
* no job registry, the executor's deadline kills the command. A foreground
|
|
30
|
+
* command the registry refuses at its start (admission or a missing
|
|
31
|
+
* controller) also runs under the deadline kill.
|
|
32
|
+
*/
|
|
33
|
+
promoteOnTimeout?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/** Runtime configuration schema for the bash tool plugin. */
|
|
36
|
+
export declare const Config: z<Config>;
|
|
37
|
+
export declare function apply(ctx: Context, config?: Config): void;
|
|
38
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model-facing result rendering for the bash tool.
|
|
3
|
+
*
|
|
4
|
+
* @module @deepseek-ai/dsh-tool-bash/render
|
|
5
|
+
*/
|
|
6
|
+
import type { ShellRunResult, ShellSandboxInfo } from '@deepseek-ai/dsh-shell';
|
|
7
|
+
import type { SandboxMode } from '@deepseek-ai/dsh-sandbox';
|
|
8
|
+
/**
|
|
9
|
+
* Shape one finished run into the text the model sees: stdout, then a marked
|
|
10
|
+
* stderr section, then exit-status markers. Non-zero exits are reported, not
|
|
11
|
+
* errored — the model decides how to react; only infrastructure failures
|
|
12
|
+
* (spawn errors, aborts) surface as isError results.
|
|
13
|
+
* @param result - the completed foreground run from the executor.
|
|
14
|
+
* @param escalationModes - the escalation targets this composition advertises;
|
|
15
|
+
* non-empty adds the same-turn escalation hint after a denial marker
|
|
16
|
+
* (default `[]`: no hint).
|
|
17
|
+
* @returns the model-facing text: output body (or `(no output)`), then any timeout/stopped/signal/exit markers, each on its own line.
|
|
18
|
+
*/
|
|
19
|
+
export declare function renderResult(result: ShellRunResult & {
|
|
20
|
+
stopped?: string;
|
|
21
|
+
}, escalationModes?: readonly SandboxMode[]): string;
|
|
22
|
+
/**
|
|
23
|
+
* Shape a foreground call that stopped waiting into the text the model sees:
|
|
24
|
+
* the output captured so far (one consuming registry read taken at that
|
|
25
|
+
* point, so `job_output` continues exactly after it), then the still-running
|
|
26
|
+
* marker and the job hand-off guidance.
|
|
27
|
+
* @param promoted - the promoted result value: the job id, the wait that
|
|
28
|
+
* expired, and the output so far.
|
|
29
|
+
* @returns the model-facing text for a promoted call.
|
|
30
|
+
*/
|
|
31
|
+
export declare function renderPromoted(promoted: {
|
|
32
|
+
jobId: string;
|
|
33
|
+
timeoutMs: number;
|
|
34
|
+
output: string;
|
|
35
|
+
}): string;
|
|
36
|
+
/**
|
|
37
|
+
* Shape the one consuming registry read a foreground call embeds in its
|
|
38
|
+
* result when it stops waiting: the output produced so far, plus the
|
|
39
|
+
* dropped-output notice (naming the job's spill files) when the model cursor
|
|
40
|
+
* fell behind the ring, and the sandbox notices. Later `job_output` reads
|
|
41
|
+
* render the same ring through the job tools.
|
|
42
|
+
* @param delta - the read's chunks as rendered text.
|
|
43
|
+
* @param lossy - whether bytes before the delta were evicted unread.
|
|
44
|
+
* @param spillPaths - the complete-stream files the job currently advertises.
|
|
45
|
+
* @param sandbox - settled sandbox facts, when this was a confined process.
|
|
46
|
+
* @param escalationModes - escalation targets advertised by this composition.
|
|
47
|
+
* @returns the delta text with any loss or sandbox notice appended.
|
|
48
|
+
*/
|
|
49
|
+
export declare function renderJobRead(delta: string, lossy: boolean, spillPaths: readonly string[], sandbox?: ShellSandboxInfo, escalationModes?: readonly SandboxMode[]): string;
|
|
50
|
+
/**
|
|
51
|
+
* The exit-status parse is the shared marker-contract half of the shell-tool
|
|
52
|
+
* rendering story, owned by `@deepseek-ai/dsh-shell` so `dsh-tool-pwsh` reuses
|
|
53
|
+
* it (its renderer emits the same markers). Re-exported here to keep
|
|
54
|
+
* `../src/render.ts` a single import root for bash-tool consumers.
|
|
55
|
+
*/
|
|
56
|
+
export { parseExitStatus, type ParsedExitStatus } from '@deepseek-ai/dsh-shell';
|
|
57
|
+
//# sourceMappingURL=render.d.ts.map
|
|
@@ -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.
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
// dscode-goal-cap-v1
|
|
2
|
+
import { CommandDefinitionId } from "@deepseek-ai/dsh-commands/brand";
|
|
3
|
+
import { GoalError } from "@deepseek-ai/dsh-goal";
|
|
4
|
+
import { createUserMessage } from "@deepseek-ai/dsh-llm";
|
|
5
|
+
//#region lib/types/index.js
|
|
6
|
+
/**
|
|
7
|
+
* Human-facing `/goal` command over the persisted same-session goal domain.
|
|
8
|
+
* @module @deepseek-ai/dsh-command-goal
|
|
9
|
+
*/
|
|
10
|
+
const name = "command-goal";
|
|
11
|
+
const inject = ["commands", "goals"];
|
|
12
|
+
const USAGE = "Usage: /goal [<objective>|clear|edit <objective>|pause|resume], /goal[<rounds>] set the round cap";
|
|
13
|
+
/** Fail loudly if a locally closed union gains an unhandled member. */
|
|
14
|
+
/* v8 ignore start -- closed-union backstop is unreachable without violating the TypeScript contract */
|
|
15
|
+
function assertNever(value, label) {
|
|
16
|
+
throw new TypeError(`unknown ${label}: ${String(value)}`);
|
|
17
|
+
}
|
|
18
|
+
/* v8 ignore stop */
|
|
19
|
+
/** Parse only the grammar owned by `/goal`; arbitrary other input is an objective. */
|
|
20
|
+
function parseGoalCommand(rawInput) {
|
|
21
|
+
const input = rawInput.trim();
|
|
22
|
+
const capMatch = /^\[(\d+)\]\s*(.*)$/su.exec(input);
|
|
23
|
+
if (capMatch !== null) {
|
|
24
|
+
const maxGoalRounds = Number(capMatch[1]);
|
|
25
|
+
const rest = capMatch[2].trim();
|
|
26
|
+
if (maxGoalRounds < 1 || ["clear", "pause", "resume", "edit"].includes(rest.toLowerCase())) return { kind: "invalid-cap" };
|
|
27
|
+
return rest === "" ? { kind: "cap", maxGoalRounds } : { kind: "create", objective: rest, maxGoalRounds };
|
|
28
|
+
}
|
|
29
|
+
if (input.length === 0) return { kind: "show" };
|
|
30
|
+
const control = input.toLowerCase();
|
|
31
|
+
if (control === "clear") return { kind: "clear" };
|
|
32
|
+
if (control === "pause") return { kind: "pause" };
|
|
33
|
+
if (control === "resume") return { kind: "resume" };
|
|
34
|
+
if (control === "edit") return { kind: "invalid-edit" };
|
|
35
|
+
if (/^edit(?=\s)/iu.test(input)) return {
|
|
36
|
+
kind: "edit",
|
|
37
|
+
objective: input.slice(4).trim()
|
|
38
|
+
};
|
|
39
|
+
return {
|
|
40
|
+
kind: "create",
|
|
41
|
+
objective: input
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/** Human label for one durable goal phase. */
|
|
45
|
+
function phaseLabel(phase) {
|
|
46
|
+
switch (phase) {
|
|
47
|
+
case "active": return "active";
|
|
48
|
+
case "paused": return "paused";
|
|
49
|
+
case "blocked": return "blocked";
|
|
50
|
+
case "complete": return "complete";
|
|
51
|
+
/* v8 ignore next 2 -- GoalPhase is closed and every member is handled above */
|
|
52
|
+
default: return assertNever(phase, "goal phase");
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/** Commands that are meaningful from one exact live state. */
|
|
56
|
+
function commandHint(goal) {
|
|
57
|
+
if (goal.phase === "active") return goal.activation === "armed" ? "/goal edit <objective>, /goal pause, /goal clear" : "/goal edit <objective>, /goal resume, /goal clear";
|
|
58
|
+
switch (goal.phase) {
|
|
59
|
+
case "paused":
|
|
60
|
+
case "blocked": return "/goal edit <objective>, /goal resume, /goal clear";
|
|
61
|
+
case "complete": return "/goal <objective>, /goal clear";
|
|
62
|
+
/* v8 ignore next 2 -- the active branch and every non-active phase are handled above */
|
|
63
|
+
default: return assertNever(goal.phase, "goal phase");
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/** Render direct UI output without exposing compare-and-set internals. */
|
|
67
|
+
function renderGoal(title, goal) {
|
|
68
|
+
const reason = goal.phase === "blocked" ? goal.blockedReason : void 0;
|
|
69
|
+
/* v8 ignore next -- durable replay guarantees every blocked goal carries its validated reason */
|
|
70
|
+
if (goal.phase === "blocked" && reason === void 0) throw new TypeError("blocked goal is missing its reason");
|
|
71
|
+
const blocker = reason === void 0 ? [] : [`Blocker: ${reason.code}: ${reason.message}`];
|
|
72
|
+
return {
|
|
73
|
+
kind: "success",
|
|
74
|
+
text: [
|
|
75
|
+
title,
|
|
76
|
+
`Status: ${phaseLabel(goal.phase)}`,
|
|
77
|
+
...blocker,
|
|
78
|
+
`Objective: ${goal.objective}`,
|
|
79
|
+
`Rounds: ${goal.roundsStarted}/${goal.maxGoalRounds}`,
|
|
80
|
+
`Activation: ${goal.activation}`,
|
|
81
|
+
"",
|
|
82
|
+
`Commands: ${commandHint(goal)}`
|
|
83
|
+
].join("\n")
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
/** Exact current compare-and-set ref. */
|
|
87
|
+
function goalRef(goal) {
|
|
88
|
+
return {
|
|
89
|
+
id: goal.id,
|
|
90
|
+
revision: goal.revision
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/** dscode: the create/edit request, carrying the `[N]` cap when the human set one. */
|
|
94
|
+
function goalRequest(command) {
|
|
95
|
+
return { objective: command.objective, ...command.maxGoalRounds === void 0 ? {} : { maxGoalRounds: command.maxGoalRounds } };
|
|
96
|
+
}
|
|
97
|
+
/** Direct error for an operation that requires a current goal. */
|
|
98
|
+
function missingGoal(action) {
|
|
99
|
+
return {
|
|
100
|
+
kind: "error",
|
|
101
|
+
text: `No goal is currently set; /goal ${action} requires one. ${USAGE}`
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Submit the invocation's admitted composer attachments as one model-visible user
|
|
106
|
+
* message ahead of the goal's next round. The attachments precede a fixed text
|
|
107
|
+
* block naming their role, so a later goal round reads them from ordinary
|
|
108
|
+
* session history without the goal domain storing attachment state.
|
|
109
|
+
*/
|
|
110
|
+
function submitObjectiveAttachments(invocation) {
|
|
111
|
+
if (invocation.attachments.length === 0) return;
|
|
112
|
+
invocation.agent.followup(createUserMessage({
|
|
113
|
+
content: [...invocation.attachments, {
|
|
114
|
+
type: "text",
|
|
115
|
+
text: "Reference attachments for the goal objective."
|
|
116
|
+
}],
|
|
117
|
+
source: { kind: "user" }
|
|
118
|
+
}));
|
|
119
|
+
}
|
|
120
|
+
/** Execute one parsed human command through the domain that owns persistence. */
|
|
121
|
+
function executeGoalCommand(ctx, invocation) {
|
|
122
|
+
const command = parseGoalCommand(invocation.rawInput);
|
|
123
|
+
if (invocation.attachments.length > 0 && command.kind !== "create" && command.kind !== "edit") return {
|
|
124
|
+
kind: "error",
|
|
125
|
+
text: "Attachments only accompany a goal objective: /goal <objective> or /goal edit <objective>."
|
|
126
|
+
};
|
|
127
|
+
try {
|
|
128
|
+
const current = ctx.goals.get(invocation.agent);
|
|
129
|
+
switch (command.kind) {
|
|
130
|
+
case "show": return current === void 0 ? {
|
|
131
|
+
kind: "success",
|
|
132
|
+
text: `No goal is currently set.\n${USAGE}`
|
|
133
|
+
} : renderGoal("Goal", current);
|
|
134
|
+
case "invalid-edit": return {
|
|
135
|
+
kind: "error",
|
|
136
|
+
text: `Goal editing requires a replacement objective.\n${USAGE}`
|
|
137
|
+
};
|
|
138
|
+
case "create": {
|
|
139
|
+
if (current !== void 0 && current.phase !== "complete") return {
|
|
140
|
+
kind: "error",
|
|
141
|
+
text: `A goal is already ${phaseLabel(current.phase)}. Use /goal edit <objective> to change it or /goal clear before replacing it.`
|
|
142
|
+
};
|
|
143
|
+
const created = ctx.goals.create(invocation.agent, goalRequest(command));
|
|
144
|
+
submitObjectiveAttachments(invocation);
|
|
145
|
+
return renderGoal("Goal created", created);
|
|
146
|
+
}
|
|
147
|
+
case "edit": {
|
|
148
|
+
if (current === void 0) return missingGoal("edit");
|
|
149
|
+
if (current.phase === "complete") {
|
|
150
|
+
const replaced = ctx.goals.create(invocation.agent, goalRequest(command));
|
|
151
|
+
submitObjectiveAttachments(invocation);
|
|
152
|
+
return renderGoal("Goal created", replaced);
|
|
153
|
+
}
|
|
154
|
+
const edited = ctx.goals.edit(invocation.agent, goalRef(current), goalRequest(command));
|
|
155
|
+
submitObjectiveAttachments(invocation);
|
|
156
|
+
return renderGoal("Goal updated", edited);
|
|
157
|
+
}
|
|
158
|
+
case "pause":
|
|
159
|
+
if (current === void 0) return missingGoal("pause");
|
|
160
|
+
return renderGoal("Goal paused", ctx.goals.pause(invocation.agent, goalRef(current)));
|
|
161
|
+
case "resume":
|
|
162
|
+
if (current === void 0) return missingGoal("resume");
|
|
163
|
+
return renderGoal("Goal resumed", ctx.goals.resume(invocation.agent, goalRef(current)));
|
|
164
|
+
case "clear":
|
|
165
|
+
if (current === void 0) return {
|
|
166
|
+
kind: "success",
|
|
167
|
+
text: "No goal to clear."
|
|
168
|
+
};
|
|
169
|
+
ctx.goals.clear(invocation.agent, goalRef(current));
|
|
170
|
+
return {
|
|
171
|
+
kind: "success",
|
|
172
|
+
text: "Goal cleared."
|
|
173
|
+
};
|
|
174
|
+
case "cap": {
|
|
175
|
+
if (current === void 0) return {
|
|
176
|
+
kind: "error",
|
|
177
|
+
text: `No goal is currently set; /goal[<rounds>] changes the round cap of an existing goal. ${USAGE}`
|
|
178
|
+
};
|
|
179
|
+
return renderGoal("Goal updated", ctx.goals.edit(invocation.agent, goalRef(current), { maxGoalRounds: command.maxGoalRounds }));
|
|
180
|
+
}
|
|
181
|
+
case "invalid-cap": return {
|
|
182
|
+
kind: "error",
|
|
183
|
+
text: `The round cap must be a positive whole number and cannot accompany a control word.\n${USAGE}`
|
|
184
|
+
};
|
|
185
|
+
/* v8 ignore next 2 -- GoalCommand is closed and every member is handled above */
|
|
186
|
+
default: return assertNever(command, "goal command");
|
|
187
|
+
}
|
|
188
|
+
} catch (error) {
|
|
189
|
+
if (error instanceof GoalError) return {
|
|
190
|
+
kind: "error",
|
|
191
|
+
text: "The goal command is not valid for the current state. Run /goal to view available commands."
|
|
192
|
+
};
|
|
193
|
+
throw error;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
/** Register the Codex-shaped `/goal` command for every composed command adapter. */
|
|
197
|
+
function apply(ctx) {
|
|
198
|
+
ctx.commands.register({
|
|
199
|
+
definitionId: CommandDefinitionId("@deepseek-ai/dsh-command-goal"),
|
|
200
|
+
name: "goal",
|
|
201
|
+
description: "Set or view the goal for a long-running task",
|
|
202
|
+
input: {
|
|
203
|
+
hint: "[<objective>|clear|edit <objective>|pause|resume], [<rounds>]",
|
|
204
|
+
attachments: true
|
|
205
|
+
},
|
|
206
|
+
handler: (invocation) => executeGoalCommand(ctx, invocation)
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
//#endregion
|
|
210
|
+
export { apply, inject, name };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Human-facing `/goal` command over the persisted same-session goal domain.
|
|
3
|
+
* @module @deepseek-ai/dsh-command-goal
|
|
4
|
+
*/
|
|
5
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
6
|
+
export declare const name = "command-goal";
|
|
7
|
+
export declare const inject: string[];
|
|
8
|
+
/** Register the Codex-shaped `/goal` command for every composed command adapter. */
|
|
9
|
+
export declare function apply(ctx: Context): void;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 anionex
|
|
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.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Shared DSH approval-policy read for Computer Use permission paths. */
|
|
2
|
+
/**
|
|
3
|
+
* The session's effective DSH approval policy: a logged override, else the
|
|
4
|
+
* approval plugin's configured default.
|
|
5
|
+
* @param ctx - context with the approval service injected.
|
|
6
|
+
* @param agent - the agent whose session policy applies.
|
|
7
|
+
* @returns `'never'` when every approval ask would auto-reject without a prompt.
|
|
8
|
+
*/
|
|
9
|
+
export function approvalPolicy(ctx, agent) {
|
|
10
|
+
return ctx.approval.overrideOf(agent.session) ?? ctx.approval.config.policy ?? 'ask';
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=approval-policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approval-policy.js","sourceRoot":"","sources":["../src/approval-policy.ts"],"names":[],"mappings":"AAAA,yEAAyE;AAMzE;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,GAAY,EAAE,KAAY;IACvD,OAAO,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,IAAI,KAAK,CAAA;AACtF,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/** Workspace-fenced screenshot artifact allocation and validation. */
|
|
2
|
+
import { randomUUID } from 'node:crypto';
|
|
3
|
+
import { lstat, mkdir, realpath, stat } from 'node:fs/promises';
|
|
4
|
+
import { basename, isAbsolute, relative, resolve, sep } from 'node:path';
|
|
5
|
+
import { ComputerUseError } from "./errors.js";
|
|
6
|
+
/** Screenshot description that hands visual analysis to the sibling Vision Toolkit. */
|
|
7
|
+
export const COMPUTER_SCREENSHOT_DESCRIPTION = [
|
|
8
|
+
'Current macOS application window observation.',
|
|
9
|
+
'For OCR, visual grounding, or pixel inspection, load the vision-tools Skill and pass this exact path to vision_glance, vision_ground, vision_detect, or vision_crop;',
|
|
10
|
+
'do not recreate OCR with bash, tesseract, or an ad hoc script.',
|
|
11
|
+
].join(' ');
|
|
12
|
+
function isWithin(root, candidate) {
|
|
13
|
+
const rel = relative(root, candidate);
|
|
14
|
+
return rel === '' || (!rel.startsWith(`..${sep}`) && rel !== '..' && !isAbsolute(rel));
|
|
15
|
+
}
|
|
16
|
+
async function rejectSymlinkComponents(root, target) {
|
|
17
|
+
const rel = relative(root, target);
|
|
18
|
+
let current = root;
|
|
19
|
+
for (const part of rel.split(sep).filter(Boolean)) {
|
|
20
|
+
current = resolve(current, part);
|
|
21
|
+
try {
|
|
22
|
+
const info = await lstat(current);
|
|
23
|
+
if (info.isSymbolicLink()) {
|
|
24
|
+
throw new ComputerUseError('COMPUTER_PROVIDER_FAILURE', `artifact path component must not be a symbolic link: ${part}`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
if (error instanceof ComputerUseError)
|
|
29
|
+
throw error;
|
|
30
|
+
const code = error.code;
|
|
31
|
+
if (code !== 'ENOENT')
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/** Allocate a unique managed PNG path inside the current Session workspace. */
|
|
37
|
+
export async function allocateScreenshotPath(workspace, artifactRoot, sessionId) {
|
|
38
|
+
const realWorkspace = await realpath(workspace);
|
|
39
|
+
const directory = resolve(realWorkspace, artifactRoot, String(sessionId));
|
|
40
|
+
if (!isWithin(realWorkspace, directory)) {
|
|
41
|
+
throw new ComputerUseError('COMPUTER_PROVIDER_FAILURE', 'artifactRoot escapes the Session workspace');
|
|
42
|
+
}
|
|
43
|
+
await rejectSymlinkComponents(realWorkspace, directory);
|
|
44
|
+
await mkdir(directory, { recursive: true, mode: 0o700 });
|
|
45
|
+
const realDirectory = await realpath(directory);
|
|
46
|
+
if (!isWithin(realWorkspace, realDirectory)) {
|
|
47
|
+
throw new ComputerUseError('COMPUTER_PROVIDER_FAILURE', 'artifact directory escaped the Session workspace');
|
|
48
|
+
}
|
|
49
|
+
return resolve(realDirectory, `observation-${randomUUID()}.png`);
|
|
50
|
+
}
|
|
51
|
+
/** Validate a committed screenshot and return its stable model/client descriptor. */
|
|
52
|
+
export async function describeScreenshot(path, width, height, maxBytes, sourceTool) {
|
|
53
|
+
const link = await lstat(path).catch((error) => {
|
|
54
|
+
throw new ComputerUseError('COMPUTER_PROVIDER_FAILURE', 'the screenshot artifact was not created', { cause: error });
|
|
55
|
+
});
|
|
56
|
+
if (link.isSymbolicLink() || !link.isFile()) {
|
|
57
|
+
throw new ComputerUseError('COMPUTER_PROVIDER_FAILURE', 'the screenshot artifact must be a regular non-symbolic-link file');
|
|
58
|
+
}
|
|
59
|
+
const info = await stat(path);
|
|
60
|
+
if (info.size > maxBytes) {
|
|
61
|
+
throw new ComputerUseError('COMPUTER_PROVIDER_FAILURE', `screenshot exceeds maxScreenshotBytes (${info.size} > ${maxBytes})`);
|
|
62
|
+
}
|
|
63
|
+
if (!Number.isInteger(width) || width <= 0 || !Number.isInteger(height) || height <= 0) {
|
|
64
|
+
throw new ComputerUseError('COMPUTER_PROVIDER_FAILURE', 'provider returned invalid screenshot dimensions');
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
path,
|
|
68
|
+
filename: basename(path),
|
|
69
|
+
mimeType: 'image/png',
|
|
70
|
+
kind: 'image',
|
|
71
|
+
description: COMPUTER_SCREENSHOT_DESCRIPTION,
|
|
72
|
+
sourceTool,
|
|
73
|
+
previewIntent: 'image',
|
|
74
|
+
bytes: info.size,
|
|
75
|
+
width,
|
|
76
|
+
height,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=artifacts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../src/artifacts.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backend.js","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AAAA,mFAAmF"}
|