@skaile/workspaces 5.16.0 → 5.18.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 (369) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/app-sdk/index.js +1 -1
  3. package/dist/{asset-feeds-BELBSJEE.js → asset-feeds-WAKBHGEV.js} +21 -21
  4. package/dist/{asset-feeds-BELBSJEE.js.map → asset-feeds-WAKBHGEV.js.map} +1 -1
  5. package/dist/asset-manager/catalog-deployer.js +8 -8
  6. package/dist/asset-manager/index.js +18 -14
  7. package/dist/asset-manager/installer.js +10 -10
  8. package/dist/asset-manager/renderers.js +9 -9
  9. package/dist/asset-manager/src/index.d.ts +122 -5
  10. package/dist/asset-manager/src/index.d.ts.map +1 -1
  11. package/dist/asset-manager/src/installer.d.ts +13 -10
  12. package/dist/asset-manager/src/installer.d.ts.map +1 -1
  13. package/dist/asset-manager/src/mcp-config.d.ts +61 -1
  14. package/dist/asset-manager/src/mcp-config.d.ts.map +1 -1
  15. package/dist/asset-manager/src/renderers.d.ts.map +1 -1
  16. package/dist/bridge/drivers/claude-sdk.js +287 -104
  17. package/dist/bridge/drivers/claude-sdk.js.map +1 -1
  18. package/dist/bridge/drivers/codex.js +12 -12
  19. package/dist/bridge/drivers/continue.js +11 -11
  20. package/dist/bridge/drivers/echo.js +4 -4
  21. package/dist/bridge/drivers/gemini.js +7 -7
  22. package/dist/bridge/drivers/goose.js +11 -11
  23. package/dist/bridge/drivers/omp.js +34 -8
  24. package/dist/bridge/drivers/omp.js.map +1 -1
  25. package/dist/bridge/drivers/opencode.js +11 -11
  26. package/dist/bridge/drivers/qwen.js +7 -7
  27. package/dist/bridge/index.js +16 -16
  28. package/dist/bridge/src/driver-model-check.d.ts +8 -8
  29. package/dist/bridge/src/driver-model-check.d.ts.map +1 -1
  30. package/dist/bridge/src/drivers/claude-sdk.d.ts +74 -20
  31. package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
  32. package/dist/bridge/src/drivers/claude-self-turns.d.ts +25 -6
  33. package/dist/bridge/src/drivers/claude-self-turns.d.ts.map +1 -1
  34. package/dist/bridge/src/drivers/omp-models-yml.d.ts +5 -0
  35. package/dist/bridge/src/drivers/omp-models-yml.d.ts.map +1 -1
  36. package/dist/bridge/src/drivers/omp.d.ts.map +1 -1
  37. package/dist/bridge/src/drivers/sanitize-assistant-text.d.ts +10 -0
  38. package/dist/bridge/src/drivers/sanitize-assistant-text.d.ts.map +1 -1
  39. package/dist/bridge/src/drivers/scrub-transcript.d.ts +20 -0
  40. package/dist/bridge/src/drivers/scrub-transcript.d.ts.map +1 -1
  41. package/dist/bridge/src/index.d.ts +1 -1
  42. package/dist/bridge/src/index.d.ts.map +1 -1
  43. package/dist/{chunk-FWAJUWXQ.js → chunk-24AXETE3.js} +55 -17
  44. package/dist/chunk-24AXETE3.js.map +1 -0
  45. package/dist/{chunk-ZVZTCDUN.js → chunk-2NOLF7B2.js} +37 -9
  46. package/dist/chunk-2NOLF7B2.js.map +1 -0
  47. package/dist/{chunk-NSNM2ZXF.js → chunk-3KMREAR2.js} +45 -5
  48. package/dist/chunk-3KMREAR2.js.map +1 -0
  49. package/dist/{chunk-D54T2F54.js → chunk-5TBFN46Z.js} +4 -4
  50. package/dist/chunk-5TBFN46Z.js.map +1 -0
  51. package/dist/{chunk-6RTEUWXX.js → chunk-6HK6RUFM.js} +3 -3
  52. package/dist/{chunk-6RTEUWXX.js.map → chunk-6HK6RUFM.js.map} +1 -1
  53. package/dist/{chunk-PGZDSDOB.js → chunk-6Z5KTFJT.js} +3 -3
  54. package/dist/{chunk-PGZDSDOB.js.map → chunk-6Z5KTFJT.js.map} +1 -1
  55. package/dist/{chunk-PW3TYWOI.js → chunk-AJ7EGIFR.js} +3 -3
  56. package/dist/{chunk-PW3TYWOI.js.map → chunk-AJ7EGIFR.js.map} +1 -1
  57. package/dist/{chunk-46IRZJV4.js → chunk-CD7SVH6W.js} +4 -4
  58. package/dist/{chunk-46IRZJV4.js.map → chunk-CD7SVH6W.js.map} +1 -1
  59. package/dist/{chunk-WKEBNB5S.js → chunk-CKBCX3HQ.js} +4 -4
  60. package/dist/{chunk-WKEBNB5S.js.map → chunk-CKBCX3HQ.js.map} +1 -1
  61. package/dist/{chunk-H7R7R5BN.js → chunk-CKICWXMU.js} +18 -15
  62. package/dist/chunk-CKICWXMU.js.map +1 -0
  63. package/dist/{chunk-YK3XLEQJ.js → chunk-CKNIYIV2.js} +83 -77
  64. package/dist/chunk-CKNIYIV2.js.map +1 -0
  65. package/dist/{chunk-SPV2CXJ3.js → chunk-D6UBEYQH.js} +4 -4
  66. package/dist/{chunk-SPV2CXJ3.js.map → chunk-D6UBEYQH.js.map} +1 -1
  67. package/dist/{chunk-5CE6J4DB.js → chunk-DA2MCPFN.js} +53 -16
  68. package/dist/chunk-DA2MCPFN.js.map +1 -0
  69. package/dist/{chunk-A26MUUN7.js → chunk-DJD36HC5.js} +7 -7
  70. package/dist/{chunk-A26MUUN7.js.map → chunk-DJD36HC5.js.map} +1 -1
  71. package/dist/{chunk-Y25V2MW2.js → chunk-E5YNGE3I.js} +4 -4
  72. package/dist/{chunk-Y25V2MW2.js.map → chunk-E5YNGE3I.js.map} +1 -1
  73. package/dist/{chunk-OJHPG6HK.js → chunk-EELKR2WP.js} +45 -28
  74. package/dist/chunk-EELKR2WP.js.map +1 -0
  75. package/dist/{chunk-YIDZJHY6.js → chunk-EFLKSMCO.js} +3 -3
  76. package/dist/{chunk-YIDZJHY6.js.map → chunk-EFLKSMCO.js.map} +1 -1
  77. package/dist/{chunk-SMUIYYCH.js → chunk-EZVZDCHZ.js} +24 -15
  78. package/dist/chunk-EZVZDCHZ.js.map +1 -0
  79. package/dist/{chunk-SAGBVBY2.js → chunk-FHIMIXT3.js} +5 -5
  80. package/dist/{chunk-SAGBVBY2.js.map → chunk-FHIMIXT3.js.map} +1 -1
  81. package/dist/{chunk-D5REDKVU.js → chunk-FKU57Q5Q.js} +3 -3
  82. package/dist/{chunk-D5REDKVU.js.map → chunk-FKU57Q5Q.js.map} +1 -1
  83. package/dist/{chunk-J4RRH2NP.js → chunk-FV2MSBVA.js} +4 -4
  84. package/dist/{chunk-J4RRH2NP.js.map → chunk-FV2MSBVA.js.map} +1 -1
  85. package/dist/{chunk-YW2BNDSE.js → chunk-GOCWM7FN.js} +22 -4
  86. package/dist/chunk-GOCWM7FN.js.map +1 -0
  87. package/dist/{chunk-TXGVG7VH.js → chunk-GRKU3S5V.js} +3 -3
  88. package/dist/{chunk-TXGVG7VH.js.map → chunk-GRKU3S5V.js.map} +1 -1
  89. package/dist/{chunk-AP24HESN.js → chunk-H6UVIKQ2.js} +3 -3
  90. package/dist/{chunk-AP24HESN.js.map → chunk-H6UVIKQ2.js.map} +1 -1
  91. package/dist/{chunk-ES6ARJPQ.js → chunk-HPVMTX6M.js} +15 -10
  92. package/dist/chunk-HPVMTX6M.js.map +1 -0
  93. package/dist/{chunk-A7AZ3RL5.js → chunk-JJ7LDI3S.js} +7 -7
  94. package/dist/{chunk-A7AZ3RL5.js.map → chunk-JJ7LDI3S.js.map} +1 -1
  95. package/dist/{chunk-OHNNCXMB.js → chunk-JY7GVNYU.js} +32 -18
  96. package/dist/chunk-JY7GVNYU.js.map +1 -0
  97. package/dist/{chunk-HUKUYWBJ.js → chunk-JYWW32JI.js} +17 -6
  98. package/dist/chunk-JYWW32JI.js.map +1 -0
  99. package/dist/{chunk-VJ2DZLDM.js → chunk-K5LVU2MN.js} +13 -7
  100. package/dist/chunk-K5LVU2MN.js.map +1 -0
  101. package/dist/{chunk-5RDZ5JHH.js → chunk-KC6HGWXN.js} +4 -4
  102. package/dist/{chunk-5RDZ5JHH.js.map → chunk-KC6HGWXN.js.map} +1 -1
  103. package/dist/{chunk-X5O56UO4.js → chunk-L2AMXONH.js} +3 -3
  104. package/dist/chunk-L2AMXONH.js.map +1 -0
  105. package/dist/{chunk-RTNWU2UD.js → chunk-L5XUEC2W.js} +4 -4
  106. package/dist/{chunk-RTNWU2UD.js.map → chunk-L5XUEC2W.js.map} +1 -1
  107. package/dist/{chunk-TKI7YDWE.js → chunk-L6IFN6ER.js} +54 -9
  108. package/dist/chunk-L6IFN6ER.js.map +1 -0
  109. package/dist/{chunk-L6UMSKDF.js → chunk-LW7ZI6EQ.js} +8 -36
  110. package/dist/chunk-LW7ZI6EQ.js.map +1 -0
  111. package/dist/{chunk-XGR7IDTY.js → chunk-MQIRRN76.js} +3 -3
  112. package/dist/{chunk-XGR7IDTY.js.map → chunk-MQIRRN76.js.map} +1 -1
  113. package/dist/{chunk-ISSYT5AZ.js → chunk-N5P2WBUL.js} +3 -3
  114. package/dist/{chunk-ISSYT5AZ.js.map → chunk-N5P2WBUL.js.map} +1 -1
  115. package/dist/{chunk-E634MBP6.js → chunk-ODDATIII.js} +8 -8
  116. package/dist/{chunk-E634MBP6.js.map → chunk-ODDATIII.js.map} +1 -1
  117. package/dist/{chunk-WXWQNJCT.js → chunk-PUK7TQT4.js} +3 -3
  118. package/dist/{chunk-WXWQNJCT.js.map → chunk-PUK7TQT4.js.map} +1 -1
  119. package/dist/{chunk-72KZJE3G.js → chunk-PZ6NF5DE.js} +16 -23
  120. package/dist/chunk-PZ6NF5DE.js.map +1 -0
  121. package/dist/{chunk-5DCOG5B5.js → chunk-RD6N2D7I.js} +3 -3
  122. package/dist/{chunk-5DCOG5B5.js.map → chunk-RD6N2D7I.js.map} +1 -1
  123. package/dist/{chunk-TADJCATD.js → chunk-RO2BPKXK.js} +3 -3
  124. package/dist/{chunk-TADJCATD.js.map → chunk-RO2BPKXK.js.map} +1 -1
  125. package/dist/{chunk-6GSE63K2.js → chunk-SRNCN4X2.js} +13 -5
  126. package/dist/chunk-SRNCN4X2.js.map +1 -0
  127. package/dist/{chunk-PIC23DDE.js → chunk-T2TQAH2X.js} +42 -11
  128. package/dist/chunk-T2TQAH2X.js.map +1 -0
  129. package/dist/{chunk-DADAZLFW.js → chunk-TDQ2ERCM.js} +695 -96
  130. package/dist/chunk-TDQ2ERCM.js.map +1 -0
  131. package/dist/{chunk-SXWGLW23.js → chunk-U2FI547Z.js} +4 -4
  132. package/dist/{chunk-SXWGLW23.js.map → chunk-U2FI547Z.js.map} +1 -1
  133. package/dist/{chunk-CQFVKN6S.js → chunk-V4RV2NJF.js} +240 -84
  134. package/dist/chunk-V4RV2NJF.js.map +1 -0
  135. package/dist/{chunk-D3PU3C6F.js → chunk-VKPBUPH7.js} +41 -15
  136. package/dist/chunk-VKPBUPH7.js.map +1 -0
  137. package/dist/{chunk-FT4ZHLYR.js → chunk-WDXZA7QW.js} +33 -3
  138. package/dist/chunk-WDXZA7QW.js.map +1 -0
  139. package/dist/{chunk-FSSRBWYL.js → chunk-WJCQFNF6.js} +4 -4
  140. package/dist/chunk-WJCQFNF6.js.map +1 -0
  141. package/dist/{chunk-2SKPPIV7.js → chunk-WJLYL6RY.js} +5 -5
  142. package/dist/{chunk-2SKPPIV7.js.map → chunk-WJLYL6RY.js.map} +1 -1
  143. package/dist/{chunk-6Q7NKTDG.js → chunk-X54YR4AW.js} +2 -2
  144. package/dist/{chunk-6Q7NKTDG.js.map → chunk-X54YR4AW.js.map} +1 -1
  145. package/dist/{chunk-D5WTOVLG.js → chunk-Y56YIT6J.js} +2 -2
  146. package/dist/chunk-Y56YIT6J.js.map +1 -0
  147. package/dist/{chunk-ZIW34FGO.js → chunk-YIF2IJUA.js} +3 -3
  148. package/dist/{chunk-ZIW34FGO.js.map → chunk-YIF2IJUA.js.map} +1 -1
  149. package/dist/{chunk-HG52NGAV.js → chunk-YU6AURJY.js} +3 -3
  150. package/dist/{chunk-HG52NGAV.js.map → chunk-YU6AURJY.js.map} +1 -1
  151. package/dist/{chunk-FSLVMZXR.js → chunk-YZ3N7IUU.js} +72 -31
  152. package/dist/chunk-YZ3N7IUU.js.map +1 -0
  153. package/dist/{chunk-DQOAPR4M.js → chunk-ZNN7ONJX.js} +8 -4
  154. package/dist/chunk-ZNN7ONJX.js.map +1 -0
  155. package/dist/cli/index.js +349 -150
  156. package/dist/cli/index.js.map +1 -1
  157. package/dist/cli/src/commands/asset-cmd.d.ts.map +1 -1
  158. package/dist/cli/src/commands/catalog.d.ts.map +1 -1
  159. package/dist/cli/src/commands/config.d.ts.map +1 -1
  160. package/dist/cli/src/commands/integration.d.ts.map +1 -1
  161. package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
  162. package/dist/cli/src/commands/library-publish.d.ts.map +1 -1
  163. package/dist/cli/src/commands/plugin/claude-code.d.ts.map +1 -1
  164. package/dist/cli/src/commands/plugin/codex.d.ts +6 -0
  165. package/dist/cli/src/commands/plugin/codex.d.ts.map +1 -1
  166. package/dist/cli/src/commands/project.d.ts.map +1 -1
  167. package/dist/cli/src/commands/run.d.ts.map +1 -1
  168. package/dist/cli/src/commands/serve.d.ts +5 -0
  169. package/dist/cli/src/commands/serve.d.ts.map +1 -1
  170. package/dist/cli/src/commands/source.d.ts.map +1 -1
  171. package/dist/cli/src/commands/validate.d.ts.map +1 -1
  172. package/dist/cli/src/commands/verify.d.ts.map +1 -1
  173. package/dist/cli/src/driver-error.d.ts +3 -1
  174. package/dist/cli/src/driver-error.d.ts.map +1 -1
  175. package/dist/cli/src/helpers.d.ts +6 -4
  176. package/dist/cli/src/helpers.d.ts.map +1 -1
  177. package/dist/cli/src/plugin-store/index.d.ts +6 -0
  178. package/dist/cli/src/plugin-store/index.d.ts.map +1 -1
  179. package/dist/cli/src/skill-checks.d.ts +4 -3
  180. package/dist/cli/src/skill-checks.d.ts.map +1 -1
  181. package/dist/connectors/config.js +5 -5
  182. package/dist/connectors/index.js +22 -22
  183. package/dist/connectors/src/connector-manager.d.ts.map +1 -1
  184. package/dist/connectors/src/connector-types.d.ts +5 -0
  185. package/dist/connectors/src/connector-types.d.ts.map +1 -1
  186. package/dist/connectors/src/watcher.d.ts.map +1 -1
  187. package/dist/{connectors-44RE2QEM.js → connectors-QL4GBMH3.js} +25 -25
  188. package/dist/{connectors-44RE2QEM.js.map → connectors-QL4GBMH3.js.map} +1 -1
  189. package/dist/connectors-shared/index.js +2 -2
  190. package/dist/core/index.js +7 -7
  191. package/dist/core/manifest.js +2 -2
  192. package/dist/core/models.js +1 -1
  193. package/dist/core/publish-manifest.js +3 -3
  194. package/dist/core/ref.js +1 -1
  195. package/dist/core/runtime-assets.js +5 -5
  196. package/dist/core/src/bind.d.ts +30 -0
  197. package/dist/core/src/bind.d.ts.map +1 -0
  198. package/dist/core/src/index.d.ts +4 -3
  199. package/dist/core/src/index.d.ts.map +1 -1
  200. package/dist/core/src/lock.d.ts +11 -2
  201. package/dist/core/src/lock.d.ts.map +1 -1
  202. package/dist/core/src/manifest.d.ts.map +1 -1
  203. package/dist/core/src/models.d.ts +19 -0
  204. package/dist/core/src/models.d.ts.map +1 -1
  205. package/dist/core/src/publish-manifest.d.ts +15 -13
  206. package/dist/core/src/publish-manifest.d.ts.map +1 -1
  207. package/dist/core/src/store.d.ts +2 -1
  208. package/dist/core/src/store.d.ts.map +1 -1
  209. package/dist/core/src/workspace-config.d.ts +26 -1
  210. package/dist/core/src/workspace-config.d.ts.map +1 -1
  211. package/dist/core/store.js +1 -1
  212. package/dist/core/workspace-config.js +4 -4
  213. package/dist/deploy/index.js +7 -7
  214. package/dist/discovery/index.js +5 -5
  215. package/dist/discovery/src/parse-manifest.d.ts +1 -1
  216. package/dist/discovery/src/source-config.d.ts +2 -1
  217. package/dist/discovery/src/source-config.d.ts.map +1 -1
  218. package/dist/{ensure-sources-R6AHZ7RV.js → ensure-sources-CEFODJCE.js} +21 -17
  219. package/dist/ensure-sources-CEFODJCE.js.map +1 -0
  220. package/dist/factory-assets/connectors/box.js +22 -22
  221. package/dist/factory-assets/connectors/deploy.js +22 -22
  222. package/dist/factory-assets/connectors/devserver.js +22 -22
  223. package/dist/factory-assets/connectors/flow/adapter.js +22 -22
  224. package/dist/factory-assets/connectors/flow/engine.js +9 -9
  225. package/dist/factory-assets/connectors/flow/run-flow.js +24 -24
  226. package/dist/factory-assets/connectors/flow.js +22 -22
  227. package/dist/factory-assets/connectors/git.js +22 -22
  228. package/dist/factory-assets/connectors/gmail.js +22 -22
  229. package/dist/factory-assets/connectors/googledrive.js +22 -22
  230. package/dist/factory-assets/connectors/local.js +22 -22
  231. package/dist/factory-assets/connectors/mattermost.js +22 -22
  232. package/dist/factory-assets/connectors/memory.js +22 -22
  233. package/dist/factory-assets/connectors/minio.js +22 -22
  234. package/dist/factory-assets/connectors/postgres.js +22 -22
  235. package/dist/factory-assets/connectors/s3.js +22 -22
  236. package/dist/factory-assets/connectors/sharepoint.js +22 -22
  237. package/dist/factory-assets/connectors/sqlite.js +22 -22
  238. package/dist/factory-assets/connectors/static-server.js +22 -22
  239. package/dist/factory-assets/connectors/tunnel.js +22 -22
  240. package/dist/factory-assets/connectors/webdav.js +22 -22
  241. package/dist/factory-assets/connectors/xstate-store/adapter.d.ts +1 -1
  242. package/dist/factory-assets/connectors/xstate-store/adapter.d.ts.map +1 -1
  243. package/dist/factory-assets/connectors/xstate-store.js +22 -22
  244. package/dist/factory-assets/connectors/xstate.js +22 -22
  245. package/dist/{flows-YKC53LDP.js → flows-BHY73K3O.js} +12 -12
  246. package/dist/{flows-YKC53LDP.js.map → flows-BHY73K3O.js.map} +1 -1
  247. package/dist/{helpers-FNQL5PI7.js → helpers-R22QNPFN.js} +21 -17
  248. package/dist/{helpers-FNQL5PI7.js.map → helpers-R22QNPFN.js.map} +1 -1
  249. package/dist/library/index.js +11 -11
  250. package/dist/library/install.js +4 -4
  251. package/dist/library/src/index.d.ts +1 -1
  252. package/dist/library/src/index.d.ts.map +1 -1
  253. package/dist/library/src/manifest-writer.d.ts +17 -1
  254. package/dist/library/src/manifest-writer.d.ts.map +1 -1
  255. package/dist/{library-publish-GHPVY42Y.js → library-publish-VBE3X2TH.js} +63 -66
  256. package/dist/library-publish-VBE3X2TH.js.map +1 -0
  257. package/dist/model-endpoint/index.js +10 -10
  258. package/dist/model-endpoint/src/server.d.ts.map +1 -1
  259. package/dist/open-library-JP5TC5UX.js +42 -0
  260. package/dist/{open-library-YSUGNP36.js.map → open-library-JP5TC5UX.js.map} +1 -1
  261. package/dist/open-registry-RBELV5YH.js +32 -0
  262. package/dist/{open-registry-YPRQDUMK.js.map → open-registry-RBELV5YH.js.map} +1 -1
  263. package/dist/paths-BFM6K2QO.js +22 -0
  264. package/dist/{paths-P55DTBEK.js.map → paths-BFM6K2QO.js.map} +1 -1
  265. package/dist/plugin-store-QOQDM24E.js +23 -0
  266. package/dist/{plugin-store-IPIBZRBX.js.map → plugin-store-QOQDM24E.js.map} +1 -1
  267. package/dist/{project-NDSLXERO.js → project-6ETXGQWD.js} +48 -48
  268. package/dist/{project-NDSLXERO.js.map → project-6ETXGQWD.js.map} +1 -1
  269. package/dist/resolver/index.js +8 -8
  270. package/dist/runner/index.js +40 -40
  271. package/dist/runner/src/agent.d.ts.map +1 -1
  272. package/dist/runner/src/capability-roundtrip.d.ts.map +1 -1
  273. package/dist/runner/src/coalesced-restart.d.ts +41 -0
  274. package/dist/runner/src/coalesced-restart.d.ts.map +1 -0
  275. package/dist/runner/src/compaction/prompt.d.ts.map +1 -1
  276. package/dist/runner/src/mcp-runtime-handlers.d.ts +27 -0
  277. package/dist/runner/src/mcp-runtime-handlers.d.ts.map +1 -1
  278. package/dist/runner/src/runner-capabilities.d.ts +7 -0
  279. package/dist/runner/src/runner-capabilities.d.ts.map +1 -1
  280. package/dist/runner/src/serve.d.ts.map +1 -1
  281. package/dist/runner/src/session-capability-wiring.d.ts +2 -0
  282. package/dist/runner/src/session-capability-wiring.d.ts.map +1 -1
  283. package/dist/sdk/asset-manager.js +18 -14
  284. package/dist/sdk/bridge.js +16 -16
  285. package/dist/sdk/core.js +7 -7
  286. package/dist/sdk/flow.js +9 -9
  287. package/dist/sdk/index.js +40 -40
  288. package/dist/sdk/resolver.js +8 -8
  289. package/dist/sdk/runner.js +40 -40
  290. package/dist/sdk/session.js +2 -2
  291. package/dist/sdk/transport/ws/server.js +19 -1
  292. package/dist/sdk/transport/ws.js +19 -1
  293. package/dist/sdk/transport.js +19 -1
  294. package/dist/sdk/types.js +1 -1
  295. package/dist/{serve-preflight-ON2LS3SD.js → serve-preflight-BTGTZUDN.js} +9 -9
  296. package/dist/{serve-preflight-ON2LS3SD.js.map → serve-preflight-BTGTZUDN.js.map} +1 -1
  297. package/dist/session/index.js +2 -2
  298. package/dist/{setup-MFPEQS2I.js → setup-JQDTYPSD.js} +30 -26
  299. package/dist/setup-JQDTYPSD.js.map +1 -0
  300. package/dist/{skills-7G6QCDEM.js → skills-RSZVUIYZ.js} +13 -13
  301. package/dist/{skills-7G6QCDEM.js.map → skills-RSZVUIYZ.js.map} +1 -1
  302. package/dist/{source-4QVRD5NV.js → source-FPLHY3DP.js} +50 -50
  303. package/dist/{source-4QVRD5NV.js.map → source-FPLHY3DP.js.map} +1 -1
  304. package/dist/{source-manifest-publish-ZIO24GUM.js → source-manifest-publish-LY4H63VA.js} +52 -52
  305. package/dist/{source-manifest-publish-ZIO24GUM.js.map → source-manifest-publish-LY4H63VA.js.map} +1 -1
  306. package/dist/transport/index.js +19 -1
  307. package/dist/transport/src/ws/server.d.ts +2 -16
  308. package/dist/transport/src/ws/server.d.ts.map +1 -1
  309. package/dist/transport/ws/server.js +19 -1
  310. package/dist/transport/ws.js +19 -1
  311. package/dist/tui/index.js +57 -45
  312. package/dist/tui/index.js.map +1 -1
  313. package/dist/tui/src/repl.d.ts +4 -1
  314. package/dist/tui/src/repl.d.ts.map +1 -1
  315. package/dist/types/index.js +1 -1
  316. package/dist/types/manifests.js +1 -1
  317. package/dist/types/src/events.d.ts +7 -4
  318. package/dist/types/src/events.d.ts.map +1 -1
  319. package/dist/types/src/manifests/index.d.ts +1 -1
  320. package/dist/types/src/manifests/index.d.ts.map +1 -1
  321. package/dist/types/src/manifests/scaffold-body.d.ts +8 -0
  322. package/dist/types/src/manifests/scaffold-body.d.ts.map +1 -1
  323. package/dist/types/src/manifests/skill.d.ts +0 -2
  324. package/dist/types/src/manifests/skill.d.ts.map +1 -1
  325. package/dist/workspace-plugin/adapters/mcp.js +29 -29
  326. package/dist/workspace-plugin/adapters/omp.js +32 -18
  327. package/dist/workspace-plugin/adapters/omp.js.map +1 -1
  328. package/dist/workspace-plugin/index.js +1 -1
  329. package/dist/workspace-plugin/src/adapters/claude-code.d.ts +1 -1
  330. package/dist/workspace-plugin/src/adapters/omp.d.ts +8 -5
  331. package/dist/workspace-plugin/src/adapters/omp.d.ts.map +1 -1
  332. package/dist/workspace-plugin/src/plugin.d.ts +7 -1
  333. package/dist/workspace-plugin/src/plugin.d.ts.map +1 -1
  334. package/package.json +1 -1
  335. package/dist/chunk-5CE6J4DB.js.map +0 -1
  336. package/dist/chunk-6GSE63K2.js.map +0 -1
  337. package/dist/chunk-72KZJE3G.js.map +0 -1
  338. package/dist/chunk-CQFVKN6S.js.map +0 -1
  339. package/dist/chunk-D3PU3C6F.js.map +0 -1
  340. package/dist/chunk-D54T2F54.js.map +0 -1
  341. package/dist/chunk-D5WTOVLG.js.map +0 -1
  342. package/dist/chunk-DADAZLFW.js.map +0 -1
  343. package/dist/chunk-DQOAPR4M.js.map +0 -1
  344. package/dist/chunk-ES6ARJPQ.js.map +0 -1
  345. package/dist/chunk-FSLVMZXR.js.map +0 -1
  346. package/dist/chunk-FSSRBWYL.js.map +0 -1
  347. package/dist/chunk-FT4ZHLYR.js.map +0 -1
  348. package/dist/chunk-FWAJUWXQ.js.map +0 -1
  349. package/dist/chunk-H7R7R5BN.js.map +0 -1
  350. package/dist/chunk-HUKUYWBJ.js.map +0 -1
  351. package/dist/chunk-L6UMSKDF.js.map +0 -1
  352. package/dist/chunk-NSNM2ZXF.js.map +0 -1
  353. package/dist/chunk-OHNNCXMB.js.map +0 -1
  354. package/dist/chunk-OJHPG6HK.js.map +0 -1
  355. package/dist/chunk-PIC23DDE.js.map +0 -1
  356. package/dist/chunk-SMUIYYCH.js.map +0 -1
  357. package/dist/chunk-TKI7YDWE.js.map +0 -1
  358. package/dist/chunk-VJ2DZLDM.js.map +0 -1
  359. package/dist/chunk-X5O56UO4.js.map +0 -1
  360. package/dist/chunk-YK3XLEQJ.js.map +0 -1
  361. package/dist/chunk-YW2BNDSE.js.map +0 -1
  362. package/dist/chunk-ZVZTCDUN.js.map +0 -1
  363. package/dist/ensure-sources-R6AHZ7RV.js.map +0 -1
  364. package/dist/library-publish-GHPVY42Y.js.map +0 -1
  365. package/dist/open-library-YSUGNP36.js +0 -40
  366. package/dist/open-registry-YPRQDUMK.js +0 -32
  367. package/dist/paths-P55DTBEK.js +0 -22
  368. package/dist/plugin-store-IPIBZRBX.js +0 -23
  369. package/dist/setup-MFPEQS2I.js.map +0 -1
