@sqdr2/dsh-agent-studio-fusion 0.0.0-stage → 1.0.0

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 (365) hide show
  1. package/CHANGELOG.md +629 -0
  2. package/INSTALL.md +72 -0
  3. package/INSTALL.zh.md +73 -0
  4. package/LICENSE +201 -0
  5. package/README.en.md +207 -0
  6. package/README.md +207 -2
  7. package/RELEASING.md +136 -0
  8. package/RELEASING.zh.md +128 -0
  9. package/assets/icon.svg +10 -0
  10. package/assets/mermaid.min.js +3636 -0
  11. package/contracts/fusion.ts +422 -0
  12. package/contracts/storage.sql +86 -0
  13. package/cordis.patch.yml +3 -0
  14. package/docs/ATTRIBUTION-ACP.md +117 -0
  15. package/docs/ATTRIBUTION-AGY.md +139 -0
  16. package/docs/COMPATIBILITY.md +242 -0
  17. package/docs/EVIDENCE.md +141 -0
  18. package/docs/MIGRATION-ACP.md +195 -0
  19. package/docs/MIGRATION-AGY.md +282 -0
  20. package/dshx.yml +58 -0
  21. package/lib/assets/mermaid.min.js +3636 -0
  22. package/lib/bridge.mjs +138 -0
  23. package/lib/client.js +7130 -0
  24. package/lib/client.js.map +7 -0
  25. package/lib/dsh-agent-studio-fusion.js +26686 -0
  26. package/lib/types/activity.d.ts +34 -0
  27. package/lib/types/approval/logical.d.ts +10 -0
  28. package/lib/types/benchmark/naive.d.ts +37 -0
  29. package/lib/types/benchmark/native-run.d.ts +68 -0
  30. package/lib/types/benchmark/output-limits.d.ts +19 -0
  31. package/lib/types/bilingual.d.ts +2 -0
  32. package/lib/types/client/AcpSettingsGuide.d.ts +15 -0
  33. package/lib/types/client/ActivityRows.d.ts +8 -0
  34. package/lib/types/client/FusionCache.d.ts +4 -0
  35. package/lib/types/client/FusionHint.d.ts +9 -0
  36. package/lib/types/client/FusionHistory.d.ts +7 -0
  37. package/lib/types/client/FusionPanelIcon.d.ts +13 -0
  38. package/lib/types/client/FusionPermission.d.ts +15 -0
  39. package/lib/types/client/FusionRecovery.d.ts +5 -0
  40. package/lib/types/client/FusionSettings.d.ts +17 -0
  41. package/lib/types/client/FusionStatus.d.ts +12 -0
  42. package/lib/types/client/FusionTool.d.ts +4 -0
  43. package/lib/types/client/acp-import.d.ts +82 -0
  44. package/lib/types/client/activity-model.d.ts +14 -0
  45. package/lib/types/client/agy/AgyConsole.d.ts +42 -0
  46. package/lib/types/client/agy/brand-icons.d.ts +34 -0
  47. package/lib/types/client/agy/decisions.d.ts +23 -0
  48. package/lib/types/client/agy/images.d.ts +13 -0
  49. package/lib/types/client/agy/locale.d.ts +26 -0
  50. package/lib/types/client/agy/locales.d.ts +174 -0
  51. package/lib/types/client/agy/scroll-guard.d.ts +24 -0
  52. package/lib/types/client/agy/toolview.d.ts +169 -0
  53. package/lib/types/client/agy-activity.d.ts +49 -0
  54. package/lib/types/client/i18n.d.ts +15 -0
  55. package/lib/types/client/index.d.ts +22 -0
  56. package/lib/types/client/settings-events.d.ts +2 -0
  57. package/lib/types/client/status-polling.d.ts +13 -0
  58. package/lib/types/client/studio-brand.d.ts +12 -0
  59. package/lib/types/context/guard.d.ts +21 -0
  60. package/lib/types/context/handoff.d.ts +17 -0
  61. package/lib/types/contracts.d.ts +494 -0
  62. package/lib/types/digest.d.ts +5 -0
  63. package/lib/types/dsh-agent-studio-fusion.d.ts +27 -0
  64. package/lib/types/dsh-fusion.d.ts +1 -0
  65. package/lib/types/errors.d.ts +28 -0
  66. package/lib/types/evidence/gate.d.ts +23 -0
  67. package/lib/types/evidence/receipts.d.ts +65 -0
  68. package/lib/types/execution/write-lease.d.ts +42 -0
  69. package/lib/types/host/acp/adapter.d.ts +107 -0
  70. package/lib/types/host/acp/agent-process.d.ts +126 -0
  71. package/lib/types/host/acp/bridge-route.d.ts +13 -0
  72. package/lib/types/host/acp/bridge.d.ts +149 -0
  73. package/lib/types/host/acp/chunk-translator.d.ts +29 -0
  74. package/lib/types/host/acp/config.d.ts +21 -0
  75. package/lib/types/host/acp/context-windows.d.ts +32 -0
  76. package/lib/types/host/acp/host.d.ts +41 -0
  77. package/lib/types/host/acp/index.d.ts +33 -0
  78. package/lib/types/host/acp/permission.d.ts +28 -0
  79. package/lib/types/host/acp/prompt-capabilities.d.ts +35 -0
  80. package/lib/types/host/acp/request-image.d.ts +32 -0
  81. package/lib/types/host/acp/transcript.d.ts +33 -0
  82. package/lib/types/host/acp/types.d.ts +54 -0
  83. package/lib/types/host/agy/adapter.d.ts +347 -0
  84. package/lib/types/host/agy/agy-db.d.ts +67 -0
  85. package/lib/types/host/agy/agy-log.d.ts +13 -0
  86. package/lib/types/host/agy/agy-usage.d.ts +52 -0
  87. package/lib/types/host/agy/ask-tool.d.ts +7 -0
  88. package/lib/types/host/agy/atomic-write.d.ts +4 -0
  89. package/lib/types/host/agy/auth.d.ts +49 -0
  90. package/lib/types/host/agy/auto-updater.d.ts +38 -0
  91. package/lib/types/host/agy/commands.d.ts +39 -0
  92. package/lib/types/host/agy/config.d.ts +37 -0
  93. package/lib/types/host/agy/credential-slot.d.ts +252 -0
  94. package/lib/types/host/agy/diagnostics.d.ts +19 -0
  95. package/lib/types/host/agy/discovery.d.ts +21 -0
  96. package/lib/types/host/agy/dsh-goal.d.ts +43 -0
  97. package/lib/types/host/agy/index.d.ts +13 -0
  98. package/lib/types/host/agy/mapper.d.ts +145 -0
  99. package/lib/types/host/agy/mcp-bridge.d.ts +72 -0
  100. package/lib/types/host/agy/media-route.d.ts +23 -0
  101. package/lib/types/host/agy/media.d.ts +54 -0
  102. package/lib/types/host/agy/mirror-tool.d.ts +60 -0
  103. package/lib/types/host/agy/models.d.ts +90 -0
  104. package/lib/types/host/agy/net.d.ts +10 -0
  105. package/lib/types/host/agy/oauth.d.ts +77 -0
  106. package/lib/types/host/agy/oneshot.d.ts +35 -0
  107. package/lib/types/host/agy/parser.d.ts +42 -0
  108. package/lib/types/host/agy/pool-auth.d.ts +70 -0
  109. package/lib/types/host/agy/pool-types.d.ts +145 -0
  110. package/lib/types/host/agy/pool.d.ts +231 -0
  111. package/lib/types/host/agy/quota.d.ts +352 -0
  112. package/lib/types/host/agy/read-json-body.d.ts +15 -0
  113. package/lib/types/host/agy/recording.d.ts +199 -0
  114. package/lib/types/host/agy/runner.d.ts +192 -0
  115. package/lib/types/host/agy/sessions.d.ts +53 -0
  116. package/lib/types/host/agy/types.d.ts +425 -0
  117. package/lib/types/host/agy/warmup.d.ts +82 -0
  118. package/lib/types/host/agy/wincred.d.ts +35 -0
  119. package/lib/types/host/authority.d.ts +50 -0
  120. package/lib/types/host/bindings.d.ts +30 -0
  121. package/lib/types/host/cache-defaults.d.ts +48 -0
  122. package/lib/types/host/cache-policy.d.ts +165 -0
  123. package/lib/types/host/change-evidence.d.ts +38 -0
  124. package/lib/types/host/compaction-routing.d.ts +15 -0
  125. package/lib/types/host/coordinator.d.ts +222 -0
  126. package/lib/types/host/evidence-page.d.ts +13 -0
  127. package/lib/types/host/history.d.ts +106 -0
  128. package/lib/types/host/http.d.ts +4 -0
  129. package/lib/types/host/model-output.d.ts +13 -0
  130. package/lib/types/host/native-activity.d.ts +26 -0
  131. package/lib/types/host/native-approvals.d.ts +29 -0
  132. package/lib/types/host/native-auxiliary.d.ts +17 -0
  133. package/lib/types/host/native-budget.d.ts +33 -0
  134. package/lib/types/host/native-checks.d.ts +130 -0
  135. package/lib/types/host/native-compaction.d.ts +8 -0
  136. package/lib/types/host/native-context.d.ts +36 -0
  137. package/lib/types/host/native-effects.d.ts +120 -0
  138. package/lib/types/host/native-evidence.d.ts +4 -0
  139. package/lib/types/host/native-exploration.d.ts +15 -0
  140. package/lib/types/host/native-keepalive.d.ts +82 -0
  141. package/lib/types/host/native-model-control.d.ts +124 -0
  142. package/lib/types/host/native-on-demand-context.d.ts +39 -0
  143. package/lib/types/host/native-request.d.ts +5 -0
  144. package/lib/types/host/native-review.d.ts +11 -0
  145. package/lib/types/host/native-role-sandbox.d.ts +57 -0
  146. package/lib/types/host/native-scopes.d.ts +70 -0
  147. package/lib/types/host/native-selection.d.ts +39 -0
  148. package/lib/types/host/native-task-context.d.ts +39 -0
  149. package/lib/types/host/native-usage.d.ts +46 -0
  150. package/lib/types/host/native-worker-brief.d.ts +74 -0
  151. package/lib/types/host/native-worker-notices.d.ts +15 -0
  152. package/lib/types/host/native-worker.d.ts +44 -0
  153. package/lib/types/host/native-workflow.d.ts +41 -0
  154. package/lib/types/host/pairs.d.ts +47 -0
  155. package/lib/types/host/price-settings.d.ts +14 -0
  156. package/lib/types/host/read-tools.d.ts +22 -0
  157. package/lib/types/host/route-transport.d.ts +22 -0
  158. package/lib/types/host/settings.d.ts +58 -0
  159. package/lib/types/host/shell.d.ts +37 -0
  160. package/lib/types/host/status.d.ts +7 -0
  161. package/lib/types/host/subagent-seam.d.ts +11 -0
  162. package/lib/types/host/text-report.d.ts +56 -0
  163. package/lib/types/host/tool-table.d.ts +35 -0
  164. package/lib/types/host/worker-terminal.d.ts +94 -0
  165. package/lib/types/host/workspace-guard.d.ts +13 -0
  166. package/lib/types/host/workspace.d.ts +52 -0
  167. package/lib/types/identity.d.ts +82 -0
  168. package/lib/types/index.d.ts +34 -0
  169. package/lib/types/message-source.d.ts +35 -0
  170. package/lib/types/profile/compactor.d.ts +5 -0
  171. package/lib/types/profile/keepalive.d.ts +3 -0
  172. package/lib/types/profile/resolve.d.ts +17 -0
  173. package/lib/types/prompts.d.ts +8 -0
  174. package/lib/types/recovery/reconcile.d.ts +28 -0
  175. package/lib/types/review/dispatch.d.ts +20 -0
  176. package/lib/types/review/protocol.d.ts +51 -0
  177. package/lib/types/review/ticket.d.ts +32 -0
  178. package/lib/types/status.d.ts +145 -0
  179. package/lib/types/store-migration.d.ts +29 -0
  180. package/lib/types/task/deletion.d.ts +64 -0
  181. package/lib/types/task/reducer.d.ts +6 -0
  182. package/lib/types/task/sqlite-store.d.ts +71 -0
  183. package/lib/types/task/state.d.ts +51 -0
  184. package/lib/types/task/status-index.d.ts +28 -0
  185. package/lib/types/task/store.d.ts +48 -0
  186. package/lib/types/usage/budget.d.ts +27 -0
  187. package/lib/types/usage/cost.d.ts +77 -0
  188. package/lib/types/usage/ledger.d.ts +66 -0
  189. package/lib/types/usage/normalize.d.ts +50 -0
  190. package/lib/types/usage/price-cards.d.ts +65 -0
  191. package/lib/types/usage/pricing.d.ts +18 -0
  192. package/package.json +197 -4
  193. package/profiles/fusion-auto.example.json +45 -0
  194. package/prompts/compact.md +7 -0
  195. package/prompts/lead.md +52 -0
  196. package/prompts/model-lead.md +16 -0
  197. package/prompts/model-worker.md +9 -0
  198. package/prompts/worker.md +25 -0
  199. package/src/activity.ts +78 -0
  200. package/src/approval/logical.ts +44 -0
  201. package/src/benchmark/naive.ts +216 -0
  202. package/src/benchmark/native-run.ts +215 -0
  203. package/src/benchmark/output-limits.ts +33 -0
  204. package/src/bilingual.ts +2 -0
  205. package/src/client/AcpSettingsGuide.tsx +469 -0
  206. package/src/client/ActivityRows.tsx +73 -0
  207. package/src/client/FusionCache.tsx +130 -0
  208. package/src/client/FusionHint.tsx +46 -0
  209. package/src/client/FusionHistory.tsx +260 -0
  210. package/src/client/FusionPanelIcon.tsx +39 -0
  211. package/src/client/FusionPermission.tsx +52 -0
  212. package/src/client/FusionRecovery.tsx +69 -0
  213. package/src/client/FusionSettings.tsx +362 -0
  214. package/src/client/FusionStatus.tsx +138 -0
  215. package/src/client/FusionTool.tsx +66 -0
  216. package/src/client/acp-import.ts +303 -0
  217. package/src/client/activity-model.ts +31 -0
  218. package/src/client/agy/AgyConsole.tsx +2213 -0
  219. package/src/client/agy/brand-icons.ts +43 -0
  220. package/src/client/agy/decisions.ts +344 -0
  221. package/src/client/agy/images.ts +605 -0
  222. package/src/client/agy/locale.ts +75 -0
  223. package/src/client/agy/locales.ts +332 -0
  224. package/src/client/agy/scroll-guard.ts +106 -0
  225. package/src/client/agy/toolview.ts +1903 -0
  226. package/src/client/agy-activity.ts +174 -0
  227. package/src/client/i18n.ts +30 -0
  228. package/src/client/index.ts +89 -0
  229. package/src/client/settings-events.ts +3 -0
  230. package/src/client/status-polling.ts +93 -0
  231. package/src/client/studio-brand.ts +13 -0
  232. package/src/context/guard.ts +81 -0
  233. package/src/context/handoff.ts +28 -0
  234. package/src/contracts.ts +489 -0
  235. package/src/digest.ts +28 -0
  236. package/src/dsh-agent-studio-fusion.ts +480 -0
  237. package/src/dsh-fusion.ts +1 -0
  238. package/src/errors.ts +34 -0
  239. package/src/evidence/gate.ts +290 -0
  240. package/src/evidence/receipts.ts +175 -0
  241. package/src/execution/write-lease.ts +187 -0
  242. package/src/host/acp/adapter.ts +692 -0
  243. package/src/host/acp/agent-process.ts +621 -0
  244. package/src/host/acp/bridge-route.ts +29 -0
  245. package/src/host/acp/bridge.ts +601 -0
  246. package/src/host/acp/chunk-translator.ts +200 -0
  247. package/src/host/acp/config.ts +57 -0
  248. package/src/host/acp/context-windows.ts +89 -0
  249. package/src/host/acp/host.ts +43 -0
  250. package/src/host/acp/index.ts +186 -0
  251. package/src/host/acp/permission.ts +129 -0
  252. package/src/host/acp/prompt-capabilities.ts +112 -0
  253. package/src/host/acp/request-image.ts +68 -0
  254. package/src/host/acp/transcript.ts +200 -0
  255. package/src/host/acp/types.ts +58 -0
  256. package/src/host/agy/adapter.ts +2790 -0
  257. package/src/host/agy/agy-db.ts +682 -0
  258. package/src/host/agy/agy-log.ts +81 -0
  259. package/src/host/agy/agy-usage.ts +253 -0
  260. package/src/host/agy/ask-tool.ts +141 -0
  261. package/src/host/agy/atomic-write.ts +35 -0
  262. package/src/host/agy/auth.ts +267 -0
  263. package/src/host/agy/auto-updater.ts +127 -0
  264. package/src/host/agy/bridge.mjs +138 -0
  265. package/src/host/agy/commands.ts +628 -0
  266. package/src/host/agy/config.ts +261 -0
  267. package/src/host/agy/credential-slot.ts +1326 -0
  268. package/src/host/agy/diagnostics.ts +118 -0
  269. package/src/host/agy/discovery.ts +71 -0
  270. package/src/host/agy/dsh-goal.ts +248 -0
  271. package/src/host/agy/index.ts +1279 -0
  272. package/src/host/agy/mapper.ts +593 -0
  273. package/src/host/agy/mcp-bridge.ts +450 -0
  274. package/src/host/agy/media-route.ts +247 -0
  275. package/src/host/agy/media.ts +163 -0
  276. package/src/host/agy/mirror-tool.ts +756 -0
  277. package/src/host/agy/models.ts +404 -0
  278. package/src/host/agy/net.ts +54 -0
  279. package/src/host/agy/oauth.ts +366 -0
  280. package/src/host/agy/oneshot.ts +198 -0
  281. package/src/host/agy/parser.ts +330 -0
  282. package/src/host/agy/pool-auth.ts +304 -0
  283. package/src/host/agy/pool-types.ts +204 -0
  284. package/src/host/agy/pool.ts +1050 -0
  285. package/src/host/agy/quota.ts +1420 -0
  286. package/src/host/agy/read-json-body.ts +70 -0
  287. package/src/host/agy/recording.ts +447 -0
  288. package/src/host/agy/runner.ts +830 -0
  289. package/src/host/agy/sessions.ts +153 -0
  290. package/src/host/agy/types.ts +657 -0
  291. package/src/host/agy/warmup.ts +614 -0
  292. package/src/host/agy/wincred.ts +354 -0
  293. package/src/host/authority.ts +231 -0
  294. package/src/host/bindings.ts +91 -0
  295. package/src/host/cache-defaults.ts +103 -0
  296. package/src/host/cache-policy.ts +180 -0
  297. package/src/host/change-evidence.ts +156 -0
  298. package/src/host/compaction-routing.ts +46 -0
  299. package/src/host/coordinator.ts +2675 -0
  300. package/src/host/evidence-page.ts +25 -0
  301. package/src/host/history.ts +180 -0
  302. package/src/host/http.ts +30 -0
  303. package/src/host/model-output.ts +22 -0
  304. package/src/host/native-activity.ts +205 -0
  305. package/src/host/native-approvals.ts +196 -0
  306. package/src/host/native-auxiliary.ts +19 -0
  307. package/src/host/native-budget.ts +112 -0
  308. package/src/host/native-checks.ts +562 -0
  309. package/src/host/native-compaction.ts +34 -0
  310. package/src/host/native-context.ts +204 -0
  311. package/src/host/native-effects.ts +379 -0
  312. package/src/host/native-evidence.ts +31 -0
  313. package/src/host/native-exploration.ts +114 -0
  314. package/src/host/native-keepalive.ts +292 -0
  315. package/src/host/native-model-control.ts +343 -0
  316. package/src/host/native-on-demand-context.ts +74 -0
  317. package/src/host/native-request.ts +12 -0
  318. package/src/host/native-review.ts +51 -0
  319. package/src/host/native-role-sandbox.ts +183 -0
  320. package/src/host/native-scopes.ts +255 -0
  321. package/src/host/native-selection.ts +154 -0
  322. package/src/host/native-task-context.ts +264 -0
  323. package/src/host/native-usage.ts +121 -0
  324. package/src/host/native-worker-brief.ts +135 -0
  325. package/src/host/native-worker-notices.ts +72 -0
  326. package/src/host/native-worker.ts +215 -0
  327. package/src/host/native-workflow.ts +103 -0
  328. package/src/host/pairs.ts +180 -0
  329. package/src/host/price-settings.ts +27 -0
  330. package/src/host/read-tools.ts +34 -0
  331. package/src/host/route-transport.ts +54 -0
  332. package/src/host/settings.ts +126 -0
  333. package/src/host/shell.ts +42 -0
  334. package/src/host/status.ts +181 -0
  335. package/src/host/subagent-seam.ts +21 -0
  336. package/src/host/text-report.ts +124 -0
  337. package/src/host/tool-table.ts +56 -0
  338. package/src/host/worker-terminal.ts +145 -0
  339. package/src/host/workspace-guard.ts +17 -0
  340. package/src/host/workspace.ts +184 -0
  341. package/src/identity.ts +117 -0
  342. package/src/index.ts +50 -0
  343. package/src/message-source.ts +33 -0
  344. package/src/profile/compactor.ts +26 -0
  345. package/src/profile/keepalive.ts +13 -0
  346. package/src/profile/resolve.ts +131 -0
  347. package/src/prompts.ts +32 -0
  348. package/src/recovery/reconcile.ts +38 -0
  349. package/src/review/dispatch.ts +48 -0
  350. package/src/review/protocol.ts +212 -0
  351. package/src/review/ticket.ts +166 -0
  352. package/src/status.ts +113 -0
  353. package/src/store-migration.ts +65 -0
  354. package/src/task/deletion.ts +105 -0
  355. package/src/task/reducer.ts +684 -0
  356. package/src/task/sqlite-store.ts +386 -0
  357. package/src/task/state.ts +72 -0
  358. package/src/task/status-index.ts +198 -0
  359. package/src/task/store.ts +287 -0
  360. package/src/usage/budget.ts +88 -0
  361. package/src/usage/cost.ts +194 -0
  362. package/src/usage/ledger.ts +218 -0
  363. package/src/usage/normalize.ts +308 -0
  364. package/src/usage/price-cards.ts +122 -0
  365. package/src/usage/pricing.ts +95 -0
