@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.
Files changed (484) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +120 -2
  3. package/THIRD_PARTY_NOTICES.md +30 -0
  4. package/bin/apply_patch +9 -0
  5. package/cordis.patch.yml +433 -0
  6. package/docs/CHANGELOG.md +641 -0
  7. package/docs/account-login.md +44 -0
  8. package/docs/auto-review.md +128 -0
  9. package/docs/browser-use.md +783 -0
  10. package/docs/computer-use.md +81 -0
  11. package/docs/custom-providers.md +88 -0
  12. package/docs/demo.md +76 -0
  13. package/docs/distribution.md +58 -0
  14. package/docs/dscode-ultra.md +75 -0
  15. package/docs/email.md +296 -0
  16. package/docs/exec.md +40 -0
  17. package/docs/hub-distribution.md +190 -0
  18. package/docs/memory.md +121 -0
  19. package/docs/opencode-go.md +61 -0
  20. package/docs/plugin-hub.md +68 -0
  21. package/docs/releases/0.2.0.md +28 -0
  22. package/docs/releases/0.3.0.md +21 -0
  23. package/docs/releases/0.4.0.md +20 -0
  24. package/docs/releases/0.5.0.md +19 -0
  25. package/docs/releases/0.6.0.md +20 -0
  26. package/docs/releases/0.7.0.md +22 -0
  27. package/docs/releases/0.7.1.md +20 -0
  28. package/docs/releases/0.7.10.md +10 -0
  29. package/docs/releases/0.7.11.md +17 -0
  30. package/docs/releases/0.7.12.md +11 -0
  31. package/docs/releases/0.7.13.md +12 -0
  32. package/docs/releases/0.7.14.md +11 -0
  33. package/docs/releases/0.7.15.md +11 -0
  34. package/docs/releases/0.7.16.md +10 -0
  35. package/docs/releases/0.7.17.md +12 -0
  36. package/docs/releases/0.7.18.md +13 -0
  37. package/docs/releases/0.7.19.md +8 -0
  38. package/docs/releases/0.7.2.md +19 -0
  39. package/docs/releases/0.7.20.md +10 -0
  40. package/docs/releases/0.7.21.md +9 -0
  41. package/docs/releases/0.7.22.md +11 -0
  42. package/docs/releases/0.7.23.md +14 -0
  43. package/docs/releases/0.7.24.md +11 -0
  44. package/docs/releases/0.7.25.md +8 -0
  45. package/docs/releases/0.7.26.md +18 -0
  46. package/docs/releases/0.7.27.md +8 -0
  47. package/docs/releases/0.7.28.md +22 -0
  48. package/docs/releases/0.7.29.md +12 -0
  49. package/docs/releases/0.7.3.md +23 -0
  50. package/docs/releases/0.7.30.md +19 -0
  51. package/docs/releases/0.7.31.md +14 -0
  52. package/docs/releases/0.7.32.md +14 -0
  53. package/docs/releases/0.7.33.md +30 -0
  54. package/docs/releases/0.7.4.md +16 -0
  55. package/docs/releases/0.7.5.md +18 -0
  56. package/docs/releases/0.7.6.md +29 -0
  57. package/docs/releases/0.7.7.md +36 -0
  58. package/docs/releases/0.7.8.md +14 -0
  59. package/docs/releases/0.7.9.md +15 -0
  60. package/docs/session-bridge.md +80 -0
  61. package/docs/session-cards.md +53 -0
  62. package/docs/session-communication.md +186 -0
  63. package/docs/session-metrics.md +41 -0
  64. package/docs/skills.md +81 -0
  65. package/docs/triggers.md +338 -0
  66. package/docs/tui-commands.md +204 -0
  67. package/extensions/browser/manifest.json +22 -0
  68. package/extensions/browser/popup.css +6 -0
  69. package/extensions/browser/popup.html +11 -0
  70. package/extensions/browser/popup.mjs +47 -0
  71. package/extensions/browser/protocol.mjs +168 -0
  72. package/extensions/browser/worker.mjs +94 -0
  73. package/icon.svg +7 -0
  74. package/locale/en.json +6 -0
  75. package/locale/zh-cn.json +6 -0
  76. package/node_modules/@deepseek-ai/node-addon-system/LICENSE +21 -0
  77. package/node_modules/@deepseek-ai/node-addon-system/README.i18n.yaml +6 -0
  78. package/node_modules/@deepseek-ai/node-addon-system/README.md +15 -0
  79. package/node_modules/@deepseek-ai/node-addon-system/README.zh.md +15 -0
  80. package/node_modules/@deepseek-ai/node-addon-system/lib/flock.d.ts +13 -0
  81. package/node_modules/@deepseek-ai/node-addon-system/lib/flock.js +51 -0
  82. package/node_modules/@deepseek-ai/node-addon-system/lib/index.d.ts +73 -0
  83. package/node_modules/@deepseek-ai/node-addon-system/lib/index.js +98 -0
  84. package/node_modules/@deepseek-ai/node-addon-system/package.json +45 -0
  85. package/node_modules/@deepseek-ai/node-addon-system/src/flock.c +164 -0
  86. package/node_modules/@deepseek-ai/node-addon-system/src/main.c +298 -0
  87. package/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/LICENSE +28 -0
  88. package/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/README.i18n.yaml +6 -0
  89. package/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/README.md +9 -0
  90. package/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/README.zh.md +9 -0
  91. package/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/bin/system.node +0 -0
  92. package/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/package.json +31 -0
  93. package/node_modules/@deepseek-ai/node-addon-system-darwin-arm64/prebuilds.json +6 -0
  94. package/node_modules/@deepseek-ai/node-addon-system-darwin-x64/LICENSE +28 -0
  95. package/node_modules/@deepseek-ai/node-addon-system-darwin-x64/README.i18n.yaml +6 -0
  96. package/node_modules/@deepseek-ai/node-addon-system-darwin-x64/README.md +9 -0
  97. package/node_modules/@deepseek-ai/node-addon-system-darwin-x64/README.zh.md +9 -0
  98. package/node_modules/@deepseek-ai/node-addon-system-darwin-x64/bin/system.node +0 -0
  99. package/node_modules/@deepseek-ai/node-addon-system-darwin-x64/package.json +31 -0
  100. package/node_modules/@deepseek-ai/node-addon-system-darwin-x64/prebuilds.json +6 -0
  101. package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/LICENSE +28 -0
  102. package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/README.i18n.yaml +6 -0
  103. package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/README.md +11 -0
  104. package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/README.zh.md +11 -0
  105. package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/bin/glibc/system.node +0 -0
  106. package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/bin/landlock-run +0 -0
  107. package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/bin/musl/system.node +0 -0
  108. package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/package.json +31 -0
  109. package/node_modules/@deepseek-ai/node-addon-system-linux-arm64/prebuilds.json +24 -0
  110. package/node_modules/@deepseek-ai/node-addon-system-linux-x64/LICENSE +28 -0
  111. package/node_modules/@deepseek-ai/node-addon-system-linux-x64/README.i18n.yaml +6 -0
  112. package/node_modules/@deepseek-ai/node-addon-system-linux-x64/README.md +11 -0
  113. package/node_modules/@deepseek-ai/node-addon-system-linux-x64/README.zh.md +11 -0
  114. package/node_modules/@deepseek-ai/node-addon-system-linux-x64/bin/glibc/system.node +0 -0
  115. package/node_modules/@deepseek-ai/node-addon-system-linux-x64/bin/landlock-run +0 -0
  116. package/node_modules/@deepseek-ai/node-addon-system-linux-x64/bin/musl/system.node +0 -0
  117. package/node_modules/@deepseek-ai/node-addon-system-linux-x64/package.json +31 -0
  118. package/node_modules/@deepseek-ai/node-addon-system-linux-x64/prebuilds.json +24 -0
  119. package/package.json +156 -4
  120. package/plugins/account/index.mjs +178 -0
  121. package/plugins/account/state.mjs +123 -0
  122. package/plugins/auto-review/audit.mjs +24 -0
  123. package/plugins/auto-review/index.mjs +267 -0
  124. package/plugins/auto-review/policy.mjs +92 -0
  125. package/plugins/browser/SKILL.md +158 -0
  126. package/plugins/browser/access.mjs +143 -0
  127. package/plugins/browser/config.mjs +60 -0
  128. package/plugins/browser/connection.mjs +385 -0
  129. package/plugins/browser/desktop-client.mjs +282 -0
  130. package/plugins/browser/desktop-host.mjs +74 -0
  131. package/plugins/browser/document-identity.mjs +57 -0
  132. package/plugins/browser/extension-relay.mjs +66 -0
  133. package/plugins/browser/files.mjs +32 -0
  134. package/plugins/browser/index.mjs +235 -0
  135. package/plugins/browser/mcp-entry.mjs +18 -0
  136. package/plugins/browser/mcp-tools.mjs +21 -0
  137. package/plugins/browser/presentation.mjs +45 -0
  138. package/plugins/browser/preview.mjs +77 -0
  139. package/plugins/browser/review.mjs +20 -0
  140. package/plugins/browser/screenshots.mjs +35 -0
  141. package/plugins/clipboard-image/clipboard-image.swift +56 -0
  142. package/plugins/clipboard-image/index.mjs +70 -0
  143. package/plugins/code-review/baseline.mjs +143 -0
  144. package/plugins/code-review/git.mjs +163 -0
  145. package/plugins/code-review/index.mjs +236 -0
  146. package/plugins/compaction/engine.mjs +304 -0
  147. package/plugins/compaction/tetris.mjs +65 -0
  148. package/plugins/compaction/threshold.mjs +98 -0
  149. package/plugins/computer-use/DESKTOP-SKILL.md +64 -0
  150. package/plugins/computer-use/desktop-host.mjs +75 -0
  151. package/plugins/computer-use/desktop-skill.mjs +28 -0
  152. package/plugins/computer-use/desktop-upstream.mjs +3 -0
  153. package/plugins/computer-use/index.mjs +37 -0
  154. package/plugins/cordis-config/plain.mjs +31 -0
  155. package/plugins/credentials/index.mjs +73 -0
  156. package/plugins/custom/adapter.mjs +110 -0
  157. package/plugins/custom/config.mjs +85 -0
  158. package/plugins/custom/desktop-client.mjs +150 -0
  159. package/plugins/custom/desktop-host.mjs +78 -0
  160. package/plugins/custom/images.mjs +32 -0
  161. package/plugins/custom/index.mjs +145 -0
  162. package/plugins/custom/wire.mjs +179 -0
  163. package/plugins/desktop/client.mjs +1041 -0
  164. package/plugins/desktop/index.mjs +10 -0
  165. package/plugins/desktop/shell-environment.mjs +9 -0
  166. package/plugins/desktop-workspace/hooks.mjs +29 -0
  167. package/plugins/desktop-workspace/index.mjs +37 -0
  168. package/plugins/dscode/board.mjs +260 -0
  169. package/plugins/dscode/child-target.mjs +11 -0
  170. package/plugins/dscode/control.mjs +17 -0
  171. package/plugins/dscode/desktop-client.mjs +55 -0
  172. package/plugins/dscode/desktop-host.mjs +37 -0
  173. package/plugins/dscode/index.mjs +270 -0
  174. package/plugins/email/cli.mjs +32 -0
  175. package/plugins/email/contacts.mjs +36 -0
  176. package/plugins/email/desktop-client.mjs +117 -0
  177. package/plugins/email/desktop-host.mjs +54 -0
  178. package/plugins/email/desktop-service.mjs +106 -0
  179. package/plugins/email/gmail-oauth.mjs +69 -0
  180. package/plugins/email/gmail-store.mjs +2 -0
  181. package/plugins/email/gmail.mjs +194 -0
  182. package/plugins/email/imap.mjs +136 -0
  183. package/plugins/email/inbox.d.mts +25 -0
  184. package/plugins/email/inbox.mjs +76 -0
  185. package/plugins/email/smtp.mjs +70 -0
  186. package/plugins/email/store.mjs +32 -0
  187. package/plugins/email-tools/index.mjs +46 -0
  188. package/plugins/exec/cli.mjs +64 -0
  189. package/plugins/exec/index.mjs +112 -0
  190. package/plugins/grok/adapter.mjs +114 -0
  191. package/plugins/grok/auth.mjs +76 -0
  192. package/plugins/grok/billing.mjs +146 -0
  193. package/plugins/grok/index.mjs +122 -0
  194. package/plugins/grok/models.mjs +129 -0
  195. package/plugins/grok/status.mjs +28 -0
  196. package/plugins/grok/wire.mjs +268 -0
  197. package/plugins/hub/catalog.mjs +82 -0
  198. package/plugins/hub/desktop-client.mjs +114 -0
  199. package/plugins/hub/desktop-host.mjs +129 -0
  200. package/plugins/i18n/messages.d.mts +21 -0
  201. package/plugins/i18n/messages.mjs +537 -0
  202. package/plugins/jev/approval.mjs +131 -0
  203. package/plugins/jev/client.mjs +74 -0
  204. package/plugins/jev/index.mjs +99 -0
  205. package/plugins/memory/content.mjs +57 -0
  206. package/plugins/memory/desktop-host.mjs +3 -0
  207. package/plugins/memory/index.mjs +168 -0
  208. package/plugins/memory/pipeline.mjs +79 -0
  209. package/plugins/memory/store.mjs +93 -0
  210. package/plugins/message-source/kind.mjs +20 -0
  211. package/plugins/opencode-go/adapter.mjs +96 -0
  212. package/plugins/opencode-go/command.mjs +128 -0
  213. package/plugins/opencode-go/index.mjs +120 -0
  214. package/plugins/opencode-go/models.mjs +58 -0
  215. package/plugins/opencode-go/oauth.mjs +194 -0
  216. package/plugins/opencode-go/search.mjs +86 -0
  217. package/plugins/opencode-go/usage.mjs +119 -0
  218. package/plugins/opencode-go/version.mjs +10 -0
  219. package/plugins/opencode-go/wire.mjs +73 -0
  220. package/plugins/openrouter/adapter.mjs +232 -0
  221. package/plugins/openrouter/index.mjs +123 -0
  222. package/plugins/openrouter/models.mjs +157 -0
  223. package/plugins/openrouter/search.mjs +113 -0
  224. package/plugins/openrouter/wire.mjs +101 -0
  225. package/plugins/providers/catalog.mjs +160 -0
  226. package/plugins/providers/chat-messages.mjs +120 -0
  227. package/plugins/providers/chat-stream.mjs +174 -0
  228. package/plugins/providers/desktop-client.mjs +84 -0
  229. package/plugins/providers/desktop-host.mjs +63 -0
  230. package/plugins/providers/effort.mjs +35 -0
  231. package/plugins/providers/http-errors.mjs +50 -0
  232. package/plugins/providers/openrouter-account.mjs +171 -0
  233. package/plugins/session-bridge/client.mjs +106 -0
  234. package/plugins/session-bridge/communication.mjs +260 -0
  235. package/plugins/session-bridge/index.mjs +68 -0
  236. package/plugins/session-bridge/mailbox.mjs +267 -0
  237. package/plugins/session-bridge/paths.mjs +21 -0
  238. package/plugins/session-bridge/server.mjs +172 -0
  239. package/plugins/session-bridge/tasks.mjs +229 -0
  240. package/plugins/session-cards/content.mjs +64 -0
  241. package/plugins/session-cards/index.mjs +38 -0
  242. package/plugins/session-cards/manager.mjs +140 -0
  243. package/plugins/session-metrics/attribution.mjs +30 -0
  244. package/plugins/session-metrics/balance.mjs +81 -0
  245. package/plugins/session-metrics/desktop-client.mjs +62 -0
  246. package/plugins/session-metrics/desktop-host.mjs +46 -0
  247. package/plugins/session-metrics/index.mjs +96 -0
  248. package/plugins/session-metrics/pricing.mjs +84 -0
  249. package/plugins/session-metrics/rate.mjs +59 -0
  250. package/plugins/session-metrics/store.mjs +75 -0
  251. package/plugins/session-metrics/turns.mjs +134 -0
  252. package/plugins/session-metrics/view.mjs +271 -0
  253. package/plugins/time-marks/desktop-host.mjs +2 -0
  254. package/plugins/time-marks/index.mjs +116 -0
  255. package/plugins/time-marks/marks.mjs +152 -0
  256. package/plugins/triggers/cli.mjs +558 -0
  257. package/plugins/triggers/commands.mjs +143 -0
  258. package/plugins/triggers/config.mjs +264 -0
  259. package/plugins/triggers/desktop-client.mjs +155 -0
  260. package/plugins/triggers/desktop-host.mjs +88 -0
  261. package/plugins/triggers/desktop-management.mjs +97 -0
  262. package/plugins/triggers/desktop-scheduler.mjs +125 -0
  263. package/plugins/triggers/host.mjs +24 -0
  264. package/plugins/triggers/index.mjs +27 -0
  265. package/plugins/triggers/job-cli.mjs +110 -0
  266. package/plugins/triggers/jobs.mjs +156 -0
  267. package/plugins/triggers/launchd.mjs +101 -0
  268. package/plugins/triggers/lease.mjs +24 -0
  269. package/plugins/triggers/log.mjs +104 -0
  270. package/plugins/triggers/management.mjs +181 -0
  271. package/plugins/triggers/options.mjs +117 -0
  272. package/plugins/triggers/overlay.mjs +7 -0
  273. package/plugins/triggers/poll.mjs +65 -0
  274. package/plugins/triggers/run.mjs +157 -0
  275. package/plugins/triggers/schedule.mjs +40 -0
  276. package/plugins/triggers/scheduler-service.mjs +46 -0
  277. package/plugins/triggers/scheduler.mjs +92 -0
  278. package/plugins/triggers/session-run.mjs +125 -0
  279. package/plugins/triggers/session.mjs +48 -0
  280. package/plugins/triggers/source-emit.mjs +19 -0
  281. package/plugins/triggers/source-host.mjs +78 -0
  282. package/plugins/triggers/source-ingress.mjs +70 -0
  283. package/plugins/triggers/source-sandbox.mjs +35 -0
  284. package/plugins/triggers/sources.mjs +45 -0
  285. package/plugins/triggers/spool.mjs +145 -0
  286. package/plugins/triggers/tools.mjs +67 -0
  287. package/plugins/triggers/unattended.mjs +18 -0
  288. package/plugins/tui-tools/composition.mjs +28 -0
  289. package/plugins/tui-tools/desktop-host.mjs +2 -0
  290. package/plugins/tui-tools/doctor-cli.mjs +22 -0
  291. package/plugins/tui-tools/doctor.mjs +148 -0
  292. package/plugins/tui-tools/hook-sources.mjs +113 -0
  293. package/plugins/tui-tools/hooks.mjs +23 -0
  294. package/plugins/tui-tools/index.mjs +268 -0
  295. package/plugins/tui-tools/sandbox-runner.mjs +123 -0
  296. package/plugins/tui-tools/shell.mjs +27 -0
  297. package/plugins/tui-tools/update.mjs +111 -0
  298. package/plugins/tui-tools/workspace-discovery.mjs +129 -0
  299. package/plugins/ultra/policy.mjs +42 -0
  300. package/plugins/worktree-subagent/worktree.mjs +56 -0
  301. package/runtime-sources.json +94 -0
  302. package/vendor/bash/LICENSE +21 -0
  303. package/vendor/bash/index.js +717 -0
  304. package/vendor/bash/types/background.d.ts +50 -0
  305. package/vendor/bash/types/index.d.ts +38 -0
  306. package/vendor/bash/types/render.d.ts +57 -0
  307. package/vendor/command-goal/LICENSE +21 -0
  308. package/vendor/command-goal/index.js +210 -0
  309. package/vendor/command-goal/types/index.d.ts +10 -0
  310. package/vendor/computer-use/LICENSE +21 -0
  311. package/vendor/computer-use/lib/approval-policy.js +12 -0
  312. package/vendor/computer-use/lib/approval-policy.js.map +1 -0
  313. package/vendor/computer-use/lib/artifacts.js +79 -0
  314. package/vendor/computer-use/lib/artifacts.js.map +1 -0
  315. package/vendor/computer-use/lib/backend.js +3 -0
  316. package/vendor/computer-use/lib/backend.js.map +1 -0
  317. package/vendor/computer-use/lib/client.js +369 -0
  318. package/vendor/computer-use/lib/client.js.map +1 -0
  319. package/vendor/computer-use/lib/config.js +159 -0
  320. package/vendor/computer-use/lib/config.js.map +1 -0
  321. package/vendor/computer-use/lib/confirmations.js +99 -0
  322. package/vendor/computer-use/lib/confirmations.js.map +1 -0
  323. package/vendor/computer-use/lib/diff.js +58 -0
  324. package/vendor/computer-use/lib/diff.js.map +1 -0
  325. package/vendor/computer-use/lib/errors.js +22 -0
  326. package/vendor/computer-use/lib/errors.js.map +1 -0
  327. package/vendor/computer-use/lib/exposure.js +244 -0
  328. package/vendor/computer-use/lib/exposure.js.map +1 -0
  329. package/vendor/computer-use/lib/index.js +66 -0
  330. package/vendor/computer-use/lib/index.js.map +1 -0
  331. package/vendor/computer-use/lib/leases.js +262 -0
  332. package/vendor/computer-use/lib/leases.js.map +1 -0
  333. package/vendor/computer-use/lib/providers/macos.js +243 -0
  334. package/vendor/computer-use/lib/providers/macos.js.map +1 -0
  335. package/vendor/computer-use/lib/providers/native-helper.js +726 -0
  336. package/vendor/computer-use/lib/providers/native-helper.js.map +1 -0
  337. package/vendor/computer-use/lib/providers/unsupported.js +51 -0
  338. package/vendor/computer-use/lib/providers/unsupported.js.map +1 -0
  339. package/vendor/computer-use/lib/service.js +608 -0
  340. package/vendor/computer-use/lib/service.js.map +1 -0
  341. package/vendor/computer-use/lib/skill.js +136 -0
  342. package/vendor/computer-use/lib/skill.js.map +1 -0
  343. package/vendor/computer-use/lib/target-resolver.js +180 -0
  344. package/vendor/computer-use/lib/target-resolver.js.map +1 -0
  345. package/vendor/computer-use/lib/tools.js +511 -0
  346. package/vendor/computer-use/lib/tools.js.map +1 -0
  347. package/vendor/computer-use/lib/types/approval-policy.d.ts +13 -0
  348. package/vendor/computer-use/lib/types/approval-policy.d.ts.map +1 -0
  349. package/vendor/computer-use/lib/types/artifacts.d.ts +10 -0
  350. package/vendor/computer-use/lib/types/artifacts.d.ts.map +1 -0
  351. package/vendor/computer-use/lib/types/backend.d.ts +124 -0
  352. package/vendor/computer-use/lib/types/backend.d.ts.map +1 -0
  353. package/vendor/computer-use/lib/types/client/index.d.ts +83 -0
  354. package/vendor/computer-use/lib/types/client/index.d.ts.map +1 -0
  355. package/vendor/computer-use/lib/types/config.d.ts +94 -0
  356. package/vendor/computer-use/lib/types/config.d.ts.map +1 -0
  357. package/vendor/computer-use/lib/types/confirmations.d.ts +23 -0
  358. package/vendor/computer-use/lib/types/confirmations.d.ts.map +1 -0
  359. package/vendor/computer-use/lib/types/diff.d.ts +5 -0
  360. package/vendor/computer-use/lib/types/diff.d.ts.map +1 -0
  361. package/vendor/computer-use/lib/types/errors.d.ts +15 -0
  362. package/vendor/computer-use/lib/types/errors.d.ts.map +1 -0
  363. package/vendor/computer-use/lib/types/exposure.d.ts +30 -0
  364. package/vendor/computer-use/lib/types/exposure.d.ts.map +1 -0
  365. package/vendor/computer-use/lib/types/index.d.ts +21 -0
  366. package/vendor/computer-use/lib/types/index.d.ts.map +1 -0
  367. package/vendor/computer-use/lib/types/leases.d.ts +81 -0
  368. package/vendor/computer-use/lib/types/leases.d.ts.map +1 -0
  369. package/vendor/computer-use/lib/types/providers/macos.d.ts +39 -0
  370. package/vendor/computer-use/lib/types/providers/macos.d.ts.map +1 -0
  371. package/vendor/computer-use/lib/types/providers/native-helper.d.ts +48 -0
  372. package/vendor/computer-use/lib/types/providers/native-helper.d.ts.map +1 -0
  373. package/vendor/computer-use/lib/types/providers/unsupported.d.ts +23 -0
  374. package/vendor/computer-use/lib/types/providers/unsupported.d.ts.map +1 -0
  375. package/vendor/computer-use/lib/types/service.d.ts +58 -0
  376. package/vendor/computer-use/lib/types/service.d.ts.map +1 -0
  377. package/vendor/computer-use/lib/types/skill.d.ts +14 -0
  378. package/vendor/computer-use/lib/types/skill.d.ts.map +1 -0
  379. package/vendor/computer-use/lib/types/target-resolver.d.ts +38 -0
  380. package/vendor/computer-use/lib/types/target-resolver.d.ts.map +1 -0
  381. package/vendor/computer-use/lib/types/tools.d.ts +6 -0
  382. package/vendor/computer-use/lib/types/tools.d.ts.map +1 -0
  383. package/vendor/computer-use/lib/types/types.d.ts +270 -0
  384. package/vendor/computer-use/lib/types/types.d.ts.map +1 -0
  385. package/vendor/computer-use/lib/types/web.d.ts +33 -0
  386. package/vendor/computer-use/lib/types/web.d.ts.map +1 -0
  387. package/vendor/computer-use/lib/types.js +9 -0
  388. package/vendor/computer-use/lib/types.js.map +1 -0
  389. package/vendor/computer-use/lib/web.js +188 -0
  390. package/vendor/computer-use/lib/web.js.map +1 -0
  391. package/vendor/computer-use/native/macos/Sources/Fixture/main.swift +412 -0
  392. package/vendor/computer-use/native/macos/Sources/Helper/CursorImage.swift +11 -0
  393. package/vendor/computer-use/native/macos/Sources/Helper/CursorMotion.swift +67 -0
  394. package/vendor/computer-use/native/macos/Sources/Helper/CursorOverlay.swift +840 -0
  395. package/vendor/computer-use/native/macos/Sources/Helper/TargetedPointer.swift +327 -0
  396. package/vendor/computer-use/native/macos/Sources/Helper/WindowNumberMatcher.swift +29 -0
  397. package/vendor/computer-use/native/macos/Sources/Helper/main.swift +1244 -0
  398. package/vendor/computer-use/native/macos/Sources/Monitor/main.swift +153 -0
  399. package/vendor/computer-use/native/macos/bin/dsh-computer-use-helper +0 -0
  400. package/vendor/computer-use/native/macos/manifest.json +14 -0
  401. package/vendor/persistent/LICENSE +21 -0
  402. package/vendor/persistent/index.js +411 -0
  403. package/vendor/persistent/types/index.d.ts +24 -0
  404. package/vendor/subagent/LICENSE +21 -0
  405. package/vendor/subagent/index.js +694 -0
  406. package/vendor/subagent/invariant.js +52 -0
  407. package/vendor/subagent/model-selection-settings.js +68 -0
  408. package/vendor/subagent/types/index.d.ts +82 -0
  409. package/vendor/subagent/types/invariant.d.ts +16 -0
  410. package/vendor/subagent/types/list-models.d.ts +10 -0
  411. package/vendor/subagent/types/model-selection-settings.d.ts +45 -0
  412. package/vendor/subagent/types/model-selection-state.d.ts +48 -0
  413. package/vendor/subagent/types/model-selection.d.ts +81 -0
  414. package/vendor/subagent-core/LICENSE +21 -0
  415. package/vendor/subagent-core/index.js +3202 -0
  416. package/vendor/subagent-core/invariant.js +76 -0
  417. package/vendor/subagent-core/typert.host.d.ts +3 -0
  418. package/vendor/subagent-core/typert.host.js +978 -0
  419. package/vendor/subagent-core/typert.remote-client.d.ts +25 -0
  420. package/vendor/subagent-core/typert.remote-client.js +114 -0
  421. package/vendor/subagent-core/types/archive-admission.d.ts +16 -0
  422. package/vendor/subagent-core/types/archive-admission.js +151 -0
  423. package/vendor/subagent-core/types/assistant-output.d.ts +48 -0
  424. package/vendor/subagent-core/types/assistant-output.js +73 -0
  425. package/vendor/subagent-core/types/catalog.d.ts +84 -0
  426. package/vendor/subagent-core/types/catalog.js +109 -0
  427. package/vendor/subagent-core/types/child-agent.d.ts +156 -0
  428. package/vendor/subagent-core/types/child-agent.js +213 -0
  429. package/vendor/subagent-core/types/client.d.ts +8 -0
  430. package/vendor/subagent-core/types/client.js +7 -0
  431. package/vendor/subagent-core/types/continuation-activation.d.ts +267 -0
  432. package/vendor/subagent-core/types/continuation-activation.js +700 -0
  433. package/vendor/subagent-core/types/continuation-messages.d.ts +62 -0
  434. package/vendor/subagent-core/types/continuation-messages.js +106 -0
  435. package/vendor/subagent-core/types/continuation.d.ts +124 -0
  436. package/vendor/subagent-core/types/continuation.js +455 -0
  437. package/vendor/subagent-core/types/control-types.d.ts +135 -0
  438. package/vendor/subagent-core/types/control-types.js +8 -0
  439. package/vendor/subagent-core/types/control.d.ts +45 -0
  440. package/vendor/subagent-core/types/control.js +79 -0
  441. package/vendor/subagent-core/types/depth.d.ts +31 -0
  442. package/vendor/subagent-core/types/depth.js +39 -0
  443. package/vendor/subagent-core/types/descriptor.d.ts +144 -0
  444. package/vendor/subagent-core/types/descriptor.js +193 -0
  445. package/vendor/subagent-core/types/error.d.ts +11 -0
  446. package/vendor/subagent-core/types/error.js +14 -0
  447. package/vendor/subagent-core/types/inbox.d.ts +43 -0
  448. package/vendor/subagent-core/types/inbox.js +61 -0
  449. package/vendor/subagent-core/types/index.d.ts +320 -0
  450. package/vendor/subagent-core/types/index.js +475 -0
  451. package/vendor/subagent-core/types/internal.d.ts +58 -0
  452. package/vendor/subagent-core/types/internal.js +58 -0
  453. package/vendor/subagent-core/types/invariant.d.ts +13 -0
  454. package/vendor/subagent-core/types/invariant.js +91 -0
  455. package/vendor/subagent-core/types/lifecycle.d.ts +113 -0
  456. package/vendor/subagent-core/types/lifecycle.js +180 -0
  457. package/vendor/subagent-core/types/list-children.d.ts +36 -0
  458. package/vendor/subagent-core/types/list-children.js +166 -0
  459. package/vendor/subagent-core/types/out-of-process.d.ts +118 -0
  460. package/vendor/subagent-core/types/out-of-process.js +219 -0
  461. package/vendor/subagent-core/types/projection-types.d.ts +82 -0
  462. package/vendor/subagent-core/types/projection-types.js +7 -0
  463. package/vendor/subagent-core/types/projection.d.ts +100 -0
  464. package/vendor/subagent-core/types/projection.js +157 -0
  465. package/vendor/subagent-core/types/run-settlement.d.ts +17 -0
  466. package/vendor/subagent-core/types/run-settlement.js +70 -0
  467. package/vendor/subagent-core/types/types.d.ts +377 -0
  468. package/vendor/subagent-core/types/types.js +19 -0
  469. package/vendor/subagent-driver/LICENSE +21 -0
  470. package/vendor/subagent-driver/index.js +255 -0
  471. package/vendor/subagent-driver/types/index.d.ts +33 -0
  472. package/vendor/subagent-driver/types/structured.d.ts +42 -0
  473. package/vendor/subagent-fork/LICENSE +21 -0
  474. package/vendor/subagent-fork/index.js +61 -0
  475. package/vendor/subagent-fork/types/index.d.ts +20 -0
  476. package/vendor/subagent-spawn/LICENSE +21 -0
  477. package/vendor/subagent-spawn/index.js +45 -0
  478. package/vendor/subagent-spawn/types/index.d.ts +19 -0
  479. package/vendor/terminal/LICENSE +21 -0
  480. package/vendor/terminal/index.js +1093 -0
  481. package/vendor/terminal/types/config.d.ts +82 -0
  482. package/vendor/terminal/types/index.d.ts +36 -0
  483. package/vendor/terminal/types/sanitize.d.ts +47 -0
  484. package/vendor/terminal/types/session.d.ts +87 -0
