@skaile/workspaces 5.1.3 → 5.2.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 (338) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/app-sdk/index.js +1 -1
  3. package/dist/{asset-feeds-C4X4RTZV.js → asset-feeds-WDIB3E6H.js} +11 -11
  4. package/dist/{asset-feeds-C4X4RTZV.js.map → asset-feeds-WDIB3E6H.js.map} +1 -1
  5. package/dist/asset-manager/catalog-deployer.js +8 -8
  6. package/dist/asset-manager/index.js +12 -12
  7. package/dist/asset-manager/installer.js +8 -8
  8. package/dist/asset-manager/src/index.d.ts +27 -1
  9. package/dist/asset-manager/src/index.d.ts.map +1 -1
  10. package/dist/bridge/drivers/claude-sdk.js +14 -13
  11. package/dist/bridge/drivers/claude-sdk.js.map +1 -1
  12. package/dist/bridge/drivers/codex.js +11 -10
  13. package/dist/bridge/drivers/codex.js.map +1 -1
  14. package/dist/bridge/drivers/continue.js +10 -10
  15. package/dist/bridge/drivers/echo.js +3 -3
  16. package/dist/bridge/drivers/gemini.js +5 -5
  17. package/dist/bridge/drivers/goose.js +10 -10
  18. package/dist/bridge/drivers/omp.js +6 -5
  19. package/dist/bridge/drivers/omp.js.map +1 -1
  20. package/dist/bridge/drivers/opencode.js +10 -10
  21. package/dist/bridge/drivers/qwen.js +5 -5
  22. package/dist/bridge/index.js +13 -13
  23. package/dist/bridge/src/driver-capabilities.d.ts +66 -0
  24. package/dist/bridge/src/driver-capabilities.d.ts.map +1 -0
  25. package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
  26. package/dist/bridge/src/drivers/codex.d.ts.map +1 -1
  27. package/dist/bridge/src/drivers/omp.d.ts.map +1 -1
  28. package/dist/bridge/src/index.d.ts +1 -0
  29. package/dist/bridge/src/index.d.ts.map +1 -1
  30. package/dist/bridge/src/registry.d.ts.map +1 -1
  31. package/dist/{chunk-WPWJRDR3.js → chunk-2MEMXBLC.js} +8 -7
  32. package/dist/chunk-2MEMXBLC.js.map +1 -0
  33. package/dist/{chunk-TVOODIZE.js → chunk-2QZG5VJQ.js} +3 -3
  34. package/dist/{chunk-TVOODIZE.js.map → chunk-2QZG5VJQ.js.map} +1 -1
  35. package/dist/{chunk-7SAWDPUT.js → chunk-37GBJLF5.js} +5 -55
  36. package/dist/chunk-37GBJLF5.js.map +1 -0
  37. package/dist/{chunk-ZD7CX25M.js → chunk-3E2TIPBZ.js} +56 -7
  38. package/dist/chunk-3E2TIPBZ.js.map +1 -0
  39. package/dist/{chunk-H4EGUQ7M.js → chunk-4YE7OYTB.js} +5 -5
  40. package/dist/chunk-4YE7OYTB.js.map +1 -0
  41. package/dist/{chunk-K5GBV4SA.js → chunk-5BEFNLOR.js} +6 -5
  42. package/dist/chunk-5BEFNLOR.js.map +1 -0
  43. package/dist/{chunk-BJZHNSQO.js → chunk-6OWIEFZ2.js} +5 -5
  44. package/dist/{chunk-BJZHNSQO.js.map → chunk-6OWIEFZ2.js.map} +1 -1
  45. package/dist/{chunk-O4U7OL6D.js → chunk-6ZCVROWW.js} +6 -6
  46. package/dist/{chunk-O4U7OL6D.js.map → chunk-6ZCVROWW.js.map} +1 -1
  47. package/dist/{chunk-RO4Z2CBP.js → chunk-77GKEZ2R.js} +21 -4
  48. package/dist/chunk-77GKEZ2R.js.map +1 -0
  49. package/dist/{chunk-TYUJB336.js → chunk-7Y43UXKA.js} +3 -3
  50. package/dist/{chunk-TYUJB336.js.map → chunk-7Y43UXKA.js.map} +1 -1
  51. package/dist/{chunk-YV4J7V53.js → chunk-ANWHAGM7.js} +3 -3
  52. package/dist/{chunk-YV4J7V53.js.map → chunk-ANWHAGM7.js.map} +1 -1
  53. package/dist/{chunk-SP47UJKE.js → chunk-B4J4RGNY.js} +231 -114
  54. package/dist/chunk-B4J4RGNY.js.map +1 -0
  55. package/dist/{chunk-IWCCZL7C.js → chunk-BIMEKYOE.js} +91 -25
  56. package/dist/chunk-BIMEKYOE.js.map +1 -0
  57. package/dist/{chunk-WCQMXBO5.js → chunk-BJQUSAGB.js} +4 -4
  58. package/dist/{chunk-WCQMXBO5.js.map → chunk-BJQUSAGB.js.map} +1 -1
  59. package/dist/{chunk-RDYI4MML.js → chunk-BNUZEYC3.js} +3 -3
  60. package/dist/{chunk-RDYI4MML.js.map → chunk-BNUZEYC3.js.map} +1 -1
  61. package/dist/{chunk-KVAI5DGL.js → chunk-BUNBKRJZ.js} +3 -3
  62. package/dist/{chunk-KVAI5DGL.js.map → chunk-BUNBKRJZ.js.map} +1 -1
  63. package/dist/{chunk-AZYIEK3F.js → chunk-BWOLP6KQ.js} +3 -3
  64. package/dist/{chunk-AZYIEK3F.js.map → chunk-BWOLP6KQ.js.map} +1 -1
  65. package/dist/chunk-BZXR6SW5.js +15 -0
  66. package/dist/{chunk-XUQBVK4R.js.map → chunk-BZXR6SW5.js.map} +1 -1
  67. package/dist/{chunk-Y6V6NUEV.js → chunk-DD3OZLRD.js} +3 -3
  68. package/dist/{chunk-Y6V6NUEV.js.map → chunk-DD3OZLRD.js.map} +1 -1
  69. package/dist/{chunk-2HR3RPWD.js → chunk-EOGNW74K.js} +9 -8
  70. package/dist/chunk-EOGNW74K.js.map +1 -0
  71. package/dist/{chunk-RNNUYFFD.js → chunk-FJTC5YFO.js} +3 -3
  72. package/dist/{chunk-RNNUYFFD.js.map → chunk-FJTC5YFO.js.map} +1 -1
  73. package/dist/{chunk-ZVKJNNME.js → chunk-IOUIC2ZD.js} +8 -8
  74. package/dist/{chunk-ZVKJNNME.js.map → chunk-IOUIC2ZD.js.map} +1 -1
  75. package/dist/{chunk-YMOZC2D3.js → chunk-JPR7EPIM.js} +4 -4
  76. package/dist/{chunk-YMOZC2D3.js.map → chunk-JPR7EPIM.js.map} +1 -1
  77. package/dist/{chunk-IDEA6CYI.js → chunk-K2K7OF4P.js} +95 -3
  78. package/dist/chunk-K2K7OF4P.js.map +1 -0
  79. package/dist/{chunk-AGWYBS2E.js → chunk-KGGT6MUM.js} +4 -4
  80. package/dist/{chunk-AGWYBS2E.js.map → chunk-KGGT6MUM.js.map} +1 -1
  81. package/dist/{chunk-BEOKEK3B.js → chunk-L257BENF.js} +73 -54
  82. package/dist/chunk-L257BENF.js.map +1 -0
  83. package/dist/{chunk-UVOJSWD2.js → chunk-LZ5RH6LD.js} +24 -13
  84. package/dist/chunk-LZ5RH6LD.js.map +1 -0
  85. package/dist/{chunk-M4ISBWXR.js → chunk-MGHUSFYQ.js} +2472 -2265
  86. package/dist/chunk-MGHUSFYQ.js.map +1 -0
  87. package/dist/{chunk-43ZBF3WH.js → chunk-OABIGSUY.js} +16 -3
  88. package/dist/chunk-OABIGSUY.js.map +1 -0
  89. package/dist/{chunk-QU4J5YSJ.js → chunk-OFNXRI4L.js} +4 -4
  90. package/dist/{chunk-QU4J5YSJ.js.map → chunk-OFNXRI4L.js.map} +1 -1
  91. package/dist/{chunk-MXXKTQXJ.js → chunk-P2EM6FNQ.js} +5 -5
  92. package/dist/{chunk-MXXKTQXJ.js.map → chunk-P2EM6FNQ.js.map} +1 -1
  93. package/dist/{chunk-DLLM4U6C.js → chunk-PHKFFJ4I.js} +3 -3
  94. package/dist/{chunk-DLLM4U6C.js.map → chunk-PHKFFJ4I.js.map} +1 -1
  95. package/dist/{chunk-YDJZRLGN.js → chunk-PU5VY7KF.js} +4 -4
  96. package/dist/{chunk-YDJZRLGN.js.map → chunk-PU5VY7KF.js.map} +1 -1
  97. package/dist/{chunk-KC3OF6B2.js → chunk-QMWMSZQ4.js} +3 -3
  98. package/dist/{chunk-KC3OF6B2.js.map → chunk-QMWMSZQ4.js.map} +1 -1
  99. package/dist/{chunk-RNOIDD3Y.js → chunk-R3QW7CA5.js} +5 -5
  100. package/dist/{chunk-RNOIDD3Y.js.map → chunk-R3QW7CA5.js.map} +1 -1
  101. package/dist/{chunk-UMSWQKCY.js → chunk-RXPC4KBW.js} +3 -3
  102. package/dist/{chunk-UMSWQKCY.js.map → chunk-RXPC4KBW.js.map} +1 -1
  103. package/dist/{chunk-IAGCOAIW.js → chunk-S6KNDUAU.js} +4 -4
  104. package/dist/{chunk-IAGCOAIW.js.map → chunk-S6KNDUAU.js.map} +1 -1
  105. package/dist/{chunk-I75CM2QF.js → chunk-TVJBJLXR.js} +14 -15
  106. package/dist/chunk-TVJBJLXR.js.map +1 -0
  107. package/dist/{chunk-WKIOWDLQ.js → chunk-UDBN3LZU.js} +4 -4
  108. package/dist/{chunk-WKIOWDLQ.js.map → chunk-UDBN3LZU.js.map} +1 -1
  109. package/dist/{chunk-5S4ZK75K.js → chunk-WMEPS6S4.js} +3 -3
  110. package/dist/{chunk-5S4ZK75K.js.map → chunk-WMEPS6S4.js.map} +1 -1
  111. package/dist/{chunk-KNC55536.js → chunk-XIYXBHLN.js} +5 -4
  112. package/dist/chunk-XIYXBHLN.js.map +1 -0
  113. package/dist/{chunk-VDJKWKH2.js → chunk-XOTJVCJB.js} +3 -3
  114. package/dist/{chunk-VDJKWKH2.js.map → chunk-XOTJVCJB.js.map} +1 -1
  115. package/dist/{chunk-DXUQCMVT.js → chunk-YANDJSMN.js} +3 -3
  116. package/dist/{chunk-DXUQCMVT.js.map → chunk-YANDJSMN.js.map} +1 -1
  117. package/dist/{chunk-AG44ZJ7W.js → chunk-YRF5CYHR.js} +5 -14
  118. package/dist/chunk-YRF5CYHR.js.map +1 -0
  119. package/dist/{chunk-KWP4RVTJ.js → chunk-ZSFTCMZL.js} +760 -642
  120. package/dist/chunk-ZSFTCMZL.js.map +1 -0
  121. package/dist/cli/index.js +506 -434
  122. package/dist/cli/index.js.map +1 -1
  123. package/dist/cli/src/commands/asset-cmd.d.ts.map +1 -1
  124. package/dist/cli/src/commands/catalog.d.ts.map +1 -1
  125. package/dist/cli/src/commands/config.d.ts.map +1 -1
  126. package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
  127. package/dist/cli/src/commands/library-publish.d.ts.map +1 -1
  128. package/dist/cli/src/commands/project.d.ts.map +1 -1
  129. package/dist/cli/src/commands/run.d.ts.map +1 -1
  130. package/dist/cli/src/commands/skailify-lib.d.ts +0 -45
  131. package/dist/cli/src/commands/skailify-lib.d.ts.map +1 -1
  132. package/dist/cli/src/commands/source.d.ts.map +1 -1
  133. package/dist/cli/src/commands/validate.d.ts.map +1 -1
  134. package/dist/cli/src/flow-discovery.d.ts +9 -0
  135. package/dist/cli/src/flow-discovery.d.ts.map +1 -1
  136. package/dist/cli/src/helpers.d.ts +13 -0
  137. package/dist/cli/src/helpers.d.ts.map +1 -1
  138. package/dist/cli/src/setup.d.ts.map +1 -1
  139. package/dist/connectors/config.js +5 -5
  140. package/dist/connectors/index.js +17 -17
  141. package/dist/connectors/src/connector-manager.d.ts +8 -27
  142. package/dist/connectors/src/connector-manager.d.ts.map +1 -1
  143. package/dist/connectors/src/index.d.ts +1 -1
  144. package/dist/connectors/src/index.d.ts.map +1 -1
  145. package/dist/connectors/src/mount-ledger.d.ts +61 -0
  146. package/dist/connectors/src/mount-ledger.d.ts.map +1 -0
  147. package/dist/{connectors-BQXFKISC.js → connectors-GUN4MRWR.js} +20 -20
  148. package/dist/{connectors-BQXFKISC.js.map → connectors-GUN4MRWR.js.map} +1 -1
  149. package/dist/connectors-shared/index.js +2 -2
  150. package/dist/core/framework.js +1 -1
  151. package/dist/core/index.js +7 -7
  152. package/dist/core/manifest.js +2 -2
  153. package/dist/core/models.js +1 -1
  154. package/dist/core/publish-manifest.js +2 -2
  155. package/dist/core/ref.js +1 -1
  156. package/dist/core/runtime-assets.js +5 -5
  157. package/dist/core/src/framework.d.ts +7 -0
  158. package/dist/core/src/framework.d.ts.map +1 -1
  159. package/dist/core/src/index.d.ts +4 -4
  160. package/dist/core/src/index.d.ts.map +1 -1
  161. package/dist/core/src/lock.d.ts +12 -0
  162. package/dist/core/src/lock.d.ts.map +1 -1
  163. package/dist/core/src/manifest-yaml-editor.d.ts +14 -6
  164. package/dist/core/src/manifest-yaml-editor.d.ts.map +1 -1
  165. package/dist/core/src/models.d.ts +15 -0
  166. package/dist/core/src/models.d.ts.map +1 -1
  167. package/dist/core/src/publish-manifest.d.ts +4 -6
  168. package/dist/core/src/publish-manifest.d.ts.map +1 -1
  169. package/dist/core/src/settings.d.ts.map +1 -1
  170. package/dist/core/workspace-config.js +4 -4
  171. package/dist/deploy/index.js +7 -7
  172. package/dist/discovery/index.js +4 -4
  173. package/dist/discovery/src/discover-manifest.d.ts +5 -0
  174. package/dist/discovery/src/discover-manifest.d.ts.map +1 -1
  175. package/dist/discovery/src/index.d.ts +1 -1
  176. package/dist/discovery/src/index.d.ts.map +1 -1
  177. package/dist/{ensure-sources-CMHOTYFS.js → ensure-sources-VCPA762L.js} +15 -15
  178. package/dist/{ensure-sources-CMHOTYFS.js.map → ensure-sources-VCPA762L.js.map} +1 -1
  179. package/dist/factory-assets/connectors/box.js +17 -17
  180. package/dist/factory-assets/connectors/deploy.js +17 -17
  181. package/dist/factory-assets/connectors/devserver.js +17 -17
  182. package/dist/factory-assets/connectors/flow/adapter.d.ts +28 -4
  183. package/dist/factory-assets/connectors/flow/adapter.d.ts.map +1 -1
  184. package/dist/factory-assets/connectors/flow/adapter.js +17 -17
  185. package/dist/factory-assets/connectors/flow/engine.js +8 -8
  186. package/dist/factory-assets/connectors/flow/index.d.ts +1 -1
  187. package/dist/factory-assets/connectors/flow/index.d.ts.map +1 -1
  188. package/dist/factory-assets/connectors/flow/run-flow.js +19 -19
  189. package/dist/factory-assets/connectors/flow.js +17 -17
  190. package/dist/factory-assets/connectors/git/checkout.d.ts +161 -0
  191. package/dist/factory-assets/connectors/git/checkout.d.ts.map +1 -0
  192. package/dist/factory-assets/connectors/git/config.d.ts +78 -0
  193. package/dist/factory-assets/connectors/git/config.d.ts.map +1 -0
  194. package/dist/factory-assets/connectors/git/credentials.d.ts +93 -0
  195. package/dist/factory-assets/connectors/git/credentials.d.ts.map +1 -0
  196. package/dist/factory-assets/connectors/git/driver.d.ts +39 -598
  197. package/dist/factory-assets/connectors/git/driver.d.ts.map +1 -1
  198. package/dist/factory-assets/connectors/git/exec.d.ts +177 -0
  199. package/dist/factory-assets/connectors/git/exec.d.ts.map +1 -0
  200. package/dist/factory-assets/connectors/git/inspect.d.ts +120 -0
  201. package/dist/factory-assets/connectors/git/inspect.d.ts.map +1 -0
  202. package/dist/factory-assets/connectors/git/lifecycle.d.ts +107 -0
  203. package/dist/factory-assets/connectors/git/lifecycle.d.ts.map +1 -0
  204. package/dist/factory-assets/connectors/git/repo.d.ts +496 -0
  205. package/dist/factory-assets/connectors/git/repo.d.ts.map +1 -0
  206. package/dist/factory-assets/connectors/git.js +17 -17
  207. package/dist/factory-assets/connectors/gmail.js +17 -17
  208. package/dist/factory-assets/connectors/googledrive.js +17 -17
  209. package/dist/factory-assets/connectors/local.js +17 -17
  210. package/dist/factory-assets/connectors/mattermost.js +17 -17
  211. package/dist/factory-assets/connectors/memory.js +17 -17
  212. package/dist/factory-assets/connectors/minio.js +17 -17
  213. package/dist/factory-assets/connectors/postgres.js +17 -17
  214. package/dist/factory-assets/connectors/s3.js +17 -17
  215. package/dist/factory-assets/connectors/sharepoint.js +17 -17
  216. package/dist/factory-assets/connectors/sqlite.js +17 -17
  217. package/dist/factory-assets/connectors/static-server.js +17 -17
  218. package/dist/factory-assets/connectors/tunnel.js +17 -17
  219. package/dist/factory-assets/connectors/webdav.js +17 -17
  220. package/dist/factory-assets/connectors/xstate-store.js +17 -17
  221. package/dist/factory-assets/connectors/xstate.js +17 -17
  222. package/dist/{flows-SVCCADGE.js → flows-BOB5YA5R.js} +12 -12
  223. package/dist/{flows-SVCCADGE.js.map → flows-BOB5YA5R.js.map} +1 -1
  224. package/dist/{helpers-R3GLTAER.js → helpers-ZGK4R5MZ.js} +15 -15
  225. package/dist/{helpers-R3GLTAER.js.map → helpers-ZGK4R5MZ.js.map} +1 -1
  226. package/dist/library/index.js +10 -10
  227. package/dist/library/install.js +2 -2
  228. package/dist/library/src/index.d.ts +6 -3
  229. package/dist/library/src/index.d.ts.map +1 -1
  230. package/dist/library/src/install/install-from-manifest.d.ts +21 -0
  231. package/dist/library/src/install/install-from-manifest.d.ts.map +1 -1
  232. package/dist/library/src/local/install-library-asset.d.ts +64 -0
  233. package/dist/library/src/local/install-library-asset.d.ts.map +1 -0
  234. package/dist/library/src/local/local-catalog-source.d.ts +30 -0
  235. package/dist/library/src/local/local-catalog-source.d.ts.map +1 -1
  236. package/dist/library/src/local/store-paths.d.ts +6 -0
  237. package/dist/library/src/local/store-paths.d.ts.map +1 -1
  238. package/dist/library/src/manifest-writer.d.ts +73 -0
  239. package/dist/library/src/manifest-writer.d.ts.map +1 -0
  240. package/dist/library/src/sync/manifest-writeback.d.ts +2 -17
  241. package/dist/library/src/sync/manifest-writeback.d.ts.map +1 -1
  242. package/dist/{library-publish-EL7VYICU.js → library-publish-RIP6NBYA.js} +20 -21
  243. package/dist/library-publish-RIP6NBYA.js.map +1 -0
  244. package/dist/{open-library-MTD34YX3.js → open-library-4IJTBVTR.js} +18 -18
  245. package/dist/{open-library-MTD34YX3.js.map → open-library-4IJTBVTR.js.map} +1 -1
  246. package/dist/{open-registry-CHCWKV5W.js → open-registry-G5DI4RPU.js} +14 -14
  247. package/dist/{open-registry-CHCWKV5W.js.map → open-registry-G5DI4RPU.js.map} +1 -1
  248. package/dist/paths-L5XLUC3D.js +22 -0
  249. package/dist/{paths-MKSI52PF.js.map → paths-L5XLUC3D.js.map} +1 -1
  250. package/dist/plugin-registry/src/targets.d.ts +3 -1
  251. package/dist/plugin-registry/src/targets.d.ts.map +1 -1
  252. package/dist/{plugin-store-SVYV7L4C.js → plugin-store-QENDYZ63.js} +9 -9
  253. package/dist/{plugin-store-SVYV7L4C.js.map → plugin-store-QENDYZ63.js.map} +1 -1
  254. package/dist/{project-HCNWJP7J.js → project-4INCIIZI.js} +16 -16
  255. package/dist/{project-HCNWJP7J.js.map → project-4INCIIZI.js.map} +1 -1
  256. package/dist/resolver/index.js +8 -8
  257. package/dist/runner/index.js +27 -27
  258. package/dist/runner/src/agent.d.ts +1 -1
  259. package/dist/runner/src/agent.d.ts.map +1 -1
  260. package/dist/runner/src/codex-init.d.ts.map +1 -1
  261. package/dist/runner/src/compaction-gate.d.ts +9 -33
  262. package/dist/runner/src/compaction-gate.d.ts.map +1 -1
  263. package/dist/runner/src/managed-codex-bootstrap.d.ts.map +1 -1
  264. package/dist/runner/src/pending-turns.d.ts +7 -2
  265. package/dist/runner/src/pending-turns.d.ts.map +1 -1
  266. package/dist/runner/src/resources.d.ts +2 -2
  267. package/dist/runner/src/resources.d.ts.map +1 -1
  268. package/dist/runner/src/serve-credentials.d.ts +2 -1
  269. package/dist/runner/src/serve-credentials.d.ts.map +1 -1
  270. package/dist/runner/src/serve.d.ts +19 -35
  271. package/dist/runner/src/serve.d.ts.map +1 -1
  272. package/dist/runner/src/session-builder.d.ts.map +1 -1
  273. package/dist/runner/src/turn-scheduler.d.ts +158 -0
  274. package/dist/runner/src/turn-scheduler.d.ts.map +1 -0
  275. package/dist/sdk/asset-manager.js +12 -12
  276. package/dist/sdk/bridge.js +13 -13
  277. package/dist/sdk/core.js +7 -7
  278. package/dist/sdk/flow.js +8 -8
  279. package/dist/sdk/index.js +27 -27
  280. package/dist/sdk/resolver.js +8 -8
  281. package/dist/sdk/runner.js +27 -27
  282. package/dist/sdk/session.js +2 -2
  283. package/dist/sdk/types.js +1 -1
  284. package/dist/session/index.js +2 -2
  285. package/dist/session/src/dispatcher.d.ts.map +1 -1
  286. package/dist/{setup-HTXNR2CZ.js → setup-RG4PJJUW.js} +23 -23
  287. package/dist/setup-RG4PJJUW.js.map +1 -0
  288. package/dist/{skills-7K2YO3KN.js → skills-CL45F7AG.js} +13 -13
  289. package/dist/{skills-7K2YO3KN.js.map → skills-CL45F7AG.js.map} +1 -1
  290. package/dist/{source-UIFC2PFC.js → source-LJOI5AXU.js} +19 -19
  291. package/dist/{source-UIFC2PFC.js.map → source-LJOI5AXU.js.map} +1 -1
  292. package/dist/{source-manifest-publish-QKAKXDVH.js → source-manifest-publish-QEJML4VS.js} +21 -21
  293. package/dist/{source-manifest-publish-QKAKXDVH.js.map → source-manifest-publish-QEJML4VS.js.map} +1 -1
  294. package/dist/tui/index.js +28 -28
  295. package/dist/tui/index.js.map +1 -1
  296. package/dist/types/index.js +1 -1
  297. package/dist/types/src/delivery.d.ts +26 -0
  298. package/dist/types/src/delivery.d.ts.map +1 -0
  299. package/dist/types/src/index.d.ts +3 -1
  300. package/dist/types/src/index.d.ts.map +1 -1
  301. package/dist/types/src/runtime.d.ts +51 -0
  302. package/dist/types/src/runtime.d.ts.map +1 -1
  303. package/dist/workspace-plugin/adapters/mcp.js +24 -24
  304. package/dist/workspace-plugin/adapters/omp.js +18 -17
  305. package/dist/workspace-plugin/adapters/omp.js.map +1 -1
  306. package/dist/workspace-plugin/index.js +2 -1
  307. package/dist/workspace-plugin/src/adapters/mcp.d.ts.map +1 -1
  308. package/dist/workspace-plugin/src/adapters/omp.d.ts.map +1 -1
  309. package/dist/workspace-plugin/src/plugin.d.ts.map +1 -1
  310. package/package.json +1 -1
  311. package/dist/chunk-2HR3RPWD.js.map +0 -1
  312. package/dist/chunk-43ZBF3WH.js.map +0 -1
  313. package/dist/chunk-7SAWDPUT.js.map +0 -1
  314. package/dist/chunk-AG44ZJ7W.js.map +0 -1
  315. package/dist/chunk-BEOKEK3B.js.map +0 -1
  316. package/dist/chunk-F7JHP7JV.js +0 -122
  317. package/dist/chunk-F7JHP7JV.js.map +0 -1
  318. package/dist/chunk-H4EGUQ7M.js.map +0 -1
  319. package/dist/chunk-I75CM2QF.js.map +0 -1
  320. package/dist/chunk-IDEA6CYI.js.map +0 -1
  321. package/dist/chunk-IWCCZL7C.js.map +0 -1
  322. package/dist/chunk-K5GBV4SA.js.map +0 -1
  323. package/dist/chunk-KNC55536.js.map +0 -1
  324. package/dist/chunk-KWP4RVTJ.js.map +0 -1
  325. package/dist/chunk-M4ISBWXR.js.map +0 -1
  326. package/dist/chunk-RO4Z2CBP.js.map +0 -1
  327. package/dist/chunk-SP47UJKE.js.map +0 -1
  328. package/dist/chunk-UVOJSWD2.js.map +0 -1
  329. package/dist/chunk-WPWJRDR3.js.map +0 -1
  330. package/dist/chunk-XUQBVK4R.js +0 -15
  331. package/dist/chunk-ZD7CX25M.js.map +0 -1
  332. package/dist/library-publish-EL7VYICU.js.map +0 -1
  333. package/dist/paths-MKSI52PF.js +0 -22
  334. package/dist/runner/src/flow-turn-dispatch.d.ts +0 -41
  335. package/dist/runner/src/flow-turn-dispatch.d.ts.map +0 -1
  336. package/dist/runner/src/reply-routing.d.ts +0 -54
  337. package/dist/runner/src/reply-routing.d.ts.map +0 -1
  338. package/dist/setup-HTXNR2CZ.js.map +0 -1