@@ -1,37 +1,37 @@
1
- import { WorkspacePlugin } from './chunk-DQOAPR4M.js';
2
- import { buildWorkspaceToolDefs } from './chunk-A7AZ3RL5.js';
3
- import { findAiAssetsRoot } from './chunk-PGZDSDOB.js';
4
- import { startModelEndpoint } from './chunk-72KZJE3G.js';
5
- import { WebSocketServerTransport } from './chunk-L6UMSKDF.js';
1
+ import { WorkspacePlugin } from './chunk-ZNN7ONJX.js';
2
+ import { buildWorkspaceToolDefs } from './chunk-JJ7LDI3S.js';
3
+ import { findAiAssetsRoot } from './chunk-6Z5KTFJT.js';
4
+ import { startModelEndpoint } from './chunk-PZ6NF5DE.js';
5
+ import { WebSocketServerTransport } from './chunk-LW7ZI6EQ.js';
6
6
  import { assembleSystemPrompt, buildCapabilitiesPromptSection } from './chunk-W3UDISS2.js';
7
7
  import { prepareNativePolicy, codexInstanceEnvironment, parseCodexCredential, parseCodexRefreshInput, parseCodexRefreshResult } from './chunk-PHRNUTSG.js';
8
- import { resolveFlowPath } from './chunk-E634MBP6.js';
9
- import { findAiAssetsRoot as findAiAssetsRoot$1, deployCatalogEntry, undeployCatalogEntry } from './chunk-AP24HESN.js';
10
- import { ConnectFailureCarryOver, registerBuiltinConnectors, buildConnectorPromptSection, findMissingPackages, installNpmPackages, ConnectorManager, buildSdkConnectorTools, buildLazySdkFlowTools, describeFlowOperations, buildConnectorToolDefs, buildFlowToolDefs, SessionNodeExecutor, SessionSubpromptRunner, ClassifierSubpromptRunner, SessionInlineSubFlowRunner, driveOrchestratorTurn, buildSdkFlowTools } from './chunk-OJHPG6HK.js';
11
- import { loadYamlConnectorDeclarations, withMaterializedConnectorDeclarations, SecretProviderChain, ConnectorStartupError, isKnownSecretRef, EnvSecretProvider, PreMintedSecretProvider, InMemorySecretProvider, resolvedConfigToDeclarations, deriveSingleMaterializedConnectorDeclaration } from './chunk-FSSRBWYL.js';
12
- import { EventNormalizer } from './chunk-TKI7YDWE.js';
13
- import { approvalCardOf, APPROVE_ONCE, DENY, probeResumeTranscript, transcriptStoreForRuntime } from './chunk-NSNM2ZXF.js';
8
+ import { resolveFlowPath } from './chunk-ODDATIII.js';
9
+ import { findAiAssetsRoot as findAiAssetsRoot$1, deployCatalogEntry, undeployCatalogEntry } from './chunk-H6UVIKQ2.js';
10
+ import { ConnectFailureCarryOver, registerBuiltinConnectors, buildConnectorPromptSection, findMissingPackages, installNpmPackages, ConnectorManager, buildSdkConnectorTools, buildLazySdkFlowTools, describeFlowOperations, buildConnectorToolDefs, buildFlowToolDefs, SessionNodeExecutor, SessionSubpromptRunner, ClassifierSubpromptRunner, SessionInlineSubFlowRunner, driveOrchestratorTurn, buildSdkFlowTools } from './chunk-EELKR2WP.js';
11
+ import { loadYamlConnectorDeclarations, withMaterializedConnectorDeclarations, SecretProviderChain, ConnectorStartupError, isKnownSecretRef, EnvSecretProvider, PreMintedSecretProvider, InMemorySecretProvider, resolvedConfigToDeclarations, deriveSingleMaterializedConnectorDeclaration } from './chunk-WJCQFNF6.js';
12
+ import { EventNormalizer } from './chunk-L6IFN6ER.js';
13
+ import { approvalCardOf, APPROVE_ONCE, DENY, probeResumeTranscript, transcriptStoreForRuntime } from './chunk-3KMREAR2.js';
14
14
  import { CodexNativeStateUnavailable } from './chunk-LOO5CB5M.js';
