@toddzheng024/dscode-desktop 0.0.0-stage → 0.7.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +120 -2
- package/THIRD_PARTY_NOTICES.md +30 -0
- package/bin/apply_patch +9 -0
- package/cordis.patch.yml +433 -0
- package/docs/CHANGELOG.md +641 -0
- package/docs/account-login.md +44 -0
- package/docs/auto-review.md +128 -0
- package/docs/browser-use.md +783 -0
- package/docs/computer-use.md +81 -0
- package/docs/custom-providers.md +88 -0
- package/docs/demo.md +76 -0
- package/docs/distribution.md +58 -0
- package/docs/dscode-ultra.md +75 -0
- package/docs/email.md +296 -0
- package/docs/exec.md +40 -0
- package/docs/hub-distribution.md +190 -0
- package/docs/memory.md +121 -0
- package/docs/opencode-go.md +61 -0
- package/docs/plugin-hub.md +68 -0
- package/docs/releases/0.2.0.md +28 -0
- package/docs/releases/0.3.0.md +21 -0
- package/docs/releases/0.4.0.md +20 -0
- package/docs/releases/0.5.0.md +19 -0
- package/docs/releases/0.6.0.md +20 -0
- package/docs/releases/0.7.0.md +22 -0
- package/docs/releases/0.7.1.md +20 -0
- package/docs/releases/0.7.10.md +10 -0
- package/docs/releases/0.7.11.md +17 -0
- package/docs/releases/0.7.12.md +11 -0
- package/docs/releases/0.7.13.md +12 -0
- package/docs/releases/0.7.14.md +11 -0
- package/docs/releases/0.7.15.md +11 -0
- package/docs/releases/0.7.16.md +10 -0
- package/docs/releases/0.7.17.md +12 -0
- package/docs/releases/0.7.18.md +13 -0
- package/docs/releases/0.7.19.md +8 -0
- package/docs/releases/0.7.2.md +19 -0
- package/docs/releases/0.7.20.md +10 -0
- package/docs/releases/0.7.21.md +9 -0
- package/docs/releases/0.7.22.md +11 -0
- package/docs/releases/0.7.23.md +14 -0
- package/docs/releases/0.7.24.md +11 -0
- package/docs/releases/0.7.25.md +8 -0
- package/docs/releases/0.7.26.md +18 -0
- package/docs/releases/0.7.27.md +8 -0
- package/docs/releases/0.7.28.md +22 -0
- package/docs/releases/0.7.29.md +12 -0
- package/docs/releases/0.7.3.md +23 -0
- package/docs/releases/0.7.30.md +19 -0
- package/docs/releases/0.7.31.md +14 -0
- package/docs/releases/0.7.32.md +14 -0
- package/docs/releases/0.7.33.md +30 -0
- package/docs/releases/0.7.4.md +16 -0
- package/docs/releases/0.7.5.md +18 -0
- package/docs/releases/0.7.6.md +29 -0
- package/docs/releases/0.7.7.md +36 -0
- package/docs/releases/0.7.8.md +14 -0
- package/docs/releases/0.7.9.md +15 -0
- package/docs/session-bridge.md +80 -0
- package/docs/session-cards.md +53 -0
- package/docs/session-communication.md +186 -0
- package/docs/session-metrics.md +41 -0
- package/docs/skills.md +81 -0
- package/docs/triggers.md +338 -0
- package/docs/tui-commands.md +204 -0
- package/extensions/browser/manifest.json +22 -0
- package/extensions/browser/popup.css +6 -0
- package/extensions/browser/popup.html +11 -0
- package/extensions/browser/popup.mjs +47 -0
- package/extensions/browser/protocol.mjs +168 -0
- package/extensions/browser/worker.mjs +94 -0
- package/icon.svg +7 -0
- package/locale/en.json +6 -0
- package/locale/zh-cn.json +6 -0
- package/node_modules/@deepseek-ai/node-addon-system/LICENSE +21 -0
- package/node_modules/@deepseek-ai/node-addon-system/README.i18n.yaml +6 -0
- package/node_modules/@deepseek-ai/node-addon-system/README.md +15 -0
- package/node_modules/@deepseek-ai/node-addon-system/README.zh.md +15 -0
- package/node_modules/@deepseek-ai/node-addon-system/lib/flock.d.ts +13 -0
- package/node_modules/@deepseek-ai/node-addon-system/lib/flock.js +51 -0
- package/node_modules/@deepseek-ai/node-addon-system/lib/index.d.ts +73 -0
- package/node_modules/@deepseek-ai/node-addon-system/lib/index.js +98 -0
- package/node_modules/@deepseek-ai/node-addon-system/package.json +45 -0
- package/node_modules/@deepseek-ai/node-addon-system/src/flock.c +164 -0
- package/node_modules/@deepseek-ai/node-addon-system/src/main.c +298 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/LICENSE +28 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/README.i18n.yaml +6 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/README.md +9 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/README.zh.md +9 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/bin/system.node +0 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/package.json +31 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/prebuilds.json +6 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-x64/LICENSE +28 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-x64/README.i18n.yaml +6 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-x64/README.md +9 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-x64/README.zh.md +9 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-x64/bin/system.node +0 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-x64/package.json +31 -0
- package/node_modules/@deepseek-ai/node-addon-system-darwin-x64/prebuilds.json +6 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/LICENSE +28 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/README.i18n.yaml +6 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/README.md +11 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/README.zh.md +11 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/bin/glibc/system.node +0 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/bin/landlock-run +0 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/bin/musl/system.node +0 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/package.json +31 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/prebuilds.json +24 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-x64/LICENSE +28 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-x64/README.i18n.yaml +6 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-x64/README.md +11 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-x64/README.zh.md +11 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-x64/bin/glibc/system.node +0 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-x64/bin/landlock-run +0 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-x64/bin/musl/system.node +0 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-x64/package.json +31 -0
- package/node_modules/@deepseek-ai/node-addon-system-linux-x64/prebuilds.json +24 -0
- package/package.json +156 -4
- package/plugins/account/index.mjs +178 -0
- package/plugins/account/state.mjs +123 -0
- package/plugins/auto-review/audit.mjs +24 -0
- package/plugins/auto-review/index.mjs +267 -0
- package/plugins/auto-review/policy.mjs +92 -0
- package/plugins/browser/SKILL.md +158 -0
- package/plugins/browser/access.mjs +143 -0
- package/plugins/browser/config.mjs +60 -0
- package/plugins/browser/connection.mjs +385 -0
- package/plugins/browser/desktop-client.mjs +282 -0
- package/plugins/browser/desktop-host.mjs +74 -0
- package/plugins/browser/document-identity.mjs +57 -0
- package/plugins/browser/extension-relay.mjs +66 -0
- package/plugins/browser/files.mjs +32 -0
- package/plugins/browser/index.mjs +235 -0
- package/plugins/browser/mcp-entry.mjs +18 -0
- package/plugins/browser/mcp-tools.mjs +21 -0
- package/plugins/browser/presentation.mjs +45 -0
- package/plugins/browser/preview.mjs +77 -0
- package/plugins/browser/review.mjs +20 -0
- package/plugins/browser/screenshots.mjs +35 -0
- package/plugins/clipboard-image/clipboard-image.swift +56 -0
- package/plugins/clipboard-image/index.mjs +70 -0
- package/plugins/code-review/baseline.mjs +143 -0
- package/plugins/code-review/git.mjs +163 -0
- package/plugins/code-review/index.mjs +236 -0
- package/plugins/compaction/engine.mjs +304 -0
- package/plugins/compaction/tetris.mjs +65 -0
- package/plugins/compaction/threshold.mjs +98 -0
- package/plugins/computer-use/DESKTOP-SKILL.md +64 -0
- package/plugins/computer-use/desktop-host.mjs +75 -0
- package/plugins/computer-use/desktop-skill.mjs +28 -0
- package/plugins/computer-use/desktop-upstream.mjs +3 -0
- package/plugins/computer-use/index.mjs +37 -0
- package/plugins/cordis-config/plain.mjs +31 -0
- package/plugins/credentials/index.mjs +73 -0
- package/plugins/custom/adapter.mjs +110 -0
- package/plugins/custom/config.mjs +85 -0
- package/plugins/custom/desktop-client.mjs +150 -0
- package/plugins/custom/desktop-host.mjs +78 -0
- package/plugins/custom/images.mjs +32 -0
- package/plugins/custom/index.mjs +145 -0
- package/plugins/custom/wire.mjs +179 -0
- package/plugins/desktop/client.mjs +1041 -0
- package/plugins/desktop/index.mjs +10 -0
- package/plugins/desktop/shell-environment.mjs +9 -0
- package/plugins/desktop-workspace/hooks.mjs +29 -0
- package/plugins/desktop-workspace/index.mjs +37 -0
- package/plugins/dscode/board.mjs +260 -0
- package/plugins/dscode/child-target.mjs +11 -0
- package/plugins/dscode/control.mjs +17 -0
- package/plugins/dscode/desktop-client.mjs +55 -0
- package/plugins/dscode/desktop-host.mjs +37 -0
- package/plugins/dscode/index.mjs +270 -0
- package/plugins/email/cli.mjs +32 -0
- package/plugins/email/contacts.mjs +36 -0
- package/plugins/email/desktop-client.mjs +117 -0
- package/plugins/email/desktop-host.mjs +54 -0
- package/plugins/email/desktop-service.mjs +106 -0
- package/plugins/email/gmail-oauth.mjs +69 -0
- package/plugins/email/gmail-store.mjs +2 -0
- package/plugins/email/gmail.mjs +194 -0
- package/plugins/email/imap.mjs +136 -0
- package/plugins/email/inbox.d.mts +25 -0
- package/plugins/email/inbox.mjs +76 -0
- package/plugins/email/smtp.mjs +70 -0
- package/plugins/email/store.mjs +32 -0
- package/plugins/email-tools/index.mjs +46 -0
- package/plugins/exec/cli.mjs +64 -0
- package/plugins/exec/index.mjs +112 -0
- package/plugins/grok/adapter.mjs +114 -0
- package/plugins/grok/auth.mjs +76 -0
- package/plugins/grok/billing.mjs +146 -0
- package/plugins/grok/index.mjs +122 -0
- package/plugins/grok/models.mjs +129 -0
- package/plugins/grok/status.mjs +28 -0
- package/plugins/grok/wire.mjs +268 -0
- package/plugins/hub/catalog.mjs +82 -0
- package/plugins/hub/desktop-client.mjs +114 -0
- package/plugins/hub/desktop-host.mjs +129 -0
- package/plugins/i18n/messages.d.mts +21 -0
- package/plugins/i18n/messages.mjs +537 -0
- package/plugins/jev/approval.mjs +131 -0
- package/plugins/jev/client.mjs +74 -0
- package/plugins/jev/index.mjs +99 -0
- package/plugins/memory/content.mjs +57 -0
- package/plugins/memory/desktop-host.mjs +3 -0
- package/plugins/memory/index.mjs +168 -0
- package/plugins/memory/pipeline.mjs +79 -0
- package/plugins/memory/store.mjs +93 -0
- package/plugins/message-source/kind.mjs +20 -0
- package/plugins/opencode-go/adapter.mjs +96 -0
- package/plugins/opencode-go/command.mjs +128 -0
- package/plugins/opencode-go/index.mjs +120 -0
- package/plugins/opencode-go/models.mjs +58 -0
- package/plugins/opencode-go/oauth.mjs +194 -0
- package/plugins/opencode-go/search.mjs +86 -0
- package/plugins/opencode-go/usage.mjs +119 -0
- package/plugins/opencode-go/version.mjs +10 -0
- package/plugins/opencode-go/wire.mjs +73 -0
- package/plugins/openrouter/adapter.mjs +232 -0
- package/plugins/openrouter/index.mjs +123 -0
- package/plugins/openrouter/models.mjs +157 -0
- package/plugins/openrouter/search.mjs +113 -0
- package/plugins/openrouter/wire.mjs +101 -0
- package/plugins/providers/catalog.mjs +160 -0
- package/plugins/providers/chat-messages.mjs +120 -0
- package/plugins/providers/chat-stream.mjs +174 -0
- package/plugins/providers/desktop-client.mjs +84 -0
- package/plugins/providers/desktop-host.mjs +63 -0
- package/plugins/providers/effort.mjs +35 -0
- package/plugins/providers/http-errors.mjs +50 -0
- package/plugins/providers/openrouter-account.mjs +171 -0
- package/plugins/session-bridge/client.mjs +106 -0
- package/plugins/session-bridge/communication.mjs +260 -0
- package/plugins/session-bridge/index.mjs +68 -0
- package/plugins/session-bridge/mailbox.mjs +267 -0
- package/plugins/session-bridge/paths.mjs +21 -0
- package/plugins/session-bridge/server.mjs +172 -0
- package/plugins/session-bridge/tasks.mjs +229 -0
- package/plugins/session-cards/content.mjs +64 -0
- package/plugins/session-cards/index.mjs +38 -0
- package/plugins/session-cards/manager.mjs +140 -0
- package/plugins/session-metrics/attribution.mjs +30 -0
- package/plugins/session-metrics/balance.mjs +81 -0
- package/plugins/session-metrics/desktop-client.mjs +62 -0
- package/plugins/session-metrics/desktop-host.mjs +46 -0
- package/plugins/session-metrics/index.mjs +96 -0
- package/plugins/session-metrics/pricing.mjs +84 -0
- package/plugins/session-metrics/rate.mjs +59 -0
- package/plugins/session-metrics/store.mjs +75 -0
- package/plugins/session-metrics/turns.mjs +134 -0
- package/plugins/session-metrics/view.mjs +271 -0
- package/plugins/time-marks/desktop-host.mjs +2 -0
- package/plugins/time-marks/index.mjs +116 -0
- package/plugins/time-marks/marks.mjs +152 -0
- package/plugins/triggers/cli.mjs +558 -0
- package/plugins/triggers/commands.mjs +143 -0
- package/plugins/triggers/config.mjs +264 -0
- package/plugins/triggers/desktop-client.mjs +155 -0
- package/plugins/triggers/desktop-host.mjs +88 -0
- package/plugins/triggers/desktop-management.mjs +97 -0
- package/plugins/triggers/desktop-scheduler.mjs +125 -0
- package/plugins/triggers/host.mjs +24 -0
- package/plugins/triggers/index.mjs +27 -0
- package/plugins/triggers/job-cli.mjs +110 -0
- package/plugins/triggers/jobs.mjs +156 -0
- package/plugins/triggers/launchd.mjs +101 -0
- package/plugins/triggers/lease.mjs +24 -0
- package/plugins/triggers/log.mjs +104 -0
- package/plugins/triggers/management.mjs +181 -0
- package/plugins/triggers/options.mjs +117 -0
- package/plugins/triggers/overlay.mjs +7 -0
- package/plugins/triggers/poll.mjs +65 -0
- package/plugins/triggers/run.mjs +157 -0
- package/plugins/triggers/schedule.mjs +40 -0
- package/plugins/triggers/scheduler-service.mjs +46 -0
- package/plugins/triggers/scheduler.mjs +92 -0
- package/plugins/triggers/session-run.mjs +125 -0
- package/plugins/triggers/session.mjs +48 -0
- package/plugins/triggers/source-emit.mjs +19 -0
- package/plugins/triggers/source-host.mjs +78 -0
- package/plugins/triggers/source-ingress.mjs +70 -0
- package/plugins/triggers/source-sandbox.mjs +35 -0
- package/plugins/triggers/sources.mjs +45 -0
- package/plugins/triggers/spool.mjs +145 -0
- package/plugins/triggers/tools.mjs +67 -0
- package/plugins/triggers/unattended.mjs +18 -0
- package/plugins/tui-tools/composition.mjs +28 -0
- package/plugins/tui-tools/desktop-host.mjs +2 -0
- package/plugins/tui-tools/doctor-cli.mjs +22 -0
- package/plugins/tui-tools/doctor.mjs +148 -0
- package/plugins/tui-tools/hook-sources.mjs +113 -0
- package/plugins/tui-tools/hooks.mjs +23 -0
- package/plugins/tui-tools/index.mjs +268 -0
- package/plugins/tui-tools/sandbox-runner.mjs +123 -0
- package/plugins/tui-tools/shell.mjs +27 -0
- package/plugins/tui-tools/update.mjs +111 -0
- package/plugins/tui-tools/workspace-discovery.mjs +129 -0
- package/plugins/ultra/policy.mjs +42 -0
- package/plugins/worktree-subagent/worktree.mjs +56 -0
- package/runtime-sources.json +94 -0
- package/vendor/bash/LICENSE +21 -0
- package/vendor/bash/index.js +717 -0
- package/vendor/bash/types/background.d.ts +50 -0
- package/vendor/bash/types/index.d.ts +38 -0
- package/vendor/bash/types/render.d.ts +57 -0
- package/vendor/command-goal/LICENSE +21 -0
- package/vendor/command-goal/index.js +210 -0
- package/vendor/command-goal/types/index.d.ts +10 -0
- package/vendor/computer-use/LICENSE +21 -0
- package/vendor/computer-use/lib/approval-policy.js +12 -0
- package/vendor/computer-use/lib/approval-policy.js.map +1 -0
- package/vendor/computer-use/lib/artifacts.js +79 -0
- package/vendor/computer-use/lib/artifacts.js.map +1 -0
- package/vendor/computer-use/lib/backend.js +3 -0
- package/vendor/computer-use/lib/backend.js.map +1 -0
- package/vendor/computer-use/lib/client.js +369 -0
- package/vendor/computer-use/lib/client.js.map +1 -0
- package/vendor/computer-use/lib/config.js +159 -0
- package/vendor/computer-use/lib/config.js.map +1 -0
- package/vendor/computer-use/lib/confirmations.js +99 -0
- package/vendor/computer-use/lib/confirmations.js.map +1 -0
- package/vendor/computer-use/lib/diff.js +58 -0
- package/vendor/computer-use/lib/diff.js.map +1 -0
- package/vendor/computer-use/lib/errors.js +22 -0
- package/vendor/computer-use/lib/errors.js.map +1 -0
- package/vendor/computer-use/lib/exposure.js +244 -0
- package/vendor/computer-use/lib/exposure.js.map +1 -0
- package/vendor/computer-use/lib/index.js +66 -0
- package/vendor/computer-use/lib/index.js.map +1 -0
- package/vendor/computer-use/lib/leases.js +262 -0
- package/vendor/computer-use/lib/leases.js.map +1 -0
- package/vendor/computer-use/lib/providers/macos.js +243 -0
- package/vendor/computer-use/lib/providers/macos.js.map +1 -0
- package/vendor/computer-use/lib/providers/native-helper.js +726 -0
- package/vendor/computer-use/lib/providers/native-helper.js.map +1 -0
- package/vendor/computer-use/lib/providers/unsupported.js +51 -0
- package/vendor/computer-use/lib/providers/unsupported.js.map +1 -0
- package/vendor/computer-use/lib/service.js +608 -0
- package/vendor/computer-use/lib/service.js.map +1 -0
- package/vendor/computer-use/lib/skill.js +136 -0
- package/vendor/computer-use/lib/skill.js.map +1 -0
- package/vendor/computer-use/lib/target-resolver.js +180 -0
- package/vendor/computer-use/lib/target-resolver.js.map +1 -0
- package/vendor/computer-use/lib/tools.js +511 -0
- package/vendor/computer-use/lib/tools.js.map +1 -0
- package/vendor/computer-use/lib/types/approval-policy.d.ts +13 -0
- package/vendor/computer-use/lib/types/approval-policy.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/artifacts.d.ts +10 -0
- package/vendor/computer-use/lib/types/artifacts.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/backend.d.ts +124 -0
- package/vendor/computer-use/lib/types/backend.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/client/index.d.ts +83 -0
- package/vendor/computer-use/lib/types/client/index.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/config.d.ts +94 -0
- package/vendor/computer-use/lib/types/config.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/confirmations.d.ts +23 -0
- package/vendor/computer-use/lib/types/confirmations.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/diff.d.ts +5 -0
- package/vendor/computer-use/lib/types/diff.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/errors.d.ts +15 -0
- package/vendor/computer-use/lib/types/errors.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/exposure.d.ts +30 -0
- package/vendor/computer-use/lib/types/exposure.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/index.d.ts +21 -0
- package/vendor/computer-use/lib/types/index.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/leases.d.ts +81 -0
- package/vendor/computer-use/lib/types/leases.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/providers/macos.d.ts +39 -0
- package/vendor/computer-use/lib/types/providers/macos.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/providers/native-helper.d.ts +48 -0
- package/vendor/computer-use/lib/types/providers/native-helper.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/providers/unsupported.d.ts +23 -0
- package/vendor/computer-use/lib/types/providers/unsupported.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/service.d.ts +58 -0
- package/vendor/computer-use/lib/types/service.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/skill.d.ts +14 -0
- package/vendor/computer-use/lib/types/skill.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/target-resolver.d.ts +38 -0
- package/vendor/computer-use/lib/types/target-resolver.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/tools.d.ts +6 -0
- package/vendor/computer-use/lib/types/tools.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/types.d.ts +270 -0
- package/vendor/computer-use/lib/types/types.d.ts.map +1 -0
- package/vendor/computer-use/lib/types/web.d.ts +33 -0
- package/vendor/computer-use/lib/types/web.d.ts.map +1 -0
- package/vendor/computer-use/lib/types.js +9 -0
- package/vendor/computer-use/lib/types.js.map +1 -0
- package/vendor/computer-use/lib/web.js +188 -0
- package/vendor/computer-use/lib/web.js.map +1 -0
- package/vendor/computer-use/native/macos/Sources/Fixture/main.swift +412 -0
- package/vendor/computer-use/native/macos/Sources/Helper/CursorImage.swift +11 -0
- package/vendor/computer-use/native/macos/Sources/Helper/CursorMotion.swift +67 -0
- package/vendor/computer-use/native/macos/Sources/Helper/CursorOverlay.swift +840 -0
- package/vendor/computer-use/native/macos/Sources/Helper/TargetedPointer.swift +327 -0
- package/vendor/computer-use/native/macos/Sources/Helper/WindowNumberMatcher.swift +29 -0
- package/vendor/computer-use/native/macos/Sources/Helper/main.swift +1244 -0
- package/vendor/computer-use/native/macos/Sources/Monitor/main.swift +153 -0
- package/vendor/computer-use/native/macos/bin/dsh-computer-use-helper +0 -0
- package/vendor/computer-use/native/macos/manifest.json +14 -0
- package/vendor/persistent/LICENSE +21 -0
- package/vendor/persistent/index.js +411 -0
- package/vendor/persistent/types/index.d.ts +24 -0
- package/vendor/subagent/LICENSE +21 -0
- package/vendor/subagent/index.js +694 -0
- package/vendor/subagent/invariant.js +52 -0
- package/vendor/subagent/model-selection-settings.js +68 -0
- package/vendor/subagent/types/index.d.ts +82 -0
- package/vendor/subagent/types/invariant.d.ts +16 -0
- package/vendor/subagent/types/list-models.d.ts +10 -0
- package/vendor/subagent/types/model-selection-settings.d.ts +45 -0
- package/vendor/subagent/types/model-selection-state.d.ts +48 -0
- package/vendor/subagent/types/model-selection.d.ts +81 -0
- package/vendor/subagent-core/LICENSE +21 -0
- package/vendor/subagent-core/index.js +3202 -0
- package/vendor/subagent-core/invariant.js +76 -0
- package/vendor/subagent-core/typert.host.d.ts +3 -0
- package/vendor/subagent-core/typert.host.js +978 -0
- package/vendor/subagent-core/typert.remote-client.d.ts +25 -0
- package/vendor/subagent-core/typert.remote-client.js +114 -0
- package/vendor/subagent-core/types/archive-admission.d.ts +16 -0
- package/vendor/subagent-core/types/archive-admission.js +151 -0
- package/vendor/subagent-core/types/assistant-output.d.ts +48 -0
- package/vendor/subagent-core/types/assistant-output.js +73 -0
- package/vendor/subagent-core/types/catalog.d.ts +84 -0
- package/vendor/subagent-core/types/catalog.js +109 -0
- package/vendor/subagent-core/types/child-agent.d.ts +156 -0
- package/vendor/subagent-core/types/child-agent.js +213 -0
- package/vendor/subagent-core/types/client.d.ts +8 -0
- package/vendor/subagent-core/types/client.js +7 -0
- package/vendor/subagent-core/types/continuation-activation.d.ts +267 -0
- package/vendor/subagent-core/types/continuation-activation.js +700 -0
- package/vendor/subagent-core/types/continuation-messages.d.ts +62 -0
- package/vendor/subagent-core/types/continuation-messages.js +106 -0
- package/vendor/subagent-core/types/continuation.d.ts +124 -0
- package/vendor/subagent-core/types/continuation.js +455 -0
- package/vendor/subagent-core/types/control-types.d.ts +135 -0
- package/vendor/subagent-core/types/control-types.js +8 -0
- package/vendor/subagent-core/types/control.d.ts +45 -0
- package/vendor/subagent-core/types/control.js +79 -0
- package/vendor/subagent-core/types/depth.d.ts +31 -0
- package/vendor/subagent-core/types/depth.js +39 -0
- package/vendor/subagent-core/types/descriptor.d.ts +144 -0
- package/vendor/subagent-core/types/descriptor.js +193 -0
- package/vendor/subagent-core/types/error.d.ts +11 -0
- package/vendor/subagent-core/types/error.js +14 -0
- package/vendor/subagent-core/types/inbox.d.ts +43 -0
- package/vendor/subagent-core/types/inbox.js +61 -0
- package/vendor/subagent-core/types/index.d.ts +320 -0
- package/vendor/subagent-core/types/index.js +475 -0
- package/vendor/subagent-core/types/internal.d.ts +58 -0
- package/vendor/subagent-core/types/internal.js +58 -0
- package/vendor/subagent-core/types/invariant.d.ts +13 -0
- package/vendor/subagent-core/types/invariant.js +91 -0
- package/vendor/subagent-core/types/lifecycle.d.ts +113 -0
- package/vendor/subagent-core/types/lifecycle.js +180 -0
- package/vendor/subagent-core/types/list-children.d.ts +36 -0
- package/vendor/subagent-core/types/list-children.js +166 -0
- package/vendor/subagent-core/types/out-of-process.d.ts +118 -0
- package/vendor/subagent-core/types/out-of-process.js +219 -0
- package/vendor/subagent-core/types/projection-types.d.ts +82 -0
- package/vendor/subagent-core/types/projection-types.js +7 -0
- package/vendor/subagent-core/types/projection.d.ts +100 -0
- package/vendor/subagent-core/types/projection.js +157 -0
- package/vendor/subagent-core/types/run-settlement.d.ts +17 -0
- package/vendor/subagent-core/types/run-settlement.js +70 -0
- package/vendor/subagent-core/types/types.d.ts +377 -0
- package/vendor/subagent-core/types/types.js +19 -0
- package/vendor/subagent-driver/LICENSE +21 -0
- package/vendor/subagent-driver/index.js +255 -0
- package/vendor/subagent-driver/types/index.d.ts +33 -0
- package/vendor/subagent-driver/types/structured.d.ts +42 -0
- package/vendor/subagent-fork/LICENSE +21 -0
- package/vendor/subagent-fork/index.js +61 -0
- package/vendor/subagent-fork/types/index.d.ts +20 -0
- package/vendor/subagent-spawn/LICENSE +21 -0
- package/vendor/subagent-spawn/index.js +45 -0
- package/vendor/subagent-spawn/types/index.d.ts +19 -0
- package/vendor/terminal/LICENSE +21 -0
- package/vendor/terminal/index.js +1093 -0
- package/vendor/terminal/types/config.d.ts +82 -0
- package/vendor/terminal/types/index.d.ts +36 -0
- package/vendor/terminal/types/sanitize.d.ts +47 -0
- package/vendor/terminal/types/session.d.ts +87 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
|
|
2
|
+
import type {
|
|
3
|
+
RemoteResult,
|
|
4
|
+
TypertRemoteContribution,
|
|
5
|
+
} from '@deepseek-ai/dsh-typert-protocol'
|
|
6
|
+
import type { SessionId } from '@deepseek-ai/dsh-session/types'
|
|
7
|
+
import type { SubagentInterruptReceipt, SubagentPromptReceipt, SubagentPromptRequest } from '@deepseek-ai/dsh-subagent/client'
|
|
8
|
+
|
|
9
|
+
declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
10
|
+
interface TypertRemoteNamespace$7375626167656e7473 {
|
|
11
|
+
interruptByParent: (childSessionId: SessionId, parentSessionId: SessionId, mode: 'continuable') => Promise<RemoteResult<SubagentInterruptReceipt>>
|
|
12
|
+
prompt: (request: SubagentPromptRequest, signal?: AbortSignal) => Promise<RemoteResult<SubagentPromptReceipt>>
|
|
13
|
+
}
|
|
14
|
+
interface TypertRemoteMap {
|
|
15
|
+
'subagents/interruptByParent': (childSessionId: SessionId, parentSessionId: SessionId, mode: 'continuable') => Promise<RemoteResult<SubagentInterruptReceipt>>
|
|
16
|
+
'subagents/prompt': (request: SubagentPromptRequest, signal?: AbortSignal) => Promise<RemoteResult<SubagentPromptReceipt>>
|
|
17
|
+
}
|
|
18
|
+
interface TypertRemoteNamespaceMap {
|
|
19
|
+
'subagents': TypertRemoteNamespace$7375626167656e7473
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export declare const TYPERT_REMOTE: TypertRemoteContribution
|
|
24
|
+
export default TYPERT_REMOTE
|
|
25
|
+
//# sourceMappingURL=typert.remote-client.d.ts.map
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
|
|
2
|
+
import { z } from 'zod'
|
|
3
|
+
|
|
4
|
+
let _deepseek_ai_dsh_subagent_subagents_interruptByParent_parameter_0$schema$value
|
|
5
|
+
const _deepseek_ai_dsh_subagent_subagents_interruptByParent_parameter_0$schema = () => (_deepseek_ai_dsh_subagent_subagents_interruptByParent_parameter_0$schema$value ??= z.intersection(z.string(), z.unknown()))
|
|
6
|
+
let _deepseek_ai_dsh_subagent_subagents_interruptByParent_parameter_1$schema$value
|
|
7
|
+
const _deepseek_ai_dsh_subagent_subagents_interruptByParent_parameter_1$schema = () => (_deepseek_ai_dsh_subagent_subagents_interruptByParent_parameter_1$schema$value ??= z.intersection(z.string(), z.unknown()))
|
|
8
|
+
let _deepseek_ai_dsh_subagent_subagents_interruptByParent_parameter_2$schema$value
|
|
9
|
+
const _deepseek_ai_dsh_subagent_subagents_interruptByParent_parameter_2$schema = () => (_deepseek_ai_dsh_subagent_subagents_interruptByParent_parameter_2$schema$value ??= z.literal("continuable"))
|
|
10
|
+
let _deepseek_ai_dsh_subagent_subagents_interruptByParent_result$schema$value
|
|
11
|
+
const _deepseek_ai_dsh_subagent_subagents_interruptByParent_result$schema = () => (_deepseek_ai_dsh_subagent_subagents_interruptByParent_result$schema$value ??= z.object({
|
|
12
|
+
'accepted': z.literal(true).readonly(),
|
|
13
|
+
}))
|
|
14
|
+
let _deepseek_ai_dsh_subagent_subagents_prompt_parameter_0$schema$value
|
|
15
|
+
const _deepseek_ai_dsh_subagent_subagents_prompt_parameter_0$schema = () => (_deepseek_ai_dsh_subagent_subagents_prompt_parameter_0$schema$value ??= z.object({
|
|
16
|
+
'requestId': z.intersection(z.string(), z.unknown()).readonly(),
|
|
17
|
+
'parentSessionId': z.intersection(z.string(), z.unknown()).readonly(),
|
|
18
|
+
'childSessionId': z.intersection(z.string(), z.unknown()).readonly(),
|
|
19
|
+
'mode': z.literal("continuable").readonly(),
|
|
20
|
+
'delivery': z.union([z.literal("queue"), z.literal("steer")]).readonly(),
|
|
21
|
+
'content': z.array(z.union([z.object({
|
|
22
|
+
'type': z.literal("text").readonly(),
|
|
23
|
+
'text': z.string().readonly(),
|
|
24
|
+
}), z.object({
|
|
25
|
+
'type': z.literal("image").readonly(),
|
|
26
|
+
'mediaType': z.union([z.literal("image/png"), z.literal("image/jpeg"), z.literal("image/webp"), z.literal("image/gif")]).readonly(),
|
|
27
|
+
'data': z.string().readonly(),
|
|
28
|
+
'name': z.string().readonly().optional(),
|
|
29
|
+
})])).readonly(),
|
|
30
|
+
'clientTimeZone': z.string().readonly().optional(),
|
|
31
|
+
}))
|
|
32
|
+
let _deepseek_ai_dsh_subagent_subagents_prompt_result$schema$value
|
|
33
|
+
const _deepseek_ai_dsh_subagent_subagents_prompt_result$schema = () => (_deepseek_ai_dsh_subagent_subagents_prompt_result$schema$value ??= z.object({
|
|
34
|
+
'messageId': z.intersection(z.string(), z.unknown()).readonly(),
|
|
35
|
+
}))
|
|
36
|
+
|
|
37
|
+
export const TYPERT_REMOTE = {
|
|
38
|
+
package: '@deepseek-ai/dsh-subagent',
|
|
39
|
+
descriptors: [
|
|
40
|
+
{
|
|
41
|
+
id: '@deepseek-ai/dsh-subagent#subagents/interruptByParent',
|
|
42
|
+
service: 'subagents',
|
|
43
|
+
namespace: 'subagents',
|
|
44
|
+
method: 'interruptByParent',
|
|
45
|
+
invocation: { kind: 'direct' },
|
|
46
|
+
parameters: [
|
|
47
|
+
{
|
|
48
|
+
name: 'childSessionId',
|
|
49
|
+
wire: 'childSessionId',
|
|
50
|
+
source: 'json',
|
|
51
|
+
codec: {
|
|
52
|
+
mode: 'strict',
|
|
53
|
+
typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
|
|
54
|
+
create: _deepseek_ai_dsh_subagent_subagents_interruptByParent_parameter_0$schema,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'parentSessionId',
|
|
59
|
+
wire: 'parentSessionId',
|
|
60
|
+
source: 'json',
|
|
61
|
+
codec: {
|
|
62
|
+
mode: 'strict',
|
|
63
|
+
typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
|
|
64
|
+
create: _deepseek_ai_dsh_subagent_subagents_interruptByParent_parameter_1$schema,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'mode',
|
|
69
|
+
wire: 'mode',
|
|
70
|
+
source: 'json',
|
|
71
|
+
codec: {
|
|
72
|
+
mode: 'strict',
|
|
73
|
+
typeSymbol: '@deepseek-ai/dsh-subagent#subagents/interruptByParent:mode',
|
|
74
|
+
create: _deepseek_ai_dsh_subagent_subagents_interruptByParent_parameter_2$schema,
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
result: {
|
|
79
|
+
mode: 'strict',
|
|
80
|
+
typeSymbol: '@deepseek-ai/dsh-subagent/client#SubagentInterruptReceipt',
|
|
81
|
+
create: _deepseek_ai_dsh_subagent_subagents_interruptByParent_result$schema,
|
|
82
|
+
},
|
|
83
|
+
sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":483,"column":3},
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
id: '@deepseek-ai/dsh-subagent#subagents/prompt',
|
|
87
|
+
service: 'subagents',
|
|
88
|
+
namespace: 'subagents',
|
|
89
|
+
method: 'prompt',
|
|
90
|
+
invocation: { kind: 'direct' },
|
|
91
|
+
parameters: [
|
|
92
|
+
{
|
|
93
|
+
name: 'request',
|
|
94
|
+
wire: 'request',
|
|
95
|
+
source: 'json',
|
|
96
|
+
codec: {
|
|
97
|
+
mode: 'strict',
|
|
98
|
+
typeSymbol: '@deepseek-ai/dsh-subagent/client#SubagentPromptRequest',
|
|
99
|
+
create: _deepseek_ai_dsh_subagent_subagents_prompt_parameter_0$schema,
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
cancellation: { parameter: 'signal' },
|
|
104
|
+
result: {
|
|
105
|
+
mode: 'strict',
|
|
106
|
+
typeSymbol: '@deepseek-ai/dsh-subagent/client#SubagentPromptReceipt',
|
|
107
|
+
create: _deepseek_ai_dsh_subagent_subagents_prompt_result$schema,
|
|
108
|
+
},
|
|
109
|
+
sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":416,"column":9},
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export default TYPERT_REMOTE
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `subagent` family of the Workspace registry's archive admission: which
|
|
3
|
+
* subagent descendants of a Session are still inside a turn, and how they
|
|
4
|
+
* stop when the Session is archived with its work.
|
|
5
|
+
*
|
|
6
|
+
* @module @deepseek-ai/dsh-subagent
|
|
7
|
+
*/
|
|
8
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
9
|
+
/**
|
|
10
|
+
* Answer `workspace/session-activity` with the running subagent descendants of
|
|
11
|
+
* the asked Session, and `workspace/session-stop` by cancelling each of them
|
|
12
|
+
* as their parent would. Both listeners live as long as `ctx`'s fiber.
|
|
13
|
+
* @param ctx - context carrying the Agent registry; the Session query service is optional and only supplies labels.
|
|
14
|
+
*/
|
|
15
|
+
export declare function installSubagentArchiveAdmission(ctx: Context): void;
|
|
16
|
+
//# sourceMappingURL=archive-admission.d.ts.map
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `subagent` family of the Workspace registry's archive admission: which
|
|
3
|
+
* subagent descendants of a Session are still inside a turn, and how they
|
|
4
|
+
* stop when the Session is archived with its work.
|
|
5
|
+
*
|
|
6
|
+
* @module @deepseek-ai/dsh-subagent
|
|
7
|
+
*/
|
|
8
|
+
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
|
9
|
+
if (value !== null && value !== void 0) {
|
|
10
|
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
11
|
+
var dispose, inner;
|
|
12
|
+
if (async) {
|
|
13
|
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
14
|
+
dispose = value[Symbol.asyncDispose];
|
|
15
|
+
}
|
|
16
|
+
if (dispose === void 0) {
|
|
17
|
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
18
|
+
dispose = value[Symbol.dispose];
|
|
19
|
+
if (async) inner = dispose;
|
|
20
|
+
}
|
|
21
|
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
22
|
+
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
23
|
+
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
24
|
+
}
|
|
25
|
+
else if (async) {
|
|
26
|
+
env.stack.push({ async: true });
|
|
27
|
+
}
|
|
28
|
+
return value;
|
|
29
|
+
};
|
|
30
|
+
var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
|
|
31
|
+
return function (env) {
|
|
32
|
+
function fail(e) {
|
|
33
|
+
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
34
|
+
env.hasError = true;
|
|
35
|
+
}
|
|
36
|
+
var r, s = 0;
|
|
37
|
+
function next() {
|
|
38
|
+
while (r = env.stack.pop()) {
|
|
39
|
+
try {
|
|
40
|
+
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
41
|
+
if (r.dispose) {
|
|
42
|
+
var result = r.dispose.call(r.value);
|
|
43
|
+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
44
|
+
}
|
|
45
|
+
else s |= 1;
|
|
46
|
+
}
|
|
47
|
+
catch (e) {
|
|
48
|
+
fail(e);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
52
|
+
if (env.hasError) throw env.error;
|
|
53
|
+
}
|
|
54
|
+
return next();
|
|
55
|
+
};
|
|
56
|
+
})(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
57
|
+
var e = new Error(message);
|
|
58
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
59
|
+
});
|
|
60
|
+
import { foldSubagentDescriptor } from "./descriptor.js";
|
|
61
|
+
/**
|
|
62
|
+
* Answer `workspace/session-activity` with the running subagent descendants of
|
|
63
|
+
* the asked Session, and `workspace/session-stop` by cancelling each of them
|
|
64
|
+
* as their parent would. Both listeners live as long as `ctx`'s fiber.
|
|
65
|
+
* @param ctx - context carrying the Agent registry; the Session query service is optional and only supplies labels.
|
|
66
|
+
*/
|
|
67
|
+
export function installSubagentArchiveAdmission(ctx) {
|
|
68
|
+
ctx.on('workspace/session-activity', async ({ sessionId }, next) => {
|
|
69
|
+
const running = runningDescendants(ctx, sessionId);
|
|
70
|
+
const rest = await next();
|
|
71
|
+
if (running.length === 0)
|
|
72
|
+
return rest;
|
|
73
|
+
const own = { kind: 'subagent', items: await Promise.all(running.map(child => describe(ctx, child))) };
|
|
74
|
+
return [own, ...rest];
|
|
75
|
+
});
|
|
76
|
+
ctx.on('workspace/session-stop', ({ sessionId }) => {
|
|
77
|
+
for (const child of runningDescendants(ctx, sessionId)) {
|
|
78
|
+
try {
|
|
79
|
+
child.cancel({ kind: 'parent' });
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
// One child refusing its cancel must not keep its siblings running for an archived parent.
|
|
83
|
+
ctx.logger.warn(`subagent: cancelling "${child.id}" for an archived Session failed: ${String(error)}`);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Live subagent descendants inside a turn, by durable lineage: a child whose
|
|
90
|
+
* header names its parent and carries the subagent origin this package
|
|
91
|
+
* records, at any depth. A fork shares the lineage field without the origin
|
|
92
|
+
* and is an independent conversation, so it never holds its source. Lineage
|
|
93
|
+
* is read as data, so a damaged header chain that loops is visited once.
|
|
94
|
+
*/
|
|
95
|
+
function runningDescendants(ctx, rootId) {
|
|
96
|
+
const childrenOf = new Map();
|
|
97
|
+
for (const agent of ctx.agents.list()) {
|
|
98
|
+
const { parentSession, origin } = agent.session.header;
|
|
99
|
+
if (parentSession === undefined || origin !== 'subagent')
|
|
100
|
+
continue;
|
|
101
|
+
const siblings = childrenOf.get(parentSession) ?? [];
|
|
102
|
+
siblings.push(agent);
|
|
103
|
+
childrenOf.set(parentSession, siblings);
|
|
104
|
+
}
|
|
105
|
+
const running = [];
|
|
106
|
+
const pending = [rootId];
|
|
107
|
+
const visited = new Set();
|
|
108
|
+
while (pending.length > 0) {
|
|
109
|
+
const parentId = pending.shift();
|
|
110
|
+
if (visited.has(parentId))
|
|
111
|
+
continue;
|
|
112
|
+
visited.add(parentId);
|
|
113
|
+
for (const child of childrenOf.get(parentId) ?? []) {
|
|
114
|
+
if (child.status === 'running')
|
|
115
|
+
running.push(child);
|
|
116
|
+
pending.push(child.id);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return running;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* The child's activity item: its id, plus the durable creation label its
|
|
123
|
+
* descriptor carries, read through a live Session observation. Without the
|
|
124
|
+
* Session query service, or with a descriptor that is absent or unreadable,
|
|
125
|
+
* the item names the child by id alone.
|
|
126
|
+
*/
|
|
127
|
+
async function describe(ctx, child) {
|
|
128
|
+
const query = ctx.get('sessionQuery');
|
|
129
|
+
if (query === undefined)
|
|
130
|
+
return { id: child.id };
|
|
131
|
+
try {
|
|
132
|
+
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
133
|
+
try {
|
|
134
|
+
const observation = __addDisposableResource(env_1, await query.observeSession(child.id, { projectionMode: 'none' }), false);
|
|
135
|
+
const label = foldSubagentDescriptor(observation.events.slice(observation.inheritedEventCount))?.label;
|
|
136
|
+
return label === undefined ? { id: child.id } : { id: child.id, label };
|
|
137
|
+
}
|
|
138
|
+
catch (e_1) {
|
|
139
|
+
env_1.error = e_1;
|
|
140
|
+
env_1.hasError = true;
|
|
141
|
+
}
|
|
142
|
+
finally {
|
|
143
|
+
__disposeResources(env_1);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
catch {
|
|
147
|
+
// A damaged descriptor is data damage in the child; the report still names the child.
|
|
148
|
+
return { id: child.id };
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=archive-admission.js.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical selection of a child's final assistant output. Backend run results
|
|
3
|
+
* and `subagent/end.lastAssistantMessage` apply the same rule: select the last
|
|
4
|
+
* non-empty assistant message. An empty-content message records usage only
|
|
5
|
+
* when the loop appends it after a max-tokens step with no executable blocks,
|
|
6
|
+
* so it does not replace earlier output. If no non-empty message exists,
|
|
7
|
+
* select the accumulated assistant text. Selection is independent of the
|
|
8
|
+
* run's stop reason.
|
|
9
|
+
*
|
|
10
|
+
* @module @deepseek-ai/dsh-subagent/assistant-output
|
|
11
|
+
*/
|
|
12
|
+
import { type ContentBlock } from '@deepseek-ai/dsh-llm';
|
|
13
|
+
import type { SessionEvent } from '@deepseek-ai/dsh-session';
|
|
14
|
+
/**
|
|
15
|
+
* Incremental fold of the selection rule, for backends that observe a child's
|
|
16
|
+
* output as it streams: session-event backends {@link push} each event, and
|
|
17
|
+
* transports without session events (ACP content chunks) {@link pushText} raw
|
|
18
|
+
* text into the same streamed fallback.
|
|
19
|
+
*/
|
|
20
|
+
export declare class AssistantOutputFold {
|
|
21
|
+
private message;
|
|
22
|
+
private partial;
|
|
23
|
+
/**
|
|
24
|
+
* Fold one session event: a non-empty assistant message becomes the
|
|
25
|
+
* candidate final answer, while its embedded stream and any log-only attempt
|
|
26
|
+
* extend the streamed fallback; every other event contributes nothing.
|
|
27
|
+
* @param event - the next observed session event.
|
|
28
|
+
*/
|
|
29
|
+
push(event: SessionEvent): void;
|
|
30
|
+
/**
|
|
31
|
+
* Extend the streamed fallback with text observed outside session events.
|
|
32
|
+
* @param text - the next streamed text piece (an empty piece is a no-op).
|
|
33
|
+
*/
|
|
34
|
+
pushText(text: string): void;
|
|
35
|
+
/**
|
|
36
|
+
* Select the final output folded so far.
|
|
37
|
+
* @returns the last non-empty assistant message, else the accumulated
|
|
38
|
+
* streamed text, or `undefined` when the child produced neither.
|
|
39
|
+
*/
|
|
40
|
+
collect(): readonly ContentBlock[] | undefined;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Apply the selection rule to one complete child-owned event suffix.
|
|
44
|
+
* @param events - the child-owned events (after any seed or epoch boundary).
|
|
45
|
+
* @returns the selected output, or `undefined` when the child produced none.
|
|
46
|
+
*/
|
|
47
|
+
export declare function finalAssistantOutput(events: readonly SessionEvent[]): readonly ContentBlock[] | undefined;
|
|
48
|
+
//# sourceMappingURL=assistant-output.d.ts.map
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical selection of a child's final assistant output. Backend run results
|
|
3
|
+
* and `subagent/end.lastAssistantMessage` apply the same rule: select the last
|
|
4
|
+
* non-empty assistant message. An empty-content message records usage only
|
|
5
|
+
* when the loop appends it after a max-tokens step with no executable blocks,
|
|
6
|
+
* so it does not replace earlier output. If no non-empty message exists,
|
|
7
|
+
* select the accumulated assistant text. Selection is independent of the
|
|
8
|
+
* run's stop reason.
|
|
9
|
+
*
|
|
10
|
+
* @module @deepseek-ai/dsh-subagent/assistant-output
|
|
11
|
+
*/
|
|
12
|
+
import { joinAssistantStreamText } from '@deepseek-ai/dsh-llm';
|
|
13
|
+
/**
|
|
14
|
+
* Incremental fold of the selection rule, for backends that observe a child's
|
|
15
|
+
* output as it streams: session-event backends {@link push} each event, and
|
|
16
|
+
* transports without session events (ACP content chunks) {@link pushText} raw
|
|
17
|
+
* text into the same streamed fallback.
|
|
18
|
+
*/
|
|
19
|
+
export class AssistantOutputFold {
|
|
20
|
+
message;
|
|
21
|
+
partial = [];
|
|
22
|
+
/**
|
|
23
|
+
* Fold one session event: a non-empty assistant message becomes the
|
|
24
|
+
* candidate final answer, while its embedded stream and any log-only attempt
|
|
25
|
+
* extend the streamed fallback; every other event contributes nothing.
|
|
26
|
+
* @param event - the next observed session event.
|
|
27
|
+
*/
|
|
28
|
+
push(event) {
|
|
29
|
+
if (event.type === 'assistant/message') {
|
|
30
|
+
const content = event.data.message.content;
|
|
31
|
+
if (content.length > 0)
|
|
32
|
+
this.message = content;
|
|
33
|
+
}
|
|
34
|
+
if (event.type === 'assistant/message' || event.type === 'assistant/attempt') {
|
|
35
|
+
this.pushText(joinAssistantStreamText(event.data.stream));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Extend the streamed fallback with text observed outside session events.
|
|
40
|
+
* @param text - the next streamed text piece (an empty piece is a no-op).
|
|
41
|
+
*/
|
|
42
|
+
pushText(text) {
|
|
43
|
+
if (text.length > 0)
|
|
44
|
+
this.partial.push(text);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Select the final output folded so far.
|
|
48
|
+
* @returns the last non-empty assistant message, else the accumulated
|
|
49
|
+
* streamed text, or `undefined` when the child produced neither.
|
|
50
|
+
*/
|
|
51
|
+
collect() {
|
|
52
|
+
if (this.message !== undefined)
|
|
53
|
+
return this.message;
|
|
54
|
+
const text = this.partial.join('');
|
|
55
|
+
return text.length > 0 ? [{ type: 'text', text }] : undefined;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Apply the selection rule to one complete child-owned event suffix.
|
|
60
|
+
* @param events - the child-owned events (after any seed or epoch boundary).
|
|
61
|
+
* @returns the selected output, or `undefined` when the child produced none.
|
|
62
|
+
*/
|
|
63
|
+
export function finalAssistantOutput(events) {
|
|
64
|
+
// TODO: this folds the complete suffix once per run/epoch settlement. If a
|
|
65
|
+
// long continuable epoch ever profiles hot here, scan backward with early
|
|
66
|
+
// exit for the last non-empty message and fold text deltas only on the
|
|
67
|
+
// no-message fallback.
|
|
68
|
+
const fold = new AssistantOutputFold();
|
|
69
|
+
for (const event of events)
|
|
70
|
+
fold.push(event);
|
|
71
|
+
return fold.collect();
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=assistant-output.js.map
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parent-owned durable subagent catalog events and their chunked projection.
|
|
3
|
+
*
|
|
4
|
+
* @module @deepseek-ai/dsh-subagent/catalog
|
|
5
|
+
*/
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
import type { ChunkedList } from '@deepseek-ai/dsh-chunked-list';
|
|
8
|
+
import type { Session, SessionEvent, SessionHeader, SessionId, SessionLogOffset } from '@deepseek-ai/dsh-session';
|
|
9
|
+
import type { SubagentCatalogEntry } from './projection-types.ts';
|
|
10
|
+
/** Catalog payload version emitted by live child creation. */
|
|
11
|
+
export declare const SUBAGENT_CATALOG_VERSION = 0;
|
|
12
|
+
type KnownCatalogMode = {
|
|
13
|
+
readonly mode: 'one-shot';
|
|
14
|
+
readonly label?: string;
|
|
15
|
+
} | {
|
|
16
|
+
readonly mode: 'continuable';
|
|
17
|
+
readonly label: string;
|
|
18
|
+
};
|
|
19
|
+
/** Parent catalog v0 records known modes; v1 also retains children with unknown mode. */
|
|
20
|
+
export type SubagentCatalogEvent = {
|
|
21
|
+
readonly childId: SessionId;
|
|
22
|
+
readonly childCreatedAt: number;
|
|
23
|
+
} & (({
|
|
24
|
+
readonly version: 0;
|
|
25
|
+
} & KnownCatalogMode) | ({
|
|
26
|
+
readonly version: 1;
|
|
27
|
+
} & (KnownCatalogMode | {
|
|
28
|
+
readonly mode: 'unknown';
|
|
29
|
+
readonly label?: string;
|
|
30
|
+
})));
|
|
31
|
+
declare module '@deepseek-ai/dsh-session/types' {
|
|
32
|
+
interface SessionEventMap {
|
|
33
|
+
/**
|
|
34
|
+
* A direct child's identity and available discovery fields.
|
|
35
|
+
* @param data - versioned parent-owned catalog entry.
|
|
36
|
+
*/
|
|
37
|
+
'subagent/catalog': SubagentCatalogEvent;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/** Host fold state for one parent catalog. */
|
|
41
|
+
export interface SubagentCatalogState {
|
|
42
|
+
readonly inheritedEventCount: SessionLogOffset;
|
|
43
|
+
readonly head?: ChunkedList<SubagentCatalogEvent> | undefined;
|
|
44
|
+
}
|
|
45
|
+
declare module '@deepseek-ai/dsh-session-projection/types' {
|
|
46
|
+
interface SessionProjectionStateMap {
|
|
47
|
+
subagentCatalog: SubagentCatalogState;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Materialize complete and unknown-mode child identities from parent catalog events.
|
|
52
|
+
* @param state - parent catalog fold state.
|
|
53
|
+
* @returns current direct-child rows in parent catalog event order.
|
|
54
|
+
*/
|
|
55
|
+
declare function subagentCatalogEntries(state: SubagentCatalogState): SubagentCatalogEntry[];
|
|
56
|
+
/** Parent-owned direct-child catalog projection; invalid own facts reject restoration. */
|
|
57
|
+
export declare const subagentCatalogProjectionDefinition: {
|
|
58
|
+
key: "subagentCatalog";
|
|
59
|
+
stateSchema: z.ZodType<SubagentCatalogState, unknown, z.core.$ZodTypeInternals<SubagentCatalogState, unknown>>;
|
|
60
|
+
init: (_header: SessionHeader, inheritedEventCount: SessionLogOffset) => {
|
|
61
|
+
inheritedEventCount: SessionLogOffset;
|
|
62
|
+
};
|
|
63
|
+
apply: (state: NoInfer<SubagentCatalogState>, event: SessionEvent) => SubagentCatalogState;
|
|
64
|
+
stateVersion: number;
|
|
65
|
+
wire: {
|
|
66
|
+
viewSchema: z.ZodType<SubagentCatalogEntry[], unknown, z.core.$ZodTypeInternals<SubagentCatalogEntry[], unknown>>;
|
|
67
|
+
view: typeof subagentCatalogEntries;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Append a complete direct-child discovery fact to its parent Session.
|
|
72
|
+
* @param parent - durable direct parent receiving the discovery fact.
|
|
73
|
+
* @param child - established child's immutable Session metadata.
|
|
74
|
+
* @param descriptor - mode-discriminated creation label frozen with the child.
|
|
75
|
+
*/
|
|
76
|
+
export declare function establishCatalogChild(parent: Session, child: SessionHeader, descriptor: {
|
|
77
|
+
readonly mode: 'one-shot';
|
|
78
|
+
readonly label?: string;
|
|
79
|
+
} | {
|
|
80
|
+
readonly mode: 'continuable';
|
|
81
|
+
readonly label: string;
|
|
82
|
+
}): void;
|
|
83
|
+
export {};
|
|
84
|
+
//# sourceMappingURL=catalog.d.ts.map
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parent-owned durable subagent catalog events and their chunked projection.
|
|
3
|
+
*
|
|
4
|
+
* @module @deepseek-ai/dsh-subagent/catalog
|
|
5
|
+
*/
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
import { appendChunkedList, chunkedListSchema, iterateChunkedList } from '@deepseek-ai/dsh-chunked-list';
|
|
8
|
+
/** Catalog payload version emitted by live child creation. */
|
|
9
|
+
export const SUBAGENT_CATALOG_VERSION = 0;
|
|
10
|
+
const sessionIdSchema = z.string();
|
|
11
|
+
const oneShotCatalogSchema = z.object({
|
|
12
|
+
version: z.union([z.literal(0), z.literal(1)]),
|
|
13
|
+
childId: sessionIdSchema,
|
|
14
|
+
childCreatedAt: z.number().int().nonnegative(),
|
|
15
|
+
mode: z.literal('one-shot'),
|
|
16
|
+
label: z.string().optional(),
|
|
17
|
+
}).strict();
|
|
18
|
+
const continuableCatalogSchema = z.object({
|
|
19
|
+
version: z.union([z.literal(0), z.literal(1)]),
|
|
20
|
+
childId: sessionIdSchema,
|
|
21
|
+
childCreatedAt: z.number().int().nonnegative(),
|
|
22
|
+
mode: z.literal('continuable'),
|
|
23
|
+
label: z.string(),
|
|
24
|
+
}).strict();
|
|
25
|
+
const unknownCatalogSchema = oneShotCatalogSchema.extend({ version: z.literal(1), mode: z.literal('unknown') });
|
|
26
|
+
const eventDataSchema = z.union([
|
|
27
|
+
oneShotCatalogSchema,
|
|
28
|
+
continuableCatalogSchema,
|
|
29
|
+
unknownCatalogSchema,
|
|
30
|
+
]);
|
|
31
|
+
const viewSchema = z.array(z.union([
|
|
32
|
+
oneShotCatalogSchema.omit({ version: true, childId: true, childCreatedAt: true }).extend({
|
|
33
|
+
id: sessionIdSchema,
|
|
34
|
+
createdAt: oneShotCatalogSchema.shape.childCreatedAt,
|
|
35
|
+
}),
|
|
36
|
+
continuableCatalogSchema.omit({ version: true, childId: true, childCreatedAt: true }).extend({
|
|
37
|
+
id: sessionIdSchema,
|
|
38
|
+
createdAt: continuableCatalogSchema.shape.childCreatedAt,
|
|
39
|
+
}),
|
|
40
|
+
unknownCatalogSchema.omit({ version: true, childId: true, childCreatedAt: true }).extend({
|
|
41
|
+
id: sessionIdSchema,
|
|
42
|
+
createdAt: unknownCatalogSchema.shape.childCreatedAt,
|
|
43
|
+
}),
|
|
44
|
+
]));
|
|
45
|
+
const stateSchema = z.object({
|
|
46
|
+
inheritedEventCount: z.number().int().nonnegative(),
|
|
47
|
+
head: chunkedListSchema(eventDataSchema).optional(),
|
|
48
|
+
}).strict();
|
|
49
|
+
/**
|
|
50
|
+
* Materialize complete and unknown-mode child identities from parent catalog events.
|
|
51
|
+
* @param state - parent catalog fold state.
|
|
52
|
+
* @returns current direct-child rows in parent catalog event order.
|
|
53
|
+
*/
|
|
54
|
+
function subagentCatalogEntries(state) {
|
|
55
|
+
const entries = [];
|
|
56
|
+
for (const data of iterateChunkedList(state.head)) {
|
|
57
|
+
entries.push(data.mode !== 'continuable'
|
|
58
|
+
? {
|
|
59
|
+
id: data.childId,
|
|
60
|
+
createdAt: data.childCreatedAt,
|
|
61
|
+
mode: data.mode,
|
|
62
|
+
...data.label === undefined ? {} : { label: data.label },
|
|
63
|
+
}
|
|
64
|
+
: {
|
|
65
|
+
id: data.childId,
|
|
66
|
+
createdAt: data.childCreatedAt,
|
|
67
|
+
mode: data.mode,
|
|
68
|
+
label: data.label,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return entries;
|
|
72
|
+
}
|
|
73
|
+
/** Parent-owned direct-child catalog projection; invalid own facts reject restoration. */
|
|
74
|
+
export const subagentCatalogProjectionDefinition = {
|
|
75
|
+
key: 'subagentCatalog',
|
|
76
|
+
stateSchema,
|
|
77
|
+
init: (_header, inheritedEventCount) => ({ inheritedEventCount }),
|
|
78
|
+
apply: (state, event) => {
|
|
79
|
+
if (event.type !== 'subagent/catalog' || event.seq < state.inheritedEventCount)
|
|
80
|
+
return state;
|
|
81
|
+
return { ...state, head: appendChunkedList(state.head, eventDataSchema.parse(event.data)) };
|
|
82
|
+
},
|
|
83
|
+
stateVersion: 3,
|
|
84
|
+
wire: { viewSchema, view: subagentCatalogEntries },
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Append a complete direct-child discovery fact to its parent Session.
|
|
88
|
+
* @param parent - durable direct parent receiving the discovery fact.
|
|
89
|
+
* @param child - established child's immutable Session metadata.
|
|
90
|
+
* @param descriptor - mode-discriminated creation label frozen with the child.
|
|
91
|
+
*/
|
|
92
|
+
export function establishCatalogChild(parent, child, descriptor) {
|
|
93
|
+
parent.append('subagent/catalog', descriptor.mode === 'one-shot'
|
|
94
|
+
? {
|
|
95
|
+
version: SUBAGENT_CATALOG_VERSION,
|
|
96
|
+
childId: child.id,
|
|
97
|
+
childCreatedAt: child.createdAt,
|
|
98
|
+
mode: descriptor.mode,
|
|
99
|
+
...descriptor.label === undefined ? {} : { label: descriptor.label },
|
|
100
|
+
}
|
|
101
|
+
: {
|
|
102
|
+
version: SUBAGENT_CATALOG_VERSION,
|
|
103
|
+
childId: child.id,
|
|
104
|
+
childCreatedAt: child.createdAt,
|
|
105
|
+
mode: descriptor.mode,
|
|
106
|
+
label: descriptor.label,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=catalog.js.map
|