@skaile/workspaces 5.7.0 → 5.9.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 (419) hide show
  1. package/CHANGELOG.md +120 -0
  2. package/dist/app-sdk/index.js +1 -1
  3. package/dist/{asset-feeds-K36CR52Q.js → asset-feeds-XMKKUUK6.js} +54 -30
  4. package/dist/asset-feeds-XMKKUUK6.js.map +1 -0
  5. package/dist/asset-manager/catalog-deployer.js +9 -9
  6. package/dist/asset-manager/index.js +15 -15
  7. package/dist/asset-manager/installer.js +11 -11
  8. package/dist/asset-manager/renderers.js +10 -10
  9. package/dist/asset-manager/src/index.d.ts +268 -24
  10. package/dist/asset-manager/src/index.d.ts.map +1 -1
  11. package/dist/asset-manager/src/install-agent.d.ts +11 -0
  12. package/dist/asset-manager/src/install-agent.d.ts.map +1 -1
  13. package/dist/asset-manager/src/installer.d.ts +2 -2
  14. package/dist/asset-manager/src/installer.d.ts.map +1 -1
  15. package/dist/bridge/drivers/claude-sdk.js +301 -212
  16. package/dist/bridge/drivers/claude-sdk.js.map +1 -1
  17. package/dist/bridge/drivers/codex.js +92 -66
  18. package/dist/bridge/drivers/codex.js.map +1 -1
  19. package/dist/bridge/drivers/continue.js +14 -15
  20. package/dist/bridge/drivers/continue.js.map +1 -1
  21. package/dist/bridge/drivers/echo.js +4 -4
  22. package/dist/bridge/drivers/gemini.js +8 -8
  23. package/dist/bridge/drivers/goose.js +14 -15
  24. package/dist/bridge/drivers/goose.js.map +1 -1
  25. package/dist/bridge/drivers/omp.js +70 -104
  26. package/dist/bridge/drivers/omp.js.map +1 -1
  27. package/dist/bridge/drivers/opencode.js +14 -15
  28. package/dist/bridge/drivers/opencode.js.map +1 -1
  29. package/dist/bridge/drivers/qwen.js +8 -8
  30. package/dist/bridge/index.js +16 -17
  31. package/dist/bridge/src/codex/managed-driver.d.ts +13 -10
  32. package/dist/bridge/src/codex/managed-driver.d.ts.map +1 -1
  33. package/dist/bridge/src/drivers/_subprocess-cli.d.ts +12 -2
  34. package/dist/bridge/src/drivers/_subprocess-cli.d.ts.map +1 -1
  35. package/dist/bridge/src/drivers/claude-sdk.d.ts +67 -62
  36. package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
  37. package/dist/bridge/src/drivers/claude-tool-allowlist.d.ts +43 -0
  38. package/dist/bridge/src/drivers/claude-tool-allowlist.d.ts.map +1 -0
  39. package/dist/bridge/src/drivers/codex.d.ts +26 -10
  40. package/dist/bridge/src/drivers/codex.d.ts.map +1 -1
  41. package/dist/bridge/src/drivers/continue.d.ts +2 -2
  42. package/dist/bridge/src/drivers/continue.d.ts.map +1 -1
  43. package/dist/bridge/src/drivers/gemini.d.ts +2 -2
  44. package/dist/bridge/src/drivers/gemini.d.ts.map +1 -1
  45. package/dist/bridge/src/drivers/goose.d.ts +2 -2
  46. package/dist/bridge/src/drivers/goose.d.ts.map +1 -1
  47. package/dist/bridge/src/drivers/omp.d.ts +24 -35
  48. package/dist/bridge/src/drivers/omp.d.ts.map +1 -1
  49. package/dist/bridge/src/drivers/opencode.d.ts +2 -2
  50. package/dist/bridge/src/drivers/opencode.d.ts.map +1 -1
  51. package/dist/bridge/src/drivers/recovery-policy.d.ts +79 -0
  52. package/dist/bridge/src/drivers/recovery-policy.d.ts.map +1 -0
  53. package/dist/bridge/src/index.d.ts +1 -0
  54. package/dist/bridge/src/index.d.ts.map +1 -1
  55. package/dist/bridge/src/reconfigure-ledger.d.ts +117 -0
  56. package/dist/bridge/src/reconfigure-ledger.d.ts.map +1 -0
  57. package/dist/bridge/src/types.d.ts +77 -7
  58. package/dist/bridge/src/types.d.ts.map +1 -1
  59. package/dist/{chunk-WIEC3ZE4.js → chunk-2FRUUDZY.js} +5 -5
  60. package/dist/{chunk-WIEC3ZE4.js.map → chunk-2FRUUDZY.js.map} +1 -1
  61. package/dist/{chunk-NARITJS2.js → chunk-2H73V6XR.js} +3 -3
  62. package/dist/{chunk-NARITJS2.js.map → chunk-2H73V6XR.js.map} +1 -1
  63. package/dist/{chunk-O4Z7MAW7.js → chunk-2LWYNQK7.js} +3 -3
  64. package/dist/{chunk-O4Z7MAW7.js.map → chunk-2LWYNQK7.js.map} +1 -1
  65. package/dist/{chunk-OOLT6HGP.js → chunk-36AFURKZ.js} +7 -7
  66. package/dist/{chunk-OOLT6HGP.js.map → chunk-36AFURKZ.js.map} +1 -1
  67. package/dist/{chunk-DFFD4BFG.js → chunk-4MQS7CAF.js} +174 -86
  68. package/dist/chunk-4MQS7CAF.js.map +1 -0
  69. package/dist/{chunk-RNPHRRLG.js → chunk-4PTSR4UU.js} +3 -3
  70. package/dist/{chunk-RNPHRRLG.js.map → chunk-4PTSR4UU.js.map} +1 -1
  71. package/dist/{chunk-BTK7ECLH.js → chunk-5NNNV76P.js} +41 -8
  72. package/dist/chunk-5NNNV76P.js.map +1 -0
  73. package/dist/{chunk-IZLQ4GDO.js → chunk-7AI3Q5AQ.js} +43 -21
  74. package/dist/chunk-7AI3Q5AQ.js.map +1 -0
  75. package/dist/{chunk-NFGRW3L7.js → chunk-7RGTAEG6.js} +3 -3
  76. package/dist/{chunk-NFGRW3L7.js.map → chunk-7RGTAEG6.js.map} +1 -1
  77. package/dist/{chunk-XBSQ4KMC.js → chunk-B4X2N7JQ.js} +205 -3
  78. package/dist/chunk-B4X2N7JQ.js.map +1 -0
  79. package/dist/{chunk-FRHE7FFB.js → chunk-B6GIW55K.js} +5 -3
  80. package/dist/chunk-B6GIW55K.js.map +1 -0
  81. package/dist/{chunk-RVIZQ5XD.js → chunk-BTE2V4IW.js} +3 -3
  82. package/dist/{chunk-RVIZQ5XD.js.map → chunk-BTE2V4IW.js.map} +1 -1
  83. package/dist/{chunk-EB4XN3KE.js → chunk-CGT45WN7.js} +3 -3
  84. package/dist/{chunk-EB4XN3KE.js.map → chunk-CGT45WN7.js.map} +1 -1
  85. package/dist/{chunk-FAP63KV7.js → chunk-CKQEIY43.js} +4 -4
  86. package/dist/{chunk-FAP63KV7.js.map → chunk-CKQEIY43.js.map} +1 -1
  87. package/dist/{chunk-NWQB7UTY.js → chunk-DNZYOKOJ.js} +3 -3
  88. package/dist/{chunk-NWQB7UTY.js.map → chunk-DNZYOKOJ.js.map} +1 -1
  89. package/dist/{chunk-AVCUPPG6.js → chunk-EF7NPDDU.js} +4 -4
  90. package/dist/{chunk-AVCUPPG6.js.map → chunk-EF7NPDDU.js.map} +1 -1
  91. package/dist/chunk-EPBKISS5.js +84 -0
  92. package/dist/chunk-EPBKISS5.js.map +1 -0
  93. package/dist/{chunk-DMLDYFDS.js → chunk-F4NJDSR7.js} +9 -5
  94. package/dist/chunk-F4NJDSR7.js.map +1 -0
  95. package/dist/{chunk-PSA6ONFB.js → chunk-FVJK4QWM.js} +4 -4
  96. package/dist/{chunk-PSA6ONFB.js.map → chunk-FVJK4QWM.js.map} +1 -1
  97. package/dist/{chunk-KNWCFEWU.js → chunk-FYXZRVID.js} +20 -7
  98. package/dist/{chunk-KNWCFEWU.js.map → chunk-FYXZRVID.js.map} +1 -1
  99. package/dist/{chunk-LBQ4BBX4.js → chunk-FZNG4V4J.js} +16 -30
  100. package/dist/chunk-FZNG4V4J.js.map +1 -0
  101. package/dist/{chunk-SWO25LTO.js → chunk-GB7WDMH2.js} +4 -4
  102. package/dist/{chunk-SWO25LTO.js.map → chunk-GB7WDMH2.js.map} +1 -1
  103. package/dist/{chunk-EU3Q5AQ4.js → chunk-GKMZ6THE.js} +23 -32
  104. package/dist/chunk-GKMZ6THE.js.map +1 -0
  105. package/dist/{chunk-TTPSDC2G.js → chunk-GTILM2CI.js} +34 -13
  106. package/dist/chunk-GTILM2CI.js.map +1 -0
  107. package/dist/{chunk-LXY4BUA3.js → chunk-GXLQLPE5.js} +9 -5
  108. package/dist/chunk-GXLQLPE5.js.map +1 -0
  109. package/dist/{chunk-D5HOETOB.js → chunk-IMKSM5NL.js} +981 -126
  110. package/dist/chunk-IMKSM5NL.js.map +1 -0
  111. package/dist/{chunk-6UFFKMVC.js → chunk-IR33D6EP.js} +6 -6
  112. package/dist/{chunk-6UFFKMVC.js.map → chunk-IR33D6EP.js.map} +1 -1
  113. package/dist/{chunk-CT6NQSA4.js → chunk-ISHJITXJ.js} +3 -3
  114. package/dist/{chunk-CT6NQSA4.js.map → chunk-ISHJITXJ.js.map} +1 -1
  115. package/dist/chunk-IZCR27MU.js +60 -0
  116. package/dist/chunk-IZCR27MU.js.map +1 -0
  117. package/dist/{chunk-GWXFSLBK.js → chunk-J7U3PIOE.js} +4 -4
  118. package/dist/{chunk-GWXFSLBK.js.map → chunk-J7U3PIOE.js.map} +1 -1
  119. package/dist/{chunk-LCU5U5IW.js → chunk-JAKOMFC6.js} +67 -19
  120. package/dist/chunk-JAKOMFC6.js.map +1 -0
  121. package/dist/{chunk-THEJJBOU.js → chunk-JZ5EHBPI.js} +3 -3
  122. package/dist/{chunk-THEJJBOU.js.map → chunk-JZ5EHBPI.js.map} +1 -1
  123. package/dist/{chunk-BWZF2ZIF.js → chunk-K3CVFRVS.js} +3 -3
  124. package/dist/{chunk-BWZF2ZIF.js.map → chunk-K3CVFRVS.js.map} +1 -1
  125. package/dist/{chunk-VOOI7B2L.js → chunk-LAMCXQGA.js} +241 -73
  126. package/dist/chunk-LAMCXQGA.js.map +1 -0
  127. package/dist/{chunk-37FTLYFP.js → chunk-LNFKL23K.js} +3 -3
  128. package/dist/{chunk-37FTLYFP.js.map → chunk-LNFKL23K.js.map} +1 -1
  129. package/dist/{chunk-XUUYAS3Z.js → chunk-M3WPBTGJ.js} +3 -3
  130. package/dist/{chunk-XUUYAS3Z.js.map → chunk-M3WPBTGJ.js.map} +1 -1
  131. package/dist/{chunk-QZLWJETK.js → chunk-MGGFBZWA.js} +3 -3
  132. package/dist/{chunk-QZLWJETK.js.map → chunk-MGGFBZWA.js.map} +1 -1
  133. package/dist/{chunk-34C42MJX.js → chunk-MR5HBOUF.js} +5 -5
  134. package/dist/{chunk-34C42MJX.js.map → chunk-MR5HBOUF.js.map} +1 -1
  135. package/dist/{chunk-QCI6D7E4.js → chunk-NUELZWCF.js} +266 -170
  136. package/dist/chunk-NUELZWCF.js.map +1 -0
  137. package/dist/{chunk-GIC3G5YG.js → chunk-P67WJVP4.js} +7 -13
  138. package/dist/chunk-P67WJVP4.js.map +1 -0
  139. package/dist/{chunk-G67BOI2J.js → chunk-PMECEZK3.js} +15 -9
  140. package/dist/chunk-PMECEZK3.js.map +1 -0
  141. package/dist/{chunk-OKGUDNDT.js → chunk-Q6E6FM7P.js} +35 -33
  142. package/dist/chunk-Q6E6FM7P.js.map +1 -0
  143. package/dist/{chunk-CWM3MYGX.js → chunk-QVEKLSEH.js} +8 -9
  144. package/dist/chunk-QVEKLSEH.js.map +1 -0
  145. package/dist/{chunk-O7VPNKYN.js → chunk-QVNRCDTV.js} +23 -7
  146. package/dist/chunk-QVNRCDTV.js.map +1 -0
  147. package/dist/{chunk-UX3K4RKE.js → chunk-S53LOR7B.js} +3 -3
  148. package/dist/{chunk-UX3K4RKE.js.map → chunk-S53LOR7B.js.map} +1 -1
  149. package/dist/{chunk-53MSCGR2.js → chunk-SCOT677Q.js} +5 -5
  150. package/dist/{chunk-53MSCGR2.js.map → chunk-SCOT677Q.js.map} +1 -1
  151. package/dist/{chunk-SZWRPEF7.js → chunk-TTRYE6AC.js} +39 -29
  152. package/dist/chunk-TTRYE6AC.js.map +1 -0
  153. package/dist/{chunk-KM7XWC4Y.js → chunk-UAROCOXF.js} +3 -3
  154. package/dist/{chunk-KM7XWC4Y.js.map → chunk-UAROCOXF.js.map} +1 -1
  155. package/dist/{chunk-MKLBK7HI.js → chunk-UM7RIAHO.js} +17 -13
  156. package/dist/chunk-UM7RIAHO.js.map +1 -0
  157. package/dist/{chunk-JMKB7IB4.js → chunk-UMVKJM4Q.js} +4 -4
  158. package/dist/chunk-UMVKJM4Q.js.map +1 -0
  159. package/dist/{chunk-JLSCA5T5.js → chunk-UO7WPLDY.js} +3 -3
  160. package/dist/{chunk-JLSCA5T5.js.map → chunk-UO7WPLDY.js.map} +1 -1
  161. package/dist/{chunk-HCYS7GFP.js → chunk-V2DXZYBB.js} +3 -3
  162. package/dist/{chunk-HCYS7GFP.js.map → chunk-V2DXZYBB.js.map} +1 -1
  163. package/dist/{chunk-47ZD34KB.js → chunk-VMKMFS2Q.js} +28 -7
  164. package/dist/chunk-VMKMFS2Q.js.map +1 -0
  165. package/dist/{chunk-IUUYRXT6.js → chunk-W5DWWE4Y.js} +4 -4
  166. package/dist/{chunk-IUUYRXT6.js.map → chunk-W5DWWE4Y.js.map} +1 -1
  167. package/dist/{chunk-FK6HPLQA.js → chunk-X4BAYGMT.js} +3 -3
  168. package/dist/{chunk-FK6HPLQA.js.map → chunk-X4BAYGMT.js.map} +1 -1
  169. package/dist/{chunk-OJ4N4T4H.js → chunk-XDVR7QIT.js} +20 -6
  170. package/dist/chunk-XDVR7QIT.js.map +1 -0
  171. package/dist/{chunk-7FJQT3GT.js → chunk-Y4N2NUZD.js} +4 -4
  172. package/dist/{chunk-7FJQT3GT.js.map → chunk-Y4N2NUZD.js.map} +1 -1
  173. package/dist/{chunk-6VRJH4MR.js → chunk-Y7QA2OLD.js} +6 -6
  174. package/dist/{chunk-6VRJH4MR.js.map → chunk-Y7QA2OLD.js.map} +1 -1
  175. package/dist/{chunk-74EEFB52.js → chunk-YSHVQGUS.js} +115 -27
  176. package/dist/chunk-YSHVQGUS.js.map +1 -0
  177. package/dist/{chunk-6C654TFI.js → chunk-ZAOGFXDO.js} +36 -8
  178. package/dist/chunk-ZAOGFXDO.js.map +1 -0
  179. package/dist/{chunk-N6FBTXQ5.js → chunk-ZTBAYUDY.js} +2 -2
  180. package/dist/{chunk-N6FBTXQ5.js.map → chunk-ZTBAYUDY.js.map} +1 -1
  181. package/dist/cli/index.js +373 -188
  182. package/dist/cli/index.js.map +1 -1
  183. package/dist/cli/src/asset-feeds.d.ts +5 -2
  184. package/dist/cli/src/asset-feeds.d.ts.map +1 -1
  185. package/dist/cli/src/commands/asset-cmd.d.ts.map +1 -1
  186. package/dist/cli/src/commands/catalog.d.ts +15 -2
  187. package/dist/cli/src/commands/catalog.d.ts.map +1 -1
  188. package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
  189. package/dist/cli/src/commands/library-index.d.ts +8 -0
  190. package/dist/cli/src/commands/library-index.d.ts.map +1 -1
  191. package/dist/cli/src/commands/library-publish.d.ts.map +1 -1
  192. package/dist/cli/src/commands/manage.d.ts.map +1 -1
  193. package/dist/cli/src/commands/outdated.d.ts +7 -2
  194. package/dist/cli/src/commands/outdated.d.ts.map +1 -1
  195. package/dist/cli/src/commands/project.d.ts +2 -0
  196. package/dist/cli/src/commands/project.d.ts.map +1 -1
  197. package/dist/cli/src/commands/publish-core.d.ts +10 -1
  198. package/dist/cli/src/commands/publish-core.d.ts.map +1 -1
  199. package/dist/cli/src/commands/session.d.ts.map +1 -1
  200. package/dist/cli/src/commands/source.d.ts +14 -0
  201. package/dist/cli/src/commands/source.d.ts.map +1 -1
  202. package/dist/cli/src/commands/tree.d.ts.map +1 -1
  203. package/dist/cli/src/commands/update.d.ts.map +1 -1
  204. package/dist/cli/src/commands/validate.d.ts.map +1 -1
  205. package/dist/cli/src/flow-discovery.d.ts +8 -5
  206. package/dist/cli/src/flow-discovery.d.ts.map +1 -1
  207. package/dist/cli/src/open-library.d.ts +0 -11
  208. package/dist/cli/src/open-library.d.ts.map +1 -1
  209. package/dist/cli/src/skill-checks.d.ts +11 -2
  210. package/dist/cli/src/skill-checks.d.ts.map +1 -1
  211. package/dist/client/index.js +1 -1
  212. package/dist/client/src/client.d.ts +10 -3
  213. package/dist/client/src/client.d.ts.map +1 -1
  214. package/dist/connectors/config.js +5 -5
  215. package/dist/connectors/index.js +25 -26
  216. package/dist/connectors/src/access-policy.d.ts +33 -0
  217. package/dist/connectors/src/access-policy.d.ts.map +1 -0
  218. package/dist/connectors/src/connector-manager.d.ts.map +1 -1
  219. package/dist/connectors/src/index.d.ts +2 -0
  220. package/dist/connectors/src/index.d.ts.map +1 -1
  221. package/dist/connectors-C7UQ73BK.js +44 -0
  222. package/dist/{connectors-SSOTIDHT.js.map → connectors-C7UQ73BK.js.map} +1 -1
  223. package/dist/connectors-shared/index.js +2 -2
  224. package/dist/core/index.js +8 -8
  225. package/dist/core/logging.js +1 -1
  226. package/dist/core/manifest.js +2 -2
  227. package/dist/core/models.js +1 -1
  228. package/dist/core/publish-manifest.js +2 -2
  229. package/dist/core/ref.js +1 -1
  230. package/dist/core/runtime-assets.js +5 -5
  231. package/dist/core/src/index.d.ts +3 -3
  232. package/dist/core/src/index.d.ts.map +1 -1
  233. package/dist/core/src/logging/config.d.ts +9 -1
  234. package/dist/core/src/logging/config.d.ts.map +1 -1
  235. package/dist/core/src/manifest.d.ts +11 -1
  236. package/dist/core/src/manifest.d.ts.map +1 -1
  237. package/dist/core/src/models.d.ts +14 -6
  238. package/dist/core/src/models.d.ts.map +1 -1
  239. package/dist/core/src/repo-manager.d.ts +41 -6
  240. package/dist/core/src/repo-manager.d.ts.map +1 -1
  241. package/dist/core/src/store.d.ts +16 -2
  242. package/dist/core/src/store.d.ts.map +1 -1
  243. package/dist/core/src/workspace-config.d.ts +10 -1
  244. package/dist/core/src/workspace-config.d.ts.map +1 -1
  245. package/dist/core/store.js +1 -1
  246. package/dist/core/workspace-config.js +4 -4
  247. package/dist/deploy/index.js +8 -8
  248. package/dist/discovery/index.js +5 -5
  249. package/dist/{ensure-sources-277VI7R3.js → ensure-sources-SRC2DVR5.js} +18 -18
  250. package/dist/{ensure-sources-277VI7R3.js.map → ensure-sources-SRC2DVR5.js.map} +1 -1
  251. package/dist/factory-assets/connectors/box.js +25 -26
  252. package/dist/factory-assets/connectors/deploy.js +25 -26
  253. package/dist/factory-assets/connectors/devserver.js +25 -26
  254. package/dist/factory-assets/connectors/flow/adapter.d.ts +6 -0
  255. package/dist/factory-assets/connectors/flow/adapter.d.ts.map +1 -1
  256. package/dist/factory-assets/connectors/flow/adapter.js +25 -26
  257. package/dist/factory-assets/connectors/flow/contract/expression.d.ts +3 -0
  258. package/dist/factory-assets/connectors/flow/contract/expression.d.ts.map +1 -1
  259. package/dist/factory-assets/connectors/flow/contract/output-fields.d.ts +1 -1
  260. package/dist/factory-assets/connectors/flow/contract/output-fields.d.ts.map +1 -1
  261. package/dist/factory-assets/connectors/flow/contract/schema.d.ts.map +1 -1
  262. package/dist/factory-assets/connectors/flow/contract.js +4 -4
  263. package/dist/factory-assets/connectors/flow/engine/flow-output.d.ts +4 -3
  264. package/dist/factory-assets/connectors/flow/engine/flow-output.d.ts.map +1 -1
  265. package/dist/factory-assets/connectors/flow/engine/output-schema.d.ts +6 -1
  266. package/dist/factory-assets/connectors/flow/engine/output-schema.d.ts.map +1 -1
  267. package/dist/factory-assets/connectors/flow/engine.js +12 -12
  268. package/dist/factory-assets/connectors/flow/inline-sub-flow-host.d.ts.map +1 -1
  269. package/dist/factory-assets/connectors/flow/prompt-fragments.js +3 -3
  270. package/dist/factory-assets/connectors/flow/run-flow.d.ts.map +1 -1
  271. package/dist/factory-assets/connectors/flow/run-flow.js +27 -28
  272. package/dist/factory-assets/connectors/flow.js +25 -26
  273. package/dist/factory-assets/connectors/git/config.d.ts.map +1 -1
  274. package/dist/factory-assets/connectors/git.js +25 -26
  275. package/dist/factory-assets/connectors/gmail.js +25 -26
  276. package/dist/factory-assets/connectors/googledrive.js +25 -26
  277. package/dist/factory-assets/connectors/local.js +25 -26
  278. package/dist/factory-assets/connectors/mattermost.js +25 -26
  279. package/dist/factory-assets/connectors/memory.js +25 -26
  280. package/dist/factory-assets/connectors/minio.js +25 -26
  281. package/dist/factory-assets/connectors/postgres.js +25 -26
  282. package/dist/factory-assets/connectors/s3.js +25 -26
  283. package/dist/factory-assets/connectors/sharepoint.js +25 -26
  284. package/dist/factory-assets/connectors/sqlite.js +25 -26
  285. package/dist/factory-assets/connectors/static-server.js +25 -26
  286. package/dist/factory-assets/connectors/tunnel.js +25 -26
  287. package/dist/factory-assets/connectors/webdav.js +25 -26
  288. package/dist/factory-assets/connectors/xstate-store.js +25 -26
  289. package/dist/factory-assets/connectors/xstate.js +25 -26
  290. package/dist/factory-assets/skills/skaile-author-asset/SKILL.md +10 -7
  291. package/dist/{flows-J2UEU2QM.js → flows-CBYRSAGS.js} +13 -13
  292. package/dist/{flows-J2UEU2QM.js.map → flows-CBYRSAGS.js.map} +1 -1
  293. package/dist/{helpers-KC5O7CML.js → helpers-XAEKCZKT.js} +18 -18
  294. package/dist/{helpers-KC5O7CML.js.map → helpers-XAEKCZKT.js.map} +1 -1
  295. package/dist/library/index.js +12 -12
  296. package/dist/library/install.js +3 -3
  297. package/dist/library/src/index.d.ts +3 -1
  298. package/dist/library/src/index.d.ts.map +1 -1
  299. package/dist/library/src/local/scan-authoring-libraries.d.ts +43 -0
  300. package/dist/library/src/local/scan-authoring-libraries.d.ts.map +1 -0
  301. package/dist/library/src/manifest-writer.d.ts +26 -3
  302. package/dist/library/src/manifest-writer.d.ts.map +1 -1
  303. package/dist/library/src/sync/git-driver.d.ts.map +1 -1
  304. package/dist/{library-publish-FGXF5TJO.js → library-publish-VJSWMOLH.js} +73 -37
  305. package/dist/library-publish-VJSWMOLH.js.map +1 -0
  306. package/dist/open-library-DB2PNL2X.js +40 -0
  307. package/dist/{open-library-P3D337NH.js.map → open-library-DB2PNL2X.js.map} +1 -1
  308. package/dist/open-registry-ZUZJ7MS7.js +32 -0
  309. package/dist/{open-registry-Z3P2X2AB.js.map → open-registry-ZUZJ7MS7.js.map} +1 -1
  310. package/dist/paths-FQ64OLJG.js +22 -0
  311. package/dist/{paths-JKEKXM52.js.map → paths-FQ64OLJG.js.map} +1 -1
  312. package/dist/{plugin-store-WI4MZJLP.js → plugin-store-MPAMD5OT.js} +10 -10
  313. package/dist/{plugin-store-WI4MZJLP.js.map → plugin-store-MPAMD5OT.js.map} +1 -1
  314. package/dist/project-I6NX3NFB.js +41 -0
  315. package/dist/{project-WFUDVYNN.js.map → project-I6NX3NFB.js.map} +1 -1
  316. package/dist/resolver/index.js +9 -9
  317. package/dist/runner/index.js +40 -41
  318. package/dist/runner/src/context-usage/compose.d.ts.map +1 -1
  319. package/dist/runner/src/logging-bootstrap.d.ts +6 -0
  320. package/dist/runner/src/logging-bootstrap.d.ts.map +1 -1
  321. package/dist/runner/src/platform-blocks.d.ts +55 -0
  322. package/dist/runner/src/platform-blocks.d.ts.map +1 -0
  323. package/dist/runner/src/reconfigure-handler.d.ts +38 -17
  324. package/dist/runner/src/reconfigure-handler.d.ts.map +1 -1
  325. package/dist/runner/src/serve.d.ts.map +1 -1
  326. package/dist/runner/src/session-builder.d.ts.map +1 -1
  327. package/dist/runner/src/session-capability-wiring.d.ts +0 -2
  328. package/dist/runner/src/session-capability-wiring.d.ts.map +1 -1
  329. package/dist/sdk/asset-manager.js +15 -15
  330. package/dist/sdk/bridge.js +16 -17
  331. package/dist/sdk/client.js +1 -1
  332. package/dist/sdk/core.js +8 -8
  333. package/dist/sdk/flow.js +12 -12
  334. package/dist/sdk/index.js +69 -46
  335. package/dist/sdk/index.js.map +1 -1
  336. package/dist/sdk/resolver.js +9 -9
  337. package/dist/sdk/runner.js +40 -41
  338. package/dist/sdk/session.js +2 -2
  339. package/dist/sdk/src/agent-session.d.ts +8 -0
  340. package/dist/sdk/src/agent-session.d.ts.map +1 -1
  341. package/dist/sdk/store.js +2 -1
  342. package/dist/sdk/types.js +1 -1
  343. package/dist/session/index.js +2 -2
  344. package/dist/session/src/dispatcher.d.ts +25 -4
  345. package/dist/session/src/dispatcher.d.ts.map +1 -1
  346. package/dist/session/src/index.d.ts +1 -1
  347. package/dist/session/src/index.d.ts.map +1 -1
  348. package/dist/{setup-RAMLTORM.js → setup-B7JUHYJW.js} +26 -27
  349. package/dist/setup-B7JUHYJW.js.map +1 -0
  350. package/dist/skills-TVO26Y4V.js +26 -0
  351. package/dist/{skills-EOHZ2DZ4.js.map → skills-TVO26Y4V.js.map} +1 -1
  352. package/dist/source-PJBMDCKX.js +41 -0
  353. package/dist/{source-FYVSFYEI.js.map → source-PJBMDCKX.js.map} +1 -1
  354. package/dist/{source-manifest-publish-4FPIPPLV.js → source-manifest-publish-LLJWXGID.js} +27 -27
  355. package/dist/{source-manifest-publish-4FPIPPLV.js.map → source-manifest-publish-LLJWXGID.js.map} +1 -1
  356. package/dist/store/index.js +2 -1
  357. package/dist/store/src/store.d.ts +8 -5
  358. package/dist/store/src/store.d.ts.map +1 -1
  359. package/dist/tui/index.js +40 -41
  360. package/dist/tui/index.js.map +1 -1
  361. package/dist/types/index.js +1 -1
  362. package/dist/types/manifests.js +1 -1
  363. package/dist/types/src/ask-slots.d.ts +68 -0
  364. package/dist/types/src/ask-slots.d.ts.map +1 -0
  365. package/dist/types/src/delivery.d.ts.map +1 -1
  366. package/dist/types/src/events.d.ts +30 -2
  367. package/dist/types/src/events.d.ts.map +1 -1
  368. package/dist/types/src/index.d.ts +3 -3
  369. package/dist/types/src/index.d.ts.map +1 -1
  370. package/dist/types/src/manifests/index.d.ts +1 -1
  371. package/dist/types/src/manifests/index.d.ts.map +1 -1
  372. package/dist/types/src/manifests/preset.d.ts +4 -0
  373. package/dist/types/src/manifests/preset.d.ts.map +1 -1
  374. package/dist/types/src/protocol.d.ts +43 -1
  375. package/dist/types/src/protocol.d.ts.map +1 -1
  376. package/dist/types/src/version.d.ts +28 -1
  377. package/dist/types/src/version.d.ts.map +1 -1
  378. package/dist/workspace-plugin/adapters/mcp.js +32 -33
  379. package/dist/workspace-plugin/adapters/omp.js +14 -14
  380. package/dist/workspace-plugin/index.js +2 -2
  381. package/package.json +1 -1
  382. package/dist/asset-feeds-K36CR52Q.js.map +0 -1
  383. package/dist/chunk-47ZD34KB.js.map +0 -1
  384. package/dist/chunk-6C654TFI.js.map +0 -1
  385. package/dist/chunk-74EEFB52.js.map +0 -1
  386. package/dist/chunk-BTK7ECLH.js.map +0 -1
  387. package/dist/chunk-CWM3MYGX.js.map +0 -1
  388. package/dist/chunk-D5HOETOB.js.map +0 -1
  389. package/dist/chunk-DFFD4BFG.js.map +0 -1
  390. package/dist/chunk-DMLDYFDS.js.map +0 -1
  391. package/dist/chunk-EINLFFP6.js +0 -59
  392. package/dist/chunk-EINLFFP6.js.map +0 -1
  393. package/dist/chunk-EU3Q5AQ4.js.map +0 -1
  394. package/dist/chunk-FRHE7FFB.js.map +0 -1
  395. package/dist/chunk-G67BOI2J.js.map +0 -1
  396. package/dist/chunk-GIC3G5YG.js.map +0 -1
  397. package/dist/chunk-IZLQ4GDO.js.map +0 -1
  398. package/dist/chunk-JMKB7IB4.js.map +0 -1
  399. package/dist/chunk-LBQ4BBX4.js.map +0 -1
  400. package/dist/chunk-LCU5U5IW.js.map +0 -1
  401. package/dist/chunk-LXY4BUA3.js.map +0 -1
  402. package/dist/chunk-MKLBK7HI.js.map +0 -1
  403. package/dist/chunk-O7VPNKYN.js.map +0 -1
  404. package/dist/chunk-OJ4N4T4H.js.map +0 -1
  405. package/dist/chunk-OKGUDNDT.js.map +0 -1
  406. package/dist/chunk-QCI6D7E4.js.map +0 -1
  407. package/dist/chunk-SZWRPEF7.js.map +0 -1
  408. package/dist/chunk-TTPSDC2G.js.map +0 -1
  409. package/dist/chunk-VOOI7B2L.js.map +0 -1
  410. package/dist/chunk-XBSQ4KMC.js.map +0 -1
  411. package/dist/connectors-SSOTIDHT.js +0 -45
  412. package/dist/library-publish-FGXF5TJO.js.map +0 -1
  413. package/dist/open-library-P3D337NH.js +0 -40
  414. package/dist/open-registry-Z3P2X2AB.js +0 -32
  415. package/dist/paths-JKEKXM52.js +0 -22
  416. package/dist/project-WFUDVYNN.js +0 -41
  417. package/dist/setup-RAMLTORM.js.map +0 -1
  418. package/dist/skills-EOHZ2DZ4.js +0 -26
  419. package/dist/source-FYVSFYEI.js +0 -41