15
- import { dispatchCapability } from './chunk-PW3TYWOI.js';
15
+ import { dispatchCapability } from './chunk-AJ7EGIFR.js';
16
16
  import { classifyClaudeSdkError } from './chunk-B4X2N7JQ.js';
17
17
  import { agentExecRequested } from './chunk-YROR332M.js';
18
- import { toAgentEffort, toMergedRegistry } from './chunk-HG52NGAV.js';
19
- import { unresolvedProviderCredentials, driverCapabilities, createDriver, catalogLayer, providerCredentialEnvName, registryCredentialEnv, AI_PROVIDER_PRESETS, supportsLiveToolUpdates } from './chunk-6Q7NKTDG.js';
20
- import { loadFlow } from './chunk-SPV2CXJ3.js';
21
- import { parseFlowDefinition } from './chunk-X3RMRJNR.js';
18
+ import { toAgentEffort, toMergedRegistry } from './chunk-YU6AURJY.js';
19
+ import { unresolvedProviderCredentials, driverCapabilities, createDriver, catalogLayer, providerCredentialEnvName, registryCredentialEnv, AI_PROVIDER_PRESETS, supportsLiveToolUpdates } from './chunk-X54YR4AW.js';
20
+ import { loadFlow } from './chunk-D6UBEYQH.js';
22
21
  import { renderStimulusPrompt } from './chunk-M3WPBTGJ.js';
