@skaile/workspaces 6.9.0 → 6.10.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 (345) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/ai-sdk.js +8 -8
  3. package/dist/{asset-feeds-JWRIWLVX.js → asset-feeds-UG3PG423.js} +22 -22
  4. package/dist/{asset-feeds-JWRIWLVX.js.map → asset-feeds-UG3PG423.js.map} +1 -1
  5. package/dist/asset-manager/catalog-deployer.js +8 -8
  6. package/dist/asset-manager/history.js +8 -8
  7. package/dist/asset-manager/index.js +14 -14
  8. package/dist/asset-manager/installer.js +9 -9
  9. package/dist/asset-manager/renderers.js +8 -8
  10. package/dist/asset-manager/src/harness-switch-state.d.ts +30 -0
  11. package/dist/asset-manager/src/harness-switch-state.d.ts.map +1 -0
  12. package/dist/asset-manager/src/index.d.ts +49 -12
  13. package/dist/asset-manager/src/index.d.ts.map +1 -1
  14. package/dist/asset-manager/src/mcp-config.d.ts +6 -0
  15. package/dist/asset-manager/src/mcp-config.d.ts.map +1 -1
  16. package/dist/bridge/codex-app-server.js +1 -2
  17. package/dist/bridge/harnesses/claude-sdk.js +11 -11
  18. package/dist/bridge/harnesses/codex.js +15 -1926
  19. package/dist/bridge/harnesses/codex.js.map +1 -1
  20. package/dist/bridge/harnesses/continue.js +11 -11
  21. package/dist/bridge/harnesses/echo.js +3 -3
  22. package/dist/bridge/harnesses/gemini.js +6 -6
  23. package/dist/bridge/harnesses/goose.js +11 -11
  24. package/dist/bridge/harnesses/omp.js +61 -9
  25. package/dist/bridge/harnesses/omp.js.map +1 -1
  26. package/dist/bridge/harnesses/opencode.js +11 -11
  27. package/dist/bridge/harnesses/qwen.js +6 -6
  28. package/dist/bridge/index.js +17 -16
  29. package/dist/bridge/src/harness-model-check.d.ts +5 -4
  30. package/dist/bridge/src/harness-model-check.d.ts.map +1 -1
  31. package/dist/bridge/src/harnesses/codex.d.ts +13 -0
  32. package/dist/bridge/src/harnesses/codex.d.ts.map +1 -1
  33. package/dist/bridge/src/harnesses/omp.d.ts +22 -0
  34. package/dist/bridge/src/harnesses/omp.d.ts.map +1 -1
  35. package/dist/bridge/src/index.d.ts +1 -0
  36. package/dist/bridge/src/index.d.ts.map +1 -1
  37. package/dist/{chunk-XPKUFOS3.js → chunk-2D6HZAO5.js} +8 -8
  38. package/dist/{chunk-XPKUFOS3.js.map → chunk-2D6HZAO5.js.map} +1 -1
  39. package/dist/chunk-2MUUPRIG.js +688 -0
  40. package/dist/chunk-2MUUPRIG.js.map +1 -0
  41. package/dist/{chunk-TMQFOJ6F.js → chunk-2PVYDAFN.js} +3 -3
  42. package/dist/{chunk-TMQFOJ6F.js.map → chunk-2PVYDAFN.js.map} +1 -1
  43. package/dist/{chunk-YGT3CGPD.js → chunk-2U67XYZM.js} +3 -3
  44. package/dist/{chunk-YGT3CGPD.js.map → chunk-2U67XYZM.js.map} +1 -1
  45. package/dist/{chunk-5NTB64PW.js → chunk-375HN3FD.js} +18 -14
  46. package/dist/chunk-375HN3FD.js.map +1 -0
  47. package/dist/{chunk-23Q5LT4U.js → chunk-4I4SBOCS.js} +345 -88
  48. package/dist/chunk-4I4SBOCS.js.map +1 -0
  49. package/dist/{chunk-WPLZGT5Z.js → chunk-4Z4RULWQ.js} +59 -31
  50. package/dist/chunk-4Z4RULWQ.js.map +1 -0
  51. package/dist/{chunk-72BDCGBB.js → chunk-5JBMYZNA.js} +3 -3
  52. package/dist/{chunk-72BDCGBB.js.map → chunk-5JBMYZNA.js.map} +1 -1
  53. package/dist/{chunk-3EPRTMXY.js → chunk-5KQFR4D7.js} +6 -6
  54. package/dist/{chunk-3EPRTMXY.js.map → chunk-5KQFR4D7.js.map} +1 -1
  55. package/dist/{chunk-KNY356I3.js → chunk-5KSGZP3E.js} +11 -4
  56. package/dist/chunk-5KSGZP3E.js.map +1 -0
  57. package/dist/{chunk-DZRN3SNG.js → chunk-5P7LTPBR.js} +5 -5
  58. package/dist/{chunk-DZRN3SNG.js.map → chunk-5P7LTPBR.js.map} +1 -1
  59. package/dist/{chunk-PTJZCOBH.js → chunk-6O7VDKX3.js} +2 -2
  60. package/dist/{chunk-PTJZCOBH.js.map → chunk-6O7VDKX3.js.map} +1 -1
  61. package/dist/{chunk-B2DGCYVC.js → chunk-7DUOKE73.js} +27 -33
  62. package/dist/chunk-7DUOKE73.js.map +1 -0
  63. package/dist/{chunk-V5KG6CCV.js → chunk-7HRZACI4.js} +7 -2
  64. package/dist/chunk-7HRZACI4.js.map +1 -0
  65. package/dist/{chunk-U3FI4DVT.js → chunk-7K73MCI6.js} +7 -5
  66. package/dist/chunk-7K73MCI6.js.map +1 -0
  67. package/dist/{chunk-SE6OL7Y5.js → chunk-BCID52M5.js} +6 -6
  68. package/dist/{chunk-SE6OL7Y5.js.map → chunk-BCID52M5.js.map} +1 -1
  69. package/dist/{chunk-FZO64PLQ.js → chunk-BNLXZXZN.js} +81 -8
  70. package/dist/chunk-BNLXZXZN.js.map +1 -0
  71. package/dist/{chunk-O3FYOS64.js → chunk-C5UKYTTD.js} +13 -23
  72. package/dist/chunk-C5UKYTTD.js.map +1 -0
  73. package/dist/{chunk-LYVLDGML.js → chunk-CG63XGVV.js} +3 -3
  74. package/dist/{chunk-LYVLDGML.js.map → chunk-CG63XGVV.js.map} +1 -1
  75. package/dist/{chunk-4ROXSQEG.js → chunk-CJO3XKO7.js} +4 -4
  76. package/dist/{chunk-4ROXSQEG.js.map → chunk-CJO3XKO7.js.map} +1 -1
  77. package/dist/{chunk-OSABUEWA.js → chunk-CVUMZTNO.js} +4 -4
  78. package/dist/{chunk-OSABUEWA.js.map → chunk-CVUMZTNO.js.map} +1 -1
  79. package/dist/{chunk-E675QKFG.js → chunk-DOMRBOJZ.js} +5 -5
  80. package/dist/{chunk-E675QKFG.js.map → chunk-DOMRBOJZ.js.map} +1 -1
  81. package/dist/{chunk-GTAHU4N4.js → chunk-EB2LKPI6.js} +4 -4
  82. package/dist/{chunk-GTAHU4N4.js.map → chunk-EB2LKPI6.js.map} +1 -1
  83. package/dist/{chunk-GZL6RN4Z.js → chunk-FXBKBOI5.js} +169 -49
  84. package/dist/chunk-FXBKBOI5.js.map +1 -0
  85. package/dist/{chunk-AERQFD6T.js → chunk-GA4GUDTL.js} +4 -4
  86. package/dist/{chunk-AERQFD6T.js.map → chunk-GA4GUDTL.js.map} +1 -1
  87. package/dist/{chunk-NJVHGS7X.js → chunk-HE3TZYNG.js} +4 -4
  88. package/dist/{chunk-NJVHGS7X.js.map → chunk-HE3TZYNG.js.map} +1 -1
  89. package/dist/chunk-HLFLET7S.js +2443 -0
  90. package/dist/chunk-HLFLET7S.js.map +1 -0
  91. package/dist/{chunk-Y2BQWZXT.js → chunk-HQUF6O4B.js} +27 -56
  92. package/dist/chunk-HQUF6O4B.js.map +1 -0
  93. package/dist/{chunk-T5EIWWEJ.js → chunk-IMO4EHND.js} +5 -5
  94. package/dist/{chunk-T5EIWWEJ.js.map → chunk-IMO4EHND.js.map} +1 -1
  95. package/dist/{chunk-TUOHA6BM.js → chunk-IOXFT5D7.js} +3 -3
  96. package/dist/{chunk-TUOHA6BM.js.map → chunk-IOXFT5D7.js.map} +1 -1
  97. package/dist/{chunk-5AQLCRR7.js → chunk-JDZUQFN7.js} +4 -4
  98. package/dist/{chunk-5AQLCRR7.js.map → chunk-JDZUQFN7.js.map} +1 -1
  99. package/dist/{chunk-SQMDFM4N.js → chunk-KE5HDORU.js} +2 -2
  100. package/dist/{chunk-SQMDFM4N.js.map → chunk-KE5HDORU.js.map} +1 -1
  101. package/dist/{chunk-PTJTOPE5.js → chunk-KOI7QFDH.js} +3 -3
  102. package/dist/{chunk-PTJTOPE5.js.map → chunk-KOI7QFDH.js.map} +1 -1
  103. package/dist/{chunk-NDBHEOIA.js → chunk-KRL53RZB.js} +8 -8
  104. package/dist/{chunk-NDBHEOIA.js.map → chunk-KRL53RZB.js.map} +1 -1
  105. package/dist/{chunk-7QYBKUAS.js → chunk-LKBRBVVS.js} +3 -3
  106. package/dist/{chunk-7QYBKUAS.js.map → chunk-LKBRBVVS.js.map} +1 -1
  107. package/dist/{chunk-USSP43U3.js → chunk-LQWOU7S2.js} +3 -3
  108. package/dist/{chunk-USSP43U3.js.map → chunk-LQWOU7S2.js.map} +1 -1
  109. package/dist/{chunk-4KPQ6ILH.js → chunk-MEU2HHGV.js} +18 -9
  110. package/dist/chunk-MEU2HHGV.js.map +1 -0
  111. package/dist/{chunk-QC5BYUED.js → chunk-MS2IXLTC.js} +4 -4
  112. package/dist/{chunk-QC5BYUED.js.map → chunk-MS2IXLTC.js.map} +1 -1
  113. package/dist/{chunk-X2B5GMJO.js → chunk-NCJSYU6A.js} +16 -14
  114. package/dist/chunk-NCJSYU6A.js.map +1 -0
  115. package/dist/{chunk-CFTTXUM2.js → chunk-NFFBYG2W.js} +3 -3
  116. package/dist/{chunk-CFTTXUM2.js.map → chunk-NFFBYG2W.js.map} +1 -1
  117. package/dist/{chunk-AVRTZAH2.js → chunk-NTFP2XF4.js} +10 -10
  118. package/dist/chunk-NTFP2XF4.js.map +1 -0
  119. package/dist/{chunk-V2CONXKD.js → chunk-PSPFWTJI.js} +4 -4
  120. package/dist/{chunk-V2CONXKD.js.map → chunk-PSPFWTJI.js.map} +1 -1
  121. package/dist/{chunk-C7L5MFUL.js → chunk-PTXQMTCG.js} +3 -3
  122. package/dist/{chunk-C7L5MFUL.js.map → chunk-PTXQMTCG.js.map} +1 -1
  123. package/dist/{chunk-Y242OE4B.js → chunk-QBJQ426X.js} +3 -3
  124. package/dist/{chunk-Y242OE4B.js.map → chunk-QBJQ426X.js.map} +1 -1
  125. package/dist/{chunk-QBUJTVMY.js → chunk-R3ZNAPBV.js} +3 -3
  126. package/dist/{chunk-QBUJTVMY.js.map → chunk-R3ZNAPBV.js.map} +1 -1
  127. package/dist/{chunk-4WB4KSSQ.js → chunk-RTFH2QR2.js} +3 -3
  128. package/dist/{chunk-4WB4KSSQ.js.map → chunk-RTFH2QR2.js.map} +1 -1
  129. package/dist/{chunk-5KWQMCH7.js → chunk-RZ5R6GDJ.js} +5 -5
  130. package/dist/{chunk-5KWQMCH7.js.map → chunk-RZ5R6GDJ.js.map} +1 -1
  131. package/dist/{chunk-MDCI4RSG.js → chunk-RZL4TOK3.js} +20 -6
  132. package/dist/chunk-RZL4TOK3.js.map +1 -0
  133. package/dist/{chunk-LMADWO4Q.js → chunk-SBAUZ7XH.js} +4 -4
  134. package/dist/{chunk-LMADWO4Q.js.map → chunk-SBAUZ7XH.js.map} +1 -1
  135. package/dist/{chunk-MPRWVZXF.js → chunk-SKG6G4HO.js} +108 -44
  136. package/dist/chunk-SKG6G4HO.js.map +1 -0
  137. package/dist/{chunk-HQAPUPBE.js → chunk-V2VDTQ7A.js} +3 -3
  138. package/dist/{chunk-HQAPUPBE.js.map → chunk-V2VDTQ7A.js.map} +1 -1
  139. package/dist/{chunk-GNUA7XT2.js → chunk-VS6XC5JE.js} +3 -3
  140. package/dist/{chunk-GNUA7XT2.js.map → chunk-VS6XC5JE.js.map} +1 -1
  141. package/dist/{chunk-5J6JWGY4.js → chunk-WDG5IVEA.js} +3 -3
  142. package/dist/{chunk-5J6JWGY4.js.map → chunk-WDG5IVEA.js.map} +1 -1
  143. package/dist/{chunk-M4G2SVXI.js → chunk-XWCV2A2F.js} +4 -4
  144. package/dist/{chunk-M4G2SVXI.js.map → chunk-XWCV2A2F.js.map} +1 -1
  145. package/dist/{chunk-UWD7YBDR.js → chunk-ZLDAPZIX.js} +4 -4
  146. package/dist/{chunk-UWD7YBDR.js.map → chunk-ZLDAPZIX.js.map} +1 -1
  147. package/dist/{claude-code-YRJIGXTL.js → claude-code-CMFGCDMX.js} +5 -5
  148. package/dist/{claude-code-YRJIGXTL.js.map → claude-code-CMFGCDMX.js.map} +1 -1
  149. package/dist/cli/index.js +322 -196
  150. package/dist/cli/index.js.map +1 -1
  151. package/dist/cli/src/commands/asset-cmd.d.ts.map +1 -1
  152. package/dist/cli/src/commands/catalog.d.ts.map +1 -1
  153. package/dist/cli/src/commands/config.d.ts.map +1 -1
  154. package/dist/cli/src/commands/connector.d.ts.map +1 -1
  155. package/dist/cli/src/commands/harness-preflight.d.ts +3 -1
  156. package/dist/cli/src/commands/harness-preflight.d.ts.map +1 -1
  157. package/dist/cli/src/commands/harness.d.ts.map +1 -1
  158. package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
  159. package/dist/cli/src/commands/library-index.d.ts +3 -3
  160. package/dist/cli/src/commands/library-index.d.ts.map +1 -1
  161. package/dist/cli/src/commands/migrate-files.d.ts +8 -0
  162. package/dist/cli/src/commands/migrate-files.d.ts.map +1 -1
  163. package/dist/cli/src/commands/migrate-harness.d.ts.map +1 -1
  164. package/dist/cli/src/commands/migrate-providers.d.ts.map +1 -1
  165. package/dist/cli/src/commands/migrate.d.ts.map +1 -1
  166. package/dist/cli/src/commands/outdated.d.ts.map +1 -1
  167. package/dist/cli/src/commands/project.d.ts.map +1 -1
  168. package/dist/cli/src/commands/run.d.ts.map +1 -1
  169. package/dist/cli/src/commands/serve-preflight.d.ts +7 -5
  170. package/dist/cli/src/commands/serve-preflight.d.ts.map +1 -1
  171. package/dist/cli/src/commands/serve.d.ts.map +1 -1
  172. package/dist/cli/src/commands/source.d.ts.map +1 -1
  173. package/dist/cli/src/commands/validate.d.ts.map +1 -1
  174. package/dist/cli/src/config-checks.d.ts +50 -12
  175. package/dist/cli/src/config-checks.d.ts.map +1 -1
  176. package/dist/cli/src/ensure-sources.d.ts.map +1 -1
  177. package/dist/cli/src/harness-error.d.ts +7 -0
  178. package/dist/cli/src/harness-error.d.ts.map +1 -1
  179. package/dist/cli/src/helpers.d.ts.map +1 -1
  180. package/dist/connectors/config.js +5 -5
  181. package/dist/connectors/index.js +20 -19
  182. package/dist/connectors/src/index.d.ts +1 -1
  183. package/dist/connectors/src/index.d.ts.map +1 -1
  184. package/dist/connectors/src/managed-gitconfig.d.ts +12 -0
  185. package/dist/connectors/src/managed-gitconfig.d.ts.map +1 -1
  186. package/dist/{connectors-JKT32HZT.js → connectors-P5M2D4MH.js} +23 -22
  187. package/dist/{connectors-JKT32HZT.js.map → connectors-P5M2D4MH.js.map} +1 -1
  188. package/dist/core/index.js +7 -7
  189. package/dist/core/logging.js +1 -1
  190. package/dist/core/manifest.js +2 -2
  191. package/dist/core/models.js +1 -1
  192. package/dist/core/publish-manifest.js +3 -3
  193. package/dist/core/ref.js +1 -1
  194. package/dist/core/runtime-assets.js +5 -5
  195. package/dist/core/src/index.d.ts +2 -2
  196. package/dist/core/src/index.d.ts.map +1 -1
  197. package/dist/core/src/lock.d.ts +7 -1
  198. package/dist/core/src/lock.d.ts.map +1 -1
  199. package/dist/core/src/models.d.ts.map +1 -1
  200. package/dist/core/src/repo-manager.d.ts +28 -0
  201. package/dist/core/src/repo-manager.d.ts.map +1 -1
  202. package/dist/core/src/run-state-ignore.d.ts +5 -3
  203. package/dist/core/src/run-state-ignore.d.ts.map +1 -1
  204. package/dist/core/src/workspace-config.d.ts.map +1 -1
  205. package/dist/core/workspace-config.js +4 -4
  206. package/dist/deploy/index.js +7 -7
  207. package/dist/discovery/index.js +4 -4
  208. package/dist/{ensure-sources-GUJODKY5.js → ensure-sources-MOGLBEUF.js} +31 -29
  209. package/dist/ensure-sources-MOGLBEUF.js.map +1 -0
  210. package/dist/factory-assets/connectors/box.js +20 -19
  211. package/dist/factory-assets/connectors/deploy.js +20 -19
  212. package/dist/factory-assets/connectors/devserver.js +20 -19
  213. package/dist/factory-assets/connectors/flow/adapter.js +20 -19
  214. package/dist/factory-assets/connectors/flow/engine.js +8 -8
  215. package/dist/factory-assets/connectors/flow/run-flow.js +22 -21
  216. package/dist/factory-assets/connectors/flow.js +20 -19
  217. package/dist/factory-assets/connectors/git/exec.d.ts +7 -0
  218. package/dist/factory-assets/connectors/git/exec.d.ts.map +1 -1
  219. package/dist/factory-assets/connectors/git/repo.d.ts.map +1 -1
  220. package/dist/factory-assets/connectors/git.js +20 -19
  221. package/dist/factory-assets/connectors/gmail/adapter.d.ts.map +1 -1
  222. package/dist/factory-assets/connectors/gmail.js +20 -19
  223. package/dist/factory-assets/connectors/googledrive.js +20 -19
  224. package/dist/factory-assets/connectors/local.js +20 -19
  225. package/dist/factory-assets/connectors/mattermost.js +20 -19
  226. package/dist/factory-assets/connectors/memory.js +20 -19
  227. package/dist/factory-assets/connectors/minio/adapter.d.ts.map +1 -1
  228. package/dist/factory-assets/connectors/minio.js +20 -19
  229. package/dist/factory-assets/connectors/postgres/adapter.d.ts.map +1 -1
  230. package/dist/factory-assets/connectors/postgres.js +20 -19
  231. package/dist/factory-assets/connectors/s3/driver.d.ts.map +1 -1
  232. package/dist/factory-assets/connectors/s3.js +20 -19
  233. package/dist/factory-assets/connectors/sharepoint.js +20 -19
  234. package/dist/factory-assets/connectors/sqlite/adapter.d.ts.map +1 -1
  235. package/dist/factory-assets/connectors/sqlite.js +20 -19
  236. package/dist/factory-assets/connectors/static-server.js +20 -19
  237. package/dist/factory-assets/connectors/tunnel.js +20 -19
  238. package/dist/factory-assets/connectors/webdav.js +20 -19
  239. package/dist/factory-assets/connectors/xstate-store.js +20 -19
  240. package/dist/factory-assets/connectors/xstate.js +20 -19
  241. package/dist/{flows-UCP6ZUYS.js → flows-J64L5MGJ.js} +12 -12
  242. package/dist/{flows-UCP6ZUYS.js.map → flows-J64L5MGJ.js.map} +1 -1
  243. package/dist/{helpers-SO53MRHF.js → helpers-JL5AEGDT.js} +28 -26
  244. package/dist/{helpers-SO53MRHF.js.map → helpers-JL5AEGDT.js.map} +1 -1
  245. package/dist/library/index.js +10 -10
  246. package/dist/library/install.js +4 -4
  247. package/dist/library/src/index.d.ts +2 -2
  248. package/dist/library/src/index.d.ts.map +1 -1
  249. package/dist/library/src/library.d.ts +6 -2
  250. package/dist/library/src/library.d.ts.map +1 -1
  251. package/dist/library/src/local/db.d.ts.map +1 -1
  252. package/dist/library/src/local/library.d.ts +10 -3
  253. package/dist/library/src/local/library.d.ts.map +1 -1
  254. package/dist/library/src/local/local-catalog-source.d.ts +0 -9
  255. package/dist/library/src/local/local-catalog-source.d.ts.map +1 -1
  256. package/dist/library/src/local/schema.d.ts +27 -20
  257. package/dist/library/src/local/schema.d.ts.map +1 -1
  258. package/dist/library/src/manifest-writer.d.ts +13 -0
  259. package/dist/library/src/manifest-writer.d.ts.map +1 -1
  260. package/dist/library/src/remote/index.d.ts +1 -1
  261. package/dist/library/src/remote/index.d.ts.map +1 -1
  262. package/dist/library/src/remote/remote-catalog-source.d.ts +6 -0
  263. package/dist/library/src/remote/remote-catalog-source.d.ts.map +1 -1
  264. package/dist/library/src/sync/git-driver.d.ts.map +1 -1
  265. package/dist/{library-publish-Z5E3YZCZ.js → library-publish-DZNNZNMB.js} +49 -50
  266. package/dist/library-publish-DZNNZNMB.js.map +1 -0
  267. package/dist/model-endpoint/index.js +10 -10
  268. package/dist/open-library-OJREQ22B.js +61 -0
  269. package/dist/{open-library-A5OB72FD.js.map → open-library-OJREQ22B.js.map} +1 -1
  270. package/dist/{open-registry-BHBHQMBA.js → open-registry-OEU6QUK2.js} +14 -14
  271. package/dist/{open-registry-BHBHQMBA.js.map → open-registry-OEU6QUK2.js.map} +1 -1
  272. package/dist/paths-PXBWY532.js +22 -0
  273. package/dist/{paths-77PXOXZY.js.map → paths-PXBWY532.js.map} +1 -1
  274. package/dist/{plugin-store-XQP2CRYH.js → plugin-store-ZC3EGZ3D.js} +10 -10
  275. package/dist/{plugin-store-XQP2CRYH.js.map → plugin-store-ZC3EGZ3D.js.map} +1 -1
  276. package/dist/{project-KTEUN7KR.js → project-52UABBD5.js} +45 -46
  277. package/dist/{project-KTEUN7KR.js.map → project-52UABBD5.js.map} +1 -1
  278. package/dist/resolver/index.js +8 -8
  279. package/dist/runner/index.js +35 -35
  280. package/dist/runner/src/agent-loop.d.ts.map +1 -1
  281. package/dist/runner/src/serve.d.ts.map +1 -1
  282. package/dist/runner/src/turn-end-contract.d.ts.map +1 -1
  283. package/dist/runner/src/turn-scheduler.d.ts +8 -0
  284. package/dist/runner/src/turn-scheduler.d.ts.map +1 -1
  285. package/dist/sdk/asset-manager.js +14 -14
  286. package/dist/sdk/bridge.js +17 -16
  287. package/dist/sdk/core.js +7 -7
  288. package/dist/sdk/flow.js +8 -8
  289. package/dist/sdk/index.js +35 -35
  290. package/dist/sdk/resolver.js +8 -8
  291. package/dist/sdk/runner.js +35 -35
  292. package/dist/sdk/transport/ws/server.js +8 -8
  293. package/dist/sdk/transport/ws.js +8 -8
  294. package/dist/sdk/transport.js +8 -8
  295. package/dist/{serve-preflight-ODQGVUFL.js → serve-preflight-HOQ7CGYR.js} +30 -30
  296. package/dist/{serve-preflight-ODQGVUFL.js.map → serve-preflight-HOQ7CGYR.js.map} +1 -1
  297. package/dist/{setup-QJDI5YAW.js → setup-JIDZ372C.js} +29 -27
  298. package/dist/setup-JIDZ372C.js.map +1 -0
  299. package/dist/{skills-DE2BDQ6G.js → skills-5D4KDVPJ.js} +13 -13
  300. package/dist/{skills-DE2BDQ6G.js.map → skills-5D4KDVPJ.js.map} +1 -1
  301. package/dist/{source-FKOUYMEM.js → source-P6ZFSSZZ.js} +47 -46
  302. package/dist/{source-FKOUYMEM.js.map → source-P6ZFSSZZ.js.map} +1 -1
  303. package/dist/{source-manifest-publish-JA4TY4Z6.js → source-manifest-publish-Y36FHVDS.js} +49 -48
  304. package/dist/source-manifest-publish-Y36FHVDS.js.map +1 -0
  305. package/dist/transport/index.js +8 -8
  306. package/dist/transport/src/ws/server.d.ts.map +1 -1
  307. package/dist/transport/ws/server.js +8 -8
  308. package/dist/transport/ws.js +8 -8
  309. package/dist/tui/index.js +35 -35
  310. package/dist/workspace-plugin/adapters/mcp.js +27 -26
  311. package/dist/workspace-plugin/adapters/omp.js +14 -14
  312. package/dist/workspace-plugin/index.js +2 -2
  313. package/package.json +1 -1
  314. package/dist/chunk-23Q5LT4U.js.map +0 -1
  315. package/dist/chunk-4KPQ6ILH.js.map +0 -1
  316. package/dist/chunk-5NTB64PW.js.map +0 -1
  317. package/dist/chunk-AVRTZAH2.js.map +0 -1
  318. package/dist/chunk-B2DGCYVC.js.map +0 -1
  319. package/dist/chunk-FZO64PLQ.js.map +0 -1
  320. package/dist/chunk-GYBDWW6K.js +0 -160
  321. package/dist/chunk-GYBDWW6K.js.map +0 -1
  322. package/dist/chunk-GYPPVANR.js +0 -357
  323. package/dist/chunk-GYPPVANR.js.map +0 -1
  324. package/dist/chunk-GZL6RN4Z.js.map +0 -1
  325. package/dist/chunk-JY2JXCL6.js +0 -334
  326. package/dist/chunk-JY2JXCL6.js.map +0 -1
  327. package/dist/chunk-KNY356I3.js.map +0 -1
  328. package/dist/chunk-LOO5CB5M.js +0 -12
  329. package/dist/chunk-LOO5CB5M.js.map +0 -1
  330. package/dist/chunk-MDCI4RSG.js.map +0 -1
  331. package/dist/chunk-MPRWVZXF.js.map +0 -1
  332. package/dist/chunk-O3FYOS64.js.map +0 -1
  333. package/dist/chunk-U3FI4DVT.js.map +0 -1
  334. package/dist/chunk-V3EJYOP2.js +0 -299
  335. package/dist/chunk-V3EJYOP2.js.map +0 -1
  336. package/dist/chunk-V5KG6CCV.js.map +0 -1
  337. package/dist/chunk-WPLZGT5Z.js.map +0 -1
  338. package/dist/chunk-X2B5GMJO.js.map +0 -1
  339. package/dist/chunk-Y2BQWZXT.js.map +0 -1
  340. package/dist/ensure-sources-GUJODKY5.js.map +0 -1
  341. package/dist/library-publish-Z5E3YZCZ.js.map +0 -1
  342. package/dist/open-library-A5OB72FD.js +0 -59
  343. package/dist/paths-77PXOXZY.js +0 -22
  344. package/dist/setup-QJDI5YAW.js.map +0 -1
  345. package/dist/source-manifest-publish-JA4TY4Z6.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { ensureRunStateIgnored } from './chunk-MDCI4RSG.js';