@@ -1,15 +1,17 @@
1
- import { readManifestSourceConfig, discoverAssetsInTree } from './chunk-UVOJSWD2.js';
2
- import { installFromManifest } from './chunk-H4EGUQ7M.js';
3
- import { defaultLibraryDir, resolveLibraryDir } from './chunk-IWCCZL7C.js';
4
- import { getGlobalCacheDir, resolveSourcePublisher } from './chunk-MXXKTQXJ.js';
1
+ import { barePublisher, createDefaultRegistry, sharesItsFolder, readManifestSourceConfig, discoverAssetsInTree } from './chunk-LZ5RH6LD.js';
2
+ import { installFromManifest, assertSafeManifestPath } from './chunk-4YE7OYTB.js';
3
+ import { defaultLibraryDir, resolveLibraryDir, readLock, buildLibraryLockEntries, writeLock, mergeLockFile, buildLockFile, ManifestYamlEditor } from './chunk-BIMEKYOE.js';
4
+ import { getGlobalCacheDir, storeManifestSlug, resolveSourcePublisher } from './chunk-P2EM6FNQ.js';
5
5
  import { globalSkaileDir, mergeLegacyEntriesInto, migrateLegacyDir, globalCacheRoot } from './chunk-TLKM4M47.js';
6
- import { encodeSkaileManifest } from './chunk-AG44ZJ7W.js';
7
- import { parseAssetRef } from './chunk-43ZBF3WH.js';
6
+ import { encodeSkaileManifest, loadSkPublishManifest, SKAILE_MANIFEST_FILENAME } from './chunk-YRF5CYHR.js';
7
+ import { scanDirectory } from './chunk-YANDJSMN.js';
8
+ import { parseAssetRef, assetRefToStr } from './chunk-OABIGSUY.js';
8
9
  import { PresetManifestSchema } from './chunk-5CYEWBPB.js';