23
- import { TERMINAL_AGENT_RUN_STATUSES, withActivityLabelJsonSchema, TOOL_ACTIVITY_PROMPT_SECTION, SESSION_ROOT_CONNECTOR_ID, PLATFORM_BLOCKS_RUNTIME_FEATURE, PROTOCOL_VERSION, deliveryClassOf } from './chunk-D5WTOVLG.js';
24
- import { knowledgeKindProvider, scanLibraryRoot, LocalIndex } from './chunk-D3PU3C6F.js';
25
- import { createDefaultKindRegistry } from './chunk-ES6ARJPQ.js';
26
- import { BindingSchema, effectiveComposes, AgentManifestSchema, AgentTriggerSchema, ANTHROPIC_MODEL_ALIASES } from './chunk-YK3XLEQJ.js';
27
- import { readLock, buildAgentPromptSections, resolveSettings, loadProviderRegistry, resolveLibraryDir } from './chunk-PIC23DDE.js';
28
- import { resolveRuntimeAssets } from './chunk-5RDZ5JHH.js';
22
+ import { TERMINAL_AGENT_RUN_STATUSES, withActivityLabelJsonSchema, TOOL_ACTIVITY_PROMPT_SECTION, SESSION_ROOT_CONNECTOR_ID, PLATFORM_BLOCKS_RUNTIME_FEATURE, PROTOCOL_VERSION, deliveryClassOf } from './chunk-Y56YIT6J.js';
23
+ import { knowledgeKindProvider, scanLibraryRoot, LocalIndex } from './chunk-VKPBUPH7.js';
24
+ import { createDefaultKindRegistry } from './chunk-HPVMTX6M.js';
25
+ import { parseFlowDefinition } from './chunk-X3RMRJNR.js';
26
+ import { BindingSchema, effectiveComposes, AgentManifestSchema, AgentTriggerSchema, ANTHROPIC_MODEL_ALIASES } from './chunk-CKNIYIV2.js';
27
+ import { readLock, buildAgentPromptSections, resolveSettings, loadProviderRegistry, resolveLibraryDir } from './chunk-T2TQAH2X.js';
28
+ import { resolveRuntimeAssets } from './chunk-KC6HGWXN.js';
29
29
  import { DEFAULT_DRIVER_ID, resolveDriverPaths } from './chunk-5BEFNLOR.js';
