@skaile/workspaces 4.34.0 → 4.36.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 (245) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/{asset-feeds-EIHLRBUG.js → asset-feeds-SJELMLNK.js} +10 -10
  3. package/dist/{asset-feeds-EIHLRBUG.js.map → asset-feeds-SJELMLNK.js.map} +1 -1
  4. package/dist/asset-manager/catalog-deployer.js +5 -5
  5. package/dist/asset-manager/index.js +10 -10
  6. package/dist/asset-manager/installer.js +7 -7
  7. package/dist/asset-manager/renderers.js +2 -2
  8. package/dist/asset-manager/src/index.d.ts +18 -0
  9. package/dist/asset-manager/src/index.d.ts.map +1 -1
  10. package/dist/asset-manager/src/mcp-config.d.ts.map +1 -1
  11. package/dist/bridge/drivers/claude-sdk.js +12 -9
  12. package/dist/bridge/drivers/claude-sdk.js.map +1 -1
  13. package/dist/bridge/drivers/codex.js +7 -7
  14. package/dist/bridge/drivers/continue.js +8 -8
  15. package/dist/bridge/drivers/echo.js +1 -1
  16. package/dist/bridge/drivers/gemini.js +6 -6
  17. package/dist/bridge/drivers/goose.js +8 -8
  18. package/dist/bridge/drivers/omp.js +7 -4
  19. package/dist/bridge/drivers/omp.js.map +1 -1
  20. package/dist/bridge/drivers/opencode.js +8 -8
  21. package/dist/bridge/drivers/qwen.js +6 -6
  22. package/dist/bridge/index.js +9 -9
  23. package/dist/bridge/src/drivers/claude-sdk.d.ts +1 -0
  24. package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
  25. package/dist/bridge/src/drivers/omp.d.ts +3 -2
  26. package/dist/bridge/src/drivers/omp.d.ts.map +1 -1
  27. package/dist/bridge/src/types.d.ts +8 -0
  28. package/dist/bridge/src/types.d.ts.map +1 -1
  29. package/dist/{chunk-TGE33MKN.js → chunk-2D3C4AJP.js} +4 -2
  30. package/dist/chunk-2D3C4AJP.js.map +1 -0
  31. package/dist/{chunk-JRSCSYRF.js → chunk-3CLUU45N.js} +7 -7
  32. package/dist/{chunk-JRSCSYRF.js.map → chunk-3CLUU45N.js.map} +1 -1
  33. package/dist/{chunk-T3YUSWVK.js → chunk-3SUWLY3H.js} +3 -3
  34. package/dist/{chunk-T3YUSWVK.js.map → chunk-3SUWLY3H.js.map} +1 -1
  35. package/dist/{chunk-NVQLE4MK.js → chunk-3VUHHDZW.js} +3 -3
  36. package/dist/{chunk-NVQLE4MK.js.map → chunk-3VUHHDZW.js.map} +1 -1
  37. package/dist/{chunk-LA7DCX2U.js → chunk-422WJ2QC.js} +4 -4
  38. package/dist/{chunk-LA7DCX2U.js.map → chunk-422WJ2QC.js.map} +1 -1
  39. package/dist/{chunk-Q6NDQ6BH.js → chunk-5JAO4MXA.js} +3 -3
  40. package/dist/{chunk-Q6NDQ6BH.js.map → chunk-5JAO4MXA.js.map} +1 -1
  41. package/dist/{chunk-ENV5DDQ7.js → chunk-5JJ5KQUM.js} +6 -6
  42. package/dist/{chunk-ENV5DDQ7.js.map → chunk-5JJ5KQUM.js.map} +1 -1
  43. package/dist/{chunk-AKBPLLFB.js → chunk-5L55HNNA.js} +5 -5
  44. package/dist/{chunk-AKBPLLFB.js.map → chunk-5L55HNNA.js.map} +1 -1
  45. package/dist/{chunk-DOF77WEV.js → chunk-BSIHJZKN.js} +6 -6
  46. package/dist/{chunk-DOF77WEV.js.map → chunk-BSIHJZKN.js.map} +1 -1
  47. package/dist/{chunk-VOXFI3XS.js → chunk-DFZDL62S.js} +4 -4
  48. package/dist/{chunk-VOXFI3XS.js.map → chunk-DFZDL62S.js.map} +1 -1
  49. package/dist/{chunk-3ELIPWCH.js → chunk-FJYOQMXT.js} +4 -4
  50. package/dist/{chunk-3ELIPWCH.js.map → chunk-FJYOQMXT.js.map} +1 -1
  51. package/dist/{chunk-7HJ6SFFF.js → chunk-FLGLODDF.js} +3 -3
  52. package/dist/{chunk-7HJ6SFFF.js.map → chunk-FLGLODDF.js.map} +1 -1
  53. package/dist/{chunk-JR2QQLAQ.js → chunk-FQE2NBUH.js} +7 -7
  54. package/dist/{chunk-JR2QQLAQ.js.map → chunk-FQE2NBUH.js.map} +1 -1
  55. package/dist/{chunk-OWN2W2IW.js → chunk-FWZTKSYI.js} +284 -19
  56. package/dist/chunk-FWZTKSYI.js.map +1 -0
  57. package/dist/{chunk-P2DLXBZK.js → chunk-H3KXUUYQ.js} +4 -4
  58. package/dist/{chunk-P2DLXBZK.js.map → chunk-H3KXUUYQ.js.map} +1 -1
  59. package/dist/{chunk-7LZJRVKJ.js → chunk-JRSLMZOT.js} +59 -11
  60. package/dist/chunk-JRSLMZOT.js.map +1 -0
  61. package/dist/{chunk-OS6256B2.js → chunk-KVDXSEQH.js} +317 -30
  62. package/dist/chunk-KVDXSEQH.js.map +1 -0
  63. package/dist/{chunk-FDZL5QVZ.js → chunk-L22WTIIC.js} +3 -3
  64. package/dist/{chunk-FDZL5QVZ.js.map → chunk-L22WTIIC.js.map} +1 -1
  65. package/dist/{chunk-N2UGG6WV.js → chunk-LIS5KT2X.js} +4 -4
  66. package/dist/{chunk-N2UGG6WV.js.map → chunk-LIS5KT2X.js.map} +1 -1
  67. package/dist/{chunk-Z2QI42YH.js → chunk-LVRKJW53.js} +22 -8
  68. package/dist/chunk-LVRKJW53.js.map +1 -0
  69. package/dist/{chunk-TB3LJ6NA.js → chunk-MDBAEEY5.js} +3 -3
  70. package/dist/{chunk-TB3LJ6NA.js.map → chunk-MDBAEEY5.js.map} +1 -1
  71. package/dist/{chunk-MTWZ7KHZ.js → chunk-MQU632EK.js} +11 -2
  72. package/dist/chunk-MQU632EK.js.map +1 -0
  73. package/dist/{chunk-C3256F2F.js → chunk-MRS5YHPI.js} +3 -3
  74. package/dist/{chunk-C3256F2F.js.map → chunk-MRS5YHPI.js.map} +1 -1
  75. package/dist/{chunk-7LBPHRRP.js → chunk-NFECHLV6.js} +3 -3
  76. package/dist/{chunk-7LBPHRRP.js.map → chunk-NFECHLV6.js.map} +1 -1
  77. package/dist/{chunk-GKTFGCQZ.js → chunk-NKYNDLCB.js} +3 -3
  78. package/dist/{chunk-GKTFGCQZ.js.map → chunk-NKYNDLCB.js.map} +1 -1
  79. package/dist/{chunk-LX3FKVLL.js → chunk-NTASYPDN.js} +3 -3
  80. package/dist/{chunk-LX3FKVLL.js.map → chunk-NTASYPDN.js.map} +1 -1
  81. package/dist/{chunk-WFRVQ2RY.js → chunk-NVNKPWL4.js} +10 -10
  82. package/dist/{chunk-WFRVQ2RY.js.map → chunk-NVNKPWL4.js.map} +1 -1
  83. package/dist/{chunk-75LXFKQR.js → chunk-O63QZ6XX.js} +4 -4
  84. package/dist/{chunk-75LXFKQR.js.map → chunk-O63QZ6XX.js.map} +1 -1
  85. package/dist/{chunk-7IH3RKKK.js → chunk-OEBAXTQ4.js} +3 -3
  86. package/dist/{chunk-7IH3RKKK.js.map → chunk-OEBAXTQ4.js.map} +1 -1
  87. package/dist/{chunk-RR4PJZLK.js → chunk-PKGI5QG7.js} +64 -8
  88. package/dist/chunk-PKGI5QG7.js.map +1 -0
  89. package/dist/{chunk-TGJIX77V.js → chunk-Q7SIVPM2.js} +3 -3
  90. package/dist/{chunk-TGJIX77V.js.map → chunk-Q7SIVPM2.js.map} +1 -1
  91. package/dist/{chunk-T762W5CI.js → chunk-QABZZROM.js} +3 -3
  92. package/dist/{chunk-T762W5CI.js.map → chunk-QABZZROM.js.map} +1 -1
  93. package/dist/{chunk-LRCSWOZO.js → chunk-QKXDRBLL.js} +5 -3
  94. package/dist/chunk-QKXDRBLL.js.map +1 -0
  95. package/dist/{chunk-DHLE66FV.js → chunk-S63H4HDH.js} +8 -4
  96. package/dist/chunk-S63H4HDH.js.map +1 -0
  97. package/dist/{chunk-2FBPAR2V.js → chunk-SQ7IN7KR.js} +3 -2
  98. package/dist/chunk-SQ7IN7KR.js.map +1 -0
  99. package/dist/{chunk-2EUW6NZD.js → chunk-TILISP6X.js} +2 -2
  100. package/dist/{chunk-2EUW6NZD.js.map → chunk-TILISP6X.js.map} +1 -1
  101. package/dist/{chunk-5YXKEM7Q.js → chunk-VCLN2IUM.js} +5 -5
  102. package/dist/{chunk-5YXKEM7Q.js.map → chunk-VCLN2IUM.js.map} +1 -1
  103. package/dist/{chunk-JRIU5GA7.js → chunk-VRFKCF3R.js} +4 -4
  104. package/dist/{chunk-JRIU5GA7.js.map → chunk-VRFKCF3R.js.map} +1 -1
  105. package/dist/{chunk-7ERHZQ7O.js → chunk-XN7DAZB7.js} +3 -3
  106. package/dist/{chunk-7ERHZQ7O.js.map → chunk-XN7DAZB7.js.map} +1 -1
  107. package/dist/{chunk-RHESVS7V.js → chunk-YOIENZHA.js} +6 -6
  108. package/dist/{chunk-RHESVS7V.js.map → chunk-YOIENZHA.js.map} +1 -1
  109. package/dist/cli/index.js +69 -61
  110. package/dist/cli/index.js.map +1 -1
  111. package/dist/cli/src/commands/catalog.d.ts +7 -0
  112. package/dist/cli/src/commands/catalog.d.ts.map +1 -1
  113. package/dist/cli/src/commands/connector.d.ts.map +1 -1
  114. package/dist/connectors/config.js +3 -3
  115. package/dist/connectors/index.js +12 -12
  116. package/dist/connectors/src/config.d.ts.map +1 -1
  117. package/dist/connectors/src/connect-failure-carry-over.d.ts +38 -0
  118. package/dist/connectors/src/connect-failure-carry-over.d.ts.map +1 -0
  119. package/dist/connectors/src/connector-manager.d.ts +15 -0
  120. package/dist/connectors/src/connector-manager.d.ts.map +1 -1
  121. package/dist/connectors/src/connector-types.d.ts +7 -0
  122. package/dist/connectors/src/connector-types.d.ts.map +1 -1
  123. package/dist/connectors/src/index.d.ts +1 -0
  124. package/dist/connectors/src/index.d.ts.map +1 -1
  125. package/dist/connectors/src/materialized-connectors.d.ts.map +1 -1
  126. package/dist/core/index.js +4 -4
  127. package/dist/core/manifest.js +1 -1
  128. package/dist/core/runtime-assets.js +3 -3
  129. package/dist/core/src/manifest.d.ts.map +1 -1
  130. package/dist/core/src/workspace-config.d.ts +7 -0
  131. package/dist/core/src/workspace-config.d.ts.map +1 -1
  132. package/dist/core/workspace-config.js +2 -2
  133. package/dist/deploy/index.js +4 -4
  134. package/dist/discovery/index.js +3 -3
  135. package/dist/{ensure-sources-JR4QI2MY.js → ensure-sources-SYZO2HNP.js} +13 -13
  136. package/dist/{ensure-sources-JR4QI2MY.js.map → ensure-sources-SYZO2HNP.js.map} +1 -1
  137. package/dist/factory-assets/connectors/box.js +12 -12
  138. package/dist/factory-assets/connectors/deploy.js +12 -12
  139. package/dist/factory-assets/connectors/devserver.js +12 -12
  140. package/dist/factory-assets/connectors/flow/adapter.js +12 -12
  141. package/dist/factory-assets/connectors/flow/engine.js +5 -5
  142. package/dist/factory-assets/connectors/flow/run-flow.js +14 -14
  143. package/dist/factory-assets/connectors/flow.js +12 -12
  144. package/dist/factory-assets/connectors/git/CONNECTOR.md +1 -0
  145. package/dist/factory-assets/connectors/git/driver.d.ts +29 -0
  146. package/dist/factory-assets/connectors/git/driver.d.ts.map +1 -1
  147. package/dist/factory-assets/connectors/git.js +12 -12
  148. package/dist/factory-assets/connectors/gmail.js +12 -12
  149. package/dist/factory-assets/connectors/googledrive.js +12 -12
  150. package/dist/factory-assets/connectors/local.js +12 -12
  151. package/dist/factory-assets/connectors/mattermost.js +12 -12
  152. package/dist/factory-assets/connectors/memory.js +12 -12
  153. package/dist/factory-assets/connectors/minio.js +12 -12
  154. package/dist/factory-assets/connectors/postgres.js +12 -12
  155. package/dist/factory-assets/connectors/s3.js +12 -12
  156. package/dist/factory-assets/connectors/sharepoint.js +12 -12
  157. package/dist/factory-assets/connectors/sqlite.js +12 -12
  158. package/dist/factory-assets/connectors/static-server.js +12 -12
  159. package/dist/factory-assets/connectors/tunnel.js +12 -12
  160. package/dist/factory-assets/connectors/webdav.js +12 -12
  161. package/dist/factory-assets/connectors/xstate-store.js +12 -12
  162. package/dist/factory-assets/connectors/xstate.js +12 -12
  163. package/dist/{flows-X7JFAVRR.js → flows-6MDMBQUZ.js} +9 -9
  164. package/dist/{flows-X7JFAVRR.js.map → flows-6MDMBQUZ.js.map} +1 -1
  165. package/dist/{helpers-HTET53KB.js → helpers-IMUCDNME.js} +13 -13
  166. package/dist/{helpers-HTET53KB.js.map → helpers-IMUCDNME.js.map} +1 -1
  167. package/dist/library/index.js +7 -7
  168. package/dist/{library-publish-T6KHQ3TE.js → library-publish-XAIAHKRL.js} +17 -17
  169. package/dist/{library-publish-T6KHQ3TE.js.map → library-publish-XAIAHKRL.js.map} +1 -1
  170. package/dist/{open-library-O5I2DAEK.js → open-library-6N3XZ2XL.js} +15 -15
  171. package/dist/{open-library-O5I2DAEK.js.map → open-library-6N3XZ2XL.js.map} +1 -1
  172. package/dist/{paths-OI5IIS22.js → paths-4MTICP3T.js} +7 -7
  173. package/dist/{paths-OI5IIS22.js.map → paths-4MTICP3T.js.map} +1 -1
  174. package/dist/{plugin-store-C67RLSPD.js → plugin-store-GQ4WQZJ2.js} +6 -6
  175. package/dist/{plugin-store-C67RLSPD.js.map → plugin-store-GQ4WQZJ2.js.map} +1 -1
  176. package/dist/{project-QIOXU2NS.js → project-HESTMGPU.js} +14 -14
  177. package/dist/{project-QIOXU2NS.js.map → project-HESTMGPU.js.map} +1 -1
  178. package/dist/resolver/index.js +5 -5
  179. package/dist/runner/index.js +21 -21
  180. package/dist/runner/src/capability-registry.d.ts +13 -0
  181. package/dist/runner/src/capability-registry.d.ts.map +1 -1
  182. package/dist/runner/src/compaction/orchestrator.d.ts +8 -0
  183. package/dist/runner/src/compaction/orchestrator.d.ts.map +1 -1
  184. package/dist/runner/src/compaction-gate.d.ts +64 -1
  185. package/dist/runner/src/compaction-gate.d.ts.map +1 -1
  186. package/dist/runner/src/driver-swap-gate.d.ts +17 -0
  187. package/dist/runner/src/driver-swap-gate.d.ts.map +1 -1
  188. package/dist/runner/src/external-mcp.d.ts +6 -0
  189. package/dist/runner/src/external-mcp.d.ts.map +1 -1
  190. package/dist/runner/src/mcp-pinned-ca.d.ts +8 -0
  191. package/dist/runner/src/mcp-pinned-ca.d.ts.map +1 -0
  192. package/dist/runner/src/prompt-turn-queue.d.ts +28 -0
  193. package/dist/runner/src/prompt-turn-queue.d.ts.map +1 -0
  194. package/dist/runner/src/resources.d.ts.map +1 -1
  195. package/dist/runner/src/serve.d.ts +46 -0
  196. package/dist/runner/src/serve.d.ts.map +1 -1
  197. package/dist/runner/src/session-stimulus.d.ts +5 -0
  198. package/dist/runner/src/session-stimulus.d.ts.map +1 -1
  199. package/dist/sdk/asset-manager.js +10 -10
  200. package/dist/sdk/bridge.js +9 -9
  201. package/dist/sdk/core.js +4 -4
  202. package/dist/sdk/flow.js +5 -5
  203. package/dist/sdk/index.js +21 -21
  204. package/dist/sdk/resolver.js +5 -5
  205. package/dist/sdk/runner.js +21 -21
  206. package/dist/sdk/session.js +1 -1
  207. package/dist/sdk/store.js +1 -1
  208. package/dist/session/index.js +1 -1
  209. package/dist/session/src/bounded-subscriber-transport.d.ts +11 -4
  210. package/dist/session/src/bounded-subscriber-transport.d.ts.map +1 -1
  211. package/dist/session/src/dispatcher.d.ts +5 -0
  212. package/dist/session/src/dispatcher.d.ts.map +1 -1
  213. package/dist/session/src/index.d.ts +1 -1
  214. package/dist/session/src/index.d.ts.map +1 -1
  215. package/dist/session/src/types.d.ts +20 -1
  216. package/dist/session/src/types.d.ts.map +1 -1
  217. package/dist/{setup-SSGPDDWL.js → setup-PQG5DH5Z.js} +18 -18
  218. package/dist/{setup-SSGPDDWL.js.map → setup-PQG5DH5Z.js.map} +1 -1
  219. package/dist/{skills-4YTVHMOH.js → skills-JHUY4DFE.js} +10 -10
  220. package/dist/{skills-4YTVHMOH.js.map → skills-JHUY4DFE.js.map} +1 -1
  221. package/dist/{source-NPU7ZWID.js → source-PNYNVVPM.js} +16 -16
  222. package/dist/{source-NPU7ZWID.js.map → source-PNYNVVPM.js.map} +1 -1
  223. package/dist/{source-manifest-publish-4EYDVPR3.js → source-manifest-publish-6O6H4T2P.js} +18 -18
  224. package/dist/{source-manifest-publish-4EYDVPR3.js.map → source-manifest-publish-6O6H4T2P.js.map} +1 -1
  225. package/dist/store/index.js +1 -1
  226. package/dist/store/src/store.d.ts +21 -1
  227. package/dist/store/src/store.d.ts.map +1 -1
  228. package/dist/tui/index.js +21 -21
  229. package/dist/types/manifests.js +1 -1
  230. package/dist/types/src/manifests/mcp-server.d.ts +1 -0
  231. package/dist/types/src/manifests/mcp-server.d.ts.map +1 -1
  232. package/dist/workspace-plugin/adapters/mcp.js +10 -10
  233. package/dist/workspace-plugin/adapters/omp.js +7 -7
  234. package/dist/workspace-plugin/index.js +1 -1
  235. package/package.json +2 -2
  236. package/dist/chunk-2FBPAR2V.js.map +0 -1
  237. package/dist/chunk-7LZJRVKJ.js.map +0 -1
  238. package/dist/chunk-DHLE66FV.js.map +0 -1
  239. package/dist/chunk-LRCSWOZO.js.map +0 -1
  240. package/dist/chunk-MTWZ7KHZ.js.map +0 -1
  241. package/dist/chunk-OS6256B2.js.map +0 -1
  242. package/dist/chunk-OWN2W2IW.js.map +0 -1
  243. package/dist/chunk-RR4PJZLK.js.map +0 -1
  244. package/dist/chunk-TGE33MKN.js.map +0 -1
  245. package/dist/chunk-Z2QI42YH.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../store/src/store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAEZ,UAAU,EAGV,OAAO,EAGR,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAwJpB;;;;;;;;;GASG;AACH,qBAAa,UAAW,YAAW,iBAAiB,CAAC,kBAAkB,CAAC;IACtE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoB;IAC7C,OAAO,CAAC,SAAS,CAAY;IAC7B,OAAO,CAAC,cAAc,CAAM;IAC5B,OAAO,CAAC,cAAc,CAAM;IAC5B,OAAO,CAAC,OAAO,CAA4B;IAC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AAiB;IASzB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,YAAY;IA6OpB;;;;;OAKG;IACH,OAAO,CAAC,eAAe;IAQvB,OAAO,CAAC,cAAc;IAetB,OAAO,CAAC,OAAO;CAMhB"}