@@ -0,0 +1,157 @@
1
+ /**
2
+ * Pure session projections for subagent identity (mode/label) and active-turn
3
+ * duration.
4
+ *
5
+ * @module @deepseek-ai/dsh-subagent/projection
6
+ */
7
+ import { z } from 'zod';
8
+ import { SessionSeq } from '@deepseek-ai/dsh-session';
9
+ import { foldSubagentDescriptor } from "./descriptor.js";
10
+ const activeIntervalSchema = z.object({
11
+ since: z.number().int().nonnegative(),
12
+ through: z.number().int().nonnegative(),
13
+ }).strict();
14
+ const projectionSchema = z.object({
15
+ settledMs: z.number().int().nonnegative(),
16
+ active: activeIntervalSchema.optional(),
17
+ lastTurnCompleted: z.boolean().optional(),
18
+ }).strict().transform(({ settledMs, active, lastTurnCompleted }) => ({
19
+ settledMs,
20
+ ...active === undefined ? {} : { active },
21
+ ...lastTurnCompleted === undefined ? {} : { lastTurnCompleted },
22
+ }));
23
+ const timingStateSchema = z.object({
24
+ settledMs: z.number().int().nonnegative(),
25
+ active: activeIntervalSchema.optional(),
26
+ pendingTurnStart: z.number().int().nonnegative().optional(),
27
+ descriptorSeen: z.boolean(),
28
+ lastTurnCompleted: z.boolean().optional(),
29
+ }).strict();
30
+ /**
31
+ * Fold turn boundaries around the child's own durable descriptor.
32
+ *
33
+ * A fork seed may contain an ancestor descriptor and completed turns. Every
34
+ * descriptor therefore resets the accumulated state; the healthy catalog
35
+ * admits only a child with exactly one descriptor in its own suffix, making
36
+ * the final reset the child's authoritative timing origin.
37
+ */
38
+ export const subagentTimingProjectionDefinition = {
39
+ key: 'subagentTiming',
40
+ stateSchema: timingStateSchema,
41
+ init: () => ({ descriptorSeen: false, settledMs: 0 }),
42
+ apply: (state, event) => {
43
+ if (event.type === 'turn/start') {
44
+ const { lastTurnCompleted: _closed, ...openState } = state;
45
+ return state.descriptorSeen
46
+ ? { ...openState, active: { since: event.time, through: event.time } }
47
+ : { ...openState, pendingTurnStart: event.time };
48
+ }
49
+ if (event.type === 'subagent/descriptor') {
50
+ const activeSince = state.active?.since ?? state.pendingTurnStart;
51
+ return {
52
+ descriptorSeen: true,
53
+ settledMs: 0,
54
+ ...(activeSince === undefined
55
+ ? {}
56
+ : { active: { since: activeSince, through: event.time } }),
57
+ };
58
+ }
59
+ if (event.type === 'turn/end') {
60
+ if (!state.descriptorSeen) {
61
+ if (state.pendingTurnStart === undefined)
62
+ return state;
63
+ const { pendingTurnStart: _closed, ...next } = state;
64
+ return next;
65
+ }
66
+ if (state.active === undefined)
67
+ return state;
68
+ const { active, ...rest } = state;
69
+ return {
70
+ ...rest,
71
+ settledMs: state.settledMs + Math.max(0, event.time - active.since),
72
+ lastTurnCompleted: event.data.reason.kind === 'completed',
73
+ };
74
+ }
75
+ if (state.active === undefined)
76
+ return state;
77
+ return { ...state, active: { ...state.active, through: event.time } };
78
+ },
79
+ wire: {
80
+ viewSchema: projectionSchema,
81
+ view: state => ({
82
+ settledMs: state.settledMs,
83
+ ...(state.active === undefined ? {} : { active: state.active }),
84
+ ...(state.lastTurnCompleted === undefined ? {} : { lastTurnCompleted: state.lastTurnCompleted }),
85
+ }),
86
+ },
87
+ stateVersion: 3,
88
+ };
89
+ // The cast bridges only the optional-label arm: Zod's optional output
90
+ // includes explicit `undefined`, which exactOptionalPropertyTypes excludes
91
+ // from the public interface. The no-value state itself is the serializable
92
+ // `null` arm — never `undefined` — so every registry read and push frame
93
+ // survives JSON.stringify losslessly.
94
+ const identityValueSchema = z.discriminatedUnion('mode', [
95
+ z.object({
96
+ mode: z.literal('one-shot'),
97
+ label: z.string().optional(),
98
+ seq: z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER).transform(SessionSeq),
99
+ }).strict(),
100
+ z.object({
101
+ mode: z.literal('continuable'),
102
+ label: z.string(),
103
+ seq: z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER).transform(SessionSeq),
104
+ }).strict(),
105
+ ]);
106
+ const identitySchema = identityValueSchema.nullable();
107
+ const identityStateSchema = z.object({
108
+ identity: identityValueSchema.optional(),
109
+ }).strict();
110
+ /** Interpret one `subagent/descriptor` event's identity; no value when the payload cannot be trusted. */
111
+ function descriptorIdentity(event) {
112
+ let descriptor;
113
+ try {
114
+ descriptor = foldSubagentDescriptor([event]);
115
+ }
116
+ catch {
117
+ // Only a malformed current-version payload throws in descriptor parsing;
118
+ // a projection fold must never throw, so damage folds to no value.
119
+ descriptor = undefined;
120
+ }
121
+ if (descriptor === undefined)
122
+ return undefined;
123
+ return descriptor.mode === 'one-shot'
124
+ ? {
125
+ mode: 'one-shot',
126
+ ...descriptor.label !== undefined ? { label: descriptor.label } : {},
127
+ seq: event.seq,
128
+ }
129
+ : { mode: 'continuable', label: descriptor.label, seq: event.seq };
130
+ }
131
+ /**
132
+ * Fold the durable mode/label identity from `subagent/descriptor` events,
133
+ * last-wins: a fork seed may replay an ancestor's descriptor, and the child's
134
+ * own descriptor must override it — the same reset discipline as
135
+ * {@link subagentTimingProjectionDefinition}. A malformed or unknown-version
136
+ * payload resets to the `null` sentinel instead of throwing, so a fork of a
137
+ * healthy ancestor never inherits an identity its own descriptor failed to
138
+ * establish — and the reset survives every JSON push frame, so a consumer
139
+ * holding the earlier identity replaces it instead of keeping it stale;
140
+ * `null` ⟺ no valid descriptor, with the causes deliberately undistinguished.
141
+ */
142
+ export const subagentIdentityProjectionDefinition = {
143
+ key: 'subagent',
144
+ stateSchema: identityStateSchema,
145
+ init: () => ({}),
146
+ apply: (state, event) => {
147
+ if (event.type !== 'subagent/descriptor')
148
+ return state;
149
+ const identity = descriptorIdentity(event);
150
+ return identity === undefined ? {} : { identity };
151
+ },
152
+ wire: { viewSchema: identitySchema, view: state => state.identity ?? null },
153
+ // Bumped when the identity gained its `seq` field: an older checkpoint row
154
+ // would replay into a value the schema rejects, so it must refold instead.
155
+ stateVersion: 2,
156
+ };
157
+ //# sourceMappingURL=projection.js.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Settlement of one ONE-SHOT subagent run into a background-Task outcome. Only
3
+ * the one-shot background path uses Jobs; continuable children have no Task,
4
+ * no per-message result, and no Task cancellation.
5
+ *
6
+ * @module @deepseek-ai/dsh-subagent/run-settlement
7
+ */
8
+ import type { JobOutcome } from '@deepseek-ai/dsh-jobs';
9
+ import type { SubagentRun } from './types.ts';
10
+ /**
11
+ * Await the child result, dispose the run, then return its task outcome. Result
12
+ * and disposal failures become `failed`; when both fail, both details survive.
13
+ * @param run - live run to settle and release.
14
+ * @returns outcome after child resources are released.
15
+ */
16
+ export declare function settleRun(run: SubagentRun): Promise<JobOutcome>;
17
+ //# sourceMappingURL=run-settlement.d.ts.map
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Settlement of one ONE-SHOT subagent run into a background-Task outcome. Only
3
+ * the one-shot background path uses Jobs; continuable children have no Task,
4
+ * no per-message result, and no Task cancellation.
5
+ *
6
+ * @module @deepseek-ai/dsh-subagent/run-settlement
7
+ */
8
+ /** Flatten a child's final output blocks to the task's final text. */
9
+ function finalText(blocks) {
10
+ return blocks
11
+ .filter((block) => block.type === 'text')
12
+ .map(block => block.text)
13
+ .join('');
14
+ }
15
+ /** Render a failed stop reason with optional provider-authored detail. */
16
+ function failureDetail(result) {
17
+ const stopReason = result.stopReason;
18
+ return result.diagnostic === undefined
19
+ ? stopReason
20
+ : `${stopReason}; diagnostic: ${result.diagnostic}`;
21
+ }
22
+ /**
23
+ * Map a child result to the task outcome: completed carries final text, local
24
+ * cancellation (`aborted` without a diagnostic) is killed, and provider-
25
+ * diagnosed remote aborts plus every other reason are failed without partial
26
+ * output.
27
+ * @param result - child terminal result.
28
+ * @returns outcome for the `ctx.jobs` registration.
29
+ */
30
+ function runOutcome(result) {
31
+ switch (result.stopReason) {
32
+ case 'completed':
33
+ return { status: 'completed', result: finalText(result.output) };
34
+ case 'aborted':
35
+ return result.diagnostic === undefined
36
+ ? { status: 'killed' }
37
+ : { status: 'failed', detail: failureDetail(result) };
38
+ case 'error':
39
+ case 'max-tokens':
40
+ case 'refusal':
41
+ return { status: 'failed', detail: failureDetail(result) };
42
+ // Merge-extensible reasons remain failures with provider-authored detail.
43
+ default:
44
+ return { status: 'failed', detail: failureDetail(result) };
45
+ }
46
+ }
47
+ /**
48
+ * Await the child result, dispose the run, then return its task outcome. Result
49
+ * and disposal failures become `failed`; when both fail, both details survive.
50
+ * @param run - live run to settle and release.
51
+ * @returns outcome after child resources are released.
52
+ */
53
+ export async function settleRun(run) {
54
+ let outcome;
55
+ try {
56
+ outcome = runOutcome(await run.result);
57
+ }
58
+ catch (error) {
59
+ outcome = { status: 'failed', detail: String(error) };
60
+ }
61
+ try {
62
+ await run.dispose();
63
+ }
64
+ catch (error) {
65
+ const prefix = outcome.detail === undefined ? '' : `${outcome.detail}; `;
66
+ return { status: 'failed', detail: `${prefix}dispose failed: ${String(error)}` };
67
+ }
68
+ return outcome;
69
+ }
70
+ //# sourceMappingURL=run-settlement.js.map
@@ -0,0 +1,377 @@
1
+ /**
2
+ * The seam's consumer-facing contracts: request, result, and capability types
3
+ * for {@link SubagentProvider}, plus the `subagent/start` and `subagent/end`
4
+ * payloads that plugins and hosts observe. Internal control interfaces belong
5
+ * with their implementation — the lifecycle observer in `./lifecycle.ts`, the
6
+ * continuation host in `./continuation.ts` — so this module stays the published
7
+ * surface rather than a bag of everything type-shaped.
8
+ *
9
+ * @module @deepseek-ai/dsh-subagent/types
10
+ */
11
+ import type { Agent, AgentOptions } from '@deepseek-ai/dsh-agent';
12
+ import type { Branded } from '@deepseek-ai/dsh-brand';
13
+ import type { ContentBlock, MessageId } from '@deepseek-ai/dsh-llm';
14
+ import type { SessionEvent, SessionId } from '@deepseek-ai/dsh-session';
15
+ import type { ObjectJsonSchema, ToolRestriction } from '@deepseek-ai/dsh-tools';
16
+ import type { SubagentDescriptorData } from './descriptor.ts';
17
+ /** Identifies one accepted subagent run across its lifecycle event pair. */
18
+ export type SubagentRunId = Branded<'SubagentRunId'>;
19
+ /**
20
+ * Brand a string as a {@link SubagentRunId}.
21
+ * @param id - the raw run id.
22
+ * @returns the same string, branded.
23
+ */
24
+ export declare function SubagentRunId(id: string): SubagentRunId;
25
+ /** What a caller asks for when starting a continuable background child. */
26
+ export interface ContinuableStartSpec {
27
+ /** The `ctx.subagents` provider whose continuable-creation capability establishes the child. */
28
+ readonly provider: string;
29
+ /** The initial delegation's short `description`, persisted as the child's creation label. */
30
+ readonly label: string;
31
+ /**
32
+ * Optional caller-reserved child identity. Omission preserves the manager's
33
+ * UUID allocation; supplying one lets a durable parent record provisioning
34
+ * before child materialization without a second identity handshake.
35
+ */
36
+ readonly childId?: SessionId;
37
+ /**
38
+ * The delegation request. The manager reserves the stable child id, resolves
39
+ * the durable descriptor, and composes the child itself.
40
+ */
41
+ readonly request: Omit<SubagentStartRequest, 'label' | 'signal' | 'outputSchema'>;
42
+ /** Caller cancellation, owning the operation only until inbox acceptance. */
43
+ readonly signal: AbortSignal;
44
+ }
45
+ /** Identities returned once a continuable child accepted its initial prompt. */
46
+ export interface ContinuableStart {
47
+ /** The durable child session id, stable across activations. */
48
+ readonly childId: SessionId;
49
+ /** The accepted initial prompt's inbox message id. */
50
+ readonly messageId: MessageId;
51
+ }
52
+ /**
53
+ * Authority under which one interrupt request is admitted. `user` carries the
54
+ * durable direct-parent address a human client presented; `ancestor` carries
55
+ * the exact live Agent object whose recorded lineage must contain the caller.
56
+ */
57
+ export type SubagentInterruptAuthority = {
58
+ readonly kind: 'user';
59
+ readonly parentSessionId: SessionId;
60
+ } | {
61
+ readonly kind: 'ancestor';
62
+ readonly agent: Agent;
63
+ };
64
+ /** Options for one model-authored message between adjacent Agents. */
65
+ export interface SubagentSendMessageOptions {
66
+ /** Caller cancellation, owning the operation only until inbox acceptance. */
67
+ readonly signal: AbortSignal;
68
+ }
69
+ /**
70
+ * Observe-only identifying detail for a published subagent run, carried by
71
+ * `subagent/start`. One-shot runs and continuable Activation epochs share this
72
+ * payload, so an observer sees the same vocabulary for both.
73
+ */
74
+ export interface SubagentRunInfo {
75
+ /** Unique identity shared with the paired terminal event. */
76
+ readonly runId: SubagentRunId;
77
+ /**
78
+ * Provider name recorded when the child was first created. The provider may
79
+ * be absent when an accepted one-shot run becomes ready or a persisted
80
+ * Activation cold-resumes, because neither lifecycle depends on continued
81
+ * registration.
82
+ */
83
+ readonly provider: string;
84
+ /** The child agent's id. */
85
+ readonly id: SessionId;
86
+ /** Snapshot of whether `SubagentRun.localAgent` was present when start fulfilled. */
87
+ readonly local: boolean;
88
+ }
89
+ /**
90
+ * Observe-only outcome detail for a settled subagent run, carried by
91
+ * `subagent/end` and paired with one {@link SubagentRunInfo} by `runId`.
92
+ */
93
+ export interface SubagentRunEndInfo {
94
+ /** Unique identity shared with the paired start event. */
95
+ readonly runId: SubagentRunId;
96
+ /** The same provider name carried by the paired start event. */
97
+ readonly provider: string;
98
+ /** The child agent's id. */
99
+ readonly id: SessionId;
100
+ /** Snapshot of whether `SubagentRun.localAgent` was present when start fulfilled. */
101
+ readonly local: boolean;
102
+ /** The terminal stop reason. */
103
+ readonly stopReason: SubagentResult['stopReason'];
104
+ /**
105
+ * The child's final assistant output, selected by the same rule as
106
+ * {@link SubagentResult.output}; absent on infrastructure rejection or when
107
+ * the child produced none.
108
+ */
109
+ readonly lastAssistantMessage?: readonly ContentBlock[];
110
+ }
111
+ /**
112
+ * Which START-TIME features a provider supports. Checked by the service before delegating to
113
+ * {@link SubagentProvider.start}: a request that needs a capability the chosen provider lacks
114
+ * is rejected with a typed error rather than accepted-then-ignored (the "fail loud, no silent
115
+ * degradation" rule). These flags describe the ONE-SHOT
116
+ * {@link SubagentProvider.start} path, where the provider composes the child;
117
+ * continuable children are composed by the continuation manager itself and are
118
+ * gated by {@link SubagentProvider.prepareContinuable} instead. Each flag
119
+ * corresponds one-to-one to a {@link SubagentStartRequest} option: `depthLimit`
120
+ * to `maxDepth`; the other names match.
121
+ */
122
+ export interface SubagentCapabilities {
123
+ readonly agentOptions: boolean;
124
+ readonly outputSchema: boolean;
125
+ readonly depthLimit: boolean;
126
+ readonly toolFilter: boolean;
127
+ readonly persona: boolean;
128
+ }
129
+ /**
130
+ * What a caller asks for when starting a ONE-SHOT subagent. The tool layer
131
+ * builds this from the model's `{ description, prompt }` plus its own config;
132
+ * the service validates {@link SubagentCapabilities} against the named provider
133
+ * and resolves the durable descriptor before dispatching to
134
+ * {@link SubagentProvider.start}.
135
+ */
136
+ export interface SubagentStartRequest {
137
+ /** Optional short display label persisted with a session-backed child. */
138
+ readonly label?: string;
139
+ /** Content delivered as the child's user message. */
140
+ readonly prompt: ContentBlock[];
141
+ /**
142
+ * The spawning agent. In-process providers derive workspace, lineage, and
143
+ * delegation depth from its durable session state. ACP reads only its cwd,
144
+ * and only when no deployment `cwd` override is configured.
145
+ */
146
+ readonly parent: Agent;
147
+ /**
148
+ * Cancellation signal from the spawning context (the tool's `exec.signal`).
149
+ * This is the canonical cancellation channel both before and after startup:
150
+ * a provider rejects `start()` after cleaning partial resources when it
151
+ * fires before the run is published, and cancels the published run's
152
+ * remaining turn work when it fires afterward.
153
+ */
154
+ readonly signal: AbortSignal;
155
+ /**
156
+ * Optional host-Agent provider, model, reasoning-effort, and output-token
157
+ * overrides. Requires {@link SubagentCapabilities.agentOptions}; in-process
158
+ * providers merge them over the parent Agent's options when they create the
159
+ * child, while the DSH SDK provider merges them over its instance defaults
160
+ * before initializing the separate child runtime.
161
+ */
162
+ readonly agentOptions?: AgentOptions;
163
+ /**
164
+ * Object-rooted JSON Schema within `assertObjectJsonSchema`'s enforced subset. Start rejects
165
+ * unsupported schemas or providers without the capability. Data must be plain host-realm JSON;
166
+ * a successful child returns the matching value as {@link SubagentResult.structured}.
167
+ */
168
+ readonly outputSchema?: ObjectJsonSchema;
169
+ /**
170
+ * Optional absolute delegation-depth cap for the child being started: its
171
+ * computed depth must be less than or equal to this non-negative safe
172
+ * integer. Requires {@link SubagentCapabilities.depthLimit}; rejected at
173
+ * start otherwise.
174
+ */
175
+ readonly maxDepth?: number;
176
+ /**
177
+ * Optional child tool scoping. Requires {@link SubagentCapabilities.toolFilter};
178
+ * rejected at start otherwise. In-process backends apply it as a scoped
179
+ * `tools.restrict()` in the child's creation window: the named tools vanish
180
+ * from the child's prompt AND refuse to execute (one visibility), with loud
181
+ * unknown-name validation.
182
+ */
183
+ readonly toolFilter?: ToolRestriction;
184
+ /**
185
+ * Optional per-child persona. Requires {@link SubagentCapabilities.persona};
186
+ * rejected at start otherwise. In-process backends register it as a scoped
187
+ * `deployment:persona-prefix` section on the child, SHADOWING the deployment's
188
+ * persona for this child alone — same template semantics as the deployment
189
+ * persona (strict `{{…}}` interpolation against the registered variables).
190
+ */
191
+ readonly persona?: string;
192
+ }
193
+ /**
194
+ * Provider-facing one-shot request after {@link SubagentRuntime.start} resolves
195
+ * the durable child descriptor.
196
+ */
197
+ export interface ResolvedSubagentStartRequest extends SubagentStartRequest {
198
+ /** Detached descriptor a session-backed provider persists in the child log. */
199
+ readonly descriptor: SubagentDescriptorData;
200
+ }
201
+ /**
202
+ * What the continuation manager asks a provider for while materializing one
203
+ * continuable child's FIRST activation. The manager has already reserved the
204
+ * durable child identity and owns every later operation, so this request
205
+ * carries only what distinguishes a fresh child from one seeded with parent
206
+ * history.
207
+ */
208
+ export interface ContinuableCreateRequest {
209
+ /** The reserved durable child session id, for provider diagnostics. */
210
+ readonly sessionId: SessionId;
211
+ /** The delegating parent agent whose history a seeding provider reads. */
212
+ readonly parent: Agent;
213
+ /**
214
+ * Caller cancellation, which owns preparation only until the manager accepts
215
+ * the initial prompt into the child's inbox.
216
+ */
217
+ readonly signal: AbortSignal;
218
+ }
219
+ /**
220
+ * A provider's detached contribution to one continuable child's creation. This
221
+ * is DATA, never a capability: it carries no Agent, `AgentHandle`, prompt
222
+ * delivery, result, disposal, or resume operation, because the continuation
223
+ * manager owns the child's whole lifecycle after preparation.
224
+ */
225
+ export interface ContinuableCreateSpec {
226
+ /**
227
+ * Completed-turn prefix of the parent's log to seed the child session with,
228
+ * or absent for a fresh child. Same durable contract as
229
+ * `CreateAgentOptions.seed`: contiguous from seq 0, lossless JSON, balanced.
230
+ */
231
+ readonly seed?: readonly SessionEvent[];
232
+ }
233
+ /**
234
+ * Why a subagent run ended. Merge-extensible (a backend may add variants);
235
+ * consumers branch on the known cases and fall through `default`. The known
236
+ * cases mirror the harness turn-end vocabulary so the tool layer can map a
237
+ * non-`completed` result to an `isError` tool result.
238
+ */
239
+ export interface SubagentStopReasonMap {
240
+ /** The child finished its turn normally. */
241
+ completed: 'completed';
242
+ /** Cancelled through the request signal or disposal. */
243
+ aborted: 'aborted';
244
+ /** Model or transport failure. */
245
+ error: 'error';
246
+ /** The child hit its token ceiling before finishing. */
247
+ 'max-tokens': 'max-tokens';
248
+ /** The child declined the task. */
249
+ refusal: 'refusal';
250
+ }
251
+ /** The union over {@link SubagentStopReasonMap} — widens automatically as backends merge in variants. */
252
+ export type SubagentStopReason = SubagentStopReasonMap[keyof SubagentStopReasonMap];
253
+ /**
254
+ * The terminal outcome of a subagent run, resolved by {@link SubagentRun.result}.
255
+ */
256
+ export interface SubagentResult {
257
+ /**
258
+ * The child's final assistant output is the content of its last non-empty
259
+ * assistant message. Empty-content messages, including usage-only messages,
260
+ * are skipped. Without a non-empty message, the output is its accumulated
261
+ * assistant text stream, or `[]` when the child produced neither.
262
+ */
263
+ readonly output: readonly ContentBlock[];
264
+ /**
265
+ * The structured result after a requested `outputSchema` was successfully
266
+ * satisfied. Requesting a schema does not guarantee presence: a provider can
267
+ * end with `stopReason: 'error'` when the child fails or finishes without a
268
+ * valid capture. The structured value is validated against the requested
269
+ * output schema by the provider; `unknown` here because the seam is
270
+ * schema-agnostic.
271
+ */
272
+ readonly structured?: unknown;
273
+ /**
274
+ * Provider-authored, non-assistant failure detail for a non-`completed`
275
+ * result. Providers keep this text free of tool inputs, file contents,
276
+ * environment values, credentials, and raw protocol payloads, and limit it
277
+ * to 4096 UTF-8 bytes. Consumers present it separately from {@link output}.
278
+ */
279
+ readonly diagnostic?: string;
280
+ /** Why the run ended. A non-`completed` reason means `output` may be partial. */
281
+ readonly stopReason: SubagentStopReason;
282
+ }
283
+ /**
284
+ * ONE-SHOT child handle returned after publication. Prompt submission, turn
285
+ * work, and infrastructure faults after that boundary belong to {@link result}.
286
+ * Consumers await that result and must always {@link dispose} to cancel
287
+ * remaining work and reach quiescence. A run is one disposable foreground
288
+ * delegation with one result; continuable conversations have no run — the
289
+ * continuation manager holds their `AgentHandle` directly and orders every
290
+ * turn through the child's own inbox.
291
+ */
292
+ export interface SubagentRun {
293
+ /**
294
+ * Parent-scoped run id. For a local run, this MUST equal the published child
295
+ * session id, whose `parentSession` records `request.parent.session.id`; a
296
+ * remote provider mints an id unique in the parent namespace.
297
+ */
298
+ readonly id: SessionId;
299
+ /**
300
+ * The exact published in-process child, or `undefined` for a remote run.
301
+ * When present, its id is {@link id}; the provider retains no ownership
302
+ * implication beyond the run's ordinary {@link dispose} contract.
303
+ */
304
+ readonly localAgent: Agent | undefined;
305
+ /**
306
+ * Resolves with the child's terminal {@link SubagentResult} when the run
307
+ * settles. Does NOT reject on a child-level failure — a model/transport
308
+ * failure resolves with `stopReason: 'error'` so the consumer maps it to an
309
+ * `isError` tool result. Rejects on an infrastructure fault the seam cannot
310
+ * represent as a stop reason.
311
+ */
312
+ readonly result: Promise<SubagentResult>;
313
+ /**
314
+ * Cancel remaining work, reach child quiescence, and release resources.
315
+ * Idempotent.
316
+ */
317
+ dispose(): Promise<void>;
318
+ }
319
+ /**
320
+ * One registered transport for running child agents. Providers are trusted
321
+ * same-process implementations; callers treat descriptors and returned values
322
+ * as borrowed immutable data. The service may call one provider concurrently
323
+ * for distinct children. Providers isolate operation-local mutable state; a
324
+ * shared capacity controller may delay an operation but must not couple its
325
+ * settlement or cleanup to a sibling.
326
+ */
327
+ export interface SubagentProvider {
328
+ /** Unique registry name (e.g. `spawn`, `fork`, `acp`). */
329
+ readonly name: string;
330
+ /** The start-time features this provider supports (see {@link SubagentCapabilities}). */
331
+ readonly capabilities: SubagentCapabilities;
332
+ /**
333
+ * Whether the child sees the parent's completed-turn prefix. This is descriptive, not a
334
+ * service-validated start capability: the model-facing tool derives truthful wording from it.
335
+ * It says nothing about tool registration, injected services, or authority inheritance.
336
+ */
337
+ readonly inheritsParentContext: boolean;
338
+ /**
339
+ * Optional static provider-owned provider/model route for one-shot Agent
340
+ * options. Consumers merge tool/model overrides over these values before
341
+ * preflight; providers whose route derives from the parent omit it. The value
342
+ * is detached immutable data and requires `agentOptions` support.
343
+ */
344
+ readonly agentRouteDefaults?: Readonly<{
345
+ provider: string;
346
+ model: string;
347
+ }>;
348
+ /**
349
+ * Establish a ONE-SHOT child and return its handle after publication.
350
+ * The service has already validated that every requested start-time
351
+ * capability is supported and resolved `request.descriptor`, so a
352
+ * session-backed implementation appends that descriptor inside the child's
353
+ * initial turn. Before fulfillment, the provider owns setup and cleans any
354
+ * unpublished partial resources before rejecting. Ownership transfers on
355
+ * fulfillment; subsequent turn or infrastructure failure settles through
356
+ * the returned run. Distinct starts may overlap; cancellation, failure,
357
+ * result settlement, and disposal remain independent for each run.
358
+ */
359
+ start(request: ResolvedSubagentStartRequest): Promise<SubagentRun>;
360
+ /**
361
+ * OPTIONAL (continuable-creation capability): contribute the detached
362
+ * creation inputs that distinguish this provider's continuable children —
363
+ * only whether the child session is seeded with parent history. Method
364
+ * presence IS the capability: the service rejects continuable starts on
365
+ * providers without it, while a provider that has it may still serve
366
+ * ordinary one-shot delegations.
367
+ *
368
+ * This is the provider's ONLY participation in a continuable child. The
369
+ * continuation manager owns identity reservation, composition, Agent
370
+ * creation, prompt delivery, cold resume, ownership, and disposal, so a
371
+ * provider never sees the child's Agent, handle, turns, or teardown.
372
+ * Distinct preparations may overlap; each follows its own signal and returns
373
+ * data belonging only to `request.sessionId`.
374
+ */
375
+ prepareContinuable?(request: ContinuableCreateRequest): Promise<ContinuableCreateSpec>;
376
+ }
377
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The seam's consumer-facing contracts: request, result, and capability types
3
+ * for {@link SubagentProvider}, plus the `subagent/start` and `subagent/end`
4
+ * payloads that plugins and hosts observe. Internal control interfaces belong
5
+ * with their implementation — the lifecycle observer in `./lifecycle.ts`, the
6
+ * continuation host in `./continuation.ts` — so this module stays the published
7
+ * surface rather than a bag of everything type-shaped.
8
+ *
9
+ * @module @deepseek-ai/dsh-subagent/types
10
+ */
11
+ /**
12
+ * Brand a string as a {@link SubagentRunId}.
13
+ * @param id - the raw run id.
14
+ * @returns the same string, branded.
15
+ */
16
+ export function SubagentRunId(id) {
17
+ return id;
18
+ }
19
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 DeepSeek
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.