30
- import { matchPin, DEFAULT_AGENT_INSTANCE_ID, effectiveAgentInstances, resolveAgentDefinitionDir, AgentRefResolutionError, resolveSkWorkspaceConfig, resolveAgentDir, loadMcpServerDeclarations, COMPACTION_DEFAULTS, resolveCompactionThresholdPercent, getGlobalCacheDir, sourceCacheKey, validateAssetRecipeAttr, deriveSingleMaterializedMcpDeclaration, stageMaterializedSkills, readSkillAllowList, isStagedSkillMarkerFor, unstageSkill, STAGED_SKILL_MARKER } from './chunk-ZVZTCDUN.js';
30
+ import { matchPin, DEFAULT_AGENT_INSTANCE_ID, effectiveAgentInstances, resolveAgentDefinitionDir, AgentRefResolutionError, resolveSkWorkspaceConfig, resolveAgentDir, loadMcpServerDeclarations, COMPACTION_DEFAULTS, resolveCompactionThresholdPercent, getGlobalCacheDir, sourceCacheKey, validateAssetRecipeAttr, deriveSingleMaterializedMcpDeclaration, stageMaterializedSkills, readSkillAllowList, isStagedSkillMarkerFor, unstageSkill, STAGED_SKILL_MARKER } from './chunk-2NOLF7B2.js';
31
31
  import { globalSkaileDir } from './chunk-L5VSIPQD.js';
32
32
  import { driverTargetForDriver, SUPPORTED_DRIVER_TARGETS, DRIVER_TARGETS } from './chunk-IG5LZ3WU.js';
33
- import { withFsDeadline, FsDeadlineError, fsDeadlineMs, parseFrontmatter, tryWithFsDeadline } from './chunk-YW2BNDSE.js';
34
- import { parseAssetRef } from './chunk-FT4ZHLYR.js';
33
+ import { withFsDeadline, FsDeadlineError, fsDeadlineMs, parseFrontmatter, tryWithFsDeadline } from './chunk-GOCWM7FN.js';
34
+ import { parseAssetRef } from './chunk-WDXZA7QW.js';
35
35
  import { resolveLogStoreConfig, createLogStoreFromConfig, OnLogBridgeSink, WsLogSink, resolveLogsRetention, enforceLogsRetention } from './chunk-DKXNKFKP.js';
36
36
  import { pickRegistryEntries, registryEntries, resolveEntryBaseUrl, parseModelRef, isEntryEnabled, parseCredentialRef } from './chunk-MJHSLODD.js';
37
37
  import { getLogStore, registerLogStore, createLogger, resetLogStore, isUnwritableStreamError, markStreamBroken, isBrokenPipeError, redactCredentials } from './chunk-BOFL7GIF.js';
@@ -6803,7 +6803,9 @@ ${message}`;
6803
6803
  settled = true;
6804
6804
  driver.off("agent-event", onEvent);
6805
6805
  const err = Object.assign(new Error(String(event.error)), {
6806
- detail: event.detail
6806
+ detail: event.detail,
6807
+ // The records of this turn sit in the log db under this id (`skaile session logs`).
6808
+ logSessionId: sessionId
6807
6809
  });
6808
6810
  chatLog.error("agent emitted error event", err);
6809
6811
  driver.kill();
@@ -6817,7 +6819,7 @@ ${message}`;
6817
6819
  driver.off("agent-event", onEvent);
6818
6820
  chatLog.error("prompt failed", err);
6819
6821
  driver.kill();
6820
- reject(err);
6822
+ reject(Object.assign(err, { logSessionId: sessionId }));
6821
6823
  });
6822
6824
  });
6823
6825
  } finally {
@@ -6910,10 +6912,23 @@ async function dispatchRunnerCapabilityInvocation(cmd, deps) {
6910
6912
  const result = await deps.invoke(cmd.name, cmd.input);
6911
6913
  deps.emit({ type: "capability_result", callId: cmd.callId, result });
6912
6914
  } catch (err) {
6913
- const message = err instanceof Error ? err.message : String(err);
6914
- deps.emit({ type: "capability_result", callId: cmd.callId, result: { error: message } });
6915
+ deps.emit({
6916
+ type: "capability_result",
6917
+ callId: cmd.callId,
6918
+ result: { error: capabilityErrorText(cmd.name, err) }
6919
+ });
6915
6920
  }
6916
6921
  }
6922
+ function capabilityErrorText(name, err) {
6923
+ if (err instanceof Error && err.name === "ZodError" && "issues" in err) {
6924
+ const issues = err.issues;
6925
+ const parts = issues.map(
6926
+ (i) => `${i.path.length > 0 ? `${i.path.map(String).join(".")}: ` : ""}${i.message}`
6927
+ );
6928
+ return `invalid input for ${name}: ${parts.join("; ")}`;
6929
+ }
6930
+ return err instanceof Error ? err.message : String(err);
6931
+ }
6917
6932
  function resolveCapabilityResult(pending, cmd) {
6918
6933
  const entry = pending.get(cmd.callId);
6919
6934
  if (!entry) return false;
@@ -8466,6 +8481,46 @@ function createCoalescedTask(lock, fn) {
8466
8481
  return run;
8467
8482
  };
8468
8483
  }