@@ -1 +1 @@
1
- {"version":3,"sources":["../core/src/runtime-assets.ts"],"names":["resolvePath","require"],"mappings":";;;;;;;;AAsDA,SAAS,sBACP,OAAA,EACmC;AACnC,EAAA,MAAM,aAAa,iBAAA,EAAkB;AACrC,EAAA,MAAM,M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M,IAAA,CAAK,GAAG,CAAA,8EAAA,CAAA;AAAA,EAC1C;AACA,EAAA,IAAI,KAAK,IAAA,EAAM;AACb,IAAA,OAAO,CAAA,YAAA,EAAe,IAAI,CAAA,kBAAA,EAAqB,IAAA,CAAK,IAAI,CAAA,CAAA;AAAA,EAC1D;AACA,EAAA,OAAO,eAAe,IAAI,CAAA,2BAAA,CAAA;AAC5B;AAEA,SAAS,gBAAA,CACP,SACA,KAAA,EACiC;AACjC,EAAA,IAAI,MAAM,IAAA,EAAM;AACd,IAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,IAAA,KAAS,KAAA,CAAM,IAAA,IAAQ,CAAA,CAAE,IAAA,KAAS,KAAA,CAAM,IAAI,CAAA;AAAA,EAC3E;AACA,EAAA,MAAM,OAAA,GAAU,QAAQ,MAAA,CAAO,CAAC,MAAM,CAAA,CAAE,IAAA,KAAS,MAAM,IAAI,CAAA;AAC3D,EAAA,IAAI,OAAA,CAAQ,MAAA,KAAW,CAAA,EAAG,OAAO,QAAQ,CAAC,CAAA;AAE1C,EAAA,OAAO,MAAA;AACT","file":"chunk-SWO25LTO.js","sourcesContent":["/**\n * Runtime asset resolution — read `skaile.yaml`, scan all declared repositories\n * (including the built-in `factory-assets/` directory as an implicit default),\n * and produce a unified view of connector catalog entries plus the implicit refs\n * that the `skaile.yaml` `connectors:` section adds to the dependency graph.\n *\n * This module is the single source of truth for \"which connectors does this\n * project see at runtime, and where do their implementations live on disk\".\n * Both the runner (serve, REPL, flow) and the platform's mid-session\n * `add_resource` flow consume `RuntimeAssetsResult.catalogEntries` and pass\n * it into `ConnectorManager` for catalog-based resolution.\n *\n * `factory-assets/` is the single first-party content tree (built-in connectors\n * + first-party skills + bundles) shipped inside the `@skaile/workspaces`\n * package — not a standalone package.\n *\n * It resolves to an **ordered list of roots** ({@link factoryAssetRoots}), not a\n * single dir. The bundled tree is always the baseline; an optional\n * `SKAILE_FACTORY_ASSETS_DIR` (legacy: `SKAILE_BASE_ASSETS_DIR`) is layered\n * **in front** as an additive override source — the agent container points it at\n * `/app/factory-assets/` (or a bind-mounted host dir) to ship updated skills /\n * flows / bundles / connector manifests without rebuilding the image. The two\n * roots resolve uniformly across every consumer (connector catalog scan, skill /\n * flow / completion discovery, the asset-manager factory source):\n * 1. `SKAILE_FACTORY_ASSETS_DIR` env dir, when set and existing (override layer).\n * 2. the bundled tree via {@link resolvePackagedAssetsDir} — the in-repo source\n * `packages/workspaces/factory-assets/` during dev, else the published\n * `dist/factory-assets/` after install (always-present baseline).\n *\n * Override semantics are **env-first**: on a name conflict the env root wins and\n * the bundled root fills the rest. Connector *code* still loads via the package's\n * static `exports` map, so the env root can override/add skills, flows, bundles,\n * and connector **manifests/metadata**, but cannot ship a new executable\n * connector — its `.js` is not on the package's import graph.\n */\n\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { lstat, stat } from \"node:fs/promises\";\nimport { createRequire } from \"node:module\";\nimport { dirname, join, resolve as resolvePath } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { tryWithFsDeadline } from \"./fs-deadline.js\";\nimport { scanDirectory } from \"./manifest.js\";\nimport type { CatalogEntry } from \"./models.js\";\nimport { getGlobalCacheDir, readLinks, sourceCacheKey } from \"./repo-manager.js\";\nimport type { SourceDeclaration, SourceEntry } from \"./workspace-config.js\";\nimport { resolveSkWorkspaceConfig } from \"./workspace-config.js\";\n\n/**\n * Map declared `sources[]` to internal `SourceDeclaration`s keyed by the\n * collision-free {@link sourceCacheKey} (`<host>/<owner>/<repo>`), pointing at\n * the unified machine-cache clone path (`getGlobalCacheDir()/<key>/`). Keyed by\n * the same function every other cache writer/reader uses so the path resolves.\n */\nfunction sourcesToDeclarations(\n sources: SourceEntry[] | undefined,\n): Record<string, SourceDeclaration> {\n const sourcesDir = getGlobalCacheDir();\n const out: Record<string, SourceDeclaration> = {};\n for (const s of sources ?? []) {\n const key = sourceCacheKey(s.url);\n if (out[key]) continue;\n out[key] = { path: join(sourcesDir, key), url: s.url, branch: s.pin };\n }\n return out;\n}\n\n// ─── Types ────────────────────────────────────────────────────────────────────\n\n/**\n * Catalog entry filtered to mount/connector kinds. Same shape as `CatalogEntry`.\n * @docLink packages/core/concepts#runtime-catalog-entry\n */\nexport type RuntimeCatalogEntry = CatalogEntry;\n\n/**\n * Implicit catalog reference derived from a `connectors:` declaration in `skaile.yaml`.\n * Each connector driver becomes an implicit ref that must be resolved in the catalog.\n * @docLink packages/core/concepts#runtime-asset-ref\n */\nexport interface RuntimeAssetRef {\n kind: \"connector\";\n /** Driver name — matches `RuntimeCatalogEntry.name`. */\n name: string;\n /** Source declaration id from `skaile.yaml`. */\n declarationId: string;\n}\n\n/**\n * Aggregated npm packages required by all resolved mount/connector adapters.\n * Populated from `metadata.npm_deps` in each matched catalog entry.\n * @docLink packages/core/concepts#runtime-npm-deps\n */\nexport interface RuntimeNpmDeps {\n required: string[];\n optional: string[];\n}\n\n/**\n * Non-fatal warning emitted during `resolveRuntimeAssets` when a repo is unavailable\n * or a driver is not found in any catalog.\n * @docLink packages/core/concepts#runtime-asset-warning\n */\nexport interface RuntimeAssetWarning {\n /** Stable code for filtering / structured logging. */\n code: \"missing_driver\" | \"repo_unavailable\" | \"invalid_repo_decl\";\n message: string;\n /** Declaration id when applicable. */\n declarationId?: string;\n /** Driver / repository name when applicable. */\n name?: string;\n}\n\n/**\n * Repository name used for the implicit built-in `factory-assets` catalog entry\n * (the in-package connector tree).\n * @docLink packages/core/concepts#factory-assets-repo-name\n */\nexport const FACTORY_ASSETS_REPO_NAME = \"factory-assets\";\n\n/**\n * Repository name for the optional `SKAILE_FACTORY_ASSETS_DIR` override layer,\n * scanned ahead of (and overriding) the bundled {@link FACTORY_ASSETS_REPO_NAME}.\n */\nconst FACTORY_ASSETS_OVERRIDE_REPO_NAME = \"factory-assets:override\";\n\n/**\n * Result of `resolveRuntimeAssets`.\n * The same object is mutated in place by `refresh()`, allowing callers to hold\n * a stable reference and observe updates after a new repository is cloned or\n * a driver is installed mid-session.\n * @docLink packages/core/concepts#runtime-assets-result\n */\nexport interface RuntimeAssetsResult {\n catalogEntries: RuntimeCatalogEntry[];\n implicitRefs: RuntimeAssetRef[];\n requiredNpmDeps: RuntimeNpmDeps;\n warnings: RuntimeAssetWarning[];\n /** Re-scan repositories and re-derive implicit refs. Mutates in place. */\n refresh(): Promise<void>;\n /**\n * Catalog lookup. When `kind` is omitted and multiple entries share the\n * `name`, returns `undefined` (caller must disambiguate).\n */\n findEntry(query: { kind?: \"connector\"; name: string }): RuntimeCatalogEntry | undefined;\n}\n\n// ─── Public API ───────────────────────────────────────────────────────────────\n\n/**\n * Resolve all runtime assets visible to a project by scanning declared repositories.\n *\n * Reads `skaile.yaml`, scans every declared repository (plus the implicit\n * built-in `factory-assets` repo), and derives implicit refs from `mounts:` /\n * `connectors:` declarations. Does not clone or install anything — purely a\n * read-only scan of what is already on disk. URL-only repositories that have\n * not been cloned yet are reported as `repo_unavailable` warnings.\n *\n * @param projectDir - Absolute path to the project workspace root\n * @returns `RuntimeAssetsResult` with catalog entries, implicit refs, npm deps, and warnings\n * @docLink packages/core/concepts#resolve-runtime-assets\n */\nexport async function resolveRuntimeAssets(projectDir: string): Promise<RuntimeAssetsResult> {\n const result: RuntimeAssetsResult = {\n catalogEntries: [],\n implicitRefs: [],\n requiredNpmDeps: { required: [], optional: [] },\n warnings: [],\n refresh: async () => {\n await populate(projectDir, result);\n },\n findEntry: (query) => findCatalogEntry(result.catalogEntries, query),\n };\n\n await populate(projectDir, result);\n return result;\n}\n\n/**\n * Resolve the ordered list of on-disk roots for the built-in `factory-assets`\n * tree (built-in connectors + first-party skills + bundles). This is the single\n * shared resolver every consumer goes through, so the env override and the\n * bundled baseline are honoured uniformly.\n *\n * Order (env-first = override-wins):\n * 1. `SKAILE_FACTORY_ASSETS_DIR` env dir (legacy: `SKAILE_BASE_ASSETS_DIR`),\n * when set and existing — an additive override layer.\n * 2. {@link resolvePackagedAssetsDir} — the bundled tree (in-repo source in dev,\n * `dist/factory-assets/` after install). Always-present baseline.\n *\n * Returns `[]` only when the package cannot be located at all. De-duplicated, so\n * pointing the env var at the bundled dir collapses to one root.\n *\n * @docLink packages/core/concepts#resolve-factory-assets-root\n */\nexport function factoryAssetRoots(): string[] {\n const roots: string[] = [];\n const envDir = process.env.SKAILE_FACTORY_ASSETS_DIR ?? process.env.SKAILE_BASE_ASSETS_DIR;\n // Deliberately still synchronous after #454: both candidates are\n // container-local (the image's `/app/factory-assets/`, or the installed\n // package tree resolved by `resolvePackagedAssetsDir`), never the FUSE\n // workspace mount. The mount-reachable probes on this module's scan path —\n // the project-relative `sources[].path` candidates in `resolveRepoDir` — are\n // async and deadline-bounded.\n if (envDir && existsSync(envDir)) roots.push(resolvePath(envDir));\n const bundled = resolvePackagedAssetsDir(\"factory-assets\");\n if (bundled) roots.push(bundled);\n return [...new Set(roots)];\n}\n\n/**\n * Resolve the primary on-disk root of the `factory-assets` tree — the first of\n * {@link factoryAssetRoots} (the env override when set, else the bundled tree).\n * Prefer {@link factoryAssetRoots} when you need to scan every layer; this\n * single-dir form is for callers that want one canonical path.\n *\n * @returns Absolute path to the highest-precedence `factory-assets` directory\n * @throws When no root can be located\n * @docLink packages/core/concepts#resolve-factory-assets-root\n */\nexport function resolveFactoryAssetsRoot(): string {\n const hit = resolveFactoryAssetsRootOrNull();\n if (hit) return hit;\n\n throw new Error(\n `Cannot resolve the factory-assets directory. ` +\n `Set SKAILE_FACTORY_ASSETS_DIR to the on-disk path, ` +\n `ensure @skaile/workspaces is installed, ` +\n `or run from within the @skaile/workspaces package tree.`,\n );\n}\n\n/**\n * Non-throwing variant of {@link resolveFactoryAssetsRoot}: the same\n * env-then-packaged resolution tiers, returning `null` instead of throwing when\n * none locate the directory. Callers that treat a missing factory tree as a\n * soft \"not present\" (e.g. the asset-manager's implicit-source injection) MUST\n * use this so they honour the `SKAILE_FACTORY_ASSETS_DIR` container override\n * identically to the runtime path.\n */\nexport function resolveFactoryAssetsRootOrNull(): string | null {\n return factoryAssetRoots()[0] ?? null;\n}\n\n/**\n * Resolve the `@skaile/workspaces` package root — the directory containing its\n * `package.json`. Tries `require.resolve` first (works when installed as a\n * dependency *and* in-repo via the self-reference), then walks upward from this\n * module looking for a `package.json` whose `name` is `@skaile/workspaces`\n * (bounded to 8 levels). Returns `null` when neither locates it.\n *\n * The single source of truth for finding content shipped inside the package —\n * the unified `factory-assets/` tree (built-in connectors + first-party skills\n * + bundles) resolves through {@link resolvePackagedAssetsDir} on top of this.\n *\n * Memoized: the package location is immutable for the process lifetime, but\n * this sits on the CLI hot path (every `findSkills` / flow / completion call\n * funnels through here), so the `require.resolve` + upward `package.json` walk\n * runs once. `undefined` = not yet computed.\n *\n * @docLink packages/core/concepts#resolve-factory-assets-root\n */\nlet workspacesPackageRootCache: string | null | undefined;\n\nexport function resolveWorkspacesPackageRoot(): string | null {\n if (workspacesPackageRootCache !== undefined) return workspacesPackageRootCache;\n workspacesPackageRootCache = computeWorkspacesPackageRoot();\n return workspacesPackageRootCache;\n}\n\nfunction computeWorkspacesPackageRoot(): string | null {\n try {\n const require = createRequire(import.meta.url);\n return dirname(require.resolve(\"@skaile/workspaces/package.json\"));\n } catch {\n // Fall through to the workspace walk.\n }\n let dir: string;\n try {\n dir = dirname(fileURLToPath(import.meta.url));\n } catch {\n return null;\n }\n for (let i = 0; i < 8; i++) {\n const pkgPath = join(dir, \"package.json\");\n if (existsSync(pkgPath)) {\n try {\n const pkg = JSON.parse(readFileSync(pkgPath, \"utf-8\")) as { name?: string };\n if (pkg.name === \"@skaile/workspaces\") return dir;\n } catch {\n // Ignore malformed package.json and keep walking.\n }\n }\n const parent = dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n return null;\n}\n\n/**\n * Locate a content-asset directory inside the package. Prefers the in-repo\n * **source** dir `<pkgRoot>/<subdir>` when present — in a dev checkout it is the\n * full tree (e.g. `factory-assets/` keeps the connector `.ts` entry files that\n * `dist/` does not) — then the published `dist/<subdir>` copy (what\n * `files: [\"dist\"]` ships, the only one present after `npm i`). Returns `null`\n * when neither exists.\n *\n * `factory-assets/` resolves to the source tree in dev (code + skills + bundles)\n * and to `dist/factory-assets` post-install (compiled connectors + copied\n * manifests/skills/bundles).\n *\n * @param subdir - `\"factory-assets\"` | …\n * @docLink packages/core/concepts#resolve-factory-assets-root\n */\nexport function resolvePackagedAssetsDir(subdir: string): string | null {\n const root = resolveWorkspacesPackageRoot();\n if (!root) return null;\n for (const cand of [join(root, subdir), join(root, \"dist\", subdir)]) {\n if (existsSync(cand)) return cand;\n }\n return null;\n}\n\n// ─── Internals ────────────────────────────────────────────────────────────────\n\nconst CONNECTOR_SCAN_KINDS: ReadonlySet<string> = new Set([\"connector\"]);\n\nasync function populate(projectDir: string, target: RuntimeAssetsResult): Promise<void> {\n target.catalogEntries = [];\n target.implicitRefs = [];\n target.requiredNpmDeps = { required: [], optional: [] };\n target.warnings = [];\n\n const config = resolveSkWorkspaceConfig(projectDir);\n // Connector catalog scan runs over the project's declared sources[] (resolved\n // to their machine-cache clone paths) plus the implicit factory-assets repo.\n const repositories = buildEffectiveRepositories(sourcesToDeclarations(config.sources));\n const links = readLinks(projectDir);\n\n // Scan each repository for connector entries.\n for (const [name, decl] of Object.entries(repositories)) {\n const repoDir = await resolveRepoDir(name, decl, projectDir, links);\n if (!repoDir) {\n target.warnings.push({\n code: \"repo_unavailable\",\n name,\n message: repoUnavailableMessage(name, decl),\n });\n continue;\n }\n try {\n // Both factory layers carry the same `factory-assets` provenance — the\n // override repo is an internal scan-order device, not a distinct source.\n const repoName = name === FACTORY_ASSETS_OVERRIDE_REPO_NAME ? FACTORY_ASSETS_REPO_NAME : name;\n // Only connector descriptors are consumed here, so only that kind is\n // \"known\": typed manifests of any other kind are irrelevant to this scan.\n const scanned = await scanDirectory(repoDir, repoName, {\n knownKinds: CONNECTOR_SCAN_KINDS,\n onDiagnostic: () => {},\n });\n const entries = scanned.filter((e) => e.kind === \"connector\");\n target.catalogEntries.push(...entries);\n } catch (err) {\n target.warnings.push({\n code: \"repo_unavailable\",\n name,\n message: `Failed to scan repository \"${name}\" at ${repoDir}: ${\n err instanceof Error ? err.message : String(err)\n }`,\n });\n }\n }\n\n // De-duplicate by (kind, name), keeping the first occurrence. Scan order is\n // declared sources → env override → bundled baseline, so an env-supplied\n // connector manifest overrides the bundled one and the bundled one fills the\n // rest (the override layer can refresh built-in manifests in place).\n const seen = new Set<string>();\n target.catalogEntries = target.catalogEntries.filter((e) => {\n const key = `${e.kind}:${e.name}`;\n if (seen.has(key)) return false;\n seen.add(key);\n return true;\n });\n\n // Derive implicit refs from skaile.yaml connectors.\n for (const c of config.connectors ?? []) {\n target.implicitRefs.push({ kind: \"connector\", name: c.driver, declarationId: c.id });\n }\n\n // Validate refs and aggregate npm deps.\n const requiredSet = new Set<string>();\n const optionalSet = new Set<string>();\n for (const ref of target.implicitRefs) {\n const entry = findCatalogEntry(target.catalogEntries, ref);\n if (!entry) {\n target.warnings.push({\n code: \"missing_driver\",\n declarationId: ref.declarationId,\n name: ref.name,\n message:\n `Unknown ${ref.kind} driver \"${ref.name}\" referenced by ${ref.kind} \"${ref.declarationId}\". ` +\n `Run \\`skaile ${ref.kind} catalog\\` to see available drivers, ` +\n `or declare a repository in skaile.yaml that provides this driver.`,\n });\n continue;\n }\n const npm = (entry.metadata?.npm_deps ?? {}) as { required?: string[]; optional?: string[] };\n for (const p of npm.required ?? []) requiredSet.add(p);\n for (const p of npm.optional ?? []) optionalSet.add(p);\n }\n target.requiredNpmDeps.required = [...requiredSet];\n target.requiredNpmDeps.optional = [...optionalSet];\n}\n\n/**\n * Build the effective `repositories` map: caller's declarations first, then the\n * implicit built-in `factory-assets` repos. Each {@link factoryAssetRoots} layer\n * becomes its own repo, the env override inserted **before** the bundled\n * baseline so its connector entries win on the first-match dedup downstream.\n * When the package cannot be located at all, a path-less sentinel under\n * {@link FACTORY_ASSETS_REPO_NAME} drives the `repo_unavailable` warning.\n */\nfunction buildEffectiveRepositories(\n declared: Record<string, SourceDeclaration> | undefined,\n): Record<string, SourceDeclaration> {\n const result: Record<string, SourceDeclaration> = { ...(declared ?? {}) };\n const roots = factoryAssetRoots();\n if (roots.length === 0) {\n // Surface as a warning during scan rather than throwing here — let the\n // caller decide whether factory-assets is required. resolveRepoDir() /\n // repoUnavailableMessage re-discover the failure and emit it.\n if (!result[FACTORY_ASSETS_REPO_NAME]) result[FACTORY_ASSETS_REPO_NAME] = { path: \"\" };\n return result;\n }\n // override-first when both layers exist, so the env root's entries are scanned\n // (and matched) ahead of the bundled baseline.\n const keys =\n roots.length > 1\n ? [FACTORY_ASSETS_OVERRIDE_REPO_NAME, FACTORY_ASSETS_REPO_NAME]\n : [FACTORY_ASSETS_REPO_NAME];\n roots.forEach((dir, i) => {\n const key = keys[i] ?? `${FACTORY_ASSETS_REPO_NAME}:${i}`;\n if (!result[key]) result[key] = { path: dir };\n });\n return result;\n}\n\n/**\n * Resolve a repository declaration to an on-disk directory. Order:\n * 1. Linked override (`.skaile/links.yaml`).\n * 2. Local `path` — relative to `projectDir`.\n * 3. Cloned URL repo at `.skaile/cache/sources/<name>/` (must already exist).\n *\n * Returns `null` when none of these resolve. Does not clone.\n *\n * **Async and deadline-bounded since #454.** Every candidate here is a\n * project-relative or operator-supplied path, so a `sources[].path` of\n * `workspace/my-assets` resolves onto the rclone FUSE mount — the same tree the\n * scan that follows walks. Probing it with `existsSync`/`lstatSync` would park\n * the `skaile serve` event loop *before* the (now async) scan ever ran, which\n * would leave the H2 fix meaningless on the very declaration that triggers it.\n * A probe that misses its deadline reads as \"unavailable\", which is what the\n * caller already does with an absent path — it becomes a `repo_unavailable`\n * warning rather than a stall.\n */\nasync function resolveRepoDir(\n name: string,\n decl: SourceDeclaration,\n projectDir: string,\n links: Record<string, string>,\n): Promise<string | null> {\n // 1. Linked override\n const linked = links[name];\n if (linked && (await pathExists(linked))) return linked;\n\n // 2. Local path\n if (decl.path) {\n const resolved = resolvePath(projectDir, decl.path);\n return (await pathExists(resolved)) ? resolved : null;\n }\n\n // 3. URL repo cloned to project's .skaile/cache/sources/<name> — the\n // project-local clone dir (often a symlink into the global cache, which\n // lives at getGlobalCacheDir()); NOT the global clone root itself.\n if (decl.url) {\n const projectDest = join(projectDir, \".skaile\", \"cache\", \"sources\", name);\n // One `lstat` answers both questions the pre-#454 `existsSync` + `lstatSync`\n // pair asked, and `lstat` (not `stat`) keeps the \"a symlink into the global\n // cache counts\" behaviour intact.\n const found = await tryWithFsDeadline(\n `lstat ${projectDest}`,\n async () => {\n await lstat(projectDest);\n return true;\n },\n false,\n );\n return found ? projectDest : null;\n }\n\n return null;\n}\n\n/** Deadline-bounded `existsSync` replacement — a wedged mount reads as absent. */\nfunction pathExists(path: string): Promise<boolean> {\n return tryWithFsDeadline(\n `stat ${path}`,\n async () => {\n await stat(path);\n return true;\n },\n false,\n );\n}\n\nfunction repoUnavailableMessage(name: string, decl: SourceDeclaration): string {\n if (name === FACTORY_ASSETS_REPO_NAME && !decl.path && !decl.url) {\n return (\n `Cannot resolve the built-in factory-assets. ` +\n `Set SKAILE_FACTORY_ASSETS_DIR or ensure @skaile/workspaces is installed.`\n );\n }\n if (decl.url) {\n return `Repository \"${name}\" (${decl.url}) is not available. Register it as a Library Source via \\`skaile source add\\`.`;\n }\n if (decl.path) {\n return `Repository \"${name}\" path not found: ${decl.path}`;\n }\n return `Repository \"${name}\" has neither url nor path.`;\n}\n\nfunction findCatalogEntry(\n entries: RuntimeCatalogEntry[],\n query: { kind?: \"connector\"; name: string },\n): RuntimeCatalogEntry | undefined {\n if (query.kind) {\n return entries.find((e) => e.kind === query.kind && e.name === query.name);\n }\n const matches = entries.filter((e) => e.name === query.name);\n if (matches.length === 1) return matches[0];\n // 0 or >1 with no kind — caller must disambiguate.\n return undefined;\n}\n"]}
1
+ {"version":3,"sources":["../core/src/runtime-assets.ts"],"names":["resolvePath","require"],"mappings":";;;;;;;;AAsDA,SAAS,sBACP,OAAA,EACmC;AACnC,EAAA,MAAM,aA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AA,YAAA,EAAe,IAAI,CAAA,GAAA,EAAM,IAAA,CAAK,GAAG,CAAA,8EAAA,CAAA;AAAA,EAC1C;AACA,EAAA,IAAI,KAAK,IAAA,EAAM;AACb,IAAA,OAAO,CAAA,YAAA,EAAe,IAAI,CAAA,kBAAA,EAAqB,IAAA,CAAK,IAAI,CAAA,CAAA;AAAA,EAC1D;AACA,EAAA,OAAO,eAAe,IAAI,CAAA,2BAAA,CAAA;AAC5B;AAEA,SAAS,gBAAA,CACP,SACA,KAAA,EACiC;AACjC,EAAA,IAAI,MAAM,IAAA,EAAM;AACd,IAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,IAAA,KAAS,KAAA,CAAM,IAAA,IAAQ,CAAA,CAAE,IAAA,KAAS,KAAA,CAAM,IAAI,CAAA;AAAA,EAC3E;AACA,EAAA,MAAM,OAAA,GAAU,QAAQ,MAAA,CAAO,CAAC,MAAM,CAAA,CAAE,IAAA,KAAS,MAAM,IAAI,CAAA;AAC3D,EAAA,IAAI,OAAA,CAAQ,MAAA,KAAW,CAAA,EAAG,OAAO,QAAQ,CAAC,CAAA;AAE1C,EAAA,OAAO,MAAA;AACT","file":"chunk-GB7WDMH2.js","sourcesContent":["/**\n * Runtime asset resolution — read `skaile.yaml`, scan all declared repositories\n * (including the built-in `factory-assets/` directory as an implicit default),\n * and produce a unified view of connector catalog entries plus the implicit refs\n * that the `skaile.yaml` `connectors:` section adds to the dependency graph.\n *\n * This module is the single source of truth for \"which connectors does this\n * project see at runtime, and where do their implementations live on disk\".\n * Both the runner (serve, REPL, flow) and the platform's mid-session\n * `add_resource` flow consume `RuntimeAssetsResult.catalogEntries` and pass\n * it into `ConnectorManager` for catalog-based resolution.\n *\n * `factory-assets/` is the single first-party content tree (built-in connectors\n * + first-party skills + bundles) shipped inside the `@skaile/workspaces`\n * package — not a standalone package.\n *\n * It resolves to an **ordered list of roots** ({@link factoryAssetRoots}), not a\n * single dir. The bundled tree is always the baseline; an optional\n * `SKAILE_FACTORY_ASSETS_DIR` (legacy: `SKAILE_BASE_ASSETS_DIR`) is layered\n * **in front** as an additive override source — the agent container points it at\n * `/app/factory-assets/` (or a bind-mounted host dir) to ship updated skills /\n * flows / bundles / connector manifests without rebuilding the image. The two\n * roots resolve uniformly across every consumer (connector catalog scan, skill /\n * flow / completion discovery, the asset-manager factory source):\n * 1. `SKAILE_FACTORY_ASSETS_DIR` env dir, when set and existing (override layer).\n * 2. the bundled tree via {@link resolvePackagedAssetsDir} — the in-repo source\n * `packages/workspaces/factory-assets/` during dev, else the published\n * `dist/factory-assets/` after install (always-present baseline).\n *\n * Override semantics are **env-first**: on a name conflict the env root wins and\n * the bundled root fills the rest. Connector *code* still loads via the package's\n * static `exports` map, so the env root can override/add skills, flows, bundles,\n * and connector **manifests/metadata**, but cannot ship a new executable\n * connector — its `.js` is not on the package's import graph.\n */\n\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { lstat, stat } from \"node:fs/promises\";\nimport { createRequire } from \"node:module\";\nimport { dirname, join, resolve as resolvePath } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { tryWithFsDeadline } from \"./fs-deadline.js\";\nimport { scanDirectory } from \"./manifest.js\";\nimport type { CatalogEntry } from \"./models.js\";\nimport { getGlobalCacheDir, readLinks, sourceCacheKey } from \"./repo-manager.js\";\nimport type { SourceDeclaration, SourceEntry } from \"./workspace-config.js\";\nimport { resolveSkWorkspaceConfig } from \"./workspace-config.js\";\n\n/**\n * Map declared `sources[]` to internal `SourceDeclaration`s keyed by the\n * collision-free {@link sourceCacheKey} (`<host>/<owner>/<repo>`), pointing at\n * the unified machine-cache clone path (`getGlobalCacheDir()/<key>/`). Keyed by\n * the same function every other cache writer/reader uses so the path resolves.\n */\nfunction sourcesToDeclarations(\n sources: SourceEntry[] | undefined,\n): Record<string, SourceDeclaration> {\n const sourcesDir = getGlobalCacheDir();\n const out: Record<string, SourceDeclaration> = {};\n for (const s of sources ?? []) {\n const key = sourceCacheKey(s.url);\n if (out[key]) continue;\n out[key] = { path: join(sourcesDir, key), url: s.url, branch: s.pin };\n }\n return out;\n}\n\n// ─── Types ────────────────────────────────────────────────────────────────────\n\n/**\n * Catalog entry filtered to mount/connector kinds. Same shape as `CatalogEntry`.\n * @docLink packages/core/concepts#runtime-catalog-entry\n */\nexport type RuntimeCatalogEntry = CatalogEntry;\n\n/**\n * Implicit catalog reference derived from a `connectors:` declaration in `skaile.yaml`.\n * Each connector driver becomes an implicit ref that must be resolved in the catalog.\n * @docLink packages/core/concepts#runtime-asset-ref\n */\nexport interface RuntimeAssetRef {\n kind: \"connector\";\n /** Driver name — matches `RuntimeCatalogEntry.name`. */\n name: string;\n /** Source declaration id from `skaile.yaml`. */\n declarationId: string;\n}\n\n/**\n * Aggregated npm packages required by all resolved mount/connector adapters.\n * Populated from `metadata.npm_deps` in each matched catalog entry.\n * @docLink packages/core/concepts#runtime-npm-deps\n */\nexport interface RuntimeNpmDeps {\n required: string[];\n optional: string[];\n}\n\n/**\n * Non-fatal warning emitted during `resolveRuntimeAssets` when a repo is unavailable\n * or a driver is not found in any catalog.\n * @docLink packages/core/concepts#runtime-asset-warning\n */\nexport interface RuntimeAssetWarning {\n /** Stable code for filtering / structured logging. */\n code: \"missing_driver\" | \"repo_unavailable\" | \"invalid_repo_decl\";\n message: string;\n /** Declaration id when applicable. */\n declarationId?: string;\n /** Driver / repository name when applicable. */\n name?: string;\n}\n\n/**\n * Repository name used for the implicit built-in `factory-assets` catalog entry\n * (the in-package connector tree).\n * @docLink packages/core/concepts#factory-assets-repo-name\n */\nexport const FACTORY_ASSETS_REPO_NAME = \"factory-assets\";\n\n/**\n * Repository name for the optional `SKAILE_FACTORY_ASSETS_DIR` override layer,\n * scanned ahead of (and overriding) the bundled {@link FACTORY_ASSETS_REPO_NAME}.\n */\nconst FACTORY_ASSETS_OVERRIDE_REPO_NAME = \"factory-assets:override\";\n\n/**\n * Result of `resolveRuntimeAssets`.\n * The same object is mutated in place by `refresh()`, allowing callers to hold\n * a stable reference and observe updates after a new repository is cloned or\n * a driver is installed mid-session.\n * @docLink packages/core/concepts#runtime-assets-result\n */\nexport interface RuntimeAssetsResult {\n catalogEntries: RuntimeCatalogEntry[];\n implicitRefs: RuntimeAssetRef[];\n requiredNpmDeps: RuntimeNpmDeps;\n warnings: RuntimeAssetWarning[];\n /** Re-scan repositories and re-derive implicit refs. Mutates in place. */\n refresh(): Promise<void>;\n /**\n * Catalog lookup. When `kind` is omitted and multiple entries share the\n * `name`, returns `undefined` (caller must disambiguate).\n */\n findEntry(query: { kind?: \"connector\"; name: string }): RuntimeCatalogEntry | undefined;\n}\n\n// ─── Public API ───────────────────────────────────────────────────────────────\n\n/**\n * Resolve all runtime assets visible to a project by scanning declared repositories.\n *\n * Reads `skaile.yaml`, scans every declared repository (plus the implicit\n * built-in `factory-assets` repo), and derives implicit refs from `mounts:` /\n * `connectors:` declarations. Does not clone or install anything — purely a\n * read-only scan of what is already on disk. URL-only repositories that have\n * not been cloned yet are reported as `repo_unavailable` warnings.\n *\n * @param projectDir - Absolute path to the project workspace root\n * @returns `RuntimeAssetsResult` with catalog entries, implicit refs, npm deps, and warnings\n * @docLink packages/core/concepts#resolve-runtime-assets\n */\nexport async function resolveRuntimeAssets(projectDir: string): Promise<RuntimeAssetsResult> {\n const result: RuntimeAssetsResult = {\n catalogEntries: [],\n implicitRefs: [],\n requiredNpmDeps: { required: [], optional: [] },\n warnings: [],\n refresh: async () => {\n await populate(projectDir, result);\n },\n findEntry: (query) => findCatalogEntry(result.catalogEntries, query),\n };\n\n await populate(projectDir, result);\n return result;\n}\n\n/**\n * Resolve the ordered list of on-disk roots for the built-in `factory-assets`\n * tree (built-in connectors + first-party skills + bundles). This is the single\n * shared resolver every consumer goes through, so the env override and the\n * bundled baseline are honoured uniformly.\n *\n * Order (env-first = override-wins):\n * 1. `SKAILE_FACTORY_ASSETS_DIR` env dir (legacy: `SKAILE_BASE_ASSETS_DIR`),\n * when set and existing — an additive override layer.\n * 2. {@link resolvePackagedAssetsDir} — the bundled tree (in-repo source in dev,\n * `dist/factory-assets/` after install). Always-present baseline.\n *\n * Returns `[]` only when the package cannot be located at all. De-duplicated, so\n * pointing the env var at the bundled dir collapses to one root.\n *\n * @docLink packages/core/concepts#resolve-factory-assets-root\n */\nexport function factoryAssetRoots(): string[] {\n const roots: string[] = [];\n const envDir = process.env.SKAILE_FACTORY_ASSETS_DIR ?? process.env.SKAILE_BASE_ASSETS_DIR;\n // Deliberately still synchronous after #454: both candidates are\n // container-local (the image's `/app/factory-assets/`, or the installed\n // package tree resolved by `resolvePackagedAssetsDir`), never the FUSE\n // workspace mount. The mount-reachable probes on this module's scan path —\n // the project-relative `sources[].path` candidates in `resolveRepoDir` — are\n // async and deadline-bounded.\n if (envDir && existsSync(envDir)) roots.push(resolvePath(envDir));\n const bundled = resolvePackagedAssetsDir(\"factory-assets\");\n if (bundled) roots.push(bundled);\n return [...new Set(roots)];\n}\n\n/**\n * Resolve the primary on-disk root of the `factory-assets` tree — the first of\n * {@link factoryAssetRoots} (the env override when set, else the bundled tree).\n * Prefer {@link factoryAssetRoots} when you need to scan every layer; this\n * single-dir form is for callers that want one canonical path.\n *\n * @returns Absolute path to the highest-precedence `factory-assets` directory\n * @throws When no root can be located\n * @docLink packages/core/concepts#resolve-factory-assets-root\n */\nexport function resolveFactoryAssetsRoot(): string {\n const hit = resolveFactoryAssetsRootOrNull();\n if (hit) return hit;\n\n throw new Error(\n `Cannot resolve the factory-assets directory. ` +\n `Set SKAILE_FACTORY_ASSETS_DIR to the on-disk path, ` +\n `ensure @skaile/workspaces is installed, ` +\n `or run from within the @skaile/workspaces package tree.`,\n );\n}\n\n/**\n * Non-throwing variant of {@link resolveFactoryAssetsRoot}: the same\n * env-then-packaged resolution tiers, returning `null` instead of throwing when\n * none locate the directory. Callers that treat a missing factory tree as a\n * soft \"not present\" (e.g. the asset-manager's implicit-source injection) MUST\n * use this so they honour the `SKAILE_FACTORY_ASSETS_DIR` container override\n * identically to the runtime path.\n */\nexport function resolveFactoryAssetsRootOrNull(): string | null {\n return factoryAssetRoots()[0] ?? null;\n}\n\n/**\n * Resolve the `@skaile/workspaces` package root — the directory containing its\n * `package.json`. Tries `require.resolve` first (works when installed as a\n * dependency *and* in-repo via the self-reference), then walks upward from this\n * module looking for a `package.json` whose `name` is `@skaile/workspaces`\n * (bounded to 8 levels). Returns `null` when neither locates it.\n *\n * The single source of truth for finding content shipped inside the package —\n * the unified `factory-assets/` tree (built-in connectors + first-party skills\n * + bundles) resolves through {@link resolvePackagedAssetsDir} on top of this.\n *\n * Memoized: the package location is immutable for the process lifetime, but\n * this sits on the CLI hot path (every `findSkills` / flow / completion call\n * funnels through here), so the `require.resolve` + upward `package.json` walk\n * runs once. `undefined` = not yet computed.\n *\n * @docLink packages/core/concepts#resolve-factory-assets-root\n */\nlet workspacesPackageRootCache: string | null | undefined;\n\nexport function resolveWorkspacesPackageRoot(): string | null {\n if (workspacesPackageRootCache !== undefined) return workspacesPackageRootCache;\n workspacesPackageRootCache = computeWorkspacesPackageRoot();\n return workspacesPackageRootCache;\n}\n\nfunction computeWorkspacesPackageRoot(): string | null {\n try {\n const require = createRequire(import.meta.url);\n return dirname(require.resolve(\"@skaile/workspaces/package.json\"));\n } catch {\n // Fall through to the workspace walk.\n }\n let dir: string;\n try {\n dir = dirname(fileURLToPath(import.meta.url));\n } catch {\n return null;\n }\n for (let i = 0; i < 8; i++) {\n const pkgPath = join(dir, \"package.json\");\n if (existsSync(pkgPath)) {\n try {\n const pkg = JSON.parse(readFileSync(pkgPath, \"utf-8\")) as { name?: string };\n if (pkg.name === \"@skaile/workspaces\") return dir;\n } catch {\n // Ignore malformed package.json and keep walking.\n }\n }\n const parent = dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n return null;\n}\n\n/**\n * Locate a content-asset directory inside the package. Prefers the in-repo\n * **source** dir `<pkgRoot>/<subdir>` when present — in a dev checkout it is the\n * full tree (e.g. `factory-assets/` keeps the connector `.ts` entry files that\n * `dist/` does not) — then the published `dist/<subdir>` copy (what\n * `files: [\"dist\"]` ships, the only one present after `npm i`). Returns `null`\n * when neither exists.\n *\n * `factory-assets/` resolves to the source tree in dev (code + skills + bundles)\n * and to `dist/factory-assets` post-install (compiled connectors + copied\n * manifests/skills/bundles).\n *\n * @param subdir - `\"factory-assets\"` | …\n * @docLink packages/core/concepts#resolve-factory-assets-root\n */\nexport function resolvePackagedAssetsDir(subdir: string): string | null {\n const root = resolveWorkspacesPackageRoot();\n if (!root) return null;\n for (const cand of [join(root, subdir), join(root, \"dist\", subdir)]) {\n if (existsSync(cand)) return cand;\n }\n return null;\n}\n\n// ─── Internals ────────────────────────────────────────────────────────────────\n\nconst CONNECTOR_SCAN_KINDS: ReadonlySet<string> = new Set([\"connector\"]);\n\nasync function populate(projectDir: string, target: RuntimeAssetsResult): Promise<void> {\n target.catalogEntries = [];\n target.implicitRefs = [];\n target.requiredNpmDeps = { required: [], optional: [] };\n target.warnings = [];\n\n const config = resolveSkWorkspaceConfig(projectDir);\n // Connector catalog scan runs over the project's declared sources[] (resolved\n // to their machine-cache clone paths) plus the implicit factory-assets repo.\n const repositories = buildEffectiveRepositories(sourcesToDeclarations(config.sources));\n const links = readLinks(projectDir);\n\n // Scan each repository for connector entries.\n for (const [name, decl] of Object.entries(repositories)) {\n const repoDir = await resolveRepoDir(name, decl, projectDir, links);\n if (!repoDir) {\n target.warnings.push({\n code: \"repo_unavailable\",\n name,\n message: repoUnavailableMessage(name, decl),\n });\n continue;\n }\n try {\n // Both factory layers carry the same `factory-assets` provenance — the\n // override repo is an internal scan-order device, not a distinct source.\n const repoName = name === FACTORY_ASSETS_OVERRIDE_REPO_NAME ? FACTORY_ASSETS_REPO_NAME : name;\n // Only connector descriptors are consumed here, so only that kind is\n // \"known\": typed manifests of any other kind are irrelevant to this scan.\n const scanned = await scanDirectory(repoDir, repoName, {\n knownKinds: CONNECTOR_SCAN_KINDS,\n onDiagnostic: () => {},\n });\n const entries = scanned.filter((e) => e.kind === \"connector\");\n target.catalogEntries.push(...entries);\n } catch (err) {\n target.warnings.push({\n code: \"repo_unavailable\",\n name,\n message: `Failed to scan repository \"${name}\" at ${repoDir}: ${\n err instanceof Error ? err.message : String(err)\n }`,\n });\n }\n }\n\n // De-duplicate by (kind, name), keeping the first occurrence. Scan order is\n // declared sources → env override → bundled baseline, so an env-supplied\n // connector manifest overrides the bundled one and the bundled one fills the\n // rest (the override layer can refresh built-in manifests in place).\n const seen = new Set<string>();\n target.catalogEntries = target.catalogEntries.filter((e) => {\n const key = `${e.kind}:${e.name}`;\n if (seen.has(key)) return false;\n seen.add(key);\n return true;\n });\n\n // Derive implicit refs from skaile.yaml connectors.\n for (const c of config.connectors ?? []) {\n target.implicitRefs.push({ kind: \"connector\", name: c.driver, declarationId: c.id });\n }\n\n // Validate refs and aggregate npm deps.\n const requiredSet = new Set<string>();\n const optionalSet = new Set<string>();\n for (const ref of target.implicitRefs) {\n const entry = findCatalogEntry(target.catalogEntries, ref);\n if (!entry) {\n target.warnings.push({\n code: \"missing_driver\",\n declarationId: ref.declarationId,\n name: ref.name,\n message:\n `Unknown ${ref.kind} driver \"${ref.name}\" referenced by ${ref.kind} \"${ref.declarationId}\". ` +\n `Run \\`skaile ${ref.kind} catalog\\` to see available drivers, ` +\n `or declare a repository in skaile.yaml that provides this driver.`,\n });\n continue;\n }\n const npm = (entry.metadata?.npm_deps ?? {}) as { required?: string[]; optional?: string[] };\n for (const p of npm.required ?? []) requiredSet.add(p);\n for (const p of npm.optional ?? []) optionalSet.add(p);\n }\n target.requiredNpmDeps.required = [...requiredSet];\n target.requiredNpmDeps.optional = [...optionalSet];\n}\n\n/**\n * Build the effective `repositories` map: caller's declarations first, then the\n * implicit built-in `factory-assets` repos. Each {@link factoryAssetRoots} layer\n * becomes its own repo, the env override inserted **before** the bundled\n * baseline so its connector entries win on the first-match dedup downstream.\n * When the package cannot be located at all, a path-less sentinel under\n * {@link FACTORY_ASSETS_REPO_NAME} drives the `repo_unavailable` warning.\n */\nfunction buildEffectiveRepositories(\n declared: Record<string, SourceDeclaration> | undefined,\n): Record<string, SourceDeclaration> {\n const result: Record<string, SourceDeclaration> = { ...(declared ?? {}) };\n const roots = factoryAssetRoots();\n if (roots.length === 0) {\n // Surface as a warning during scan rather than throwing here — let the\n // caller decide whether factory-assets is required. resolveRepoDir() /\n // repoUnavailableMessage re-discover the failure and emit it.\n if (!result[FACTORY_ASSETS_REPO_NAME]) result[FACTORY_ASSETS_REPO_NAME] = { path: \"\" };\n return result;\n }\n // override-first when both layers exist, so the env root's entries are scanned\n // (and matched) ahead of the bundled baseline.\n const keys =\n roots.length > 1\n ? [FACTORY_ASSETS_OVERRIDE_REPO_NAME, FACTORY_ASSETS_REPO_NAME]\n : [FACTORY_ASSETS_REPO_NAME];\n roots.forEach((dir, i) => {\n const key = keys[i] ?? `${FACTORY_ASSETS_REPO_NAME}:${i}`;\n if (!result[key]) result[key] = { path: dir };\n });\n return result;\n}\n\n/**\n * Resolve a repository declaration to an on-disk directory. Order:\n * 1. Linked override (`.skaile/links.yaml`).\n * 2. Local `path` — relative to `projectDir`.\n * 3. Cloned URL repo at `.skaile/cache/sources/<name>/` (must already exist).\n *\n * Returns `null` when none of these resolve. Does not clone.\n *\n * **Async and deadline-bounded since #454.** Every candidate here is a\n * project-relative or operator-supplied path, so a `sources[].path` of\n * `workspace/my-assets` resolves onto the rclone FUSE mount — the same tree the\n * scan that follows walks. Probing it with `existsSync`/`lstatSync` would park\n * the `skaile serve` event loop *before* the (now async) scan ever ran, which\n * would leave the H2 fix meaningless on the very declaration that triggers it.\n * A probe that misses its deadline reads as \"unavailable\", which is what the\n * caller already does with an absent path — it becomes a `repo_unavailable`\n * warning rather than a stall.\n */\nasync function resolveRepoDir(\n name: string,\n decl: SourceDeclaration,\n projectDir: string,\n links: Record<string, string>,\n): Promise<string | null> {\n // 1. Linked override\n const linked = links[name];\n if (linked && (await pathExists(linked))) return linked;\n\n // 2. Local path\n if (decl.path) {\n const resolved = resolvePath(projectDir, decl.path);\n return (await pathExists(resolved)) ? resolved : null;\n }\n\n // 3. URL repo cloned to project's .skaile/cache/sources/<name> — the\n // project-local clone dir (often a symlink into the global cache, which\n // lives at getGlobalCacheDir()); NOT the global clone root itself.\n if (decl.url) {\n const projectDest = join(projectDir, \".skaile\", \"cache\", \"sources\", name);\n // One `lstat` answers both questions the pre-#454 `existsSync` + `lstatSync`\n // pair asked, and `lstat` (not `stat`) keeps the \"a symlink into the global\n // cache counts\" behaviour intact.\n const found = await tryWithFsDeadline(\n `lstat ${projectDest}`,\n async () => {\n await lstat(projectDest);\n return true;\n },\n false,\n );\n return found ? projectDest : null;\n }\n\n return null;\n}\n\n/** Deadline-bounded `existsSync` replacement — a wedged mount reads as absent. */\nfunction pathExists(path: string): Promise<boolean> {\n return tryWithFsDeadline(\n `stat ${path}`,\n async () => {\n await stat(path);\n return true;\n },\n false,\n );\n}\n\nfunction repoUnavailableMessage(name: string, decl: SourceDeclaration): string {\n if (name === FACTORY_ASSETS_REPO_NAME && !decl.path && !decl.url) {\n return (\n `Cannot resolve the built-in factory-assets. ` +\n `Set SKAILE_FACTORY_ASSETS_DIR or ensure @skaile/workspaces is installed.`\n );\n }\n if (decl.url) {\n return `Repository \"${name}\" (${decl.url}) is not available. Register it as a Library Source via \\`skaile source add\\`.`;\n }\n if (decl.path) {\n return `Repository \"${name}\" path not found: ${decl.path}`;\n }\n return `Repository \"${name}\" has neither url nor path.`;\n}\n\nfunction findCatalogEntry(\n entries: RuntimeCatalogEntry[],\n query: { kind?: \"connector\"; name: string },\n): RuntimeCatalogEntry | undefined {\n if (query.kind) {\n return entries.find((e) => e.kind === query.kind && e.name === query.name);\n }\n const matches = entries.filter((e) => e.name === query.name);\n if (matches.length === 1) return matches[0];\n // 0 or >1 with no kind — caller must disambiguate.\n return undefined;\n}\n"]}
@@ -1,11 +1,11 @@
1
1
  import { createSpinner } from './chunk-NESV47MF.js';