1
+ import { ensureRunStateIgnored } from './chunk-RZL4TOK3.js';
2
2
  import { existsSync, readFileSync, mkdirSync, writeFileSync } from 'fs';
3
3
  import { join } from 'path';
4
4
  import { parse, stringify } from 'yaml';
@@ -43,5 +43,5 @@ function clearHistory(projectDir) {
43
43
  }
44
44
 
45
45
  export { appendHistory, clearHistory, getRecentHistory, loadHistory };
46
- //# sourceMappingURL=chunk-7QYBKUAS.js.map
47
- //# sourceMappingURL=chunk-7QYBKUAS.js.map
46
+ //# sourceMappingURL=chunk-LKBRBVVS.js.map
47
+ //# sourceMappingURL=chunk-LKBRBVVS.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../asset-manager/src/history.ts"],"names":[],"mappings":";;;;;AA0BA,SAAS,YAAY,UAAA,EAA4B;AAC/C,EAAA,OAAO,IAAA,CAAK,UAAA,EAAY,SAAA,EAAW,cAAc,CAAA;AACnD;AASO,SAAS,YAAY,UAAA,EAAoC;AAC9D,EAAA,MAAM,IAAA,GAAO,YAAY,UAAU,CAAA;AACnC,EAAA,IAAI,CAAC,UAAA,CAAW,IAAI,CAAA,SAAU,EAAC;AAC/B,EAAA,IAAI;AACF,IAAA,MAAM,IAAA,GAAO,KAAA,CAAM,YAAA,CAAa,IAAA,EAAM,MAAM,CAAC,CAAA;AAC7C,IAAA,OAAA,CAAQ,MAAM,OAAA,IAAW,EAAC,EAAG,GAAA,CAAI,CAAC,CAAA,KAAM;AACtC,MAAA,MAAM,CAAA,GAAI,CAAA;AACV,MAAA,OAAO;AAAA,QACL,GAAA,EAAK,MAAA,CAAO,CAAA,CAAE,GAAA,IAAO,EAAE,CAAA;AAAA,QACvB,MAAA,EAAQ,MAAA,CAAO,CAAA,CAAE,MAAA,IAAU,KAAK,CAAA;AAAA,QAChC,SAAA,EAAW,OAAO,CAAA,CAAE,SAAA,IAAA,qBAAiB,IAAA,EAAK,EAAE,aAAa,CAAA;AAAA,QACzD,OAAA,EAAS,MAAA,CAAO,CAAA,CAAE,OAAA,IAAW,SAAS;AAAA,OACxC;AAAA,IACF,CAAC,CAAA;AAAA,EACH,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,EAAC;AAAA,EACV;AACF;AASO,SAAS,aAAA,CAAc,YAAoB,KAAA,EAA2B;AAC3E,EAAA,MAAM,OAAA,GAAU,YAAY,UAAU,CAAA;AACtC,EAAA,OAAA,CAAQ,KAAK,KAAK,CAAA;AAClB,EAAA,MAAM,OAAA,GAAU,OAAA,CAAQ,KAAA,CAAM,IAAI,CAAA;AAClC,EAAA,MAAM,IAAA,GAAO,YAAY,UAAU,CAAA;AACnC,EAAA,SAAA,CAAU,KAAK,UAAA,EAAY,SAAS,GAAG,EAAE,SAAA,EAAW,MAAM,CAAA;AAC1D,EAAA,aAAA,CAAc,MAAM,SAAA,CAAU,EAAE,OAAA,EAAS,OAAA,EAAS,CAAC,CAAA;AACnD,EAAA,IAAI,KAAA,CAAM,OAAA,KAAY,SAAA,EAAW,qBAAA,CAAsB,UAAU,CAAA;AACnE;AAUO,SAAS,gBAAA,CAAiB,UAAA,EAAoB,KAAA,GAAQ,EAAA,EAAoB;AAC/E,EAAA,OAAO,YAAY,UAAU,CAAA,CAAE,MAAM,CAAC,KAAK,EAAE,OAAA,EAAQ;AACvD;AAQO,SAAS,aAAa,UAAA,EAA0B;AACrD,EAAA,MAAM,IAAA,GAAO,YAAY,UAAU,CAAA;AACnC,EAAA,SAAA,CAAU,KAAK,UAAA,EAAY,SAAS,GAAG,EAAE,SAAA,EAAW,MAAM,CAAA;AAC1D,EAAA,aAAA,CAAc,MAAM,SAAA,CAAU,EAAE,SAAS,EAAC,EAAG,CAAC,CAAA;AAChD","file":"chunk-7QYBKUAS.js","sourcesContent":["/**\n * Project-local action history — tracks add/remove/update actions.\n * Stored at .skaile/history.yaml within the project directory.\n */\n\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { ensureRunStateIgnored } from \"@skaile/workspaces/core\";\nimport { parse, stringify } from \"yaml\";\n\n/**\n * A single record in the project's asset action history.\n *\n * @docLink packages/asset-manager/api-reference#history\n */\nexport interface HistoryEntry {\n /** Asset ref in `kind:name` form (e.g. `skill:my-skill`). */\n ref: string;\n /** Action performed on the asset. */\n action: \"add\" | \"remove\" | \"update\";\n /** ISO 8601 timestamp of when the action was recorded. */\n timestamp: string;\n /** Whether this action was performed in project scope or global-install scope. */\n context: \"project\" | \"global\";\n}\n\nfunction historyFile(projectDir: string): string {\n return join(projectDir, \".skaile\", \"history.yaml\");\n}\n\n/**\n * Load all history entries from `.skaile/history.yaml` in the project directory.\n *\n * @param projectDir - Absolute path to the workspace root.\n * @returns Array of history entries, oldest first. Returns `[]` when the file does not exist.\n * @docLink packages/asset-manager/api-reference#history\n */\nexport function loadHistory(projectDir: string): HistoryEntry[] {\n const file = historyFile(projectDir);\n if (!existsSync(file)) return [];\n try {\n const data = parse(readFileSync(file, \"utf8\")) as { entries?: unknown[] } | null;\n return (data?.entries ?? []).map((e) => {\n const d = e as Record<string, unknown>;\n return {\n ref: String(d.ref ?? \"\"),\n action: String(d.action ?? \"add\") as HistoryEntry[\"action\"],\n timestamp: String(d.timestamp ?? new Date().toISOString()),\n context: String(d.context ?? \"project\") as HistoryEntry[\"context\"],\n };\n });\n } catch {\n return [];\n }\n}\n\n/**\n * Append a single action to the history log, capping the total at 500 entries.\n *\n * @param projectDir - Absolute path to the workspace root.\n * @param entry - The history entry to record.\n * @docLink packages/asset-manager/api-reference#history\n */\nexport function appendHistory(projectDir: string, entry: HistoryEntry): void {\n const entries = loadHistory(projectDir);\n entries.push(entry);\n const trimmed = entries.slice(-500);\n const file = historyFile(projectDir);\n mkdirSync(join(projectDir, \".skaile\"), { recursive: true });\n writeFileSync(file, stringify({ entries: trimmed }));\n if (entry.context === \"project\") ensureRunStateIgnored(projectDir);\n}\n\n/**\n * Return the most recent history entries, newest first.\n *\n * @param projectDir - Absolute path to the workspace root.\n * @param limit - Maximum number of entries to return. Defaults to `20`.\n * @returns Most recent entries in reverse-chronological order.\n * @docLink packages/asset-manager/api-reference#history\n */\nexport function getRecentHistory(projectDir: string, limit = 20): HistoryEntry[] {\n return loadHistory(projectDir).slice(-limit).reverse();\n}\n\n/**\n * Erase all history entries by writing an empty list to `.skaile/history.yaml`.\n *\n * @param projectDir - Absolute path to the workspace root.\n * @docLink packages/asset-manager/api-reference#history\n */\nexport function clearHistory(projectDir: string): void {\n const file = historyFile(projectDir);\n mkdirSync(join(projectDir, \".skaile\"), { recursive: true });\n writeFileSync(file, stringify({ entries: [] }));\n}\n"]}
1
+ {"version":3,"sources":["../asset-manager/src/history.ts"],"names":[],"mappings":";;;;;AA0BA,SAAS,YAAY,UAAA,EAA4B;AAC/C,EAAA,OAAO,IAAA,CAAK,UAAA,EAAY,SAAA,EAAW,cAAc,CAAA;AACnD;AASO,SAAS,YAAY,UAAA,EAAoC;AAC9D,EAAA,MAAM,IAAA,GAAO,YAAY,UAAU,CAAA;AACnC,EAAA,IAAI,CAAC,UAAA,CAAW,IAAI,CAAA,SAAU,EAAC;AAC/B,EAAA,IAAI;AACF,IAAA,MAAM,IAAA,GAAO,KAAA,CAAM,YAAA,CAAa,IAAA,EAAM,MAAM,CAAC,CAAA;AAC7C,IAAA,OAAA,CAAQ,MAAM,OAAA,IAAW,EAAC,EAAG,GAAA,CAAI,CAAC,CAAA,KAAM;AACtC,MAAA,MAAM,CAAA,GAAI,CAAA;AACV,MAAA,OAAO;AAAA,QACL,GAAA,EAAK,MAAA,CAAO,CAAA,CAAE,GAAA,IAAO,EAAE,CAAA;AAAA,QACvB,MAAA,EAAQ,MAAA,CAAO,CAAA,CAAE,MAAA,IAAU,KAAK,CAAA;AAAA,QAChC,SAAA,EAAW,OAAO,CAAA,CAAE,SAAA,IAAA,qBAAiB,IAAA,EAAK,EAAE,aAAa,CAAA;AAAA,QACzD,OAAA,EAAS,MAAA,CAAO,CAAA,CAAE,OAAA,IAAW,SAAS;AAAA,OACxC;AAAA,IACF,CAAC,CAAA;AAAA,EACH,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,EAAC;AAAA,EACV;AACF;AASO,SAAS,aAAA,CAAc,YAAoB,KAAA,EAA2B;AAC3E,EAAA,MAAM,OAAA,GAAU,YAAY,UAAU,CAAA;AACtC,EAAA,OAAA,CAAQ,KAAK,KAAK,CAAA;AAClB,EAAA,MAAM,OAAA,GAAU,OAAA,CAAQ,KAAA,CAAM,IAAI,CAAA;AAClC,EAAA,MAAM,IAAA,GAAO,YAAY,UAAU,CAAA;AACnC,EAAA,SAAA,CAAU,KAAK,UAAA,EAAY,SAAS,GAAG,EAAE,SAAA,EAAW,MAAM,CAAA;AAC1D,EAAA,aAAA,CAAc,MAAM,SAAA,CAAU,EAAE,OAAA,EAAS,OAAA,EAAS,CAAC,CAAA;AACnD,EAAA,IAAI,KAAA,CAAM,OAAA,KAAY,SAAA,EAAW,qBAAA,CAAsB,UAAU,CAAA;AACnE;AAUO,SAAS,gBAAA,CAAiB,UAAA,EAAoB,KAAA,GAAQ,EAAA,EAAoB;AAC/E,EAAA,OAAO,YAAY,UAAU,CAAA,CAAE,MAAM,CAAC,KAAK,EAAE,OAAA,EAAQ;AACvD;AAQO,SAAS,aAAa,UAAA,EAA0B;AACrD,EAAA,MAAM,IAAA,GAAO,YAAY,UAAU,CAAA;AACnC,EAAA,SAAA,CAAU,KAAK,UAAA,EAAY,SAAS,GAAG,EAAE,SAAA,EAAW,MAAM,CAAA;AAC1D,EAAA,aAAA,CAAc,MAAM,SAAA,CAAU,EAAE,SAAS,EAAC,EAAG,CAAC,CAAA;AAChD","file":"chunk-LKBRBVVS.js","sourcesContent":["/**\n * Project-local action history — tracks add/remove/update actions.\n * Stored at .skaile/history.yaml within the project directory.\n */\n\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { ensureRunStateIgnored } from \"@skaile/workspaces/core\";\nimport { parse, stringify } from \"yaml\";\n\n/**\n * A single record in the project's asset action history.\n *\n * @docLink packages/asset-manager/api-reference#history\n */\nexport interface HistoryEntry {\n /** Asset ref in `kind:name` form (e.g. `skill:my-skill`). */\n ref: string;\n /** Action performed on the asset. */\n action: \"add\" | \"remove\" | \"update\";\n /** ISO 8601 timestamp of when the action was recorded. */\n timestamp: string;\n /** Whether this action was performed in project scope or global-install scope. */\n context: \"project\" | \"global\";\n}\n\nfunction historyFile(projectDir: string): string {\n return join(projectDir, \".skaile\", \"history.yaml\");\n}\n\n/**\n * Load all history entries from `.skaile/history.yaml` in the project directory.\n *\n * @param projectDir - Absolute path to the workspace root.\n * @returns Array of history entries, oldest first. Returns `[]` when the file does not exist.\n * @docLink packages/asset-manager/api-reference#history\n */\nexport function loadHistory(projectDir: string): HistoryEntry[] {\n const file = historyFile(projectDir);\n if (!existsSync(file)) return [];\n try {\n const data = parse(readFileSync(file, \"utf8\")) as { entries?: unknown[] } | null;\n return (data?.entries ?? []).map((e) => {\n const d = e as Record<string, unknown>;\n return {\n ref: String(d.ref ?? \"\"),\n action: String(d.action ?? \"add\") as HistoryEntry[\"action\"],\n timestamp: String(d.timestamp ?? new Date().toISOString()),\n context: String(d.context ?? \"project\") as HistoryEntry[\"context\"],\n };\n });\n } catch {\n return [];\n }\n}\n\n/**\n * Append a single action to the history log, capping the total at 500 entries.\n *\n * @param projectDir - Absolute path to the workspace root.\n * @param entry - The history entry to record.\n * @docLink packages/asset-manager/api-reference#history\n */\nexport function appendHistory(projectDir: string, entry: HistoryEntry): void {\n const entries = loadHistory(projectDir);\n entries.push(entry);\n const trimmed = entries.slice(-500);\n const file = historyFile(projectDir);\n mkdirSync(join(projectDir, \".skaile\"), { recursive: true });\n writeFileSync(file, stringify({ entries: trimmed }));\n if (entry.context === \"project\") ensureRunStateIgnored(projectDir);\n}\n\n/**\n * Return the most recent history entries, newest first.\n *\n * @param projectDir - Absolute path to the workspace root.\n * @param limit - Maximum number of entries to return. Defaults to `20`.\n * @returns Most recent entries in reverse-chronological order.\n * @docLink packages/asset-manager/api-reference#history\n */\nexport function getRecentHistory(projectDir: string, limit = 20): HistoryEntry[] {\n return loadHistory(projectDir).slice(-limit).reverse();\n}\n\n/**\n * Erase all history entries by writing an empty list to `.skaile/history.yaml`.\n *\n * @param projectDir - Absolute path to the workspace root.\n * @docLink packages/asset-manager/api-reference#history\n */\nexport function clearHistory(projectDir: string): void {\n const file = historyFile(projectDir);\n mkdirSync(join(projectDir, \".skaile\"), { recursive: true });\n writeFileSync(file, stringify({ entries: [] }));\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { tryWithFsDeadline, withFsDeadline, fsDeadlineMs } from './chunk-GNUA7XT2.js';
1
+ import { tryWithFsDeadline, withFsDeadline, fsDeadlineMs } from './chunk-VS6XC5JE.js';
2
2
  import { createLogger } from './chunk-BOFL7GIF.js';
3
3
  import { stat, mkdir, cp, writeFile, rm } from 'fs/promises';
4
4
  import { resolve, sep, join } from 'path';
@@ -155,5 +155,5 @@ function resolveFlowSkills(flow, allEntries) {
155
155
  }
156
156
 
157
157
  export { WORKSPACE_MOUNT_ENV_VAR, deployAll, deployCatalogEntry, findAiAssetsRoot, isUnderWorkspaceMount, resolveFlowSkills, undeployCatalogEntry, workspaceMountDirs };
158
- //# sourceMappingURL=chunk-USSP43U3.js.map
159
- //# sourceMappingURL=chunk-USSP43U3.js.map
158
+ //# sourceMappingURL=chunk-LQWOU7S2.js.map
159
+ //# sourceMappingURL=chunk-LQWOU7S2.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../asset-manager/src/catalog-deployer.ts"],"names":[],"mappings":";;;;;AAyGA,IAAM,uBAAA,GAA0B,CAAA;AAGhC,IAAM,qBAAA,GAAwB,CAAA;AAE9B,IAAI,cAAA;AAEJ,SAAS,GAAA,GAAuC;AAC9C,EAAA,cAAA,KAAmB,aAAa,EAAE,IAAA,EAAM,QAAA,EAAU,OAAA,EAAS,oBAAoB,CAAA;AAC/E,EAAA,OAAO,cAAA;AACT;AAOA,IAAM,2BAAA,GAA8B,mBAAA;AAS7B,IAAM,uBAAA,GAA0B;AAYhC,SAAS,kBAAA,GAA+B;AAC7C,EAAA,MAAM,GAAA,GAAM,OAAA,CAAQ,GAAA,CAAI,uBAAuB,CAAA;AAC/C,EAAA,IAAI,GAAA,K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AO,KAAK,CAAA,EAAG,KAAA,CAAM,EAAE,CAAA,EAAA,EAAK,CAAA,CAAE,KAAK,CAAA,CAAE,CAAA;AAAA,IAC9C;AAAA,EACF;AAEA,EAAA,OAAO,MAAA;AACT;AAeO,SAAS,iBAAA,CACd,MACA,UAAA,EAC2F;AAC3F,EAAA,MAAM,YAAA,uBAAmB,GAAA,EAAkC;AAC3D,EAAA,KAAA,MAAW,KAAK,UAAA,EAAY;AAC1B,IAAA,IAAI,EAAE,IAAA,KAAS,OAAA,eAAsB,GAAA,CAAI,CAAA,CAAE,MAAM,CAAC,CAAA;AAAA,EACpD;AAEA,EAAA,MAAM,WAAmC,EAAC;AAC1C,EAAA,MAAM,WAAmC,EAAC;AAC1C,EAAA,MAAM,UAAoB,EAAC;AAE3B,EAAA,KAAA,MAAW,IAAA,IAAQ,IAAA,CAAK,eAAA,IAAmB,EAAC,EAAG;AAC7C,IAAA,MAAM,KAAA,GAAQ,YAAA,CAAa,GAAA,CAAI,IAAI,CAAA;AACnC,IAAA,IAAI,KAAA,EAAO,QAAA,CAAS,IAAA,CAAK,KAAK,CAAA;AAAA,SACzB,OAAA,CAAQ,KAAK,IAAI,CAAA;AAAA,EACxB;AAEA,EAAA,KAAA,MAAW,IAAA,IAAQ,IAAA,CAAK,eAAA,IAAmB,EAAC,EAAG;AAC7C,IAAA,MAAM,KAAA,GAAQ,YAAA,CAAa,GAAA,CAAI,IAAI,CAAA;AACnC,IAAA,IAAI,KAAA,EAAO,QAAA,CAAS,IAAA,CAAK,KAAK,CAAA;AAAA,EAEhC;AAEA,EAAA,OAAO,EAAE,QAAA,EAAU,QAAA,EAAU,OAAA,EAAQ;AACvC","file":"chunk-USSP43U3.js","sourcesContent":["/**\n * Platform-triggered asset deployment.\n *\n * Takes catalog entries (with source_path relative to ai-assets/) and deploys\n * them to a session's .claude/skills/ directory. Handles skill context injection\n * and catalog priority-based name resolution.\n */\n\nimport { cp, mkdir, rm, stat, writeFile } from \"node:fs/promises\";\nimport { join, resolve, sep } from \"node:path\";\nimport { fsDeadlineMs, tryWithFsDeadline, withFsDeadline } from \"@skaile/workspaces/core\";\nimport { createLogger } from \"@skaile/workspaces/core/logging\";\n\n// ---------------------------------------------------------------------------\n// Types (formerly in catalog-compiler.ts, inlined after tear-out in Task 1.5)\n// ---------------------------------------------------------------------------\n\n/**\n * A single user-facing input parameter declared in a SKILL.md.\n *\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport interface InputSpec {\n /** Input parameter key used in skill invocation. */\n key: string;\n /** Whether the input must be provided before running the skill. */\n required?: boolean;\n /** Question string shown to the user when collecting this input. */\n prompt?: string;\n /** Short display label for UI forms. */\n label?: string;\n /** Input data type hint (e.g. `\"string\"`, `\"number\"`, `\"file\"`). */\n type?: string;\n /** Additional guidance text shown alongside the input field. */\n hint?: string;\n}\n\n/**\n * A compiled catalog entry (skill or flow).\n *\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport interface CatalogEntryCompiled {\n /** Unique ID in `publisher/name` form (e.g. `skaileup/cf_overview`). */\n id: string;\n /** Asset kind. */\n kind: \"skill\" | \"flow\";\n /** Human-readable asset name. */\n name: string;\n /** One-line description. */\n description: string;\n /** Semantic version string. */\n version: string;\n /** Maturity stage. */\n stage: \"alpha\" | \"beta\" | \"stable\";\n /** Searchable keywords. */\n keywords: string[];\n /** User-facing input specifications. */\n inputs: InputSpec[];\n /** Asset path relative to assetsRoot. */\n source_path: string;\n /** Optional icon identifier. */\n icon?: string;\n /** Flow-only: required skill names. */\n required_skills?: string[];\n /** Flow-only: optional skill names. */\n optional_skills?: string[];\n}\n\n/**\n * Options controlling how platform-triggered skill deployment is performed.\n *\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport interface DeployFromCatalogOptions {\n /** Root directory of ai-assets (where `source_path` in catalog entries is relative to). */\n assetsRoot: string;\n /** Target directory for deployed skills (e.g. `/workspace/.claude/skills/`). */\n skillsDir: string;\n /** Optional context markdown appended to the deployed skill directory as `CONTEXT.md`. */\n context?: string;\n}\n\n/**\n * Result of a platform-triggered batch skill deployment.\n *\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport interface DeployResult {\n /** IDs of catalog entries successfully deployed. */\n deployed: string[];\n /** IDs of catalog entries skipped (non-skill kinds). */\n skipped: string[];\n /** Error messages for entries that could not be deployed. */\n errors: string[];\n}\n\n// ---------------------------------------------------------------------------\n// Workspace-mount awareness\n// ---------------------------------------------------------------------------\n\n/**\n * Multiplier applied to the base filesystem deadline for whole-tree operations\n * (recursive copy / remove), which legitimately outlast a single `stat`.\n */\nconst TREE_OP_DEADLINE_FACTOR = 4;\n\n/** Default number of parent levels {@link findAiAssetsRoot} inspects. */\nconst AI_ASSETS_WALK_LEVELS = 6;\n\nlet deployerLogger: ReturnType<typeof createLogger> | undefined;\n\nfunction log(): ReturnType<typeof createLogger> {\n deployerLogger ??= createLogger({ kind: \"runner\", subkind: \"catalog-deployer\" });\n return deployerLogger;\n}\n\n/**\n * Where the agent container binds its rclone FUSE mount. Nothing under this\n * path is a safe place to read an asset tree from: the mount is remote\n * (SharePoint / OneDrive / WebDAV) and can wedge indefinitely.\n */\nconst DEFAULT_WORKSPACE_MOUNT_DIR = \"/skaile/workspace\";\n\n/**\n * Env override for the workspace-mount path(s), comma-separated.\n *\n * Set it when the runner binds the mount somewhere other than\n * {@link DEFAULT_WORKSPACE_MOUNT_DIR}; set it to the empty string to disable\n * the guard entirely (single-machine dev, where nothing is a network mount).\n */\nexport const WORKSPACE_MOUNT_ENV_VAR = \"SKAILE_WORKSPACE_MOUNT_DIR\";\n\n/**\n * Resolve the directories treated as network mounts.\n *\n * Read per call rather than cached: the runner mutates `process.env` while\n * wiring a session, so a module-load snapshot would pin a pre-configuration\n * value.\n *\n * @returns Absolute mount paths; empty when the guard is disabled.\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport function workspaceMountDirs(): string[] {\n const raw = process.env[WORKSPACE_MOUNT_ENV_VAR];\n if (raw === undefined) return [DEFAULT_WORKSPACE_MOUNT_DIR];\n return raw\n .split(\",\")\n .map((segment) => segment.trim())\n .filter((segment) => segment.length > 0)\n .map((segment) => resolve(segment));\n}\n\n/**\n * Is `candidate` at, or inside, one of the known workspace mount paths?\n *\n * Pure path arithmetic — deliberately no filesystem access, because the whole\n * point is to decide *before* touching a path that might be unresponsive.\n *\n * @param candidate - Path to test.\n * @param mountDirs - Mount roots; defaults to {@link workspaceMountDirs}.\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport function isUnderWorkspaceMount(\n candidate: string,\n mountDirs: string[] = workspaceMountDirs(),\n): boolean {\n const target = resolve(candidate);\n return mountDirs.some((dir) => {\n const root = resolve(dir);\n return target === root || target.startsWith(root + sep);\n });\n}\n\n/**\n * Walk upward from `startDir` looking for an `ai-assets/` directory.\n *\n * Two properties matter beyond \"find the folder\":\n *\n * 1. **Never synchronous.** The walk probes up to six directories; any one of\n * them can be on a FUSE mount, and the former `existsSync` chain blocked the\n * event loop on the first unresponsive probe. Each probe is now awaited and\n * deadline-bounded, so a wedged mount costs one skipped candidate.\n * 2. **Never resolves onto a mount.** A hit under the workspace mount is\n * skipped with a warning rather than returned: accepting it would wire every\n * later skill deploy — a recursive copy — to a remote filesystem. The walk\n * continues upward, so a legitimate `ai-assets/` in a parent still wins.\n *\n * Only a **directory** counts. An `ai-assets` file would otherwise be returned\n * as a root and every later `join(root, source_path)` would fail with ENOTDIR.\n *\n * @param startDir - Directory to start from (typically the project dir).\n * @param opts - `levels` caps the upward walk; `mountDirs` overrides the mount\n * roots (defaults to {@link workspaceMountDirs}).\n * @returns Absolute path to the `ai-assets/` directory, or `null` if none is\n * reachable within `levels`.\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport async function findAiAssetsRoot(\n startDir: string,\n opts?: { levels?: number; mountDirs?: string[] },\n): Promise<string | null> {\n const mountDirs = opts?.mountDirs ?? workspaceMountDirs();\n const levels = opts?.levels ?? AI_ASSETS_WALK_LEVELS;\n let dir = resolve(startDir);\n // Every level of a `/skaile/workspace/...` start dir is under the mount, so\n // an unconditional warn would fire once per level for one lookup. Collect and\n // report once — the operator needs the fact, not six copies of it.\n const refused: string[] = [];\n\n for (let i = 0; i < levels; i++) {\n const candidate = join(dir, \"ai-assets\");\n if (isUnderWorkspaceMount(candidate, mountDirs)) {\n refused.push(candidate);\n } else {\n const isDir = await tryWithFsDeadline(\n `stat ${candidate}`,\n async () => (await stat(candidate)).isDirectory(),\n false,\n );\n if (isDir) {\n if (refused.length > 0) warnRefused(refused, mountDirs);\n return candidate;\n }\n }\n const parent = resolve(dir, \"..\");\n if (parent === dir) break; // filesystem root — nothing further up\n dir = parent;\n }\n if (refused.length > 0) warnRefused(refused, mountDirs);\n return null;\n}\n\n/** Single warning for every `ai-assets` candidate skipped for sitting on a mount. */\nfunction warnRefused(refused: string[], mountDirs: string[]): void {\n log().warn(\n \"findAiAssetsRoot refused candidates under a workspace mount — deploying skills from a network mount can stall the session\",\n { refused, mountDirs },\n );\n}\n\n/**\n * Deploy a single catalog entry to the session skills directory.\n *\n * Copies the entire skill source directory into `skillsDir/<entry.name>/`.\n * If `context` is provided, a separate `CONTEXT.md` is written alongside\n * `SKILL.md` so the source file is never modified.\n *\n * Only `skill` entries are deployable; other kinds return an error.\n *\n * **Async by necessity.** This runs from the `session_init` command handler\n * with the WebSocket live, and both `assetsRoot` and `skillsDir` can sit on a\n * network mount. The former `cpSync`/`rmSync` pair parked the event loop for\n * the whole copy; every call is now awaited and deadline-bounded, so an\n * unresponsive mount fails one deployment instead of the session.\n *\n * @param entry - Compiled catalog entry to deploy.\n * @param options - Deployment target and optional context.\n * @returns `{ success: true }` on success, `{ success: false, error }` on failure.\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport async function deployCatalogEntry(\n entry: CatalogEntryCompiled,\n options: DeployFromCatalogOptions,\n): Promise<{ success: boolean; error?: string }> {\n const { assetsRoot, skillsDir, context } = options;\n\n if (entry.kind !== \"skill\") {\n return { success: false, error: `Cannot deploy ${entry.kind} directly — only skills` };\n }\n\n const sourcePath = join(assetsRoot, entry.source_path);\n const skillMdPath = join(sourcePath, \"SKILL.md\");\n\n const hasSkillMd = await tryWithFsDeadline(\n `stat ${skillMdPath}`,\n async () => {\n await stat(skillMdPath);\n return true;\n },\n false,\n );\n if (!hasSkillMd) {\n return { success: false, error: `SKILL.md not found at ${skillMdPath}` };\n }\n\n const destDir = join(skillsDir, entry.name);\n\n try {\n await withFsDeadline(`mkdir ${destDir}`, () => mkdir(destDir, { recursive: true }));\n\n // Copy the entire skill directory\n await withFsDeadline(\n `cp ${sourcePath} -> ${destDir}`,\n () => cp(sourcePath, destDir, { recursive: true }),\n fsDeadlineMs() * TREE_OP_DEADLINE_FACTOR,\n );\n\n // Write context to a separate CONTEXT.md — never modify the original SKILL.md.\n // The agent discovers both files in the skill directory.\n const contextPath = join(destDir, \"CONTEXT.md\");\n if (context) {\n await withFsDeadline(`write ${contextPath}`, () =>\n writeFile(contextPath, `# Additional Context\\n\\n${context}\\n`, \"utf8\"),\n );\n } else {\n // `force: true` makes this a single call: a stale CONTEXT.md is removed,\n // an absent one is a no-op. The former existsSync probe only added a\n // second trip to the same possibly-wedged mount.\n await withFsDeadline(`rm ${contextPath}`, () => rm(contextPath, { force: true }));\n }\n } catch (err) {\n return { success: false, error: err instanceof Error ? err.message : String(err) };\n }\n\n return { success: true };\n}\n\n/**\n * Remove a deployed skill directory from the session skills directory.\n *\n * @param name - Skill name (directory basename under `skillsDir`).\n * @param skillsDir - Absolute path to the session skills directory.\n * @returns `true` if the skill was found and removed; `false` if it was not\n * deployed, or if the directory could not be reached within the deadline.\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport async function undeployCatalogEntry(name: string, skillsDir: string): Promise<boolean> {\n const destDir = join(skillsDir, name);\n const exists = await tryWithFsDeadline(\n `stat ${destDir}`,\n async () => {\n await stat(destDir);\n return true;\n },\n false,\n );\n if (!exists) return false;\n await withFsDeadline(\n `rm -r ${destDir}`,\n () => rm(destDir, { recursive: true, force: true }),\n fsDeadlineMs() * TREE_OP_DEADLINE_FACTOR,\n );\n return true;\n}\n\n/**\n * Deploy multiple catalog entries in a single batch operation.\n *\n * Non-skill entries (flows, agents, etc.) are automatically skipped and\n * recorded in `result.skipped`. Deployment failures are collected in\n * `result.errors` without aborting the rest of the batch.\n *\n * @param entries - Compiled catalog entries to deploy.\n * @param options - Deployment target and optional context.\n * @returns Aggregated {@link DeployResult} with deployed, skipped, and error lists.\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport async function deployAll(\n entries: CatalogEntryCompiled[],\n options: DeployFromCatalogOptions,\n): Promise<DeployResult> {\n const result: DeployResult = { deployed: [], skipped: [], errors: [] };\n\n for (const entry of entries) {\n if (entry.kind !== \"skill\") {\n result.skipped.push(entry.id);\n continue;\n }\n\n // Serial on purpose: concurrent recursive copies onto one mount multiply\n // the queue depth on the exact resource that is already the bottleneck.\n const r = await deployCatalogEntry(entry, options);\n if (r.success) {\n result.deployed.push(entry.id);\n } else {\n result.errors.push(`${entry.id}: ${r.error}`);\n }\n }\n\n return result;\n}\n\n/**\n * Resolve a flow's skill dependencies from the full catalog entry list.\n *\n * Partitions `flow.required_skills` and `flow.optional_skills` into resolved\n * entries and a list of names that could not be found. Missing optional skills\n * are silently ignored (they do not appear in `missing`).\n *\n * @param flow - Compiled flow entry whose skill dependencies should be resolved.\n * @param allEntries - Full set of compiled catalog entries to search.\n * @returns Object containing resolved `required` entries, resolved `optional` entries,\n * and `missing` skill names that were listed as required but not found.\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport function resolveFlowSkills(\n flow: CatalogEntryCompiled,\n allEntries: CatalogEntryCompiled[],\n): { required: CatalogEntryCompiled[]; optional: CatalogEntryCompiled[]; missing: string[] } {\n const skillsByName = new Map<string, CatalogEntryCompiled>();\n for (const e of allEntries) {\n if (e.kind === \"skill\") skillsByName.set(e.name, e);\n }\n\n const required: CatalogEntryCompiled[] = [];\n const optional: CatalogEntryCompiled[] = [];\n const missing: string[] = [];\n\n for (const name of flow.required_skills ?? []) {\n const entry = skillsByName.get(name);\n if (entry) required.push(entry);\n else missing.push(name);\n }\n\n for (const name of flow.optional_skills ?? []) {\n const entry = skillsByName.get(name);\n if (entry) optional.push(entry);\n // Optional skills don't count as missing\n }\n\n return { required, optional, missing };\n}\n"]}
1
+ {"version":3,"sources":["../asset-manager/src/catalog-deployer.ts"],"names":[],"mappings":";;;;;AAyGA,IAAM,uBAAA,GAA0B,CAAA;AAGhC,IAAM,qBAAA,GAAwB,CAAA;AAE9B,IAAI,cAAA;AAEJ,SAAS,GAAA,GAAuC;AAC9C,EAAA,cAAA,KAAmB,aAAa,EAAE,IAAA,EAAM,QAAA,EAAU,OAAA,EAAS,oBAAoB,CAAA;AAC/E,EAAA,OAAO,cAAA;AACT;AAOA,IAAM,2BAAA,GAA8B,mBAAA;AAS7B,IAAM,uBAAA,GAA0B;AAYhC,SAAS,kBAAA,GAA+B;AAC7C,EAAA,MAAM,GAAA,GAAM,OAAA,CAAQ,GAAA,CAAI,uBAAuB,CAAA;AAC/C,EAAA,IAAI,GAAA,KAAQ,MAAA,EAAW,OAAO,CAAC,2BAA2B,CAAA;AAC1D,EAAA,OAAO,GAAA,CACJ,MAAM,GAAG,CAAA,CACT,IAAI,CAAC,OAAA,KAAY,OAAA,CAAQ,IAAA,EAAM,CAAA,CAC/B,OAAO,CAAC,OAAA,KAAY,OAAA,CAAQ,MAAA,GAAS,CAAC,CAAA,CACtC,IAAI,CAAC,OAAA,KAAY,OAAA,CAAQ,OAAO,CAAC,CAAA;AACtC;AAYO,SAAS,qBAAA,CACd,SAAA,EACA,SAAA,GAAsB,kBAAA,EAAmB,EAChC;AACT,EAAA,MAAM,MAAA,GAAS,QAAQ,SAAS,CAAA;AAChC,EAAA,OAAO,SAAA,CAAU,IAAA,CAAK,CAAC,GAAA,KAAQ;AAC7B,IAAA,MAAM,IAAA,GAAO,QAAQ,GAAG,CAAA;AACxB,IAAA,OAAO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,IAAmB,EAAC,EAAG;AAC7C,IAAA,MAAM,KAAA,GAAQ,YAAA,CAAa,GAAA,CAAI,IAAI,CAAA;AACnC,IAAA,IAAI,KAAA,EAAO,QAAA,CAAS,IAAA,CAAK,KAAK,CAAA;AAAA,SACzB,OAAA,CAAQ,KAAK,IAAI,CAAA;AAAA,EACxB;AAEA,EAAA,KAAA,MAAW,IAAA,IAAQ,IAAA,CAAK,eAAA,IAAmB,EAAC,EAAG;AAC7C,IAAA,MAAM,KAAA,GAAQ,YAAA,CAAa,GAAA,CAAI,IAAI,CAAA;AACnC,IAAA,IAAI,KAAA,EAAO,QAAA,CAAS,IAAA,CAAK,KAAK,CAAA;AAAA,EAEhC;AAEA,EAAA,OAAO,EAAE,QAAA,EAAU,QAAA,EAAU,OAAA,EAAQ;AACvC","file":"chunk-LQWOU7S2.js","sourcesContent":["/**\n * Platform-triggered asset deployment.\n *\n * Takes catalog entries (with source_path relative to ai-assets/) and deploys\n * them to a session's .claude/skills/ directory. Handles skill context injection\n * and catalog priority-based name resolution.\n */\n\nimport { cp, mkdir, rm, stat, writeFile } from \"node:fs/promises\";\nimport { join, resolve, sep } from \"node:path\";\nimport { fsDeadlineMs, tryWithFsDeadline, withFsDeadline } from \"@skaile/workspaces/core\";\nimport { createLogger } from \"@skaile/workspaces/core/logging\";\n\n// ---------------------------------------------------------------------------\n// Types (formerly in catalog-compiler.ts, inlined after tear-out in Task 1.5)\n// ---------------------------------------------------------------------------\n\n/**\n * A single user-facing input parameter declared in a SKILL.md.\n *\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport interface InputSpec {\n /** Input parameter key used in skill invocation. */\n key: string;\n /** Whether the input must be provided before running the skill. */\n required?: boolean;\n /** Question string shown to the user when collecting this input. */\n prompt?: string;\n /** Short display label for UI forms. */\n label?: string;\n /** Input data type hint (e.g. `\"string\"`, `\"number\"`, `\"file\"`). */\n type?: string;\n /** Additional guidance text shown alongside the input field. */\n hint?: string;\n}\n\n/**\n * A compiled catalog entry (skill or flow).\n *\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport interface CatalogEntryCompiled {\n /** Unique ID in `publisher/name` form (e.g. `skaileup/cf_overview`). */\n id: string;\n /** Asset kind. */\n kind: \"skill\" | \"flow\";\n /** Human-readable asset name. */\n name: string;\n /** One-line description. */\n description: string;\n /** Semantic version string. */\n version: string;\n /** Maturity stage. */\n stage: \"alpha\" | \"beta\" | \"stable\";\n /** Searchable keywords. */\n keywords: string[];\n /** User-facing input specifications. */\n inputs: InputSpec[];\n /** Asset path relative to assetsRoot. */\n source_path: string;\n /** Optional icon identifier. */\n icon?: string;\n /** Flow-only: required skill names. */\n required_skills?: string[];\n /** Flow-only: optional skill names. */\n optional_skills?: string[];\n}\n\n/**\n * Options controlling how platform-triggered skill deployment is performed.\n *\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport interface DeployFromCatalogOptions {\n /** Root directory of ai-assets (where `source_path` in catalog entries is relative to). */\n assetsRoot: string;\n /** Target directory for deployed skills (e.g. `/workspace/.claude/skills/`). */\n skillsDir: string;\n /** Optional context markdown appended to the deployed skill directory as `CONTEXT.md`. */\n context?: string;\n}\n\n/**\n * Result of a platform-triggered batch skill deployment.\n *\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport interface DeployResult {\n /** IDs of catalog entries successfully deployed. */\n deployed: string[];\n /** IDs of catalog entries skipped (non-skill kinds). */\n skipped: string[];\n /** Error messages for entries that could not be deployed. */\n errors: string[];\n}\n\n// ---------------------------------------------------------------------------\n// Workspace-mount awareness\n// ---------------------------------------------------------------------------\n\n/**\n * Multiplier applied to the base filesystem deadline for whole-tree operations\n * (recursive copy / remove), which legitimately outlast a single `stat`.\n */\nconst TREE_OP_DEADLINE_FACTOR = 4;\n\n/** Default number of parent levels {@link findAiAssetsRoot} inspects. */\nconst AI_ASSETS_WALK_LEVELS = 6;\n\nlet deployerLogger: ReturnType<typeof createLogger> | undefined;\n\nfunction log(): ReturnType<typeof createLogger> {\n deployerLogger ??= createLogger({ kind: \"runner\", subkind: \"catalog-deployer\" });\n return deployerLogger;\n}\n\n/**\n * Where the agent container binds its rclone FUSE mount. Nothing under this\n * path is a safe place to read an asset tree from: the mount is remote\n * (SharePoint / OneDrive / WebDAV) and can wedge indefinitely.\n */\nconst DEFAULT_WORKSPACE_MOUNT_DIR = \"/skaile/workspace\";\n\n/**\n * Env override for the workspace-mount path(s), comma-separated.\n *\n * Set it when the runner binds the mount somewhere other than\n * {@link DEFAULT_WORKSPACE_MOUNT_DIR}; set it to the empty string to disable\n * the guard entirely (single-machine dev, where nothing is a network mount).\n */\nexport const WORKSPACE_MOUNT_ENV_VAR = \"SKAILE_WORKSPACE_MOUNT_DIR\";\n\n/**\n * Resolve the directories treated as network mounts.\n *\n * Read per call rather than cached: the runner mutates `process.env` while\n * wiring a session, so a module-load snapshot would pin a pre-configuration\n * value.\n *\n * @returns Absolute mount paths; empty when the guard is disabled.\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport function workspaceMountDirs(): string[] {\n const raw = process.env[WORKSPACE_MOUNT_ENV_VAR];\n if (raw === undefined) return [DEFAULT_WORKSPACE_MOUNT_DIR];\n return raw\n .split(\",\")\n .map((segment) => segment.trim())\n .filter((segment) => segment.length > 0)\n .map((segment) => resolve(segment));\n}\n\n/**\n * Is `candidate` at, or inside, one of the known workspace mount paths?\n *\n * Pure path arithmetic — deliberately no filesystem access, because the whole\n * point is to decide *before* touching a path that might be unresponsive.\n *\n * @param candidate - Path to test.\n * @param mountDirs - Mount roots; defaults to {@link workspaceMountDirs}.\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport function isUnderWorkspaceMount(\n candidate: string,\n mountDirs: string[] = workspaceMountDirs(),\n): boolean {\n const target = resolve(candidate);\n return mountDirs.some((dir) => {\n const root = resolve(dir);\n return target === root || target.startsWith(root + sep);\n });\n}\n\n/**\n * Walk upward from `startDir` looking for an `ai-assets/` directory.\n *\n * Two properties matter beyond \"find the folder\":\n *\n * 1. **Never synchronous.** The walk probes up to six directories; any one of\n * them can be on a FUSE mount, and the former `existsSync` chain blocked the\n * event loop on the first unresponsive probe. Each probe is now awaited and\n * deadline-bounded, so a wedged mount costs one skipped candidate.\n * 2. **Never resolves onto a mount.** A hit under the workspace mount is\n * skipped with a warning rather than returned: accepting it would wire every\n * later skill deploy — a recursive copy — to a remote filesystem. The walk\n * continues upward, so a legitimate `ai-assets/` in a parent still wins.\n *\n * Only a **directory** counts. An `ai-assets` file would otherwise be returned\n * as a root and every later `join(root, source_path)` would fail with ENOTDIR.\n *\n * @param startDir - Directory to start from (typically the project dir).\n * @param opts - `levels` caps the upward walk; `mountDirs` overrides the mount\n * roots (defaults to {@link workspaceMountDirs}).\n * @returns Absolute path to the `ai-assets/` directory, or `null` if none is\n * reachable within `levels`.\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport async function findAiAssetsRoot(\n startDir: string,\n opts?: { levels?: number; mountDirs?: string[] },\n): Promise<string | null> {\n const mountDirs = opts?.mountDirs ?? workspaceMountDirs();\n const levels = opts?.levels ?? AI_ASSETS_WALK_LEVELS;\n let dir = resolve(startDir);\n // Every level of a `/skaile/workspace/...` start dir is under the mount, so\n // an unconditional warn would fire once per level for one lookup. Collect and\n // report once — the operator needs the fact, not six copies of it.\n const refused: string[] = [];\n\n for (let i = 0; i < levels; i++) {\n const candidate = join(dir, \"ai-assets\");\n if (isUnderWorkspaceMount(candidate, mountDirs)) {\n refused.push(candidate);\n } else {\n const isDir = await tryWithFsDeadline(\n `stat ${candidate}`,\n async () => (await stat(candidate)).isDirectory(),\n false,\n );\n if (isDir) {\n if (refused.length > 0) warnRefused(refused, mountDirs);\n return candidate;\n }\n }\n const parent = resolve(dir, \"..\");\n if (parent === dir) break; // filesystem root — nothing further up\n dir = parent;\n }\n if (refused.length > 0) warnRefused(refused, mountDirs);\n return null;\n}\n\n/** Single warning for every `ai-assets` candidate skipped for sitting on a mount. */\nfunction warnRefused(refused: string[], mountDirs: string[]): void {\n log().warn(\n \"findAiAssetsRoot refused candidates under a workspace mount — deploying skills from a network mount can stall the session\",\n { refused, mountDirs },\n );\n}\n\n/**\n * Deploy a single catalog entry to the session skills directory.\n *\n * Copies the entire skill source directory into `skillsDir/<entry.name>/`.\n * If `context` is provided, a separate `CONTEXT.md` is written alongside\n * `SKILL.md` so the source file is never modified.\n *\n * Only `skill` entries are deployable; other kinds return an error.\n *\n * **Async by necessity.** This runs from the `session_init` command handler\n * with the WebSocket live, and both `assetsRoot` and `skillsDir` can sit on a\n * network mount. The former `cpSync`/`rmSync` pair parked the event loop for\n * the whole copy; every call is now awaited and deadline-bounded, so an\n * unresponsive mount fails one deployment instead of the session.\n *\n * @param entry - Compiled catalog entry to deploy.\n * @param options - Deployment target and optional context.\n * @returns `{ success: true }` on success, `{ success: false, error }` on failure.\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport async function deployCatalogEntry(\n entry: CatalogEntryCompiled,\n options: DeployFromCatalogOptions,\n): Promise<{ success: boolean; error?: string }> {\n const { assetsRoot, skillsDir, context } = options;\n\n if (entry.kind !== \"skill\") {\n return { success: false, error: `Cannot deploy ${entry.kind} directly — only skills` };\n }\n\n const sourcePath = join(assetsRoot, entry.source_path);\n const skillMdPath = join(sourcePath, \"SKILL.md\");\n\n const hasSkillMd = await tryWithFsDeadline(\n `stat ${skillMdPath}`,\n async () => {\n await stat(skillMdPath);\n return true;\n },\n false,\n );\n if (!hasSkillMd) {\n return { success: false, error: `SKILL.md not found at ${skillMdPath}` };\n }\n\n const destDir = join(skillsDir, entry.name);\n\n try {\n await withFsDeadline(`mkdir ${destDir}`, () => mkdir(destDir, { recursive: true }));\n\n // Copy the entire skill directory\n await withFsDeadline(\n `cp ${sourcePath} -> ${destDir}`,\n () => cp(sourcePath, destDir, { recursive: true }),\n fsDeadlineMs() * TREE_OP_DEADLINE_FACTOR,\n );\n\n // Write context to a separate CONTEXT.md — never modify the original SKILL.md.\n // The agent discovers both files in the skill directory.\n const contextPath = join(destDir, \"CONTEXT.md\");\n if (context) {\n await withFsDeadline(`write ${contextPath}`, () =>\n writeFile(contextPath, `# Additional Context\\n\\n${context}\\n`, \"utf8\"),\n );\n } else {\n // `force: true` makes this a single call: a stale CONTEXT.md is removed,\n // an absent one is a no-op. The former existsSync probe only added a\n // second trip to the same possibly-wedged mount.\n await withFsDeadline(`rm ${contextPath}`, () => rm(contextPath, { force: true }));\n }\n } catch (err) {\n return { success: false, error: err instanceof Error ? err.message : String(err) };\n }\n\n return { success: true };\n}\n\n/**\n * Remove a deployed skill directory from the session skills directory.\n *\n * @param name - Skill name (directory basename under `skillsDir`).\n * @param skillsDir - Absolute path to the session skills directory.\n * @returns `true` if the skill was found and removed; `false` if it was not\n * deployed, or if the directory could not be reached within the deadline.\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport async function undeployCatalogEntry(name: string, skillsDir: string): Promise<boolean> {\n const destDir = join(skillsDir, name);\n const exists = await tryWithFsDeadline(\n `stat ${destDir}`,\n async () => {\n await stat(destDir);\n return true;\n },\n false,\n );\n if (!exists) return false;\n await withFsDeadline(\n `rm -r ${destDir}`,\n () => rm(destDir, { recursive: true, force: true }),\n fsDeadlineMs() * TREE_OP_DEADLINE_FACTOR,\n );\n return true;\n}\n\n/**\n * Deploy multiple catalog entries in a single batch operation.\n *\n * Non-skill entries (flows, agents, etc.) are automatically skipped and\n * recorded in `result.skipped`. Deployment failures are collected in\n * `result.errors` without aborting the rest of the batch.\n *\n * @param entries - Compiled catalog entries to deploy.\n * @param options - Deployment target and optional context.\n * @returns Aggregated {@link DeployResult} with deployed, skipped, and error lists.\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport async function deployAll(\n entries: CatalogEntryCompiled[],\n options: DeployFromCatalogOptions,\n): Promise<DeployResult> {\n const result: DeployResult = { deployed: [], skipped: [], errors: [] };\n\n for (const entry of entries) {\n if (entry.kind !== \"skill\") {\n result.skipped.push(entry.id);\n continue;\n }\n\n // Serial on purpose: concurrent recursive copies onto one mount multiply\n // the queue depth on the exact resource that is already the bottleneck.\n const r = await deployCatalogEntry(entry, options);\n if (r.success) {\n result.deployed.push(entry.id);\n } else {\n result.errors.push(`${entry.id}: ${r.error}`);\n }\n }\n\n return result;\n}\n\n/**\n * Resolve a flow's skill dependencies from the full catalog entry list.\n *\n * Partitions `flow.required_skills` and `flow.optional_skills` into resolved\n * entries and a list of names that could not be found. Missing optional skills\n * are silently ignored (they do not appear in `missing`).\n *\n * @param flow - Compiled flow entry whose skill dependencies should be resolved.\n * @param allEntries - Full set of compiled catalog entries to search.\n * @returns Object containing resolved `required` entries, resolved `optional` entries,\n * and `missing` skill names that were listed as required but not found.\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport function resolveFlowSkills(\n flow: CatalogEntryCompiled,\n allEntries: CatalogEntryCompiled[],\n): { required: CatalogEntryCompiled[]; optional: CatalogEntryCompiled[]; missing: string[] } {\n const skillsByName = new Map<string, CatalogEntryCompiled>();\n for (const e of allEntries) {\n if (e.kind === \"skill\") skillsByName.set(e.name, e);\n }\n\n const required: CatalogEntryCompiled[] = [];\n const optional: CatalogEntryCompiled[] = [];\n const missing: string[] = [];\n\n for (const name of flow.required_skills ?? []) {\n const entry = skillsByName.get(name);\n if (entry) required.push(entry);\n else missing.push(name);\n }\n\n for (const name of flow.optional_skills ?? []) {\n const entry = skillsByName.get(name);\n if (entry) optional.push(entry);\n // Optional skills don't count as missing\n }\n\n return { required, optional, missing };\n}\n"]}
@@ -1,12 +1,12 @@
1
- import { factoryAssetRoots, resolveWorkspacesPackageRoot } from './chunk-4ROXSQEG.js';
1
+ import { factoryAssetRoots, resolveWorkspacesPackageRoot } from './chunk-CJO3XKO7.js';
2
2
  import { deployedBase } from './chunk-5KRMNUL4.js';
3
3
  import { DEFAULT_HARNESS_ID } from './chunk-C5HFK34M.js';
4
- import { ConfigParseError, valueShapeError, parseSourceEntries, resolveSkWorkspaceConfig } from './chunk-FZO64PLQ.js';
4
+ import { ConfigParseError, valueShapeError, parseSourceEntries, resolveSkWorkspaceConfig } from './chunk-BNLXZXZN.js';
5
5
  import { globalSkaileDir } from './chunk-L5VSIPQD.js';
6
6
  import { harnessNameForHarnessId, SUPPORTED_HARNESSES } from './chunk-VTETQCR6.js';
7
- import { sha256Hex, compositeSha256, orderedAsset, ASSET_KEY_ORDER } from './chunk-QC5BYUED.js';
8
- import { yamlQuotingHint } from './chunk-GNUA7XT2.js';
9
- import { parseAssetRefLoose } from './chunk-V5KG6CCV.js';
7
+ import { sha256Hex, compositeSha256, orderedAsset, ASSET_KEY_ORDER } from './chunk-MS2IXLTC.js';
8
+ import { yamlQuotingHint } from './chunk-VS6XC5JE.js';
9
+ import { parseAssetRefLoose } from './chunk-7HRZACI4.js';
10
10
  import { validateRegistry, mergeRegistries, validateMergedRegistry } from './chunk-RXGPFAMN.js';
11
11
  import fs, { existsSync, readFileSync, writeFileSync, realpathSync, renameSync, rmSync, mkdirSync, cpSync, readdirSync } from 'fs';
12
12
  import path, { join, resolve, basename, dirname } from 'path';
@@ -287,7 +287,9 @@ function lockRequires(c) {
287
287
  }
288
288
  function sourcesOfAssets(assets) {
289
289
  const byUrl = /* @__PURE__ */ new Map();
290
- for (const key of Object.keys(assets).sort()) {
290
+ const keys = Object.keys(assets).sort();
291
+ const isStore = (k) => assets[k]?.origin === "store";
292
+ for (const key of [...keys.filter((k) => !isStore(k)), ...keys.filter(isStore)]) {
291
293
  const source = assets[key]?.source;
292
294
  if (source && !byUrl.has(source.url)) {
293
295
  byUrl.set(source.url, { url: source.url, commit: source.commit });
@@ -295,6 +297,13 @@ function sourcesOfAssets(assets) {
295
297
  }
296
298
  return [...byUrl.values()].sort((a, b) => a.url.localeCompare(b.url));
297
299
  }
300
+ function cloneBackedSources(lock) {
301
+ const urls = /* @__PURE__ */ new Set();
302
+ for (const entry of Object.values(lock.assets)) {
303
+ if (entry.source && entry.origin !== "store") urls.add(entry.source.url);
304
+ }
305
+ return lock.sources.filter((s) => urls.has(s.url));
306
+ }
298
307
  function resyncLockSources(lock, droppedUrls = []) {
299
308
  const sources = new Map(lock.sources.map((s) => [s.url, s]));
300
309
  const live = sourcesOfAssets(lock.assets);
@@ -1600,6 +1609,6 @@ var WorkspaceYamlEditor = class _WorkspaceYamlEditor {
1600
1609
  }
1601
1610
  };
1602
1611
 
1603
- export { AGENT_PROMPT_SECTION_ORDER, FACTORY_SOURCE_URL, GLOBAL_INSTALL_DIR_NAME, LOCK_FACTORY_URL, LOCK_SCHEMA_VERSION, LockParseError, ManifestYamlEditor, PROVIDERS_FILENAME, SETTINGS_DEFAULTS, WorkspaceYamlEditor, aiResourceRoots, applyPatch, assertLockHashes, buildAgentPromptSections, buildLibraryLockEntries, buildLockFile, capMemoryContent, checkAgentSkillConformance, computeHash, connectProbe, defaultLibraryDir, detectPackageManager, extractForPatch, findProjectPackageDir, generatePatch, globalInstallDir, globalSettingsPath, harnessSdkMissingError, holdsWildcard, installCommand, installCommandFor, isFactoryMemorySource, listPatches, listenWithProbe, loadHarnessSdk, loadHarnessSdkSubpath, loadProviderRegistry, loadProviderRegistryFile, loadSettings, mapLegacyFields, maskApiKey, mergeLockFile, migrateSettings, needsWildcardProbe, portIsHeld, probeHosts, projectAssetRoots, projectSettingsPath, readLock, readPatch, readPluginsLockSlice, renderMemorySection, resolveConfiguredHarnessName, resolveLibraryDir, resolveSettings, resolveSettingsWithSources, resyncLockSources, savePatch, saveProviderRegistryFile, saveSettings, sdkLookupPlaces, skaileInstallDir, userProviderRegistryPath, verifyLock, verifyLockEntry, walkForSettings, workspaceProviderRegistryPath, writeLock, writePluginsLockSlice };
1604
- //# sourceMappingURL=chunk-4KPQ6ILH.js.map
1605
- //# sourceMappingURL=chunk-4KPQ6ILH.js.map
1612
+ export { AGENT_PROMPT_SECTION_ORDER, FACTORY_SOURCE_URL, GLOBAL_INSTALL_DIR_NAME, LOCK_FACTORY_URL, LOCK_SCHEMA_VERSION, LockParseError, ManifestYamlEditor, PROVIDERS_FILENAME, SETTINGS_DEFAULTS, WorkspaceYamlEditor, aiResourceRoots, applyPatch, assertLockHashes, buildAgentPromptSections, buildLibraryLockEntries, buildLockFile, capMemoryContent, checkAgentSkillConformance, cloneBackedSources, computeHash, connectProbe, defaultLibraryDir, detectPackageManager, extractForPatch, findProjectPackageDir, generatePatch, globalInstallDir, globalSettingsPath, harnessSdkMissingError, holdsWildcard, installCommand, installCommandFor, isFactoryMemorySource, listPatches, listenWithProbe, loadHarnessSdk, loadHarnessSdkSubpath, loadProviderRegistry, loadProviderRegistryFile, loadSettings, mapLegacyFields, maskApiKey, mergeLockFile, migrateSettings, needsWildcardProbe, portIsHeld, probeHosts, projectAssetRoots, projectSettingsPath, readLock, readPatch, readPluginsLockSlice, renderMemorySection, resolveConfiguredHarnessName, resolveLibraryDir, resolveSettings, resolveSettingsWithSources, resyncLockSources, savePatch, saveProviderRegistryFile, saveSettings, sdkLookupPlaces, skaileInstallDir, userProviderRegistryPath, verifyLock, verifyLockEntry, walkForSettings, workspaceProviderRegistryPath, writeLock, writePluginsLockSlice };
1613
+ //# sourceMappingURL=chunk-MEU2HHGV.js.map
1614
+ //# sourceMappingURL=chunk-MEU2HHGV.js.map