8484
+
8485
+ // runner/src/coalesced-restart.ts
8486
+ function createCoalescedRestartScheduler(deps) {
8487
+ const quietMs = deps.quietMs ?? 250;
8488
+ const maxWaitMs = deps.maxWaitMs ?? 2e3;
8489
+ const now = deps.now ?? Date.now;
8490
+ const sleep = deps.sleep ?? ((ms) => new Promise((resolve4) => setTimeout(resolve4, ms)));
8491
+ let open4 = null;
8492
+ return (reason) => {
8493
+ if (open4) {
8494
+ open4.reasons.push(reason);
8495
+ open4.lastJoinedAt = now();
8496
+ return;
8497
+ }
8498
+ const state = { reasons: [reason], lastJoinedAt: now() };
8499
+ open4 = state;
8500
+ const close = () => {
8501
+ if (open4 === state) open4 = null;
8502
+ };
8503
+ const batch = {
8504
+ settle: async () => {
8505
+ const deadline = now() + maxWaitMs;
8506
+ for (; ; ) {
8507
+ const wait = Math.min(state.lastJoinedAt + quietMs, deadline) - now();
8508
+ if (wait <= 0 || open4 !== state) break;
8509
+ await sleep(wait);
8510
+ }
8511
+ close();
8512
+ },
8513
+ reasons: () => state.reasons
8514
+ };
8515
+ let started;
8516
+ try {
8517
+ started = deps.start(batch);
8518
+ } catch (err) {
8519
+ started = Promise.reject(err);
8520
+ }
8521
+ void started.catch((err) => deps.onError(state.reasons, err)).finally(close);
8522
+ };
8523
+ }
8469
8524
  async function recordStagedSkills(staged, projectDir, skillsDir, names, timeoutMs) {
8470
8525
  for (const name of names) {
8471
8526
  const path11 = join(projectDir, skillsDir, name);
@@ -9563,11 +9618,32 @@ DROP (omit entirely):
9563
9618
  - Redundant back-and-forth (corrections already applied)
9564
9619
  - Transient UI state
9565
9620
 
9621
+ ## Conversation Language
9622
+
9623
+ Write the summary in the language the user writes in, not in English by
9624
+ default. If the user writes German, the whole summary is in German, section
9625
+ headings included. When users write in more than one language, use the
9626
+ language of the most recent message a user wrote before this compaction
9627
+ request (this request itself does not count). Do this even when a previous
9628
+ summary below is in another language: restate it in the conversation's
9629
+ language.
9630
+
9631
+ Keep file paths, code identifiers, commands, error messages and quoted user
9632
+ text exactly as they were -- never translate them.
9633
+
9634
+ Record the language explicitly in the "Conversation Language" section of the
9635
+ summary, so the agent keeps replying in it after the session is restored.
9636
+
9566
9637
  ## Format
9567
9638
 
9568
9639
  Write a structured summary using these sections. Omit any section that
9569
9640
  has no content.
9570
9641
 
9642
+ ### Conversation Language
9643
+ The language the user writes in (for example "German"). Always include this
9644
+ section. If users write in more than one language, name each and say which
9645
+ one to reply in.
9646
+
9571
9647
  ### Goal
9572
9648
  What the user is trying to accomplish.
9573
9649
 
@@ -11084,9 +11160,9 @@ function asDeclaration(declaration) {
11084
11160
  }
11085
11161
  return null;
11086
11162
  }
11087
- function isLive(rm3, id) {
11163
+ function isLive(rm4, id) {
11088
11164
  try {
11089
- return typeof rm3.has === "function" && rm3.has(id);
11165
+ return typeof rm4.has === "function" && rm4.has(id);
11090
11166
  } catch {
11091
11167
  return false;
11092
11168
  }
@@ -11097,8 +11173,8 @@ function toPreMinted(token) {
11097
11173
  function buildSessionResourceHandlers(deps) {
11098
11174
  const { getResourceManager, getPreMintedSecrets, emitResourcesAvailable, log, getProjectDir } = deps;
11099
11175
  async function add(kind, input) {
11100
- const rm3 = getResourceManager();
11101
- if (!rm3) return { ok: false, code: "no_session", message: "session resources not ready" };
11176
+ const rm4 = getResourceManager();
11177
+ if (!rm4) return { ok: false, code: "no_session", message: "session resources not ready" };
11102
11178
  const decl = asDeclaration(input.declaration);
11103
11179
  if (!decl) {
11104
11180
  return { ok: false, code: "invalid_declaration", message: "declaration missing id/driver" };
@@ -11111,14 +11187,14 @@ function buildSessionResourceHandlers(deps) {
11111
11187
  `[session-resource] preMintedToken provided but secret store not ready \u2014 ${kind}:${decl.id}`
11112
11188
  );
11113
11189
  }
11114
- const wasLive = isLive(rm3, decl.id);
11190
+ const wasLive = isLive(rm4, decl.id);
11115
11191
  try {
11116
- await rm3.connect(decl);
11192
+ await rm4.connect(decl);
11117
11193
  } catch (err) {
11118
11194
  if (input.preMintedToken) {
11119
11195
  getPreMintedSecrets()?.unset(kind, decl.id);
11120
11196
  }
11121
- if (wasLive && !isLive(rm3, decl.id)) emitResourcesAvailable();
11197
+ if (wasLive && !isLive(rm4, decl.id)) emitResourcesAvailable();
11122
11198
  const message = err instanceof Error ? err.message : String(err);
11123
11199
  log(`[session-resource] runner.add_${kind} failed for ${decl.id}: ${message}`);
11124
11200
  return { ok: false, code: "connect_failed", message };
@@ -11151,8 +11227,8 @@ function buildSessionResourceHandlers(deps) {
11151
11227
  message: `no materialized connector at ${join(root, name)}`
11152
11228
  };
11153
11229
  }
11154
- const rm3 = getResourceManager();
11155
- if (!rm3) return { ok: false, code: "no_session", message: "session resources not ready" };
11230
+ const rm4 = getResourceManager();
11231
+ if (!rm4) return { ok: false, code: "no_session", message: "session resources not ready" };
11156
11232
  if (preMintedToken) {
11157
11233
  const ps = getPreMintedSecrets();
11158
11234
  if (ps) ps.set("connector", decl.id, toPreMinted(preMintedToken));
@@ -11161,14 +11237,14 @@ function buildSessionResourceHandlers(deps) {
11161
11237
  `[session-resource] preMintedToken provided but secret store not ready \u2014 connector:${decl.id}`
11162
11238
  );
11163
11239
  }
11164
- const wasLive = isLive(rm3, decl.id);
11240
+ const wasLive = isLive(rm4, decl.id);
11165
11241
  try {
11166
- await rm3.connect(decl);
11242
+ await rm4.connect(decl);
11167
11243
  } catch (err) {
11168
11244
  if (preMintedToken) {
11169
11245
  getPreMintedSecrets()?.unset("connector", decl.id);
11170
11246
  }
11171
- if (wasLive && !isLive(rm3, decl.id)) emitResourcesAvailable();
11247
+ if (wasLive && !isLive(rm4, decl.id)) emitResourcesAvailable();
11172
11248
  const message = err instanceof Error ? err.message : String(err);
11173
11249
  log(`[session-resource] runner.attach_instance connector failed for ${decl.id}: ${message}`);
11174
11250
  return { ok: false, code: "connector_connect_failed", message };
@@ -11182,13 +11258,13 @@ function buildSessionResourceHandlers(deps) {
11182
11258
  addMount: (input) => add("mount", input),
11183
11259
  attachConnectorInstance,
11184
11260
  removeResource: async (input) => {
11185
- const rm3 = getResourceManager();
11186
- if (!rm3) return { ok: false, code: "no_session", message: "session resources not ready" };
11187
- if (!rm3.has(input.id)) {
11261
+ const rm4 = getResourceManager();
11262
+ if (!rm4) return { ok: false, code: "no_session", message: "session resources not ready" };
11263
+ if (!rm4.has(input.id)) {
11188
11264
  return { ok: false, code: "not_found", message: `no resource with id ${input.id}` };
11189
11265
  }
11190
11266
  try {
11191
- await rm3.disconnect(input.id);
11267
+ await rm4.disconnect(input.id);
11192
11268
  } catch (err) {
11193
11269
  const message = err instanceof Error ? err.message : String(err);
11194
11270
  log(`[session-resource] runner.remove_resource failed for ${input.id}: ${message}`);
@@ -11204,8 +11280,8 @@ function buildSessionResourceHandlers(deps) {
11204
11280
  updateCredential: async (input) => {
11205
11281
  const ps = getPreMintedSecrets();
11206
11282
  if (!ps) return { ok: false, code: "no_session", message: "session resources not ready" };
11207
- const rm3 = getResourceManager();
11208
- if (rm3 && !rm3.has(input.id)) {
11283
+ const rm4 = getResourceManager();
11284
+ if (rm4 && !rm4.has(input.id)) {
11209
11285
  return { ok: false, code: "not_found", message: `no resource with id ${input.id}` };
11210
11286
  }
11211
11287
  ps.set(input.kind, input.id, input.mint);
@@ -11216,6 +11292,13 @@ function buildSessionResourceHandlers(deps) {
11216
11292
  }
11217
11293
 
11218
11294
  // runner/src/mcp-runtime-handlers.ts
11295
+ function invalidAssetName(name) {
11296
+ if (!name) return "name is required";
11297
+ if (name === "." || name.includes("/") || name.includes("\\") || name.includes("..")) {
11298
+ return "name must not contain path separators or traversal segments";
11299
+ }
11300
+ return null;
11301
+ }
11219
11302
  function buildMcpRuntimeHandlers(deps) {
11220
11303
  const resolveManager = () => {
11221
11304
  try {
@@ -11274,16 +11357,8 @@ function buildMcpRuntimeHandlers(deps) {
11274
11357
  message: `attach_instance supports mcp-server only; '${input.kind}' is not yet supported`
11275
11358
  };
11276
11359
  }
11277
- if (!input.name) {
11278
- return { ok: false, code: "invalid_input", message: "name is required" };
11279
- }
11280
- if (input.name.includes("/") || input.name.includes("\\") || input.name.includes("..")) {
11281
- return {
11282
- ok: false,
11283
- code: "invalid_input",
11284
- message: "name must not contain path separators or traversal segments"
11285
- };
11286
- }
11360
+ const invalidName = invalidAssetName(input.name);
11361
+ if (invalidName) return { ok: false, code: "invalid_input", message: invalidName };
11287
11362
  if (!deps.getProjectDir) {
11288
11363
  return { ok: false, code: "no_project_dir", message: "getProjectDir not configured" };
11289
11364
  }
@@ -11315,6 +11390,65 @@ function buildMcpRuntimeHandlers(deps) {
11315
11390
  const code = err instanceof McpServerAlreadyRegisteredError ? "mcp_already_registered" : "mcp_connect_failed";
11316
11391
  return { ok: false, code, message };
11317
11392
  }
11393
+ },
11394
+ // Order matters: the on-disk asset and the live-attach record go first, so
11395
+ // a session rebuild that starts meanwhile cannot respawn the server.
11396
+ detachInstance: async (input) => {
11397
+ if (input.kind !== "mcp-server") {
11398
+ return {
11399
+ ok: false,
11400
+ code: "unsupported_kind",
11401
+ message: `detach_instance supports mcp-server here; '${input.kind}' is not`
11402
+ };
11403
+ }
11404
+ const invalid = invalidAssetName(input.name);
11405
+ if (invalid) return { ok: false, code: "invalid_input", message: invalid };
11406
+ if (!deps.unregisterLiveAttachedMcp) {
11407
+ return {
11408
+ ok: false,
11409
+ code: "not_implemented",
11410
+ message: "detach_instance for mcp-server is not configured"
11411
+ };
11412
+ }
11413
+ const mgr = resolveManager();
11414
+ if (!mgr) return { ok: false, code: "no_session", message: "session resources not ready" };
11415
+ const id = input.name;
11416
+ if (deps.getProjectDir) {
11417
+ const assetDir = join(deps.getProjectDir(), ".skaile/assets/mcp-server", id);
11418
+ try {
11419
+ await rm(assetDir, { recursive: true, force: true });
11420
+ } catch (err) {
11421
+ const message = err instanceof Error ? err.message : String(err);
11422
+ deps.log(`[mcp-runtime] runner.detach_instance could not remove ${assetDir}: ${message}`);
11423
+ return { ok: false, code: "asset_remove_failed", message };
11424
+ }
11425
+ }
11426
+ deps.unregisterLiveAttachedMcp(id);
11427
+ const wasConnected = mgr.listServers().some((s) => s.id === id);
11428
+ try {
11429
+ await mgr.removeServer(id);
11430
+ } catch (err) {
11431
+ const message = err instanceof Error ? err.message : String(err);
11432
+ deps.log(`[mcp-runtime] runner.detach_instance failed to remove ${id}: ${message}`);
11433
+ return { ok: false, code: "mcp_remove_failed", message };
11434
+ }
11435
+ deps.getPreMintedSecrets()?.unset("mcp", id);
11436
+ let live = true;
11437
+ if (wasConnected && !deps.driverPicksUpToolsLive()) {
11438
+ live = false;
11439
+ try {
11440
+ deps.scheduleDriverRestartForToolChanges(`MCP server '${id}' removal`);
11441
+ } catch (err) {
11442
+ deps.log(
11443
+ `[mcp-runtime] scheduling the restart for ${id} failed: ${err instanceof Error ? err.message : String(err)}`
11444
+ );
11445
+ }
11446
+ }
11447
+ deps.emitResourcesAvailable();
11448
+ deps.log(
11449
+ wasConnected ? `[mcp-runtime] runner.detach_instance removed ${id}${live ? "" : " (driver restart queued)"}` : `[mcp-runtime] runner.detach_instance: ${id} was not connected; records cleared`
11450
+ );
11451
+ return { ok: true, id, removed: wasConnected, live };
11318
11452
  }
11319
11453
  };
11320
11454
  }
@@ -11424,7 +11558,6 @@ function buildRunnerCapabilities(handlers) {
11424
11558
  });
11425
11559
  }
11426
11560
  }),
11427
- // TODO(mcp-detach): no runner.remove_mcp_server yet — live MCP detach + mcp: credential cleanup deferred with the attach-by-ref rework.
11428
11561
  defineCapability({
11429
11562
  name: "runner.add_mcp_server",
11430
11563
  displayName: "Add MCP server",
@@ -11463,7 +11596,7 @@ function buildRunnerCapabilities(handlers) {
11463
11596
  defineCapability({
11464
11597
  name: "runner.detach_instance",
11465
11598
  displayName: "Detach instance",
11466
- description: "Unload an instance the platform unassigned from the live session. Skills only: removes the runner-staged copy and materialized asset, then restarts the driver without killing an in-flight turn. A same-named dir the runner did not stage is left in place (reason: not_staged).",
11599
+ description: "Unload an instance the platform unassigned from the live session. kind 'skill': removes the runner-staged copy and materialized asset, then restarts the driver without killing an in-flight turn; a same-named dir the runner did not stage is left in place (reason: not_staged). kind 'mcp-server': removes the server's tools, its mcp: credential and its materialized asset; restarts the driver (once per burst of detaches) only when the driver cannot drop tools live.",
11467
11600
  side: "agent",
11468
11601
  origin: RUNNER_CAP_ORIGIN,
11469
11602
  audience: ["runtime"],
@@ -11597,6 +11730,7 @@ function wireSessionCapabilities(deps) {
11597
11730
  attachSkillInstance,
11598
11731
  detachSkillInstance,
11599
11732
  registerLiveAttachedMcp,
11733
+ unregisterLiveAttachedMcp,
11600
11734
  scheduleDriverRestartForToolChanges,
11601
11735
  getDriver,
11602
11736
  rememberReconfigure,
@@ -11615,6 +11749,7 @@ function wireSessionCapabilities(deps) {
11615
11749
  getPreMintedSecrets: () => getPreMintedSecrets() ?? null,
11616
11750
  driverPicksUpToolsLive,
11617
11751
  registerLiveAttachedMcp,
11752
+ unregisterLiveAttachedMcp,
11618
11753
  scheduleDriverRestartForToolChanges,
11619
11754
  emitResourcesAvailable,
11620
11755
  log,
@@ -11639,12 +11774,15 @@ function wireSessionCapabilities(deps) {
11639
11774
  message: "attach_instance handler not configured"
11640
11775
  };
11641
11776
  },
11642
- // Only skills have a live unload path; a connector or mount detaches
11643
- // through remove_resource, and MCP servers have no detach yet.
11777
+ // Skills and MCP servers have a live unload path; a connector or mount
11778
+ // detaches through remove_resource.
11644
11779
  detachInstance: async (input) => {
11645
11780
  if (input.kind === "skill") {
11646
11781
  return detachSkillInstance(input.name);
11647
11782
  }
11783
+ if (input.kind === "mcp-server" && mcpHandlers.detachInstance) {
11784
+ return mcpHandlers.detachInstance(input);
11785
+ }
11648
11786
  return {
11649
11787
  ok: false,
11650
11788
  code: "unsupported_kind",
@@ -11653,16 +11791,16 @@ function wireSessionCapabilities(deps) {
11653
11791
  },
11654
11792
  // setLogLevel left undefined (the cap self-falls-back to getLogStore).
11655
11793
  setState: async (input) => {
11656
- const rm3 = getResourceManager();
11657
- if (!rm3) return { ok: false, code: "no_session", message: "session resources not ready" };
11658
- if (!isSharedStateStore(input.store) || !rm3.has(input.store)) {
11794
+ const rm4 = getResourceManager();
11795
+ if (!rm4) return { ok: false, code: "no_session", message: "session resources not ready" };
11796
+ if (!isSharedStateStore(input.store) || !rm4.has(input.store)) {
11659
11797
  return {
11660
11798
  ok: false,
11661
11799
  code: "store_not_found",
11662
11800
  message: `no shared state store "${input.store}" \u2014 declare it in session_init.sharedState`
11663
11801
  };
11664
11802
  }
11665
- const connector = rm3.get(input.store).connector;
11803
+ const connector = rm4.get(input.store).connector;
11666
11804
  if (typeof connector.onStoreChange !== "function") {
11667
11805
  return {
11668
11806
  ok: false,
@@ -11671,7 +11809,7 @@ function wireSessionCapabilities(deps) {
11671
11809
  };
11672
11810
  }
11673
11811
  try {
11674
- await rm3.executeOp(input.store, "set", {
11812
+ await rm4.executeOp(input.store, "set", {
11675
11813
  key: input.key,
11676
11814
  value: typeof input.value === "string" ? JSON.stringify(input.value) : input.value
11677
11815
  });
@@ -13540,6 +13678,12 @@ async function startAgentServer(opts) {
13540
13678
  liveAttachedMcpDeclarations.set(decl.id, decl);
13541
13679
  bakedMcpServerIds = /* @__PURE__ */ new Set([...bakedMcpServerIds, decl.id]);
13542
13680
  };
13681
+ const unregisterLiveAttachedMcp = (id) => {
13682
+ liveAttachedMcpDeclarations.delete(id);
13683
+ if (bakedMcpServerIds.has(id)) {
13684
+ bakedMcpServerIds = new Set([...bakedMcpServerIds].filter((baked) => baked !== id));
13685
+ }
13686
+ };
13543
13687
  const modelEndpointConfig = {
13544
13688
  ...wsConfig.model_endpoint,
13545
13689
  ...opts.modelEndpoint
@@ -13701,6 +13845,7 @@ async function startAgentServer(opts) {
13701
13845
  logPhase
13702
13846
  });
13703
13847
  let driverRestartChain = Promise.resolve();
13848
+ let toolRestartScheduler;
13704
13849
  let liveDriverActiveAfterTurn = false;
13705
13850
  let driver = secretsMode === "env" ? agentSession.driver : void 0;
13706
13851
  let secretsProvisioned = secretsMode === "env";
@@ -14292,6 +14437,7 @@ async function startAgentServer(opts) {
14292
14437
  attachSkillInstance,
14293
14438
  detachSkillInstance,
14294
14439
  registerLiveAttachedMcp,
14440
+ unregisterLiveAttachedMcp,
14295
14441
  scheduleDriverRestartForToolChanges,
14296
14442
  getDriver: () => driver ?? null,
14297
14443
  rememberReconfigure: (patch) => {
@@ -14357,8 +14503,9 @@ async function startAgentServer(opts) {
14357
14503
  }
14358
14504
  return { needsWireFallbackRecreate, needsWireAgentConfigRecreate };
14359
14505
  }
14360
- async function recreateAgentSession(overrides) {
14506
+ async function recreateAgentSession(overrides, opts2) {
14361
14507
  return turnScheduler.runSwap(async () => {
14508
+ await opts2?.settle?.();
14362
14509
  const resolved = typeof overrides === "function" ? overrides() : overrides;
14363
14510
  if (!resolved) return false;
14364
14511
  await recreateAgentSessionInner(resolved);
@@ -14671,20 +14818,27 @@ async function startAgentServer(opts) {
14671
14818
  return detachStagedSkill(skillStagingDeps, name);
14672
14819
  }
14673
14820
  async function restartDriverForToolChanges(reason) {
14821
+ const batch = typeof reason === "string" ? void 0 : reason;
14822
+ const label = () => batch ? batch.reasons().join(", ") : reason;
14674
14823
  if (!driverStarted) {
14675
- log(`[serve] ${reason} applied before driver start \u2014 picked up on the first prompt`);
14824
+ log(`[serve] ${label()} applied before driver start \u2014 picked up on the first prompt`);
14676
14825
  return;
14677
14826
  }
14678
- await recreateAgentSession(() => {
14679
- if (!driverStarted) {
14680
- log(`[serve] ${reason} applied after an earlier recreate \u2014 picked up on the first prompt`);
14681
- return null;
14682
- }
14683
- const prevSessionId = driver.runtimeSessionId;
14684
- log(`[serve] restarting driver to pick up ${reason} (resume=${prevSessionId ?? "none"})`);
14685
- markPhase(`driver restart: ${reason}`);
14686
- return { resumeSessionId: prevSessionId };
14687
- });
14827
+ await recreateAgentSession(
14828
+ () => {
14829
+ if (!driverStarted) {
14830
+ log(
14831
+ `[serve] ${label()} applied after an earlier recreate \u2014 picked up on the first prompt`
14832
+ );
14833
+ return null;
14834
+ }
14835
+ const prevSessionId = driver.runtimeSessionId;
14836
+ log(`[serve] restarting driver to pick up ${label()} (resume=${prevSessionId ?? "none"})`);
14837
+ markPhase(`driver restart: ${label()}`);
14838
+ return { resumeSessionId: prevSessionId };
14839
+ },
14840
+ batch ? { settle: () => batch.settle() } : void 0
14841
+ );
14688
14842
  }
14689
14843
  function enqueueDriverRestart(reason) {
14690
14844
  const next = driverRestartChain.then(() => restartDriverForToolChanges(reason));
@@ -14693,11 +14847,13 @@ async function startAgentServer(opts) {
14693
14847
  return next;
14694
14848
  }
14695
14849
  function scheduleDriverRestartForToolChanges(reason) {
14696
- void enqueueDriverRestart(reason).catch((err) => {
14697
- log(
14698
- `[serve] background driver restart for ${reason} failed: ${err instanceof Error ? err.message : String(err)}`
14699
- );
14850
+ toolRestartScheduler ??= createCoalescedRestartScheduler({
14851
+ start: (batch) => enqueueDriverRestart(batch),
14852
+ onError: (reasons, err) => log(
14853
+ `[serve] background driver restart for ${reasons.join(", ")} failed: ${err instanceof Error ? err.message : String(err)}`
14854
+ )
14700
14855
  });
14856
+ toolRestartScheduler(reason);
14701
14857
  }
14702
14858
  async function restartDriverForSkillChanges(catalogActions) {
14703
14859
  const restarted = driverStarted;
@@ -15814,5 +15970,5 @@ function touchSession(state) {
15814
15970
  }
15815
15971
 
15816
15972
  export { AgentRunError, CLAUDE_CODE_CREDENTIALS_KEY, COMPILE_MANIFEST_FILENAME, CONNECTOR_MUTATE_NOT_READY, CapabilityRegistry, CompileManifestEntrySchema, CompositionError, DEFAULT_CAPABILITY_CALL_TIMEOUT_MS, DEFAULT_COALESCE_MS, DEFAULT_FLOW_MUTATE_CONNECTOR_WAIT_MS, DEFAULT_MAX_FINISHED_TREES, DEFAULT_RUN_LIMITS, MOUNT_LIST_MAX_DEPTH, MOUNT_LIST_MAX_ENTRIES, MOUNT_READ_DEADLINE_FACTOR, MOUNT_READ_MAX_CHUNK_BYTES, MOUNT_STAT_BUDGET_MS, MOUNT_STAT_MAX_ENTRIES, MOUNT_TREE_OP_DEADLINE_FACTOR, MOUNT_WRITE_MAX_CHUNK_BYTES, MarkdownStreamer, PreInitRingSink, ResourceOperationError, SESSION_ROOT_WRITABLE_DIRS, SESSION_ROOT_WRITABLE_FILES, UnknownCompositionKindError, WRITE_RANGE_PARTIAL_TTL_MS, WS_AUTH_TOKEN_ENV, WS_AUTH_TOKEN_FILE_ENV, agentDefinitionExists, bootstrapCapabilityRegistry, bootstrapRunnerLogStore, buildAgentResources, buildClientCapabilityHandler, buildCompositionRunSnapshot, buildConnectorTokenMediator, buildContextSection, buildEnvironmentSection, buildResourcesAvailablePayload, buildRunnerAgentSections, buildStoreSnapshotReplay, builtinCapabilities, canonicalJson, capabilityLogInstance, capabilitySignatureInputs, clearPreInitRingSink, clearSession, compileComposition, compositionRunSnapshotPath, computeCapabilitySignature, computeDirectoryTotals, computeRevisionHash, connectorRefreshKind, createAgentSession, createCompositionContentSource, createFinalTextFallback, createFlowConnectorReadiness, createInMemoryRunStore, createManagedCodexSubpromptDriver, createRunController, createSessionStimulusBus, defineCapability, deleteSession, describeComposition, dispatchResourceRequest, dispatchRunnerCapabilityInvocation, driverActiveAfterTurnEnd, emitSystemPromptComposed, ensureClaudeSettingsDisablesConnectors, ensureGitConfigInclude, executeConnectorMutate, extractClaudeAiOauthExpiresAt, flowStartNeedsDriverRestart, getPreInitRingSink, handleMountResourceRequest, handleResourceRequest, handleSessionRootResourceRequest, hasNonTerminalFlow, hashAgentFiles, hashContent, hostOpResumeStimulus, installPreInitRingSink, instanceForSession, instanceSessionOverrides, isCompositionError, isEmptyKnowledgeIndex, isSessionRootPathAllowed, listSessions, loadAgentManifest, loadCompileManifest, loadCompileManifestFromDir, loadCompositionRunSnapshot, loadKnowledgeDir, loadManagedCodexHostConfig, loadSession, loadSessionById, manifestModelForDriver, mcpAuthSecretKey, newSession, nulTailPaddingLength, pickChatFlowTarget, pickFlowToolTarget, pickRepointedManager, planFlowMutate, prepareCodexTools, reconcilePendingDecisions, reconnectedRunNeedsAgentTurn, recreateKeepingLiveFlows, registerActiveFlow, registerCompositionCapabilities, rejectCapabilityOnApprovalDeny, rejectPendingCapabilityCallsOnDisconnect, resetRunnerLogStore, resolveAgentInstance, resolveBinding, resolveCapabilityCallTimeoutMs, resolveCapabilityResult, resolveComposition, resolveFlowMutateConnectorWaitMs, resolveInstanceAgentDir, resolveMixin, resolveSessionId, restoredRunHasWorkToResume, runAgentChat, saveCompositionRunSnapshot, saveSession, setCurrentSession, setUpFlowConnector, startAgentServer, stimulusFromMetas, stripFrontmatter, takeRunnerWsAuthToken, toActiveFlowTarget, touchSession, unresolvedCredentialNotices, validateInputResponse, verifyConventionItems, writeClaudeCodeCredentialsFile, writeRangeChunk, writeRangePartialPath };
15817
- //# sourceMappingURL=chunk-CQFVKN6S.js.map
15818
- //# sourceMappingURL=chunk-CQFVKN6S.js.map
15973
+ //# sourceMappingURL=chunk-V4RV2NJF.js.map
15974
+ //# sourceMappingURL=chunk-V4RV2NJF.js.map