package/dist/tui/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import { createAgentSession } from '../chunk-OS6256B2.js';
2
- import '../chunk-2EUW6NZD.js';
3
- import '../chunk-N2UGG6WV.js';
4
- import '../chunk-C3256F2F.js';
5
- import '../chunk-P2DLXBZK.js';
6
- import '../chunk-7IH3RKKK.js';
1
+ import { createAgentSession } from '../chunk-KVDXSEQH.js';
2
+ import '../chunk-TILISP6X.js';
3
+ import '../chunk-LIS5KT2X.js';
4
+ import '../chunk-MRS5YHPI.js';
5
+ import '../chunk-H3KXUUYQ.js';
6
+ import '../chunk-OEBAXTQ4.js';
7
7
  import '../chunk-4ZTPYIBE.js';
8
8
  import '../chunk-35G4M33T.js';
9
9
  import '../chunk-R6O6YWU7.js';
@@ -15,49 +15,49 @@ import '../chunk-5LKOAX7I.js';
15
15
  import '../chunk-32NA4TVC.js';
16
16
  import '../chunk-W3UDISS2.js';
17
17
  import '../chunk-HCYS7GFP.js';
18
- import '../chunk-JRSCSYRF.js';
18
+ import '../chunk-3CLUU45N.js';
19
19
  import '../chunk-4R6DROGN.js';
20
- import '../chunk-T3YUSWVK.js';
21
- import '../chunk-Q6NDQ6BH.js';
20
+ import '../chunk-3SUWLY3H.js';
21
+ import '../chunk-5JAO4MXA.js';
22
22
  import '../chunk-6X4DHKHP.js';
23
- import '../chunk-OWN2W2IW.js';
23
+ import '../chunk-FWZTKSYI.js';
24
24
  import '../chunk-ZWTCXL3H.js';
25
- import { loadConnectorDeclarations } from '../chunk-DHLE66FV.js';
26
- import '../chunk-NVQLE4MK.js';
27
- import '../chunk-LX3FKVLL.js';
25
+ import { loadConnectorDeclarations } from '../chunk-S63H4HDH.js';
26
+ import '../chunk-3VUHHDZW.js';
27
+ import '../chunk-NTASYPDN.js';
28
28
  import '../chunk-EINLFFP6.js';
29
29
  import '../chunk-LOO5CB5M.js';
30
30
  import '../chunk-TTITGVXV.js';
31
- import '../chunk-75LXFKQR.js';
31
+ import '../chunk-O63QZ6XX.js';
32
32
  import '../chunk-XBSQ4KMC.js';
33
33
  import '../chunk-YROR332M.js';
34
- import '../chunk-MTWZ7KHZ.js';
34
+ import '../chunk-MQU632EK.js';
35
35
  import '../chunk-6E6PKKAD.js';
36
36
  import '../chunk-IFGTRL2I.js';
37
- import '../chunk-7HJ6SFFF.js';
37
+ import '../chunk-FLGLODDF.js';
38
38
  import '../chunk-YYH5EVPM.js';
39
39
  import '../chunk-DIQDYNXZ.js';
40
40
  import '../chunk-K3IBZ2UZ.js';
41
41
  import '../chunk-UDFWBALP.js';
42
42
  import '../chunk-ORH2BZEM.js';
43
43
  import '../chunk-JS7DCCDA.js';
44
- import { resolveSettings } from '../chunk-3ELIPWCH.js';
44
+ import { resolveSettings } from '../chunk-FJYOQMXT.js';
45
45
  import '../chunk-4GY63JU6.js';
46
- import '../chunk-JRIU5GA7.js';
46
+ import '../chunk-VRFKCF3R.js';
47
47
  import '../chunk-KIFJWSNC.js';
48
48
  import '../chunk-K5GBV4SA.js';
49
49
  import '../chunk-QVZA2MDT.js';
50
- import { resolveAgentDir } from '../chunk-LRCSWOZO.js';
50
+ import { resolveAgentDir } from '../chunk-QKXDRBLL.js';
51
51
  import '../chunk-EB4ZTESQ.js';
52
52
  import '../chunk-P4VHQA4N.js';
53
- import '../chunk-2FBPAR2V.js';
53
+ import '../chunk-SQ7IN7KR.js';
54
54
  import '../chunk-GEEW6SY2.js';
55
55
  import '../chunk-JMKB7IB4.js';
56
56
  import '../chunk-ICSCSM5D.js';
57
57
  import '../chunk-MJHSLODD.js';
58
58
  import '../chunk-C3CAXQMA.js';
59
59
  import '../chunk-BOFL7GIF.js';
60
- import '../chunk-TGE33MKN.js';
60
+ import '../chunk-2D3C4AJP.js';
61
61
  import '../chunk-NSBPE2FW.js';
62
62
  import { existsSync, readFileSync, statSync, readdirSync } from 'fs';
63
63
  import { resolve, join, basename, parse, dirname } from 'path';
@@ -1,4 +1,4 @@
1
- export { ANTHROPIC_FIRST_PARTY_HOSTS, ANTHROPIC_FULL_ID_PATTERN, ANTHROPIC_MODEL_ALIASES, ANTHROPIC_MODEL_FAMILIES, AgentComposeItemSchema, AgentManifestSchema, AgentToolsSchema, ArtifactRefSchema, AssetKindSchema, AssetKindValues, BEDROCK_MODEL_ID_PATTERN, BaseFrontmatterSchema, BindingSchema, BindingValues, CommonMetadataSchema, ConnectorManifestSchema, ContractManifestSchema, FieldSchema, FilePrerequisiteSchema, FreeFormModelIdSchema, McpServerManifestSchema, ModelIdSchema, ModelSelectorSchema, MountManifestSchema, PersonaManifestSchema, PlaceholderSchema, PlaceholderTypeSchema, PresetItemSchema, PresetManifestSchema, PresetSourceSchema, PromptManifestSchema, RulesetManifestSchema, SkillManifestSchema, UserInputSchema, VERTEX_MODEL_ID_PATTERN, isFirstPartyAnthropicEndpoint, modelIdSchemaForCloud, modelIdSchemaForTarget, normalizeAnthropicModel, requiresAnthropicModelId, validateAgent, validateByKind, validateConnector, validateContract, validateManifest, validateMcpServer, validateMount, validatePersona, validatePreset, validatePrompt, validateRuleset, validateSkill } from '../chunk-TGE33MKN.js';
1
+ export { ANTHROPIC_FIRST_PARTY_HOSTS, ANTHROPIC_FULL_ID_PATTERN, ANTHROPIC_MODEL_ALIASES, ANTHROPIC_MODEL_FAMILIES, AgentComposeItemSchema, AgentManifestSchema, AgentToolsSchema, ArtifactRefSchema, AssetKindSchema, AssetKindValues, BEDROCK_MODEL_ID_PATTERN, BaseFrontmatterSchema, BindingSchema, BindingValues, CommonMetadataSchema, ConnectorManifestSchema, ContractManifestSchema, FieldSchema, FilePrerequisiteSchema, FreeFormModelIdSchema, McpServerManifestSchema, ModelIdSchema, ModelSelectorSchema, MountManifestSchema, PersonaManifestSchema, PlaceholderSchema, PlaceholderTypeSchema, PresetItemSchema, PresetManifestSchema, PresetSourceSchema, PromptManifestSchema, RulesetManifestSchema, SkillManifestSchema, UserInputSchema, VERTEX_MODEL_ID_PATTERN, isFirstPartyAnthropicEndpoint, modelIdSchemaForCloud, modelIdSchemaForTarget, normalizeAnthropicModel, requiresAnthropicModelId, validateAgent, validateByKind, validateConnector, validateContract, validateManifest, validateMcpServer, validateMount, validatePersona, validatePreset, validatePrompt, validateRuleset, validateSkill } from '../chunk-2D3C4AJP.js';
2
2
  import '../chunk-NSBPE2FW.js';
3
3
  //# sourceMappingURL=manifests.js.map
4
4
  //# sourceMappingURL=manifests.js.map
@@ -15,6 +15,7 @@ export declare const McpServerManifestSchema: z.ZodObject<{
15
15
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
16
16
  url: z.ZodOptional<z.ZodString>;
17
17
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
18
+ ca: z.ZodOptional<z.ZodString>;
18
19
  keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
19
20
  license: z.ZodOptional<z.ZodString>;
20
21
  payload: z.ZodOptional<z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../../../../types/src/manifests/mcp-server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,KAAK,wBAAwB,EAAoB,MAAM,cAAc,CAAC;AAE/E,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;iBAkClC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,GAAG,wBAAwB,CAAC,iBAAiB,CAAC,CAE5F"}
1
+ {"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../../../../types/src/manifests/mcp-server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,KAAK,wBAAwB,EAAoB,MAAM,cAAc,CAAC;AAE/E,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;iBAoClC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,GAAG,wBAAwB,CAAC,iBAAiB,CAAC,CAE5F"}
@@ -1,24 +1,24 @@
1
- export { buildWorkspaceMcpServer, buildWorkspaceMcpStdioServer, buildWorkspaceToolDefs, runMcpServerStdio } from '../../chunk-N2UGG6WV.js';
2
- import '../../chunk-C3256F2F.js';
3
- import '../../chunk-P2DLXBZK.js';
4
- import '../../chunk-7IH3RKKK.js';
1
+ export { buildWorkspaceMcpServer, buildWorkspaceMcpStdioServer, buildWorkspaceToolDefs, runMcpServerStdio } from '../../chunk-LIS5KT2X.js';
2
+ import '../../chunk-MRS5YHPI.js';
3
+ import '../../chunk-H3KXUUYQ.js';
4
+ import '../../chunk-OEBAXTQ4.js';
5
5
  import '../../chunk-4ZTPYIBE.js';
6
6
  import '../../chunk-35G4M33T.js';
7
7
  import '../../chunk-R6O6YWU7.js';
8
8
  import '../../chunk-X5YPJV4N.js';
9
- import '../../chunk-T3YUSWVK.js';
10
- import '../../chunk-Q6NDQ6BH.js';
9
+ import '../../chunk-3SUWLY3H.js';
10
+ import '../../chunk-5JAO4MXA.js';
11
11
  import '../../chunk-JS7DCCDA.js';
12
- import '../../chunk-3ELIPWCH.js';
12
+ import '../../chunk-FJYOQMXT.js';
13
13
  import '../../chunk-4GY63JU6.js';
14
- import '../../chunk-JRIU5GA7.js';
14
+ import '../../chunk-VRFKCF3R.js';
15
15
  import '../../chunk-KIFJWSNC.js';
16
16
  import '../../chunk-K5GBV4SA.js';
17
17
  import '../../chunk-QVZA2MDT.js';
18
- import '../../chunk-LRCSWOZO.js';
18
+ import '../../chunk-QKXDRBLL.js';
19
19
  import '../../chunk-EB4ZTESQ.js';
20
20
  import '../../chunk-P4VHQA4N.js';
21
- import '../../chunk-2FBPAR2V.js';
21
+ import '../../chunk-SQ7IN7KR.js';
22
22
  import '../../chunk-GEEW6SY2.js';
23
23
  import '../../chunk-JMKB7IB4.js';
24
24
  import '../../chunk-ICSCSM5D.js';
@@ -74,7 +74,7 @@ function buildOmpToolSet(plugin) {
74
74
  description: "List all available flow definitions from ai-assets.",
75
75
  parameters: {},
76
76
  handler: async () => {
77
- const { flowList } = await import('../../flows-X7JFAVRR.js');
77
+ const { flowList } = await import('../../flows-6MDMBQUZ.js');
78
78
  return (await flowList(plugin.projectDir)).content[0].text;
79
79
  }
80
80
  },
@@ -83,7 +83,7 @@ function buildOmpToolSet(plugin) {
83
83
  description: "List past flow run sessions for this workspace.",
84
84
  parameters: {},
85
85
  handler: async () => {
86
- const { flowListSessions } = await import('../../flows-X7JFAVRR.js');
86
+ const { flowListSessions } = await import('../../flows-6MDMBQUZ.js');
87
87
  return (await flowListSessions(plugin.projectDir)).content[0].text;
88
88
  }
89
89
  },
@@ -92,7 +92,7 @@ function buildOmpToolSet(plugin) {
92
92
  description: "List all skills in the ai-assets catalog.",
93
93
  parameters: { domain: { type: "string", optional: true } },
94
94
  handler: async ({ domain }) => {
95
- const { skillList } = await import('../../skills-4YTVHMOH.js');
95
+ const { skillList } = await import('../../skills-JHUY4DFE.js');
96
96
  return (await skillList(plugin.projectDir, domain)).content[0].text;
97
97
  }
98
98
  },
@@ -101,7 +101,7 @@ function buildOmpToolSet(plugin) {
101
101
  description: "Search skills by name, description, or keywords.",
102
102
  parameters: { query: { type: "string" } },
103
103
  handler: async ({ query }) => {
104
- const { skillSearch } = await import('../../skills-4YTVHMOH.js');
104
+ const { skillSearch } = await import('../../skills-JHUY4DFE.js');
105
105
  return (await skillSearch(plugin.projectDir, query)).content[0].text;
106
106
  }
107
107
  },
@@ -110,7 +110,7 @@ function buildOmpToolSet(plugin) {
110
110
  description: "Show the full SKILL.md content for a skill.",
111
111
  parameters: { skill_id: { type: "string" } },
112
112
  handler: async ({ skill_id }) => {
113
- const { skillShow } = await import('../../skills-4YTVHMOH.js');
113
+ const { skillShow } = await import('../../skills-JHUY4DFE.js');
114
114
  return (await skillShow(plugin.projectDir, skill_id)).content[0].text;
115
115
  }
116
116
  },
@@ -201,7 +201,7 @@ async function handleSlashCommand(plugin, group, args) {
201
201
  }
202
202
  }