2
- import { logInfo, logWarn, TARGET_DEFAULT_HINT, logErr, logOk, colorRef, S, deferredWarnings, warnLegacyClaudeCopies, formatSoftDepHint } from './chunk-THEJJBOU.js';
3
- import { getKindRegistry } from './chunk-WIEC3ZE4.js';
4
- import { AssetManager } from './chunk-D5HOETOB.js';
5
- import { readLock } from './chunk-OOLT6HGP.js';
2
+ import { logInfo, logWarn, TARGET_DEFAULT_HINT, logErr, logOk, colorRef, S, deferredWarnings, warnLegacyClaudeCopies, formatSoftDepHint } from './chunk-JZ5EHBPI.js';
3
+ import { getKindRegistry } from './chunk-2FRUUDZY.js';
4
+ import { AssetManager } from './chunk-IMKSM5NL.js';
5
+ import { readLock } from './chunk-36AFURKZ.js';
6
6
  import { userConfigPath } from './chunk-L5VSIPQD.js';
7
7
  import { SUPPORTED_DRIVER_TARGETS } from './chunk-CPSIPIX7.js';
8
- import { parseAssetRef } from './chunk-O7VPNKYN.js';
8
+ import { parseAssetRef } from './chunk-QVNRCDTV.js';
9
9
  import path from 'path';
