@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
package/docs/triggers.md
ADDED
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
# Triggers: running the agent from an event
|
|
2
|
+
|
|
3
|
+
One event starts one run. By default each run starts a fresh session; a persistent trigger resumes its own session across runs. A trigger definition says where the event comes from, which folder the session works in, what it is asked to do, and the limits that keep an unattended run bounded.
|
|
4
|
+
|
|
5
|
+
A trigger is not a way to reach a session that is already open: that is [session communication](session-communication.md) (`dscode send`, the mailbox). A persistent trigger owns its session binding; it does not attach to an arbitrary open conversation. Each run ends independently, while its session history remains durable.
|
|
6
|
+
|
|
7
|
+
## Experimental Desktop scheduling
|
|
8
|
+
|
|
9
|
+
The [combined Desktop package](browser-use.md#install-the-experimental-combined-desktop-package)
|
|
10
|
+
adds **Settings → DSCODE schedules**. Open a DSCODE session in the target project,
|
|
11
|
+
then select that session in the settings page. The form creates or edits an
|
|
12
|
+
interval, calendar, external-event or script task. New form entries default to
|
|
13
|
+
read-only execution and a persistent task-owned session. You can pause a task,
|
|
14
|
+
queue one manual run, cancel a pending job, and start, stop or restart a script
|
|
15
|
+
source and inspect its output. Recent job states refresh while the page is open.
|
|
16
|
+
The same four agent tools and `/trigger` commands remain available inside DSCODE
|
|
17
|
+
sessions, with the workspace and mutation restrictions described below.
|
|
18
|
+
|
|
19
|
+
Background refresh preserves form errors and unsaved entries. A refresh failure
|
|
20
|
+
appears separately and clears after a successful refresh. Source output clears
|
|
21
|
+
when you select another session or the selected session closes.
|
|
22
|
+
Polling keeps the form editable. An action submitted during a refresh waits for
|
|
23
|
+
that refresh to finish and then runs once, even if the refresh failed. A failed
|
|
24
|
+
action focuses its error message so it is visible after submitting a long form;
|
|
25
|
+
background refresh does not move focus.
|
|
26
|
+
|
|
27
|
+
If a manual run cannot be confirmed, its button changes to **Retry**. While the
|
|
28
|
+
settings page remains mounted, retries reuse the same request for that workspace
|
|
29
|
+
and task, including when queuing succeeded but refreshing the result failed.
|
|
30
|
+
Running another task or selecting another workspace does not discard that
|
|
31
|
+
request. Closing and reopening the page discards this retry state; inspect
|
|
32
|
+
**Recent jobs** before submitting another run after reopening it.
|
|
33
|
+
|
|
34
|
+
Delivery is off by default. **Enable delivery and resume on launch** starts the
|
|
35
|
+
Desktop queue owner for every registered project in this state directory and
|
|
36
|
+
saves that choice in `<state>/config/desktop-scheduler.json`. Later Desktop
|
|
37
|
+
launches start it after the Host's providers and preset hooks are ready.
|
|
38
|
+
**Stop delivery and disable resume** cancels active trigger runs, drains script
|
|
39
|
+
sources and disables automatic startup. Pending jobs and task definitions stay
|
|
40
|
+
saved. A paused definition does not consume its pending jobs.
|
|
41
|
+
|
|
42
|
+
Desktop uses `/trigger scheduler status|start|stop` and the corresponding
|
|
43
|
+
`trigger_scheduler` actions. It does not install a launchd service. Another
|
|
44
|
+
process may already own the same queue; the page reports that owner and cannot
|
|
45
|
+
stop it. Use the terminal or service manager that started it. A native background
|
|
46
|
+
job cancellation stops the current Desktop owner but retains the saved launch
|
|
47
|
+
preference; use the settings stop action to disable that preference too.
|
|
48
|
+
|
|
49
|
+
Keep Desktop running for delivery. Its quit and update inspection counts an
|
|
50
|
+
enabled scheduler as active work, including time between task runs. A graceful
|
|
51
|
+
quit drains its owned work while keeping the saved preference. After a crash,
|
|
52
|
+
unclaimed jobs can resume on the next enabled launch; a task already running at
|
|
53
|
+
the crash is recorded as interrupted and is not automatically executed again.
|
|
54
|
+
Removing the package stops its owner and retains the saved data. Reinstallation
|
|
55
|
+
can resume delivery if the saved preference is enabled, so disable delivery
|
|
56
|
+
before removal when you do not want that behavior.
|
|
57
|
+
|
|
58
|
+
Desktop runs require the DSCODE preset and `read-only` or `workspace-write`
|
|
59
|
+
permission. Plan mode, read-only management sessions, unattended runs and
|
|
60
|
+
subagents cannot change schedules through the agent tools or session-bound
|
|
61
|
+
settings controls. The global delivery buttons are explicit user settings.
|
|
62
|
+
An unattended task also cannot stop the shared scheduler through `job_kill`.
|
|
63
|
+
Events do not grant authority, and required approvals stop unattended execution.
|
|
64
|
+
|
|
65
|
+
This remains an unpublished integration. The queue and shutdown path have been
|
|
66
|
+
qualified against two independent Host versions and the signed macOS Desktop
|
|
67
|
+
Host. Component tests, shared Web-client interaction and the signed macOS
|
|
68
|
+
Electron settings cover task creation, editing, manual queuing, cancellation and
|
|
69
|
+
delivery controls. Windows source execution still requires qualification.
|
|
70
|
+
The updated package passed native macOS installation, upgrade, removal and
|
|
71
|
+
reinstallation with delivery enabled: its preference, definition and pending job
|
|
72
|
+
survived, and enabled delivery resumed after upgrade and reinstallation.
|
|
73
|
+
Scripted model fixtures establish
|
|
74
|
+
delivery and cleanup, not live-model task quality.
|
|
75
|
+
|
|
76
|
+
## Define a trigger
|
|
77
|
+
|
|
78
|
+
| Where | Who reads it |
|
|
79
|
+
| --- | --- |
|
|
80
|
+
| `<state>/triggers/<id>.yml` or `.json` | this machine |
|
|
81
|
+
| `<project>/.dsh/triggers/<id>.yml` or `.json` | this project, reviewed with it |
|
|
82
|
+
|
|
83
|
+
The file name must equal the `id`, and a project file wins over a machine file with the same id. An unreadable file is reported by `dscode trigger list` without hiding the others.
|
|
84
|
+
|
|
85
|
+
```yaml
|
|
86
|
+
id: nightly-review
|
|
87
|
+
workspace: /Users/me/work/repo # absolute; the session binds here
|
|
88
|
+
prompt: review the diff and fix what is broken
|
|
89
|
+
source: { kind: calendar, cron: "0 9 * * *" }
|
|
90
|
+
session: { mode: new } # new (default), or persistent
|
|
91
|
+
goal: { objective: the diff is reviewed and the tests pass, maxRounds: 12 }
|
|
92
|
+
limits: { timeoutSeconds: 1800, maxRunsPerDay: 4, minIntervalSeconds: 300 }
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
| Field | Meaning |
|
|
96
|
+
| --- | --- |
|
|
97
|
+
| `id` | identity, also the file name and the spool/log key |
|
|
98
|
+
| `enabled` | `false` prevents execution; manual runs skip, scheduled jobs remain pending (default `true`) |
|
|
99
|
+
| `source` | what produces the event, see below |
|
|
100
|
+
| `workspace` | the session's folder; chosen here and never changed by a run |
|
|
101
|
+
| `prompt` | what the session is asked to do; `{{event.text}}`, `{{event.title}}`, `{{event.source}}`, `{{event.eventId}}` and `{{event.fields.NAME}}` are substituted, and an event whose text the template never mentions is appended |
|
|
102
|
+
| `session.mode` | `new` (default): a fresh session for every run; `persistent`: create once, then resume the same session |
|
|
103
|
+
| `preset` | agent preset (default `dscode`) |
|
|
104
|
+
| `permission` | `auto-review`, `workspace-write` (default), `read-only` or `danger-full-access` — `ask` is refused, because nobody is there to answer |
|
|
105
|
+
| `model`, `effort` | optional route and reasoning level for the run |
|
|
106
|
+
| `goal` | the objective plus `maxRounds`: the run continues toward it and stops when it is reached or the rounds are spent |
|
|
107
|
+
| `limits` | `timeoutSeconds` (1800), `maxRunsPerDay` (24), `minIntervalSeconds` (60), optional `maxCostUsd` |
|
|
108
|
+
| `overlap` | `skip` for `new`, `queue` for `persistent`; defaults follow the session mode, and conflicting values are refused |
|
|
109
|
+
| `notify` | `log` (the only value) |
|
|
110
|
+
|
|
111
|
+
Unknown or misspelled fields are refused rather than ignored, so a typo like `maxRound` cannot fall back to the default cap.
|
|
112
|
+
|
|
113
|
+
## Ask DSCODE to manage schedules
|
|
114
|
+
|
|
115
|
+
The agent has four tools over the same definition files and SQLite jobs used by the CLI:
|
|
116
|
+
|
|
117
|
+
| Tool | Actions |
|
|
118
|
+
| --- | --- |
|
|
119
|
+
| `trigger_manage` | `list`, `get`, `create`, `update`, `enable`, `disable`, `register`, `unregister` |
|
|
120
|
+
| `trigger_jobs` | `schedule`, `list`, `cancel` |
|
|
121
|
+
| `trigger_source` | `status`, `start`, `stop`, `restart`, `logs` |
|
|
122
|
+
| `trigger_scheduler` | Terminal: `status`, `install`; experimental Desktop: `status`, `start`, `stop` |
|
|
123
|
+
|
|
124
|
+
For example, ask “Check this project's build every weekday at 9 am in America/Los_Angeles” or “Run this trigger once in 30 minutes.” The agent creates a project-local definition with `trigger_manage`, then uses `trigger_jobs` for a one-shot event. Creating or updating a `calendar` or `interval` definition also registers its cadence. A `script` definition registers a supervised producer. An `external` definition has no recurring schedule. `update` merges top-level fields; a supplied nested object, such as `limits`, replaces that entire object and omitted fields inside it receive their normal defaults. Both `new` and `persistent` session modes are supported.
|
|
125
|
+
|
|
126
|
+
A delay call supplies an existing `trigger_id`, exactly one of `after` (`30m`) or `at` (an ISO timestamp with a UTC offset), and an `idempotency_key`. Retrying the same key and request returns the original job and original due time, including after cancellation or completion. Reusing that key for a different request is refused. Keys are scoped to the workspace. `list` returns up to 100 jobs (50 by default), newest due time first, including terminal states.
|
|
127
|
+
|
|
128
|
+
The tools bind definitions and job management to the current session's workspace. They create or edit project-local definitions only; machine-level definitions in that workspace can be inspected and scheduled without rewriting their files. Agent-managed execution uses the `dscode` preset with `read-only` or `workspace-write` permission. Mutations go through the existing tool approval pipeline, including automatic review when enabled. Plan mode, read-only sessions, subagents and unattended trigger runs cannot mutate schedules through these tools.
|
|
129
|
+
|
|
130
|
+
Every scheduling response reports `scheduler.running`. A saved job does not by itself start the scheduler. On macOS, `trigger_scheduler` with `action: install` installs the shared launchd service, which can deliver due jobs from every registered project in that state directory. Other platforms receive instructions for their service manager. Service installation acknowledgement and observed liveness are reported separately. These tools do not stop the shared service; use the CLI for that machine-wide operation.
|
|
131
|
+
|
|
132
|
+
Disabling a trigger leaves its pending jobs waiting. `unregister` cancels pending recurring jobs from that registration while leaving one-shot jobs intact. `cancel` cancels one pending job and never interrupts a running job. No completion notification is sent yet; inspect the jobs and run log for results.
|
|
133
|
+
|
|
134
|
+
## Choose a session mode
|
|
135
|
+
|
|
136
|
+
```yaml
|
|
137
|
+
id: project-monitor
|
|
138
|
+
workspace: /Users/me/work/repo
|
|
139
|
+
source: { kind: external }
|
|
140
|
+
session: { mode: persistent }
|
|
141
|
+
prompt: "Review this event using the previous findings: {{event.text}}"
|
|
142
|
+
goal: { objective: this event has been investigated, maxRounds: 12 }
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
`new` isolates each event's context. `persistent` creates a session on its first run and stores the binding in `<state>/triggers/sessions/<id>.json`; later runs resume that session through the ordinary session persistence service, including after a CLI or machine restart. Each event still has a distinct run id, a fresh goal, its own round cap and its own cost cap. An earlier blocked, paused or unfinished goal is cleared through the goal service before the new goal is created; its history and run result remain available. This is a new attempt for the new event, not an automatic retry of the old one.
|
|
146
|
+
|
|
147
|
+
A persistent trigger's workspace and agent preset must continue to match its binding. Use a new trigger id to start a different workspace or preset. A missing or unreadable bound session is an error; it never silently becomes an empty conversation. Switching to `new` leaves the old binding alone, so switching back to `persistent` resumes the earlier persistent session.
|
|
148
|
+
|
|
149
|
+
Persistent runs process queued events oldest first. Concurrent `fire` or scheduled `run` invocations persist their events and wait for the trigger's execution lock; the active command drains arrivals after the current run. The command stays alive while draining, waiting for `minIntervalSeconds` between runs. Reaching the daily cap, disabling the trigger, or losing the runner leaves pending events on disk for a later `run`. Direct `fire` events and legacy spool files still need a `run` invocation after every waiting process exits. `emit` commits a job to the shared scheduler queue; it returns without waiting for the model. A run stopped by interruption leaves subsequent events pending.
|
|
150
|
+
|
|
151
|
+
The lock is shared across CLI processes and inherited by the Host, so killing a parent cannot start a second writer while its Host is still alive. The ordinary session persistence lock also refuses to resume a session already open for writing in another Host (including the TUI).
|
|
152
|
+
|
|
153
|
+
## Sources
|
|
154
|
+
|
|
155
|
+
| `source.kind` | Fields | What fires a run |
|
|
156
|
+
| --- | --- | --- |
|
|
157
|
+
| `interval` | `seconds` | the schedule, every N seconds |
|
|
158
|
+
| `calendar` | `cron` (five numeric fields), optional `timezone`, `misfire` | the schedule, on the cron rule |
|
|
159
|
+
| `watch` | `paths` | a change to one of those paths |
|
|
160
|
+
| `poll` | `everySeconds`, `check` | the schedule, but only when `check` exits 0 |
|
|
161
|
+
| `script` | `mode`, `command`; poll also requires `everySeconds` | a sandboxed script submits explicit events |
|
|
162
|
+
| `external` | — | only what someone posts with `dscode trigger emit` |
|
|
163
|
+
|
|
164
|
+
A legacy `poll` check runs in a filesystem sandbox in the workspace with a 60-second limit; anything other than exit 0 — including a timeout or a check that cannot start — means there is nothing to do. Its output is kept in the run's tail. It never falls back to an unsandboxed shell when sandbox setup fails.
|
|
165
|
+
|
|
166
|
+
## Post an event
|
|
167
|
+
|
|
168
|
+
```sh
|
|
169
|
+
dscode trigger emit nightly-review --text "the build failed"
|
|
170
|
+
dscode trigger emit nightly-review --event event.json # or "-" for stdin
|
|
171
|
+
dscode trigger fire nightly-review --text "do it now" # post and run
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
An event body may carry only `source`, `title`, `text` and scalar `fields`; any other key is refused, because an event is data and must never name a permission, a session or a tool. Pass a stable `--event-id` when a producer may retry. `emit` commits the event and its job atomically in SQLite before returning success. Repeating the same event id and payload returns the original job, even after completion or cancellation; changing the payload under that id is refused. At most 100 pending/running jobs per project and trigger may be admitted through `emit`. `QUEUE_FULL` means no new event was accepted: retry later with the same id. Event text is limited to 64,000 bytes and the complete normalized body to 128 KiB. Tasks with external side effects should also use `eventId` for their own idempotency.
|
|
175
|
+
|
|
176
|
+
`fire` retains its direct, synchronous spool path. Legacy spool files are not automatically migrated into the scheduler queue. An interrupted direct spool run can be replayed if its result was never recorded.
|
|
177
|
+
|
|
178
|
+
## Run one
|
|
179
|
+
|
|
180
|
+
```sh
|
|
181
|
+
dscode trigger run nightly-review # decide, then run if the limits allow
|
|
182
|
+
dscode trigger list # definitions and each one's last outcome
|
|
183
|
+
dscode trigger show nightly-review # one definition in full
|
|
184
|
+
dscode trigger log nightly-review # recorded runs, newest first
|
|
185
|
+
dscode trigger log --failed # only what did not complete
|
|
186
|
+
dscode trigger events nightly-review # queued events and legacy spool entries
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Before a session starts, `run` refuses: a disabled definition, a workspace that does not exist, an event id already recorded, a spent 24-hour cap, a run inside `minIntervalSeconds`, or a run that is still in flight. A refusal is recorded as `skipped` with its reason and exits 0; it never counts against the cap or the interval.
|
|
190
|
+
|
|
191
|
+
| Exit code | Meaning |
|
|
192
|
+
| --- | --- |
|
|
193
|
+
| 0 | completed, or skipped with a reason |
|
|
194
|
+
| 1 | the run failed |
|
|
195
|
+
| 2 | a cap stopped it (rounds or cost) |
|
|
196
|
+
| 3 | the goal is blocked or paused |
|
|
197
|
+
| 124 | the timeout stopped it |
|
|
198
|
+
| 130 | it was interrupted |
|
|
199
|
+
|
|
200
|
+
## What one run is
|
|
201
|
+
|
|
202
|
+
A fresh or resumed session in the definition's `workspace` — the same folder binding the terminal uses, so the session's shell and log stay there. The goal is created through the goal service (the model-facing goal tools require a direct human turn, which an unattended run never has), the prompt is delivered, and the goal round driver continues the work turn after turn until:
|
|
203
|
+
|
|
204
|
+
- the goal is complete (exit 0) or blocked (exit 3);
|
|
205
|
+
- the round cap or `maxCostUsd` is reached (exit 2);
|
|
206
|
+
- `timeoutSeconds` passes (exit 124);
|
|
207
|
+
- the goal is paused (exit 3);
|
|
208
|
+
- an approval is needed: it is rejected, because no human is present, and the run is marked `approval_required` when a cap or the timeout then stops it (fail closed).
|
|
209
|
+
|
|
210
|
+
Cost is the spend added by this run, rather than the persistent session's lifetime spend. The outcome, reason, exit code, session id, cost and rounds go to `<state>/triggers/runs.jsonl`, and the agent's last message to `<state>/triggers/logs/<id>/<runId>.log`. The session itself is durable: it appears in `dscode sessions` and `/resume`.
|
|
211
|
+
|
|
212
|
+
## Schedule recurring work
|
|
213
|
+
|
|
214
|
+
```yaml
|
|
215
|
+
source:
|
|
216
|
+
kind: calendar
|
|
217
|
+
cron: "0 9 * * 1-5"
|
|
218
|
+
timezone: America/Los_Angeles
|
|
219
|
+
misfire: run-once
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Cron uses five numeric fields and accepts `*`, lists, ranges and steps, such as `*/15 9-17 * * 1-5`. `timezone` accepts an IANA time zone and defaults to the machine's current time zone. Calendar iteration uses the pinned [cron-parser](https://github.com/harrisiirak/cron-parser) dependency, including its daylight-saving behavior. A cron expression or time zone that cannot be evaluated is rejected before installation.
|
|
223
|
+
|
|
224
|
+
```sh
|
|
225
|
+
dscode trigger install nightly-review
|
|
226
|
+
dscode trigger uninstall nightly-review
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
For `calendar`, `interval`, `poll` and `script`, `install` registers the recurring source with the shared scheduler and installs its launchd service on macOS. Reinstalling the same source preserves its cursor. Editing a registered source, or re-enabling it, resets its next firing from the time the scheduler observes the change. A disabled or missing definition generates no new occurrences. `uninstall` removes the recurring registration and cancels its pending recurring jobs; separately scheduled delay jobs remain. It leaves the shared scheduler running for other triggers.
|
|
230
|
+
|
|
231
|
+
`watch` continues to use its own launchd `WatchPaths` agent. An `external` source has no recurring schedule: emit events or schedule individual jobs for it. Reinstalling a previously installed recurring trigger removes its old per-trigger launchd registration before using the shared scheduler.
|
|
232
|
+
|
|
233
|
+
When the machine wakes or the scheduler restarts, `misfire: run-once` (the default) merges missed cron occurrences into one job for the latest missed instant. `misfire: skip` drops missed instants older than the current minute. A firing in the current minute is still eligible. Intervals and polls merge missed occurrences into one job. There is no replay of every missed tick.
|
|
234
|
+
|
|
235
|
+
## Schedule one event
|
|
236
|
+
|
|
237
|
+
```sh
|
|
238
|
+
dscode trigger schedule nightly-review --after 30m --text "check the build again"
|
|
239
|
+
dscode trigger schedule nightly-review --at "2026-09-23T09:00:00-07:00" --event event.json
|
|
240
|
+
dscode trigger jobs nightly-review
|
|
241
|
+
dscode trigger cancel job-REPLACE-WITH-RETURNED-ID
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
`schedule` takes exactly one of `--after` (`s`, `m`, `h`, `d`) or `--at` (a future ISO timestamp with seconds and an explicit UTC offset). The event has the same data-only payload as `emit`; it cannot select a session, workspace or permission. The command returns a durable `jobId` immediately without starting an agent. `cancel` applies only to a pending job and never interrupts a run already claimed by a worker.
|
|
245
|
+
|
|
246
|
+
Jobs are stored in `<state>/triggers/jobs.sqlite`, independently of the producer process. A delay that becomes due while the machine is asleep runs after the scheduler is available again. Due time means eligible to run: overlap, minimum intervals, daily caps and disabled definitions keep a job pending with its waiting reason shown by `jobs`. Due jobs for one trigger execute oldest first in either session mode. Jobs keep their original workspace; a changed workspace holds them with `workspace_changed` until cancelled and rescheduled.
|
|
247
|
+
|
|
248
|
+
Each job has its own `jobId`; when claimed, it also has a `runId` and uses `job:<jobId>` as its event identity for cron/delay jobs; emitted jobs keep the producer's original event id. The run record carries the job id and session id. Job states are `pending`, `running`, `completed`, `failed` and `cancelled`. A false poll predicate completes the job with `no_match` without starting an agent. Failed jobs are not automatically retried. If a worker dies, the scheduler waits for any surviving Host to release its lock, then uses the run record to settle the job or marks it `failed (interrupted)` when no result survived. It never assumes an interrupted job had no external effects.
|
|
249
|
+
|
|
250
|
+
## Script producers and loops
|
|
251
|
+
|
|
252
|
+
Use `script` when an agent needs to write a custom detector, poll an API, or maintain a subscription. The script does cheap detection work; an emitted event starts the usual bounded agent run. Save scripts in the project so their code can be inspected alongside the trigger definition.
|
|
253
|
+
|
|
254
|
+
```yaml
|
|
255
|
+
source:
|
|
256
|
+
kind: script
|
|
257
|
+
mode: daemon
|
|
258
|
+
command: ["python3", ".dsh/scripts/watch_build.py"]
|
|
259
|
+
permission: read-only
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
`command` is an argv array, with no implicit shell. Relative script paths resolve from the trigger's workspace. `daemon` owns its loop and runs until stopped. For a finite check, use `mode: poll`, `everySeconds: 60`, and optionally `timeoutSeconds: 30` (default 60). A successful poll waits its interval after exit; it creates no model job unless it emits an event. Unexpected daemon exits and failed/timed-out polls restart with exponential backoff from 2 seconds up to 5 minutes. Missed polls are not replayed.
|
|
263
|
+
|
|
264
|
+
Within either script mode:
|
|
265
|
+
|
|
266
|
+
```sh
|
|
267
|
+
dscode trigger emit build-monitor --event-id "build:123:failed" --text "Build 123 failed"
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
The private `dscode` command provided on the script's PATH supports only `trigger emit`, with `--text` or `--event FILE` (`-` reads JSON from stdin). It returns a JSON receipt containing `jobId`, `state` and `eventId`. A nonzero exit means the producer must retry the same event rather than advance its cursor. Store cursors under the writable directory named by `DSCODE_SOURCE_STATE`; it survives process restarts. `TMPDIR` is a separate temporary directory removed after each attempt. `DSCODE_TRIGGER_ID` names the bound trigger. The local ingress accepts only that trigger and validates the event before acknowledging its durable commit.
|
|
271
|
+
|
|
272
|
+
The script's filesystem permission is independent of the agent run's permission. It defaults to `read-only`, with writes allowed only in its private state and temporary directories. `source.permission: workspace-write` also permits workspace writes while excluding the DSCODE state directory. Scripts inherit the scheduler's environment and network access; this is a filesystem write boundary, not credential or network isolation. macOS uses Seatbelt, Linux requires bubblewrap, and other platforms refuse execution. Sandbox setup failures never run the script unrestricted. The legacy `poll.check` shell predicate now uses the same sandbox launcher.
|
|
273
|
+
|
|
274
|
+
```sh
|
|
275
|
+
dscode trigger install build-monitor # register and install shared scheduler
|
|
276
|
+
dscode trigger source build-monitor status
|
|
277
|
+
dscode trigger source build-monitor logs # last 32,768 characters
|
|
278
|
+
dscode trigger source build-monitor stop
|
|
279
|
+
dscode trigger source build-monitor start
|
|
280
|
+
dscode trigger source build-monitor restart
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
The agent uses `trigger_manage` to create/update the definition and `trigger_source` for these lifecycle actions. Saving a definition registers it; process startup still requires the shared scheduler. A stop persists until an explicit start/restart. Disabling a definition stops its producer, and re-enabling it resumes a producer whose desired state is running. Editing the command or source settings restarts the process; after editing script contents alone, use `restart`. Stop/unregister leave already accepted event jobs intact; cancel those separately when needed. Status distinguishes desired state, the observed process, next attempt, and the last error. Output tails are bounded; they are not a full log archive.
|
|
284
|
+
|
|
285
|
+
Each source has a singleton lock. The scheduler starts a guardian that terminates the script process group on stop or loss of its scheduler IPC connection, escalating to `SIGKILL` after a short grace period. The script inherits the lock so a surviving process cannot overlap a replacement. Deliberately detached processes that create another process group are outside this cleanup guarantee. If the guardian itself is forcibly killed and a script survives with the lock, a replacement reports the held lease rather than starting a duplicate; inspect and terminate that orphan before restarting. Source supervision requires the scheduler service, so it can continue after the TUI closes but cannot run while the machine is asleep or powered off.
|
|
286
|
+
|
|
287
|
+
## Run the scheduler
|
|
288
|
+
|
|
289
|
+
```sh
|
|
290
|
+
dscode trigger scheduler install # macOS: start now and at future logins
|
|
291
|
+
dscode trigger scheduler status
|
|
292
|
+
dscode trigger scheduler start # foreground, also usable under another service manager
|
|
293
|
+
dscode trigger scheduler tick # one scan; wait for the workers it starts
|
|
294
|
+
dscode trigger scheduler uninstall # remove the service; retain jobs and registrations
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
One scheduler owns each state directory. It scans roughly once per second, launches at most four workers concurrently and never runs model work itself. Each worker uses the ordinary trigger execution path, with a fresh or persistent session according to the definition. It also supervises up to 16 script processes, independently of the four model workers. Ordinary `emit` events use the same durable job queue. `scheduler tick` only scans jobs; use the long-running scheduler to supervise scripts.
|
|
298
|
+
|
|
299
|
+
The macOS service is written to `~/Library/LaunchAgents/ai.dscode.scheduler.<state-hash>.plist` with an explicit Node executable, state directory and PATH. launchd restarts it after exit and starts it at login; jobs do not run while the machine is powered off. On other platforms, `install` prints the foreground command for your service manager. `scheduler.log` and per-job worker output under `<state>/triggers/jobs/<jobId>.log` explain startup failures. Updating or moving the Node/DSCODE executable requires updating and restarting the service (`scheduler uninstall`, then `scheduler install`).
|
|
300
|
+
|
|
301
|
+
## In the terminal
|
|
302
|
+
|
|
303
|
+
`/trigger` opens a text overview of this workspace's definitions, source registrations and scheduler status. `/triggers` is a compatible alias with the same management commands. Use `/trigger help` for the complete syntax.
|
|
304
|
+
|
|
305
|
+
```text
|
|
306
|
+
/trigger
|
|
307
|
+
/trigger new build-monitor
|
|
308
|
+
/trigger show build-monitor
|
|
309
|
+
/trigger enable build-monitor
|
|
310
|
+
/trigger disable build-monitor
|
|
311
|
+
/trigger run build-monitor Check the latest build
|
|
312
|
+
/trigger schedule build-monitor 30m Check again after deployment
|
|
313
|
+
/trigger jobs build-monitor
|
|
314
|
+
/trigger cancel <jobId>
|
|
315
|
+
/trigger source build-monitor status
|
|
316
|
+
/trigger source build-monitor restart
|
|
317
|
+
/trigger source build-monitor logs
|
|
318
|
+
/trigger scheduler status
|
|
319
|
+
/trigger scheduler install
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
`new` creates a disabled, project-local `external` starter. Configure its prompt, goal and source before enabling it, either by asking the agent or by supplying JSON fields directly:
|
|
323
|
+
|
|
324
|
+
```text
|
|
325
|
+
/trigger update build-monitor {"prompt":"Review recent build failures","goal":{"objective":"Report the failures and suggested fixes"},"source":{"kind":"calendar","cron":"0 9 * * 1-5","timezone":"America/Los_Angeles"}}
|
|
326
|
+
/trigger enable build-monitor
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
`create <id> <JSON>` creates a fully specified definition, and `update` uses the same top-level merge semantics as `trigger_manage`. `register` and `unregister` control recurring registration separately from the enabled flag. `schedule` accepts a duration (`30s`, `10m`, `2h`, `1d`) or an ISO timestamp with an explicit offset; the remainder of the line is literal event text and needs no shell quoting. `run` queues an event immediately and returns its job id. Both use the shared scheduler and report when it is stopped; neither launches a blocking agent run inside the TUI. `jobs` displays up to 100 workspace jobs. `runs` shows recent outcomes, and `events` shows durable emitted events and legacy spool entries.
|
|
330
|
+
|
|
331
|
+
These are direct user commands and do not invoke the model or its tool-approval flow. Mutations retain the same writable-session, plan-mode, unattended/subagent and workspace boundaries as the agent management tools. Definition edits remain project-local. Source start/stop/restart saves desired state for the scheduler to apply; it does not cancel accepted jobs. `/trigger scheduler install` explicitly installs the machine-wide shared service, which can deliver work from other registered projects too.
|
|
332
|
+
|
|
333
|
+
## Current limits
|
|
334
|
+
|
|
335
|
+
- Nothing notifies you yet. `runs.jsonl` and `dscode trigger log --failed` are the record a notifier will read.
|
|
336
|
+
- Recurring jobs have stable identities derived from their registration, source and scheduled UTC instant; job creation and advancing the schedule cursor commit together. Manual `run` invocations retain their cadence-window identities.
|
|
337
|
+
- A trigger never asks for approval, and an event can never widen its authority.
|
|
338
|
+
- An unattended run is bounded by `goal.maxRounds`, the limits, and its definition's permission preset; the goal round driver must be mounted for a run to get past its first turn.
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
# dscode TUI commands
|
|
2
|
+
|
|
3
|
+
Restart `dscode` to load these commands. Most commands run locally; `/doctor` makes one bounded call to the selected model for analysis. At startup the TUI reads the npm registry once, within eight seconds, and shows a notice when a newer release exists; set `DSCODE_UPDATE_CHECK=off` to skip that check.
|
|
4
|
+
|
|
5
|
+
If a provider rejects a request for content filtering, the turn stops with a `CONTENT_POLICY` or `CONTENT_FILTER` error and keeps the provider's explanation. Review the request and relevant context before sending a follow-up in the same session. The default retry policy does not repeat these rejected requests, and changing an API key does not resolve a content-filter rejection. DSCODE cannot identify the triggering passage unless the provider supplies it.
|
|
6
|
+
|
|
7
|
+
| Command | Behavior |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| `/email` | `i`: connect IMAP with a masked application password; `r`: sync. Browse, preview, and press Enter to steer email directly into this session. [Email interface](email.md). |
|
|
10
|
+
| `/status` | Session ID, workspace, model route, permission mode, recorded token totals/context pressure, tool/plugin counts. Unknown usage stays unknown. `/review-usage` reports the independent reviewer separately. |
|
|
11
|
+
| `/provider [deepseek\|openrouter\|grok\|opencode-go\|custom]` | For self-hosted or private APIs, `/provider custom` opens [Custom model providers](custom-providers.md). Saved custom services also appear by name in the picker: Enter switches to their current or first configured model. The Custom entry adds or edits services. Switch the session between DeepSeek's official API, OpenRouter, Grok and OpenCode Go. Without an argument, open a picker (↑↓ choose, Enter switch, Esc close) that shows each provider's key status. OpenRouter is DSCODE's own adapter over OpenRouter's live model listing (cached for a day in `$DSH_HOME/openrouter-models.json`, settings in the `llm-openrouter` section; `/model` offers DSCODE's curated list from that listing rather than all of it); a switch asks for the key when none is stored, then moves to the counterpart of the current model and keeps the effort when the target offers it. When the new model would compact the current context, the switch asks first. Ultra works on both routes: on OpenRouter it sends `xhigh` plus the collaboration policy, and `low` is sent as `high`, which is how DeepSeek itself answers low. The footer shows the active provider's remaining balance (for OpenRouter, the account's remaining credits, or the key's own remaining limit when OpenRouter refuses the key those) and records the cost OpenRouter reports for each call (estimated from list prices only when it reports none); the 🔥/❄️ peak marker appears only for DeepSeek, because OpenRouter bills no peak window. OpenCode Go serves its chat-completions models to an OpenCode account login, never a key: before `/opencode login` the switch names that command instead of asking for a key, and the footer shows the subscription's usage instead of a cost; see [OpenCode Go](opencode-go.md). Stop a running turn first. |
|
|
12
|
+
| `/model` | Picker for the session's current provider only, listed alphabetically by the displayed model name (digits compare naturally, so GLM 5.2 precedes GLM 5.3). Typing searches as you type (BM25 over model name, id and provider; the word being typed matches prefixes) and narrows the list without re-ranking it; Enter focuses the first match, a second Enter selects it, Esc clears the search then closes, Tab opens the provider picker. |
|
|
13
|
+
| `/opencode [login\|cancel\|logout]` | Sign in to OpenCode Go with an OpenCode account, the route's only credential. `login` shows a code, opens the console in the browser and waits in the background for up to ten minutes; the consent page names the OpenCode CLI, whose login client DSCODE uses. Without an argument it shows who is signed in or how the last attempt ended. The login is stored in `~/.dscode/credentials.yaml` and renews itself. See [OpenCode Go](opencode-go.md). |
|
|
14
|
+
| `/openrouter` | OpenRouter account panel: the account balance, this key's limit and its spend today, this week and this month; with a management key, also every API key's usage and the last 30 days of spend by model and serving provider. `r` refreshes, `m` sets the management key (checked against OpenRouter, stored in `~/.dscode/credentials.yaml`, read-only use; `OPENROUTER_MANAGEMENT_KEY` also works). Saving the OpenRouter API key through `/provider openrouter` or `/login openrouter` offers the management key as an optional step. |
|
|
15
|
+
| `/review` | Independent review of the current changes. `DSCODE_REVIEW_MODEL=provider/model` pins the reviewer to its own model and `DSCODE_REVIEW_EFFORT=<level>` sets its reasoning level, so a small session model cannot cap the review; the budget leaves room for reasoning plus the report. |
|
|
16
|
+
| `/update [exact-version]` | Upgrade DSCODE after this session exits: the TUI starts a detached helper that waits for the session to end and then runs the same `dscode update` entry (npm/Hub launcher, or tar/source self-update). Progress and the outcome are written to `$DSH_HOME/update.log` and `$DSH_HOME/update-result.json`. |
|
|
17
|
+
| `/login [deepseek\|openrouter]` | Paste an API key into the private input; it is saved to `~/.dscode/credentials.yaml` (`0600`, shared across projects and installed versions). Without an argument it targets the current provider. `DEEPSEEK_API_KEY` or `OPENROUTER_API_KEY` in the environment takes precedence and makes that key read-only here. |
|
|
18
|
+
| `/memories [status\|on\|off\|global-on\|global-off\|run\|note <text>\|clear]` | Global cross-session memory controls and background model usage. [Behavior and configuration](memory.md). |
|
|
19
|
+
| `/session` | Current session ID, local socket, and external send/read/watch commands. [Multi-source sessions](session-bridge.md). |
|
|
20
|
+
| `/mailbox [cancel MESSAGE_ID]` | Read messages and deferred notes, or cancel a request/message. [Session communication](session-communication.md). |
|
|
21
|
+
| `/session-new-task` | Explicitly start a fresh communication budget while idle; ordinary continuation and resume retain their existing budgets. |
|
|
22
|
+
| `/goal [<objective>\|clear\|edit <objective>\|pause\|resume]` | Show or control this session's goal: one objective plus the round cap that bounds automatic continuation. `/goal[20] <objective>` creates the goal with a 20-round cap, and `/goal[20]` re-caps the current goal — so an unattended task stops after the rounds you allowed instead of running indefinitely. A cap with no goal, or a control word after a cap, is refused with the usage. |
|
|
23
|
+
| `/trigger` (alias `/triggers`) | Manage this workspace's triggers without a model turn. The default overview shows definitions, registrations and scheduler status. Use `new`, `create`/`update` with JSON fields, `enable`/`disable`, `register`/`unregister`, `run`, `schedule`, `jobs`/`cancel`, `events`, `runs`, `source` and `scheduler`; `/trigger help` lists the syntax. `run` queues an event and reports a stopped scheduler. `new` creates a disabled starter. Mutations require a writable session outside plan mode; scheduler installation starts the shared service for all registered projects. [Triggers](triggers.md). |
|
|
24
|
+
| `/doctor [local\|preview]` | Read-only runtime health plus self-diagnosis from recent warning/error logs and session event traces for this workspace. By default, sends bounded, redacted event metadata to the selected model. `local` skips the model; `preview` shows the exact evidence payload. Does not read conversation text, tool arguments, or tool output. Falls back to local findings if model analysis fails. |
|
|
25
|
+
| `/browser` | Browser status, start/stop, profiles, extension pairing, site permissions, Developer mode, WebMCP, human handoff/resume and tab retention; see [Browser use](browser-use.md). |
|
|
26
|
+
| `/mcp` | List MCP entry IDs, loader state and transport; credentials, headers and environment values are not printed. |
|
|
27
|
+
| `/mcp tools <id>` | List registered tools for a server. |
|
|
28
|
+
| `/mcp enable|disable|reconnect <id>` | Change a server for this process. All agents must be idle. Reconnect disposes and remounts the server. Host servers are configured in `config/mcp.local.yml`; the dscode preset mounts none at startup. Built-in browser connections are managed separately with `/browser`. IDs may be full loader IDs or an unambiguous short ID. |
|
|
29
|
+
| `/skills` | Effective skill catalog, source, provider and invocation permissions. |
|
|
30
|
+
| `/skills <name>` | Description and effective file path, without injecting its instructions into the model. |
|
|
31
|
+
| `/skills conflicts` | Duplicate names in the configured filesystem roots, with the runtime's effective source. Hidden candidates from runtime/remote providers are not enumerable. |
|
|
32
|
+
| `/hooks` | Hook configuration location, the merged layer list and supported events. It also reports a layer whose file changed — or disappeared — after the merge, because only a restart re-reads the layers. |
|
|
33
|
+
| `/hooks reload|enable|disable` | Reload installation-owned hook configuration, or switch hooks for this process while all agents are idle. |
|
|
34
|
+
| `/review [--staged\|--base REF\|--commit REF] [--path RELATIVE_PATH]` | Independently review the selected Git diff in a read-only, tool-free model request. Default includes tracked and untracked uncommitted changes, and when there are none it reviews the commits made since the latest user task started (read from the HEAD reflog), so work that was committed or merged is still reviewed; `--commit` reviews a merge commit against its first parent; empty scopes do not call the model. Narrow large or unrelated diffs with `--path`. |
|
|
35
|
+
| `/delegate <task>` | Hand the task to the main agent as coordinator: it records the parts on a delegate board, launches them as child agents with `worktree: true` in the background while child slots are free (five below Ultra, twenty at Ultra), answers the questions they send to `/`, verifies each finished worktree, and once every task is done merges the accepted ones into the main workspace with `git apply --3way`, leaving them staged and uncommitted. Refused unless the session starts at a clean Git repository root, and inside a child agent. See [Ultra](dscode-ultra.md#delegate-mode). |
|
|
36
|
+
| `/delegate-dashboard` | Popup kanban of the current session's delegate board with four columns — pending, running, verifying, complete — and the child slots in use. A task is running while its child works or waits on an answer from the main agent (marked `?`), and verifying once the child has settled and the main agent has not yet recorded the result. Columns are divided by vertical rules and every task is its own bordered card with its id, child name and title; `▲` marks high priority and `▼` low. Pending cards run in launch order, ready ones first; a blocked task has a grey card with a hollow `◌` and names what it waits on (`after t1,t2`). Waiting cards lead their column. On a short terminal each card folds to one line so more of them fit, and a narrow terminal stacks the columns. It refreshes every second; Esc or q closes it. |
|
|
37
|
+
| `/verbose` | Toggle verbose chat: thinking and tool calls appear dimmed as `· Thinking: …`, `· Tool Call: name args` and ` Output: …` (thinking capped at eight lines), with a blank line between blocks. The setting is saved per machine in `~/.dsh/dsh-code/verbose.json`. Ctrl/Alt+R toggles the same setting; Ctrl+O still opens the full history inspector. |
|
|
38
|
+
| `/mouse` | Toggle mouse capture. On (default) makes the wheel scroll the chat one row per notch, merging the notches that arrive in the same frame; off hands the mouse back to the terminal for drag-select and copy, leaving PageUp/PageDown to scroll the chat. While capture is on, hold Shift (Option in iTerm2, Fn in Terminal.app) to select text. The choice is saved per machine in `~/.dsh/dsh-code/mouse.json`. |
|
|
39
|
+
| `/language [code]` | Without an argument, open a picker (↑↓ choose, enter apply, esc close) for the interface language for DSCODE's own labels, notices, the status-line telemetry labels and the composer placeholder: `en` (default), `zh-CN`, `zh-TW`, `ja`, `ko`, `es`. Names and common aliases work too (`简体中文`, `jp`). The choice is saved per machine in `~/.dsh/dsh-code/language.json`; `DSCODE_LANGUAGE` overrides it for one process. |
|
|
40
|
+
| `/clear` | Start a fresh session and clear the screen after successful activation; the previous session remains available through `/resume`. Stop a running turn first. |
|
|
41
|
+
| Ctrl+L | Clear the screen only, keeping the conversation context. |
|
|
42
|
+
| Ctrl+C | While an agent runs, cancel it immediately; a second press exits the TUI without waiting for the busy display to settle. With an idle draft, the first press clears it and the second exits. |
|
|
43
|
+
|
|
44
|
+
The interactive preset is fixed to `dscode`. `/mode` is hidden from help and completion; typing it only reports the fixed mode. `/new` creates a DSCODE session and refuses other preset names. Older sessions retain their transcript when resumed under DSCODE. `/model`, `/effort`, `/permission` and plan-mode controls remain independent.
|
|
45
|
+
|
|
46
|
+
Command results use the standard collapsible TUI result presentation.
|
|
47
|
+
|
|
48
|
+
Normal mode shows the agent's ordinary text, including progress updates. The agent is instructed to explain its first step, report significant findings or blockers, and give brief updates roughly every minute during sustained work when it has control. This is model guidance, not a timer: a blocking tool call may delay an update until it returns. `/verbose` additionally shows reasoning and tool details; it is not required for progress updates.
|
|
49
|
+
|
|
50
|
+
The agent also has a `review` tool backed by the same service. Automatic review allows **two passes per direct user task**, including failed passes; a changed path or scope does not reset the allowance. The first pass follows code changes and relevant checks. A second pass verifies confirmed findings and direct regressions from their fixes, rather than opening another audit. Recorded results preserve the allowance when resuming a session; unchanged diff+task+provider+model requests reuse cached reports. Concurrent calls do not start additional reviews. Each pass asks for thinking off (a model without that level keeps its own default), at most **32,768 output tokens per model attempt** (65,536 on the one retry that spent its whole budget without writing anything), and a **90-second deadline** including that retry. An explicit idle `/review` command can request an additional manual pass without resetting the automatic allowance.
|
|
51
|
+
|
|
52
|
+
The reviewer sees the latest direct user task and at most 160 KiB of selected diff, with common secret formats redacted; it cannot inspect surrounding files, run tests or edit code. It reports at most five concrete defects affecting the task. Findings must be checked against the actual code before edits. Timeouts, truncated output, omitted files and exhausted budgets are incomplete reviews, never clean results. The agent should complete necessary fixes and affected checks, then report remaining gaps instead of repeatedly calling review.
|
|
53
|
+
|
|
54
|
+
Task completion guidance keeps scope and acceptance checks stable. Once requested behavior and required checks pass, the agent proceeds to delivery; optional refactors and optimizations are separate follow-ups. Changes invalidate only the checks they affect unless evidence requires broader verification. This guidance reduces unnecessary work, but does not mechanically prove that arbitrary shell commands or agent decisions satisfy the task.
|
|
55
|
+
|
|
56
|
+
`dscode doctor` runs the same diagnostic collector and model analysis without opening the TUI. It checks the current working directory's recent sessions, including subagents, and reads the owner-only `diagnostics/runtime.jsonl` warning/error journal under `DSH_HOME`. `--local` skips the model; `--preview` shows the exact evidence payload. A model call is limited to 45 seconds; missing credentials or model failure leave a local trace summary. These commands diagnose existing evidence and do not execute tools or repair state. `npm run doctor` remains the separate deterministic integration fixture.
|
|
57
|
+
|
|
58
|
+
Child aliases such as `/reader` are scoped to their parent session. Names of
|
|
59
|
+
continuable children survive a Host restart: sending to the alias resumes the
|
|
60
|
+
same child, and the name stays reserved while that child is cold. Looking up a
|
|
61
|
+
name does not start a turn. Finished foreground children cannot be resumed by
|
|
62
|
+
name; reopen their tasks with an available name to launch new work. A child's
|
|
63
|
+
`send_message` to `/` addresses its parent. Waiting indicators change only after
|
|
64
|
+
successful delivery, so a failed reply keeps the outstanding question visible.
|
|
65
|
+
Edits rejected by validation leave the task unchanged, including its child, worktree,
|
|
66
|
+
verification evidence and priority. Reopening a completed task must use a child
|
|
67
|
+
name that is not already planned for another open task.
|
|
68
|
+
|
|
69
|
+
Both foreground and background named child runs enter the task board when the
|
|
70
|
+
runtime accepts their launch. A foreground call waits for its child and releases
|
|
71
|
+
that one-shot agent before returning; the task then remains in Verifying with
|
|
72
|
+
its recorded worktree path. Cancellation or failure after launch also leaves the
|
|
73
|
+
task for review. The coordinator must inspect the outcome and explicitly
|
|
74
|
+
complete, reopen or drop it. A task is never marked complete solely because the
|
|
75
|
+
child stopped. Starting a child unsuccessfully before launch leaves it Pending.
|
|
76
|
+
|
|
77
|
+
## Experimental Desktop delegation board
|
|
78
|
+
|
|
79
|
+
The combined Desktop package adds **Delegation board** to the right sidebar.
|
|
80
|
+
Select an open DSCODE main session and run `/delegate <task>` in chat to start
|
|
81
|
+
coordination. Its board shows Pending, Running, Verifying and Complete tasks,
|
|
82
|
+
priorities, dependencies, blocked tasks, children waiting for the coordinator,
|
|
83
|
+
and the number of running child slots. Expand **Task details** for owned scope,
|
|
84
|
+
checks, worktree paths, reopen reasons and recorded verification evidence.
|
|
85
|
+
|
|
86
|
+
The view reads the same live board as the coordinator and refreshes once per
|
|
87
|
+
second while visible. Reading it does not launch children, change tasks or merge
|
|
88
|
+
work. Closing another session leaves the selected board available; switching
|
|
89
|
+
sessions clears the previous view. Task records survive restart, while running
|
|
90
|
+
and verifying status is derived from live children. Recorded evidence describes
|
|
91
|
+
the coordinator's checks; displaying it does not run those checks again.
|
|
92
|
+
|
|
93
|
+
Child sessions and native Standard sessions cannot read a DSCODE main session's
|
|
94
|
+
board through this view. The terminal continues to use `/delegate-dashboard`;
|
|
95
|
+
Desktop's `/delegate` instructions point to **Delegation board**. The package is
|
|
96
|
+
experimental and unpublished; see [Browser use](browser-use.md#install-the-experimental-combined-desktop-package)
|
|
97
|
+
for local build and installation instructions.
|
|
98
|
+
|
|
99
|
+
## Experimental Desktop diagnostics
|
|
100
|
+
|
|
101
|
+
In the combined Desktop package, type complete commands such as
|
|
102
|
+
`/memories status`, `/shell status`, `/review --staged`,
|
|
103
|
+
`/mailbox cancel <message-id>` and `/computer status` in the composer. Their
|
|
104
|
+
arguments go to the native command handler. The diagnostic commands below also
|
|
105
|
+
accept arguments there. None of these commands accepts attachments. Existing
|
|
106
|
+
behavior still applies: a valid `/review` uses the reviewer model, bare
|
|
107
|
+
`/dscode-doctor` requests model analysis, and memory generation may run in the
|
|
108
|
+
background. `/dscode-doctor local` skips model analysis.
|
|
109
|
+
|
|
110
|
+
The experimental combined Desktop package registers `/dscode-status`,
|
|
111
|
+
`/dscode-doctor [local|preview]`, `/dscode-skills [name|conflicts]` and
|
|
112
|
+
`/dscode-mcp [list|tools|enable|disable|reconnect]`. Select a DSCODE session before
|
|
113
|
+
using them. Native command names keep their existing handlers, and Standard
|
|
114
|
+
sessions cannot use the DSCODE diagnostic commands. Desktop keeps its own updater
|
|
115
|
+
and terminal interface; the package does not add `/dscode-update`,
|
|
116
|
+
`/dscode-shell-exec` or `/dscode-hooks`.
|
|
117
|
+
|
|
118
|
+
Desktop doctor reads up to six recent sessions in the selected session's
|
|
119
|
+
workspace, including the current session. A workspace with no persisted history
|
|
120
|
+
does not fall back to another workspace. Warning/error logs come from the shared
|
|
121
|
+
Host and can include other workspaces. The collector summarizes session event
|
|
122
|
+
metadata without copying conversation bodies, tool arguments or tool output.
|
|
123
|
+
Known credential patterns in logs and command results are redacted; log messages
|
|
124
|
+
can still contain other application details. Use `preview` to inspect the
|
|
125
|
+
evidence, `local` for local findings, or the command without an argument for one
|
|
126
|
+
bounded analysis call to the selected model. That call is charged to the invoking
|
|
127
|
+
session under `doctor`; failure falls back to local findings.
|
|
128
|
+
|
|
129
|
+
MCP changes apply only to mutable Host entries and require all agents to be idle.
|
|
130
|
+
Preset modules are inspection-only. Skill conflict reports explicitly mark
|
|
131
|
+
per-agent filesystem roots as unchecked, because the preset inventory does not
|
|
132
|
+
expose their configuration. Current user guides ship in the package's `docs/`
|
|
133
|
+
directory, and the DSCODE agent's documentation prompt points there. Links to
|
|
134
|
+
unbundled developer records open the public repository, which may lag this
|
|
135
|
+
unpublished package. See [Browser use](browser-use.md#install-the-experimental-combined-desktop-package)
|
|
136
|
+
for local installation.
|
|
137
|
+
|
|
138
|
+
## Hooks
|
|
139
|
+
|
|
140
|
+
`npm run setup` creates `config/hooks.local.json` containing `{"hooks":{}}`. No hook commands run by default. This file is local to the installation, ignored by git, and excluded from distributable archives. Project `.codex/hooks.json`, `.dsh/hooks.json` and `.claude/settings.json` are layered on top by default; set `DSCODE_PROJECT_HOOKS=0` to load `config/hooks.local.json` alone.
|
|
141
|
+
|
|
142
|
+
The pinned bridge reads one file for the whole process, so the layers are merged — installation, then `.codex/hooks.json`, `.dsh/hooks.json` and `.claude/settings.json` (its top-level `hooks`) — into `$DSH_HOME/hooks.resolved.json` (mode 0600), and a sibling `hooks.resolved.report.json` report records the layers and any event this bridge cannot run; `/hooks` prints both. A project file is report-only: an event this bridge cannot run, or a gate it cannot load, is skipped and listed with its reason, while `config/hooks.local.json` still fails startup on anything it cannot run. The merged file is rewritten at startup, so an edit to any layer needs a restart rather than `/hooks reload`. Matchers stay regular expressions, so a Claude Code matcher such as `Bash` does not match dscode's `bash` tool — write `^bash$`. These layers run as your OS user outside tool approval, so set `DSCODE_PROJECT_HOOKS=0` on a repository you do not trust.
|
|
143
|
+
|
|
144
|
+
Edit this file with trusted commands, then `/hooks reload` (or restart). Example:
|
|
145
|
+
|
|
146
|
+
```json
|
|
147
|
+
{
|
|
148
|
+
"hooks": {
|
|
149
|
+
"PreToolUse": [{
|
|
150
|
+
"matcher": "^bash$",
|
|
151
|
+
"hooks": [{
|
|
152
|
+
"type": "command",
|
|
153
|
+
"command": "/absolute/path/to/your-tool-gate",
|
|
154
|
+
"timeout": 5
|
|
155
|
+
}]
|
|
156
|
+
}]
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Hook stdin is a JSON event payload; for shell tools it includes `tool_input.command`. Exit code 2 with a stderr reason blocks the tool. Successful hooks may return the upstream Codex-compatible JSON output. These are host shell commands, running in the session workspace as the OS user, outside the model's tool-approval flow. They can use local CLI credentials; configure them with the same care as local shell scripts. This is not a security sandbox for untrusted project hooks.
|
|
162
|
+
|
|
163
|
+
The pinned official `@deepseek-ai/dsh-hooks-codex` bridge supports:
|
|
164
|
+
|
|
165
|
+
- `SessionStart`: attach context; asynchronous delivery may miss the first request.
|
|
166
|
+
- `UserPromptSubmit`: block a prompt or add context.
|
|
167
|
+
- `PreToolUse`: deny a tool; cannot grant approval or rewrite arguments.
|
|
168
|
+
- `PostToolUse`: add context or feedback.
|
|
169
|
+
- `Stop`: request continuation. The hook must self-limit to avoid a continuation loop.
|
|
170
|
+
|
|
171
|
+
`PermissionRequest`, `PreCompact`, `PostCompact`, `SubagentStart`, `SubagentStop`, async hooks and non-command hooks are not supported. dscode validates these at startup/reload so unsupported gates do not silently load. The default timeout is 10 seconds; explicit hook timeouts may be up to 600 seconds. Hook execution failures otherwise follow the upstream bridge's fail-open behavior. Non-shell tool inputs are reduced to `{command: ""}` by this bridge. Model and permission-mode fields are upstream static placeholders, not authoritative runtime status. Native `hook/invoked` and `hook/result` events remain resumable.
|
|
172
|
+
|
|
173
|
+
## Skills and workspace instructions
|
|
174
|
+
|
|
175
|
+
Skills come from the runtime's filesystem provider: the project's `.dsh/skills` and `.agents/skills` (project root is the nearest ancestor containing `.git`), then custom roots, then the user roots under `$DSH_HOME` and `$DSH_AGENTS_HOME`. Ancestor discovery is on by default: `.dsh/skills`, `.agents/skills` and `.claude/skills` from every directory between the working directory and home register at rank 300, nearest first; `DSCODE_SKILL_ANCESTORS=0` (also `off`/`false`/`no`) turns that off, and it belongs in the environment (the installation's `.env`) rather than `config/harness.local.yml`. `AGENTS.md` and `CLAUDE.md` from directories above the project root are folded into the workspace instructions without a switch. [Skills](skills.md) covers the scopes and ranks, the ordering rules, how to verify the mode, and the instruction-file chain.
|
|
176
|
+
|
|
177
|
+
## Distribution and verification
|
|
178
|
+
|
|
179
|
+
The launcher applies an idempotent, version-checked patch to the pinned `dsh-code@1.0.6` bundle for `/clear` and startup command discovery. An unsupported upstream version/shape fails setup instead of patching blindly. All other command behavior lives in `plugins/tui-tools` and hooks use the official runtime plugin. `npm ci` followed by setup reinstalls the patch, including on distributed installs.
|
|
180
|
+
|
|
181
|
+
`npm test` covers hook validation, MCP idle gating/reconnect, skill conflicts and patch drift. `npm run doctor` boots the real profile, calls the command registry, tests MCP unregister/remount, and uses a real hook subprocess to block a deterministic model's shell tool. No paid model call is used.
|
|
182
|
+
|
|
183
|
+
## Input and session resume
|
|
184
|
+
|
|
185
|
+
- `!command`: runs the user's command in the current session directory through `$SHELL` (`/bin/sh` by default), showing stdout, stderr and the exit code without starting a model turn. Multi-line commands are supported; each run is its own shell, so `cd` and environment variables do not persist between commands. It runs non-interactively with a 120-second timeout and shows at most 64 KiB of output; exiting or switching session cancels an unfinished command.
|
|
186
|
+
- `Shift+Enter`: newline; `Enter`: send. The CSI-u and xterm modifyOtherKeys Shift+Enter sequences are supported. A terminal that cannot send the modifier can use `Ctrl+J` for a newline.
|
|
187
|
+
- Pasting more than 200 characters shows `[Pasted Content N chars]` in the composer as a placeholder while the surrounding text stays editable; after sending, the transcript expands to the full content and the model receives that same full content. The placeholder can be deleted as one unit. Command text starting with `/` or `!` stays visible.
|
|
188
|
+
- Pasting or dropping an image file path shows `[Image 1]`, `[Image 2]` and so on in the composer; the image is sent as an attachment. On macOS, `Ctrl+V` attaches a screenshot or a copied image straight from the system clipboard; in a terminal that pastes an image as a temporary path, `Cmd+V` goes through the file-path entry point too. The first `Ctrl+V` compiles a local image-reading helper and needs Xcode Command Line Tools.
|
|
189
|
+
- `dscode resume`: continues the most recent session; `dscode resume SESSION_ID`: resumes the named session. `--cwd DIRECTORY` may be appended. After a successful exit and save it prints the resume command for the current session.
|
|
190
|
+
- A session's folder is chosen when it is created and never changes: resuming one, through `--resume`, `/resume`, `/search` or a queued switch, works in the folder the session is bound to, and the window's workspace, shell and durable log all follow that folder. A resume that leaves the folder `dscode` was launched in prints one warning notice naming both folders, so a window that silently changed project is visible. To reach another project's context from here, have an agent read that session or use `dscode send` across sessions instead of resuming it.
|
|
191
|
+
- The main chat area hides thinking, tool arguments, tool results and completed tool calls; the dynamic area shows only the name of the tool currently running. User messages, agent prose, user shell command results and the necessary error/approval prompts are still shown. The complete record stays in the session and can be seen through the history detail or an export.
|
|
192
|
+
- When a turn ends, the chat area draws a light separator line after that turn's last visible record; the next turn starts on a new line. Turn separators are kept when a session is resumed, and an export contains none.
|
|
193
|
+
- A sent user message uses its own light-grey background block in the main chat area; the background stays continuous when a long message wraps, and the dark and light themes adapt separately. A session export is still plain text.
|
|
194
|
+
- CJK input-method positioning: after each frame the terminal's real cursor is synchronised to the composer's current character position (including CJK width, line wrapping and the composer's internal scroll), and the render position is restored before the redraw. A change here needs the TUI restarted; how the macOS candidate window appears still has to be verified in the terminal actually in use.
|
|
195
|
+
- The screen is cleared on startup; the interface shows the most recent session content according to the terminal height, with the composer and status bar pinned to the bottom. The mouse wheel or PageUp/PageDown browses earlier messages in the main chat area, and following new messages resumes after scrolling back to the bottom; Ctrl+O shows the complete session record and `/export` exports it. The terminal scrollback no longer keeps appending completed messages.
|
|
196
|
+
- The effort step of `/effort` and `/model` replaces the composer at the bottom. A model with four bands shows a horizontal `low → high → max → ultra` bar; arrow keys move, Enter applies, Esc cancels and restores the composer, and `o` switches straight to off. As the cursor reaches ultra a blue effect spreads from the centre outwards; after Enter applies, the composer plays a short central ripple. Nothing plays while animations are off. Other models still show the band list they provide. When switching models, a supported effort is preserved; otherwise the picker starts at the target model's default (for example, MiMo `medium` becomes DeepSeek's default `high`). The footer shows the selected model's effort without borrowing a previous request's value. If no default is advertised, the default selection has no effort label.
|
|
197
|
+
|
|
198
|
+
## DSCODE interface layout
|
|
199
|
+
|
|
200
|
+
The startup header is a compact welcome box: on the left a pixel snowflake in three blues — six arms 60° apart around a bright hexagonal crystal, twelve lines tall, or eleven on terminals under 26 rows — and on the right a bold DSCODE wordmark with a thin divider that brands the box and lists the current model, effort, local version and project path. A narrow window or a short terminal compresses it to a three-line layout with ❄, keeping the last directory of a long path. A session title that changes while running still shows at the bottom. The body keeps the user and agent output, while thinking and tool-call history stay hidden.
|
|
201
|
+
|
|
202
|
+
Above the composer, thinking, the reply or the current tool and its description are shown uniformly, timed as the total for the turn. Only the running marker animates; the composer plays no wave. The sub-agent overview separates running / idle / done, and `/agents` shows the tasks and current activity.
|
|
203
|
+
|
|
204
|
+
The footer leads row 1 with the session name and the model with its effort, then the working directory, the permission badge and any task state. Row 2 places request TPS, session-average TPS, context and the loaded skill count on the left, with session cost, DeepSeek balance and peak/off-peak marker, optional last-turn cost and cache rate aligned together on the right. Space separates the groups; `·` separates figures within each group. At narrow widths the financial group moves to a third row before left-side figures are dropped. Average TPS yields before current TPS, context and skills. Extremely narrow terminals may omit the optional last-turn cost and clip the financial group. `/statusline` still customises every original item, and an existing custom configuration keeps working.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifest_version": 3,
|
|
3
|
+
"name": "DSCODE Browser",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"description": "Share selected browser tabs with your local DSCODE session.",
|
|
6
|
+
"minimum_chrome_version": "125",
|
|
7
|
+
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA7hXV+eosyq7w+kTH3h/jv/OLf92aNLA4XcI9rxVZr8pcdLewrdVWQRRYpp1Ug0NkcBjwoLyhWlhU1ulyEcs4HekF3l7EQpcUa8vKOMUxzzZSTqmUSVYXRoHd9Vl0plsMccL/uDCvqNCn3oi7eSpPuX0oAvOoUeyhM+2bPqSF1mMhZOqPp1U82fct09Wh68B5WQTCzzkm1GG4QqSPCjpvk1ht9GvuPXFyg2TWf/O6ZWkt94K4fgvoGdFNbwwOr8O5J+KKV3vVej1U+o7n6LbFC/9j9zzrHyneWgVNVkUAML7Uq23h5gI2ZEWGlp9Xz5UyTzYuJ/iJysbWflVErGBnQQIDAQAB",
|
|
8
|
+
"permissions": [
|
|
9
|
+
"debugger",
|
|
10
|
+
"activeTab"
|
|
11
|
+
],
|
|
12
|
+
"host_permissions": [
|
|
13
|
+
"http://127.0.0.1/*"
|
|
14
|
+
],
|
|
15
|
+
"background": {
|
|
16
|
+
"service_worker": "worker.mjs",
|
|
17
|
+
"type": "module"
|
|
18
|
+
},
|
|
19
|
+
"action": {
|
|
20
|
+
"default_popup": "popup.html"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
body { width: 330px; margin: 18px; color: #20242c; background: #fafafa; font: 14px/1.5 system-ui; }
|
|
2
|
+
h1 { font-size: 19px; } label, input, button { display: block; box-sizing: border-box; width: 100%; }
|
|
3
|
+
input, button { padding: 9px; margin: 8px 0; border: 1px solid #c8cbd0; border-radius: 6px; }
|
|
4
|
+
button { cursor: pointer; background: #fff; } button:disabled { opacity: .5; }
|
|
5
|
+
#stop { border-color: #bd4520; color: #a13613; } [hidden] { display: none; }
|
|
6
|
+
li { overflow-wrap: anywhere; } #status { font-weight: 600; }
|