9
10
  import { __export } from './chunk-NSBPE2FW.js';
10
11
  import * as fs10 from 'fs';
11
- import { existsSync, mkdirSync } from 'fs';
12
- import * as path5 from 'path';
12
+ import { existsSync, mkdirSync, symlinkSync, copyFileSync, cpSync } from 'fs';
13
+ import * as path4 from 'path';
14
+ import { resolve, relative, sep, join, dirname } from 'path';
13
15
  import { stringify, parse, parseDocument } from 'yaml';
14
16
  import * as z3 from 'zod';
15
17
  import * as crypto from 'crypto';
@@ -18,6 +20,7 @@ import { createClient } from '@libsql/client';
18
20
  import { drizzle } from 'drizzle-orm/libsql';
19
21
  import { sqliteTable, text, integer } from 'drizzle-orm/sqlite-core';
20
22
  import { spawnSync } from 'child_process';
23
+ import { isDeepStrictEqual } from 'util';
21
24
 
22
25
  // library/src/library.ts
23
26
  var KNOWN_ASSET_KINDS = [
@@ -113,7 +116,7 @@ var SkaileConfigSchema = z3.object({
113
116
  library: LibraryConfigSchema.optional()
114
117
  });
115
118
  function defaultIndexPath() {
116
- return path5.join(globalSkaileDir(), "index.db");
119
+ return path4.join(globalSkaileDir(), "index.db");
117
120
  }
118
121
  function resolveIndexPath() {
119
122
  if (process.env.SKAILE_INDEX_PATH) return process.env.SKAILE_INDEX_PATH;
@@ -127,10 +130,10 @@ function getConfigDefaults() {
127
130
  }
128
131
  var CONFIG_FILENAME = "config.yaml";
129
132
  function userConfigPath() {
130
- return path5.join(globalSkaileDir(), CONFIG_FILENAME);
133
+ return path4.join(globalSkaileDir(), CONFIG_FILENAME);
131
134
  }
132
135
  function projectConfigPath(projectDir) {
133
- return path5.join(projectDir, ".skaile", CONFIG_FILENAME);
136
+ return path4.join(projectDir, ".skaile", CONFIG_FILENAME);
134
137
  }
135
138
  function loadConfigFile(filePath) {
136
139
  if (!fs10.existsSync(filePath)) return null;
@@ -183,7 +186,7 @@ function resolveConfig(opts) {
183
186
  return resolved;
184
187
  }
185
188
  function saveConfig(filePath, config) {
186
- const dir = path5.dirname(filePath);
189
+ const dir = path4.dirname(filePath);
187
190
  if (!fs10.existsSync(dir)) {
188
191
  fs10.mkdirSync(dir, { recursive: true });
189
192
  }
@@ -213,11 +216,11 @@ function validateKnowledge(data) {
213
216
 
214
217
  // library/src/knowledge/knowledge-kind-provider.ts
215
218
  function collectDirRecursive(baseDir, relativeDir) {
216
- const full = path5.join(baseDir, relativeDir);
219
+ const full = path4.join(baseDir, relativeDir);
217
220
  if (!fs10.existsSync(full) || !fs10.statSync(full).isDirectory()) return [];
218
221
  const results = [];
219
222
  for (const entry of fs10.readdirSync(full, { withFileTypes: true })) {
220
- const rel = path5.posix.join(relativeDir, entry.name);
223
+ const rel = path4.posix.join(relativeDir, entry.name);
221
224
  if (entry.isDirectory()) {
222
225
  results.push(...collectDirRecursive(baseDir, rel));
223
226
  } else if (entry.isFile()) {
@@ -244,8 +247,8 @@ var knowledgeKindProvider = {
244
247
  return validateKnowledge(data);
245
248
  },
246
249
  defaultFileFilter(manifestPath) {
247
- const dir = path5.dirname(manifestPath);
248
- const manifestName = path5.basename(manifestPath);
250
+ const dir = path4.dirname(manifestPath);
251
+ const manifestName = path4.basename(manifestPath);
249
252
  const files = [manifestName];
250
253
  files.push(...collectDirRecursive(dir, "documents"));
251
254
  files.sort();
@@ -324,30 +327,30 @@ var assignments = sqliteTable("assignments", {
324
327
  assignedAt: text("assigned_at").notNull()
325
328
  });
326
329
  function isClone(dir) {
327
- return fs10.existsSync(path5.join(dir, ".git"));
330
+ return fs10.existsSync(path4.join(dir, ".git"));
328
331
  }
329
332
  function getSidecarRoot() {
330
333
  const home = globalSkaileDir();
331
- const sidecars = path5.join(home, "sidecars");
332
- const legacy = path5.join(home, "sources");
334
+ const sidecars = path4.join(home, "sidecars");
335
+ const legacy = path4.join(home, "sources");
333
336
  mergeLegacyEntriesInto(getGlobalCacheDir(), legacy, isClone);
334
337
  mergeLegacyEntriesInto(sidecars, legacy, (p) => !isClone(p));
335
338
  return sidecars;
336
339
  }
337
340
  function resolveSidecarPaths(slug) {
338
341
  const rootDir = getSidecarRoot();
339
- const sidecarDir = path5.join(rootDir, slug);
342
+ const sidecarDir = path4.join(rootDir, slug);
340
343
  return {
341
344
  rootDir,
342
345
  sidecarDir,
343
- manifestFile: path5.join(sidecarDir, "skaile.manifest.yaml"),
344
- readmeFile: path5.join(sidecarDir, "README.md"),
345
- lockFile: path5.join(sidecarDir, "skaile.manifest.lock.json")
346
+ manifestFile: path4.join(sidecarDir, "skaile.manifest.yaml"),
347
+ readmeFile: path4.join(sidecarDir, "README.md"),
348
+ lockFile: path4.join(sidecarDir, "skaile.manifest.lock.json")
346
349
  };
347
350
  }
348
351
  function deriveSlug(sourceConfig, sourcePath, existingSlugs) {
349
352
  const fromConfig = sourceConfig && typeof sourceConfig.name === "string" ? sourceConfig.name : void 0;
350
- const base = fromConfig && fromConfig.length > 0 ? slugify(fromConfig) : slugify(path5.basename(sourcePath || "")) || "unnamed-source";
353
+ const base = fromConfig && fromConfig.length > 0 ? slugify(fromConfig) : slugify(path4.basename(sourcePath || "")) || "unnamed-source";
351
354
  const taken = new Set(existingSlugs);
352
355
  if (!taken.has(base)) return base;
353
356
  for (let i = 2; i < 1e3; i++) {
@@ -373,13 +376,17 @@ function slugify(input) {
373
376
 
374
377
  // library/src/local/store-paths.ts
375
378
  function getStoreRoot() {
376
- return path5.join(globalSkaileDir(), "store");
379
+ return path4.join(globalSkaileDir(), "store");
377
380
  }
378
381
  function getStoreManifestsDir() {
379
- return path5.join(getStoreRoot(), "manifests");
382
+ return path4.join(getStoreRoot(), "manifests");
383
+ }
384
+ function curatedManifestOverlay(sourceUrl) {
385
+ const file = path4.join(getStoreManifestsDir(), `${storeManifestSlug(sourceUrl)}.yaml`);
386
+ return fs10.existsSync(file) ? file : void 0;
380
387
  }
381
388
  function migratedMarkerPath() {
382
- return path5.join(getStoreRoot(), ".migrated");
389
+ return path4.join(getStoreRoot(), ".migrated");
383
390
  }
384
391
  function collectSidecarMigrationCandidates(sidecarRoot) {
385
392
  const candidates = [];
@@ -387,9 +394,9 @@ function collectSidecarMigrationCandidates(sidecarRoot) {
387
394
  for (const entry of fs10.readdirSync(sidecarRoot, { withFileTypes: true })) {
388
395
  if (!entry.isDirectory()) continue;
389
396
  if (entry.name.startsWith(".")) continue;
390
- const sidecarDir = path5.join(sidecarRoot, entry.name);
391
- const current = path5.join(sidecarDir, "skaile.manifest.yaml");
392
- const legacy = path5.join(sidecarDir, ".skaile-source.yaml");
397
+ const sidecarDir = path4.join(sidecarRoot, entry.name);
398
+ const current = path4.join(sidecarDir, "skaile.manifest.yaml");
399
+ const legacy = path4.join(sidecarDir, ".skaile-source.yaml");
393
400
  const src = fs10.existsSync(current) ? current : fs10.existsSync(legacy) ? legacy : void 0;
394
401
  if (src) candidates.push({ src, slug: entry.name });
395
402
  }
@@ -399,7 +406,7 @@ function collectSidecarMigrationCandidates(sidecarRoot) {
399
406
  function moveSidecarManifests(candidates, manifestsDir) {
400
407
  let migrated = 0;
401
408
  for (const { src, slug } of candidates) {
402
- const dest = path5.join(manifestsDir, `${slug}.yaml`);
409
+ const dest = path4.join(manifestsDir, `${slug}.yaml`);
403
410
  if (fs10.existsSync(dest)) continue;
404
411
  try {
405
412
  fs10.renameSync(src, dest);
@@ -414,11 +421,11 @@ function moveSidecarManifests(candidates, manifestsDir) {
414
421
  return migrated;
415
422
  }
416
423
  function initStoreGitRepo(storeRoot) {
417
- if (fs10.existsSync(path5.join(storeRoot, ".git"))) return;
424
+ if (fs10.existsSync(path4.join(storeRoot, ".git"))) return;
418
425
  try {
419
426
  spawnSync("git", ["init", "--quiet"], { cwd: storeRoot, stdio: "ignore" });
420
427
  fs10.writeFileSync(
421
- path5.join(storeRoot, ".gitignore"),
428
+ path4.join(storeRoot, ".gitignore"),
422
429
  "# Remote-store cache \u2014 local to this machine.\nremote-cache/\n",
423
430
  "utf8"
424
431
  );
@@ -516,7 +523,7 @@ async function librariesPresent(client) {
516
523
  return rs.rows.length > 0;
517
524
  }
518
525
  function slugify2(p) {
519
- const base = path5.basename(p) || "lib";
526
+ const base = path4.basename(p) || "lib";
520
527
  return base.toLowerCase().replace(/[^a-z0-9-]+/g, "-").replace(/^-|-$/g, "") || "lib";
521
528
  }
522
529
  async function runLibrariesMigration(client) {
@@ -681,19 +688,19 @@ async function purgeOrphanedAssetDefinitions(client) {
681
688
  }
682
689
  function assertNoLegacyLibDb(newDbPath) {
683
690
  if (fs10.existsSync(newDbPath)) return;
684
- const parent = path5.dirname(newDbPath);
691
+ const parent = path4.dirname(newDbPath);
685
692
  const skaileHome = globalSkaileDir();
686
- const defaultIndexPath2 = path5.join(skaileHome, "index.db");
693
+ const defaultIndexPath2 = path4.join(skaileHome, "index.db");
687
694
  const candidates = [];
688
- if (path5.basename(newDbPath) === "index.db") {
689
- candidates.push(path5.join(parent, "lib.db"));
695
+ if (path4.basename(newDbPath) === "index.db") {
696
+ candidates.push(path4.join(parent, "lib.db"));
690
697
  }
691
698
  if (newDbPath === defaultIndexPath2) {
692
- candidates.push(path5.join(skaileHome, "libraries", "lib.db"));
693
- candidates.push(path5.join(skaileHome, "library", "lib.db"));
699
+ candidates.push(path4.join(skaileHome, "libraries", "lib.db"));
700
+ candidates.push(path4.join(skaileHome, "library", "lib.db"));
694
701
  }
695
- if (path5.basename(parent) === "libraries") {
696
- candidates.push(path5.join(path5.dirname(parent), "library", "lib.db"));
702
+ if (path4.basename(parent) === "libraries") {
703
+ candidates.push(path4.join(path4.dirname(parent), "library", "lib.db"));
697
704
  }
698
705
  for (const legacy of candidates) {
699
706
  if (!fs10.existsSync(legacy)) continue;
@@ -855,14 +862,14 @@ var LocalIndex = class {
855
862
  let dbPath;
856
863
  if (typeof optionsOrDir === "string") {
857
864
  dir = optionsOrDir;
858
- dbPath = path5.join(dir, "index.db");
865
+ dbPath = path4.join(dir, "index.db");
859
866
  } else if (optionsOrDir?.indexPath) {
860
867
  dbPath = optionsOrDir.indexPath;
861
868
  dir = optionsOrDir.libraryDir ?? resolveLibraryDir();
862
869
  this._kindRegistry = optionsOrDir.kindRegistry;
863
870
  } else if (optionsOrDir?.libraryDir) {
864
871
  dir = optionsOrDir.libraryDir;
865
- dbPath = path5.join(dir, "index.db");
872
+ dbPath = path4.join(dir, "index.db");
866
873
  this._kindRegistry = optionsOrDir.kindRegistry;
867
874
  } else {
868
875
  dir = resolveLibraryDir();
@@ -872,7 +879,7 @@ var LocalIndex = class {
872
879
  if (!fs10.existsSync(dir)) {
873
880
  fs10.mkdirSync(dir, { recursive: true });
874
881
  }
875
- const dbParent = path5.dirname(dbPath);
882
+ const dbParent = path4.dirname(dbPath);
876
883
  if (!fs10.existsSync(dbParent)) {
877
884
  fs10.mkdirSync(dbParent, { recursive: true });
878
885
  }
@@ -1094,7 +1101,7 @@ var LocalIndex = class {
1094
1101
  * @returns The created Instance plus its on-disk install path.
1095
1102
  */
1096
1103
  async install(manifest, opts) {
1097
- const libraryRoot = opts?.libraryRoot ?? path5.join(this.libraryDir, "installed");
1104
+ const libraryRoot = opts?.libraryRoot ?? path4.join(this.libraryDir, "installed");
1098
1105
  const { installPath } = await installFromManifest({
1099
1106
  manifest,
1100
1107
  libraryRoot,
@@ -1251,7 +1258,7 @@ function git(cwd, args) {
1251
1258
  return spawnSync("git", args, { cwd, encoding: "utf-8" });
1252
1259
  }
1253
1260
  function isGitRepo(libPath) {
1254
- return existsSync(path5.join(libPath, ".git"));
1261
+ return existsSync(path4.join(libPath, ".git"));
1255
1262
  }
1256
1263
  function spawnGit(cwd, args, action) {
1257
1264
  const r = git(cwd, args);
@@ -1606,7 +1613,7 @@ var LibraryManager = class {
1606
1613
  (l) => l.isDefault && (l.ownership === "owner" || l.ownership === "contributor")
1607
1614
  );
1608
1615
  if (writableDefault) return { library: writableDefault, created: false };
1609
- const personalPath = path5.join(librariesDir, "personal");
1616
+ const personalPath = path4.join(librariesDir, "personal");
1610
1617
  fs10.mkdirSync(personalPath, { recursive: true });
1611
1618
  const lib = await this.addLibrary({
1612
1619
  name: "personal",
@@ -1637,6 +1644,24 @@ function describeSyncError(err) {
1637
1644
  }
1638
1645
  return parts.join(": ");
1639
1646
  }
1647
+ function scanLibraryRoot(rootPath, registry, scanOpts) {
1648
+ const fallbackPublisher = resolveSourcePublisher(rootPath) ?? (path4.basename(rootPath) || "unknown");
1649
+ const opts = {
1650
+ registry,
1651
+ sidecarManifestFile: scanOpts?.sidecarManifestFile,
1652
+ sidecarPath: scanOpts?.sidecarPath,
1653
+ includeDev: scanOpts?.includeDev ?? false,
1654
+ publisher: fallbackPublisher
1655
+ };
1656
+ if (!scanOpts?.sidecarPath && !scanOpts?.sidecarManifestFile) {
1657
+ opts.sourceConfig = readManifestSourceConfig(rootPath, fallbackPublisher);
1658
+ }
1659
+ return discoverAssetsInTree(rootPath, opts);
1660
+ }
1661
+ function libraryScanOptions(library) {
1662
+ const url = library.ownership === "reader" && library.backendConfig && "url" in library.backendConfig ? library.backendConfig.url : void 0;
1663
+ return { includeDev: true, sidecarManifestFile: url ? curatedManifestOverlay(url) : void 0 };
1664
+ }
1640
1665
  var LocalCatalogSource = class {
1641
1666
  constructor(library, sourceId, rootPath, registry, options) {
1642
1667
  this.library = library;
@@ -1673,9 +1698,9 @@ var LocalCatalogSource = class {
1673
1698
  libraryId: this.sourceId,
1674
1699
  kind: parsed.kind
1675
1700
  });
1676
- const wantPublisher = parsed.publisher?.replace(/^@/, "");
1701
+ const wantPublisher = parsed.publisher === void 0 ? void 0 : barePublisher(parsed.publisher);
1677
1702
  return defs.filter(
1678
- (d) => d.name === parsed.name && (wantPublisher === void 0 || d.publisher.replace(/^@/, "") === wantPublisher)
1703
+ (d) => d.name === parsed.name && (wantPublisher === void 0 || barePublisher(d.publisher) === wantPublisher)
1679
1704
  ).map((d) => d.version);
1680
1705
  }
1681
1706
  async fetchTarball(_ref, _sha256) {
@@ -1696,18 +1721,11 @@ var LocalCatalogSource = class {
1696
1721
  * config's `dev_paths` (e.g. `ai-assets-dev/`) are discovered too.
1697
1722
  */
1698
1723
  scan(scanOpts) {
1699
- const fallbackPublisher = resolveSourcePublisher(this.rootPath) ?? (path5.basename(this.rootPath) || "unknown");
1700
- const opts = {
1701
- registry: this.registry,
1702
- sidecarManifestFile: this.sidecarManifestFile,
1724
+ return scanLibraryRoot(this.rootPath, this.registry, {
1703
1725
  sidecarPath: this.sidecarPath,
1704
- includeDev: scanOpts?.includeDev ?? false,
1705
- publisher: fallbackPublisher
1706
- };
1707
- if (!this.sidecarPath && !this.sidecarManifestFile) {
1708
- opts.sourceConfig = readManifestSourceConfig(this.rootPath, fallbackPublisher);
1709
- }
1710
- return discoverAssetsInTree(this.rootPath, opts);
1726
+ sidecarManifestFile: this.sidecarManifestFile,
1727
+ includeDev: scanOpts?.includeDev
1728
+ });
1711
1729
  }
1712
1730
  /**
1713
1731
  * Sync: discover assets in the source directory and cache them in the library.
@@ -1793,6 +1811,61 @@ function defToCatalogAsset(def) {
1793
1811
  manifest: def.manifest
1794
1812
  };
1795
1813
  }
1814
+
1815
+ // library/src/local/install-library-asset.ts
1816
+ function installLibraryAsset(opts) {
1817
+ const { def, library, mode } = opts;
1818
+ const publisher = barePublisher(def.publisher);
1819
+ const ref = assetRefToStr({ kind: def.kind, name: def.name, publisher, pin: def.version });
1820
+ const registry = opts.registry ?? createDefaultRegistry();
1821
+ const found = scanLibraryRoot(library.path, registry, libraryScanOptions(library)).assets.find(
1822
+ (a) => a.kind === def.kind && a.name === def.name && barePublisher(a.publisher) === publisher && a.version === def.version
1823
+ );
1824
+ if (!found) {
1825
+ const reindex = library.ownership === "reader" ? "skaile source sync" : `skaile library index ${library.name}`;
1826
+ throw new Error(
1827
+ `${ref} not found in library "${library.name}" at version ${def.version} \u2014 run \`${reindex}\``
1828
+ );
1829
+ }
1830
+ if (def.sha256 && found.sha256 !== def.sha256) {
1831
+ throw new Error(
1832
+ `hash mismatch for ${ref}: indexed ${def.sha256}, library has ${found.sha256} \u2014 run \`skaile library index ${library.name}\``
1833
+ );
1834
+ }
1835
+ const libRoot = resolve(library.path);
1836
+ const srcRoot = resolve(found.fileFilter.assetRoot);
1837
+ const target = resolve(opts.targetDir);
1838
+ const fileScoped = sharesItsFolder(def.kind, registry);
1839
+ const manifestAbs = resolve(found.manifestPath);
1840
+ const src = fileScoped ? manifestAbs : srcRoot;
1841
+ const rel = relative(libRoot, src).split(sep).join("/");
1842
+ if (!rel) {
1843
+ throw new Error(`${ref} sits at the root of library "${library.name}"; move it into a folder`);
1844
+ }
1845
+ assertSafeManifestPath(target, rel);
1846
+ const installPath = resolve(target, rel);
1847
+ const lockPath = join(target, "skaile.lock.yaml");
1848
+ const prevLock = readLock(lockPath);
1849
+ mkdirSync(dirname(installPath), { recursive: true });
1850
+ if (mode === "link") symlinkSync(src, installPath);
1851
+ else if (fileScoped) copyFileSync(src, installPath);
1852
+ else cpSync(src, installPath, { recursive: true });
1853
+ const lockEntries = buildLibraryLockEntries([
1854
+ {
1855
+ kind: def.kind,
1856
+ publisher,
1857
+ name: def.name,
1858
+ library: {
1859
+ name: library.name,
1860
+ version: def.version,
1861
+ sha256: found.sha256,
1862
+ installed: mode
1863
+ }
1864
+ }
1865
+ ]);
1866
+ writeLock(lockPath, mergeLockFile(prevLock, buildLockFile([], /* @__PURE__ */ new Set(), lockEntries)));
1867
+ return { installPath, lockKey: Object.keys(lockEntries)[0] ?? ref, sha256: found.sha256 };
1868
+ }
1796
1869
  var FALLBACK_USER_NAME = "Skaile CLI";
1797
1870
  var FALLBACK_USER_EMAIL = "skaile-cli@local";
1798
1871
  var ROOT_README = `# Skaile Sidecar Manifests
@@ -1840,7 +1913,7 @@ var SidecarGit = class {
1840
1913
  if (!fs10.existsSync(this.rootDir)) {
1841
1914
  fs10.mkdirSync(this.rootDir, { recursive: true });
1842
1915
  }
1843
- const gitDir = path5.join(this.rootDir, ".git");
1916
+ const gitDir = path4.join(this.rootDir, ".git");
1844
1917
  const freshRepo = !fs10.existsSync(gitDir);
1845
1918
  if (freshRepo) {
1846
1919
  const init = this.spawn(["init", "-b", "main"]);
@@ -1848,9 +1921,9 @@ var SidecarGit = class {
1848
1921
  throw new Error(`git init failed: ${init.stderr || init.stdout}`);
1849
1922
  }
1850
1923
  }
1851
- const attrsPath = path5.join(this.rootDir, ".gitattributes");
1924
+ const attrsPath = path4.join(this.rootDir, ".gitattributes");
1852
1925
  if (!fs10.existsSync(attrsPath)) fs10.writeFileSync(attrsPath, GITATTRIBUTES, "utf-8");
1853
- const readmePath = path5.join(this.rootDir, "README.md");
1926
+ const readmePath = path4.join(this.rootDir, "README.md");
1854
1927
  if (!fs10.existsSync(readmePath)) fs10.writeFileSync(readmePath, ROOT_README, "utf-8");
1855
1928
  if (!this.hasGlobalGitConfig("user.name")) {
1856
1929
  this.spawn(["config", "user.name", FALLBACK_USER_NAME]);
@@ -1876,7 +1949,7 @@ var SidecarGit = class {
1876
1949
  */
1877
1950
  async commit(slug, message, opts) {
1878
1951
  if (opts?.skip) return;
1879
- const slugDir = path5.join(this.rootDir, slug);
1952
+ const slugDir = path4.join(this.rootDir, slug);
1880
1953
  if (fs10.existsSync(slugDir)) {
1881
1954
  this.spawn(["add", "--", slug]);
1882
1955
  } else {
@@ -1937,7 +2010,7 @@ ${result.stderr}`;
1937
2010
  };
1938
2011
  function migrateWorkspaceConfig(dir, opts) {
1939
2012
  const filename = opts?.filename ?? "skaile.yaml";
1940
- const filePath = path5.join(dir, filename);
2013
+ const filePath = path4.join(dir, filename);
1941
2014
  if (!fs10.existsSync(filePath)) {
1942
2015
  return { migrated: false, version: 1, warnings: ["No skaile.yaml found"] };
1943
2016
  }
@@ -2162,8 +2235,8 @@ function resolveTemplate(template, context) {
2162
2235
  });
2163
2236
  return { value: result, hasSecret: false };
2164
2237
  }
2165
- function setNestedValue(obj, path15, value) {
2166
- const parts = path15.split(".");
2238
+ function setNestedValue(obj, path16, value) {
2239
+ const parts = path16.split(".");
2167
2240
  let current = obj;
2168
2241
  for (let i = 0; i < parts.length - 1; i++) {
2169
2242
  const key = parts[i];
@@ -2768,8 +2841,8 @@ function deepEqual(a, b) {
2768
2841
  function defaultCatalogCacheDir() {
2769
2842
  const home = globalSkaileDir();
2770
2843
  return migrateLegacyDir(
2771
- path5.join(globalCacheRoot(), "catalog"),
2772
- path5.join(home, "catalog-cache")
2844
+ path4.join(globalCacheRoot(), "catalog"),
2845
+ path4.join(home, "catalog-cache")
2773
2846
  );
2774
2847
  }
2775
2848
  var INDEX_FILE = "index.json";
@@ -2842,7 +2915,7 @@ var CatalogCache = class {
2842
2915
  // ── public: tarball cache ───────────────────────────────────────────────
2843
2916
  /** Absolute path where a tarball with `sha256` would be cached. */
2844
2917
  tarballPath(sha256) {
2845
- return path5.join(this.dir, TARBALL_DIR, `${sha256}.tgz`);
2918
+ return path4.join(this.dir, TARBALL_DIR, `${sha256}.tgz`);
2846
2919
  }
2847
2920
  /** Read a cached tarball from disk if present, otherwise `null`. */
2848
2921
  readTarball(sha256) {
@@ -2852,7 +2925,7 @@ var CatalogCache = class {
2852
2925
  }
2853
2926
  /** Persist a tarball blob to disk (atomic write). */
2854
2927
  writeTarball(sha256, bytes) {
2855
- const dir = path5.join(this.dir, TARBALL_DIR);
2928
+ const dir = path4.join(this.dir, TARBALL_DIR);
2856
2929
  if (!fs10.existsSync(dir)) fs10.mkdirSync(dir, { recursive: true });
2857
2930
  const finalPath = this.tarballPath(sha256);
2858
2931
  const tmpPath = `${finalPath}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;
@@ -2876,7 +2949,7 @@ var CatalogCache = class {
2876
2949
  */
2877
2950
  invalidateEverything() {
2878
2951
  this.invalidateAll();
2879
- const tarballDir = path5.join(this.dir, TARBALL_DIR);
2952
+ const tarballDir = path4.join(this.dir, TARBALL_DIR);
2880
2953
  if (fs10.existsSync(tarballDir)) {
2881
2954
  fs10.rmSync(tarballDir, { recursive: true, force: true });
2882
2955
  }
@@ -2888,11 +2961,11 @@ var CatalogCache = class {
2888
2961
  // ── private ─────────────────────────────────────────────────────────────
2889
2962
  ensureDir() {
2890
2963
  if (!fs10.existsSync(this.dir)) fs10.mkdirSync(this.dir, { recursive: true });
2891
- const tarballDir = path5.join(this.dir, TARBALL_DIR);
2964
+ const tarballDir = path4.join(this.dir, TARBALL_DIR);
2892
2965
  if (!fs10.existsSync(tarballDir)) fs10.mkdirSync(tarballDir, { recursive: true });
2893
2966
  }
2894
2967
  indexPath() {
2895
- return path5.join(this.dir, INDEX_FILE);
2968
+ return path4.join(this.dir, INDEX_FILE);
2896
2969
  }
2897
2970
  loadIndex() {
2898
2971
  if (this.index) return this.index;
@@ -3726,37 +3799,8 @@ var defaultFetch2 = async (url, init) => {
3726
3799
  signal: requestInit.signal ?? AbortSignal.timeout(CATALOG_REQUEST_TIMEOUT_MS2)
3727
3800
  });
3728
3801
  };
3729
- var MANIFEST_FILENAME = "skaile.manifest.yaml";
3730
- async function writeManifestIfMissing(input) {
3731
- const manifestPath = path5.join(input.libraryPath, MANIFEST_FILENAME);
3732
- if (fs10.existsSync(manifestPath)) return { wrote: false, manifestPath };
3733
- const now = (/* @__PURE__ */ new Date()).toISOString();
3734
- const yaml = `# Generated by skaile library add on ${now}
3735
- # Edit by hand to inline discovered assets; or run \`skaile library refresh-manifest\`.
3736
- publisher: ""
3737
- assets: []
3738
- `;
3739
- fs10.writeFileSync(manifestPath, yaml, "utf-8");
3740
- if (input.ownership !== "owner") {
3741
- const excludePath = path5.join(input.libraryPath, ".git", "info", "exclude");
3742
- if (fs10.existsSync(path5.dirname(excludePath))) {
3743
- const current = fs10.existsSync(excludePath) ? fs10.readFileSync(excludePath, "utf-8") : "";
3744
- if (!current.includes(MANIFEST_FILENAME)) {
3745
- fs10.writeFileSync(
3746
- excludePath,
3747
- (current.endsWith("\n") || current === "" ? current : `${current}
3748
- `) + `# skaile-managed local-overlay manifest
3749
- ${MANIFEST_FILENAME}
3750
- `,
3751
- "utf-8"
3752
- );
3753
- }
3754
- }
3755
- }
3756
- return { wrote: true, manifestPath };
3757
- }
3758
3802
  function discoveredToAssetEntry(asset, repoPublisher, inheritPublisher) {
3759
- const root = path5.posix.dirname(asset.relativePath.replace(/\\/g, "/"));
3803
+ const root = path4.posix.dirname(asset.relativePath.replace(/\\/g, "/"));
3760
3804
  const entry = {
3761
3805
  kind: asset.kind,
3762
3806
  name: asset.name,
@@ -3780,10 +3824,83 @@ function writeCuratedManifest(input) {
3780
3824
  const inheritPublisher = input.inheritPublisher ?? false;
3781
3825
  const assets = input.assets.filter((a) => a.kind !== "preset").map((a) => discoveredToAssetEntry(a, publisher, inheritPublisher)).sort((a, b) => `${a.kind}:${a.name}`.localeCompare(`${b.kind}:${b.name}`));
3782
3826
  const manifest = { publisher, assets };
3783
- fs10.mkdirSync(path5.dirname(manifestPath), { recursive: true });
3827
+ fs10.mkdirSync(path4.dirname(manifestPath), { recursive: true });
3784
3828
  fs10.writeFileSync(manifestPath, encodeSkaileManifest(manifest), "utf-8");
3785
3829
  return { wrote: true, manifestPath, assetCount: assets.length };
3786
3830
  }
3831
+ function openManifest(libraryPath) {
3832
+ const dir = path4.resolve(libraryPath);
3833
+ const file = path4.join(dir, SKAILE_MANIFEST_FILENAME);
3834
+ if (!fs10.existsSync(file)) {
3835
+ fs10.mkdirSync(dir, { recursive: true });
3836
+ return { editor: ManifestYamlEditor.create(file), created: true };
3837
+ }
3838
+ const editor = ManifestYamlEditor.load(file);
3839
+ const problem = editor.problem();
3840
+ if (problem) throw new Error(`${file} is not a valid manifest: ${problem}`);
3841
+ return { editor, created: false };
3842
+ }
3843
+ function assertManifestEditable(libraryPath) {
3844
+ openManifest(libraryPath);
3845
+ }
3846
+ function upsertManifestAsset(libraryPath, input) {
3847
+ const { editor } = openManifest(libraryPath);
3848
+ const declared = editor.getPublisher();
3849
+ const topLevel = declared === void 0 ? void 0 : barePublisher(declared);
3850
+ const overridesTopLevel = !!input.publisher && input.publisher !== topLevel;
3851
+ const entry = { kind: input.kind, name: input.name, root: input.root };
3852
+ if (input.version) entry.version = input.version;
3853
+ if (overridesTopLevel) entry.publisher = input.publisher;
3854
+ if (input.description) entry.description = input.description;
3855
+ if (input.keywords && input.keywords.length > 0) entry.keywords = input.keywords;
3856
+ const existing = editor.getAssets().find((a) => a.kind === input.kind && a.name === input.name);
3857
+ const next = existing ? { ...existing, ...entry } : entry;
3858
+ if (existing && input.publisher && !overridesTopLevel) delete next.publisher;
3859
+ if (!existing || !isDeepStrictEqual(existing, next)) {
3860
+ editor.setAsset(next);
3861
+ editor.save();
3862
+ }
3863
+ return { manifestPath: editor.path, added: !existing };
3864
+ }
3865
+ function missingRootAssets(libraryPath, manifest) {
3866
+ return (manifest.assets ?? []).filter((a) => {
3867
+ if (a.source || manifest.source || !a.root) return false;
3868
+ const dir = path4.resolve(libraryPath, a.root);
3869
+ return !(fs10.existsSync(dir) && fs10.statSync(dir).isDirectory());
3870
+ });
3871
+ }
3872
+ function pruneMissingRootAssets(libraryPath) {
3873
+ const manifest = loadSkPublishManifest(libraryPath);
3874
+ if (!manifest) return [];
3875
+ const missing = missingRootAssets(libraryPath, manifest);
3876
+ if (missing.length === 0) return [];
3877
+ const { editor } = openManifest(libraryPath);
3878
+ const removed = missing.filter((a) => editor.removeAsset(a.kind, a.name));
3879
+ if (removed.length > 0) editor.save();
3880
+ return removed;
3881
+ }
3882
+ function stampManifestPublisher(libraryPath, publisher) {
3883
+ const { editor, created } = openManifest(libraryPath);
3884
+ if (editor.getPublisher()) return false;
3885
+ editor.setPublisher(publisher);
3886
+ if (created) editor.ensureAssets();
3887
+ editor.save();
3888
+ return true;
3889
+ }
3890
+ async function syncManifestWithDisk(libraryPath, defaultPublisher) {
3891
+ stampManifestPublisher(libraryPath, defaultPublisher);
3892
+ const removed = pruneMissingRootAssets(libraryPath);
3893
+ const publisher = loadSkPublishManifest(libraryPath)?.publisher ?? defaultPublisher;
3894
+ for (const e of await scanDirectory(libraryPath, publisher)) {
3895
+ upsertManifestAsset(libraryPath, {
3896
+ kind: e.kind,
3897
+ name: e.name,
3898
+ root: path4.relative(libraryPath, path4.dirname(e.source)) || e.name,
3899
+ version: e.version
3900
+ });
3901
+ }
3902
+ return removed;
3903
+ }
3787
3904
  var PinPolicySchema = z3.enum(PIN_POLICIES);
3788
3905
  var LibraryInstanceRefSchema = z3.object({
3789
3906
  id: z3.string().uuid(),
@@ -3836,7 +3953,7 @@ function parseWorkspaceV2(raw) {
3836
3953
  return WorkspaceConfigV2Schema.parse(raw);
3837
3954
  }
3838
3955
  function loadWorkspaceV2(dir, filename = "skaile.yaml") {
3839
- const filePath = path5.join(dir, filename);
3956
+ const filePath = path4.join(dir, filename);
3840
3957
  if (!fs10.existsSync(filePath)) return null;
3841
3958
  const content = fs10.readFileSync(filePath, "utf-8");
3842
3959
  const raw = parse(content);
@@ -3844,7 +3961,7 @@ function loadWorkspaceV2(dir, filename = "skaile.yaml") {
3844
3961
  return parseWorkspaceV2(raw);
3845
3962
  }
3846
3963
  function saveWorkspaceV2(dir, v2, filename = "skaile.yaml") {
3847
- const filePath = path5.join(dir, filename);
3964
+ const filePath = path4.join(dir, filename);
3848
3965
  let existing = {};
3849
3966
  if (fs10.existsSync(filePath)) {
3850
3967
  const content = fs10.readFileSync(filePath, "utf-8");
@@ -3860,7 +3977,7 @@ function saveWorkspaceV2(dir, v2, filename = "skaile.yaml") {
3860
3977
  }
3861
3978
  var LOCK_FILENAME = "skaile.lock.yaml";
3862
3979
  function loadLockFile(dir) {
3863
- const filePath = path5.join(dir, LOCK_FILENAME);
3980
+ const filePath = path4.join(dir, LOCK_FILENAME);
3864
3981
  if (!fs10.existsSync(filePath)) return null;
3865
3982
  const content = fs10.readFileSync(filePath, "utf-8");
3866
3983
  const raw = parse(content);
@@ -3878,7 +3995,7 @@ function loadLockFile(dir) {
3878
3995
  return LockFileSchema.parse(raw);
3879
3996
  }
3880
3997
  function saveLockFile(dir, lock) {
3881
- const filePath = path5.join(dir, LOCK_FILENAME);
3998
+ const filePath = path4.join(dir, LOCK_FILENAME);
3882
3999
  if (!fs10.existsSync(dir)) {
3883
4000
  fs10.mkdirSync(dir, { recursive: true });
3884
4001
  }
@@ -3899,7 +4016,7 @@ function createEmptyLockFile() {
3899
4016
  };
3900
4017
  }
3901
4018
  function detectWorkspaceVersion(dir, filename = "skaile.yaml") {
3902
- const filePath = path5.join(dir, filename);
4019
+ const filePath = path4.join(dir, filename);
3903
4020
  if (!fs10.existsSync(filePath)) return null;
3904
4021
  const content = fs10.readFileSync(filePath, "utf-8");
3905
4022
  const raw = parse(content);
@@ -3907,6 +4024,6 @@ function detectWorkspaceVersion(dir, filename = "skaile.yaml") {
3907
4024
  return raw.version === 2 ? 2 : 1;
3908
4025
  }
3909
4026
 
3910
- export { AssignmentNotFoundError, CatalogCache, CatalogConfigSchema, CatalogHttpError, DuplicateAssignmentError, DuplicateLibraryNameError, GitSyncDriver, InstanceHasConsumersError, InstanceNotFoundError, InterpolationError, KNOWN_ASSET_KINDS, KnowledgeManifestSchema, LIBRARY_BACKENDS, LIBRARY_OWNERSHIPS, LOCAL_CATALOG_URL, LibraryConfigSchema, LibraryError, LibraryInstanceRefSchema, LibraryManager, LibrarySectionSchema, LibrarySyncError, LocalCatalogSource, LocalIndex, LocalSyncDriver, LockAssignmentSchema, LockFileSchema, OfflineError, OperationNotPermittedError, PIN_POLICIES, PinPolicySchema, PresetAppliedSchema, PresetExpandedSchema, RemoteCatalogSource, RequiresEdgeSchema, RestCatalogSource, SidecarGit, SkaileConfigSchema, SourceNotFoundError, TarballHashMismatchError, UserLibraryNotFoundError, WorkspaceConfigV2Schema, applyNonStructuralUpgrade, applyPreset, applyPresetFromData, classifyRef, cloneOrInitGitRepo, createEmptyLockFile, deriveSlug, detectChanges, detectNestedPresetRefs, detectWorkspaceVersion, ensureGitRepo, evaluateUpgrade, extractLibraryInstanceId, extractReferencedKeys, filterKey, getConfigDefaults, getDefaultValue, getSidecarRoot, getStoreManifestsDir, getStoreRoot, hasInterpolationTokens, interpolate, isGitRepo, isLocalCatalogUrl, isSecretPlaceholder, knowledgeKindProvider, listSidecarSlugsOnDisk, loadLockFile, loadWorkspaceV2, migrateSidecarsToStoreIfNeeded, migrateWorkspaceConfig, parsePreset, parsePresetYaml, parseWorkspaceV2, projectConfigPath, queryInstancePickerChoices, resolveAllItems, resolveConfig, resolveIndexPath, resolveItem, resolvePin, resolveSidecarPaths, saveConfig, saveLockFile, saveWorkspaceV2, setOriginUrl, sha256Hex, storeSecrets, trpcGetUrl, userConfigPath, validateAllPlaceholders, validateKnowledge, validateNestingDepth, validatePlaceholder, writeCuratedManifest, writeManifestIfMissing };
3911
- //# sourceMappingURL=chunk-SP47UJKE.js.map
3912
- //# sourceMappingURL=chunk-SP47UJKE.js.map
4027
+ export { AssignmentNotFoundError, CatalogCache, CatalogConfigSchema, CatalogHttpError, DuplicateAssignmentError, DuplicateLibraryNameError, GitSyncDriver, InstanceHasConsumersError, InstanceNotFoundError, InterpolationError, KNOWN_ASSET_KINDS, KnowledgeManifestSchema, LIBRARY_BACKENDS, LIBRARY_OWNERSHIPS, LOCAL_CATALOG_URL, LibraryConfigSchema, LibraryError, LibraryInstanceRefSchema, LibraryManager, LibrarySectionSchema, LibrarySyncError, LocalCatalogSource, LocalIndex, LocalSyncDriver, LockAssignmentSchema, LockFileSchema, OfflineError, OperationNotPermittedError, PIN_POLICIES, PinPolicySchema, PresetAppliedSchema, PresetExpandedSchema, RemoteCatalogSource, RequiresEdgeSchema, RestCatalogSource, SidecarGit, SkaileConfigSchema, SourceNotFoundError, TarballHashMismatchError, UserLibraryNotFoundError, WorkspaceConfigV2Schema, applyNonStructuralUpgrade, applyPreset, applyPresetFromData, assertManifestEditable, classifyRef, cloneOrInitGitRepo, createEmptyLockFile, curatedManifestOverlay, deriveSlug, detectChanges, detectNestedPresetRefs, detectWorkspaceVersion, ensureGitRepo, evaluateUpgrade, extractLibraryInstanceId, extractReferencedKeys, filterKey, getConfigDefaults, getDefaultValue, getSidecarRoot, getStoreManifestsDir, getStoreRoot, hasInterpolationTokens, installLibraryAsset, interpolate, isGitRepo, isLocalCatalogUrl, isSecretPlaceholder, knowledgeKindProvider, listSidecarSlugsOnDisk, loadLockFile, loadWorkspaceV2, migrateSidecarsToStoreIfNeeded, migrateWorkspaceConfig, missingRootAssets, parsePreset, parsePresetYaml, parseWorkspaceV2, projectConfigPath, pruneMissingRootAssets, queryInstancePickerChoices, resolveAllItems, resolveConfig, resolveIndexPath, resolveItem, resolvePin, resolveSidecarPaths, saveConfig, saveLockFile, saveWorkspaceV2, setOriginUrl, sha256Hex, stampManifestPublisher, storeSecrets, syncManifestWithDisk, trpcGetUrl, upsertManifestAsset, userConfigPath, validateAllPlaceholders, validateKnowledge, validateNestingDepth, validatePlaceholder, writeCuratedManifest };
4028
+ //# sourceMappingURL=chunk-B4J4RGNY.js.map
4029
+ //# sourceMappingURL=chunk-B4J4RGNY.js.map