10
10
  import * as p from '@clack/prompts';
11
11
  import { Command } from 'commander';
@@ -58,6 +58,9 @@ function reportAgentInstances(instances, removedFiles, onLine = logInfo, onRemov
58
58
  }
59
59
  for (const file of removedFiles ?? []) onRemoved(`Removed: ${file}`);
60
60
  }
61
+ function reportRelocked(relocked, onLine = logInfo) {
62
+ for (const ref of relocked ?? []) onLine(`Re-locked ${ref}`);
63
+ }
61
64
  function makeInstallCommand() {
62
65
  return new Command("install").description(`Install dependencies from skaile.yaml, or a single asset by ref (${REF_HINT})`).argument("[ref]", `Asset ref to install from the Catalog (${REF_HINT})`).option("--locked", "Install from lock file (CI mode \u2014 fails on drift)").option("--project-dir <path>", "Project directory", process.cwd()).option("--target <agent>", `Agent framework (${TARGET_DEFAULT_HINT})`).option(
63
66
  "--global",
@@ -98,7 +101,7 @@ async function runRefInstall(ref, opts) {
98
101
  const spinner = createSpinner();
99
102
  spinner.start(`Installing ${ref}`);
100
103
  try {
101
- const { openCatalogSource, openLibrary } = await import('./open-library-P3D337NH.js');
104
+ const { openCatalogSource, openLibrary } = await import('./open-library-DB2PNL2X.js');
102
105
  const catalog = await openCatalogSource({ projectDir: path.resolve(opts.projectDir) });
103
106
  if (!supportsInstallManifest(catalog)) {
104
107
  throw new Error(
@@ -140,7 +143,7 @@ async function runYamlInstall(opts) {
140
143
  return;
141
144
  }
142
145
  try {
143
- const { ensureSourcesCloned } = await import('./ensure-sources-277VI7R3.js');
146
+ const { ensureSourcesCloned } = await import('./ensure-sources-SRC2DVR5.js');
144
147
  const hydrate = ensureSourcesCloned(projectDir, { quiet: true });
145
148
  if (hydrate.cloned.length > 0) {
146
149
  logOk(`Cloned source(s): ${hydrate.cloned.join(", ")}`);
@@ -172,7 +175,8 @@ async function runYamlInstall(opts) {
172
175
  if (result.removed.length > 0) {
173
176
  for (const r of result.removed) logWarn(`Removed: ${r}`);
174
177
  }
175
- if (result.deployed.length === 0 && result.removed.length === 0 && result.missing.length === 0) {
178
+ reportRelocked(result.relocked);
179
+ if (result.deployed.length === 0 && result.removed.length === 0 && result.missing.length === 0 && !result.relocked?.length) {
176
180
  logInfo("Nothing to install (already up to date).");
177
181
  }
178
182
  if (result.missing.length > 0) {
@@ -218,7 +222,8 @@ async function runGlobalInstall(opts, harnesses) {
218
222
  if (result.deployed.length > 0) for (const d of result.deployed) logOk(d);
219
223
  reportPresetExpansions(result.presets);
220
224
  if (result.removed.length > 0) for (const r of result.removed) logWarn(`Removed: ${r}`);
221
- if (result.deployed.length === 0 && result.removed.length === 0 && result.missing.length === 0)
225
+ reportRelocked(result.relocked);
226
+ if (result.deployed.length === 0 && result.removed.length === 0 && result.missing.length === 0 && !result.relocked?.length)
222
227
  logInfo("Nothing to install (already up to date).");
223
228
  if (result.missing.length > 0) {
224
229
  for (const m of result.missing) logErr(`Missing: ${m}${result.missingHints?.[m] ?? ""}`);
@@ -243,29 +248,15 @@ function makeCheckCommand() {
243
248
  registry: getKindRegistry(),
244
249
  projectDir: path.resolve(opts.projectDir)
245
250
  });
246
- const issues = await am.doctor();
247
- let notInstalled = [];
248
- try {
249
- notInstalled = (await am.listDeclared()).filter((d) => d.state !== "installed");
250
- } catch {
251
- }
252
- if (issues.length === 0 && notInstalled.length === 0) {
251
+ const gaps = await am.lockGaps();
252
+ const incomplete = await am.incompleteDeploys();
253
+ if (gaps.length === 0 && incomplete.length === 0) {
253
254
  logOk("All dependencies satisfied.");
254
255
  } else {
255
- for (const i of issues) {
256
- if (i.unresolved) {
257
- logErr(
258
- `${i.assetKind}:${i.assetName} is locked but no source or library provides it any more \u2014 its requirements cannot be checked`
259
- );
260
- continue;
261
- }
262
- logErr(
263
- `${i.assetKind}:${i.assetName} requires ${i.depKind}:${i.depName} (${i.inRepos ? "fixable" : "not found"})`
264
- );
265
- }
266
- for (const d of notInstalled) {
256
+ for (const g of gaps) logErr(g.message);
257
+ for (const d of incomplete) {
267
258
  logErr(
268
- d.state === "invalid" ? `${d.ref} is not a valid asset ref (expected ${REF_HINT})` : d.state === "drift" ? `${d.ref} is declared and locked but not materialized \u2014 run \`skaile install\`` : `${d.ref} is declared but does not resolve \u2014 run \`skaile install\``
259
+ `${d.ref} is deployed without ${d.missing.join(", ")} \u2014 run \`skaile install\` to restore it`
269
260
  );
270
261
  }
271
262
  process.exit(1);
@@ -331,6 +322,6 @@ function makeCleanCommand() {
331
322
  });
332
323
  }
333
324
 
334
- export { REF_HINT, makeCheckCommand, makeCleanCommand, makeInstallCommand, reportAgentInstances, reportInstalledSoftDeps, reportPresetExpansions, runPointerOnlyInstall, supportsInstallManifest };
335
- //# sourceMappingURL=chunk-EU3Q5AQ4.js.map
336
- //# sourceMappingURL=chunk-EU3Q5AQ4.js.map
325
+ export { REF_HINT, makeCheckCommand, makeCleanCommand, makeInstallCommand, reportAgentInstances, reportInstalledSoftDeps, reportPresetExpansions, reportRelocked, runPointerOnlyInstall, supportsInstallManifest };
326
+ //# sourceMappingURL=chunk-GKMZ6THE.js.map
327
+ //# sourceMappingURL=chunk-GKMZ6THE.js.map
@@ -0,0 +1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sBAAsB,CAAA;AAAA,IAC9B;AAAA,EACF,CAAC,CAAA;AACL","file":"chunk-GKMZ6THE.js","sourcesContent":["import path from \"node:path\";\nimport * as p from \"@clack/prompts\";\nimport { AssetManager, type InstalledAgentInstance } from \"@skaile/workspaces/asset-manager\";\nimport {\n type DriverTarget,\n type PresetExpansion,\n parseAssetRef,\n readLock,\n SUPPORTED_DRIVER_TARGETS,\n userConfigPath,\n} from \"@skaile/workspaces/core\";\nimport type { InstallManifest } from \"@skaile/workspaces/types\";\nimport { Command } from \"commander\";\nimport {\n colorRef,\n deferredWarnings,\n formatSoftDepHint,\n logErr,\n logInfo,\n logOk,\n logWarn,\n S,\n TARGET_DEFAULT_HINT,\n warnLegacyClaudeCopies,\n} from \"../helpers.ts\";\nimport { createSpinner } from \"../spinner.ts\";\nimport { getKindRegistry } from \"../open-registry.ts\";\n\n/**\n * Canonical asset-ref shape accepted by `skaile install <ref>`:\n * `kind:@<publisher>/<name>#<version>` (the `#` version sigil). Validated via\n * `parseAssetRef` so the CLI shares the single canonical grammar; the legacy\n * trailing-`@version` shape is rejected.\n */\nexport const REF_HINT = \"kind:@<publisher>/<name>#<version> (e.g. skill:@skaile/use-exa#1.0.0)\";\n\n/** True when `ref` parses as a canonical asset ref. */\nfunction isValidAssetRef(ref: string): boolean {\n try {\n parseAssetRef(ref);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Minimal catalog-source surface the pointer-only install path needs.\n * `RemoteCatalogSource` satisfies this — narrowing keeps {@link runPointerOnlyInstall}\n * testable with a hand-rolled stub.\n */\nexport interface InstallManifestSource {\n getInstallManifest(ref: string): Promise<InstallManifest>;\n}\n\n/**\n * Capability check: is this catalog source able to serve install manifests?\n *\n * `openCatalogSource` returns a `RemoteCatalogSource | RestCatalogSource`.\n * Only the tRPC-framed `RemoteCatalogSource` implements `getInstallManifest`;\n * the REST-framed `RestCatalogSource` (the default for any catalog URL other\n * than `https://skaile.store`) does not. Calling it unconditionally would be a\n * runtime `TypeError`, so the pointer-only install path must capability-detect\n * first and fail with a clear, actionable message.\n */\nexport function supportsInstallManifest(source: unknown): source is InstallManifestSource {\n return (\n typeof (source as { getInstallManifest?: unknown } | null | undefined)?.getInstallManifest ===\n \"function\"\n );\n}\n\n/**\n * Minimal library surface the pointer-only install path needs.\n * `LocalIndex` satisfies this.\n */\nexport interface InstallLibrary {\n install(manifest: InstallManifest): Promise<{ installPath: string }>;\n}\n\n/**\n * Result of a pointer-only catalog install.\n */\nexport interface PointerOnlyInstallResult {\n /** Absolute path the verified asset bytes were written to. */\n installPath: string;\n /** The pinned upstream commit SHA the asset was fetched at. */\n commitSha: string;\n /** Number of files in the install manifest. */\n fileCount: number;\n}\n\n/**\n * Pointer-only catalog install — the `skaile install <ref>` code path.\n *\n * 1. Resolves the pointer-only {@link InstallManifest} from the Catalog.\n * 2. Hands it to the library, which fetches each file's bytes directly from\n * the upstream repo at the pinned commit, verifies every per-file SHA256\n * plus the composite SHA256, and only then writes the verified files.\n *\n * Both dependencies are injected so the function is unit-testable without a\n * network round-trip. In production the CLI passes a `RemoteCatalogSource`\n * and a `LocalIndex`.\n *\n * @param ref - Canonical asset ref (`kind:@<publisher>/<name>#<version>`).\n * @param deps - Injected catalog source + library.\n * @returns The install path, pinned commit SHA, and file count.\n * @throws When the ref is malformed, the manifest cannot be resolved, or any\n * hash verification fails. The underlying error message is surfaced as-is.\n */\nexport async function runPointerOnlyInstall(\n ref: string,\n deps: { catalog: InstallManifestSource; library: InstallLibrary },\n): Promise<PointerOnlyInstallResult> {\n let requested: ReturnType<typeof parseAssetRef>;\n try {\n requested = parseAssetRef(ref);\n } catch (e) {\n throw new Error(\n `malformed asset ref '${ref}' — expected ${REF_HINT}: ${e instanceof Error ? e.message : String(e)}`,\n );\n }\n const manifest = await deps.catalog.getInstallManifest(ref);\n // [M1] Identity check: the catalog must not install a different asset than\n // requested. Compare the PARSED refs (kind/publisher/name/pin) so equivalent\n // spellings (optional `kind:`, default `skill`) are treated as the same ref.\n const got = parseAssetRef(manifest.ref);\n if (\n got.kind !== requested.kind ||\n got.publisher !== requested.publisher ||\n got.name !== requested.name ||\n got.pin !== requested.pin\n ) {\n throw new Error(\n `catalog identity mismatch: requested '${ref}' but the catalog returned a manifest for '${manifest.ref}'`,\n );\n }\n const { installPath } = await deps.library.install(manifest);\n return {\n installPath,\n commitSha: manifest.source.commitSha,\n fileCount: manifest.files.length,\n };\n}\n\n/**\n * Print one summary line per `preset:` dependency `skaile install` expanded: how many\n * asset items joined the install set and how many instance items (`library://`,\n * placeholders) were skipped, which only `skaile preset apply` materialises.\n */\nexport function reportPresetExpansions(\n presets: readonly PresetExpansion[] | undefined,\n onLine: (line: string) => void = logInfo,\n): void {\n for (const preset of presets ?? []) {\n onLine(\n `preset ${preset.ref}: ${preset.assets} assets, ${preset.skipped} instance items skipped (apply with skaile preset apply)`,\n );\n }\n}\n\n/**\n * Print one line per agent instance `skaile install` rendered (with the files\n * written) and one per native agent file removed because its instance left `skaile.yaml`.\n */\nexport function reportAgentInstances(\n instances: readonly InstalledAgentInstance[] | undefined,\n removedFiles: readonly string[] | undefined,\n onLine: (line: string) => void = logInfo,\n onRemoved: (line: string) => void = logWarn,\n): void {\n for (const instance of instances ?? []) {\n onLine(`agent ${instance.id}: ${instance.files.join(\", \")}`);\n }\n for (const file of removedFiles ?? []) onRemoved(`Removed: ${file}`);\n}\n\n/** One `Re-locked` line per lock entry `install`/`update` rewrote for an already-locked asset. */\nexport function reportRelocked(\n relocked: string[] | undefined,\n onLine: (line: string) => void = logInfo,\n): void {\n for (const ref of relocked ?? []) onLine(`Re-locked ${ref}`);\n}\n\n/**\n * Creates the `skaile install` command.\n *\n * Two modes, selected by argument shape:\n *\n * - `skaile install` (no positional arg) — reads `skaile.yaml` and deploys all\n * declared assets (and their transitive dependencies) to the configured\n * driver target directory. Supports `--locked` for CI-mode install from a\n * lock file.\n * - `skaile install kind:@<publisher>/<name>#<version>` — pointer-only catalog\n * install: resolves the pointer-only install manifest from the configured\n * Catalog, fetches each file's bytes directly from the upstream repo at the\n * pinned commit, verifies every per-file + the composite SHA256, then writes\n * the verified files into the local Library.\n *\n * @returns Configured {@link Command} ready for `program.addCommand()`.\n * @docLink cli/commands/project#make-install-command\n */\nexport function makeInstallCommand(): Command {\n return new Command(\"install\")\n .description(`Install dependencies from skaile.yaml, or a single asset by ref (${REF_HINT})`)\n .argument(\"[ref]\", `Asset ref to install from the Catalog (${REF_HINT})`)\n .option(\"--locked\", \"Install from lock file (CI mode — fails on drift)\")\n .option(\"--project-dir <path>\", \"Project directory\", process.cwd())\n .option(\"--target <agent>\", `Agent framework (${TARGET_DEFAULT_HINT})`)\n .option(\n \"--global\",\n \"Install the global SSOT (~/.skaile/skaile.yaml), fanning out to every global harness\",\n )\n .option(\n \"--harness <ids>\",\n \"Comma-separated global harnesses to install into (default: all resolved); implies --global\",\n )\n .option(\n \"--link\",\n \"symlink local-path assets instead of copying (dev loop; machine-local, not for committing)\",\n )\n .action(runInstallCommand);\n}\n\n/** Options shape accepted by the `skaile install` command action. */\ninterface InstallCommandOptions {\n locked?: boolean;\n projectDir: string;\n target?: string;\n global?: boolean;\n harness?: string;\n link?: boolean;\n}\n\n/**\n * Parse a `--harness a,b` value into validated {@link DriverTarget}s, exiting on\n * an unknown id. Returns `undefined` when the flag is absent (resolve the full\n * global set instead).\n */\nfunction parseHarnessFilter(raw: string | undefined): DriverTarget[] | undefined {\n if (!raw) return undefined;\n const ids = raw\n .split(\",\")\n .map((s) => s.trim())\n .filter(Boolean);\n const out: DriverTarget[] = [];\n for (const id of ids) {\n if (!(SUPPORTED_DRIVER_TARGETS as string[]).includes(id)) {\n logErr(`unknown harness '${id}' — expected one of: ${SUPPORTED_DRIVER_TARGETS.join(\", \")}`);\n process.exit(1);\n }\n out.push(id as DriverTarget);\n }\n return out.length > 0 ? out : undefined;\n}\n\n/**\n * `skaile install` action body. Dispatches by argument shape:\n * a positional `ref` selects pointer-only catalog install, otherwise the\n * legacy `skaile.yaml` install path runs.\n */\nasync function runInstallCommand(\n ref: string | undefined,\n opts: InstallCommandOptions,\n): Promise<void> {\n // ── Pointer-only catalog install: `skaile install <ref>` ──────────────\n if (ref !== undefined) {\n await runRefInstall(ref, opts);\n return;\n }\n\n // ── Legacy install: `skaile install` reads skaile.yaml ────────────────\n await runYamlInstall(opts);\n}\n\n/** Pointer-only catalog install path for `skaile install <ref>`. */\nasync function runRefInstall(ref: string, opts: InstallCommandOptions): Promise<void> {\n if (!isValidAssetRef(ref)) {\n logErr(`malformed asset ref '${ref}' — expected ${REF_HINT}`);\n process.exit(1);\n }\n const spinner = createSpinner();\n spinner.start(`Installing ${ref}`);\n try {\n const { openCatalogSource, openLibrary } = await import(\"../open-library.ts\");\n const catalog = await openCatalogSource({ projectDir: path.resolve(opts.projectDir) });\n // [H2] REST-framed catalogs (the default for any catalog URL other\n // than https://skaile.store) cannot serve install manifests. Detect\n // and fail clearly rather than throwing a runtime TypeError.\n if (!supportsInstallManifest(catalog)) {\n throw new Error(\n \"pointer-only install (skaile install <ref>) requires a tRPC-framed Catalog. \" +\n \"The configured catalog uses REST framing, which does not serve install \" +\n \"manifests. Set catalog.url to https://skaile.store, or catalog.framing: trpc, \" +\n `in ${userConfigPath()}.`,\n );\n }\n const library = await openLibrary();\n try {\n const result = await runPointerOnlyInstall(ref, { catalog, library });\n spinner.stop(\"Done\");\n logOk(`Installed ${colorRef(ref)}`);\n logInfo(`Path: ${S.dim(result.installPath)}`);\n logInfo(`Commit: ${S.dim(result.commitSha)}`);\n logInfo(`Files: ${S.dim(String(result.fileCount))}`);\n logInfo(\n S.dim(\n `Installed globally (see Path above) — use \\`skaile add ${ref}\\` to deploy into this project.`,\n ),\n );\n } finally {\n library.close();\n }\n } catch (err) {\n spinner.stop(\"Failed\");\n const msg = err instanceof Error ? err.message : String(err);\n if (/unreachable/i.test(msg)) {\n logErr(`asset uninstallable — source commit no longer available (${msg})`);\n } else {\n logErr(msg);\n }\n process.exit(1);\n }\n}\n\n/** Legacy install path for bare `skaile install` (reads skaile.yaml). */\nasync function runYamlInstall(opts: InstallCommandOptions): Promise<void> {\n const projectDir = path.resolve(opts.projectDir);\n\n const harnesses = parseHarnessFilter(opts.harness);\n // `--harness` implies `--global`.\n if (opts.global || harnesses) {\n await runGlobalInstall(opts, harnesses);\n return;\n }\n\n // Hydrate sources declared in skaile.yaml before resolving assets, so\n // freshly checked-out projects pull their source clones automatically.\n try {\n const { ensureSourcesCloned } = await import(\"../ensure-sources.ts\");\n const hydrate = ensureSourcesCloned(projectDir, { quiet: true });\n if (hydrate.cloned.length > 0) {\n logOk(`Cloned source(s): ${hydrate.cloned.join(\", \")}`);\n }\n if (hydrate.failed.length > 0) {\n logErr(`Failed to clone source(s): ${hydrate.failed.join(\", \")}`);\n }\n } catch (err) {\n logWarn(`source hydration skipped: ${err instanceof Error ? err.message : String(err)}`);\n }\n\n const warnings = deferredWarnings();\n const am = new AssetManager({\n registry: getKindRegistry(),\n projectDir,\n driverTarget: opts.target as DriverTarget,\n onLibraryCollision: warnings.push,\n });\n const spinner = createSpinner();\n spinner.start(opts.locked ? \"Installing from lock file\" : \"Installing dependencies\");\n try {\n const result = await am.install({ locked: opts.locked, link: opts.link });\n spinner.stop(\"Done\");\n warnings.flush();\n if (result.deployed.length > 0) {\n for (const d of result.deployed) logOk(d);\n }\n reportPresetExpansions(result.presets);\n reportAgentInstances(result.agentInstances, result.agentFilesRemoved);\n if (result.removed.length > 0) {\n for (const r of result.removed) logWarn(`Removed: ${r}`);\n }\n reportRelocked(result.relocked);\n if (\n result.deployed.length === 0 &&\n result.removed.length === 0 &&\n result.missing.length === 0 &&\n !result.relocked?.length\n ) {\n logInfo(\"Nothing to install (already up to date).\");\n }\n if (result.missing.length > 0) {\n for (const m of result.missing) logErr(`Missing: ${m}${result.missingHints?.[m] ?? \"\"}`);\n // Partial-miss must fail the process — CI can't otherwise distinguish a\n // clean install from \"half the assets never resolved\".\n process.exitCode = 1;\n }\n if (result.lockWritten) {\n logInfo(`Lock file written: ${S.dim(\"skaile.lock.yaml\")}`);\n }\n warnLegacyClaudeCopies(am);\n // Report-only: surface soft deps the declared assets reference but aren't\n // present. Never a prompt — install is a batch/CI path. Skipped under\n // --locked: that mode is \"restore exactly\", so an `add` nudge would jar.\n if (!opts.locked) await reportInstalledSoftDeps(am);\n } catch (err) {\n spinner.stop(\"Failed\");\n warnings.flush();\n logErr(String(err));\n process.exit(1);\n }\n}\n\n/**\n * Report (never prompt) the body-link soft deps that the declared assets\n * reference but that aren't in the project — the `install` counterpart to the\n * `add`-time soft-dep surface. `install` is a batch/CI path (often non-TTY), so\n * it only ever prints a hint: pulling stays an explicit `skaile add`. Best-effort\n * — `reportSoftDeps` swallows any index failure and returns `[]`.\n */\nexport async function reportInstalledSoftDeps(\n am: Pick<AssetManager, \"listDeclared\" | \"reportSoftDeps\">,\n onHint: (line: string) => void = (l) => logInfo(S.dim(l)),\n): Promise<void> {\n try {\n const declared = (await am.listDeclared()).map((d) => d.ref);\n if (declared.length === 0) return;\n const edges = await am.reportSoftDeps(declared);\n for (const edge of edges) onHint(formatSoftDepHint(edge));\n } catch {\n // Best-effort: a soft-dep report must never fail an install that succeeded.\n }\n}\n\n/**\n * Global cross-harness install: deploy every dep declared in the global SSOT\n * (`~/.skaile/skaile.yaml`) into each resolved global harness's dir under `~`,\n * write the global lock (`~/.skaile/skaile.lock.yaml`), then print per-harness\n * state. `harnesses` is the `--harness` filter (omit for the full resolved set).\n */\nasync function runGlobalInstall(\n opts: InstallCommandOptions,\n harnesses: DriverTarget[] | undefined,\n): Promise<void> {\n const warnings = deferredWarnings();\n const am = new AssetManager({\n registry: getKindRegistry(),\n projectDir: path.resolve(opts.projectDir),\n global: true,\n harnesses,\n onLibraryCollision: warnings.push,\n });\n const spinner = createSpinner();\n spinner.start(\"Installing global dependencies\");\n try {\n const result = await am.install({ locked: opts.locked, link: opts.link });\n spinner.stop(\"Done\");\n warnings.flush();\n if (result.deployed.length > 0) for (const d of result.deployed) logOk(d);\n reportPresetExpansions(result.presets);\n if (result.removed.length > 0) for (const r of result.removed) logWarn(`Removed: ${r}`);\n reportRelocked(result.relocked);\n if (\n result.deployed.length === 0 &&\n result.removed.length === 0 &&\n result.missing.length === 0 &&\n !result.relocked?.length\n )\n logInfo(\"Nothing to install (already up to date).\");\n if (result.missing.length > 0) {\n for (const m of result.missing) logErr(`Missing: ${m}${result.missingHints?.[m] ?? \"\"}`);\n process.exitCode = 1;\n }\n if (result.lockWritten) logInfo(`Global lock written: ${S.dim(\"~/.skaile/skaile.lock.yaml\")}`);\n\n // Per-harness reconciliation summary so a partial fan-out is visible.\n const state = am.globalState({});\n const byHarness = new Map<string, number>();\n for (const s of state)\n if (s.state === \"installed\") byHarness.set(s.harness, (byHarness.get(s.harness) ?? 0) + 1);\n for (const [harness, n] of byHarness) logInfo(`${harness}: ${n} installed`);\n } catch (err) {\n spinner.stop(\"Failed\");\n warnings.flush();\n logErr(String(err));\n process.exit(1);\n }\n}\n\n/**\n * Creates the `skaile check` command.\n *\n * Scans all deployed assets for unmet dependency requirements **and** the\n * declared set for deps that never materialized, and exits with code 1 if\n * either is found. `doctor()` alone only walks *deployed* assets' `requires`, so\n * a declared dep whose bytes never landed (e.g. a store-sourced `mcp-server`)\n * used to report \"satisfied\" (#462). A declared dep that is not in the lock at\n * all (its library or source is gone) fails the check too, like `skaile list`\n * showing it as `declared`.\n *\n * @returns Configured {@link Command} ready for `program.addCommand()`.\n * @docLink cli/commands/project#make-check-command\n */\nexport function makeCheckCommand(): Command {\n return new Command(\"check\")\n .description(\"Check for unmet requirements\")\n .option(\"--project-dir <path>\", \"Project directory\", process.cwd())\n .action(async (opts) => {\n const am = new AssetManager({\n registry: getKindRegistry(),\n projectDir: path.resolve(opts.projectDir),\n });\n // `lockGaps` is the one set `install --locked` and `outdated` fail on too: unmet\n // `requires` of deployed assets plus declared deps the lock misses or contradicts.\n const gaps = await am.lockGaps();\n const incomplete = await am.incompleteDeploys();\n if (gaps.length === 0 && incomplete.length === 0) {\n logOk(\"All dependencies satisfied.\");\n } else {\n for (const g of gaps) logErr(g.message);\n for (const d of incomplete) {\n logErr(\n `${d.ref} is deployed without ${d.missing.join(\", \")} — run \\`skaile install\\` to restore it`,\n );\n }\n process.exit(1);\n }\n });\n}\n\n/**\n * Creates the `skaile clean` command.\n *\n * Removes all skaile-managed assets tracked in `skaile.lock.yaml` from the\n * workspace. With `--all` also removes history, patches, repos, and the lock\n * file itself. Preserves unmanaged (manually placed) assets.\n *\n * @returns Configured {@link Command} ready for `program.addCommand()`.\n * @docLink cli/commands/project#make-clean-command\n */\nexport function makeCleanCommand(): Command {\n return new Command(\"clean\")\n .description(\"Remove all skaile-managed assets from the workspace\")\n .option(\"--all\", \"Full reset: also remove history, patches, repos, and lock file\")\n .option(\"--dry-run\", \"Show what would be removed without doing it\")\n .option(\"-y, --yes\", \"Skip confirmation prompt\")\n .option(\"--project-dir <path>\", \"Project directory\", process.cwd())\n .option(\"--target <agent>\", `Agent framework (${TARGET_DEFAULT_HINT})`)\n .action(async (opts) => {\n const am = new AssetManager({\n registry: getKindRegistry(),\n projectDir: path.resolve(opts.projectDir),\n driverTarget: opts.target as DriverTarget,\n });\n\n // Preview: load lock file to show what will be cleaned\n const lock = readLock(path.resolve(opts.projectDir, \"skaile.lock.yaml\"));\n\n if (!lock || Object.keys(lock.assets).length === 0) {\n logInfo(\"Nothing to clean (no skaile-managed assets found).\");\n return;\n }\n\n const assetRefs = Object.keys(lock.assets);\n console.log();\n console.log(` ${S.heading(\"Assets to remove:\")} ${S.dim(`(${assetRefs.length})`)}`);\n for (const ref of assetRefs) {\n console.log(` ${colorRef(ref)}`);\n }\n\n if (opts.all) {\n console.log();\n console.log(` ${S.heading(\"Also removing:\")}`);\n console.log(` ${S.dim(\".skaile/history.yaml\")}`);\n console.log(` ${S.dim(\".skaile/patches/\")}`);\n console.log(` ${S.dim(\"skaile.lock.yaml\")}`);\n }\n\n if (opts.dryRun) {\n console.log();\n logInfo(\"Dry run — no changes made.\");\n return;\n }\n\n if (!opts.yes) {\n const confirm = await p.confirm({ message: \"Proceed?\" });\n if (p.isCancel(confirm) || !confirm) {\n logInfo(\"Cancelled.\");\n return;\n }\n }\n\n const result = am.clean({ all: opts.all });\n\n console.log();\n for (const r of result.removed) {\n logOk(`Removed ${r}`);\n }\n for (const s of result.skipped) {\n logWarn(`Skipped ${s.ref}: ${s.reason}`);\n }\n if (result.unmanaged.length > 0) {\n console.log();\n logInfo(`Kept ${result.unmanaged.length} unmanaged asset(s):`);\n for (const u of result.unmanaged) {\n console.log(` ${S.dim(u)}`);\n }\n }\n if (opts.all) {\n console.log();\n logOk(\"Full reset complete.\");\n }\n });\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { parseDep, isValidAssetName, slugifyAssetName } from './chunk-O7VPNKYN.js';
1
+ import { parseDep, isValidAssetName, slugifyAssetName } from './chunk-QVNRCDTV.js';
2
2
  import { createLogger } from './chunk-BOFL7GIF.js';
3
3
  import { stat, readFile, opendir } from 'fs/promises';
4
4
  import { basename, dirname, join } from 'path';
@@ -239,6 +239,7 @@ function fromPresetYamlContent(content, repoName, filePath) {
239
239
  meta = parse(content) ?? {};
240
240
  } catch {
241
241
  }
242
+ const { refs, skipped } = presetItemRefs(meta.items);
242
243
  return {
243
244
  name: String(meta.name ?? basename(filePath).replace(/\.preset\.yaml$/, "")),
244
245
  kind: "preset",
@@ -247,7 +248,8 @@ function fromPresetYamlContent(content, repoName, filePath) {
247
248
  publisher: repoName,
248
249
  version: String(meta.version ?? ""),
249
250
  requires: [],
250
- dependencies: presetItemRefs(meta.items).refs
251
+ dependencies: refs,
252
+ ...skipped > 0 ? { skippedItems: skipped } : {}
251
253
  };
252
254
  }
253
255
  async function assetDepRefs(filePath) {
@@ -518,7 +520,7 @@ function entryFromManifest(name, content, filePath, repoName, knownKinds) {
518
520
  function isManifestName(name) {
519
521
  return name === "SKILL.md" || name === "AGENT.md" || name === "agent.yaml" || name === "CONTRACT.md" || name === "MCP.md" || name === "CONNECTOR.md" || name === "knowledge.yaml" || name.endsWith(".prompt.md") || name.endsWith(".preset.yaml") || name.endsWith(".flow.yaml") || name.endsWith(".flow.json");
520
522
  }
521
- async function readAssetPublisherOverrides(root, opTimeoutMs) {
523
+ async function readManifestAssetOverrides(root, opTimeoutMs) {
522
524
  const out = {};
523
525
  const file = join(root, "skaile.manifest.yaml");
524
526
  const content = await tryWithFsDeadline(
@@ -537,16 +539,30 @@ async function readAssetPublisherOverrides(root, opTimeoutMs) {
537
539
  const assets = doc?.assets;
538
540
  if (!Array.isArray(assets)) return out;
539
541
  for (const a of assets) {
540
- const { kind, name, publisher } = a ?? {};
542
+ const { kind, name, publisher, dependencies } = a ?? {};
541
543
  if (typeof kind !== "string" || typeof name !== "string") continue;
542
- if (typeof publisher !== "string") continue;
543
- const bare = publisher.trim().replace(/^@/, "");
544
- if (bare) out[`${kind}:${name}`] = bare;
544
+ const override = {
545
+ dependencies: Array.isArray(dependencies) ? dependencies.filter((d) => typeof d === "string" && d.trim().length > 0) : []
546
+ };
547
+ const bare = typeof publisher === "string" ? publisher.trim().replace(/^@/, "") : "";
548
+ if (bare) override.publisher = bare;
549
+ if (override.publisher || override.dependencies.length > 0) out[`${kind}:${name}`] = override;
545
550
  }
546
551
  return out;
547
552
  }
553
+ function mergeManifestDependencies(entry, dependencies) {
554
+ const idOf = (d) => `${d.kind}:@${d.publisher ?? ""}/${d.name}`;
555
+ const seen = new Set(entry.requires.map(idOf));
556
+ for (const raw of dependencies) {
557
+ const dep = parseDep(raw);
558
+ if (seen.has(idOf(dep))) continue;
559
+ seen.add(idOf(dep));
560
+ entry.requires.push(dep);
561
+ }
562
+ }
548
563
  async function scanDirectory(root, repoName, options) {
549
564
  const entries = /* @__PURE__ */ new Map();
565
+ const copies = [];
550
566
  const onTruncate = options.onTruncate ?? warnTruncation;
551
567
  const reported = /* @__PURE__ */ new Set();
552
568
  const relay = (info) => {
@@ -554,12 +570,17 @@ async function scanDirectory(root, repoName, options) {
554
570
  onTruncate(info);
555
571
  };
556
572
  const opTimeoutMs = options.opTimeoutMs ?? fsDeadlineMs();
557
- const publisherOverrides = await readAssetPublisherOverrides(root, opTimeoutMs);
573
+ const manifestOverrides = await readManifestAssetOverrides(root, opTimeoutMs);
558
574
  function add(e) {
559
575
  normalizeEntryName(e);
560
576
  const key = `${e.kind}:${e.name}`;
561
- const override = publisherOverrides[key];
562
- if (override) e.publisher = override;
577
+ const override = manifestOverrides[key];
578
+ if (override?.publisher) e.publisher = override.publisher;
579
+ if (override) mergeManifestDependencies(e, override.dependencies);
580
+ if (options.keepDuplicates) {
581
+ copies.push(e);
582
+ return;
583
+ }
563
584
  const existing = entries.get(key);
564
585
  if (!existing) {
565
586
  entries.set(key, e);
@@ -592,9 +613,9 @@ async function scanDirectory(root, repoName, options) {
592
613
  }
593
614
  }
594
615
  }
595
- return [...entries.values()];
616
+ return options.keepDuplicates ? copies : [...entries.values()];
596
617
  }
597
618
 
598
619
  export { DEFAULT_FS_DEADLINE_MS, DEFAULT_WALK_BUDGET_MS, DEFAULT_WALK_MAX_DEPTH, DEFAULT_WALK_MAX_ENTRIES, FS_DEADLINE_ENV_VAR, FsDeadlineError, ManifestKindError, WALK_BUDGET_MS_ENV_VAR, WALK_MAX_DEPTH_ENV_VAR, WALK_MAX_ENTRIES_ENV_VAR, assetDepRefs, fromAgentMd, fromAgentYaml, fromConnectorMd, fromContractMd, fromFlowYaml, fromKnowledgeYaml, fromMcpServerMd, fromMcpServerMdContent, fromPresetYaml, fromPromptMd, fromSkillMd, fsDeadlineMs, manifestKindDiagnostic, parseFrontmatter, parseRequires, presetItemRefs, scanDirectory, tryWithFsDeadline, walkDir, withFsDeadline };
599
- //# sourceMappingURL=chunk-TTPSDC2G.js.map
600
- //# sourceMappingURL=chunk-TTPSDC2G.js.map
620
+ //# sourceMappingURL=chunk-GTILM2CI.js.map
621
+ //# sourceMappingURL=chunk-GTILM2CI.js.map