package/INSTALL.md ADDED
@@ -0,0 +1,72 @@
1
+ # Install DSH Agent Studio
2
+
3
+ [中文](INSTALL.zh.md) · Product pages: [README.md](README.md) (中文), [README.en.md](README.en.md)
4
+
5
+ Requires **DeepSeek Harness `>=0.2.1-rc.5 <0.3.0-0`** on **Node 24 or newer**. Other versions are not supported;
6
+ the 0.2.0 series is no longer supported.
7
+
8
+ > Published as `@sqdr2/dsh-agent-studio-fusion`, with plugin id `dsh-agent-studio-fusion`.
9
+ > Any existing data from `dsh-fusion` or `dsh-model-fusion` is migrated automatically on first start.
10
+
11
+ ## From npm (recommended)
12
+
13
+ ```sh
14
+ dsh plugin --profile web add @sqdr2/dsh-agent-studio-fusion
15
+ ```
16
+
17
+ ## From GitHub
18
+
19
+ The repository ships the built `lib/`, so nothing is compiled locally.
20
+
21
+ ```sh
22
+ dsh plugin --profile web add github:SQDR2/dsh-agent-studio-fusion
23
+ ```
24
+
25
+ If `dsh` is not on PATH, pin one supported CLI:
26
+
27
+ ```sh
28
+ npx @deepseek-ai/dsh@0.2.1-rc.5 plugin --profile web add @sqdr2/dsh-agent-studio-fusion
29
+ ```
30
+
31
+ This writes only the `web` profile. Reopen a running Web Host once and reload the page.
32
+
33
+ ## From a local checkout (development)
34
+
35
+ ```sh
36
+ git clone https://github.com/SQDR2/dsh-agent-studio-fusion.git ~/github/dsh-agent-studio-fusion
37
+ cd ~/github/dsh-agent-studio-fusion && corepack pnpm@9.15.9 install --frozen-lockfile && cd -
38
+ dsh plugin --profile web add ~/github/dsh-agent-studio-fusion
39
+ ```
40
+
41
+ ## DSH Studio desktop app
42
+
43
+ Click **Plugins** in the left sidebar → **Add plugin**, and enter in "Package name or address":
44
+
45
+ ```text
46
+ @sqdr2/dsh-agent-studio-fusion
47
+ ```
48
+
49
+ `github:SQDR2/dsh-agent-studio-fusion` works there too. Then quit and reopen DSH Studio (plugins take effect at the next start).
50
+
51
+ ## Upgrading from earlier packages
52
+
53
+ 1. Remove previous packages to avoid conflicts:
54
+
55
+ ```sh
56
+ dsh plugin --profile web remove @sqdr2/dsh-fusion
57
+ dsh plugin --profile web remove dsh-model-fusion
58
+ ```
59
+
60
+ 2. Install `@sqdr2/dsh-agent-studio-fusion` as shown above. Do **not** delete the data directory:
61
+ all ledger, tasks and state will migrate into `$DSH_HOME/plugins/dsh-agent-studio-fusion/` automatically.
62
+ 3. If you had standalone `dsh-agy-worker` installed, remove it:
63
+ ```sh
64
+ dsh plugin --profile web remove @sqdr2/dsh-agy-worker
65
+ ```
66
+ 4. Restart DSH.
67
+
68
+ ## Uninstall
69
+
70
+ ```sh
71
+ dsh plugin --profile web remove @sqdr2/dsh-agent-studio-fusion
72
+ ```
package/INSTALL.zh.md ADDED
@@ -0,0 +1,73 @@
1
+ # 安装 DSH Agent Studio
2
+
3
+ [English](INSTALL.md) · 产品介绍:[README.md](README.md)(中文)、[README.en.md](README.en.md)
4
+
5
+ 需要 **DeepSeek Harness `>=0.2.1-rc.5 <0.3.0-0`**,并需要 **Node 24 或更新版本**。其他版本不支持;0.2.0 系列已不再支持。
6
+
7
+ > 包名 `@sqdr2/dsh-agent-studio-fusion`,插件 id 为 `dsh-agent-studio-fusion`。
8
+ > 旧的 `dsh-fusion` 或 `dsh-model-fusion` 数据会在首次启动时自动迁移。
9
+
10
+ ## 从 npm 安装(推荐)
11
+
12
+ ```sh
13
+ dsh plugin --profile web add @sqdr2/dsh-agent-studio-fusion
14
+ ```
15
+
16
+ ## 从 GitHub 安装
17
+
18
+ 仓库里带着构建好的 `lib/`,不需要自己编译。
19
+
20
+ ```sh
21
+ dsh plugin --profile web add github:SQDR2/dsh-agent-studio-fusion
22
+ ```
23
+
24
+ `dsh` 不在 PATH 里时,指定一个受支持的 CLI:
25
+
26
+ ```sh
27
+ npx @deepseek-ai/dsh@0.2.1-rc.5 plugin --profile web add @sqdr2/dsh-agent-studio-fusion
28
+ ```
29
+
30
+ 这只会写入 `web` 配置。正在运行的 Web 服务需要重新打开一次,再刷新页面。
31
+
32
+ ## 从本地目录安装(开发用)
33
+
34
+ ```sh
35
+ git clone https://github.com/SQDR2/dsh-agent-studio-fusion.git ~/github/dsh-agent-studio-fusion
36
+ cd ~/github/dsh-agent-studio-fusion && corepack pnpm@9.15.9 install --frozen-lockfile && cd -
37
+ dsh plugin --profile web add ~/github/dsh-agent-studio-fusion
38
+ ```
39
+
40
+ ## DSH Studio 桌面版
41
+
42
+ 点左侧栏的 **插件** → **添加插件**,在"包名或地址"里填:
43
+
44
+ ```text
45
+ @sqdr2/dsh-agent-studio-fusion
46
+ ```
47
+
48
+ 也可以填 `github:SQDR2/dsh-agent-studio-fusion`。装好后退出并重新打开 DSH Studio(插件在下次启动时生效)。
49
+
50
+ ## 从旧版本迁移
51
+
52
+ 1. 先卸载旧包,避免多个包同时注册插件入口:
53
+
54
+ ```sh
55
+ dsh plugin --profile web remove @sqdr2/dsh-fusion
56
+ dsh plugin --profile web remove dsh-model-fusion
57
+ ```
58
+
59
+ 2. 按上面的方式安装 `@sqdr2/dsh-agent-studio-fusion`。**不要**先手动删除旧数据目录:
60
+ `$DSH_HOME/plugins/dsh-fusion/` 或 `dsh-model-fusion/` 里的任务、用量和设置会在首次启动时整体迁移到
61
+ `$DSH_HOME/plugins/dsh-agent-studio-fusion/`。
62
+ 3. 如果之前单独装过 `dsh-agy-worker`,也予以卸载(功能已完全内置):
63
+ ```sh
64
+ dsh plugin --profile web remove @sqdr2/dsh-agy-worker
65
+ ```
66
+ 4. 重启 DSH(桌面版退出后重开,Web 版重开服务并刷新页面)。
67
+ 5. 已有的会话不用改:模型菜单里的选项会自动兼容指向新的线路。
68
+
69
+ ## 卸载
70
+
71
+ ```sh
72
+ dsh plugin --profile web remove @sqdr2/dsh-agent-studio-fusion
73
+ ```
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.en.md ADDED
@@ -0,0 +1,207 @@
1
+ # DSH Agent Studio With Fusion
2
+
3
+ [中文](README.md) · [Install](INSTALL.md) · [Changelog](CHANGELOG.md) · [Doc index](#doc-index)
4
+
5
+ <img src="assets/icon.svg" width="72" alt="">
6
+
7
+ **The expensive model only thinks; the cheap model does the work — as one plugin, and as an ordinary model in DSH.**
8
+
9
+ After installing, the left sidebar has a **Fusion** entry whose page holds three sections: **Fusion combos**, **Antigravity** (the `agy` CLI) and **ACP routes**. No `dsh-agy-worker`, no `dsh-tauri-acp`, no companion package.
10
+
11
+ | | |
12
+ |---|---|
13
+ | Package | `@sqdr2/dsh-agent-studio-fusion` |
14
+ | Plugin id | `dsh-agent-studio-fusion` (config row, state directory and log marker) |
15
+ | Provider route | `dsh-fusion`, shown in the model menu as **Fusion · combo name** |
16
+ | Requirements | DSH `>=0.2.1-rc.5 <0.3.0-0`, Node 24+ |
17
+
18
+ ## What it solves
19
+
20
+ Behind every **Fusion combo** are two models you choose:
21
+
22
+ - **Lead**: a strong frontier model. It reads the request and the code, briefs the work, reviews the result and sends it back. It **does not write code** — it has no file-writing tools, and its shell commands run in DSH's read-only sandbox. The program enforces that, not the prompt.
23
+ - **Sidekick**: a much cheaper model. It edits files, runs commands, runs tests and reports back.
24
+ - **One goal**: frontier-model results at a discount. The saving comes from the price gap — the Sidekick must cost far less than the Lead (ideally 5× or more). The closer their prices, the smaller the saving.
25
+
26
+ Inspired by Fusion in Cognition's Devin. This is an independent implementation, not affiliated with Cognition.
27
+
28
+ ## Measured
29
+
30
+ Nine real open-source issues (SWE-rebench, Python), two runs each, graded by hidden tests. Lead GPT-6 Astra (high), Sidekick GLM-5.3-Flash (high):
31
+
32
+ | | Solved | Total cost (API list prices) |
33
+ |---|---|---|
34
+ | GPT-6 Astra alone | 9/18 | $39.17 |
35
+ | **Fusion: Astra + GLM-5.3-Flash** | **11/18** | **$18.07 (54% less)** |
36
+ | Fusion: Astra + Grok 4.6 | 13/18 | $41.27 (no saving) |
37
+
38
+ Against Devin's own Fusion — the same pair (Lead GPT-6 Astra, Sidekick SWE-2), the same tasks, workspaces and hidden tests. After contaminated attempts were excluded, four tasks were clean in every condition: **this plugin 4/4, $2.73**; Devin Fusion 3/4, $4.81; Devin with Astra alone 3/4, $8.13. This plugin took about 3.4× Devin's wall time.
39
+
40
+ The samples are small (4 tasks × 1 run; 9 tasks × 2 in the other round), Python only, and public issues may be in training data — so this is **not** a ranking, and not a parity claim. Method, raw data, per-round conclusions and the excluded attempts: **[docs/EVIDENCE.md](docs/EVIDENCE.md)**.
41
+
42
+ ## Use
43
+
44
+ ```sh
45
+ dsh plugin --profile web add @sqdr2/dsh-agent-studio-fusion
46
+ ```
47
+
48
+ Installing straight from GitHub works too (the repository ships a built `lib/`): `dsh plugin --profile web add github:SQDR2/dsh-agent-studio-fusion`. Desktop-app install, local-directory install, uninstall and migration from older packages: **[INSTALL.md](INSTALL.md)**.
49
+
50
+ 1. Open **Fusion** in the left sidebar (default below Memory System).
51
+ 2. In **Fusion combos**, name the combo and choose a Lead and a Sidekick. Any model you are signed in to works, including a configured Antigravity or ACP route.
52
+ 3. Pick **Fusion · combo name** in the model menu and work as usual.
53
+ 4. Fusion's chip near the composer names the role working right now: `Lead · Read Only` / `Sidekick · Full access`.
54
+
55
+ **Up to 6 combos** can coexist — a cheap "fast" one and a strong "thorough" one, each its own model-menu entry. With several conversations open, each can pick a different combo; a conversation freezes the combo it picked, so later edits or other conversations never change it. A pre-combo installation is migrated into one combo named "自动" whose model id stays `auto`, so existing conversations keep working.
56
+
57
+ The composer's permission control reads `Custom` once a task is dispatched: the Lead's session is pinned to read-only, and "read-only plus your approval policy" usually matches no configured preset. That control still sets the **Sidekick's** permission — change it and the Sidekick's next step uses that mode, while the Lead stays read-only. If you would rather it read a name instead of `Custom`, add a preset to your profile's `presets` with `sandbox: read-only` and `approval: never` — pure configuration, this plugin does not depend on it.
58
+
59
+ ## How one task runs
60
+
61
+ 1. The Lead decides code must change and hands the work to the Sidekick. The brief carries the user's own words and the acceptance commands.
62
+ 2. The Sidekick reports; DSH runs the acceptance commands in the real workspace.
63
+ 3. The Lead reviews each of the user's hard requirements and must give a verdict with evidence for every one — a missing verdict blocks acceptance. If the Sidekick rewrote an existing test, that is flagged and needs the Lead's confirmation.
64
+ 4. A rejection goes back to the same Sidekick with the concrete problem. When the allowed files turn out too narrow (say another test file still encodes the old behaviour), the Lead may only **add** paths during rework, never remove them, and every addition is recorded.
65
+ 5. Tests that were already failing (a missing optional dependency, for instance) can be marked "no new failures".
66
+ 6. **The one exception**: a takeover the Host unlocks only when the Sidekick demonstrably cannot finish (still failing after 2 rework rounds, step limit reached, repeated stalls). The Lead may then change only the files the task allows, must pass the same acceptance, and returns to read-only afterwards.
67
+ 7. Quota or provider errors are handled per role: switch a model or schedule a continuation, with progress kept.
68
+
69
+ ## The three routes
70
+
71
+ ### Fusion combos
72
+
73
+ The Lead/Sidekick pair above. Either side can be a built-in DSH route, a subscription route, Antigravity or an ACP route.
74
+
75
+ ### Antigravity (the `agy` CLI, built in)
76
+
77
+ Built in as of 1.0.0, ported from [`dsh-agy-worker`](https://github.com/SQDR2/dsh-agy-worker) 0.6.3 (MIT, see [docs/ATTRIBUTION-AGY.md](docs/ATTRIBUTION-AGY.md)): the `antigravity` route, the `/agy` command family, `agy_ask` / `agy_tool`, the `/plugins/agy-worker/*` surface, and the account pool with quota tracking. The console lives in the page's **Antigravity** section; `/agy status | pool | models | doctor` answers the same questions from the composer.
78
+
79
+ With this route as the Sidekick, **three conditions must hold at once**; each fails silently on its own:
80
+
81
+ | Condition | What it buys | Without it |
82
+ |---|---|---|
83
+ | `mcpBridge: true` | agy must be able to **execute** DSH tools | tools are listed but never run |
84
+ | `permissionMode: 'skip'` | headless mode cannot prompt for the MCP permission | agy aborts: `a tool required the "mcp" permission that headless mode cannot prompt for` |
85
+ | the allowlist admits `fusion_*` | the Sidekick must **report back** | it diagnoses but never submits |
86
+
87
+ You do not write the `agy_tool` transport yourself: when the `antigravity` route is registered, this plugin unions it into both the Lead's and the Sidekick's tool surface (`src/host/route-transport.ts`).
88
+
89
+ ```yaml
90
+ - id: dsh-agent-studio-fusion
91
+ config:
92
+ agy:
93
+ mcpBridge: true
94
+ permissionMode: skip
95
+ mcpConfigScope: global
96
+ mcpToolAllowlist: "fusion_submit_result,fusion_read_state,fusion_read_evidence,bash,read,write,edit,glob,grep,job_output,job_kill"
97
+ ```
98
+
99
+ Every key from the old `dsh-agy-worker` (`enabled`, `agyBin`, `workspaceRoot`, `defaultModel`, `hiddenModels`, `quotaPollIntervalMs`, `autoWarmup`, …) works verbatim inside that `agy` block, and `DSH_AGY_*` environment variables still win. `enabled: false` is an **install-time** switch: it removes the `antigravity` route and every background capability (quota polling, warmup, the MCP bridge, the media sweep) while leaving `/agy` and the management routes mounted for inspection; re-enabling means changing the block and restarting DSH, not a live toggle.
100
+
101
+ > On Windows use `pwsh` instead of `bash`, and follow any change to `workerTools`. Before enabling this, **first** disable or remove `dsh-agy-worker`: both use the same route prefix, the same `antigravity` provider, the same `/agy` command and the same tool-card keys, so running both fails at load (`duplicate exact route`, `DUPLICATE_ADAPTER`, `already registered`). Steps, the config move and the one manual account-pool copy: [docs/MIGRATION-AGY.md](docs/MIGRATION-AGY.md).
102
+
103
+ ### ACP routes (the built-in `deepseek-harness-acp` port)
104
+
105
+ The Host implementation is merged here under the MIT license ([docs/ATTRIBUTION-ACP.md](docs/ATTRIBUTION-ACP.md)), so a separate `dsh-tauri-acp` install is **no longer needed**. The page's **ACP routes** section has a minimal example, the restart requirement and the migration steps; each key is the provider route shown in the model picker:
106
+
107
+ ```yaml
108
+ - id: dsh-agent-studio-fusion
109
+ config:
110
+ acp:
111
+ agents:
112
+ codex:
113
+ displayName: Codex (ACP)
114
+ command: /absolute/path/to/codex-acp # required; absolute is more reliable, PATH also works
115
+ args: []
116
+ models: # may be omitted entirely; then discoverModels asks
117
+ - id: default
118
+ permission: ask
119
+ ```
120
+
121
+ Routes are read once when the Host starts, so a change needs a restart. If you still have the standalone `dsh-tauri-acp`, **disable it manually first** and then move the same provider here — registering it twice fails at load ([docs/MIGRATION-ACP.md](docs/MIGRATION-ACP.md)).
122
+
123
+ When an ACP route is the Sidekick, this plugin declares a Host-tool MCP bridge in that session's ACP `session/new` and nowhere else: this Host's own public origin plus the fixed `/api/fusion/acp-mcp` path, with 32 random bytes carried **only** in the `Authorization: Bearer` header (never in the URL). Requests are trusted against that origin — `Host` must match, a present `Origin` must equal it, a cross-site request is refused, the peer must be this machine — and no forwarding header is consulted. The token is bound to this task's Worker session, the current work order and its revision, the brief revision, the implement/explore mode, this route's provider *and* model, and the configured `workerTools`; every call re-checks all of it. It is revoked, with in-flight calls aborted, on pause, rework, recovery, completion, a pending approval, a budget block, a submitted report, runtime shutdown, a config change, a session replacement, abort or timeout. Only `workerTools` ∩ the Agent's own visible tools are exposed (an explore order additionally intersects the read-only tools, so the ceiling can only narrow), and every call dispatches through DSH's `tools.guard`, approvals and Fusion's path/lease checks. A Lead ACP session, an ordinary route call, model discovery and compaction requests, a text order, and any other Fusion task all open with an empty `mcpServers` list.
124
+
125
+ ### Other agent routes
126
+
127
+ The `mcpBridge` / `permissionMode` / `agy_tool` trio above is **agy-only**, because that route is wired by this plugin's bridge layer. A different adapter (anything that is not this plugin's built-in ACP routes) may open its session with no MCP server at all, and **no Fusion setting can make it call Fusion's tools**. For text-only questions on such a route, Fusion accepts a strictly bounded text report instead (`fusionTextReport`, bound to the current `workOrderId` + `revision`, same fields as `fusion_submit_result`; prose, another order, another revision and extra fields are all refused, and the Lead still reviews it). Work that needs files or commands still requires real tool calls. See [docs/WORKER-TOOLS-UNREACHABLE.md](docs/WORKER-TOOLS-UNREACHABLE.md).
128
+
129
+ ## Cache keepalive
130
+
131
+ While the Lead waits for the Sidekick, often for several minutes, the prompt cache can expire and the next request re-reads the whole conversation at full price. Keepalive resends the Lead's previous request at intervals with only `Reply OK` appended. The prefix is identical, so the provider serves it from cache and the cache lifetime is renewed; the model answers with 5 tokens, and the reply is discarded — it never enters the conversation and runs no tool call.
132
+
133
+ - **Defaults** come from each provider's documentation, covering the vendors of the Artificial Analysis top 20, matched by model name (`gpt-*`, `claude-*`, `gemini-*`, `glm-*`, `grok-*`, `kimi-*`, `deepseek-*`, …). Plans billed per request — the [dsh-oauth-login](https://github.com/aa2246740/dsh-oauth-login) routes — default to off, since every ping counts as a request.
134
+ - **Auto start**: pings begin only after the model has actually reported cache hits, so a model without caching never pays for them.
135
+ - Every model is adjustable in the Fusion panel: on/off, interval, reset to default. The panel also shows the observed effect — whether the cache survived the wait, how many pings were sent, how many tokens they read, and how many tokens were kept from being resent at full price.
136
+ - **Measured** (ChatGPT subscription route, gpt-6-astra, ~20k-token context): the cache was still there after 10 idle minutes and gone after 15, and every ping restarts that clock, so this route defaults to one every 8 minutes.
137
+ - **Automatic adjustment**: the interval shortens only when 3 of the last 5 pings at it missed (an occasional random eviction does not count). It never lengthens on its own; when a wider interval looks safe, the page suggests it and you decide.
138
+
139
+ ## Support
140
+
141
+ | | |
142
+ |---|---|
143
+ | DSH | `>=0.2.1-rc.5 <0.3.0-0`, desktop app or Web; the 0.2.0 series is no longer supported |
144
+ | Node | 24 or newer (`engines.node` is `>=24.0.0`) |
145
+ | Models | Built-in DSH routes, the subscription routes of [dsh-oauth-login](https://github.com/aa2246740/dsh-oauth-login) and dsh-antigravity-oauth, and the built-in Antigravity route; other third-party model plugins are untested |
146
+ | macOS | Verified (Seatbelt sandbox) |
147
+ | Windows | Native `pwsh` since `v0.2.1`, verified on Windows Server 2022 / PowerShell 7.6.6; Windows 10/11 unverified. ACL enforcement is partial: it restricts ordinary file writes, but not reads or networking |
148
+ | Linux | Unverified |
149
+
150
+ <details>
151
+ <summary>Self-check on Linux</summary>
152
+
153
+ 1. In a test folder, select Fusion and say: "This is a read-only sandbox test; a refusal is expected. Call the bash tool yourself with `echo test > fusion-probe.txt` (don't delegate, don't rewrite it) and paste the tool's raw output."
154
+ 2. Expected: the output says the sandbox denied it (for example `Operation not permitted` / `read-only`), and no `fusion-probe.txt` appears. If the Lead only declines in words without calling the tool, the check doesn't count — ask it again to actually call the tool.
155
+ 3. If the file is created, the Lead's read-only limit does not work on your system: don't use Fusion there, and please report it.
156
+
157
+ Where DSH has no sandbox at all, every Lead shell command is refused (it fails safe); the Lead still reads code with its file and search tools.
158
+
159
+ </details>
160
+
161
+ ## Where the data lives
162
+
163
+ - **Fusion's own records**: briefs, check results, usage, cache statistics and settings in `$DSH_HOME/plugins/dsh-agent-studio-fusion/state.sqlite` (`DSH_HOME` defaults to `~/.dsh`).
164
+ - **Upgrading from an older name**: the `dsh-fusion`, `dsh-model-fusion` and `dsh-agent-studio` directories are **migrated** wholesale on first start, so existing tasks, usage and settings survive. Across filesystems it falls back to copying the database plus its `-wal`/`-shm`/`-journal`, removing only the files it copied.
165
+ - **Built-in Antigravity**: work state stays where the standalone plugin kept it — runtime overrides, session bindings, media cache and warmup history in `$DSH_HOME/agy-worker/`. The account pool is this plugin's `$DSH_HOME/agy-accounts/pool.json`, with each isolated account HOME at `$DSH_HOME/agy-accounts/<id>/`; upstream read that pool from `DSH_STATE_DIR`, so only an installation that set it needs the one-time copy in [docs/MIGRATION-AGY.md](docs/MIGRATION-AGY.md). Nothing moves automatically and uninstalling this package deletes neither directory.
166
+ - **The conversations themselves** are stored by DSH; Fusion uploads nothing else. To clear its records, quit DSH and delete that sqlite file — settings go with it.
167
+
168
+ ## Known limits
169
+
170
+ - **Slower than the frontier model alone**: GPT-6 + Flash took about 5× the time of GPT-6 alone, mostly spent in the Sidekick. A faster Sidekick helps a lot.
171
+ - **Lead takeover**: never triggered in 72 measured runs; only automated tests cover it.
172
+ - **PATH in the macOS desktop app**: DSH Studio opened from the Dock gets only the system PATH, so `node`, `npm`, `cargo` and other tools installed by Homebrew (`/opt/homebrew/bin`), nvm and similar are not found by the shell. This is DSH's environment and affects every model. Before handing off work, Fusion checks the programs the acceptance commands use; when one is missing it tells the Lead where it is installed (for example `/opt/homebrew/bin/node`), and the Lead retries with the full path.
173
+ - **Windows 10/11 and Linux unverified**: see the table above.
174
+
175
+ ## Development
176
+
177
+ ```sh
178
+ corepack pnpm@9.15.9 install --frozen-lockfile
179
+ node scripts/link-host.mjs /path/to/deepseek-harness-0.2.1-rc.5 # the supported baseline; link DSH sources while developing
180
+ DSHX_HARNESS=/path/to/deepseek-harness-0.2.1-rc.5 pnpm build
181
+ pnpm test && DSHX_HARNESS=/path/to/deepseek-harness-0.2.1-rc.5 pnpm test:host
182
+ ```
183
+
184
+ On Windows, put PowerShell 7 (`pwsh`), Node and Python on the test process PATH. Native tests use `DSHX_HARNESS` to read the built, pinned Host checkout; no Host source changes are needed.
185
+
186
+ `lib/` is a build artifact committed with the source (`lib/dsh-agent-studio-fusion.js`, `lib/client.js`, `lib/bridge.mjs`, `lib/assets/mermaid.min.js`, `lib/types/**`), so a change under `src/` needs `pnpm build` and the rebuilt `lib/` in the same commit. The plugin uses only DSH's public plugin APIs and never modifies DSH itself; adapting to a new DSH release is described in [docs/COMPATIBILITY.md](docs/COMPATIBILITY.md). Cutting a release (bump the version, rebuild `lib/`, push a tag, let CI publish over OIDC): [RELEASING.md](RELEASING.md).
187
+
188
+ ## Doc index
189
+
190
+ | Document | Contents |
191
+ |---|---|
192
+ | [INSTALL.md](INSTALL.md) | Install, uninstall, migrating from older packages |
193
+ | [CHANGELOG.md](CHANGELOG.md) | What each release changed, validated, and did **not** validate |
194
+ | [docs/EVIDENCE.md](docs/EVIDENCE.md) | Measurement method, raw data, excluded attempts |
195
+ | [docs/COMPATIBILITY.md](docs/COMPATIBILITY.md) | The DSH interfaces this depends on, and the upgrade procedure |
196
+ | [docs/WORKER-TOOLS-UNREACHABLE.md](docs/WORKER-TOOLS-UNREACHABLE.md) | Diagnosing a Sidekick that cannot reach tools, and the text-report fallback |
197
+ | [docs/MIGRATION-AGY.md](docs/MIGRATION-AGY.md) | Moving from `dsh-agy-worker` to the built-in Antigravity |
198
+ | [docs/MIGRATION-ACP.md](docs/MIGRATION-ACP.md) | Moving from `dsh-tauri-acp` to the built-in ACP routes |
199
+ | [docs/ATTRIBUTION-AGY.md](docs/ATTRIBUTION-AGY.md) · [docs/ATTRIBUTION-ACP.md](docs/ATTRIBUTION-ACP.md) | Origin, changes and license of the merged code |
200
+ | [docs/DEVIN-LOCAL-FUSION.md](docs/DEVIN-LOCAL-FUSION.md) | Binary forensics of Devin CLI's Fusion, compared point by point with this project |
201
+ | [RELEASING.md](RELEASING.md) | Release procedure |
202
+
203
+ ## License
204
+
205
+ Apache-2.0. Forked from [`aa2246740/dsh-model-fusion`](https://github.com/aa2246740/dsh-model-fusion), also under Apache-2.0.
206
+
207
+ Merged third-party work keeps its own license: the ACP provider port is MIT ([docs/ATTRIBUTION-ACP.md](docs/ATTRIBUTION-ACP.md)), and the built-in Antigravity (agy) capability is MIT, ported from [`SQDR2/dsh-agy-worker`](https://github.com/SQDR2/dsh-agy-worker) (itself a fork of [`amlyczz/dsh-agy-link`](https://github.com/amlyczz/dsh-agy-link)) — see [docs/ATTRIBUTION-AGY.md](docs/ATTRIBUTION-AGY.md), which also lists the licenses of the libraries bundled in `mermaid.min.js`.