203
203
  async function handleFlowCommand(plugin, sub, rest) {
204
- const { flowList, flowShow, flowListSessions, flowGetSession } = await import('../../flows-X7JFAVRR.js');
204
+ const { flowList, flowShow, flowListSessions, flowGetSession } = await import('../../flows-6MDMBQUZ.js');
205
205
  if (!sub || sub === "list") return (await flowList(plugin.projectDir)).content[0].text;
206
206
  if (sub === "show" && rest[0])
207
207
  return (await flowShow(plugin.projectDir, rest[0])).content[0].text;
@@ -230,7 +230,7 @@ async function handleConnectorCommand(plugin, sub, rest) {
230
230
  return "Usage: /connector list | read <id> <path> | exec <id> <op> [json-args] | describe <id>";
231
231
  }
232
232
  async function handleSkillCommand(plugin, sub, rest) {
233
- const { skillList, skillShow, skillSearch } = await import('../../skills-4YTVHMOH.js');
233
+ const { skillList, skillShow, skillSearch } = await import('../../skills-JHUY4DFE.js');
234
234
  if (sub === "run" && rest[0])
235
235
  return (await skillShow(plugin.projectDir, rest[0])).content[0].text;
236
236
  if (!sub || sub === "list") return (await skillList(plugin.projectDir, rest[0])).content[0].text;
@@ -1,4 +1,4 @@
1
- export { PluginStore, WorkspacePlugin, buildClaudePluginFiles, resolveProjectDir } from '../chunk-2EUW6NZD.js';
1
+ export { PluginStore, WorkspacePlugin, buildClaudePluginFiles, resolveProjectDir } from '../chunk-TILISP6X.js';
2
2
  export { err, ok, okJson } from '../chunk-X5YPJV4N.js';
3
3
  import '../chunk-JMKB7IB4.js';
4
4
  import '../chunk-C3CAXQMA.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skaile/workspaces",
3
- "version": "4.34.0",
3
+ "version": "4.36.0",
4
4
  "description": "Skaile workspaces runtime — types, core, bridge, runner, store, connectors, and supporting layers as one publishable package",
5
5
  "type": "module",
6
6
  "packageManager": "bun@1.3.9",
@@ -830,7 +830,7 @@
830
830
  },
831
831
  "devDependencies": {
832
832
  "@anthropic-ai/claude-agent-sdk": "^0.3.289",
833
- "@biomejs/biome": "^2.4.9",
833
+ "@biomejs/biome": "2.4.15",
834
834
  "@openai/codex-sdk": "^0.133.0",
835
835
  "@opentelemetry/api": "^1.9.0",
836
836
  "@opentelemetry/exporter-trace-otlp-http": "^0.218.0",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../core/src/fs-deadline.ts","../core/src/manifest.ts"],"names":[],"mappings":";;;;;;;AA4BO,IAAM,sBAAA,GAAyB;AAQ/B,IAAM,mBAAA,GAAsB;AAQ5B,IAAM,eAAA,GAAN,cAA8B,KAAA,CAAM;AAAA,EAChC,SAAA;AAAA,EACA,SAAA;AAAA,EAET,WAAA,CAAY,WAAmB,SAAA,EAAmB;AAChD,IAAA,KAAA;AAAA,MACE,CAAA,sBAAA,EAAyB,SAAS,CAAA,WAAA,EAAc,SAAS,CAAA,uCAAA;AAAA,KAC3D;AACA,IAAA,IAAA,CAAK,IAAA,GAAO,iBAAA;AACZ,IAAA,IAAA,CAAK,SAAA,GAAY,SAAA;AACjB,IAAA,IAAA,CAAK,SAAA,GAAY,SAAA;AAAA,EACnB;AACF;AAYO,SAAS,YAAA,CAAa,WAAmB,sBAAA,EAAgC;AAC9E,EAAA,MAAM,GAAA,GAAM,OAAA,CAAQ,GAAA,CAAI,mBAAmB,CAAA;AAC3C,EAAA,IAAI,GAAA,KAAQ,QAAW,OAAO,QAAA;AAC9B,EAAA,MAAM,MAAA,GAAS,MAAA,CAAO,QAAA,CAAS,GAAA,EAAK,EAAE,CAAA;AAGtC,EAAA,OAAO,OAAO,QAAA,CAAS,MAAM,CAAA,IAAK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CAAA;AAC/E,MAAA;AAAA,IACF;AACA,IAAA,IAAI;AACF,MAAA,MAAM,KAAA,GAAQ,iBAAA,CAAkB,IAAA,EAAM,OAAA,EAAS,UAAU,QAAQ,CAAA;AACjE,MAAA,IAAI,KAAA,MAAW,KAAK,CAAA;AAAA,IACtB,CAAA,CAAA,MAAQ;AAAA,IAAC;AAAA,EACX;AAEA,EAAA,OAAO,CAAC,GAAG,OAAA,CAAQ,MAAA,EAAQ,CAAA;AAC7B","file":"chunk-2FBPAR2V.js","sourcesContent":["/**\n * Deadline guards for filesystem work that can land on a network mount.\n *\n * Inside the agent container `/skaile/workspace` **is** an rclone FUSE mount\n * (SharePoint / OneDrive / WebDAV). When the host rclone process wedges, a\n * filesystem call against that path parks in an uninterruptible kernel wait.\n * A **synchronous** call there stops the entire single-threaded event loop —\n * the whole `skaile serve` process stops serving, and the platform reads the\n * session as dead or idle. A hang is not an error, so `try/catch` never fires.\n *\n * Two rules follow, and both matter:\n *\n * 1. **Never touch a mount synchronously.** Async `node:fs/promises` keeps the\n * loop free, so a wedged mount degrades to one stuck request instead of a\n * dead session. This is the actual fix.\n * 2. **Bound the wait.** {@link withFsDeadline} converts an unbounded wait into\n * a bounded failure so the requester gets an error rather than nothing.\n *\n * `withFsDeadline` does **not** cancel the underlying operation — Node cannot\n * abort a syscall already in the kernel. The losing promise stays pending until\n * the mount recovers or the process exits. That is acceptable precisely because\n * rule 1 holds: a pending promise costs one handle, not the event loop.\n *\n * Modelled on `connectors/src/fleet-utils.ts` (`ensureFleetMounted`), which\n * already does async-stat-with-deadline correctly.\n */\n\n/** Default deadline for a single filesystem operation on a possibly-networked mount. */\nexport const DEFAULT_FS_DEADLINE_MS = 15_000;\n\n/**\n * Env override for {@link DEFAULT_FS_DEADLINE_MS}, in milliseconds.\n *\n * A cloud-backed mount over a slow link can legitimately need longer than the\n * default; operators raise this rather than patching call sites.\n */\nexport const FS_DEADLINE_ENV_VAR = \"SKAILE_FS_DEADLINE_MS\";\n\n/**\n * Thrown when a filesystem operation misses its deadline.\n *\n * Distinct from a plain `Error` so callers can tell \"the mount is wedged\" apart\n * from \"the file does not exist\" and surface the right message to the frontend.\n */\nexport class FsDeadlineError extends Error {\n readonly timeoutMs: number;\n readonly operation: string;\n\n constructor(operation: string, timeoutMs: number) {\n super(\n `filesystem operation \"${operation}\" exceeded ${timeoutMs}ms — the mount may be unresponsive`,\n );\n this.name = \"FsDeadlineError\";\n this.operation = operation;\n this.timeoutMs = timeoutMs;\n }\n}\n\n/**\n * Resolve the effective filesystem deadline.\n *\n * Reads {@link FS_DEADLINE_ENV_VAR} on every call rather than caching it: the\n * runner mutates `process.env` while wiring a session, so a module-load-time\n * snapshot would pin the value set before configuration ran.\n *\n * @param fallback - Deadline to use when the env var is absent or unusable.\n * @returns The deadline in milliseconds.\n */\nexport function fsDeadlineMs(fallback: number = DEFAULT_FS_DEADLINE_MS): number {\n const raw = process.env[FS_DEADLINE_ENV_VAR];\n if (raw === undefined) return fallback;\n const parsed = Number.parseInt(raw, 10);\n // A non-positive or non-numeric override would disable the guard entirely,\n // which is exactly the failure mode this module exists to prevent.\n return Number.isFinite(parsed) && parsed > 0 ? parsed : fallback;\n}\n\n/**\n * Run an async filesystem operation under a deadline.\n *\n * @param operation - Short label used in the timeout message (e.g. `\"readdir /skaile/workspace\"`).\n * @param fn - Thunk performing the operation. Called immediately.\n * @param timeoutMs - Deadline override; defaults to {@link fsDeadlineMs}.\n * @returns The operation's result.\n * @throws {FsDeadlineError} when the deadline elapses first.\n * @throws Whatever `fn` rejects with, unchanged, when it loses no race.\n * @docLink packages/core/api-reference#with-fs-deadline\n */\nexport async function withFsDeadline<T>(\n operation: string,\n fn: () => Promise<T>,\n timeoutMs: number = fsDeadlineMs(),\n): Promise<T> {\n let timer: ReturnType<typeof setTimeout> | undefined;\n try {\n return await Promise.race([\n fn(),\n new Promise<never>((_resolve, reject) => {\n timer = setTimeout(() => reject(new FsDeadlineError(operation, timeoutMs)), timeoutMs);\n // Never hold the process open on the guard alone — without unref a\n // pending deadline would keep `skaile serve` alive after shutdown.\n timer.unref?.();\n }),\n ]);\n } finally {\n if (timer !== undefined) clearTimeout(timer);\n }\n}\n\n/**\n * Run an async filesystem operation under a deadline, mapping every failure to\n * `fallback`.\n *\n * For best-effort probes that previously used `existsSync` — a missing file, an\n * unreadable file, and a wedged mount are all \"nothing usable here\", and the\n * caller has no better move than to continue without it.\n *\n * @param operation - Short label used in the timeout message.\n * @param fn - Thunk performing the operation.\n * @param fallback - Value returned when `fn` rejects or the deadline elapses.\n * @param timeoutMs - Deadline override; defaults to {@link fsDeadlineMs}.\n */\nexport async function tryWithFsDeadline<T>(\n operation: string,\n fn: () => Promise<T>,\n fallback: T,\n timeoutMs: number = fsDeadlineMs(),\n): Promise<T> {\n try {\n return await withFsDeadline(operation, fn, timeoutMs);\n } catch {\n return fallback;\n }\n}\n","/**\n * Manifest parsing — reads SKILL.md, AGENT.md, agent.yaml, CONTRACT.md,\n * CONNECTOR.md, *.prompt.md, *.flow.yaml, *.bundle.yaml files and\n * produces CatalogEntry objects.\n * Used by @skaile/asset-manager for on-demand repo scanning.\n *\n * **All filesystem access here is async and bounded** (issue #454). A repo root\n * can resolve onto the rclone FUSE mount at `/skaile/workspace` — either\n * directly (a `sources[].path` pointing into the workspace) or indirectly, since\n * the walk follows symlinks and an off-mount tree can link into one. A\n * synchronous `readdirSync`/`statSync`/`readFileSync` there parks the whole\n * `skaile serve` event loop in an uninterruptible kernel wait, and a hang is not\n * an error so `try/catch` never fires. Every call goes through\n * {@link withFsDeadline}/{@link tryWithFsDeadline}, and the walk itself is\n * bounded by depth, entry count, a wall-clock budget, and an ancestor-inode set.\n */\n\nimport type { Dirent } from \"node:fs\";\nimport { opendir, readFile, stat } from \"node:fs/promises\";\nimport { basename, dirname, join } from \"node:path\";\nimport { parse } from \"yaml\";\nimport { fsDeadlineMs, tryWithFsDeadline, withFsDeadline } from \"./fs-deadline.js\";\nimport { createLogger } from \"./logging/create-logger.js\";\nimport type { AssetKind, CatalogEntry, Dependency } from \"./models.js\";\nimport { isValidAssetName, parseDep, slugifyAssetName } from \"./models.js\";\n\n// ── Bounded manifest I/O ──────────────────────────────────────────────────────\n\n/**\n * Read one manifest file under a deadline.\n *\n * @param filePath - Absolute path to the manifest.\n * @param timeoutMs - Per-operation deadline; defaults to {@link fsDeadlineMs}.\n * @throws {import(\"./fs-deadline.js\").FsDeadlineError} when the read outlives the deadline.\n */\nfunction readManifestFile(filePath: string, timeoutMs?: number): Promise<string> {\n return withFsDeadline(`readFile ${filePath}`, () => readFile(filePath, \"utf8\"), timeoutMs);\n}\n\n/**\n * Read one manifest file under a deadline, degrading an unreadable/slow file to\n * an empty document. Mirrors the pre-#454 `try { readFileSync } catch {}` shape\n * of the YAML parsers: a file we cannot read yields `{}` metadata rather than\n * aborting the caller.\n */\nfunction readManifestFileOrEmpty(filePath: string, timeoutMs?: number): Promise<string> {\n return tryWithFsDeadline(`readFile ${filePath}`, () => readFile(filePath, \"utf8\"), \"\", timeoutMs);\n}\n\n// ── Frontmatter helpers ───────────────────────────────────────────────────────\n\n/**\n * Result of parsing YAML frontmatter from a markdown file.\n * @docLink packages/core/concepts#frontmatter-result\n */\nexport interface FrontmatterResult {\n /** Parsed YAML data. Empty object if no frontmatter block is present. */\n data: Record<string, unknown>;\n /** Markdown body below the frontmatter block (trimmed). */\n body: string;\n}\n\n/**\n * Parse YAML frontmatter from a markdown file (`---` delimited).\n * Returns `{ data: {}, body: text }` when no frontmatter block is present.\n *\n * @param text - Raw file contents\n * @returns Parsed frontmatter data and the remaining body text\n * @docLink packages/core/concepts#parse-frontmatter\n */\nexport function parseFrontmatter(text: string): FrontmatterResult {\n const m = text.match(/^---\\s*\\n([\\s\\S]*?)\\n---/);\n if (!m) return { data: {}, body: text.trim() };\n try {\n const data = (parse(m[1]!) as Record<string, unknown>) ?? {};\n const body = text.slice(m[0].length).trim();\n return { data, body };\n } catch {\n return { data: {}, body: text.trim() };\n }\n}\n\n/** Extract version from frontmatter, checking both top-level and metadata.version. */\nfunction extractVersion(meta: Record<string, unknown>): string {\n return String(\n meta.version ?? (meta.metadata as Record<string, unknown> | undefined)?.version ?? \"\",\n );\n}\n\n/**\n * Parse the `requires:` field from manifest frontmatter into typed `Dependency` objects.\n * Accepts a comma-separated string or an array of `\"kind:name\"` strings. Reads from either\n * the root or `metadata.requires` (matching `extractVersion`'s dual-location behavior) so\n * skill authors can follow the agentskills.io convention of placing skaile extensions under\n * `metadata:` while remaining backward-compatible with root-level declarations.\n *\n * @param meta - Parsed frontmatter data object\n * @returns Array of `Dependency` objects (empty when `requires` is absent)\n * @docLink packages/core/concepts#parse-requires\n */\nexport function parseRequires(meta: Record<string, unknown>): Dependency[] {\n const raw = meta.requires ?? (meta.metadata as Record<string, unknown> | undefined)?.requires;\n if (!raw) return [];\n const list =\n typeof raw === \"string\"\n ? raw.split(\",\").map((s) => s.trim())\n : Array.isArray(raw)\n ? (raw as string[])\n : [];\n return list.filter(Boolean).map(parseDep);\n}\n\n// ── agent.yaml dependency collectors ───────────────────────────────────────────\n\n/**\n * Collect named sub-agent dependencies from an `agent.yaml` array field.\n * Each `{name, ...}` object entry becomes an `{kind: \"agent\", name}` dependency.\n * Covers both the new `requires[]` and legacy `dependencies[]` formats.\n */\nfunction collectAgentDeps(raw: unknown, out: Dependency[]): void {\n if (!Array.isArray(raw)) return;\n for (const d of raw) {\n if (typeof d === \"object\" && d !== null && \"name\" in d) {\n out.push({ kind: \"agent\", name: String((d as Record<string, unknown>).name) });\n }\n }\n}\n\n/**\n * Collect string refs from an `agent.yaml` array field (`abilities[]`,\n * `contracts[]`) as `{kind, name}` dependencies, skipping empty entries.\n */\nfunction collectStringRefs(raw: unknown, kind: Dependency[\"kind\"], out: Dependency[]): void {\n if (!Array.isArray(raw)) return;\n for (const r of raw) {\n if (typeof r === \"string\" && r) out.push({ kind, name: r });\n }\n}\n\n/**\n * Collect catalog refs from an `agent.yaml` mixin field (`persona`, `rules`,\n * `knowledge`) as requires so `skaile install` pulls them automatically. Local\n * paths (`.`/`/`) are skipped — not catalog assets. Refs without a `kind:`\n * prefix get `defaultKind` injected; the publisher scope and `#pin` are stripped\n * so only `kind:name` is tracked.\n */\nfunction collectMixinRefs(raw: unknown, defaultKind: string, out: Dependency[]): void {\n if (!Array.isArray(raw)) return;\n for (const r of raw) {\n if (typeof r !== \"string\" || !r) continue;\n if (r.startsWith(\".\") || r.startsWith(\"/\")) continue; // local path — skip\n // Normalize: if no kind: prefix, inject the default kind\n const normalized = r.includes(\":\") ? r : `${defaultKind}:${r}`;\n // Only kind:name matters for requires — strip the publisher scope and #pin.\n const colonIdx = normalized.indexOf(\":\");\n const kind = normalized.slice(0, colonIdx).trim();\n let rest = normalized.slice(colonIdx + 1).trim();\n const hashIdx = rest.indexOf(\"#\");\n if (hashIdx !== -1) rest = rest.slice(0, hashIdx).trim();\n let name: string;\n if (rest.startsWith(\"@\")) {\n // Scoped form @publisher/name → name is the segment after the slash.\n const slashIdx = rest.indexOf(\"/\");\n name = slashIdx !== -1 ? rest.slice(slashIdx + 1).trim() : \"\";\n } else {\n // Legacy name@publisher (deprecated) or a bare name.\n const atIdx = rest.indexOf(\"@\");\n name = atIdx !== -1 ? rest.slice(0, atIdx).trim() : rest;\n }\n if (name) out.push({ kind, name });\n }\n}\n\n// ── Manifest parsers ──────────────────────────────────────────────────────────\n\n/**\n * Parse a `SKILL.md` file into a `CatalogEntry`.\n * The `kind` field defaults to `\"skill\"` but can be overridden to `\"agent\"` or `\"prompt\"`\n * via the `type:` frontmatter key. Falls back to the parent directory name when `name:` is absent.\n *\n * Async since #454 — the file may live on the FUSE workspace mount.\n *\n * @param filePath - Absolute path to the `SKILL.md` file\n * @param repoName - Repository name used as the `repository` field of the entry\n * @returns Populated `CatalogEntry` with kind, name, description, version, and requires\n * @docLink packages/core/concepts#from-skill-md\n */\nexport async function fromSkillMd(filePath: string, repoName: string): Promise<CatalogEntry> {\n return fromSkillMdContent(await readManifestFile(filePath), repoName, filePath);\n}\n\n/** Pure {@link fromSkillMd} core over already-read content (no I/O). */\nfunction fromSkillMdContent(content: string, repoName: string, filePath: string): CatalogEntry {\n const { data: meta } = parseFrontmatter(content);\n let kind = String(meta.type ?? \"skill\") as AssetKind;\n if (![\"skill\", \"agent\", \"prompt\", \"persona\", \"ruleset\", \"knowledge\"].includes(kind))\n kind = \"skill\";\n return {\n name: String(meta.name ?? basename(dirname(filePath))),\n kind,\n description: String(meta.description ?? \"\"),\n source: filePath,\n publisher: repoName,\n version: extractVersion(meta),\n requires: parseRequires(meta),\n dependencies: [],\n };\n}\n\n/**\n * Parse an `AGENT.md` file into a `CatalogEntry` with `kind: \"agent\"`.\n * Falls back to the parent directory name when `name:` is absent.\n *\n * Async since #454 — the file may live on the FUSE workspace mount.\n *\n * @param filePath - Absolute path to the `AGENT.md` file\n * @param repoName - Repository name used as the `repository` field of the entry\n * @returns Populated `CatalogEntry` with kind `\"agent\"`\n * @docLink packages/core/concepts#from-agent-md\n */\nexport async function fromAgentMd(filePath: string, repoName: string): Promise<CatalogEntry> {\n return fromAgentMdContent(await readManifestFile(filePath), repoName, filePath);\n}\n\n/** Pure {@link fromAgentMd} core over already-read content (no I/O). */\nfunction fromAgentMdContent(content: string, repoName: string, filePath: string): CatalogEntry {\n const { data: meta } = parseFrontmatter(content);\n return {\n name: String(meta.name ?? basename(dirname(filePath))),\n kind: \"agent\",\n description: String(meta.description ?? \"\"),\n source: filePath,\n publisher: repoName,\n version: extractVersion(meta),\n requires: parseRequires(meta),\n dependencies: [],\n };\n}\n\n/**\n * Parse an `agent.yaml` file into a `CatalogEntry` with `kind: \"agent\"`.\n * Collects sub-agent dependencies from `requires[]` (new format) and `dependencies[]`\n * (legacy format), skill abilities from `abilities[]`, and contracts from `contracts[]`.\n *\n * Async since #454 — the file may live on the FUSE workspace mount.\n *\n * @param filePath - Absolute path to the `agent.yaml` file\n * @param repoName - Repository name used as the `repository` field of the entry\n * @returns Populated `CatalogEntry` with kind `\"agent\"` and full dependency graph\n * @docLink packages/core/concepts#from-agent-yaml\n */\nexport async function fromAgentYaml(filePath: string, repoName: string): Promise<CatalogEntry> {\n return fromAgentYamlContent(await readManifestFileOrEmpty(filePath), repoName, filePath);\n}\n\n/** Pure {@link fromAgentYaml} core over already-read content (no I/O). */\nfunction fromAgentYamlContent(content: string, repoName: string, filePath: string): CatalogEntry {\n let meta: Record<string, unknown> = {};\n try {\n meta = (parse(content) as Record<string, unknown>) ?? {};\n } catch {}\n\n const requires: Dependency[] = [];\n\n // Sub-agent dependencies from requires[] (new format: {name, source, ...})\n collectAgentDeps(meta.requires, requires);\n // Legacy sub-agent dependencies from dependencies[] (old format: {name, ...})\n collectAgentDeps(meta.dependencies, requires);\n // Skill abilities referenced in the system prompt\n collectStringRefs(meta.abilities, \"skill\", requires);\n // Contracts referenced in the system prompt (co-located in skills dir)\n collectStringRefs(meta.contracts, \"contract\", requires);\n\n // Mixin composition fields — track catalog refs as requires so `skaile install`\n // automatically pulls them. Local paths (. or /) are skipped — not catalog assets.\n for (const [field, defaultKind] of [\n [\"persona\", \"persona\"],\n [\"rules\", \"ruleset\"],\n [\"knowledge\", \"knowledge\"],\n ] as const) {\n collectMixinRefs(meta[field], defaultKind, requires);\n }\n\n return {\n name: String(meta.name ?? basename(dirname(filePath))),\n kind: \"agent\",\n description: String(meta.description ?? \"\"),\n source: filePath,\n publisher: repoName,\n version: String(meta.version ?? \"\"),\n requires,\n dependencies: [],\n };\n}\n\n/**\n * Parse a `*.prompt.md` file into a `CatalogEntry` with `kind: \"prompt\"`.\n * The name defaults to the filename stem (without the `.prompt.md` suffix)\n * when no `name:` frontmatter key is present.\n *\n * Async since #454 — the file may live on the FUSE workspace mount.\n *\n * @param filePath - Absolute path to the `.prompt.md` file\n * @param repoName - Repository name used as the `repository` field of the entry\n * @returns Populated `CatalogEntry` with kind `\"prompt\"`\n * @docLink packages/core/concepts#from-prompt-md\n */\nexport async function fromPromptMd(filePath: string, repoName: string): Promise<CatalogEntry> {\n return fromPromptMdContent(await readManifestFile(filePath), repoName, filePath);\n}\n\n/** Pure {@link fromPromptMd} core over already-read content (no I/O). */\nfunction fromPromptMdContent(content: string, repoName: string, filePath: string): CatalogEntry {\n const { data: meta } = parseFrontmatter(content);\n const name = String(meta.name ?? basename(filePath).replace(/\\.prompt\\.md$/, \"\"));\n return {\n name,\n kind: \"prompt\",\n description: String(meta.description ?? \"\"),\n source: filePath,\n publisher: repoName,\n version: extractVersion(meta),\n requires: parseRequires(meta),\n dependencies: [],\n };\n}\n\n/**\n * Parse a `*.flow.yaml` or `*.flow.json` file into a `CatalogEntry` with `kind: \"flow\"`.\n * The name resolves from `name:` or `id:` frontmatter, falling back to the filename stem.\n *\n * Async since #454 — the file may live on the FUSE workspace mount.\n *\n * @param filePath - Absolute path to the flow definition file\n * @param repoName - Repository name used as the `repository` field of the entry\n * @returns Populated `CatalogEntry` with kind `\"flow\"`\n * @docLink packages/core/concepts#from-flow-yaml\n */\nexport async function fromFlowYaml(filePath: string, repoName: string): Promise<CatalogEntry> {\n return fromFlowYamlContent(await readManifestFileOrEmpty(filePath), repoName, filePath);\n}\n\n/** Pure {@link fromFlowYaml} core over already-read content (no I/O). */\nfunction fromFlowYamlContent(content: string, repoName: string, filePath: string): CatalogEntry {\n let meta: Record<string, unknown> = {};\n try {\n meta = (parse(content) as Record<string, unknown>) ?? {};\n } catch {}\n\n const stem = basename(filePath)\n .replace(/\\.flow\\.yaml$/, \"\")\n .replace(/\\.flow\\.json$/, \"\");\n return {\n name: String(meta.name ?? meta.id ?? stem),\n kind: \"flow\",\n description: String(meta.description ?? \"\"),\n source: filePath,\n publisher: repoName,\n version: String(meta.version ?? \"\"),\n requires: parseRequires(meta),\n dependencies: [],\n };\n}\n\n/**\n * Parse a `*.bundle.yaml` file into a `CatalogEntry` with `kind: \"bundle\"`.\n * Bundles declare a flat list of string `dependencies` (asset refs) rather than\n * typed `Dependency` objects; both `requires` and `dependencies` are populated.\n *\n * Async since #454 — the file may live on the FUSE workspace mount.\n *\n * @param filePath - Absolute path to the bundle YAML file\n * @param repoName - Repository name used as the `repository` field of the entry\n * @returns Populated `CatalogEntry` with kind `\"bundle\"`\n * @docLink packages/core/concepts#from-bundle-yaml\n */\nexport async function fromBundleYaml(filePath: string, repoName: string): Promise<CatalogEntry> {\n return fromBundleYamlContent(await readManifestFileOrEmpty(filePath), repoName, filePath);\n}\n\n/** Pure {@link fromBundleYaml} core over already-read content (no I/O). */\nfunction fromBundleYamlContent(content: string, repoName: string, filePath: string): CatalogEntry {\n let meta: Record<string, unknown> = {};\n try {\n meta = (parse(content) as Record<string, unknown>) ?? {};\n } catch {}\n\n const name = String(meta.name ?? basename(filePath).replace(/\\.bundle\\.yaml$/, \"\"));\n\n const deps = meta.dependencies;\n const dependencies = Array.isArray(deps) ? (deps as string[]).filter(Boolean) : [];\n\n return {\n name,\n kind: \"bundle\",\n description: String(meta.description ?? \"\"),\n source: filePath,\n publisher: repoName,\n version: String(meta.version ?? \"\"),\n requires: parseRequires(meta),\n dependencies,\n };\n}\n\n/**\n * Extract a bundle's raw transitive dependency ref strings from its manifest\n * file — the union of its `requires` and `dependencies` lists, kept verbatim\n * (publisher/pin qualifiers preserved, comments dropped by the parser).\n *\n * Supports `*.bundle.yaml` / `*.flow.{yaml,json}` (top-level\n * `requires`/`dependencies`) and the `BUNDLE.md` frontmatter layout\n * (`requires`/`dependencies`, incl. nested under `metadata`). Unlike\n * {@link parseRequires}, refs are returned as-is — the resolver needs the full\n * `kind:name@<publisher>[#pin]` form, not a publisher-stripped {@link Dependency}.\n *\n * Async since #454 — the file may live on the FUSE workspace mount.\n *\n * @param filePath - Absolute path to a `.bundle.yaml`, `.flow.{yaml,json}`, or `BUNDLE.md`.\n * @returns Deduped list of ref strings; `[]` on parse failure or no deps.\n * @docLink packages/core/concepts#bundle-dep-refs\n */\nexport async function bundleDepRefs(filePath: string): Promise<string[]> {\n return bundleDepRefsFromContent(await readManifestFileOrEmpty(filePath), filePath);\n}\n\n/** Pure {@link bundleDepRefs} core over already-read content (no I/O). */\nfunction bundleDepRefsFromContent(content: string, filePath: string): string[] {\n // `.bundle.yaml` / `.flow.yaml` / `.flow.json` carry their dep list as a\n // top-level document key (`requires`/`dependencies`); `BUNDLE.md` carries it\n // in frontmatter. YAML is a JSON superset, so `parse` reads `.flow.json` too.\n const wholeDoc = /\\.(bundle\\.yaml|flow\\.yaml|flow\\.json)$/.test(filePath);\n let meta: Record<string, unknown> = {};\n try {\n meta = wholeDoc\n ? ((parse(content) as Record<string, unknown>) ?? {})\n : parseFrontmatter(content).data;\n } catch {\n return [];\n }\n const out: string[] = [];\n const collect = (v: unknown) => {\n if (Array.isArray(v))\n for (const x of v) if (typeof x === \"string\" && x.trim()) out.push(x.trim());\n };\n collect(meta.requires);\n collect((meta.metadata as Record<string, unknown> | undefined)?.requires);\n collect(meta.dependencies);\n return [...new Set(out)];\n}\n\n/**\n * Parse a `CONTRACT.md` file into a `CatalogEntry` with `kind: \"contract\"`.\n * Falls back to the parent directory name when `name:` is absent.\n *\n * Async since #454 — the file may live on the FUSE workspace mount.\n *\n * @param filePath - Absolute path to the `CONTRACT.md` file\n * @param repoName - Repository name used as the `repository` field of the entry\n * @returns Populated `CatalogEntry` with kind `\"contract\"`\n * @docLink packages/core/concepts#from-contract-md\n */\nexport async function fromContractMd(filePath: string, repoName: string): Promise<CatalogEntry> {\n return fromContractMdContent(await readManifestFile(filePath), repoName, filePath);\n}\n\n/** Pure {@link fromContractMd} core over already-read content (no I/O). */\nfunction fromContractMdContent(content: string, repoName: string, filePath: string): CatalogEntry {\n const { data: meta } = parseFrontmatter(content);\n return {\n name: String(meta.name ?? basename(dirname(filePath))),\n kind: \"contract\",\n description: String(meta.description ?? \"\"),\n source: filePath,\n publisher: repoName,\n version: extractVersion(meta),\n requires: parseRequires(meta),\n dependencies: [],\n };\n}\n\n/**\n * Parse an `MCP.md` file into a `CatalogEntry` with `kind: \"mcp-server\"`.\n * Falls back to the parent directory name when `name:` is absent.\n *\n * Frontmatter fields (catalog identity):\n * - `name` — server name (default: parent dir name)\n * - `description` — short description\n * - `version` — semver\n * - `keywords` — array of discovery tags\n *\n * Frontmatter fields (runtime defaults, stored in `metadata`):\n * - `transport` — \"stdio\" | \"sse\" | \"http\" (default: \"stdio\")\n * - `command` — command to execute (stdio)\n * - `args` — command arguments (stdio)\n * - `env` — environment variables (stdio)\n * - `url` — server URL (sse/http)\n * - `headers` — HTTP headers (sse/http)\n *\n * When `mcp:name` appears in `skaile.yaml` `dependencies`, the runner reads\n * these defaults from `metadata` to build a `McpServerDeclaration` without\n * requiring verbose inline config.\n *\n * Async since #454 — the file may live on the FUSE workspace mount.\n *\n * @param filePath - Absolute path to the `MCP.md` file\n * @param repoName - Repository name used as the `repository` field of the entry\n * @returns Populated `CatalogEntry` with kind `\"mcp-server\"`\n * @docLink packages/core/concepts#from-mcp-server-md\n */\nexport async function fromMcpServerMd(filePath: string, repoName: string): Promise<CatalogEntry> {\n return fromMcpServerMdContent(await readManifestFile(filePath), repoName, filePath);\n}\n\n/**\n * Parse pre-read MCP.md content into a `CatalogEntry`.\n * Callers that already hold the file content (e.g. to avoid a second read) use\n * this directly; `fromMcpServerMd` is a thin wrapper that reads then delegates here.\n *\n * @param content - UTF-8 content of the `MCP.md` file\n * @param repoName - Repository name used as the `publisher` field of the entry\n * @param filePath - Absolute path (used as `source` and for name fallback)\n * @returns Populated `CatalogEntry` with kind `\"mcp-server\"`\n */\nexport function fromMcpServerMdContent(\n content: string,\n repoName: string,\n filePath: string,\n): CatalogEntry {\n const { data: meta } = parseFrontmatter(content);\n\n // Extract runtime defaults into metadata\n const metadata: Record<string, unknown> = {};\n if (meta.transport) metadata.transport = String(meta.transport);\n if (meta.command) metadata.command = String(meta.command);\n if (Array.isArray(meta.args)) metadata.args = meta.args.map(String);\n if (meta.env && typeof meta.env === \"object\" && !Array.isArray(meta.env)) {\n metadata.env = meta.env as Record<string, string>;\n }\n if (meta.url) metadata.url = String(meta.url);\n if (meta.headers && typeof meta.headers === \"object\" && !Array.isArray(meta.headers)) {\n metadata.headers = meta.headers as Record<string, string>;\n }\n if (meta.recipe && typeof meta.recipe === \"object\" && !Array.isArray(meta.recipe)) {\n metadata.recipe = meta.recipe;\n }\n\n return {\n name: String(meta.name ?? basename(dirname(filePath))),\n kind: \"mcp-server\",\n description: String(meta.description ?? \"\"),\n source: filePath,\n publisher: repoName,\n version: extractVersion(meta),\n requires: parseRequires(meta),\n dependencies: [],\n metadata: Object.keys(metadata).length > 0 ? metadata : undefined,\n };\n}\n\n/**\n * Parse a `knowledge.yaml` file into a `CatalogEntry` with `kind: \"knowledge\"`.\n * Falls back to the parent directory name when `name:` is absent.\n *\n * Async since #454 — the file may live on the FUSE workspace mount.\n *\n * @param filePath - Absolute path to the `knowledge.yaml` file\n * @param repoName - Repository name used as the `repository` field of the entry\n * @returns Populated `CatalogEntry` with kind `\"knowledge\"`\n * @docLink packages/core/concepts#from-knowledge-yaml\n */\nexport async function fromKnowledgeYaml(filePath: string, repoName: string): Promise<CatalogEntry> {\n return fromKnowledgeYamlContent(await readManifestFileOrEmpty(filePath), repoName, filePath);\n}\n\n/** Pure {@link fromKnowledgeYaml} core over already-read content (no I/O). */\nfunction fromKnowledgeYamlContent(\n content: string,\n repoName: string,\n filePath: string,\n): CatalogEntry {\n let meta: Record<string, unknown> = {};\n try {\n meta = (parse(content) as Record<string, unknown>) ?? {};\n } catch {}\n return {\n name: String(meta.name ?? basename(dirname(filePath))),\n kind: \"knowledge\",\n description: String(meta.description ?? \"\"),\n source: filePath,\n publisher: repoName,\n version: String(meta.version ?? \"\"),\n requires: parseRequires(meta),\n dependencies: [],\n };\n}\n\n/**\n * Parse a `CONNECTOR.md` file into a `CatalogEntry` with `kind: \"connector\"`.\n * Falls back to the parent directory name when `name:` is absent.\n *\n * Frontmatter fields (catalog identity):\n * - `name` — connector name (default: parent dir name)\n * - `description` — short description\n * - `version` — semver\n *\n * Frontmatter fields (runtime defaults, stored in `metadata`):\n * - `entry` — adapter entry point (default: \"./adapter.ts\")\n * - `npm_deps` — npm dependencies required by the adapter\n * - `fields` — configuration fields the adapter expects\n * - `health_check` — whether to run a health check on connect\n *\n * The markdown body (below the frontmatter) is stored in `metadata.body`\n * so the runner can inject the connector's skill description into the\n * system prompt when `expose_as_skill` is enabled.\n *\n * Async since #454 — the file may live on the FUSE workspace mount.\n *\n * @param filePath - Absolute path to the `CONNECTOR.md` file\n * @param repoName - Repository name used as the `repository` field of the entry\n * @returns Populated `CatalogEntry` with kind `\"connector\"`\n * @docLink packages/core/concepts#from-connector-md\n */\nexport async function fromConnectorMd(filePath: string, repoName: string): Promise<CatalogEntry> {\n return fromConnectorMdContent(await readManifestFile(filePath), repoName, filePath);\n}\n\n/** Pure {@link fromConnectorMd} core over already-read content (no I/O). */\nfunction fromConnectorMdContent(content: string, repoName: string, filePath: string): CatalogEntry {\n const { data: meta, body } = parseFrontmatter(content);\n const name = String(meta.name ?? basename(dirname(filePath)));\n return {\n name,\n kind: \"connector\" as AssetKind,\n description: String(meta.description ?? \"\"),\n source: filePath,\n publisher: repoName,\n version: extractVersion(meta),\n requires: parseRequires(meta),\n dependencies: [],\n metadata: {\n entry: meta.entry ?? \"./adapter.ts\",\n npm_deps: meta.npm_deps ?? {},\n fields: meta.fields ?? [],\n health_check: meta.health_check ?? null,\n body,\n },\n };\n}\n\n// ── Recursive walker ──────────────────────────────────────────────────────────\n\ninterface WalkEntry {\n path: string;\n name: string;\n}\n\n/** Default maximum directory nesting the walk descends into. */\nexport const DEFAULT_WALK_MAX_DEPTH = 32;\n\n/** Default maximum number of directory entries a single walk may examine. */\nexport const DEFAULT_WALK_MAX_ENTRIES = 50_000;\n\n/** Default wall-clock budget for one whole walk / scan pass, in milliseconds. */\nexport const DEFAULT_WALK_BUDGET_MS = 60_000;\n\n/** Env override for {@link DEFAULT_WALK_MAX_DEPTH}. */\nexport const WALK_MAX_DEPTH_ENV_VAR = \"SKAILE_SCAN_MAX_DEPTH\";\n\n/** Env override for {@link DEFAULT_WALK_MAX_ENTRIES}. */\nexport const WALK_MAX_ENTRIES_ENV_VAR = \"SKAILE_SCAN_MAX_ENTRIES\";\n\n/** Env override for {@link DEFAULT_WALK_BUDGET_MS}. */\nexport const WALK_BUDGET_MS_ENV_VAR = \"SKAILE_SCAN_DEADLINE_MS\";\n\n/** Read a positive-integer env override, falling back when absent or unusable. */\nfunction envInt(name: string, fallback: number): number {\n const raw = process.env[name];\n if (raw === undefined) return fallback;\n const parsed = Number.parseInt(raw, 10);\n return Number.isFinite(parsed) && parsed > 0 ? parsed : fallback;\n}\n\n/**\n * Why a walk stopped early. Every one of these means the returned entries are a\n * **partial** view of the tree — never present a truncated walk as complete.\n *\n * @docLink packages/core/concepts#walk-dir\n */\nexport interface WalkTruncation {\n reason: \"depth\" | \"entries\" | \"budget\" | \"cycle\" | \"unreadable\";\n /** Directory (or symlink) at which the bound was hit. */\n path: string;\n /** The bound that was hit, when the reason has a numeric limit. */\n limit?: number;\n}\n\n/**\n * Bounds for {@link walkDir} / {@link scanDirectory}.\n *\n * @docLink packages/core/concepts#walk-dir\n */\nexport interface WalkOptions {\n /** Maximum nesting depth below the root. Default {@link DEFAULT_WALK_MAX_DEPTH}. */\n maxDepth?: number;\n /** Maximum directory entries examined across the whole walk. Default {@link DEFAULT_WALK_MAX_ENTRIES}. */\n maxEntries?: number;\n /**\n * Wall-clock budget for the whole walk. Default {@link DEFAULT_WALK_BUDGET_MS}.\n * The check is inclusive, so `0` yields no entries at all.\n */\n budgetMs?: number;\n /** Per-`opendir`/`stat`/`readFile` deadline. Default {@link fsDeadlineMs}. */\n opTimeoutMs?: number;\n /**\n * Called once per distinct truncation reason. Defaults to a `warn` on the\n * core logger — override to route the signal somewhere the caller can act on.\n */\n onTruncate?: (info: WalkTruncation) => void;\n}\n\n/** Mutable bookkeeping threaded through one walk. */\ninterface WalkState {\n maxDepth: number;\n maxEntries: number;\n opTimeoutMs: number | undefined;\n deadlineAt: number;\n examined: number;\n /**\n * `dev:ino` of the directories on the **current path from the root** — an\n * ancestor stack, not an ever-visited set. Re-entering an ancestor is a cycle;\n * re-reaching a directory off the current path is a diamond, and must be walked.\n */\n ancestors: Set<string>;\n reported: Set<WalkTruncation[\"reason\"]>;\n onTruncate: (info: WalkTruncation) => void;\n}\n\nlet walkLogger: ReturnType<typeof createLogger> | undefined;\n\n/** Default truncation sink — a structured warning naming the bound that was hit. */\nfunction warnTruncation(info: WalkTruncation): void {\n walkLogger ??= createLogger({ kind: \"runner\", subkind: \"asset-scan\" });\n walkLogger.warn(`asset scan truncated (${info.reason}) — results are incomplete`, {\n ...info,\n });\n}\n\n/** Record a truncation once per reason so a wide tree does not spam the log. */\nfunction truncate(state: WalkState, info: WalkTruncation): void {\n if (state.reported.has(info.reason)) return;\n state.reported.add(info.reason);\n state.onTruncate(info);\n}\n\n/**\n * Stable identity (`dev:ino`) of the directory `path` resolves to, or `null`\n * when it cannot be stat'ed within the deadline. Used to terminate symlink\n * cycles — the pre-#454 walker recursed forever on `a/link -> a`.\n */\nasync function dirIdentity(path: string, timeoutMs: number | undefined): Promise<string | null> {\n const st = await tryWithFsDeadline(`stat ${path}`, () => stat(path), null, timeoutMs);\n return st ? `${st.dev}:${st.ino}` : null;\n}\n\n/**\n * Read one directory's entries under a deadline, capped at the walk's remaining\n * entry budget. Uses `opendir` rather than `readdir` so a pathological directory\n * streams instead of materialising in full; entries are collected and sorted\n * because the `scanDirectory` dedup rule (\"alphabetically later source wins\")\n * depends on a deterministic per-level order.\n */\nasync function readDirEntries(\n dir: string,\n state: WalkState,\n): Promise<{ entries: Dirent[]; capped: boolean } | null> {\n const remaining = state.maxEntries - state.examined;\n if (remaining <= 0) return { entries: [], capped: true };\n try {\n return await withFsDeadline(\n `opendir ${dir}`,\n async () => {\n const handle = await opendir(dir);\n const entries: Dirent[] = [];\n let capped = false;\n for await (const e of handle) {\n // Stop *before* keeping the over-budget entry, so `capped` means \"an\n // entry was actually dropped\". Breaking after the push instead marked\n // a directory of exactly `remaining` entries as truncated — and since\n // `truncate()` reports once per reason for the whole walk, that\n // spurious first report swallowed a later genuine one.\n if (entries.length >= remaining) {\n capped = true;\n break;\n }\n entries.push(e);\n }\n entries.sort((a, b) => (a.name < b.name ? -1 : 1));\n return { entries, capped };\n },\n state.opTimeoutMs,\n );\n } catch {\n // Unreadable (permissions, vanished mid-walk) or the mount missed its\n // deadline. Either way this subtree contributes nothing; keep walking.\n truncate(state, { reason: \"unreadable\", path: dir });\n return null;\n }\n}\n\n/**\n * Recursively yield every file entry under `dir`, sorted alphabetically at each\n * level. Skips `.git` and `node_modules` directories and follows symlinks\n * (resolving to the stat target). `node_modules` is excluded because Bun's\n * `node_modules/.bun/...` layout contains symlink farms that form cycles when\n * packages reference each other transitively.\n *\n * **Async and bounded since #454.** A repo root can resolve onto the rclone FUSE\n * mount, where the previous synchronous `readdirSync`/`statSync` walk parked the\n * whole event loop. Four bounds now hold, and hitting any of them reports a\n * {@link WalkTruncation} — a truncated walk is never presented as a complete one:\n *\n * - **depth** ({@link WalkOptions.maxDepth}) — also the backstop for a cycle no\n * inode check can see, e.g. a bind mount of the root inside itself.\n * - **entry count** ({@link WalkOptions.maxEntries}) — total directory entries\n * examined, so an enormous tree cannot run unbounded.\n * - **wall-clock budget** ({@link WalkOptions.budgetMs}) — a wedged mount that\n * times out one operation at a time cannot add up to an unbounded scan.\n * - **ancestor inodes** — the `dev:ino` of every directory on the path from the\n * root is held while its subtree is walked, so `a/link -> a` terminates\n * instead of recursing forever. Two sibling symlinks onto one shared\n * directory are a diamond, not a cycle: both are walked, at the price of\n * visiting the shared subtree twice — bounded by the entry and time budgets.\n *\n * @param dir - Absolute path to the directory to walk\n * @param options - Bounds and truncation sink; see {@link WalkOptions}\n * @docLink packages/core/concepts#walk-dir\n */\nexport async function* walkDir(dir: string, options: WalkOptions = {}): AsyncGenerator<WalkEntry> {\n const state: WalkState = {\n maxDepth: options.maxDepth ?? envInt(WALK_MAX_DEPTH_ENV_VAR, DEFAULT_WALK_MAX_DEPTH),\n maxEntries: options.maxEntries ?? envInt(WALK_MAX_ENTRIES_ENV_VAR, DEFAULT_WALK_MAX_ENTRIES),\n opTimeoutMs: options.opTimeoutMs,\n deadlineAt:\n Date.now() + (options.budgetMs ?? envInt(WALK_BUDGET_MS_ENV_VAR, DEFAULT_WALK_BUDGET_MS)),\n examined: 0,\n ancestors: new Set<string>(),\n reported: new Set<WalkTruncation[\"reason\"]>(),\n onTruncate: options.onTruncate ?? warnTruncation,\n };\n // The root is an ancestor of everything, so it is seeded here and never\n // popped — a self-referential `root/link -> root` is caught on first descent.\n const rootId = await dirIdentity(dir, state.opTimeoutMs);\n if (rootId) state.ancestors.add(rootId);\n yield* walkFrom(dir, 0, state);\n}\n\nasync function* walkFrom(dir: string, depth: number, state: WalkState): AsyncGenerator<WalkEntry> {\n if (depth > state.maxDepth) {\n truncate(state, { reason: \"depth\", path: dir, limit: state.maxDepth });\n return;\n }\n if (Date.now() >= state.deadlineAt) {\n truncate(state, { reason: \"budget\", path: dir });\n return;\n }\n\n const read = await readDirEntries(dir, state);\n if (!read) return;\n if (read.capped) truncate(state, { reason: \"entries\", path: dir, limit: state.maxEntries });\n\n for (const e of read.entries) {\n if (state.examined >= state.maxEntries) {\n truncate(state, { reason: \"entries\", path: dir, limit: state.maxEntries });\n return;\n }\n if (Date.now() >= state.deadlineAt) {\n truncate(state, { reason: \"budget\", path: dir });\n return;\n }\n state.examined++;\n const full = join(dir, e.name);\n\n if (e.isSymbolicLink()) {\n // A symlink is the only way a cycle can enter this walk, so identity is\n // resolved here and nowhere else — one extra stat per link, none per\n // ordinary directory.\n const st = await tryWithFsDeadline(`stat ${full}`, () => stat(full), null, state.opTimeoutMs);\n if (!st) continue;\n if (st.isDirectory()) {\n if (e.name === \".git\" || e.name === \"node_modules\") continue;\n const id = `${st.dev}:${st.ino}`;\n // Only an *ancestor* is a cycle. A target already walked elsewhere in\n // the tree is a diamond (`a/link -> shared`, `b/link -> shared`) and\n // dropping it would silently lose that subtree from the scan.\n if (state.ancestors.has(id)) {\n truncate(state, { reason: \"cycle\", path: full });\n continue;\n }\n state.ancestors.add(id);\n try {\n yield* walkFrom(full, depth + 1, state);\n } finally {\n // finally, not a trailing delete: an early `return` from the bounds\n // checks — or an abandoned consumer — would otherwise leave the\n // ancestor stack holding a directory the walk has already left.\n state.ancestors.delete(id);\n }\n } else {\n yield { path: full, name: e.name };\n }\n } else if (e.isDirectory()) {\n if (e.name !== \".git\" && e.name !== \"node_modules\") yield* walkFrom(full, depth + 1, state);\n } else if (e.isFile()) {\n yield { path: full, name: e.name };\n }\n }\n}\n\n// ── Public scanner ────────────────────────────────────────────────────────────\n\n/**\n * Coerce a scanned entry's `name` to a canonical asset name in place. When the\n * raw name is already canonical this is a no-op; otherwise the original is stashed\n * on `metadata.displayName` (only when not already set) so callers keep the pretty\n * label for display while identity uses the slug. A name that slugifies to empty\n * is left untouched — `parseAssetRef` will reject it downstream with its full hint.\n */\nfunction normalizeEntryName(e: CatalogEntry): void {\n if (isValidAssetName(e.name)) return;\n let slug: string;\n try {\n slug = slugifyAssetName(e.name);\n } catch {\n return;\n }\n const original = e.name;\n e.name = slug;\n if (e.metadata?.displayName === undefined) {\n e.metadata = { ...e.metadata, displayName: original };\n }\n}\n\n/**\n * Build a `CatalogEntry` from an already-read manifest, dispatching on filename.\n * Returns `null` when the filename is not a recognized manifest.\n */\nfunction entryFromManifest(\n name: string,\n content: string,\n filePath: string,\n repoName: string,\n): CatalogEntry | null {\n if (name === \"SKILL.md\") return fromSkillMdContent(content, repoName, filePath);\n if (name === \"AGENT.md\") return fromAgentMdContent(content, repoName, filePath);\n if (name === \"agent.yaml\") return fromAgentYamlContent(content, repoName, filePath);\n if (name === \"CONTRACT.md\") return fromContractMdContent(content, repoName, filePath);\n if (name === \"MCP.md\") return fromMcpServerMdContent(content, repoName, filePath);\n if (name === \"CONNECTOR.md\") return fromConnectorMdContent(content, repoName, filePath);\n if (name === \"knowledge.yaml\") return fromKnowledgeYamlContent(content, repoName, filePath);\n if (name.endsWith(\".prompt.md\")) return fromPromptMdContent(content, repoName, filePath);\n if (name.endsWith(\".bundle.yaml\")) return fromBundleYamlContent(content, repoName, filePath);\n if (name.endsWith(\".flow.yaml\") || name.endsWith(\".flow.json\"))\n return fromFlowYamlContent(content, repoName, filePath);\n return null;\n}\n\n/** Filenames {@link scanDirectory} recognises as asset manifests. */\nfunction isManifestName(name: string): boolean {\n return (\n name === \"SKILL.md\" ||\n name === \"AGENT.md\" ||\n name === \"agent.yaml\" ||\n name === \"CONTRACT.md\" ||\n name === \"MCP.md\" ||\n name === \"CONNECTOR.md\" ||\n name === \"knowledge.yaml\" ||\n name.endsWith(\".prompt.md\") ||\n name.endsWith(\".bundle.yaml\") ||\n name.endsWith(\".flow.yaml\") ||\n name.endsWith(\".flow.json\")\n );\n}\n\n/**\n * Walk `root` recursively and return a `CatalogEntry` for every recognized asset manifest found.\n *\n * Recognized filenames: `SKILL.md`, `AGENT.md`, `agent.yaml`, `CONTRACT.md`, `MCP.md`,\n * `CONNECTOR.md`, `knowledge.yaml`, `*.prompt.md`, `*.bundle.yaml`, `*.flow.yaml`, `*.flow.json`.\n *\n * When two entries share the same `kind:name` key, the one with the alphabetically\n * later source path wins (consistent with catalog precedence rules).\n *\n * **Async and bounded since #454.** `root` can resolve onto the rclone FUSE mount\n * (a `sources[].path` under `/skaile/workspace`), and the walk follows symlinks, so\n * even an off-mount root can descend into one. Every `opendir`/`stat`/`readFile`\n * is deadline-bounded and the walk is capped by depth, entry count, a wall-clock\n * budget, and an ancestor-inode set — see {@link walkDir}. Hitting any bound reports\n * a {@link WalkTruncation} through {@link WalkOptions.onTruncate} (a `warn` by\n * default); the returned array is then a **partial** scan, never a complete one.\n *\n * A manifest that cannot be read within its deadline is skipped rather than\n * failing the whole scan — one unreachable file must not cost the whole catalog.\n *\n * @param root - Absolute path to the directory tree to scan\n * @param repoName - Repository name attached to every produced entry\n * @param options - Walk bounds and truncation sink; see {@link WalkOptions}\n * @returns Array of deduplicated `CatalogEntry` objects, one per manifest file\n * @docLink packages/core/concepts#scan-directory\n */\nexport async function scanDirectory(\n root: string,\n repoName: string,\n options: WalkOptions = {},\n): Promise<CatalogEntry[]> {\n const entries = new Map<string, CatalogEntry>();\n const onTruncate = options.onTruncate ?? warnTruncation;\n const reported = new Set<WalkTruncation[\"reason\"]>();\n const relay = (info: WalkTruncation) => {\n reported.add(info.reason);\n onTruncate(info);\n };\n const opTimeoutMs = options.opTimeoutMs ?? fsDeadlineMs();\n\n function add(e: CatalogEntry): void {\n // Boundary normalization: a third-party source we don't control may name an\n // asset with a human-styled identity (\"Complex App\"). Slugify it to a\n // canonical name so the ref it produces parses, preserving the original on\n // `metadata.displayName` for display. No-op for already-canonical names.\n normalizeEntryName(e);\n const key = `${e.kind}:${e.name}`;\n const existing = entries.get(key);\n if (!existing) {\n entries.set(key, e);\n return;\n }\n // Among duplicates, alphabetically later source path wins\n if (e.source > existing.source) entries.set(key, e);\n }\n\n for await (const { path: filePath, name } of walkDir(root, {\n ...options,\n opTimeoutMs,\n onTruncate: relay,\n })) {\n if (!isManifestName(name)) continue;\n const content = await tryWithFsDeadline(\n `readFile ${filePath}`,\n () => readFile(filePath, \"utf8\"),\n null,\n opTimeoutMs,\n );\n if (content === null) {\n // Unreadable or past its deadline — the catalog loses this asset, not the\n // whole scan. Reported once so a wedged mount is visible in the logs.\n if (!reported.has(\"unreadable\")) relay({ reason: \"unreadable\", path: filePath });\n continue;\n }\n try {\n const entry = entryFromManifest(name, content, filePath, repoName);\n if (entry) add(entry);\n } catch {}\n }\n\n return [...entries.values()];\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../store/src/resource-client.ts","../store/src/store.ts"],"names":[],"mappings":";AAuBA,IAAM,kBAAA,GAAqB,GAAA;AAOpB,IAAM,oBAAA,GAAN,cAAmC,KAAA,CAAM;AAAA,EACrC,IAAA;AAAA,EAET,WAAA,CAAY,SAAiB,IAAA,EAAqC;AAChE,IAAA,KAAA,CAAM,OAAO,C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AAW,QAAA,IAAY,KAAK,UAAA,EAAY;AACtC,MAAA,QAAA,EAAS;AAAA,IACX;AAAA,EACF;AACF","file":"chunk-7LZJRVKJ.js","sourcesContent":["import type {\n AgentEvent,\n ConnectorContent,\n ConnectorEntry,\n ConnectorInfo,\n ConnectorOperation,\n ConnectorResponseEvent,\n ConnectorResponseFailureCode,\n ConnectorStat,\n ConnectorStatusEvent,\n ListOptions,\n MountInfo,\n ReadOptions,\n SearchOptions,\n StatOptions,\n} from \"@skaile/workspaces/types\";\nimport type {\n ConnectorStatus,\n ResourceClientSnapshot,\n StoreTransport,\n SubscribableStore,\n} from \"./types.js\";\n\nconst DEFAULT_TIMEOUT_MS = 30_000;\n\n/**\n * Rejection for a `resource_response` that carried an `error`. `code` is the\n * runner's machine-readable failure class, absent from runners older than\n * protocol 4.2.0.\n */\nexport class ResourceRequestError extends Error {\n readonly code: ConnectorResponseFailureCode | undefined;\n\n constructor(message: string, code?: ConnectorResponseFailureCode) {\n super(message);\n this.name = \"ResourceRequestError\";\n this.code = code;\n }\n}\n\n/**\n * Lazy resource browser for agent connectors.\n *\n * Provides a reactive list of connected mounts and connectors, and\n * request/response methods for browsing connector contents. Shares\n * the same transport (`send` + `onEvent`) as `AgentStore`.\n * @docLink packages/store/concepts#resource-client\n */\nexport class ResourceClient implements SubscribableStore<ResourceClientSnapshot> {\n private readonly _send: StoreTransport[\"send\"];\n private _mounts: readonly MountInfo[] = [];\n private _connectors: readonly ConnectorInfo[] = [];\n\n /** Live connection status per connector, keyed by connector ID. Updated by connector_status events. */\n connectorStatus: Map<string, ConnectorStatus> = new Map();\n\n private _snapshot: ResourceClientSnapshot | null = null;\n private readonly _listeners = new Set<() => void>();\n private readonly _pendingRequests = new Map<\n string,\n {\n resolve: (event: ConnectorResponseEvent) => void;\n reject: (error: Error) => void;\n timer: ReturnType<typeof setTimeout>;\n }\n >();\n private readonly _unsubEvent: () => void;\n\n /**\n * @param transport - Shared transport (same instance as the AgentStore for this session).\n */\n constructor(transport: StoreTransport) {\n this._send = transport.send;\n this._unsubEvent = transport.onEvent((event) => this._handleEvent(event));\n }\n\n // -- Reactive state --------------------------------------------------------\n\n /** Mounts available in this session, populated from `resources_available` events. */\n get mounts(): readonly MountInfo[] {\n return this._mounts;\n }\n\n /** Tool-based connectors available in this session, populated from `resources_available` events. */\n get connectors(): readonly ConnectorInfo[] {\n return this._connectors;\n }\n\n // -- Resource operations ---------------------------------------------------\n\n /**\n * List directory entries at the given path within a connector.\n *\n * @param connectorId - ID of the connector to query.\n * @param path - Directory path to list. Omit for the connector root.\n * @param opts - Optional pagination and filter options.\n * @returns Array of entries (files, directories, etc.) at the given path.\n * @throws If the request times out or the connector returns an error.\n */\n async list(connectorId: string, path?: string, opts?: ListOptions): Promise<ConnectorEntry[]> {\n const response = await this._request(connectorId, \"list\", path, opts);\n return (response.data as ConnectorEntry[]) ?? [];\n }\n\n /**\n * Read the content of a single resource.\n *\n * @param connectorId - ID of the connector to query.\n * @param path - Full path to the resource within the connector.\n * @param opts - `{ encoding: \"binary\" }` asks a filesystem mount for base64\n * of the bytes instead of text guessed from a NUL sniff (protocol 4.6.0;\n * an older runner ignores it).\n * @returns The resource content object.\n * @throws If the request times out or the connector returns an error.\n */\n async read(connectorId: string, path: string, opts?: ReadOptions): Promise<ConnectorContent> {\n const response = await this._request(connectorId, \"read\", path, opts);\n return response.data as ConnectorContent;\n }\n\n /**\n * Write content to a resource, creating it if it does not exist.\n *\n * @param connectorId - ID of the connector to write to.\n * @param path - Full path to the resource within the connector.\n * @param content - Content to write.\n * @throws If the request times out or the connector returns an error.\n */\n async write(connectorId: string, path: string, content: ConnectorContent): Promise<void> {\n await this._request(connectorId, \"write\", path, undefined, content);\n }\n\n /**\n * Delete a resource from a connector.\n *\n * @param connectorId - ID of the connector to delete from.\n * @param path - Full path to the resource within the connector.\n * @throws If the request times out or the connector returns an error.\n */\n async delete(connectorId: string, path: string): Promise<void> {\n await this._request(connectorId, \"delete\", path);\n }\n\n /**\n * Full-text search within a connector.\n *\n * @param connectorId - ID of the connector to search.\n * @param query - Search query string.\n * @param opts - Optional search options (e.g. path prefix, result limit).\n * @returns Matching entries, ordered by relevance as determined by the connector.\n * @throws If the request times out or the connector returns an error.\n */\n async search(\n connectorId: string,\n query: string,\n opts?: SearchOptions,\n ): Promise<ConnectorEntry[]> {\n const response = await this._request(connectorId, \"search\", query, opts);\n return (response.data as ConnectorEntry[]) ?? [];\n }\n\n /**\n * Create an empty directory on a filesystem mount, parents included.\n *\n * @param connectorId - ID of the mount.\n * @param path - Directory path within the mount.\n * @throws {ResourceRequestError} with `code: \"already_exists\"` if something\n * is already at `path`; also if the target is not a filesystem mount or the\n * runner predates protocol 4.2.0 (then `code` is absent).\n */\n async mkdir(connectorId: string, path: string): Promise<void> {\n await this._request(connectorId, \"mkdir\", path);\n }\n\n /**\n * Describe one path on a filesystem mount; with `opts.recursive`, a\n * directory also carries capped recursive totals.\n *\n * @param connectorId - ID of the mount.\n * @param path - Path within the mount; omit for the mount root.\n * @param opts - Optional stat options.\n * @throws If the path does not exist, the target is not a filesystem mount,\n * or the runner predates protocol 4.2.0.\n */\n async stat(connectorId: string, path?: string, opts?: StatOptions): Promise<ConnectorStat> {\n const response = await this._request(connectorId, \"stat\", path, opts);\n return response.data as ConnectorStat;\n }\n\n // -- useSyncExternalStore interface ----------------------------------------\n\n /**\n * Register a change listener. Called after every resource availability change.\n *\n * Conforms to the `subscribe` parameter of React's `useSyncExternalStore`.\n *\n * @param listener - Callback invoked whenever mounts or connectors change.\n * @returns Unsubscribe function — call to stop receiving notifications.\n */\n subscribe = (listener: () => void): (() => void) => {\n this._listeners.add(listener);\n return () => this._listeners.delete(listener);\n };\n\n /**\n * Return the current immutable resource snapshot.\n *\n * A new object is produced lazily after each `resources_available` event.\n * Conforms to the `getSnapshot` parameter of React's `useSyncExternalStore`.\n */\n getSnapshot = (): ResourceClientSnapshot => {\n if (!this._snapshot) {\n this._snapshot = { mounts: this._mounts, connectors: this._connectors };\n }\n return this._snapshot;\n };\n\n // -- Connector config mutations --------------------------------------------\n\n /**\n * Send a `connector_config` add command to wire a new connector at runtime,\n * without restarting the session. The runner receives this command and\n * calls `ConnectorManager.connect()`, which fires a `connector_status` event\n * back to the store once the connector is live.\n *\n * @param declaration - Connector declaration (id, driver, access level, options).\n */\n addConnector(declaration: {\n id: string;\n driver: string;\n access?: \"read-only\" | \"read-write\";\n options?: Record<string, unknown>;\n }): void {\n this._send({ type: \"connector_config\", action: \"add\", declaration });\n }\n\n /**\n * Send a `connector_config` remove command to disconnect a connector by ID\n * without restarting the session.\n *\n * @param connectorId - ID of the connector to disconnect and remove.\n */\n removeConnector(connectorId: string): void {\n this._send({ type: \"connector_config\", action: \"remove\", connectorId });\n }\n\n /**\n * Send a `connector_config` refresh command to reconnect all configured\n * connectors (e.g. after a credentials change).\n */\n refreshConnectors(): void {\n this._send({ type: \"connector_config\", action: \"refresh\" });\n }\n\n // -- Cleanup ---------------------------------------------------------------\n\n /**\n * Unsubscribe from transport events, reject all pending requests, and\n * clear all change listeners.\n *\n * All in-flight resource requests will reject\n * with `\"ResourceClient disposed\"`.\n */\n dispose(): void {\n this._unsubEvent();\n for (const [, pending] of this._pendingRequests) {\n clearTimeout(pending.timer);\n pending.reject(new Error(\"ResourceClient disposed\"));\n }\n this._pendingRequests.clear();\n this._listeners.clear();\n }\n\n // -- Internal --------------------------------------------------------------\n\n private _handleEvent(event: AgentEvent): void {\n if (event.type === \"connector_status\") {\n const e = event as ConnectorStatusEvent;\n const existing = this.connectorStatus.get(e.connectorId);\n const next = new Map(this.connectorStatus);\n next.set(e.connectorId, {\n id: e.connectorId,\n driver:\n existing?.driver ?? this._connectors.find((c) => c.id === e.connectorId)?.driver ?? \"\",\n state: e.status,\n ...(e.error !== undefined ? { error: e.error } : {}),\n ...(e.errorKind !== undefined ? { errorKind: e.errorKind } : {}),\n ...(e.latencyMs !== undefined ? { latencyMs: e.latencyMs } : {}),\n lastUpdated: new Date(),\n });\n this.connectorStatus = next;\n for (const listener of this._listeners) {\n listener();\n }\n return;\n }\n\n if (event.type === \"resources_available\") {\n this._mounts = event.mounts;\n this._connectors = event.connectors;\n this._snapshot = null;\n for (const listener of this._listeners) {\n listener();\n }\n return;\n }\n\n if (event.type === \"resource_response\") {\n const pending = this._pendingRequests.get(event.requestId);\n if (!pending) return;\n\n clearTimeout(pending.timer);\n this._pendingRequests.delete(event.requestId);\n\n if (event.error) {\n pending.reject(new ResourceRequestError(event.error, event.code));\n } else {\n pending.resolve(event);\n }\n }\n }\n\n private _request(\n connectorId: string,\n operation: ConnectorOperation,\n path?: string,\n options?: ListOptions | SearchOptions | StatOptions | ReadOptions,\n content?: ConnectorContent,\n ): Promise<ConnectorResponseEvent> {\n const requestId = crypto.randomUUID();\n\n return new Promise<ConnectorResponseEvent>((resolve, reject) => {\n const timer = setTimeout(() => {\n this._pendingRequests.delete(requestId);\n reject(\n new Error(\n `Resource request timed out after ${DEFAULT_TIMEOUT_MS}ms: ${operation} ${connectorId}${path ? ` ${path}` : \"\"}`,\n ),\n );\n }, DEFAULT_TIMEOUT_MS);\n\n this._pendingRequests.set(requestId, { resolve, reject, timer });\n\n this._send({\n type: \"resource_request\",\n requestId,\n connectorId,\n operation,\n ...(path !== undefined ? { path } : {}),\n ...(options ? { options } : {}),\n ...(content ? { content } : {}),\n });\n });\n }\n}\n","import type {\n AgentCommand,\n AgentEvent,\n AgentPhase,\n Capability,\n IncompatibleProtocolEvent,\n Message,\n ProtocolInfoEvent,\n RenderInvokedEvent,\n} from \"@skaile/workspaces/types\";\nimport type {\n AgentClientLike,\n AgentStoreOptions,\n AgentStoreSnapshot,\n ConnectionStatus,\n SubscribableStore,\n} from \"./types.js\";\n\nconst DEFAULT_PAGE_SIZE = 50;\n\n/** Conservative equality for plain JSON data; unsupported or unverifiable values fail open. */\nfunction isSameJsonValue<T>(a: T | undefined, b: T, conservativeCommandInput = false): boolean {\n const aObjects = new WeakSet<object>();\n const bObjects = new WeakSet<object>();\n\n const compare = (left: unknown, right: unknown): boolean => {\n if (left === null || right === null) return left === right;\n if (typeof left !== typeof right) return false;\n\n switch (typeof left) {\n case \"string\":\n case \"boolean\":\n return left === right;\n case \"number\":\n return (\n Number.isFinite(left) &&\n Number.isFinite(right) &&\n !Object.is(left, -0) &&\n !Object.is(right, -0) &&\n left === right\n );\n case \"object\":\n break;\n default:\n return false;\n }\n\n const leftObject = left as object;\n const rightObject = right as object;\n if (aObjects.has(leftObject) || bObjects.has(rightObject)) return false;\n if (conservativeCommandInput) {\n if (leftObject === rightObject || bObjects.has(leftObject) || aObjects.has(rightObject)) {\n return false;\n }\n }\n aObjects.add(leftObject);\n bObjects.add(rightObject);\n\n const leftIsArray = Array.isArray(leftObject);\n if (leftIsArray !== Array.isArray(rightObject)) return false;\n\n const leftPrototype = Object.getPrototypeOf(leftObject);\n const rightPrototype = Object.getPrototypeOf(rightObject);\n const leftHasPlainPrototype = leftIsArray\n ? leftPrototype === Array.prototype\n : leftPrototype === Object.prototype || leftPrototype === null;\n const rightHasPlainPrototype = leftIsArray\n ? rightPrototype === Array.prototype\n : rightPrototype === Object.prototype || rightPrototype === null;\n if (\n !leftHasPlainPrototype ||\n !rightHasPlainPrototype ||\n leftPrototype !== rightPrototype ||\n !Object.isExtensible(leftObject) ||\n !Object.isExtensible(rightObject)\n ) {\n return false;\n }\n\n const leftKeys = Reflect.ownKeys(leftObject);\n const rightKeys = Reflect.ownKeys(rightObject);\n if (\n leftKeys.length !== rightKeys.length ||\n leftKeys.some((key) => typeof key !== \"string\") ||\n rightKeys.some((key) => typeof key !== \"string\")\n ) {\n return false;\n }\n\n if (leftIsArray) {\n const leftLengthDescriptor = Object.getOwnPropertyDescriptor(leftObject, \"length\");\n const rightLengthDescriptor = Object.getOwnPropertyDescriptor(rightObject, \"length\");\n const leftLength = leftLengthDescriptor?.value;\n const rightLength = rightLengthDescriptor?.value;\n if (\n !leftLengthDescriptor ||\n !(\"value\" in leftLengthDescriptor) ||\n !leftLengthDescriptor.writable ||\n leftLengthDescriptor.enumerable ||\n leftLengthDescriptor.configurable ||\n !rightLengthDescriptor ||\n !(\"value\" in rightLengthDescriptor) ||\n !rightLengthDescriptor.writable ||\n rightLengthDescriptor.enumerable ||\n rightLengthDescriptor.configurable ||\n typeof leftLength !== \"number\" ||\n leftLength !== rightLength ||\n leftKeys.length !== leftLength + 1\n ) {\n return false;\n }\n\n for (let index = 0; index < leftLength; index++) {\n const key = String(index);\n const leftDescriptor = Object.getOwnPropertyDescriptor(leftObject, key);\n const rightDescriptor = Object.getOwnPropertyDescriptor(rightObject, key);\n if (\n !leftDescriptor?.enumerable ||\n !(\"value\" in leftDescriptor) ||\n !leftDescriptor.writable ||\n !leftDescriptor.configurable ||\n !rightDescriptor?.enumerable ||\n !(\"value\" in rightDescriptor) ||\n !rightDescriptor.writable ||\n !rightDescriptor.configurable ||\n !compare(leftDescriptor.value, rightDescriptor.value)\n ) {\n return false;\n }\n }\n return true;\n }\n\n for (let index = 0; index < leftKeys.length; index++) {\n const leftKey = leftKeys[index] as string;\n const rightKey = rightKeys[index] as string;\n if (leftKey !== rightKey) return false;\n\n const leftDescriptor = Object.getOwnPropertyDescriptor(leftObject, leftKey);\n const rightDescriptor = Object.getOwnPropertyDescriptor(rightObject, rightKey);\n if (\n !leftDescriptor?.enumerable ||\n !(\"value\" in leftDescriptor) ||\n !leftDescriptor.writable ||\n !leftDescriptor.configurable ||\n !rightDescriptor?.enumerable ||\n !(\"value\" in rightDescriptor) ||\n !rightDescriptor.writable ||\n !rightDescriptor.configurable ||\n !compare(leftDescriptor.value, rightDescriptor.value)\n ) {\n return false;\n }\n }\n return true;\n };\n\n try {\n const same = compare(a, b);\n if (!same || !conservativeCommandInput) return same;\n structuredClone(a);\n structuredClone(b);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Headless reactive store for agent conversation state.\n *\n * Framework-agnostic — works with React (`useSyncExternalStore`),\n * Vue (`shallowRef` + `subscribe`), or any other UI framework.\n *\n * Accepts a minimal transport interface (`send` + `onEvent`) so it works\n * with WebSocket, tRPC, SSE, or any other delivery mechanism.\n * @docLink packages/store/concepts#agent-store\n */\nexport class AgentStore implements SubscribableStore<AgentStoreSnapshot> {\n private readonly _options: AgentStoreOptions;\n private _messages: Message[];\n private _streamingText = \"\";\n private _cancelledText = \"\";\n private _status: ConnectionStatus = \"idle\";\n private _phase: AgentPhase = \"idle\";\n private _pendingQuestion: AgentStoreSnapshot[\"pendingQuestion\"] = null;\n private _error: AgentStoreSnapshot[\"error\"] = null;\n private _isAllLoaded: boolean;\n private _seq: number;\n private _streamingFlushed = true;\n /** Shared state per store namespace — new Map instance on every mutation. */\n private _sharedState: Map<string, Record<string, unknown>> = new Map();\n /** Protocol v2 capability registry — new Map instance on every mutation. */\n private _capabilities: Map<string, Capability> = new Map();\n /** Protocol v2 active render invocations — new Map instance on every mutation. */\n private _activeRenderInvocations: Map<string, RenderInvokedEvent> = new Map();\n /** Protocol v2 — most recent `protocol_info` event from the runner. */\n private _protocolInfo: ProtocolInfoEvent | null = null;\n /** Protocol v2 — latest incompatible-protocol notice. */\n private _incompatibleProtocol: IncompatibleProtocolEvent | null = null;\n\n private _snapshot: AgentStoreSnapshot | null = null;\n private readonly _listeners = new Set<() => void>();\n private readonly _unsubEvent: () => void;\n private readonly _unsubStatus: (() => void) | undefined;\n\n /**\n * @param options - Store configuration including transport and optional pagination support.\n */\n constructor(options: AgentStoreOptions) {\n this._options = options;\n this._messages = options.initialMessages ? [...options.initialMessages] : [];\n this._isAllLoaded = !options.loadMessages;\n this._seq = this._messages.reduce((max, m) => Math.max(max, m.seq), 0);\n\n this._unsubEvent = options.onEvent((event) => this._handleEvent(event));\n this._unsubStatus = options.onStatusChange?.((status) => this.setStatus(status));\n }\n\n // -- Reactive state --------------------------------------------------------\n\n /** Accumulated conversation messages, oldest first. */\n get messages(): readonly Message[] {\n return this._messages;\n }\n\n /** Text currently streaming from the agent. Empty when not streaming. */\n get streamingText(): string {\n return this._streamingText;\n }\n\n /** Current connection lifecycle state. */\n get status(): ConnectionStatus {\n return this._status;\n }\n\n /** Current agent execution phase (e.g. `\"idle\"`, `\"thinking\"`, `\"executing\"`). */\n get phase(): AgentPhase {\n return this._phase;\n }\n\n /** The pending question the agent is waiting for the user to answer, or null. */\n get pendingQuestion(): AgentStoreSnapshot[\"pendingQuestion\"] {\n return this._pendingQuestion;\n }\n\n /** Most recent error, or null when no error is active. */\n get error(): AgentStoreSnapshot[\"error\"] {\n return this._error;\n }\n\n /** Partial text that was visible when the user cancelled. Empty when not cancelled. */\n get cancelledText(): string {\n return this._cancelledText;\n }\n\n /** True when there are no more older messages to load via pagination. */\n get isAllLoaded(): boolean {\n return this._isAllLoaded;\n }\n\n // -- Commands --------------------------------------------------------------\n\n /**\n * Send a user prompt to the agent and optimistically update local state.\n *\n * Clears any previous error and cancelled text, sets phase to `\"thinking\"`,\n * and appends the prompt as a local message before forwarding to the agent.\n *\n * @param text - The user's prompt text.\n */\n prompt(text: string): void {\n // A prompt sent mid-turn (sender interjecting while the agent streams) is a\n // boundary: finalize the in-flight text before this prompt so the two don't\n // merge into one bubble. No-op at turn start (nothing streaming).\n this._flushStreaming();\n this._error = null;\n this._cancelledText = \"\";\n this._streamingFlushed = false;\n // A free-form prompt abandons any unanswered question: the turn it belonged\n // to is over. Left set, it would gate every status of the new turn.\n this._pendingQuestion = null;\n this._phase = \"thinking\";\n this._appendMessage({ type: \"prompt\", prompt: text }, \"user\");\n this._options.send({ type: \"prompt\", prompt: text });\n this._notify();\n }\n\n /**\n * Send a reply to the agent's pending question.\n *\n * Clears the pending question locally before forwarding the reply command.\n *\n * @param answer - The user's answer text.\n * @param question - The sub-question being answered, verbatim from its\n * `question` event. Required for correctness in hosts that surface several\n * queued questions at once ({@link pendingQuestion} tracks only the latest,\n * so those hosts drive this from their own message history): without it the\n * agent files the answer under its next unanswered sub-question, which\n * mismatches any non-sequential reply.\n * @param requestId - Exact identity from the rendered question; never inferred from pending state.\n */\n reply(answer: string, question?: string, requestId?: string): void {\n // A reply to a stale card must not clear a newer request in this client.\n if (this._pendingQuestion?.requestId && this._pendingQuestion.requestId !== requestId) return;\n this._pendingQuestion = null;\n // Answering a pending question resumes the agent turn — restore the busy\n // phase (mirrors prompt()) so the thinking indicator reappears immediately\n // rather than after the agent's first resumed event lands.\n this._phase = \"thinking\";\n const command = {\n type: \"reply\",\n answer,\n ...(question !== undefined ? { question } : {}),\n ...(requestId !== undefined ? { requestId } : {}),\n } as const;\n this._appendMessage(command, \"user\");\n this._options.send(command);\n this._notify();\n }\n\n /**\n * Cancel the current agent turn.\n *\n * Preserves partial streaming text in {@link cancelledText} so the UI can\n * display it. Clears streaming state, sets phase to `\"cancelling\"` (not\n * yet confirmed idle — see {@link AgentPhase}), and sends a `cancel`\n * command to the agent.\n */\n cancel(): void {\n // Preserve partial streaming text so the UI can still display it\n this._cancelledText = this._streamingText;\n this._streamingText = \"\";\n this._streamingFlushed = true;\n this._phase = \"cancelling\";\n this._options.send({ type: \"cancel\" });\n this._notify();\n }\n\n /**\n * Update shared state for a store namespace.\n *\n * Sends a `state_update` command to the agent and optimistically\n * updates local state so the change is reflected immediately.\n *\n * @param store - Store namespace (e.g. \"app\", \"component:render-123\").\n * @param state - Full state snapshot (replaces previous).\n */\n updateState(store: string, state: Record<string, unknown>): void {\n this._options.send({ type: \"state_update\", store, state });\n if (isSameJsonValue(this._sharedState.get(store), state, true)) return;\n // Optimistic local update\n this._sharedState = new Map(this._sharedState);\n this._sharedState.set(store, state);\n this._notify();\n }\n\n /**\n * Send an arbitrary command to the agent.\n *\n * Use this for commands that don't have a dedicated convenience method\n * (e.g. `ui_interaction`). No local state changes — the command is\n * forwarded as-is to the transport.\n *\n * @param cmd - The command to send.\n */\n send(cmd: AgentCommand): void {\n this._options.send(cmd);\n }\n\n /**\n * Load the previous page of messages and prepend them to the current list.\n *\n * No-op when `loadMessages` was not provided at construction time or when\n * all history has already been loaded ({@link isAllLoaded} is true).\n * Sets {@link isAllLoaded} to true once the server returns fewer messages\n * than the configured page size.\n */\n async loadPreviousMessages(): Promise<void> {\n if (!this._options.loadMessages || this._isAllLoaded) return;\n\n const pageSize = this._options.pageSize ?? DEFAULT_PAGE_SIZE;\n const before = this._messages.length > 0 ? this._messages[0].seq : undefined;\n const older = await this._options.loadMessages({ before, limit: pageSize });\n\n if (older.length < pageSize) this._isAllLoaded = true;\n\n const existingIds = new Set(this._messages.map((m) => m.id));\n const unique = older.filter((m) => !existingIds.has(m.id));\n this._messages = [...unique, ...this._messages];\n\n this._notify();\n }\n\n // -- External control ------------------------------------------------------\n\n /**\n * Programmatically update the connection status.\n *\n * Called by transport wrappers that cannot use the `onStatusChange`\n * callback (e.g. tRPC subscriptions that track status externally).\n *\n * Writing the status the store already holds is a no-op: it neither rotates\n * the snapshot nor notifies listeners.\n *\n * @param status - The new connection status.\n */\n setStatus(status: ConnectionStatus): void {\n if (this._status === status) return;\n this._status = status;\n this._notify();\n }\n\n // -- useSyncExternalStore interface ----------------------------------------\n\n /**\n * Register a change listener. Called synchronously after every state change.\n *\n * Conforms to the `subscribe` parameter of React's `useSyncExternalStore`.\n *\n * @param listener - Callback invoked whenever state changes.\n * @returns Unsubscribe function — call to stop receiving notifications.\n */\n subscribe = (listener: () => void): (() => void) => {\n this._listeners.add(listener);\n return () => this._listeners.delete(listener);\n };\n\n /**\n * Return the current immutable state snapshot.\n *\n * A new object is produced lazily on the first call after each state change.\n * Subsequent calls return the same cached object until the next change.\n * Conforms to the `getSnapshot` parameter of React's `useSyncExternalStore`.\n */\n getSnapshot = (): AgentStoreSnapshot => {\n if (!this._snapshot) {\n this._snapshot = {\n messages: this._messages,\n streamingText: this._streamingText,\n cancelledText: this._cancelledText,\n status: this._status,\n phase: this._phase,\n pendingQuestion: this._pendingQuestion,\n error: this._error,\n isAllLoaded: this._isAllLoaded,\n sharedState: this._sharedState,\n capabilities: this._capabilities,\n activeRenderInvocations: this._activeRenderInvocations,\n protocolInfo: this._protocolInfo,\n incompatibleProtocol: this._incompatibleProtocol,\n };\n }\n return this._snapshot;\n };\n\n // -- Cleanup ---------------------------------------------------------------\n\n /**\n * Unsubscribe from transport events and clear all change listeners.\n *\n * Call this when the component or service that owns the store unmounts or\n * shuts down to prevent memory leaks.\n */\n dispose(): void {\n this._unsubEvent();\n this._unsubStatus?.();\n this._listeners.clear();\n }\n\n // -- Factory ---------------------------------------------------------------\n\n /**\n * Create an {@link AgentStore} connected to a duck-typed agent client.\n *\n * Adapts the client's `send`/`onEvent`/`offEvent` API to the\n * {@link StoreTransport} interface expected by the constructor, without\n * creating a hard runtime dependency on `@skaile/workspaces/client`.\n *\n * @param client - Any object implementing {@link AgentClientLike}.\n * @param opts - Optional store configuration.\n * @param opts.sessionId - Session ID for message envelopes (defaults to a new UUID).\n * @param opts.initialMessages - Messages to pre-populate the store with.\n *\n * @example\n * ```ts\n * const store = AgentStore.fromClient(agentClient, { sessionId: 'sess-123' })\n * ```\n */\n static fromClient(\n client: AgentClientLike,\n opts?: { sessionId?: string; initialMessages?: Message[] },\n ): AgentStore {\n return new AgentStore({\n sessionId: opts?.sessionId ?? crypto.randomUUID(),\n send: (cmd) => client.send(cmd),\n onEvent: (handler) => {\n client.onEvent(handler);\n return () => client.offEvent(handler);\n },\n initialMessages: opts?.initialMessages,\n });\n }\n\n // -- Internal --------------------------------------------------------------\n\n private _handleEvent(event: AgentEvent): void {\n switch (event.type) {\n case \"text\":\n this._cancelledText = \"\";\n this._streamingText += event.content;\n this._streamingFlushed = false;\n break;\n\n case \"text_retract\":\n // The driver abandoned an attempt mid-message and is replaying it. Cut\n // only a matching tail: text already flushed into a message, or a\n // stream that no longer ends in the fragment, is left as it is.\n if (!event.content || !this._streamingText.endsWith(event.content)) return;\n this._streamingText = this._streamingText.slice(\n 0,\n this._streamingText.length - event.content.length,\n );\n break;\n\n case \"finished\":\n this._cancelledText = \"\";\n this._flushStreaming();\n this._appendMessage(event);\n // A cancelled finished is synthetic (persisted immediately for reload-\n // durability) and precedes the driver's real abort/kill sequence — stay\n // \"cancelling\" until the later, genuine status event reports \"idle\".\n if (!event.cancelled) this._phase = \"idle\";\n this._pendingQuestion = null;\n break;\n\n case \"status\":\n // While cancelling, the driver's interrupt/unwind window can still emit\n // stale \"working\" statuses for already-buffered tool activity — ignore\n // anything but the genuine idle confirmation.\n if (this._phase === \"cancelling\" && event.phase !== \"idle\") return;\n // A parked question is the same shape: the driver re-emits the turn's\n // buffered tool activity — including one call for the question tool\n // itself — while nothing is actually running. Only the genuine idle\n // confirmation may move the phase until the user answers.\n if (this._pendingQuestion !== null && event.phase !== \"idle\") return;\n // The bridge re-emits phase:\"working\" on every tool call, so most status\n // events in a turn carry the phase we already hold. `_notify()` rotates\n // the snapshot, so notifying for them re-renders consumers for nothing.\n if (this._phase === event.phase) return;\n this._phase = event.phase;\n break;\n\n case \"user_message\":\n // A peer's message mid-turn is a boundary: finalize the in-flight text\n // so it renders before the interjection. Flush-only — the peer message\n // is delivered via the host's history, not this transient echo. The\n // flush is internally conditional, so an echo arriving while nothing is\n // streaming (the common case — peers talk between turns) changed no\n // state and notifying for it was a pure fanout.\n if (!this._flushStreaming()) return;\n break;\n\n case \"question_reply\": {\n // A peer answered: open the status gate the same way `reply()` does.\n // The runner echoes every reply to all clients, so the replier's own\n // echo (its question already cleared) and an answer to an older\n // question of a multi-question ask must leave this client untouched.\n // A complete arm rather than a fall through into the group below:\n // sharing that body once let a tool_call clear the flag.\n const pending = this._pendingQuestion;\n if (pending === null) return;\n if (pending.requestId !== undefined && pending.requestId !== event.requestId) return;\n if (event.question !== undefined && event.question !== pending.question) return;\n this._pendingQuestion = null;\n this._flushStreaming();\n this._appendMessage(event);\n break;\n }\n\n case \"tool_call\":\n case \"tool_result\":\n case \"file_changed\":\n case \"subagent\":\n case \"dev_server\":\n case \"handoff\":\n // Flush in-flight text first so each text block becomes its own\n // Message, interleaved with tool activity in order — otherwise text\n // before and after a tool call merges into one wall-of-text blob.\n this._flushStreaming();\n this._appendMessage(event);\n break;\n\n case \"question\":\n // A pending question is a human-in-the-loop pause — the agent is waiting\n // for the user, not working. Reset to idle (like finished/error) so any\n // phase-derived busy indicator clears until the user replies.\n this._flushStreaming();\n this._phase = \"idle\";\n this._pendingQuestion = event;\n this._appendMessage(event);\n break;\n\n case \"error\":\n this._error = { message: event.message, fatal: event.fatal };\n this._streamingText = \"\";\n this._streamingFlushed = true;\n this._phase = \"idle\";\n // A fatal error ends the turn like `finished`; a surviving question would\n // keep the status gate shut. Non-fatal side-channel errors leave it parked.\n if (event.fatal) this._pendingQuestion = null;\n this._appendMessage(event);\n break;\n\n case \"state_changed\": {\n // Accumulate state per store namespace (notify only — no message).\n // Re-emits of unchanged state are routine, not exceptional: `serve.ts`\n // replays every namespace on connect (`buildStoreSnapshotReplay`), on a\n // seeded execution, on re-registering an already-registered store, and\n // immediately after registration — and the `xstate-store` adapter is\n // equality-free, so writing a key its current value emits too. Each of\n // those rebuilt the Map and rotated the snapshot for identical state.\n if (isSameJsonValue(this._sharedState.get(event.store), event.state)) return;\n this._sharedState = new Map(this._sharedState);\n this._sharedState.set(event.store, event.state);\n break;\n }\n\n // ── Protocol v2 ────────────────────────────────────────────────────────\n\n case \"capability_register\": {\n // TRANSIENT — accumulate v2 capabilities into the registry (no message).\n // The gateway replays the whole set on every (re)attach; a byte-identical\n // replay must not rotate the Map identity or notify, or a reconnect storm\n // compounds into an unbounded render loop in consumers.\n if (\n event.capabilities.every((cap) => isSameJsonValue(this._capabilities.get(cap.name), cap))\n ) {\n return;\n }\n this._capabilities = new Map(this._capabilities);\n for (const cap of event.capabilities) {\n this._capabilities.set(cap.name, cap);\n }\n break;\n }\n\n case \"capability_deregister\": {\n // TRANSIENT — drop capabilities by name. Names we never had are a no-op:\n // rebuilding the Map for them would notify with an identical registry.\n const present = event.names.filter((name) => this._capabilities.has(name));\n if (present.length === 0) return;\n this._capabilities = new Map(this._capabilities);\n for (const name of present) {\n this._capabilities.delete(name);\n }\n break;\n }\n\n case \"render_invoked\":\n // TRANSIENT — record latest render invocation (frontend pairs with\n // the matching `Capability.render` for placement).\n this._activeRenderInvocations = new Map(this._activeRenderInvocations);\n this._activeRenderInvocations.set(event.callId, event);\n break;\n\n case \"protocol_info\": {\n // TRANSIENT — runner announced its protocol version. It announces on\n // every attach, so tab mounts, StrictMode remounts and SSE reconnects\n // almost always carry the version we already hold. `ProtocolInfoEvent`\n // is nothing but `version`, and `ProtocolVersion` is exactly three\n // numbers, so the field comparison is complete, not conservative.\n //\n // A fresh announcement also retires any incompatibility notice: the\n // platform restarts the session on `incompatible_protocol`, and this\n // event is the replacement container introducing itself. Nothing cleared\n // `_incompatibleProtocol` before, so the restart banner was sticky for\n // the life of the store even though the platform's debug pane documents\n // this clear as already happening. Guarding without clearing would make\n // that permanent, since a repeat announcement would never get here.\n const held = this._protocolInfo?.version;\n const sameVersion =\n held !== undefined &&\n held.major === event.version.major &&\n held.minor === event.version.minor &&\n held.patch === event.version.patch;\n if (sameVersion && this._incompatibleProtocol === null) return;\n // Keep the held event object when the version is unchanged so consumers\n // with an effect keyed on `snapshot.protocolInfo` do not re-fire.\n if (!sameVersion) this._protocolInfo = event;\n this._incompatibleProtocol = null;\n break;\n }\n\n case \"incompatible_protocol\":\n // TRANSIENT — runner detected version drift; platform restarts session.\n this._incompatibleProtocol = event;\n break;\n\n case \"capability_invoked\":\n // Backend intercepts client-side invocations and dispatches them\n // through V2CapabilityRegistryService — frontends should not see\n // these. Drop silently if one slips through.\n return;\n\n case \"resource_response\":\n case \"resources_available\":\n // Transient — handled by ResourceClient, not AgentStore\n return;\n\n default:\n // The switch names 22 of `AgentEvent`'s 56 members. The other 34 —\n // `log_entry` above all, one per line of container output — hold no\n // AgentStore state, so falling through to the trailing `_notify()`\n // rotated the snapshot and re-rendered every consumer for state that\n // had not changed. Unlike the guarded cases this was not a replay\n // artifact: it happened on every single occurrence. Hosts that need\n // these events (log panels, mount indicators, typing bubbles) read them\n // off the transport upstream of the store, not out of the snapshot.\n //\n // Deliberately not an `assertNever` exhaustiveness check: that is a\n // compile error while 34 members are unnamed, and naming all 56 would\n // enumerate events the store holds no state for just to satisfy it.\n return;\n }\n\n this._notify();\n }\n\n /**\n * Finalize buffered streaming text as a `text` Message.\n *\n * @returns true when text was flushed; false when there was nothing to flush,\n * so callers can skip a notify that would change nothing.\n */\n private _flushStreaming(): boolean {\n if (this._streamingFlushed || !this._streamingText) return false;\n this._appendMessage({ type: \"text\", content: this._streamingText });\n this._streamingText = \"\";\n this._streamingFlushed = true;\n return true;\n }\n\n private _appendMessage(payload: AgentCommand | AgentEvent, senderId?: string): void {\n this._seq++;\n this._messages = [\n ...this._messages,\n {\n id: crypto.randomUUID(),\n seq: this._seq,\n timestamp: new Date().toISOString(),\n sessionId: this._options.sessionId,\n ...(senderId ? { senderId } : {}),\n payload,\n },\n ];\n }\n\n private _notify(): void {\n this._snapshot = null;\n for (const listener of this._listeners) {\n listener();\n }\n }\n}\n"]}