@skaile/workspaces 6.4.0 → 6.6.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 (405) hide show
  1. package/CHANGELOG.md +58 -1
  2. package/README.md +4 -0
  3. package/dist/ai-sdk.js +55 -25
  4. package/dist/ai-sdk.js.map +1 -1
  5. package/dist/app-sdk/index.js +1 -1
  6. package/dist/{asset-feeds-UJSYGKCX.js → asset-feeds-WQ6YQPHV.js} +22 -22
  7. package/dist/{asset-feeds-UJSYGKCX.js.map → asset-feeds-WQ6YQPHV.js.map} +1 -1
  8. package/dist/asset-manager/catalog-deployer.js +8 -8
  9. package/dist/asset-manager/index.js +14 -14
  10. package/dist/asset-manager/installer.js +10 -10
  11. package/dist/asset-manager/renderers.js +9 -9
  12. package/dist/asset-manager/src/index.d.ts +114 -12
  13. package/dist/asset-manager/src/index.d.ts.map +1 -1
  14. package/dist/asset-manager/src/installer.d.ts +6 -0
  15. package/dist/asset-manager/src/installer.d.ts.map +1 -1
  16. package/dist/bridge/harnesses/claude-sdk.js +24 -19
  17. package/dist/bridge/harnesses/claude-sdk.js.map +1 -1
  18. package/dist/bridge/harnesses/codex.js +38 -36
  19. package/dist/bridge/harnesses/codex.js.map +1 -1
  20. package/dist/bridge/harnesses/continue.js +12 -13
  21. package/dist/bridge/harnesses/continue.js.map +1 -1
  22. package/dist/bridge/harnesses/echo.js +5 -6
  23. package/dist/bridge/harnesses/echo.js.map +1 -1
  24. package/dist/bridge/harnesses/gemini.js +9 -10
  25. package/dist/bridge/harnesses/goose.js +12 -13
  26. package/dist/bridge/harnesses/goose.js.map +1 -1
  27. package/dist/bridge/harnesses/omp.js +17 -12
  28. package/dist/bridge/harnesses/omp.js.map +1 -1
  29. package/dist/bridge/harnesses/opencode.js +12 -13
  30. package/dist/bridge/harnesses/opencode.js.map +1 -1
  31. package/dist/bridge/harnesses/qwen.js +9 -10
  32. package/dist/bridge/harnesses/qwen.js.map +1 -1
  33. package/dist/bridge/index.js +20 -21
  34. package/dist/bridge/src/ai-sdk.d.ts +0 -2
  35. package/dist/bridge/src/ai-sdk.d.ts.map +1 -1
  36. package/dist/bridge/src/codex/login-fallback.d.ts +39 -0
  37. package/dist/bridge/src/codex/login-fallback.d.ts.map +1 -0
  38. package/dist/bridge/src/error-classifier.d.ts +6 -0
  39. package/dist/bridge/src/error-classifier.d.ts.map +1 -1
  40. package/dist/bridge/src/harnesses/claude-sdk.d.ts.map +1 -1
  41. package/dist/bridge/src/harnesses/codex.d.ts +0 -6
  42. package/dist/bridge/src/harnesses/codex.d.ts.map +1 -1
  43. package/dist/bridge/src/harnesses/omp.d.ts.map +1 -1
  44. package/dist/bridge/src/index.d.ts +1 -0
  45. package/dist/bridge/src/index.d.ts.map +1 -1
  46. package/dist/{chunk-GTMANMBZ.js → chunk-2M3VLKT2.js} +3 -3
  47. package/dist/{chunk-GTMANMBZ.js.map → chunk-2M3VLKT2.js.map} +1 -1
  48. package/dist/{chunk-2WOA3TKK.js → chunk-2TLPC6TQ.js} +34 -19
  49. package/dist/chunk-2TLPC6TQ.js.map +1 -0
  50. package/dist/{chunk-O7KAQQAI.js → chunk-4BFEPZ6J.js} +4 -4
  51. package/dist/{chunk-O7KAQQAI.js.map → chunk-4BFEPZ6J.js.map} +1 -1
  52. package/dist/{chunk-TPQKFX6X.js → chunk-4J7JQX4G.js} +4 -4
  53. package/dist/{chunk-TPQKFX6X.js.map → chunk-4J7JQX4G.js.map} +1 -1
  54. package/dist/{chunk-6OHZUUR7.js → chunk-5DE3DGVR.js} +11 -5
  55. package/dist/chunk-5DE3DGVR.js.map +1 -0
  56. package/dist/{chunk-Q4XWCVFA.js → chunk-5ETYBC2X.js} +8 -8
  57. package/dist/{chunk-Q4XWCVFA.js.map → chunk-5ETYBC2X.js.map} +1 -1
  58. package/dist/{chunk-ZWCGJYR7.js → chunk-5XHQBCB5.js} +3 -3
  59. package/dist/{chunk-ZWCGJYR7.js.map → chunk-5XHQBCB5.js.map} +1 -1
  60. package/dist/{chunk-JSWMRYLM.js → chunk-65UAC3ZR.js} +31 -7
  61. package/dist/chunk-65UAC3ZR.js.map +1 -0
  62. package/dist/{chunk-UBLZALKP.js → chunk-6A6HE5LW.js} +3 -3
  63. package/dist/{chunk-UBLZALKP.js.map → chunk-6A6HE5LW.js.map} +1 -1
  64. package/dist/{chunk-ABVWUM2E.js → chunk-6ARPZHOV.js} +47 -25
  65. package/dist/chunk-6ARPZHOV.js.map +1 -0
  66. package/dist/{chunk-TDKZL5ZC.js → chunk-6RHWTZPT.js} +4 -4
  67. package/dist/{chunk-TDKZL5ZC.js.map → chunk-6RHWTZPT.js.map} +1 -1
  68. package/dist/{chunk-6WQGJF65.js → chunk-6SXSVKQY.js} +88 -17
  69. package/dist/chunk-6SXSVKQY.js.map +1 -0
  70. package/dist/{chunk-YFGXYQW4.js → chunk-7I5PNB2G.js} +3 -3
  71. package/dist/{chunk-YFGXYQW4.js.map → chunk-7I5PNB2G.js.map} +1 -1
  72. package/dist/{serve-preflight-NPWI4MV6.js → chunk-7PVGND4J.js} +30 -61
  73. package/dist/chunk-7PVGND4J.js.map +1 -0
  74. package/dist/{chunk-P7EL7QRD.js → chunk-7SJHSGUV.js} +34 -20
  75. package/dist/chunk-7SJHSGUV.js.map +1 -0
  76. package/dist/{chunk-VSCLUPGZ.js → chunk-AQNW2FET.js} +289 -44
  77. package/dist/chunk-AQNW2FET.js.map +1 -0
  78. package/dist/{chunk-45KLCFQB.js → chunk-B6N653ZG.js} +6 -6
  79. package/dist/{chunk-45KLCFQB.js.map → chunk-B6N653ZG.js.map} +1 -1
  80. package/dist/{chunk-6UP2EDFN.js → chunk-BSMW3PX2.js} +313 -4
  81. package/dist/chunk-BSMW3PX2.js.map +1 -0
  82. package/dist/{chunk-HTGTNN2B.js → chunk-CMXDFTA2.js} +3 -3
  83. package/dist/{chunk-HTGTNN2B.js.map → chunk-CMXDFTA2.js.map} +1 -1
  84. package/dist/{chunk-YJNE4V2M.js → chunk-DI6J2PJB.js} +70 -37
  85. package/dist/chunk-DI6J2PJB.js.map +1 -0
  86. package/dist/{chunk-V4OXHEWY.js → chunk-DS6UUCFG.js} +4 -4
  87. package/dist/{chunk-V4OXHEWY.js.map → chunk-DS6UUCFG.js.map} +1 -1
  88. package/dist/{chunk-U6S5CXKB.js → chunk-E2EC6SAX.js} +4 -4
  89. package/dist/{chunk-U6S5CXKB.js.map → chunk-E2EC6SAX.js.map} +1 -1
  90. package/dist/{chunk-TF5CWJQZ.js → chunk-EPXZQIC6.js} +23 -80
  91. package/dist/chunk-EPXZQIC6.js.map +1 -0
  92. package/dist/{chunk-6X3GDPCB.js → chunk-F4CZQD3T.js} +3 -4
  93. package/dist/chunk-F4CZQD3T.js.map +1 -0
  94. package/dist/{chunk-VZU67OKK.js → chunk-G5SYFFMD.js} +2 -2
  95. package/dist/{chunk-VZU67OKK.js.map → chunk-G5SYFFMD.js.map} +1 -1
  96. package/dist/{chunk-VV2DJT4I.js → chunk-GNUA7XT2.js} +4 -3
  97. package/dist/chunk-GNUA7XT2.js.map +1 -0
  98. package/dist/{chunk-E237FGGX.js → chunk-GTAHU4N4.js} +4 -4
  99. package/dist/{chunk-E237FGGX.js.map → chunk-GTAHU4N4.js.map} +1 -1
  100. package/dist/{chunk-SISUT7VR.js → chunk-GTGWRKMJ.js} +7 -7
  101. package/dist/{chunk-SISUT7VR.js.map → chunk-GTGWRKMJ.js.map} +1 -1
  102. package/dist/{chunk-BX7PSWJA.js → chunk-HGZN6JLP.js} +4 -4
  103. package/dist/{chunk-BX7PSWJA.js.map → chunk-HGZN6JLP.js.map} +1 -1
  104. package/dist/{chunk-L45IHRDH.js → chunk-HQAPUPBE.js} +3 -3
  105. package/dist/{chunk-L45IHRDH.js.map → chunk-HQAPUPBE.js.map} +1 -1
  106. package/dist/{chunk-L4OYPFLB.js → chunk-I5IF3JCG.js} +4 -4
  107. package/dist/{chunk-L4OYPFLB.js.map → chunk-I5IF3JCG.js.map} +1 -1
  108. package/dist/{chunk-IYZAJ2J2.js → chunk-J262X4JU.js} +36 -36
  109. package/dist/chunk-J262X4JU.js.map +1 -0
  110. package/dist/{chunk-WENTJ5KP.js → chunk-J4WKNJHO.js} +6 -6
  111. package/dist/{chunk-WENTJ5KP.js.map → chunk-J4WKNJHO.js.map} +1 -1
  112. package/dist/{chunk-3ENE6ZOF.js → chunk-JIQUF3X2.js} +9 -8
  113. package/dist/chunk-JIQUF3X2.js.map +1 -0
  114. package/dist/{chunk-TGB4E5Z6.js → chunk-JRVQV7WC.js} +414 -95
  115. package/dist/chunk-JRVQV7WC.js.map +1 -0
  116. package/dist/{chunk-BOS7P2Y4.js → chunk-KSH5CFQS.js} +3 -3
  117. package/dist/{chunk-BOS7P2Y4.js.map → chunk-KSH5CFQS.js.map} +1 -1
  118. package/dist/{chunk-UUKCPPTQ.js → chunk-KSUT5KAE.js} +3 -3
  119. package/dist/{chunk-UUKCPPTQ.js.map → chunk-KSUT5KAE.js.map} +1 -1
  120. package/dist/{chunk-DF5WJC3Q.js → chunk-LBJ4M5J2.js} +4 -4
  121. package/dist/{chunk-DF5WJC3Q.js.map → chunk-LBJ4M5J2.js.map} +1 -1
  122. package/dist/{chunk-GBXQFJ4G.js → chunk-MMOWIRHP.js} +310 -175
  123. package/dist/chunk-MMOWIRHP.js.map +1 -0
  124. package/dist/{chunk-G63KOHFS.js → chunk-MXI3XWV6.js} +4 -4
  125. package/dist/{chunk-G63KOHFS.js.map → chunk-MXI3XWV6.js.map} +1 -1
  126. package/dist/{chunk-ACBL7X62.js → chunk-N2PBAXAA.js} +3 -3
  127. package/dist/{chunk-ACBL7X62.js.map → chunk-N2PBAXAA.js.map} +1 -1
  128. package/dist/{chunk-5NHBLKKU.js → chunk-O7QZI6MQ.js} +3 -3
  129. package/dist/{chunk-5NHBLKKU.js.map → chunk-O7QZI6MQ.js.map} +1 -1
  130. package/dist/{chunk-U3SXCVR7.js → chunk-OY22B7E2.js} +4 -4
  131. package/dist/{chunk-U3SXCVR7.js.map → chunk-OY22B7E2.js.map} +1 -1
  132. package/dist/{chunk-C7TQARGC.js → chunk-PTJTOPE5.js} +3 -3
  133. package/dist/{chunk-C7TQARGC.js.map → chunk-PTJTOPE5.js.map} +1 -1
  134. package/dist/{chunk-HSF665NV.js → chunk-RAU5QPI6.js} +5 -5
  135. package/dist/{chunk-HSF665NV.js.map → chunk-RAU5QPI6.js.map} +1 -1
  136. package/dist/{chunk-RKI35EAN.js → chunk-RHCEX2EV.js} +3 -3
  137. package/dist/{chunk-RKI35EAN.js.map → chunk-RHCEX2EV.js.map} +1 -1
  138. package/dist/{chunk-76WSWPOB.js → chunk-SCRYXAHH.js} +15 -6
  139. package/dist/chunk-SCRYXAHH.js.map +1 -0
  140. package/dist/{chunk-DKXNKFKP.js → chunk-SGI5MRKP.js} +75 -3
  141. package/dist/chunk-SGI5MRKP.js.map +1 -0
  142. package/dist/{chunk-24D7IW5O.js → chunk-SHTXMERQ.js} +7 -8
  143. package/dist/chunk-SHTXMERQ.js.map +1 -0
  144. package/dist/{chunk-IZV3HDVG.js → chunk-SZKCE7EC.js} +5 -5
  145. package/dist/{chunk-IZV3HDVG.js.map → chunk-SZKCE7EC.js.map} +1 -1
  146. package/dist/{chunk-UAOHR6AL.js → chunk-TCH5UDKT.js} +4 -4
  147. package/dist/{chunk-UAOHR6AL.js.map → chunk-TCH5UDKT.js.map} +1 -1
  148. package/dist/{chunk-UVTN4O7N.js → chunk-TUFNY6OD.js} +33 -10
  149. package/dist/chunk-TUFNY6OD.js.map +1 -0
  150. package/dist/{chunk-PTBX55QF.js → chunk-U3UDOX6I.js} +4 -4
  151. package/dist/{chunk-PTBX55QF.js.map → chunk-U3UDOX6I.js.map} +1 -1
  152. package/dist/{chunk-BUU2DLPC.js → chunk-USSP43U3.js} +3 -3
  153. package/dist/{chunk-BUU2DLPC.js.map → chunk-USSP43U3.js.map} +1 -1
  154. package/dist/{chunk-IZQOO6MN.js → chunk-V5KG6CCV.js} +2 -2
  155. package/dist/{chunk-IZQOO6MN.js.map → chunk-V5KG6CCV.js.map} +1 -1
  156. package/dist/{chunk-CK3CJSRY.js → chunk-VJRL6ZK6.js} +4 -4
  157. package/dist/{chunk-CK3CJSRY.js.map → chunk-VJRL6ZK6.js.map} +1 -1
  158. package/dist/{chunk-76FLBODK.js → chunk-VT6G5AJV.js} +10 -7
  159. package/dist/chunk-VT6G5AJV.js.map +1 -0
  160. package/dist/{chunk-EXRQKOY6.js → chunk-VXYZ5M7Z.js} +83 -34
  161. package/dist/chunk-VXYZ5M7Z.js.map +1 -0
  162. package/dist/{chunk-QSIFEHSN.js → chunk-WW5NAU6N.js} +3 -3
  163. package/dist/{chunk-QSIFEHSN.js.map → chunk-WW5NAU6N.js.map} +1 -1
  164. package/dist/chunk-XD3RYAMR.js +83 -0
  165. package/dist/chunk-XD3RYAMR.js.map +1 -0
  166. package/dist/{chunk-HXZ3FQQN.js → chunk-XYCYGN3Q.js} +82 -50
  167. package/dist/chunk-XYCYGN3Q.js.map +1 -0
  168. package/dist/{chunk-5T3DTK7A.js → chunk-YN6N3RBM.js} +9 -10
  169. package/dist/chunk-YN6N3RBM.js.map +1 -0
  170. package/dist/{chunk-DCJ4BION.js → chunk-Z4FERR4U.js} +2 -2
  171. package/dist/{chunk-DCJ4BION.js.map → chunk-Z4FERR4U.js.map} +1 -1
  172. package/dist/{claude-code-UBT4ZME7.js → claude-code-LZH7Y4Y5.js} +5 -5
  173. package/dist/{claude-code-UBT4ZME7.js.map → claude-code-LZH7Y4Y5.js.map} +1 -1
  174. package/dist/cli/index.js +308 -162
  175. package/dist/cli/index.js.map +1 -1
  176. package/dist/cli/src/commands/cache.d.ts.map +1 -1
  177. package/dist/cli/src/commands/catalog.d.ts.map +1 -1
  178. package/dist/cli/src/commands/config.d.ts.map +1 -1
  179. package/dist/cli/src/commands/connector.d.ts.map +1 -1
  180. package/dist/cli/src/commands/deploy.d.ts.map +1 -1
  181. package/dist/cli/src/commands/harness.d.ts +5 -4
  182. package/dist/cli/src/commands/harness.d.ts.map +1 -1
  183. package/dist/cli/src/commands/integration.d.ts.map +1 -1
  184. package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
  185. package/dist/cli/src/commands/library-index.d.ts +6 -0
  186. package/dist/cli/src/commands/library-index.d.ts.map +1 -1
  187. package/dist/cli/src/commands/migrate-files.d.ts +3 -6
  188. package/dist/cli/src/commands/migrate-files.d.ts.map +1 -1
  189. package/dist/cli/src/commands/migrate-harness.d.ts +4 -3
  190. package/dist/cli/src/commands/migrate-harness.d.ts.map +1 -1
  191. package/dist/cli/src/commands/migrate.d.ts +2 -2
  192. package/dist/cli/src/commands/outdated.d.ts.map +1 -1
  193. package/dist/cli/src/commands/plugin-registry-cmd.d.ts.map +1 -1
  194. package/dist/cli/src/commands/project.d.ts +7 -1
  195. package/dist/cli/src/commands/project.d.ts.map +1 -1
  196. package/dist/cli/src/commands/run.d.ts.map +1 -1
  197. package/dist/cli/src/commands/serve-preflight.d.ts +21 -0
  198. package/dist/cli/src/commands/serve-preflight.d.ts.map +1 -1
  199. package/dist/cli/src/commands/serve.d.ts.map +1 -1
  200. package/dist/cli/src/commands/source-manifest.d.ts.map +1 -1
  201. package/dist/cli/src/commands/source.d.ts +8 -0
  202. package/dist/cli/src/commands/source.d.ts.map +1 -1
  203. package/dist/cli/src/commands/update.d.ts.map +1 -1
  204. package/dist/cli/src/commands/validate-instances.d.ts +6 -0
  205. package/dist/cli/src/commands/validate-instances.d.ts.map +1 -1
  206. package/dist/cli/src/commands/validate.d.ts.map +1 -1
  207. package/dist/cli/src/commands/verify.d.ts.map +1 -1
  208. package/dist/cli/src/config-checks.d.ts +8 -0
  209. package/dist/cli/src/config-checks.d.ts.map +1 -1
  210. package/dist/cli/src/ensure-sources.d.ts.map +1 -1
  211. package/dist/cli/src/helpers.d.ts +3 -2
  212. package/dist/cli/src/helpers.d.ts.map +1 -1
  213. package/dist/cli/src/plugin-store/index.d.ts.map +1 -1
  214. package/dist/cli/src/plugin-store/reconcile.d.ts.map +1 -1
  215. package/dist/cli/src/plugin-store/spec.d.ts +1 -0
  216. package/dist/cli/src/plugin-store/spec.d.ts.map +1 -1
  217. package/dist/cli/src/skill-checks.d.ts +2 -0
  218. package/dist/cli/src/skill-checks.d.ts.map +1 -1
  219. package/dist/connectors/config.js +5 -5
  220. package/dist/connectors/index.js +24 -25
  221. package/dist/connectors/src/connector-manager.d.ts.map +1 -1
  222. package/dist/connectors/src/index.d.ts +2 -2
  223. package/dist/connectors/src/index.d.ts.map +1 -1
  224. package/dist/connectors/src/managed-gitconfig.d.ts +22 -0
  225. package/dist/connectors/src/managed-gitconfig.d.ts.map +1 -1
  226. package/dist/connectors/src/mount-ledger.d.ts.map +1 -1
  227. package/dist/connectors/src/npm-installer.d.ts +11 -3
  228. package/dist/connectors/src/npm-installer.d.ts.map +1 -1
  229. package/dist/connectors-HU5MHSUJ.js +49 -0
  230. package/dist/{connectors-4WH32NK2.js.map → connectors-HU5MHSUJ.js.map} +1 -1
  231. package/dist/connectors-shared/index.js +2 -2
  232. package/dist/core/index.js +7 -7
  233. package/dist/core/logging.js +1 -1
  234. package/dist/core/manifest.js +2 -2
  235. package/dist/core/models.js +1 -1
  236. package/dist/core/publish-manifest.js +3 -3
  237. package/dist/core/ref.js +1 -1
  238. package/dist/core/runtime-assets.js +5 -5
  239. package/dist/core/src/agent-instances.d.ts +6 -0
  240. package/dist/core/src/agent-instances.d.ts.map +1 -1
  241. package/dist/core/src/config-key-diagnostics.d.ts +2 -1
  242. package/dist/core/src/config-key-diagnostics.d.ts.map +1 -1
  243. package/dist/core/src/index.d.ts +4 -4
  244. package/dist/core/src/index.d.ts.map +1 -1
  245. package/dist/core/src/lock.d.ts +20 -1
  246. package/dist/core/src/lock.d.ts.map +1 -1
  247. package/dist/core/src/logging/index.d.ts +1 -0
  248. package/dist/core/src/logging/index.d.ts.map +1 -1
  249. package/dist/core/src/logging/log-safe-text.d.ts +20 -0
  250. package/dist/core/src/logging/log-safe-text.d.ts.map +1 -0
  251. package/dist/core/src/manifest-yaml-editor.d.ts +4 -1
  252. package/dist/core/src/manifest-yaml-editor.d.ts.map +1 -1
  253. package/dist/core/src/manifest.d.ts.map +1 -1
  254. package/dist/core/src/models.d.ts +10 -0
  255. package/dist/core/src/models.d.ts.map +1 -1
  256. package/dist/core/src/repo-manager.d.ts +11 -0
  257. package/dist/core/src/repo-manager.d.ts.map +1 -1
  258. package/dist/core/src/runtime-assets.d.ts +12 -1
  259. package/dist/core/src/runtime-assets.d.ts.map +1 -1
  260. package/dist/core/src/walker.d.ts +3 -0
  261. package/dist/core/src/walker.d.ts.map +1 -1
  262. package/dist/core/src/workspace-config.d.ts +10 -2
  263. package/dist/core/src/workspace-config.d.ts.map +1 -1
  264. package/dist/core/workspace-config.js +4 -4
  265. package/dist/deploy/index.js +7 -7
  266. package/dist/discovery/index.js +5 -5
  267. package/dist/{ensure-sources-UC2RBYMP.js → ensure-sources-CAMWJTMR.js} +32 -32
  268. package/dist/ensure-sources-CAMWJTMR.js.map +1 -0
  269. package/dist/factory-assets/connectors/box.js +24 -25
  270. package/dist/factory-assets/connectors/deploy.js +24 -25
  271. package/dist/factory-assets/connectors/devserver.js +24 -25
  272. package/dist/factory-assets/connectors/flow/adapter.js +24 -25
  273. package/dist/factory-assets/connectors/flow/engine.js +8 -8
  274. package/dist/factory-assets/connectors/flow/run-flow.js +26 -27
  275. package/dist/factory-assets/connectors/flow.js +24 -25
  276. package/dist/factory-assets/connectors/git.js +24 -25
  277. package/dist/factory-assets/connectors/gmail.js +24 -25
  278. package/dist/factory-assets/connectors/googledrive.js +24 -25
  279. package/dist/factory-assets/connectors/local.js +24 -25
  280. package/dist/factory-assets/connectors/mattermost.js +24 -25
  281. package/dist/factory-assets/connectors/memory.js +24 -25
  282. package/dist/factory-assets/connectors/minio.js +24 -25
  283. package/dist/factory-assets/connectors/postgres.js +24 -25
  284. package/dist/factory-assets/connectors/s3.js +24 -25
  285. package/dist/factory-assets/connectors/sharepoint.js +24 -25
  286. package/dist/factory-assets/connectors/sqlite.js +24 -25
  287. package/dist/factory-assets/connectors/static-server.js +24 -25
  288. package/dist/factory-assets/connectors/tunnel.js +24 -25
  289. package/dist/factory-assets/connectors/webdav.js +24 -25
  290. package/dist/factory-assets/connectors/xstate-store.js +24 -25
  291. package/dist/factory-assets/connectors/xstate.js +24 -25
  292. package/dist/factory-assets/skills/authoring-skaile-assets/SKILL.md +2 -1
  293. package/dist/{flows-LYTKNGKE.js → flows-GVOVQGQW.js} +12 -12
  294. package/dist/{flows-LYTKNGKE.js.map → flows-GVOVQGQW.js.map} +1 -1
  295. package/dist/{helpers-SSSKT5XK.js → helpers-WMCCODAV.js} +29 -30
  296. package/dist/{helpers-SSSKT5XK.js.map → helpers-WMCCODAV.js.map} +1 -1
  297. package/dist/library/index.js +11 -11
  298. package/dist/library/install.js +4 -4
  299. package/dist/library/src/manifest-writer.d.ts +9 -0
  300. package/dist/library/src/manifest-writer.d.ts.map +1 -1
  301. package/dist/library/src/remote/remote-catalog-source.d.ts +9 -0
  302. package/dist/library/src/remote/remote-catalog-source.d.ts.map +1 -1
  303. package/dist/library/src/remote/rest-catalog-source.d.ts +1 -0
  304. package/dist/library/src/remote/rest-catalog-source.d.ts.map +1 -1
  305. package/dist/{library-publish-GQMNTAKK.js → library-publish-UQQMHTND.js} +55 -55
  306. package/dist/{library-publish-GQMNTAKK.js.map → library-publish-UQQMHTND.js.map} +1 -1
  307. package/dist/model-endpoint/index.js +10 -11
  308. package/dist/open-library-OJ4HT2X4.js +57 -0
  309. package/dist/{open-library-XGUCUJYE.js.map → open-library-OJ4HT2X4.js.map} +1 -1
  310. package/dist/open-registry-LWGIOJDK.js +32 -0
  311. package/dist/{open-registry-DIFEPDF6.js.map → open-registry-LWGIOJDK.js.map} +1 -1
  312. package/dist/paths-FR2752HV.js +22 -0
  313. package/dist/{paths-G4GFJLE2.js.map → paths-FR2752HV.js.map} +1 -1
  314. package/dist/{plugin-store-BBLDFD3L.js → plugin-store-IALJUBN2.js} +10 -10
  315. package/dist/{plugin-store-BBLDFD3L.js.map → plugin-store-IALJUBN2.js.map} +1 -1
  316. package/dist/project-UQFCYHYS.js +88 -0
  317. package/dist/{project-LB745WVZ.js.map → project-UQFCYHYS.js.map} +1 -1
  318. package/dist/resolver/index.js +8 -8
  319. package/dist/runner/index.js +40 -41
  320. package/dist/runner/src/composition/resolve-instance.d.ts.map +1 -1
  321. package/dist/runner/src/composition/resolve.d.ts +6 -0
  322. package/dist/runner/src/composition/resolve.d.ts.map +1 -1
  323. package/dist/runner/src/credential-notice.d.ts +3 -2
  324. package/dist/runner/src/credential-notice.d.ts.map +1 -1
  325. package/dist/runner/src/external-mcp.d.ts +22 -0
  326. package/dist/runner/src/external-mcp.d.ts.map +1 -1
  327. package/dist/runner/src/mcp-tools-snapshot.d.ts +13 -0
  328. package/dist/runner/src/mcp-tools-snapshot.d.ts.map +1 -0
  329. package/dist/runner/src/resources.d.ts +14 -0
  330. package/dist/runner/src/resources.d.ts.map +1 -1
  331. package/dist/runner/src/serve.d.ts.map +1 -1
  332. package/dist/sdk/asset-manager.js +14 -14
  333. package/dist/sdk/bridge.js +20 -21
  334. package/dist/sdk/core.js +7 -7
  335. package/dist/sdk/flow.js +8 -8
  336. package/dist/sdk/index.js +40 -41
  337. package/dist/sdk/index.js.map +1 -1
  338. package/dist/sdk/resolver.js +8 -8
  339. package/dist/sdk/runner.js +40 -41
  340. package/dist/sdk/session.js +2 -2
  341. package/dist/sdk/transport/ws/server.js +8 -8
  342. package/dist/sdk/transport/ws.js +8 -8
  343. package/dist/sdk/transport.js +8 -8
  344. package/dist/sdk/types.js +1 -1
  345. package/dist/serve-preflight-TYEKHC32.js +56 -0
  346. package/dist/serve-preflight-TYEKHC32.js.map +1 -0
  347. package/dist/session/index.js +2 -2
  348. package/dist/{setup-X6ZYH2MW.js → setup-4JV2IMCB.js} +30 -31
  349. package/dist/setup-4JV2IMCB.js.map +1 -0
  350. package/dist/{skills-62PXDBPJ.js → skills-6QTKFMLW.js} +13 -13
  351. package/dist/{skills-62PXDBPJ.js.map → skills-6QTKFMLW.js.map} +1 -1
  352. package/dist/source-XYMMJVKR.js +86 -0
  353. package/dist/{source-LAYCTRHP.js.map → source-XYMMJVKR.js.map} +1 -1
  354. package/dist/{source-manifest-publish-3S6PJ25W.js → source-manifest-publish-SZFGGKB4.js} +52 -53
  355. package/dist/source-manifest-publish-SZFGGKB4.js.map +1 -0
  356. package/dist/transport/index.js +8 -8
  357. package/dist/transport/ws/server.js +8 -8
  358. package/dist/transport/ws.js +8 -8
  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/manifests/agent.d.ts +2 -2
  364. package/dist/types/src/manifests/agent.d.ts.map +1 -1
  365. package/dist/types/src/version.d.ts +8 -8
  366. package/dist/workspace-plugin/adapters/mcp.js +31 -32
  367. package/dist/workspace-plugin/adapters/omp.js +14 -14
  368. package/dist/workspace-plugin/index.js +2 -2
  369. package/package.json +1 -1
  370. package/dist/chunk-24D7IW5O.js.map +0 -1
  371. package/dist/chunk-2WOA3TKK.js.map +0 -1
  372. package/dist/chunk-3ENE6ZOF.js.map +0 -1
  373. package/dist/chunk-5T3DTK7A.js.map +0 -1
  374. package/dist/chunk-6OHZUUR7.js.map +0 -1
  375. package/dist/chunk-6UP2EDFN.js.map +0 -1
  376. package/dist/chunk-6WQGJF65.js.map +0 -1
  377. package/dist/chunk-6X3GDPCB.js.map +0 -1
  378. package/dist/chunk-76FLBODK.js.map +0 -1
  379. package/dist/chunk-76WSWPOB.js.map +0 -1
  380. package/dist/chunk-ABVWUM2E.js.map +0 -1
  381. package/dist/chunk-DKXNKFKP.js.map +0 -1
  382. package/dist/chunk-EXRQKOY6.js.map +0 -1
  383. package/dist/chunk-GBXQFJ4G.js.map +0 -1
  384. package/dist/chunk-HXZ3FQQN.js.map +0 -1
  385. package/dist/chunk-IYZAJ2J2.js.map +0 -1
  386. package/dist/chunk-JSWMRYLM.js.map +0 -1
  387. package/dist/chunk-P7EL7QRD.js.map +0 -1
  388. package/dist/chunk-QJQQNBVT.js +0 -315
  389. package/dist/chunk-QJQQNBVT.js.map +0 -1
  390. package/dist/chunk-TF5CWJQZ.js.map +0 -1
  391. package/dist/chunk-TGB4E5Z6.js.map +0 -1
  392. package/dist/chunk-UVTN4O7N.js.map +0 -1
  393. package/dist/chunk-VSCLUPGZ.js.map +0 -1
  394. package/dist/chunk-VV2DJT4I.js.map +0 -1
  395. package/dist/chunk-YJNE4V2M.js.map +0 -1
  396. package/dist/connectors-4WH32NK2.js +0 -50
  397. package/dist/ensure-sources-UC2RBYMP.js.map +0 -1
  398. package/dist/open-library-XGUCUJYE.js +0 -58
  399. package/dist/open-registry-DIFEPDF6.js +0 -32
  400. package/dist/paths-G4GFJLE2.js +0 -22
  401. package/dist/project-LB745WVZ.js +0 -88
  402. package/dist/serve-preflight-NPWI4MV6.js.map +0 -1
  403. package/dist/setup-X6ZYH2MW.js.map +0 -1
  404. package/dist/source-LAYCTRHP.js +0 -87
  405. package/dist/source-manifest-publish-3S6PJ25W.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,62 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1121](https://github.com/skaile-ai/workspaces/pull/1121) [`6fba753`](https://github.com/skaile-ai/workspaces/commit/6fba75377830f1f8786e0be21034e11a0c58ef8c) Thanks [@peteralbert](https://github.com/peteralbert)! - A stdio MCP server can start on its first tool call instead of at session start. With `lazy: true` on the declaration (`MCP.md` frontmatter or an `mcp_servers:` entry), the runner registers the server's tools from a cached `tools/list` snapshot and spawns nothing until a tool is called; concurrent first calls share one start, and a failed start is returned as that call's error. The snapshot is written by the first eager start and keyed by the server's resolved command and args, so a new release reads none. It lives under `$SKAILE_MCP_TOOLS_CACHE_DIR` (default `<cache root>/mcp-tools`); a host should point it at storage that survives container replacement. Declarations without `lazy` start as before. New: `McpServerDeclaration.lazy`.
8
+
9
+ - [#1118](https://github.com/skaile-ai/workspaces/pull/1118) [`3d2818d`](https://github.com/skaile-ai/workspaces/commit/3d2818da25a56cbc49036a732e0af229eeed6edf) Thanks [@Frozen666](https://github.com/Frozen666)! - Connector failure logs no longer carry document paths or names. The runner's `connector failed` line, the connector manager's `connect failed`, `connectAll failed`, outside-project and disconnect warnings, the mount-ledger cleanup warning and `connector_mutate failed` now log the error text through the new `scrubLogText` (quoted spans, URL paths, slash paths and document file names become `<path#…>` tags or `<quoted>`). The text shown to the agent and the platform, and the thrown errors, keep their wording, except that the `mountPath … does not exist` and `… is a symlink to …` errors now put their paths in double quotes (so a log copy hides each path whole). New exports in `core/logging`: `pathFingerprint`, `pathTag` (the same tags as the platform) and `scrubLogText`.
10
+
11
+ ## 6.5.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [#1116](https://github.com/skaile-ai/workspaces/pull/1116) [`05adce1`](https://github.com/skaile-ai/workspaces/commit/05adce1e62cc68e63fe6ba4998f8b37b8048d5d9) Thanks [@mortegro](https://github.com/mortegro)! - `skaile add agent:<ref>` binds the agent as an instance, `agents.<name>: {ref: ...}` in `skaile.yaml`, so `skaile run --instance <name>` works at once. `remove` unbinds it; an existing binding is kept (p1870). `run`, `repl` and `rebuild` use the `agent:` definition when set, else `agents.default`, so an instance that binds a connector slot is the primary agent (p1910, p422). `validate` refuses an `agent.definition` that does not resolve with the same one line `serve` prints, and `serve` no longer ends with an `AgentRefResolutionError` stack (p1733). The first run of an agent added with `add agent:` no longer warns that its `SOUL.md` is not compiled (p1876).
16
+
17
+ - [#1116](https://github.com/skaile-ai/workspaces/pull/1116) [`05adce1`](https://github.com/skaile-ai/workspaces/commit/05adce1e62cc68e63fe6ba4998f8b37b8048d5d9) Thanks [@mortegro](https://github.com/mortegro)! - `skaile library create`, `index` and the other manifest writers take a lock on `skaile.manifest.yaml` and save it in one step, so parallel `library create` runs keep every entry and every printed ref resolves (p1803). `skaile add` of an asset whose name is invalid prints the `validate` line (`invalid asset name "..."`) and the fix, not `Asset not found` (p1801). `add` refuses a manifest entry whose `files:` names a missing file, with the line `validate`, `library index` and the plan print (p1802). The adoption notice after `library init --path <clone>` no longer says that `pull` and `sync` stop: an untracked manifest does not stop them (p1800). `skaile validate versions` reads an agent without `version:` as 0.1.0, as `validate`, `library index` and `add` do (p1858). A `requires:` list of plain names in `agent.yaml` is accepted with the `deprecated_agent_requires` warning, not an error; an agent names its skills in `composes:` (p1950).
18
+
19
+ - [#1116](https://github.com/skaile-ai/workspaces/pull/1116) [`05adce1`](https://github.com/skaile-ai/workspaces/commit/05adce1e62cc68e63fe6ba4998f8b37b8048d5d9) Thanks [@mortegro](https://github.com/mortegro)! - Consume fixes from the 6.4.0 critique:
20
+
21
+ - Only `update` moves a lock, for every library kind. `install` with a same-version content change of a locked library asset names the asset and says `run skaile update`; it keeps the lock and the deployed copy, and exits 1. `install` also names a hand edit of a deployed file that it keeps, and no longer says `Nothing to install` while `check` fails (p1911, p1840).
22
+ - `outdated` says which source it could not reach and exits 1 instead of `All assets are up to date.`. A failed `update` (a source that cannot be synced) writes no lock and prints no `Updated` (p1820).
23
+ - A lock that is not valid YAML is one line `x skaile.lock.yaml - parse error: ... at line N` and exit 1 in every command that reads it, and it is never overwritten (p1892).
24
+ - `validate` refuses `sources: [12]`, `- {}`, `- url: 5` and a non-string `publisher:`, as `check`, `doctor` and `add` do (p1620).
25
+ - `config show` warns about a mistyped key, with a `Did you mean` hint (p1474).
26
+ - `add` and `install` from a git library with uncommitted edits in the asset folder warn, name the files and say that other machines cannot restore those bytes (p1859).
27
+ - The store restore notice of a library-less clone names each store once and appears only on a run that wrote files; a run that wrote nothing prints one `Library "x" is not registered here` line (p1855).
28
+ - A symlink added to a library after the lock no longer stops `install --locked`, `install` or `update` while the deployed copy of that asset is intact; a missing copy is still refused (p1857).
29
+
30
+ - [#1116](https://github.com/skaile-ai/workspaces/pull/1116) [`05adce1`](https://github.com/skaile-ai/workspaces/commit/05adce1e62cc68e63fe6ba4998f8b37b8048d5d9) Thanks [@mortegro](https://github.com/mortegro)! - `agent-config.default.agent` is retired: `init` and `harness set` no longer write it, `validate`, `check` and `run` warn that it is ignored, and `skaile migrate harness` removes it (p1874). `harness set` names the old `.omp/` and `.codex/` copies as well as `.claude/`, and `--clean` deletes them (p1671). `skaile migrate harness` now writes by default (`--dry-run` prints the diff; `--apply` and `--write` are gone) and renames `driver:` to `harness:`; the deprecated `driver:` key warns in `check` and `run` too (p1873). `codex` with an `openai` registry entry whose key is not exported runs on the codex ChatGPT login or `OPENAI_API_KEY`, and `run` and `repl` print one line saying so (p1871). `run --dry-run` exits 1 with the install line when the harness SDK is not installed (p1872). `plugin install` prints the installer failure as one line (p1875). The omp no-login error and the claude-sdk auth hints name CLI commands, not a `Settings` screen, on a developer machine (p1912, p1943). `check --global` and `doctor --global` judge a 5.12.0 omp-only global record by its one copy and no longer ask for a claude-code copy (p1442).
31
+
32
+ - [#1116](https://github.com/skaile-ai/workspaces/pull/1116) [`05adce1`](https://github.com/skaile-ai/workspaces/commit/05adce1e62cc68e63fe6ba4998f8b37b8048d5d9) Thanks [@mortegro](https://github.com/mortegro)! - Protocol, SDK and plugins. `serve` always writes `<project>/.skaile/managed-gitconfig`. When the developer has a `~/.gitconfig`, the file starts with an `[include]` of it, so the agent's git keeps the developer's identity, aliases and signing settings. A container (no `~/.gitconfig`) gets the file without an include. `serve --provider <name>` now picks one AI provider registry entry like `--providers <name>`; a name that is no entry stops with one line and exit 1 (managed Codex still takes `openai`).
33
+
34
+ `resolveLanguageModel` (`@skaile/workspaces/ai-sdk`): a `<x>/<y>` selector whose `<x>` is no registry entry is refused, and the credential goes nowhere, unless an entry lists no models. That entry takes the selector as a bare model id and the result carries a warning. A missing provider SDK says `Run in the project: npm i @ai-sdk/...` (the command of the project's package manager).
35
+
36
+ `validate` and `connector catalog|list|status|ops|...` load the `plugins:` of the project like `serve`, so a plugin's connector driver (`yjs`, `redis`) is known and `validate` no longer warns `Unknown connector driver`. `plugin install` trims the spec and refuses an empty range (`name@`) with one line; a range with a space (`name@>=1 <2`) is accepted. `plugin remove` of the last plugin removes `.skaile/plugins/`, and a removed `file:` plugin leaves no `node_modules` copy. A failed first install leaves no empty `.skaile/plugins/`. `connector add` installs with npm when bun is not on PATH, installs in the project folder (a project without `package.json` gets its own, never an ancestor's), and a failed install prints the tool's error or says that neither bun nor npm was found.
37
+
38
+ - [#1116](https://github.com/skaile-ai/workspaces/pull/1116) [`05adce1`](https://github.com/skaile-ai/workspaces/commit/05adce1e62cc68e63fe6ba4998f8b37b8048d5d9) Thanks [@mortegro](https://github.com/mortegro)! - Source repair from the 6.4.0 critique:
39
+
40
+ - A failed first clone leaves no folder behind. `cloneRepo` removes the folder it made, and the empty `<host>/<owner>` folders above it. A folder that is empty or is no git repository counts as not cloned everywhere: `install`, `install --locked`, `update`, `source add` and `source sync` clone it again, and `install --locked` no longer says `a private repo needs SKAILE_GITHUB_PAT` for it (p1821, p1890). `skaile source sync` now repairs such a clone, as the hint of `add` and `update` says.
41
+ - The built-in factory source always stays. A declared `skaile-ai/ai-assets` source adds to it: the factory skills (tutorial 01 authoring skills, presets) stay resolvable, `update` does not remove them, and `source remove` of the declared source does not count them as its assets (p1951). New core export: `isFactoryMemorySource`.
42
+ - Factory rows of the lock keep `url: factory` and the version of the bundled tree, also when a declared `ai-assets` source holds the same URL. Its own rows keep the repo URL and the real commit, so a fresh copy's `install --locked` restores both (p1755).
43
+
44
+ - [#1116](https://github.com/skaile-ai/workspaces/pull/1116) [`05adce1`](https://github.com/skaile-ai/workspaces/commit/05adce1e62cc68e63fe6ba4998f8b37b8048d5d9) Thanks [@mortegro](https://github.com/mortegro)! - Source scope from the 6.4.0 critique:
45
+
46
+ - A source clone is project-scoped. `search --local`, `add`, `update`, the tie-break by name and `library default` read the clone of a source only in a project that declares it in `skaile.yaml` `sources:`. `library default <name>` for another project's clone exits 1 (p321).
47
+ - The publisher is per project. `source add <url> --publisher zzz` in one project no longer changes what another project sees; each project reads the assets of a shared clone under the publisher its own `sources:` entry names (p1822). New `AssetManager.scopeLibraryIndex`.
48
+ - A `file://` URL with `.` or `..` segments is keyed by its folded path, so `source add file://<dir>/../remotes/x.git` reuses the existing clone and library (p1856).
49
+ - `source add` of a URL that is the remote of a library you registered refuses with one line naming the library (p499).
50
+ - Every `source` subcommand looks for `skaile.yaml` in the project directory only (no parent search), and `add`, `show`, `remove` and `sync` accept `--project-dir` like `list` (p1860). `library default` accepts `--project-dir` too.
51
+
52
+ - [#1116](https://github.com/skaile-ai/workspaces/pull/1116) [`05adce1`](https://github.com/skaile-ai/workspaces/commit/05adce1e62cc68e63fe6ba4998f8b37b8048d5d9) Thanks [@mortegro](https://github.com/mortegro)! - Store assets are judged from the lock. A lock entry of an asset a store supplied now records `origin: store` and the catalog URL (`store: <url>`), so `check`, `doctor`, `outdated`, `diff` and `install --locked` work with the store unreachable and a cold cache. A lock written before this field reads as before; its next `install` or `update` that reaches the store adds the field. For such an old entry a failed lookup now says `store unreachable` instead of only `not in skaile.yaml sources`.
53
+
54
+ `skaile cache clean` without a terminal and without `--yes` stops with `needs --yes` and exit 1, and removes nothing. `skaile info <ref>` never prints `(latest )`: an empty latest version counts as unknown. With the store down and an expired cache, `store search` and `store show` print one plain line (the store, the cause and the age of the cached answer) instead of `[skaile/catalog] Background refresh failed ...`. The top-level `skaile --help` no longer marks `store search / show` as a stub.
55
+
56
+ ### Patch Changes
57
+
58
+ - [#1116](https://github.com/skaile-ai/workspaces/pull/1116) [`05adce1`](https://github.com/skaile-ai/workspaces/commit/05adce1e62cc68e63fe6ba4998f8b37b8048d5d9) Thanks [@mortegro](https://github.com/mortegro)! - Docs round for the 6.4.0 critique (v13). The `(pNNNN)` finding ids are gone from the user docs. New page for `@skaile/workspaces/ai-sdk` (`resolveLanguageModel`: install line, one peer per surface, selectors, result fields); the README lists the `ai-sdk`, `sdk`, `model-endpoint` and `plugin-registry` subpaths. The 6.3.0 CHANGELOG headline names `loadMergedProviderRegistry` under `@skaile/workspaces/bridge`, where it lives. Pages that still described the retired `configure` command now describe `session_init`; the feature-detect advice reads `major > 4 || (major === 4 && minor >= N)`. `integration install --harness claude-code` says that Claude Code lists the server as `Pending approval` until you approve it. The workspace-plugin tutorials install the CLI with `npm i -g skaile-cli`.
59
+
3
60
  ## 6.4.0
4
61
 
5
62
  ### Minor Changes
@@ -26,7 +83,7 @@
26
83
 
27
84
  ### Minor Changes
28
85
 
29
- - [#1108](https://github.com/skaile-ai/workspaces/pull/1108) [`e750e6d`](https://github.com/skaile-ai/workspaces/commit/e750e6db28a26fefe31a761c39ffb27fba501ffe) Thanks [@mortegro](https://github.com/mortegro)! - `@skaile/workspaces/ai-sdk`: `resolveLanguageModel`, `loadMergedProviderRegistry`.
86
+ - [#1108](https://github.com/skaile-ai/workspaces/pull/1108) [`e750e6d`](https://github.com/skaile-ai/workspaces/commit/e750e6db28a26fefe31a761c39ffb27fba501ffe) Thanks [@mortegro](https://github.com/mortegro)! - `@skaile/workspaces/ai-sdk`: `resolveLanguageModel`; `loadMergedProviderRegistry` from `@skaile/workspaces/bridge`.
30
87
 
31
88
  - `resolveLanguageModel(selector, { projectDir?, env? })` turns a provider-registry selector (`<providerId>/<modelId>`, a bare model id or `@role`) into a ready AI SDK `LanguageModel` over the same merged registry the CLI reads, with the credential read from `env:` refs. It returns the model, `providerId`, `modelId`, the endpoint `baseUrl`, the `role` and the selector's parse `warnings`. The provider SDKs (`@ai-sdk/anthropic`, `@ai-sdk/openai`, `@ai-sdk/openai-compatible`) are optional peers, loaded for the entry's surface only; a missing package or an unsupported surface fails with an error that names it.
32
89
  - `loadMergedProviderRegistry({ projectDir })` (from `@skaile/workspaces/bridge` and `./sdk/bridge`) is the two-pass registry load `skaile providers` always did, moved out of the CLI. The CLI's output is unchanged.
package/README.md CHANGED
@@ -19,6 +19,10 @@ published package. Every internal folder is exposed as a subpath export and the
19
19
  | **connectors** | `@skaile/workspaces/connectors` | Resource adapter infrastructure — unified access to git, postgres, redis, s3, sqlite, webdav, and more. |
20
20
  | **session** | `@skaile/workspaces/session` | Session message dispatcher — bridges frontend subscribers with agent clients through a persisted message stream. |
21
21
  | **runner** | `@skaile/workspaces/runner` | Headless agent runtime. Builds injected/native agent sessions, manages session state, executes flows via bridge. |
22
+ | **ai-sdk** | `@skaile/workspaces/ai-sdk` | `resolveLanguageModel`: a provider-registry model name as a Vercel AI SDK `LanguageModel`. Needs the peers `ai` and one `@ai-sdk/*` provider package. See the [AI SDK models](https://github.com/skaile-ai/workspaces/blob/main/docs/sections/bridge/ai-sdk.md) page. |
23
+ | **sdk** | `@skaile/workspaces/sdk` | `createAgentSession`: start an agent in your own process (no WebSocket) and read its output lines. |
24
+ | **model-endpoint** | `@skaile/workspaces/model-endpoint` | The loopback OpenAI-compatible HTTP endpoint that `skaile serve --model-endpoint` starts. |
25
+ | **plugin-registry** | `@skaile/workspaces/plugin-registry` | The registry a plugin's `register(pluginRegistry)` fills with harnesses, connectors and deploy targets. See [plugin registry](https://github.com/skaile-ai/workspaces/blob/main/docs/plugin-registry.md). |
22
26
  | **asset-manager** | `@skaile/workspaces/asset-manager` | Programmatic asset management API. Catalog, install / remove, workspace scaffolder. |
23
27
  | **cli** | `@skaile/workspaces` (`bin: skaile`) | The `skaile` CLI binary — run skills, flows, manage projects. Also importable via the `@skaile/workspaces/cli` subpath. |
24
28
  | **React bindings** | `@skaile/workspace-bridge-react` | `useAgentStore` + `useResourceClient` for React 18+. Separate npm package, lives at [`packages/bridge-react`](https://github.com/skaile-ai/workspaces/tree/main/packages/bridge-react) in this monorepo. |
package/dist/ai-sdk.js CHANGED
@@ -1,21 +1,23 @@
1
- import { loadMergedProviderRegistry } from './chunk-G63KOHFS.js';
2
- import { buildCredentialHeaders } from './chunk-6UP2EDFN.js';
3
- import './chunk-ABVWUM2E.js';
1
+ import { loadMergedProviderRegistry } from './chunk-MXI3XWV6.js';
2
+ import { entryModelIds } from './chunk-F4CZQD3T.js';
3
+ import { buildCredentialHeaders } from './chunk-BSMW3PX2.js';
4
+ import './chunk-G5SUWZEU.js';
5
+ import { installCommandFor } from './chunk-6ARPZHOV.js';
4
6
  import './chunk-4GY63JU6.js';
5
- import './chunk-3ENE6ZOF.js';
7
+ import './chunk-JIQUF3X2.js';
6
8
  import './chunk-5KRMNUL4.js';
7
9
  import './chunk-C5HFK34M.js';
8
10
  import './chunk-MWXYN6NY.js';
9
- import './chunk-6WQGJF65.js';
11
+ import './chunk-6SXSVKQY.js';
10
12
  import './chunk-L5VSIPQD.js';
11
13
  import './chunk-VTETQCR6.js';
12
- import './chunk-U6S5CXKB.js';
13
- import './chunk-VV2DJT4I.js';
14
+ import './chunk-E2EC6SAX.js';
15
+ import './chunk-GNUA7XT2.js';
14
16
  import './chunk-RVRB27AN.js';
15
- import './chunk-IZQOO6MN.js';
17
+ import './chunk-V5KG6CCV.js';
16
18
  import { resolveCredential } from './chunk-VSX2G7LA.js';
17
- import { parseModelRef, normalizeEntryBaseUrl, resolveEntryBaseUrl, normalizeAnthropicBaseUrl } from './chunk-RXGPFAMN.js';
18
- import './chunk-DKXNKFKP.js';
19
+ import { parseModelRef, registryEntries, isEntryEnabled, normalizeEntryBaseUrl, resolveEntryBaseUrl, normalizeAnthropicBaseUrl } from './chunk-RXGPFAMN.js';
20
+ import './chunk-SGI5MRKP.js';
19
21
  import './chunk-C3CAXQMA.js';
20
22
  import './chunk-BOFL7GIF.js';
21
23
  import './chunk-NSBPE2FW.js';
@@ -34,9 +36,26 @@ async function resolveLanguageModel(selector, opts = {}) {
34
36
  `no provider for '${selector}': run \`skaile providers add openrouter --credential env:OPENROUTER_API_KEY --workspace\``
35
37
  );
36
38
  }
37
- const entry = merged.providers[ref.providerId];
39
+ let providerId = ref.providerId;
40
+ const warnings = [...ref.warnings];
41
+ const slash = ref.modelId?.indexOf("/") ?? -1;
42
+ const vendorHead = ref.fallback && slash > 0 ? ref.modelId?.slice(0, slash) : void 0;
43
+ if (vendorHead) {
44
+ const llm = registryEntries(merged).filter(
45
+ (pair) => pair[1].kind === "llm" && isEntryEnabled(pair[1])
46
+ );
47
+ const passThrough = llm.find(([, e]) => entryModelIds(e).length === 0);
48
+ if (!passThrough) {
49
+ throw new Error(
50
+ `'${vendorHead}' is no provider of this registry, and no provider takes '${selector}' as a model id. Providers: ${llm.map(([id]) => id).join(", ") || "none"}. Write <provider>/<model> with one of them, or use a provider that lists no models.`
51
+ );
52
+ }
53
+ providerId = passThrough[0];
54
+ warnings.push(`'${vendorHead}' is no provider; sent to '${providerId}' as a bare model id`);
55
+ }
56
+ const entry = merged.providers[providerId];
38
57
  if (!entry || entry.kind !== "llm") {
39
- throw new Error(`provider '${ref.providerId}' is not an llm entry`);
58
+ throw new Error(`provider '${providerId}' is not an llm entry`);
40
59
  }
41
60
  const modelId = ref.providerModelId ?? ref.modelId;
42
61
  if (!modelId) {
@@ -45,29 +64,37 @@ async function resolveLanguageModel(selector, opts = {}) {
45
64
  );
46
65
  }
47
66
  const baseUrl = normalizeEntryBaseUrl(resolveEntryBaseUrl(entry), entry.surface);
48
- if (!baseUrl) throw new Error(`provider '${ref.providerId}' has no base_url`);
67
+ if (!baseUrl) throw new Error(`provider '${providerId}' has no base_url`);
49
68
  const credential = resolveCredential(entry, { env: opts.env });
50
- if (credential.error) throw new Error(`provider '${ref.providerId}': ${credential.error}`);
51
- const model = await createModel(entry, ref.providerId, modelId, baseUrl, credential.value);
69
+ if (credential.error) throw new Error(`provider '${providerId}': ${credential.error}`);
70
+ const model = await createModel(
71
+ entry,
72
+ providerId,
73
+ modelId,
74
+ baseUrl,
75
+ credential.value,
76
+ opts.projectDir ?? process.cwd()
77
+ );
52
78
  return {
53
79
  model,
54
- providerId: ref.providerId,
80
+ providerId,
55
81
  modelId,
56
82
  baseUrl,
57
83
  ...ref.role !== void 0 ? { role: ref.role } : {},
58
- warnings: ref.warnings
84
+ warnings
59
85
  };
60
86
  }
61
- async function loadProviderSdk(load, pkg, providerId, surface) {
87
+ async function loadProviderSdk(load, pkg, providerId, surface, projectDir) {
62
88
  try {
63
89
  return await load();
64
90
  } catch (cause) {
65
- throw new Error(`provider '${providerId}' needs ${pkg} installed (surface '${surface}')`, {
66
- cause
67
- });
91
+ throw new Error(
92
+ `provider '${providerId}' needs ${pkg} installed (surface '${surface}'). Run in the project: ${installCommandFor(pkg, projectDir)}`,
93
+ { cause }
94
+ );
68
95
  }
69
96
  }
70
- async function createModel(entry, providerId, modelId, baseURL, secret) {
97
+ async function createModel(entry, providerId, modelId, baseURL, secret, projectDir) {
71
98
  const credentialHeaders = buildCredentialHeaders(entry, secret);
72
99
  const headers = { ...entry.headers, ...credentialHeaders };
73
100
  const bearer = credentialHeaders.Authorization !== void 0 ? secret : void 0;
@@ -78,7 +105,8 @@ async function createModel(entry, providerId, modelId, baseURL, secret) {
78
105
  () => import('@ai-sdk/anthropic'),
79
106
  "@ai-sdk/anthropic",
80
107
  providerId,
81
- surface
108
+ surface,
109
+ projectDir
82
110
  );
83
111
  return createAnthropic({
84
112
  baseURL: `${normalizeAnthropicBaseUrl(baseURL) ?? baseURL}/v1`,
@@ -91,7 +119,8 @@ async function createModel(entry, providerId, modelId, baseURL, secret) {
91
119
  () => import('@ai-sdk/openai'),
92
120
  "@ai-sdk/openai",
93
121
  providerId,
94
- surface
122
+ surface,
123
+ projectDir
95
124
  );
96
125
  return createOpenAI({ baseURL, apiKey: bearer ?? NO_CREDENTIAL_PLACEHOLDER, headers })(
97
126
  modelId
@@ -102,7 +131,8 @@ async function createModel(entry, providerId, modelId, baseURL, secret) {
102
131
  () => import('@ai-sdk/openai-compatible'),
103
132
  "@ai-sdk/openai-compatible",
104
133
  providerId,
105
- surface
134
+ surface,
135
+ projectDir
106
136
  );
107
137
  return createOpenAICompatible({
108
138
  name: providerId,
@@ -1 +1 @@
1
- {"version":3,"sources":["../bridge/src/ai-sdk.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA8BA,IAAM,yBAAA,GAA4B,0BAAA;AA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QAAQ,MAAA,IAAU,yBAAA,EAA2B,SAAS,CAAA;AAAA,QACnF;AAAA,OACF;AAAA,IACF;AAAA,IACA,KAAK,oBAAA,EAAsB;AACzB,MAAA,MAAM,EAAE,sBAAA,EAAuB,GAAI,MAAM,eAAA;AAAA,QACvC,MAAM,OAAO,2BAA2B,CAAA;AAAA,QACxC,2BAAA;AAAA,QACA,UAAA;AAAA,QACA;AAAA,OACF;AAEA,MAAA,OAAO,sBAAA,CAAuB;AAAA,QAC5B,IAAA,EAAM,UAAA;AAAA,QACN,OAAA;AAAA,QACA,MAAA,EAAQ,MAAA;AAAA,QACR;AAAA,OACD,CAAA,CAAE,SAAA,CAAU,OAAO,CAAA;AAAA,IACtB;AAAA,IACA;AACE,MAAA,MAAM,IAAI,KAAA;AAAA,QACR,CAAA,UAAA,EAAa,UAAU,CAAA,YAAA,EAAe,OAAO,CAAA,sFAAA;AAAA,OAC/C;AAAA;AAEN","file":"ai-sdk.js","sourcesContent":["/**\n * `@skaile/workspaces/ai-sdk` — a provider-registry selector as a Vercel AI SDK\n * `LanguageModel`.\n *\n * Any AI-SDK host (a Nuxt route, a script) names a model the way the CLI does —\n * `<providerId>/<modelId>` or a bare model id — and gets a model object wired\n * to the merged `providers.yml` registry: endpoint, headers and credential\n * (`env:` refs read at call time). The provider SDKs (`@ai-sdk/anthropic`,\n * `@ai-sdk/openai`, `@ai-sdk/openai-compatible`) are optional peers, loaded\n * only for the surface the selected entry speaks.\n *\n * @see PROVIDER-CONFIG-PLAN.md §1.6\n */\n\nimport {\n type AIProviderLlmEntry,\n normalizeAnthropicBaseUrl,\n normalizeEntryBaseUrl,\n parseModelRef,\n resolveCredential,\n resolveEntryBaseUrl,\n} from \"@skaile/workspaces/core\";\nimport type { LanguageModel } from \"ai\";\nimport { buildCredentialHeaders } from \"./provider-catalog.js\";\nimport { loadMergedProviderRegistry } from \"./provider-registry-load.js\";\n\n/**\n * Passed as the SDK `apiKey` where the entry carries no key, so the SDK never\n * falls back to an ambient `OPENAI_API_KEY` / `ANTHROPIC_API_KEY`.\n */\nconst NO_CREDENTIAL_PLACEHOLDER = \"no-credential-configured\";\n\n/** A model object (never the bare-string gateway selector `LanguageModel` also admits). */\ntype ModelObject = Exclude<LanguageModel, string>;\n\n/** The result of {@link resolveLanguageModel}. */\nexport interface ResolvedLanguageModel {\n /** The AI SDK model, ready for `streamText` / `generateText` / `wrapLanguageModel`. */\n model: ModelObject;\n /** Registry entry the selector routed to. */\n providerId: string;\n /** Provider-side model id the request carries (`model_map` applied). */\n modelId: string;\n /** Endpoint the model talks to; for `anthropic-messages` the host root without `/v1`. */\n baseUrl: string;\n /** The role name, when the selector was `@role`. */\n role?: string;\n /** Non-fatal notes from resolving the selector (a dangling role, …). */\n warnings: string[];\n}\n\nexport interface ResolveLanguageModelOptions {\n /** Project whose `.skaile/providers.yml` is the workspace layer. Default: `process.cwd()`. */\n projectDir?: string;\n /** Where `env:` credential references are read from. Default: `process.env`. */\n env?: Record<string, string | undefined>;\n /**\n * Role → model-ref map `@role` selectors resolve against (the session\n * config's `roles`). Without it every `@role` selector fails.\n */\n roles?: Record<string, string>;\n}\n\n/**\n * The AI SDK model for `selector`, or an error naming the fix. Throws when the\n * registry has errors, no entry matches, the credential is unresolved, the\n * entry's surface has no AI SDK factory, or the provider SDK it needs is not\n * installed.\n */\nexport async function resolveLanguageModel(\n selector: string,\n opts: ResolveLanguageModelOptions = {},\n): Promise<ResolvedLanguageModel> {\n const { merged, diagnostics } = loadMergedProviderRegistry({\n projectDir: opts.projectDir ?? process.cwd(),\n });\n const errors = diagnostics\n .filter((d) => d.severity === \"error\")\n .map((d) => (d.path ? `${d.path}: ${d.message}` : d.message));\n if (errors.length > 0) throw new Error(`providers registry: ${errors.join(\"; \")}`);\n\n const ref = parseModelRef(selector, merged, opts.roles);\n if (!ref) {\n throw new Error(\n `no provider for '${selector}': run \\`skaile providers add openrouter --credential env:OPENROUTER_API_KEY --workspace\\``,\n );\n }\n const entry = merged.providers[ref.providerId];\n if (!entry || entry.kind !== \"llm\") {\n throw new Error(`provider '${ref.providerId}' is not an llm entry`);\n }\n const modelId = ref.providerModelId ?? ref.modelId;\n if (!modelId) {\n throw new Error(\n `'${selector}' names no model${ref.warnings.length > 0 ? ` (${ref.warnings.join(\"; \")})` : \"\"}`,\n );\n }\n const baseUrl = normalizeEntryBaseUrl(resolveEntryBaseUrl(entry), entry.surface);\n if (!baseUrl) throw new Error(`provider '${ref.providerId}' has no base_url`);\n const credential = resolveCredential(entry, { env: opts.env });\n if (credential.error) throw new Error(`provider '${ref.providerId}': ${credential.error}`);\n\n const model = await createModel(entry, ref.providerId, modelId, baseUrl, credential.value);\n return {\n model,\n providerId: ref.providerId,\n modelId,\n baseUrl,\n ...(ref.role !== undefined ? { role: ref.role } : {}),\n warnings: ref.warnings,\n };\n}\n\n/** `import(pkg)` with a missing-package error that names the package and the surface. */\nasync function loadProviderSdk<T>(\n load: () => Promise<T>,\n pkg: string,\n providerId: string,\n surface: string,\n): Promise<T> {\n try {\n return await load();\n } catch (cause) {\n throw new Error(`provider '${providerId}' needs ${pkg} installed (surface '${surface}')`, {\n cause,\n });\n }\n}\n\nasync function createModel(\n entry: AIProviderLlmEntry,\n providerId: string,\n modelId: string,\n baseURL: string,\n secret: string | undefined,\n): Promise<ModelObject> {\n // Same merge as model discovery (`models.ts`): static headers, then the\n // credential carrier the preset / credential kind names.\n const credentialHeaders = buildCredentialHeaders(entry, secret);\n const headers = { ...entry.headers, ...credentialHeaders };\n const bearer = credentialHeaders.Authorization !== undefined ? secret : undefined;\n const surface = entry.surface ?? \"openai-completions\";\n switch (surface) {\n case \"anthropic-messages\": {\n const { createAnthropic } = await loadProviderSdk(\n () => import(\"@ai-sdk/anthropic\"),\n \"@ai-sdk/anthropic\",\n providerId,\n surface,\n );\n // `@ai-sdk/anthropic` wants the versioned base; the registry stores the host root.\n // Bearer credentials go through `authToken` (the SDK's only `Authorization` path);\n // everything else through `apiKey`, with a placeholder when the entry carries none so\n // the SDK never reads `ANTHROPIC_API_KEY` from the process environment.\n return createAnthropic({\n baseURL: `${normalizeAnthropicBaseUrl(baseURL) ?? baseURL}/v1`,\n ...(bearer !== undefined\n ? { authToken: bearer }\n : { apiKey: credentialHeaders[\"x-api-key\"] ?? NO_CREDENTIAL_PLACEHOLDER }),\n headers,\n })(modelId);\n }\n case \"openai-responses\": {\n const { createOpenAI } = await loadProviderSdk(\n () => import(\"@ai-sdk/openai\"),\n \"@ai-sdk/openai\",\n providerId,\n surface,\n );\n // A placeholder `apiKey` keeps the SDK off `OPENAI_API_KEY`; the real credential\n // header (when any) is in `headers`, which the SDK applies last.\n return createOpenAI({ baseURL, apiKey: bearer ?? NO_CREDENTIAL_PLACEHOLDER, headers })(\n modelId,\n );\n }\n case \"openai-completions\": {\n const { createOpenAICompatible } = await loadProviderSdk(\n () => import(\"@ai-sdk/openai-compatible\"),\n \"@ai-sdk/openai-compatible\",\n providerId,\n surface,\n );\n // No env fallback in this SDK: an absent `apiKey` sends no `Authorization` header.\n return createOpenAICompatible({\n name: providerId,\n baseURL,\n apiKey: bearer,\n headers,\n }).chatModel(modelId);\n }\n default:\n throw new Error(\n `provider '${providerId}': surface '${surface}' has no AI SDK factory yet (openai-completions, openai-responses, anthropic-messages)`,\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["../bridge/src/ai-sdk.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,IAAM,yBAAA,GAA4B,0BAAA;AAuClC,eAAsB,oBAAA,CACpB,QAAA,EACA,IAAA,GAAoC,EAAC,EACL;AAChC,EAAA,MAAM,EAAE,MAAA,EAAQ,WAAA,EAAY,GAAI,0BAAA,CAA2B;AAAA,IACzD,UAAA,EAAY,IAAA,CAAK,UAAA,IAAc,OAAA,CAAQ,GAAA;AAAI,GAC5C,CAAA;AACD,EAAA,MAAM,MAAA,GAAS,YACZ,MAAA,CAAO,CAAC,MAAM,CAAA,CAAE,QAAA,KAAa,OAAO,CAAA,CACpC,GA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uB;AAAA,QAC5B,IAAA,EAAM,UAAA;AAAA,QACN,OAAA;AAAA,QACA,MAAA,EAAQ,MAAA;AAAA,QACR;AAAA,OACD,CAAA,CAAE,SAAA,CAAU,OAAO,CAAA;AAAA,IACtB;AAAA,IACA;AACE,MAAA,MAAM,IAAI,KAAA;AAAA,QACR,CAAA,UAAA,EAAa,UAAU,CAAA,YAAA,EAAe,OAAO,CAAA,sFAAA;AAAA,OAC/C;AAAA;AAEN","file":"ai-sdk.js","sourcesContent":["/**\n * `@skaile/workspaces/ai-sdk` — a provider-registry selector as a Vercel AI SDK\n * `LanguageModel`.\n *\n * Any AI-SDK host (a Nuxt route, a script) names a model the way the CLI does —\n * `<providerId>/<modelId>` or a bare model id — and gets a model object wired\n * to the merged `providers.yml` registry: endpoint, headers and credential\n * (`env:` refs read at call time). The provider SDKs (`@ai-sdk/anthropic`,\n * `@ai-sdk/openai`, `@ai-sdk/openai-compatible`) are optional peers, loaded\n * only for the surface the selected entry speaks.\n */\n\nimport {\n type AIProviderLlmEntry,\n installCommandFor,\n isEntryEnabled,\n normalizeAnthropicBaseUrl,\n normalizeEntryBaseUrl,\n parseModelRef,\n registryEntries,\n resolveCredential,\n resolveEntryBaseUrl,\n} from \"@skaile/workspaces/core\";\nimport type { LanguageModel } from \"ai\";\nimport { buildCredentialHeaders } from \"./provider-catalog.js\";\nimport { entryModelIds } from \"./provider-materialize/env-harnesses.js\";\nimport { loadMergedProviderRegistry } from \"./provider-registry-load.js\";\n\n/**\n * Passed as the SDK `apiKey` where the entry carries no key, so the SDK never\n * falls back to an ambient `OPENAI_API_KEY` / `ANTHROPIC_API_KEY`.\n */\nconst NO_CREDENTIAL_PLACEHOLDER = \"no-credential-configured\";\n\n/** A model object (never the bare-string gateway selector `LanguageModel` also admits). */\ntype ModelObject = Exclude<LanguageModel, string>;\n\n/** The result of {@link resolveLanguageModel}. */\nexport interface ResolvedLanguageModel {\n /** The AI SDK model, ready for `streamText` / `generateText` / `wrapLanguageModel`. */\n model: ModelObject;\n /** Registry entry the selector routed to. */\n providerId: string;\n /** Provider-side model id the request carries (`model_map` applied). */\n modelId: string;\n /** Endpoint the model talks to; for `anthropic-messages` the host root without `/v1`. */\n baseUrl: string;\n /** The role name, when the selector was `@role`. */\n role?: string;\n /** Non-fatal notes from resolving the selector (a dangling role, …). */\n warnings: string[];\n}\n\nexport interface ResolveLanguageModelOptions {\n /** Project whose `.skaile/providers.yml` is the workspace layer. Default: `process.cwd()`. */\n projectDir?: string;\n /** Where `env:` credential references are read from. Default: `process.env`. */\n env?: Record<string, string | undefined>;\n /**\n * Role → model-ref map `@role` selectors resolve against (the session\n * config's `roles`). Without it every `@role` selector fails.\n */\n roles?: Record<string, string>;\n}\n\n/**\n * The AI SDK model for `selector`, or an error naming the fix. Throws when the\n * registry has errors, no entry matches, the credential is unresolved, the\n * entry's surface has no AI SDK factory, or the provider SDK it needs is not\n * installed.\n */\nexport async function resolveLanguageModel(\n selector: string,\n opts: ResolveLanguageModelOptions = {},\n): Promise<ResolvedLanguageModel> {\n const { merged, diagnostics } = loadMergedProviderRegistry({\n projectDir: opts.projectDir ?? process.cwd(),\n });\n const errors = diagnostics\n .filter((d) => d.severity === \"error\")\n .map((d) => (d.path ? `${d.path}: ${d.message}` : d.message));\n if (errors.length > 0) throw new Error(`providers registry: ${errors.join(\"; \")}`);\n\n const ref = parseModelRef(selector, merged, opts.roles);\n if (!ref) {\n throw new Error(\n `no provider for '${selector}': run \\`skaile providers add openrouter --credential env:OPENROUTER_API_KEY --workspace\\``,\n );\n }\n let providerId = ref.providerId;\n const warnings = [...ref.warnings];\n // `<x>/<y>` where `<x>` is no entry and no entry lists the model: `parseModelRef` took the first\n // entry only because something has to carry the id. That sends the credential to an entry the\n // caller never named (a typo'd provider id), so only an entry that declares no models, which\n // takes any `<provider>/<model>` as is (as the model endpoint does), may carry it, and the\n // result says so.\n const slash = ref.modelId?.indexOf(\"/\") ?? -1;\n // A bare id (no `/`) goes to the first entry as before; only `<x>/<y>` names a vendor head.\n const vendorHead = ref.fallback && slash > 0 ? ref.modelId?.slice(0, slash) : undefined;\n if (vendorHead) {\n const llm = registryEntries(merged).filter(\n (pair): pair is [string, AIProviderLlmEntry] =>\n pair[1].kind === \"llm\" && isEntryEnabled(pair[1]),\n );\n const passThrough = llm.find(([, e]) => entryModelIds(e).length === 0);\n if (!passThrough) {\n throw new Error(\n `'${vendorHead}' is no provider of this registry, and no provider takes '${selector}' as a model id. ` +\n `Providers: ${llm.map(([id]) => id).join(\", \") || \"none\"}. ` +\n \"Write <provider>/<model> with one of them, or use a provider that lists no models.\",\n );\n }\n providerId = passThrough[0];\n warnings.push(`'${vendorHead}' is no provider; sent to '${providerId}' as a bare model id`);\n }\n const entry = merged.providers[providerId];\n if (!entry || entry.kind !== \"llm\") {\n throw new Error(`provider '${providerId}' is not an llm entry`);\n }\n const modelId = ref.providerModelId ?? ref.modelId;\n if (!modelId) {\n throw new Error(\n `'${selector}' names no model${ref.warnings.length > 0 ? ` (${ref.warnings.join(\"; \")})` : \"\"}`,\n );\n }\n const baseUrl = normalizeEntryBaseUrl(resolveEntryBaseUrl(entry), entry.surface);\n if (!baseUrl) throw new Error(`provider '${providerId}' has no base_url`);\n const credential = resolveCredential(entry, { env: opts.env });\n if (credential.error) throw new Error(`provider '${providerId}': ${credential.error}`);\n\n const model = await createModel(\n entry,\n providerId,\n modelId,\n baseUrl,\n credential.value,\n opts.projectDir ?? process.cwd(),\n );\n return {\n model,\n providerId,\n modelId,\n baseUrl,\n ...(ref.role !== undefined ? { role: ref.role } : {}),\n warnings,\n };\n}\n\n/** `import(pkg)` with a missing-package error that names the package and the surface. */\nasync function loadProviderSdk<T>(\n load: () => Promise<T>,\n pkg: string,\n providerId: string,\n surface: string,\n projectDir: string,\n): Promise<T> {\n try {\n return await load();\n } catch (cause) {\n throw new Error(\n `provider '${providerId}' needs ${pkg} installed (surface '${surface}'). ` +\n `Run in the project: ${installCommandFor(pkg, projectDir)}`,\n { cause },\n );\n }\n}\n\nasync function createModel(\n entry: AIProviderLlmEntry,\n providerId: string,\n modelId: string,\n baseURL: string,\n secret: string | undefined,\n projectDir: string,\n): Promise<ModelObject> {\n // Same merge as model discovery (`models.ts`): static headers, then the\n // credential carrier the preset / credential kind names.\n const credentialHeaders = buildCredentialHeaders(entry, secret);\n const headers = { ...entry.headers, ...credentialHeaders };\n const bearer = credentialHeaders.Authorization !== undefined ? secret : undefined;\n const surface = entry.surface ?? \"openai-completions\";\n switch (surface) {\n case \"anthropic-messages\": {\n const { createAnthropic } = await loadProviderSdk(\n () => import(\"@ai-sdk/anthropic\"),\n \"@ai-sdk/anthropic\",\n providerId,\n surface,\n projectDir,\n );\n // `@ai-sdk/anthropic` wants the versioned base; the registry stores the host root.\n // Bearer credentials go through `authToken` (the SDK's only `Authorization` path);\n // everything else through `apiKey`, with a placeholder when the entry carries none so\n // the SDK never reads `ANTHROPIC_API_KEY` from the process environment.\n return createAnthropic({\n baseURL: `${normalizeAnthropicBaseUrl(baseURL) ?? baseURL}/v1`,\n ...(bearer !== undefined\n ? { authToken: bearer }\n : { apiKey: credentialHeaders[\"x-api-key\"] ?? NO_CREDENTIAL_PLACEHOLDER }),\n headers,\n })(modelId);\n }\n case \"openai-responses\": {\n const { createOpenAI } = await loadProviderSdk(\n () => import(\"@ai-sdk/openai\"),\n \"@ai-sdk/openai\",\n providerId,\n surface,\n projectDir,\n );\n // A placeholder `apiKey` keeps the SDK off `OPENAI_API_KEY`; the real credential\n // header (when any) is in `headers`, which the SDK applies last.\n return createOpenAI({ baseURL, apiKey: bearer ?? NO_CREDENTIAL_PLACEHOLDER, headers })(\n modelId,\n );\n }\n case \"openai-completions\": {\n const { createOpenAICompatible } = await loadProviderSdk(\n () => import(\"@ai-sdk/openai-compatible\"),\n \"@ai-sdk/openai-compatible\",\n providerId,\n surface,\n projectDir,\n );\n // No env fallback in this SDK: an absent `apiKey` sends no `Authorization` header.\n return createOpenAICompatible({\n name: providerId,\n baseURL,\n apiKey: bearer,\n headers,\n }).chatModel(modelId);\n }\n default:\n throw new Error(\n `provider '${providerId}': surface '${surface}' has no AI SDK factory yet (openai-completions, openai-responses, anthropic-messages)`,\n );\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { PROTOCOL_VERSION_STRING } from '../chunk-VZU67OKK.js';
1
+ import { PROTOCOL_VERSION_STRING } from '../chunk-G5SYFFMD.js';
2
2
  import '../chunk-NSBPE2FW.js';
3
3
  import * as z from 'zod';
4
4
 
@@ -1,39 +1,39 @@
1
- import { storeNotInstallableReason } from './chunk-TDKZL5ZC.js';
2
- import { getKnownKinds } from './chunk-HSF665NV.js';
3
- import './chunk-ZWCGJYR7.js';
1
+ import { storeNotInstallableReason } from './chunk-6RHWTZPT.js';
2
+ import { getKnownKinds } from './chunk-RAU5QPI6.js';
3
+ import './chunk-5XHQBCB5.js';
4
4
  import './chunk-7RGTAEG6.js';
5
- import './chunk-TGB4E5Z6.js';
6
- import './chunk-GBXQFJ4G.js';
7
- import './chunk-WENTJ5KP.js';
8
- import './chunk-CK3CJSRY.js';
5
+ import './chunk-JRVQV7WC.js';
6
+ import './chunk-MMOWIRHP.js';
7
+ import './chunk-J4WKNJHO.js';
8
+ import './chunk-VJRL6ZK6.js';
9
9
  import './chunk-F3D25RGM.js';
10
10
  import './chunk-3TXEJN4W.js';
11
11
  import './chunk-ISHJITXJ.js';
12
12
  import './chunk-LNFKL23K.js';
13
13
  import './chunk-JRN5QF4C.js';
14
14
  import './chunk-NUELZWCF.js';
15
- import './chunk-YJNE4V2M.js';
15
+ import './chunk-DI6J2PJB.js';
16
16
  import './chunk-PKE3PXOK.js';
17
17
  import './chunk-KTBKW2FI.js';
18
18
  import './chunk-UQ6LFBPZ.js';
19
- import './chunk-V4OXHEWY.js';
20
- import './chunk-76FLBODK.js';
21
- import './chunk-ABVWUM2E.js';
19
+ import './chunk-DS6UUCFG.js';
20
+ import './chunk-VT6G5AJV.js';
21
+ import './chunk-6ARPZHOV.js';
22
22
  import './chunk-4GY63JU6.js';
23
- import { factoryAssetRoots } from './chunk-3ENE6ZOF.js';
23
+ import { factoryAssetRoots } from './chunk-JIQUF3X2.js';
24
24
  import './chunk-5KRMNUL4.js';
25
25
  import './chunk-C5HFK34M.js';
26
26
  import './chunk-MWXYN6NY.js';
27
- import { scanRepo } from './chunk-6WQGJF65.js';
27
+ import { scanRepo } from './chunk-6SXSVKQY.js';
28
28
  import './chunk-L5VSIPQD.js';
29
29
  import './chunk-VTETQCR6.js';
30
- import './chunk-U6S5CXKB.js';
31
- import { parseRequires } from './chunk-VV2DJT4I.js';
30
+ import './chunk-E2EC6SAX.js';
31
+ import { parseRequires } from './chunk-GNUA7XT2.js';
32
32
  import './chunk-RVRB27AN.js';
33
- import './chunk-IZQOO6MN.js';
33
+ import './chunk-V5KG6CCV.js';
34
34
  import './chunk-VSX2G7LA.js';
35
35
  import './chunk-RXGPFAMN.js';
36
- import './chunk-DKXNKFKP.js';
36
+ import './chunk-SGI5MRKP.js';
37
37
  import './chunk-C3CAXQMA.js';
38
38
  import './chunk-BOFL7GIF.js';
39
39
  import './chunk-NSBPE2FW.js';
@@ -60,8 +60,8 @@ function libraryEntryOf(asset) {
60
60
  async function libraryAssets() {
61
61
  const notes = [];
62
62
  try {
63
- const { openLibraryManager } = await import('./open-library-XGUCUJYE.js');
64
- const { getKindRegistry } = await import('./open-registry-DIFEPDF6.js');
63
+ const { openLibraryManager } = await import('./open-library-OJ4HT2X4.js');
64
+ const { getKindRegistry } = await import('./open-registry-LWGIOJDK.js');
65
65
  const { scanAuthoringLibraries } = await import('./library/index.js');
66
66
  const { library: index, close } = await openLibraryManager();
67
67
  try {
@@ -94,7 +94,7 @@ async function libraryAssets() {
94
94
  async function storeAssets(projectDir) {
95
95
  const notes = [];
96
96
  try {
97
- const { resolveCatalogSource } = await import('./open-library-XGUCUJYE.js');
97
+ const { resolveCatalogSource } = await import('./open-library-OJ4HT2X4.js');
98
98
  const { source, close } = await resolveCatalogSource({ projectDir });
99
99
  try {
100
100
  const assets = (await source.listAssets()).filter(
@@ -175,5 +175,5 @@ async function gatherAssetFeeds(am, projectDir) {
175
175
  }
176
176
 
177
177
  export { gatherAssetFeeds };
178
- //# sourceMappingURL=asset-feeds-UJSYGKCX.js.map
179
- //# sourceMappingURL=asset-feeds-UJSYGKCX.js.map
178
+ //# sourceMappingURL=asset-feeds-WQ6YQPHV.js.map
179
+ //# sourceMappingURL=asset-feeds-WQ6YQPHV.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../cli/src/asset-feeds.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwEA,SAAS,eAAe,KAAA,EAAsC;AAC5D,EAAA,MAAM,EAAE,UAAS,GAAI,KAAA;AACrB,EAAA,MAAM,MAAA,GAAU,SAAS,QAAA,EAAkD,QAAA;AAC3E,EAAA,MAAM,WAAA,GAAc,SAAS,QAAA,IAAY,MAAA;AACzC,EAAA,MAAM,cACJ,OAAO,WAAA,KAAgB,QAAA,GACnB,WAAA,GACA,MAAM,OAAA,CAAQ,WAAW,CAAA,GACvB,WAAA,CAAY,OAAO,CAAC,CAAA,KAAmB,OAAO,CAAA,KAAM,QAAQ,CAAA,GAC5D,MAAA;AACR,EAAA,MAAM,OAAO,QAAA,CAAS,YAAA;AACtB,EAAA,OAAO;AAAA,IACL,MAAM,KAAA,CAAM,IAAA;AAAA,IACZ,MAAM,KAAA,CAAM,IAAA;AAAA,IACZ,aAAa,OAAO,QAAA,CAAS,WAAA,KAAgB,QAAA,GAAW,SAAS,WAAA,GAAc,EAAA;AAAA,IAC/E,QAAQ,KAAA,CAAM,YAAA;AAAA,IACd,WAAW,KAAA,CAAM,SAAA;AAAA,IACjB,GAAI,MAAM,MAAA,GAAS,EAAE,QAAQ,KAAA,CAAM,MAAA,KAAW,EAAC;AAAA,IAC/C,SAAS,KAAA,CAAM,OAAA;AAAA,IACf,QAAA,EAAU,gBAAgB,MAAA,GAAY,KAAK,aAAA,CAAc,EAAE,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AAA,EAC9B;AACF;AAGA,SAAS,GAAA,CAAI,QAAqB,OAAA,EAAwC;AACxE,EAAA,OAAO,QAAQ,GAAA,CAAI,CAAC,WAAW,EAAE,MAAA,EAAQ,OAAM,CAAE,CAAA;AACnD;AASA,eAAsB,gBAAA,CACpB,IACA,UAAA,EAC0B;AAC1B,EAAA,MAAM,CAAC,IAAA,EAAM,KAAK,CAAA,GAAI,MAAM,OAAA,CAAQ,GAAA,CAAI,CAAC,aAAA,EAAc,EAAG,WAAA,CAAY,UAAU,CAAC,CAAC,CAAA;AAClF,EAAA,MAAM,OAAA,GAAU,MAAM,aAAA,EAAc;AACpC,EAAA,MAAM,GAAA,GAAM,MAAM,YAAA,CAAa,EAAE,CAAA;AACjC,EAAA,OAAO;AAAA,IACL,OAAA,EAAS;AAAA,MACP,GAAG,GAAA;AAAA,MACH,GAAG,IAAA,CAAK,OAAA;AAAA,MACR,GAAG,GAAA,CAAI,SAAA,EAAW,OAAA,CAAQ,OAAO,CAAA;AAAA,MACjC,GAAG,GAAA,CAAI,OAAA,EAAS,KAAA,CAAM,OAAO;AAAA,KAC/B;AAAA,IACA,KAAA,EAAO,CAAC,GAAG,IAAA,CAAK,KAAA,EAAO,GAAG,KAAA,CAAM,KAAA,EAAO,GAAG,OAAA,CAAQ,KAAK;AAAA,GACzD;AACF","file":"asset-feeds-UJSYGKCX.js","sourcesContent":["/**\n * asset-feeds.ts — gather installable assets from every feed the manage TUI\n * surfaces.\n *\n * Four feeds, normalized into `CatalogEntry`:\n * - **Project sources** — `skaile.yaml` `sources:` entries (scanned via\n * `AssetManager.search()`; the new `sources:` field is merged into the\n * legacy repositories map in `AssetManager.loadConfig`).\n * - **Local libraries** — user authoring places from `LocalIndex`, read through\n * `scanAuthoringLibraries` (`@skaile/workspaces/library`): the same scan\n * `library index` / `search --local` use, so publishers and refs match them\n * (per-asset `publisher_overrides` honoured), `dev_paths` assets are left out,\n * and a library that fails to scan becomes one note while the rest stay listed.\n * - **Factory assets** — the bundled first-party `factory-assets` tree\n * (`factoryAssetRoots()`), scanned from disk. Always present; no network.\n * - **Remote store** — the configured catalog source when `catalog.url` is\n * not `local`. Failures are non-fatal — they surface as notes.\n */\n\nimport * as path from \"node:path\";\nimport {\n type AssetKind,\n type CatalogEntry,\n factoryAssetRoots,\n parseRequires,\n scanRepo,\n} from \"@skaile/workspaces/core\";\nimport { getKnownKinds } from \"./open-registry.ts\";\nimport { storeNotInstallableReason } from \"./store-addable.ts\";\nimport type { DiscoveredAsset } from \"@skaile/workspaces/discovery\";\n\n/** One non-fatal note returned to the caller for surfacing in the UI. */\nexport interface FeedNote {\n feed: \"sources\" | \"libraries\" | \"store\" | \"factory\";\n message: string;\n}\n\n/**\n * Which feed an asset came from. This is the top-level grouping axis in the\n * manage TUI (\"where is this skill coming from?\") and is intentionally distinct\n * from `publisher` (asset-intrinsic identity): the same publisher can legitimately\n * appear under more than one origin (e.g. a github repo you added as a `source`\n * that is also listed in the remote `store`).\n */\nexport type AssetOrigin = \"source\" | \"library\" | \"factory\" | \"store\";\n\n/** A catalog entry tagged with the feed it was gathered from. */\nexport interface OriginEntry {\n origin: AssetOrigin;\n entry: CatalogEntry;\n /**\n * Second-level grouping label for the manage tree. Defaults (when unset) to the\n * entry's `publisher`; the source feed sets it to the source's short repo name\n * so the Sources band groups by source — \"which repo did this come from\" — not\n * by the asset-intrinsic publisher.\n */\n group?: string;\n}\n\nexport interface AssetFeedResult {\n entries: OriginEntry[];\n notes: FeedNote[];\n}\n\n/**\n * Map one discovered library asset to the `CatalogEntry` the manage rows read.\n * `publisher` is the bare per-asset publisher (what `search --local` prints),\n * `source` the manifest path. `repo` is left unset: it only feeds the Sources-tree\n * org grouping. `requires` / `dependencies` come from the manifest the way the\n * scanner fills them — string `requires:` refs parsed to `{kind, name}`, a bundle's\n * string `dependencies:` list verbatim.\n */\nfunction libraryEntryOf(asset: DiscoveredAsset): CatalogEntry {\n const { manifest } = asset;\n const nested = (manifest.metadata as Record<string, unknown> | undefined)?.requires;\n const rawRequires = manifest.requires ?? nested;\n const requireRefs =\n typeof rawRequires === \"string\"\n ? rawRequires\n : Array.isArray(rawRequires)\n ? rawRequires.filter((r): r is string => typeof r === \"string\")\n : undefined;\n const deps = manifest.dependencies;\n return {\n name: asset.name,\n kind: asset.kind as AssetKind,\n description: typeof manifest.description === \"string\" ? manifest.description : \"\",\n source: asset.manifestPath,\n publisher: asset.publisher,\n ...(asset.plugin ? { plugin: asset.plugin } : {}),\n version: asset.version,\n requires: requireRefs === undefined ? [] : parseRequires({ requires: requireRefs }),\n dependencies:\n asset.kind === \"bundle\" && Array.isArray(deps)\n ? deps.filter((d): d is string => typeof d === \"string\" && d.length > 0)\n : [],\n };\n}\n\n/**\n * Pull assets from local libraries (the authoring places under\n * `~/.skaile/libraries/<name>/`, not the `~/.skaile/cache/sources/` cache) through\n * `scanAuthoringLibraries`, grouped under the bare library name\n * (`group: <name>`) so the manage TUI shows a clean `<name>` band — no\n * `library:` prefix (mirrors the source feed). Plugin grouping (`entry.plugin`)\n * comes from `DiscoveredAsset.plugin`. A library whose scan fails becomes one\n * `FeedNote`; the outer `catch` covers only opening the index.\n */\nasync function libraryAssets(): Promise<{\n entries: OriginEntry[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n try {\n // Lazy: the library subpath pulls in SQLite, which the other feeds never need.\n const { openLibraryManager } = await import(\"./open-library.ts\");\n const { getKindRegistry } = await import(\"./open-registry.ts\");\n const { scanAuthoringLibraries } = await import(\"@skaile/workspaces/library\");\n const { library: index, close } = await openLibraryManager();\n try {\n const entries: OriginEntry[] = [];\n for (const scan of await scanAuthoringLibraries(index, getKindRegistry())) {\n if (scan.error !== undefined) {\n notes.push({ feed: \"libraries\", message: `${scan.library.name}: ${scan.error}` });\n continue;\n }\n for (const asset of scan.assets) {\n entries.push({\n origin: \"library\",\n entry: libraryEntryOf(asset),\n group: scan.library.name,\n });\n }\n }\n return { entries, notes };\n } finally {\n close();\n }\n } catch (err) {\n notes.push({\n feed: \"libraries\",\n message: err instanceof Error ? err.message : String(err),\n });\n return { entries: [], notes };\n }\n}\n\n/**\n * Pull a (best-effort) snapshot of the connected remote store catalog.\n *\n * - Returns no entries when the resolved catalog is local-only or the host\n * is unreachable (the failure becomes a note, not an exception).\n * - Maps `CatalogAsset` → `CatalogEntry`, carrying `publisher`, `repo`, and\n * `category` straight through and using `source = \"store://<id>\"`; per-file\n * `source` paths are not available for remote assets so the canonical ref is\n * a stable placeholder.\n */\nasync function storeAssets(projectDir: string): Promise<{\n entries: CatalogEntry[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n try {\n const { resolveCatalogSource } = await import(\"./open-library.ts\");\n const { source, close } = await resolveCatalogSource({ projectDir });\n try {\n // The store lists only what `skaile add` can install (see store-addable.ts).\n const assets = (await source.listAssets()).filter(\n (a) => storeNotInstallableReason(a) === undefined,\n );\n const entries: CatalogEntry[] = assets.map((a) => ({\n name: a.name,\n kind: (a.kind as AssetKind) ?? \"skill\",\n description: a.description ?? \"\",\n source: `store://${a.id}`,\n publisher: a.publisher,\n repo: a.repo,\n plugin: a.plugin,\n category: a.category,\n version: a.version,\n requires: [],\n dependencies: [],\n }));\n return { entries, notes };\n } finally {\n close();\n }\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n // Local-only catalog throws a recognizable message — silence it; absence\n // is the user's choice, not an error.\n if (!/local/i.test(msg)) {\n notes.push({ feed: \"store\", message: msg });\n }\n return { entries: [], notes };\n }\n}\n\n/** The slice of `AssetManager` the source feed needs (kept narrow for tests). */\ninterface AssetManagerLike {\n search: () => Promise<CatalogEntry[]>;\n searchRepoRoots: () => { repoName: string; root: string }[];\n}\n\n/**\n * Project-source feed: leans on `AssetManager.search()`, which merges\n * `skaile.yaml`'s `sources:` field into the repositories map. Plugin grouping\n * (`entry.plugin`) is stamped by the scanner, so entries pass through as-is.\n */\nasync function sourceAssets(am: AssetManagerLike): Promise<OriginEntry[]> {\n // The bundled factory tree is injected into the repositories map as an implicit\n // source, so `am.search()` returns it too. It has its own `factory` origin band,\n // so drop it here — otherwise the same first-party skills list twice under Sources.\n const factoryPrefixes = factoryAssetRoots().map((r) => (r.endsWith(path.sep) ? r : r + path.sep));\n const isFactoryPath = (p: string) =>\n factoryPrefixes.some((fp) => p === fp.slice(0, -1) || p.startsWith(fp));\n\n const all = (await am.search()).filter((e) => !isFactoryPath(e.source));\n const entries: OriginEntry[] = [];\n // Group each source's entries under the source node (its short repo name), not\n // the publisher: under Sources the navigational question is \"which repo did\n // this come from\". Each entry's `source` (absolute manifest path) lives under\n // exactly one declared root, so group by prefix. The cache slug is\n // URL-keyed `github.com/<org>/<repo>` — take the trailing segment.\n for (const { repoName, root } of am.searchRepoRoots()) {\n if (isFactoryPath(root)) continue;\n const prefix = root.endsWith(path.sep) ? root : root + path.sep;\n const owned = all.filter((e) => e.source === root || e.source.startsWith(prefix));\n if (owned.length === 0) continue;\n const sourceName = repoName.split(\"/\").pop() || repoName;\n for (const entry of owned) entries.push({ origin: \"source\", entry, group: sourceName });\n }\n return entries;\n}\n\n/**\n * Factory-asset feed: scan the bundled first-party `factory-assets` tree(s)\n * resolved by `factoryAssetRoots()` (the `SKAILE_FACTORY_ASSETS_DIR` override\n * layer ahead of the bundled tree). Local disk only, no network — the entries are\n * the built-in skills / connectors / bundles that ship with `@skaile/workspaces`.\n * `factoryAssetRoots()` already dedupes, so the env override pointing at the\n * bundled dir collapses to one root.\n */\nasync function factoryAssets(): Promise<{\n entries: CatalogEntry[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n try {\n const entries: CatalogEntry[] = [];\n for (const root of factoryAssetRoots()) {\n entries.push(...(await scanRepo(root, \"skaile-factory\", { knownKinds: getKnownKinds() })));\n }\n return { entries, notes };\n } catch (err) {\n notes.push({\n feed: \"factory\",\n message: err instanceof Error ? err.message : String(err),\n });\n return { entries: [], notes };\n }\n}\n\n/** Tag a flat entry list with a single origin. */\nfunction tag(origin: AssetOrigin, entries: CatalogEntry[]): OriginEntry[] {\n return entries.map((entry) => ({ origin, entry }));\n}\n\n/**\n * Run all feeds and return a single normalized result.\n *\n * Feeds run in parallel where possible — the store fetch is the slow one\n * (one HTTP call) and is fired alongside the local library walk. The factory\n * scan is local disk only, so it runs inline.\n */\nexport async function gatherAssetFeeds(\n am: AssetManagerLike,\n projectDir: string,\n): Promise<AssetFeedResult> {\n const [libs, store] = await Promise.all([libraryAssets(), storeAssets(projectDir)]);\n const factory = await factoryAssets();\n const src = await sourceAssets(am);\n return {\n entries: [\n ...src,\n ...libs.entries,\n ...tag(\"factory\", factory.entries),\n ...tag(\"store\", store.entries),\n ],\n notes: [...libs.notes, ...store.notes, ...factory.notes],\n };\n}\n"]}
1
+ {"version":3,"sources":["../cli/src/asset-feeds.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwEA,SAAS,eAAe,KAAA,EAAsC;AAC5D,EAAA,MAAM,EAAE,UAAS,GAAI,KAAA;AACrB,EAAA,MAAM,MAAA,GAAU,SAAS,QAAA,EAAkD,QAAA;AAC3E,EAAA,MAAM,WAAA,GAAc,SAAS,QAAA,IAAY,MAAA;AACzC,EAAA,MAAM,cACJ,OAAO,WAAA,KAAgB,QAAA,GACnB,WAAA,GACA,MAAM,OAAA,CAAQ,WAAW,CAAA,GACvB,WAAA,CAAY,OAAO,CAAC,CAAA,KAAmB,OAAO,CAAA,KAAM,QAAQ,CAAA,GAC5D,MAAA;AACR,EAAA,MAAM,OAAO,QAAA,CAAS,YAAA;AACtB,EAAA,OAAO;AAAA,IACL,MAAM,KAAA,CAAM,IAAA;AAAA,IACZ,MAAM,KAAA,CAAM,IAAA;AAAA,IACZ,aAAa,OAAO,QAAA,CAAS,WAAA,KAAgB,QAAA,GAAW,SAAS,WAAA,GAAc,EAAA;AAAA,IAC/E,QAAQ,KAAA,CAAM,YAAA;AAAA,IACd,WAAW,KAAA,CAAM,SAAA;AAAA,IACjB,GAAI,MAAM,MAAA,G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A,MACN,SAAS,GAAA,YAAe,KAAA,GAAQ,GAAA,CAAI,OAAA,GAAU,OAAO,GAAG;AAAA,KACzD,CAAA;AACD,IAAA,OAAO,EAAE,OAAA,EAAS,EAAC,EAAG,KAAA,EAAM;AAAA,EAC9B;AACF;AAGA,SAAS,GAAA,CAAI,QAAqB,OAAA,EAAwC;AACxE,EAAA,OAAO,QAAQ,GAAA,CAAI,CAAC,WAAW,EAAE,MAAA,EAAQ,OAAM,CAAE,CAAA;AACnD;AASA,eAAsB,gBAAA,CACpB,IACA,UAAA,EAC0B;AAC1B,EAAA,MAAM,CAAC,IAAA,EAAM,KAAK,CAAA,GAAI,MAAM,OAAA,CAAQ,GAAA,CAAI,CAAC,aAAA,EAAc,EAAG,WAAA,CAAY,UAAU,CAAC,CAAC,CAAA;AAClF,EAAA,MAAM,OAAA,GAAU,MAAM,aAAA,EAAc;AACpC,EAAA,MAAM,GAAA,GAAM,MAAM,YAAA,CAAa,EAAE,CAAA;AACjC,EAAA,OAAO;AAAA,IACL,OAAA,EAAS;AAAA,MACP,GAAG,GAAA;AAAA,MACH,GAAG,IAAA,CAAK,OAAA;AAAA,MACR,GAAG,GAAA,CAAI,SAAA,EAAW,OAAA,CAAQ,OAAO,CAAA;AAAA,MACjC,GAAG,GAAA,CAAI,OAAA,EAAS,KAAA,CAAM,OAAO;AAAA,KAC/B;AAAA,IACA,KAAA,EAAO,CAAC,GAAG,IAAA,CAAK,KAAA,EAAO,GAAG,KAAA,CAAM,KAAA,EAAO,GAAG,OAAA,CAAQ,KAAK;AAAA,GACzD;AACF","file":"asset-feeds-WQ6YQPHV.js","sourcesContent":["/**\n * asset-feeds.ts — gather installable assets from every feed the manage TUI\n * surfaces.\n *\n * Four feeds, normalized into `CatalogEntry`:\n * - **Project sources** — `skaile.yaml` `sources:` entries (scanned via\n * `AssetManager.search()`; the new `sources:` field is merged into the\n * legacy repositories map in `AssetManager.loadConfig`).\n * - **Local libraries** — user authoring places from `LocalIndex`, read through\n * `scanAuthoringLibraries` (`@skaile/workspaces/library`): the same scan\n * `library index` / `search --local` use, so publishers and refs match them\n * (per-asset `publisher_overrides` honoured), `dev_paths` assets are left out,\n * and a library that fails to scan becomes one note while the rest stay listed.\n * - **Factory assets** — the bundled first-party `factory-assets` tree\n * (`factoryAssetRoots()`), scanned from disk. Always present; no network.\n * - **Remote store** — the configured catalog source when `catalog.url` is\n * not `local`. Failures are non-fatal — they surface as notes.\n */\n\nimport * as path from \"node:path\";\nimport {\n type AssetKind,\n type CatalogEntry,\n factoryAssetRoots,\n parseRequires,\n scanRepo,\n} from \"@skaile/workspaces/core\";\nimport { getKnownKinds } from \"./open-registry.ts\";\nimport { storeNotInstallableReason } from \"./store-addable.ts\";\nimport type { DiscoveredAsset } from \"@skaile/workspaces/discovery\";\n\n/** One non-fatal note returned to the caller for surfacing in the UI. */\nexport interface FeedNote {\n feed: \"sources\" | \"libraries\" | \"store\" | \"factory\";\n message: string;\n}\n\n/**\n * Which feed an asset came from. This is the top-level grouping axis in the\n * manage TUI (\"where is this skill coming from?\") and is intentionally distinct\n * from `publisher` (asset-intrinsic identity): the same publisher can legitimately\n * appear under more than one origin (e.g. a github repo you added as a `source`\n * that is also listed in the remote `store`).\n */\nexport type AssetOrigin = \"source\" | \"library\" | \"factory\" | \"store\";\n\n/** A catalog entry tagged with the feed it was gathered from. */\nexport interface OriginEntry {\n origin: AssetOrigin;\n entry: CatalogEntry;\n /**\n * Second-level grouping label for the manage tree. Defaults (when unset) to the\n * entry's `publisher`; the source feed sets it to the source's short repo name\n * so the Sources band groups by source — \"which repo did this come from\" — not\n * by the asset-intrinsic publisher.\n */\n group?: string;\n}\n\nexport interface AssetFeedResult {\n entries: OriginEntry[];\n notes: FeedNote[];\n}\n\n/**\n * Map one discovered library asset to the `CatalogEntry` the manage rows read.\n * `publisher` is the bare per-asset publisher (what `search --local` prints),\n * `source` the manifest path. `repo` is left unset: it only feeds the Sources-tree\n * org grouping. `requires` / `dependencies` come from the manifest the way the\n * scanner fills them — string `requires:` refs parsed to `{kind, name}`, a bundle's\n * string `dependencies:` list verbatim.\n */\nfunction libraryEntryOf(asset: DiscoveredAsset): CatalogEntry {\n const { manifest } = asset;\n const nested = (manifest.metadata as Record<string, unknown> | undefined)?.requires;\n const rawRequires = manifest.requires ?? nested;\n const requireRefs =\n typeof rawRequires === \"string\"\n ? rawRequires\n : Array.isArray(rawRequires)\n ? rawRequires.filter((r): r is string => typeof r === \"string\")\n : undefined;\n const deps = manifest.dependencies;\n return {\n name: asset.name,\n kind: asset.kind as AssetKind,\n description: typeof manifest.description === \"string\" ? manifest.description : \"\",\n source: asset.manifestPath,\n publisher: asset.publisher,\n ...(asset.plugin ? { plugin: asset.plugin } : {}),\n version: asset.version,\n requires: requireRefs === undefined ? [] : parseRequires({ requires: requireRefs }),\n dependencies:\n asset.kind === \"bundle\" && Array.isArray(deps)\n ? deps.filter((d): d is string => typeof d === \"string\" && d.length > 0)\n : [],\n };\n}\n\n/**\n * Pull assets from local libraries (the authoring places under\n * `~/.skaile/libraries/<name>/`, not the `~/.skaile/cache/sources/` cache) through\n * `scanAuthoringLibraries`, grouped under the bare library name\n * (`group: <name>`) so the manage TUI shows a clean `<name>` band — no\n * `library:` prefix (mirrors the source feed). Plugin grouping (`entry.plugin`)\n * comes from `DiscoveredAsset.plugin`. A library whose scan fails becomes one\n * `FeedNote`; the outer `catch` covers only opening the index.\n */\nasync function libraryAssets(): Promise<{\n entries: OriginEntry[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n try {\n // Lazy: the library subpath pulls in SQLite, which the other feeds never need.\n const { openLibraryManager } = await import(\"./open-library.ts\");\n const { getKindRegistry } = await import(\"./open-registry.ts\");\n const { scanAuthoringLibraries } = await import(\"@skaile/workspaces/library\");\n const { library: index, close } = await openLibraryManager();\n try {\n const entries: OriginEntry[] = [];\n for (const scan of await scanAuthoringLibraries(index, getKindRegistry())) {\n if (scan.error !== undefined) {\n notes.push({ feed: \"libraries\", message: `${scan.library.name}: ${scan.error}` });\n continue;\n }\n for (const asset of scan.assets) {\n entries.push({\n origin: \"library\",\n entry: libraryEntryOf(asset),\n group: scan.library.name,\n });\n }\n }\n return { entries, notes };\n } finally {\n close();\n }\n } catch (err) {\n notes.push({\n feed: \"libraries\",\n message: err instanceof Error ? err.message : String(err),\n });\n return { entries: [], notes };\n }\n}\n\n/**\n * Pull a (best-effort) snapshot of the connected remote store catalog.\n *\n * - Returns no entries when the resolved catalog is local-only or the host\n * is unreachable (the failure becomes a note, not an exception).\n * - Maps `CatalogAsset` → `CatalogEntry`, carrying `publisher`, `repo`, and\n * `category` straight through and using `source = \"store://<id>\"`; per-file\n * `source` paths are not available for remote assets so the canonical ref is\n * a stable placeholder.\n */\nasync function storeAssets(projectDir: string): Promise<{\n entries: CatalogEntry[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n try {\n const { resolveCatalogSource } = await import(\"./open-library.ts\");\n const { source, close } = await resolveCatalogSource({ projectDir });\n try {\n // The store lists only what `skaile add` can install (see store-addable.ts).\n const assets = (await source.listAssets()).filter(\n (a) => storeNotInstallableReason(a) === undefined,\n );\n const entries: CatalogEntry[] = assets.map((a) => ({\n name: a.name,\n kind: (a.kind as AssetKind) ?? \"skill\",\n description: a.description ?? \"\",\n source: `store://${a.id}`,\n publisher: a.publisher,\n repo: a.repo,\n plugin: a.plugin,\n category: a.category,\n version: a.version,\n requires: [],\n dependencies: [],\n }));\n return { entries, notes };\n } finally {\n close();\n }\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n // Local-only catalog throws a recognizable message — silence it; absence\n // is the user's choice, not an error.\n if (!/local/i.test(msg)) {\n notes.push({ feed: \"store\", message: msg });\n }\n return { entries: [], notes };\n }\n}\n\n/** The slice of `AssetManager` the source feed needs (kept narrow for tests). */\ninterface AssetManagerLike {\n search: () => Promise<CatalogEntry[]>;\n searchRepoRoots: () => { repoName: string; root: string }[];\n}\n\n/**\n * Project-source feed: leans on `AssetManager.search()`, which merges\n * `skaile.yaml`'s `sources:` field into the repositories map. Plugin grouping\n * (`entry.plugin`) is stamped by the scanner, so entries pass through as-is.\n */\nasync function sourceAssets(am: AssetManagerLike): Promise<OriginEntry[]> {\n // The bundled factory tree is injected into the repositories map as an implicit\n // source, so `am.search()` returns it too. It has its own `factory` origin band,\n // so drop it here — otherwise the same first-party skills list twice under Sources.\n const factoryPrefixes = factoryAssetRoots().map((r) => (r.endsWith(path.sep) ? r : r + path.sep));\n const isFactoryPath = (p: string) =>\n factoryPrefixes.some((fp) => p === fp.slice(0, -1) || p.startsWith(fp));\n\n const all = (await am.search()).filter((e) => !isFactoryPath(e.source));\n const entries: OriginEntry[] = [];\n // Group each source's entries under the source node (its short repo name), not\n // the publisher: under Sources the navigational question is \"which repo did\n // this come from\". Each entry's `source` (absolute manifest path) lives under\n // exactly one declared root, so group by prefix. The cache slug is\n // URL-keyed `github.com/<org>/<repo>` — take the trailing segment.\n for (const { repoName, root } of am.searchRepoRoots()) {\n if (isFactoryPath(root)) continue;\n const prefix = root.endsWith(path.sep) ? root : root + path.sep;\n const owned = all.filter((e) => e.source === root || e.source.startsWith(prefix));\n if (owned.length === 0) continue;\n const sourceName = repoName.split(\"/\").pop() || repoName;\n for (const entry of owned) entries.push({ origin: \"source\", entry, group: sourceName });\n }\n return entries;\n}\n\n/**\n * Factory-asset feed: scan the bundled first-party `factory-assets` tree(s)\n * resolved by `factoryAssetRoots()` (the `SKAILE_FACTORY_ASSETS_DIR` override\n * layer ahead of the bundled tree). Local disk only, no network — the entries are\n * the built-in skills / connectors / bundles that ship with `@skaile/workspaces`.\n * `factoryAssetRoots()` already dedupes, so the env override pointing at the\n * bundled dir collapses to one root.\n */\nasync function factoryAssets(): Promise<{\n entries: CatalogEntry[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n try {\n const entries: CatalogEntry[] = [];\n for (const root of factoryAssetRoots()) {\n entries.push(...(await scanRepo(root, \"skaile-factory\", { knownKinds: getKnownKinds() })));\n }\n return { entries, notes };\n } catch (err) {\n notes.push({\n feed: \"factory\",\n message: err instanceof Error ? err.message : String(err),\n });\n return { entries: [], notes };\n }\n}\n\n/** Tag a flat entry list with a single origin. */\nfunction tag(origin: AssetOrigin, entries: CatalogEntry[]): OriginEntry[] {\n return entries.map((entry) => ({ origin, entry }));\n}\n\n/**\n * Run all feeds and return a single normalized result.\n *\n * Feeds run in parallel where possible — the store fetch is the slow one\n * (one HTTP call) and is fired alongside the local library walk. The factory\n * scan is local disk only, so it runs inline.\n */\nexport async function gatherAssetFeeds(\n am: AssetManagerLike,\n projectDir: string,\n): Promise<AssetFeedResult> {\n const [libs, store] = await Promise.all([libraryAssets(), storeAssets(projectDir)]);\n const factory = await factoryAssets();\n const src = await sourceAssets(am);\n return {\n entries: [\n ...src,\n ...libs.entries,\n ...tag(\"factory\", factory.entries),\n ...tag(\"store\", store.entries),\n ],\n notes: [...libs.notes, ...store.notes, ...factory.notes],\n };\n}\n"]}
@@ -1,20 +1,20 @@
1
- export { WORKSPACE_MOUNT_ENV_VAR, deployAll, deployCatalogEntry, findAiAssetsRoot, isUnderWorkspaceMount, resolveFlowSkills, undeployCatalogEntry, workspaceMountDirs } from '../chunk-BUU2DLPC.js';
2
- import '../chunk-ABVWUM2E.js';
1
+ export { WORKSPACE_MOUNT_ENV_VAR, deployAll, deployCatalogEntry, findAiAssetsRoot, isUnderWorkspaceMount, resolveFlowSkills, undeployCatalogEntry, workspaceMountDirs } from '../chunk-USSP43U3.js';
2
+ import '../chunk-6ARPZHOV.js';
3
3
  import '../chunk-4GY63JU6.js';
4
- import '../chunk-3ENE6ZOF.js';
4
+ import '../chunk-JIQUF3X2.js';
5
5
  import '../chunk-5KRMNUL4.js';
6
6
  import '../chunk-C5HFK34M.js';
7
7
  import '../chunk-MWXYN6NY.js';
8
- import '../chunk-6WQGJF65.js';
8
+ import '../chunk-6SXSVKQY.js';
9
9
  import '../chunk-L5VSIPQD.js';
10
10
  import '../chunk-VTETQCR6.js';
11
- import '../chunk-U6S5CXKB.js';
12
- import '../chunk-VV2DJT4I.js';
11
+ import '../chunk-E2EC6SAX.js';
12
+ import '../chunk-GNUA7XT2.js';
13
13
  import '../chunk-RVRB27AN.js';
14
- import '../chunk-IZQOO6MN.js';
14
+ import '../chunk-V5KG6CCV.js';
15
15
  import '../chunk-VSX2G7LA.js';
16
16
  import '../chunk-RXGPFAMN.js';
17
- import '../chunk-DKXNKFKP.js';
17
+ import '../chunk-SGI5MRKP.js';
18
18
  import '../chunk-C3CAXQMA.js';
19
19
  import '../chunk-BOFL7GIF.js';
20
20
  import '../chunk-NSBPE2FW.js';
@@ -1,35 +1,35 @@
1
- export { AssetManager, LibraryEntryError, MissingManifestError, installAgentInstances, labelDiffHeaders, mcpNotRunnableReason, normalizeRepoUrl, parseCanonicalLockKey, parseRefTolerant, renderMcpServerConfig, setLibraryAssetCheck, setRenamedEntryLookup, softDepName } from '../chunk-TGB4E5Z6.js';
2
- import '../chunk-GBXQFJ4G.js';
3
- import '../chunk-WENTJ5KP.js';
4
- import '../chunk-CK3CJSRY.js';
1
+ export { AssetManager, LibraryEntryError, MissingManifestError, installAgentInstances, labelDiffHeaders, mcpNotRunnableReason, normalizeRepoUrl, parseCanonicalLockKey, parseRefTolerant, renderMcpServerConfig, setLibraryAssetCheck, setRenamedEntryLookup, softDepName } from '../chunk-JRVQV7WC.js';
2
+ import '../chunk-MMOWIRHP.js';
3
+ import '../chunk-J4WKNJHO.js';
4
+ import '../chunk-VJRL6ZK6.js';
5
5
  import '../chunk-F3D25RGM.js';
6
6
  import '../chunk-3TXEJN4W.js';
7
7
  import '../chunk-ISHJITXJ.js';
8
8
  import '../chunk-LNFKL23K.js';
9
9
  import '../chunk-JRN5QF4C.js';
10
10
  import '../chunk-NUELZWCF.js';
11
- export { SCAFFOLD_KINDS, createScaffold, deployAll, installAgent, installTargetOf, removeAsset } from '../chunk-YJNE4V2M.js';
11
+ export { SCAFFOLD_KINDS, createScaffold, deployAll, installAgent, installTargetOf, removeAsset } from '../chunk-DI6J2PJB.js';
12
12
  export { BUILT_IN_FRAGMENTS, loadPromptExtensions, resolveFragments } from '../chunk-PKE3PXOK.js';
13
13
  export { appendHistory, clearHistory, getRecentHistory, loadHistory } from '../chunk-KTBKW2FI.js';
14
14
  import '../chunk-UQ6LFBPZ.js';
15
- export { AGENT_RENDERERS, claudeCodeRenderer, codexRenderer, harnessTargetSupportsAgents, ompRenderer, renderAgentToFramework } from '../chunk-V4OXHEWY.js';
16
- import '../chunk-76FLBODK.js';
17
- export { FACTORY_SOURCE_URL } from '../chunk-ABVWUM2E.js';
15
+ export { AGENT_RENDERERS, claudeCodeRenderer, codexRenderer, harnessTargetSupportsAgents, ompRenderer, renderAgentToFramework } from '../chunk-DS6UUCFG.js';
16
+ import '../chunk-VT6G5AJV.js';
17
+ export { FACTORY_SOURCE_URL } from '../chunk-6ARPZHOV.js';
18
18
  import '../chunk-4GY63JU6.js';
19
- import '../chunk-3ENE6ZOF.js';
19
+ import '../chunk-JIQUF3X2.js';
20
20
  import '../chunk-5KRMNUL4.js';
21
21
  import '../chunk-C5HFK34M.js';
22
22
  import '../chunk-MWXYN6NY.js';
23
- import '../chunk-6WQGJF65.js';
23
+ import '../chunk-6SXSVKQY.js';
24
24
  import '../chunk-L5VSIPQD.js';
25
25
  import '../chunk-VTETQCR6.js';
26
- import '../chunk-U6S5CXKB.js';
27
- import '../chunk-VV2DJT4I.js';
26
+ import '../chunk-E2EC6SAX.js';
27
+ import '../chunk-GNUA7XT2.js';
28
28
  import '../chunk-RVRB27AN.js';
29
- import '../chunk-IZQOO6MN.js';
29
+ import '../chunk-V5KG6CCV.js';
30
30
  import '../chunk-VSX2G7LA.js';
31
31
  import '../chunk-RXGPFAMN.js';
32
- import '../chunk-DKXNKFKP.js';
32
+ import '../chunk-SGI5MRKP.js';
33
33
  import '../chunk-C3CAXQMA.js';
34
34
  import '../chunk-BOFL7GIF.js';
35
35
  import '../chunk-NSBPE2FW.js';
@@ -1,23 +1,23 @@
1
- export { SCAFFOLD_KINDS, assertNoLibrarySymlinks, cachedComposedFiles, canonicalEntryRef, composedDriftRefs, createScaffold, deployAll, deployAsset, deployedAssetDrift, diffDeployedAgent, installTargetOf, readKeptLegacyCopies, removeAsset, sourceComposedFiles, writeKeptLegacyCopies } from '../chunk-YJNE4V2M.js';
1
+ export { SCAFFOLD_KINDS, assertNoLibrarySymlinks, cachedComposedFiles, canonicalEntryRef, composedDriftRefs, createScaffold, deployAll, deployAsset, deployedAssetDrift, diffDeployedAgent, entriesNeedingDeploy, installTargetOf, readKeptLegacyCopies, removeAsset, sourceComposedFiles, writeKeptLegacyCopies } from '../chunk-DI6J2PJB.js';
2
2
  import '../chunk-PKE3PXOK.js';
3
- import '../chunk-V4OXHEWY.js';
4
- import '../chunk-76FLBODK.js';
5
- import '../chunk-ABVWUM2E.js';
3
+ import '../chunk-DS6UUCFG.js';
4
+ import '../chunk-VT6G5AJV.js';
5
+ import '../chunk-6ARPZHOV.js';
6
6
  import '../chunk-4GY63JU6.js';
7
- import '../chunk-3ENE6ZOF.js';
7
+ import '../chunk-JIQUF3X2.js';
8
8
  import '../chunk-5KRMNUL4.js';
9
9
  import '../chunk-C5HFK34M.js';
10
10
  import '../chunk-MWXYN6NY.js';
11
- import '../chunk-6WQGJF65.js';
11
+ import '../chunk-6SXSVKQY.js';
12
12
  import '../chunk-L5VSIPQD.js';
13
13
  import '../chunk-VTETQCR6.js';
14
- import '../chunk-U6S5CXKB.js';
15
- import '../chunk-VV2DJT4I.js';
14
+ import '../chunk-E2EC6SAX.js';
15
+ import '../chunk-GNUA7XT2.js';
16
16
  import '../chunk-RVRB27AN.js';
17
- import '../chunk-IZQOO6MN.js';
17
+ import '../chunk-V5KG6CCV.js';
18
18
  import '../chunk-VSX2G7LA.js';
19
19
  import '../chunk-RXGPFAMN.js';
20
- import '../chunk-DKXNKFKP.js';
20
+ import '../chunk-SGI5MRKP.js';
21
21
  import '../chunk-C3CAXQMA.js';
22
22
  import '../chunk-BOFL7GIF.js';
23
23
  import '../chunk-NSBPE2FW.js';