@skaile/workspaces 3.27.1 → 4.1.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 (356) hide show
  1. package/CHANGELOG.md +482 -0
  2. package/dist/app-sdk/index.js +1 -1
  3. package/dist/{asset-feeds-QF7LGRUX.js → asset-feeds-VEPD5ZU7.js} +11 -9
  4. package/dist/asset-feeds-VEPD5ZU7.js.map +1 -0
  5. package/dist/asset-manager/catalog-deployer.js +5 -3
  6. package/dist/asset-manager/index.js +11 -9
  7. package/dist/asset-manager/installer.js +8 -6
  8. package/dist/asset-manager/renderers.js +2 -2
  9. package/dist/asset-manager/src/renderers.d.ts.map +1 -1
  10. package/dist/bridge/codex-app-server.js +15 -1
  11. package/dist/bridge/drivers/claude-sdk.js +102 -55
  12. package/dist/bridge/drivers/claude-sdk.js.map +1 -1
  13. package/dist/bridge/drivers/codex.js +179 -23
  14. package/dist/bridge/drivers/codex.js.map +1 -1
  15. package/dist/bridge/drivers/continue.js +199 -7
  16. package/dist/bridge/drivers/continue.js.map +1 -1
  17. package/dist/bridge/drivers/echo.js +10 -4
  18. package/dist/bridge/drivers/echo.js.map +1 -1
  19. package/dist/bridge/drivers/gemini.js +7 -4
  20. package/dist/bridge/drivers/goose.js +160 -7
  21. package/dist/bridge/drivers/goose.js.map +1 -1
  22. package/dist/bridge/drivers/omp.js +321 -96
  23. package/dist/bridge/drivers/omp.js.map +1 -1
  24. package/dist/bridge/drivers/opencode.js +148 -13
  25. package/dist/bridge/drivers/opencode.js.map +1 -1
  26. package/dist/bridge/drivers/qwen.js +41 -11
  27. package/dist/bridge/drivers/qwen.js.map +1 -1
  28. package/dist/bridge/index.js +12 -9
  29. package/dist/bridge/src/cloud.d.ts +62 -71
  30. package/dist/bridge/src/cloud.d.ts.map +1 -1
  31. package/dist/bridge/src/codex/config-toml.d.ts +128 -0
  32. package/dist/bridge/src/codex/config-toml.d.ts.map +1 -0
  33. package/dist/bridge/src/codex/credentials.d.ts +26 -0
  34. package/dist/bridge/src/codex/credentials.d.ts.map +1 -1
  35. package/dist/bridge/src/codex/managed-driver.d.ts.map +1 -1
  36. package/dist/bridge/src/codex-app-server.d.ts.map +1 -1
  37. package/dist/bridge/src/drivers/_subprocess-cli.d.ts +9 -4
  38. package/dist/bridge/src/drivers/_subprocess-cli.d.ts.map +1 -1
  39. package/dist/bridge/src/drivers/claude-sdk.d.ts +19 -11
  40. package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
  41. package/dist/bridge/src/drivers/codex.d.ts +26 -1
  42. package/dist/bridge/src/drivers/codex.d.ts.map +1 -1
  43. package/dist/bridge/src/drivers/continue.d.ts +31 -5
  44. package/dist/bridge/src/drivers/continue.d.ts.map +1 -1
  45. package/dist/bridge/src/drivers/echo.d.ts.map +1 -1
  46. package/dist/bridge/src/drivers/gemini.d.ts +34 -3
  47. package/dist/bridge/src/drivers/gemini.d.ts.map +1 -1
  48. package/dist/bridge/src/drivers/goose.d.ts +26 -2
  49. package/dist/bridge/src/drivers/goose.d.ts.map +1 -1
  50. package/dist/bridge/src/drivers/omp-models-yml.d.ts +216 -0
  51. package/dist/bridge/src/drivers/omp-models-yml.d.ts.map +1 -0
  52. package/dist/bridge/src/drivers/omp.d.ts +26 -23
  53. package/dist/bridge/src/drivers/omp.d.ts.map +1 -1
  54. package/dist/bridge/src/drivers/opencode.d.ts +28 -3
  55. package/dist/bridge/src/drivers/opencode.d.ts.map +1 -1
  56. package/dist/bridge/src/drivers/qwen.d.ts +10 -4
  57. package/dist/bridge/src/drivers/qwen.d.ts.map +1 -1
  58. package/dist/bridge/src/index.d.ts +3 -1
  59. package/dist/bridge/src/index.d.ts.map +1 -1
  60. package/dist/bridge/src/models.d.ts +118 -19
  61. package/dist/bridge/src/models.d.ts.map +1 -1
  62. package/dist/bridge/src/provider-catalog.d.ts +188 -0
  63. package/dist/bridge/src/provider-catalog.d.ts.map +1 -0
  64. package/dist/bridge/src/provider-materialize/continue-config-yaml.d.ts +117 -0
  65. package/dist/bridge/src/provider-materialize/continue-config-yaml.d.ts.map +1 -0
  66. package/dist/bridge/src/provider-materialize/credential-env.d.ts +103 -0
  67. package/dist/bridge/src/provider-materialize/credential-env.d.ts.map +1 -0
  68. package/dist/bridge/src/provider-materialize/env-drivers.d.ts +209 -0
  69. package/dist/bridge/src/provider-materialize/env-drivers.d.ts.map +1 -0
  70. package/dist/bridge/src/provider-materialize/goose-custom-providers.d.ts +127 -0
  71. package/dist/bridge/src/provider-materialize/goose-custom-providers.d.ts.map +1 -0
  72. package/dist/bridge/src/provider-materialize/opencode-config.d.ts +127 -0
  73. package/dist/bridge/src/provider-materialize/opencode-config.d.ts.map +1 -0
  74. package/dist/bridge/src/provider-materialize/session-config-home.d.ts +63 -0
  75. package/dist/bridge/src/provider-materialize/session-config-home.d.ts.map +1 -0
  76. package/dist/bridge/src/provider-registry-derive.d.ts +59 -0
  77. package/dist/bridge/src/provider-registry-derive.d.ts.map +1 -0
  78. package/dist/bridge/src/registry.d.ts +19 -7
  79. package/dist/bridge/src/registry.d.ts.map +1 -1
  80. package/dist/bridge/src/runtime.d.ts.map +1 -1
  81. package/dist/bridge/src/types.d.ts +79 -60
  82. package/dist/bridge/src/types.d.ts.map +1 -1
  83. package/dist/bridge/src/validation.d.ts +2 -3
  84. package/dist/bridge/src/validation.d.ts.map +1 -1
  85. package/dist/{chunk-ZEXYTJ6Y.js → chunk-2GF42G2J.js} +6 -6
  86. package/dist/{chunk-ZEXYTJ6Y.js.map → chunk-2GF42G2J.js.map} +1 -1
  87. package/dist/{chunk-WWGU3REE.js → chunk-2K7NURDN.js} +7 -7
  88. package/dist/{chunk-WWGU3REE.js.map → chunk-2K7NURDN.js.map} +1 -1
  89. package/dist/{chunk-TCHEW3T2.js → chunk-2RO6N7DN.js} +6 -6
  90. package/dist/{chunk-TCHEW3T2.js.map → chunk-2RO6N7DN.js.map} +1 -1
  91. package/dist/{chunk-HSRHO7SK.js → chunk-3VSRJE3M.js} +155 -143
  92. package/dist/chunk-3VSRJE3M.js.map +1 -0
  93. package/dist/{chunk-T3YLZQS4.js → chunk-45LLHKQ2.js} +24 -3
  94. package/dist/chunk-45LLHKQ2.js.map +1 -0
  95. package/dist/chunk-5DQWB5TW.js +843 -0
  96. package/dist/chunk-5DQWB5TW.js.map +1 -0
  97. package/dist/{chunk-JMYOJ3PA.js → chunk-5HT5M5HX.js} +3 -3
  98. package/dist/{chunk-JMYOJ3PA.js.map → chunk-5HT5M5HX.js.map} +1 -1
  99. package/dist/{chunk-VN7DELUT.js → chunk-6AMTSRRO.js} +4 -4
  100. package/dist/{chunk-VN7DELUT.js.map → chunk-6AMTSRRO.js.map} +1 -1
  101. package/dist/{chunk-MX6TGDZ7.js → chunk-6DI4NTZN.js} +5 -5
  102. package/dist/{chunk-MX6TGDZ7.js.map → chunk-6DI4NTZN.js.map} +1 -1
  103. package/dist/{chunk-FFE7YLYO.js → chunk-AN7E2IL5.js} +7 -7
  104. package/dist/chunk-AN7E2IL5.js.map +1 -0
  105. package/dist/{chunk-A3HTL7XV.js → chunk-APDN5LW4.js} +3 -3
  106. package/dist/{chunk-A3HTL7XV.js.map → chunk-APDN5LW4.js.map} +1 -1
  107. package/dist/{chunk-FACPWN6P.js → chunk-ASU5IJZS.js} +9 -12
  108. package/dist/chunk-ASU5IJZS.js.map +1 -0
  109. package/dist/{chunk-J3IXRPZB.js → chunk-BTMDSMXF.js} +10 -10
  110. package/dist/{chunk-J3IXRPZB.js.map → chunk-BTMDSMXF.js.map} +1 -1
  111. package/dist/chunk-CTBUPYOQ.js +500 -0
  112. package/dist/chunk-CTBUPYOQ.js.map +1 -0
  113. package/dist/{chunk-K6VZQNTR.js → chunk-DKCFWSVW.js} +3 -3
  114. package/dist/{chunk-K6VZQNTR.js.map → chunk-DKCFWSVW.js.map} +1 -1
  115. package/dist/{chunk-MQASB52N.js → chunk-FEFTOV2Y.js} +3 -3
  116. package/dist/{chunk-MQASB52N.js.map → chunk-FEFTOV2Y.js.map} +1 -1
  117. package/dist/{chunk-XMULHVKX.js → chunk-FGTYTU6Q.js} +17 -15
  118. package/dist/chunk-FGTYTU6Q.js.map +1 -0
  119. package/dist/{chunk-WJVBJAM5.js → chunk-HHC2T7BM.js} +7 -7
  120. package/dist/{chunk-WJVBJAM5.js.map → chunk-HHC2T7BM.js.map} +1 -1
  121. package/dist/chunk-ILG4BXYE.js +936 -0
  122. package/dist/chunk-ILG4BXYE.js.map +1 -0
  123. package/dist/{chunk-E7HKNQTH.js → chunk-JXCUUZA3.js} +3 -4
  124. package/dist/chunk-JXCUUZA3.js.map +1 -0
  125. package/dist/{chunk-MBARHWMZ.js → chunk-K27T47OO.js} +79 -53
  126. package/dist/chunk-K27T47OO.js.map +1 -0
  127. package/dist/chunk-KSIRR5PL.js +142 -0
  128. package/dist/chunk-KSIRR5PL.js.map +1 -0
  129. package/dist/{chunk-SIREWRZE.js → chunk-KW7YIRYL.js} +3 -3
  130. package/dist/{chunk-SIREWRZE.js.map → chunk-KW7YIRYL.js.map} +1 -1
  131. package/dist/{chunk-3U3ZKYR7.js → chunk-LPF24MZA.js} +139 -29
  132. package/dist/chunk-LPF24MZA.js.map +1 -0
  133. package/dist/chunk-M2F5UXCX.js +187 -0
  134. package/dist/chunk-M2F5UXCX.js.map +1 -0
  135. package/dist/{chunk-DZ4UZOFB.js → chunk-M5H4DWIA.js} +3 -3
  136. package/dist/{chunk-DZ4UZOFB.js.map → chunk-M5H4DWIA.js.map} +1 -1
  137. package/dist/{chunk-PHBYB4XT.js → chunk-MLDJHV2U.js} +4 -8
  138. package/dist/chunk-MLDJHV2U.js.map +1 -0
  139. package/dist/{chunk-773WLEXL.js → chunk-MVBK4JUK.js} +3 -3
  140. package/dist/{chunk-773WLEXL.js.map → chunk-MVBK4JUK.js.map} +1 -1
  141. package/dist/{chunk-AN6NAFRT.js → chunk-N7B3LZ7V.js} +31 -6
  142. package/dist/chunk-N7B3LZ7V.js.map +1 -0
  143. package/dist/{chunk-EB72L5ZL.js → chunk-ORZBDXNS.js} +18 -30
  144. package/dist/chunk-ORZBDXNS.js.map +1 -0
  145. package/dist/{chunk-6H6HLMWG.js → chunk-OXTPH6HT.js} +3 -3
  146. package/dist/{chunk-6H6HLMWG.js.map → chunk-OXTPH6HT.js.map} +1 -1
  147. package/dist/{chunk-QSPCI4W2.js → chunk-PI244HAH.js} +175 -178
  148. package/dist/chunk-PI244HAH.js.map +1 -0
  149. package/dist/{chunk-NW65H5EV.js → chunk-PTETBRRC.js} +3 -3
  150. package/dist/{chunk-NW65H5EV.js.map → chunk-PTETBRRC.js.map} +1 -1
  151. package/dist/{chunk-UL4LD7KD.js → chunk-QQL3ET3J.js} +3 -3
  152. package/dist/{chunk-UL4LD7KD.js.map → chunk-QQL3ET3J.js.map} +1 -1
  153. package/dist/{chunk-GURXUF2J.js → chunk-R2GE2NXM.js} +95 -80
  154. package/dist/chunk-R2GE2NXM.js.map +1 -0
  155. package/dist/{chunk-IB4XKQMQ.js → chunk-REILIKVM.js} +3 -3
  156. package/dist/{chunk-IB4XKQMQ.js.map → chunk-REILIKVM.js.map} +1 -1
  157. package/dist/{chunk-3NCGSSCU.js → chunk-WLFRA5RM.js} +47 -45
  158. package/dist/chunk-WLFRA5RM.js.map +1 -0
  159. package/dist/{chunk-2BK4N3FS.js → chunk-WO65FA7W.js} +2 -7
  160. package/dist/chunk-WO65FA7W.js.map +1 -0
  161. package/dist/{chunk-72DG6GSB.js → chunk-YS4XBN7O.js} +4 -4
  162. package/dist/{chunk-72DG6GSB.js.map → chunk-YS4XBN7O.js.map} +1 -1
  163. package/dist/chunk-YSJKLJD4.js +32 -0
  164. package/dist/chunk-YSJKLJD4.js.map +1 -0
  165. package/dist/cli/index.js +765 -334
  166. package/dist/cli/index.js.map +1 -1
  167. package/dist/cli/src/commands/config.d.ts +17 -6
  168. package/dist/cli/src/commands/config.d.ts.map +1 -1
  169. package/dist/cli/src/commands/migrate-legacy-entry.d.ts +46 -0
  170. package/dist/cli/src/commands/migrate-legacy-entry.d.ts.map +1 -0
  171. package/dist/cli/src/commands/migrate-providers.d.ts +93 -0
  172. package/dist/cli/src/commands/migrate-providers.d.ts.map +1 -0
  173. package/dist/cli/src/commands/providers.d.ts +89 -0
  174. package/dist/cli/src/commands/providers.d.ts.map +1 -0
  175. package/dist/cli/src/commands/run.d.ts +1 -1
  176. package/dist/cli/src/commands/run.d.ts.map +1 -1
  177. package/dist/cli/src/setup.d.ts +46 -6
  178. package/dist/cli/src/setup.d.ts.map +1 -1
  179. package/dist/connectors/config.js +6 -4
  180. package/dist/connectors/index.js +15 -12
  181. package/dist/core/index.js +5 -3
  182. package/dist/core/provider-registry-credentials.d.ts +2 -0
  183. package/dist/core/provider-registry-credentials.js +5 -0
  184. package/dist/core/provider-registry-credentials.js.map +1 -0
  185. package/dist/core/provider-registry.d.ts +2 -0
  186. package/dist/core/provider-registry.js +4 -0
  187. package/dist/core/provider-registry.js.map +1 -0
  188. package/dist/core/runtime-assets.js +2 -2
  189. package/dist/core/src/index.d.ts +11 -4
  190. package/dist/core/src/index.d.ts.map +1 -1
  191. package/dist/core/src/process-alive.d.ts +28 -0
  192. package/dist/core/src/process-alive.d.ts.map +1 -0
  193. package/dist/core/src/provider-registry-credentials.d.ts +50 -0
  194. package/dist/core/src/provider-registry-credentials.d.ts.map +1 -0
  195. package/dist/core/src/provider-registry-files.d.ts +97 -0
  196. package/dist/core/src/provider-registry-files.d.ts.map +1 -0
  197. package/dist/core/src/provider-registry.d.ts +450 -0
  198. package/dist/core/src/provider-registry.d.ts.map +1 -0
  199. package/dist/core/src/settings.d.ts +18 -78
  200. package/dist/core/src/settings.d.ts.map +1 -1
  201. package/dist/core/src/workspace-config.d.ts +31 -47
  202. package/dist/core/src/workspace-config.d.ts.map +1 -1
  203. package/dist/core/src/workspace-yaml-editor.d.ts.map +1 -1
  204. package/dist/core/workspace-config.js +1 -1
  205. package/dist/deploy/index.js +9 -16
  206. package/dist/deploy/index.js.map +1 -1
  207. package/dist/deploy/src/targets/local.d.ts.map +1 -1
  208. package/dist/deploy/src/targets/nix.d.ts.map +1 -1
  209. package/dist/deploy/src/targets/process-handle.d.ts +0 -2
  210. package/dist/deploy/src/targets/process-handle.d.ts.map +1 -1
  211. package/dist/discovery/index.js +2 -2
  212. package/dist/{ensure-sources-GEJGBQIP.js → ensure-sources-B3VWHD5M.js} +14 -12
  213. package/dist/ensure-sources-B3VWHD5M.js.map +1 -0
  214. package/dist/factory-assets/connectors/box.js +15 -12
  215. package/dist/factory-assets/connectors/deploy.js +15 -12
  216. package/dist/factory-assets/connectors/devserver/adapter.d.ts.map +1 -1
  217. package/dist/factory-assets/connectors/devserver.js +15 -12
  218. package/dist/factory-assets/connectors/flow/adapter.js +15 -12
  219. package/dist/factory-assets/connectors/flow/engine.js +6 -4
  220. package/dist/factory-assets/connectors/flow/index.d.ts +1 -1
  221. package/dist/factory-assets/connectors/flow/index.d.ts.map +1 -1
  222. package/dist/factory-assets/connectors/flow/run-flow.d.ts +0 -3
  223. package/dist/factory-assets/connectors/flow/run-flow.d.ts.map +1 -1
  224. package/dist/factory-assets/connectors/flow/run-flow.js +16 -13
  225. package/dist/factory-assets/connectors/flow/subprompt-runner.d.ts +31 -28
  226. package/dist/factory-assets/connectors/flow/subprompt-runner.d.ts.map +1 -1
  227. package/dist/factory-assets/connectors/flow.js +15 -12
  228. package/dist/factory-assets/connectors/git.js +15 -12
  229. package/dist/factory-assets/connectors/gmail.js +15 -12
  230. package/dist/factory-assets/connectors/googledrive.js +15 -12
  231. package/dist/factory-assets/connectors/local.js +15 -12
  232. package/dist/factory-assets/connectors/mattermost.js +15 -12
  233. package/dist/factory-assets/connectors/memory.js +15 -12
  234. package/dist/factory-assets/connectors/minio.js +15 -12
  235. package/dist/factory-assets/connectors/postgres.js +15 -12
  236. package/dist/factory-assets/connectors/s3.js +15 -12
  237. package/dist/factory-assets/connectors/sharepoint.js +15 -12
  238. package/dist/factory-assets/connectors/sqlite.js +15 -12
  239. package/dist/factory-assets/connectors/static-server.js +15 -12
  240. package/dist/factory-assets/connectors/tunnel.js +15 -12
  241. package/dist/factory-assets/connectors/webdav.js +15 -12
  242. package/dist/factory-assets/connectors/xstate-store.js +15 -12
  243. package/dist/factory-assets/connectors/xstate.js +15 -12
  244. package/dist/{flows-MI2VM5JZ.js → flows-KIQH2VGA.js} +9 -7
  245. package/dist/{flows-MI2VM5JZ.js.map → flows-KIQH2VGA.js.map} +1 -1
  246. package/dist/{helpers-DXZOHX25.js → helpers-72W3NZ2L.js} +14 -12
  247. package/dist/{helpers-DXZOHX25.js.map → helpers-72W3NZ2L.js.map} +1 -1
  248. package/dist/library/index.js +8 -6
  249. package/dist/library/install.js +5 -3
  250. package/dist/{library-publish-CUPDG5NI.js → library-publish-YPHKEA6L.js} +18 -16
  251. package/dist/library-publish-YPHKEA6L.js.map +1 -0
  252. package/dist/{open-library-32XAI2LH.js → open-library-7OIUAGAH.js} +16 -14
  253. package/dist/{open-library-32XAI2LH.js.map → open-library-7OIUAGAH.js.map} +1 -1
  254. package/dist/paths-XLSP5K6C.js +18 -0
  255. package/dist/{paths-CZEH643M.js.map → paths-XLSP5K6C.js.map} +1 -1
  256. package/dist/plugin-registry/src/targets.d.ts +16 -2
  257. package/dist/plugin-registry/src/targets.d.ts.map +1 -1
  258. package/dist/{plugin-store-QJNBPIQK.js → plugin-store-V5BMOYGS.js} +7 -5
  259. package/dist/plugin-store-V5BMOYGS.js.map +1 -0
  260. package/dist/{project-RRHUCVXW.js → project-KNAZV4B3.js} +15 -13
  261. package/dist/{project-RRHUCVXW.js.map → project-KNAZV4B3.js.map} +1 -1
  262. package/dist/resolver/index.js +5 -3
  263. package/dist/runner/index.js +25 -22
  264. package/dist/runner/src/agent.d.ts +0 -2
  265. package/dist/runner/src/agent.d.ts.map +1 -1
  266. package/dist/runner/src/codex-init.d.ts.map +1 -1
  267. package/dist/runner/src/codex-resource-tools.d.ts.map +1 -1
  268. package/dist/runner/src/managed-codex-bootstrap.d.ts.map +1 -1
  269. package/dist/runner/src/resources.d.ts +1 -2
  270. package/dist/runner/src/resources.d.ts.map +1 -1
  271. package/dist/runner/src/serve.d.ts.map +1 -1
  272. package/dist/runner/src/session-builder.d.ts +31 -35
  273. package/dist/runner/src/session-builder.d.ts.map +1 -1
  274. package/dist/runner/src/session.d.ts +0 -2
  275. package/dist/runner/src/session.d.ts.map +1 -1
  276. package/dist/sdk/asset-manager.js +11 -9
  277. package/dist/sdk/bridge.js +12 -9
  278. package/dist/sdk/core.js +5 -3
  279. package/dist/sdk/flow.js +6 -4
  280. package/dist/sdk/index.js +25 -22
  281. package/dist/sdk/index.js.map +1 -1
  282. package/dist/sdk/resolver.js +5 -3
  283. package/dist/sdk/runner.js +25 -22
  284. package/dist/sdk/session.js +2 -2
  285. package/dist/sdk/types.js +1 -1
  286. package/dist/session/index.js +2 -2
  287. package/dist/setup-TG4KECRQ.js +435 -0
  288. package/dist/setup-TG4KECRQ.js.map +1 -0
  289. package/dist/{skills-IE3IWWB7.js → skills-KHBYF6AU.js} +7 -5
  290. package/dist/{skills-IE3IWWB7.js.map → skills-KHBYF6AU.js.map} +1 -1
  291. package/dist/{source-RHQLCTWA.js → source-7AFRUD3U.js} +17 -15
  292. package/dist/{source-RHQLCTWA.js.map → source-7AFRUD3U.js.map} +1 -1
  293. package/dist/{source-manifest-publish-DXMCSKU7.js → source-manifest-publish-JWOT7O3A.js} +19 -17
  294. package/dist/source-manifest-publish-JWOT7O3A.js.map +1 -0
  295. package/dist/tui/index.js +25 -23
  296. package/dist/tui/index.js.map +1 -1
  297. package/dist/tui/src/repl.d.ts +0 -2
  298. package/dist/tui/src/repl.d.ts.map +1 -1
  299. package/dist/types/index.js +1 -1
  300. package/dist/types/manifests.js +1 -1
  301. package/dist/types/src/index.d.ts +1 -1
  302. package/dist/types/src/index.d.ts.map +1 -1
  303. package/dist/types/src/lifecycle.d.ts +35 -10
  304. package/dist/types/src/lifecycle.d.ts.map +1 -1
  305. package/dist/types/src/manifests/agent.d.ts +116 -22
  306. package/dist/types/src/manifests/agent.d.ts.map +1 -1
  307. package/dist/types/src/manifests/index.d.ts +2 -2
  308. package/dist/types/src/manifests/index.d.ts.map +1 -1
  309. package/dist/types/src/manifests/preset.d.ts +5 -5
  310. package/dist/types/src/runtime.d.ts +51 -5
  311. package/dist/types/src/runtime.d.ts.map +1 -1
  312. package/dist/types/src/version.d.ts +18 -2
  313. package/dist/types/src/version.d.ts.map +1 -1
  314. package/dist/validator-P5ESKTW5.js +5 -0
  315. package/dist/{validator-RN64BKFW.js.map → validator-P5ESKTW5.js.map} +1 -1
  316. package/dist/workspace-plugin/adapters/mcp.js +11 -9
  317. package/dist/workspace-plugin/adapters/omp.js +11 -11
  318. package/dist/workspace-plugin/adapters/omp.js.map +1 -1
  319. package/dist/workspace-plugin/index.js +1 -1
  320. package/dist/workspace-plugin/src/plugin.d.ts +1 -4
  321. package/dist/workspace-plugin/src/plugin.d.ts.map +1 -1
  322. package/dist/workspace-plugin/src/tools/validator.d.ts +4 -4
  323. package/dist/workspace-plugin/src/tools/validator.d.ts.map +1 -1
  324. package/package.json +13 -1
  325. package/dist/asset-feeds-QF7LGRUX.js.map +0 -1
  326. package/dist/bridge/src/provider-endpoints.d.ts +0 -55
  327. package/dist/bridge/src/provider-endpoints.d.ts.map +0 -1
  328. package/dist/chunk-2BK4N3FS.js.map +0 -1
  329. package/dist/chunk-3NCGSSCU.js.map +0 -1
  330. package/dist/chunk-3U3ZKYR7.js.map +0 -1
  331. package/dist/chunk-AN6NAFRT.js.map +0 -1
  332. package/dist/chunk-AQW4BWNR.js +0 -324
  333. package/dist/chunk-AQW4BWNR.js.map +0 -1
  334. package/dist/chunk-E7HKNQTH.js.map +0 -1
  335. package/dist/chunk-EB72L5ZL.js.map +0 -1
  336. package/dist/chunk-FACPWN6P.js.map +0 -1
  337. package/dist/chunk-FFE7YLYO.js.map +0 -1
  338. package/dist/chunk-FYIHH56K.js +0 -110
  339. package/dist/chunk-FYIHH56K.js.map +0 -1
  340. package/dist/chunk-GURXUF2J.js.map +0 -1
  341. package/dist/chunk-HSRHO7SK.js.map +0 -1
  342. package/dist/chunk-MBARHWMZ.js.map +0 -1
  343. package/dist/chunk-PHBYB4XT.js.map +0 -1
  344. package/dist/chunk-QSPCI4W2.js.map +0 -1
  345. package/dist/chunk-T3YLZQS4.js.map +0 -1
  346. package/dist/chunk-XMULHVKX.js.map +0 -1
  347. package/dist/ensure-sources-GEJGBQIP.js.map +0 -1
  348. package/dist/library-publish-CUPDG5NI.js.map +0 -1
  349. package/dist/paths-CZEH643M.js +0 -16
  350. package/dist/plugin-store-QJNBPIQK.js.map +0 -1
  351. package/dist/runner/src/cloud-bundle.d.ts +0 -36
  352. package/dist/runner/src/cloud-bundle.d.ts.map +0 -1
  353. package/dist/setup-CIRH5BYB.js +0 -517
  354. package/dist/setup-CIRH5BYB.js.map +0 -1
  355. package/dist/source-manifest-publish-DXMCSKU7.js.map +0 -1
  356. package/dist/validator-RN64BKFW.js +0 -5
package/dist/cli/index.js CHANGED
@@ -1,79 +1,82 @@
1
1
  #!/usr/bin/env node
2
- import { makeInstallCommand, makeCheckCommand, makeCleanCommand, reportInstalledSoftDeps } from '../chunk-WJVBJAM5.js';
3
- import { getStoreConfig, storeFetch, deviceLogin, loadStoreAuthConfig, logout, hasStoredAuth, isStoreAuthenticated, getStoreToken, getStoreIdentity } from '../chunk-6H6HLMWG.js';
4
- import { makeSourceCommand, syncProjectSources } from '../chunk-J3IXRPZB.js';
5
- import { openCatalogSource, openLibraryManager, createFullRegistry, openLibrary } from '../chunk-ZEXYTJ6Y.js';
6
- import { logErr, S, logOk, logInfo, kindColorPad, kindColor, colorRef, formatSoftDepSection, bareSoftDepName, logWarn, formatSoftDepHint, formatRelativeTime, formatSoftDepRemovePreview, formatSoftDepAddPreview, fitWidth } from '../chunk-A3HTL7XV.js';
7
- import { AI_RESOURCES } from '../chunk-NW65H5EV.js';
2
+ import { AI_RESOURCES } from '../chunk-PTETBRRC.js';
3
+ import { makeInstallCommand, makeCheckCommand, makeCleanCommand, reportInstalledSoftDeps } from '../chunk-HHC2T7BM.js';
4
+ import { makeProvidersCommand, loadRegistryView, addProviderEntry, ProviderRegistryWriteError } from '../chunk-CTBUPYOQ.js';
5
+ import { getStoreConfig, storeFetch, deviceLogin, loadStoreAuthConfig, logout, hasStoredAuth, isStoreAuthenticated, getStoreToken, getStoreIdentity } from '../chunk-OXTPH6HT.js';
6
+ import { makeSourceCommand, syncProjectSources } from '../chunk-BTMDSMXF.js';
7
+ import { openCatalogSource, openLibraryManager, createFullRegistry, openLibrary } from '../chunk-2GF42G2J.js';
8
+ import { logErr, S, logOk, logInfo, logWarn, kindColorPad, kindColor, colorRef, formatSoftDepSection, bareSoftDepName, formatSoftDepHint, formatRelativeTime, formatSoftDepRemovePreview, formatSoftDepAddPreview, fitWidth } from '../chunk-APDN5LW4.js';
8
9
  import { LocalSecretsProvider } from '../chunk-6BEGKO2Q.js';
9
- import { runAgentChat, loadSessionById, loadSession, listSessions, setCurrentSession, deleteSession, clearSession, loadAgentManifest, compileComposition, MarkdownStreamer, resolveMixin } from '../chunk-QSPCI4W2.js';
10
- import '../chunk-FFE7YLYO.js';
11
- import '../chunk-E7HKNQTH.js';
12
- import '../chunk-FUCYTGAE.js';
13
- import '../chunk-773WLEXL.js';
14
- import '../chunk-R6O6YWU7.js';
10
+ import { runAgentChat, loadSessionById, loadSession, listSessions, setCurrentSession, deleteSession, clearSession, loadAgentManifest, compileComposition, MarkdownStreamer, resolveMixin } from '../chunk-PI244HAH.js';
11
+ import { buildClaudePluginFiles } from '../chunk-WO65FA7W.js';
12
+ import '../chunk-AN7E2IL5.js';
13
+ import '../chunk-MVBK4JUK.js';
15
14
  import '../chunk-FAI2SMFE.js';
16
15
  import '../chunk-7IRJ4K4F.js';
17
- import { buildClaudePluginFiles } from '../chunk-2BK4N3FS.js';
16
+ import '../chunk-JXCUUZA3.js';
17
+ import '../chunk-FUCYTGAE.js';
18
+ import '../chunk-R6O6YWU7.js';
18
19
  import '../chunk-X5YPJV4N.js';
19
- import '../chunk-W3UDISS2.js';
20
20
  import '../chunk-O7SG5PC2.js';
21
21
  import '../chunk-7QBNJTTQ.js';
22
22
  import '../chunk-GTS2FODO.js';
23
23
  import '../chunk-73ZXUUL6.js';
24
24
  import '../chunk-32NA4TVC.js';
25
- import '../chunk-T3YLZQS4.js';
26
- import { runFlow, resumeFlow } from '../chunk-FACPWN6P.js';
25
+ import '../chunk-W3UDISS2.js';
26
+ import '../chunk-45LLHKQ2.js';
27
+ import { runFlow, resumeFlow } from '../chunk-ASU5IJZS.js';
27
28
  import '../chunk-4R6DROGN.js';
28
29
  import { validateFlowVersions, parseSkillFrontmatter } from '../chunk-3XXQPHGL.js';
29
30
  import '../chunk-7BUZQVRR.js';
30
31
  import '../chunk-M6VQU5TS.js';
31
- import '../chunk-EB72L5ZL.js';
32
- import '../chunk-SIREWRZE.js';
33
- import '../chunk-XMULHVKX.js';
34
- import '../chunk-3NCGSSCU.js';
32
+ import '../chunk-ORZBDXNS.js';
33
+ import '../chunk-KW7YIRYL.js';
34
+ import '../chunk-FGTYTU6Q.js';
35
+ import '../chunk-WLFRA5RM.js';
35
36
  import '../chunk-LOO5CB5M.js';
36
- import '../chunk-UL4LD7KD.js';
37
- import '../chunk-GURXUF2J.js';
37
+ import '../chunk-QQL3ET3J.js';
38
+ import '../chunk-R2GE2NXM.js';
38
39
  import '../chunk-GAH4YRCI.js';
39
- import '../chunk-AQW4BWNR.js';
40
+ import { deriveRegistryFromLegacyApiKeys, getProviderPreset, AI_PROVIDER_PRESETS } from '../chunk-5DQWB5TW.js';
40
41
  import '../chunk-6E6PKKAD.js';
41
42
  import '../chunk-IFGTRL2I.js';
42
- import { projectAiAssetsRoots, loadFlow, loadAllFlowEntries, findFlowFileInRoots } from '../chunk-JMYOJ3PA.js';
43
+ import { projectAiAssetsRoots, loadFlow, loadAllFlowEntries, findFlowFileInRoots } from '../chunk-5HT5M5HX.js';
43
44
  import '../chunk-TIOT3ZOQ.js';
44
45
  import '../chunk-53ORCYPJ.js';
45
46
  import '../chunk-2D5BYAL6.js';
46
47
  import { nodeLabel, nodeSkillAsset, nodeIsInert, nodeIsOptional, nodeRunKind, flowSkillVersionPins } from '../chunk-ELPR5XBG.js';
47
- import '../chunk-72DG6GSB.js';
48
- import { AssetManager, NON_DEPLOYABLE_KINDS, MissingManifestError, parseRefTolerant, normalizeRepoUrl, FACTORY_SOURCE_URL } from '../chunk-WWGU3REE.js';
49
- import { getStoreManifestsDir, getDefaultValue, isSecretPlaceholder } from '../chunk-TCHEW3T2.js';
50
- import '../chunk-DZ4UZOFB.js';
48
+ import '../chunk-YS4XBN7O.js';
49
+ import { AssetManager, NON_DEPLOYABLE_KINDS, MissingManifestError, parseRefTolerant, normalizeRepoUrl, FACTORY_SOURCE_URL } from '../chunk-2K7NURDN.js';
50
+ import { getStoreManifestsDir, getDefaultValue, isSecretPlaceholder } from '../chunk-2RO6N7DN.js';
51
+ import '../chunk-M5H4DWIA.js';
51
52
  import '../chunk-UKJMQZV6.js';
52
53
  import '../chunk-R7FOF242.js';
53
54
  import '../chunk-JXT46QFC.js';
54
- import '../chunk-MX6TGDZ7.js';
55
+ import '../chunk-6DI4NTZN.js';
55
56
  import '../chunk-CGYEHQOX.js';
56
- import { resolveSettings, globalSettingsPath, projectSettingsPath, loadSettings, saveSettings, portableSpawn, portableSpawnSync, WorkspaceYamlEditor, resolveLibraryDir, checkAgentSkillConformance, aiResourceRoots, readLock } from '../chunk-HSRHO7SK.js';
57
+ import { resolveSettings, globalSettingsPath, projectSettingsPath, loadSettings, saveSettings, WorkspaceYamlEditor, resolveLibraryDir, checkAgentSkillConformance, aiResourceRoots, readLock, workspaceProviderRegistryPath, userProviderRegistryPath, loadProviderRegistryFile } from '../chunk-3VSRJE3M.js';
58
+ import { factoryAssetRoots } from '../chunk-REILIKVM.js';
57
59
  import '../chunk-F3HNW354.js';
58
60
  import { DRIVER_DEFAULTS } from '../chunk-K5GBV4SA.js';
59
61
  import { detectDomains, assetSearchDirs } from '../chunk-QVZA2MDT.js';
60
- import { factoryAssetRoots } from '../chunk-IB4XKQMQ.js';
61
- import { globalCacheRoot, sourceCacheKey, getGlobalCacheDir, resolveAgentDir, matchPin, coerceVersion, loadSkWorkspaceConfig, resolveSkWorkspaceConfig, storeManifestSlug } from '../chunk-MBARHWMZ.js';
62
+ import { globalCacheRoot, sourceCacheKey, getGlobalCacheDir, resolveAgentDir, matchPin, coerceVersion, loadSkWorkspaceConfig, resolveSkWorkspaceConfig, storeManifestSlug, isWorkspaceConfigFilename } from '../chunk-K27T47OO.js';
62
63
  import { SUPPORTED_DRIVER_TARGETS } from '../chunk-MENCWIHW.js';
63
64
  import { SKAILE_MANIFEST_FILENAME, decodeSkaileManifest, loadSkPublishManifest, saveSkPublishManifest } from '../chunk-P4VHQA4N.js';
64
65
  import { parseFrontmatter, scanDirectory } from '../chunk-MKZOK4JU.js';
65
66
  import { parseAssetRef, ASSET_KINDS, isValidAssetName, slugifyAssetName, ASSET_NAME_HINT, assetRefToStr } from '../chunk-GEEW6SY2.js';
66
67
  import { openSqlite } from '../chunk-FTG7CRFD.js';
68
+ import { portableSpawn, portableSpawnSync } from '../chunk-KSIRR5PL.js';
69
+ import { parseModelRef, mergeRegistries, resolveEntryBaseUrl } from '../chunk-ILG4BXYE.js';
67
70
  import '../chunk-W4IPN3DD.js';
68
71
  import '../chunk-KTBKW2FI.js';
69
72
  import '../chunk-UQ6LFBPZ.js';
70
- import '../chunk-K6VZQNTR.js';
71
- import { validatePreset } from '../chunk-AN6NAFRT.js';
73
+ import '../chunk-DKCFWSVW.js';
74
+ import { validatePreset } from '../chunk-N7B3LZ7V.js';
72
75
  import '../chunk-NSBPE2FW.js';
73
76
  import * as fs12 from 'fs';
74
77
  import fs12__default, { readFileSync, existsSync, mkdirSync, writeFileSync, lstatSync, rmSync, readdirSync, statSync } from 'fs';
75
- import * as path35 from 'path';
76
- import path35__default, { resolve, join } from 'path';
78
+ import * as path36 from 'path';
79
+ import path36__default, { resolve, join } from 'path';
77
80
  import { fileURLToPath } from 'url';
78
81
  import { Help, Command, Option } from 'commander';
79
82
  import { rcompare } from 'semver';
@@ -81,7 +84,7 @@ import * as p5 from '@clack/prompts';
81
84
  import pc5 from 'picocolors';
82
85
  import * as os from 'os';
83
86
  import { homedir } from 'os';
84
- import { parse, stringify } from 'yaml';
87
+ import { parse, stringify, parseDocument } from 'yaml';
85
88
  import * as readline from 'readline';
86
89
  import { createInterface } from 'readline';
87
90
  import fs5 from 'fs/promises';
@@ -111,7 +114,7 @@ async function runSearch(kind, query, opts) {
111
114
  const showLocal = !opts.store;
112
115
  const showStore = !opts.local;
113
116
  const { resolveConfig } = await import('../library/index.js');
114
- const airGapped = resolveConfig({ projectDir: path35__default.resolve(opts.projectDir) }).catalog.cache_ttl === 0;
117
+ const airGapped = resolveConfig({ projectDir: path36__default.resolve(opts.projectDir) }).catalog.cache_ttl === 0;
115
118
  if (showLocal) {
116
119
  await searchLocal(query, kind, opts, showStore, airGapped);
117
120
  }
@@ -120,7 +123,7 @@ async function runSearch(kind, query, opts) {
120
123
  }
121
124
  }
122
125
  async function searchIndex(query, kind) {
123
- const { openLibrary: openLibrary2 } = await import('../open-library-32XAI2LH.js');
126
+ const { openLibrary: openLibrary2 } = await import('../open-library-7OIUAGAH.js');
124
127
  const library = await openLibrary2();
125
128
  try {
126
129
  const defs = await library.listAssetDefs(kind ? { kind } : {});
@@ -152,7 +155,7 @@ async function searchIndex(query, kind) {
152
155
  }
153
156
  }
154
157
  async function searchFactory(projectDir, query, kind) {
155
- const prefixes = factoryAssetRoots().map((r) => r.endsWith(path35__default.sep) ? r : r + path35__default.sep);
158
+ const prefixes = factoryAssetRoots().map((r) => r.endsWith(path36__default.sep) ? r : r + path36__default.sep);
156
159
  const isFactoryPath = (p7) => prefixes.some((fp) => p7 === fp.slice(0, -1) || p7.startsWith(fp));
157
160
  try {
158
161
  const entries = await new AssetManager({ projectDir }).search(query, kind);
@@ -169,11 +172,11 @@ function unionEntries(indexed, factory) {
169
172
  return [...indexed, ...factory.filter((e) => !seen.has(entryDedupKey(e)))];
170
173
  }
171
174
  async function searchLocal(query, kind, opts, showStore, airGapped) {
172
- const projectDir = path35__default.resolve(opts.projectDir);
175
+ const projectDir = path36__default.resolve(opts.projectDir);
173
176
  const factory = await searchFactory(projectDir, query, kind);
174
177
  let entries = unionEntries(await searchIndex(query, kind), factory);
175
178
  if (entries.length === 0 && !query && !kind && !airGapped) {
176
- const { autoSyncForSearch } = await import('../source-RHQLCTWA.js');
179
+ const { autoSyncForSearch } = await import('../source-7AFRUD3U.js');
177
180
  if (await autoSyncForSearch(projectDir)) {
178
181
  entries = unionEntries(await searchIndex(query, kind), factory);
179
182
  }
@@ -227,9 +230,9 @@ async function searchStore(query, kind, opts, airGapped) {
227
230
  logInfo("air-gapped (cache_ttl: 0) \u2014 local sources only");
228
231
  return;
229
232
  }
230
- const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-32XAI2LH.js');
233
+ const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-7OIUAGAH.js');
231
234
  try {
232
- const remote = await openCatalogSource2({ projectDir: path35__default.resolve(opts.projectDir) });
235
+ const remote = await openCatalogSource2({ projectDir: path36__default.resolve(opts.projectDir) });
233
236
  const assets = await remote.listAssets(kind ? { kind } : {});
234
237
  const results = filterCatalogAssets(assets, query);
235
238
  if (results.length > 0) {
@@ -343,7 +346,7 @@ function makeAddCommand() {
343
346
  }
344
347
  const backends = parseBackendFilter(opts.backend);
345
348
  const am2 = new AssetManager({
346
- projectDir: path35__default.resolve(opts.projectDir),
349
+ projectDir: path36__default.resolve(opts.projectDir),
347
350
  global: opts.global || backends !== void 0,
348
351
  backends,
349
352
  driverTarget: opts.target
@@ -386,7 +389,7 @@ function makeRemoveCommand() {
386
389
  ).option("--target <agent>", "Driver target", "claude-code").option("--no-soft-deps", "skip the orphaned-soft-dep prompt (don't remove, don't report)").action(async (ref, opts) => {
387
390
  const backends = parseBackendFilter(opts.backend);
388
391
  const am2 = new AssetManager({
389
- projectDir: path35__default.resolve(opts.projectDir),
392
+ projectDir: path36__default.resolve(opts.projectDir),
390
393
  global: opts.global || backends !== void 0,
391
394
  backends,
392
395
  driverTarget: opts.target
@@ -426,7 +429,7 @@ function makeListCommand() {
426
429
  return;
427
430
  }
428
431
  const am2 = new AssetManager({
429
- projectDir: path35__default.resolve(opts.projectDir),
432
+ projectDir: path36__default.resolve(opts.projectDir),
430
433
  driverTarget: opts.target
431
434
  });
432
435
  let declared;
@@ -471,7 +474,7 @@ function makeListCommand() {
471
474
  }
472
475
  function runGlobalList(kind, opts, backends) {
473
476
  const am2 = new AssetManager({
474
- projectDir: path35__default.resolve(opts.projectDir),
477
+ projectDir: path36__default.resolve(opts.projectDir),
475
478
  global: true,
476
479
  backends
477
480
  });
@@ -542,7 +545,7 @@ async function resolveInfoEntry(am2, ref, opts) {
542
545
  return { entry: match ?? deployed };
543
546
  }
544
547
  const lookup = opts.storeLookup ?? (async (filter) => {
545
- const { resolveCatalogSource } = await import('../open-library-32XAI2LH.js');
548
+ const { resolveCatalogSource } = await import('../open-library-7OIUAGAH.js');
546
549
  const { source, close } = await resolveCatalogSource({ projectDir: opts.projectDir });
547
550
  try {
548
551
  return await source.listAssets(filter);
@@ -558,7 +561,7 @@ async function resolveInfoEntry(am2, ref, opts) {
558
561
  );
559
562
  return { entry: hit ? catalogAssetToEntry(hit) : null };
560
563
  } catch (err) {
561
- const { LocalCatalogDisabledError } = await import('../open-library-32XAI2LH.js');
564
+ const { LocalCatalogDisabledError } = await import('../open-library-7OIUAGAH.js');
562
565
  const storeNote = err instanceof Error ? err.message : String(err);
563
566
  const disabled = err instanceof LocalCatalogDisabledError || /catalog\.url/i.test(storeNote);
564
567
  return { entry: null, storeNote, ...disabled ? { storeDisabled: true } : {} };
@@ -574,7 +577,7 @@ function infoNotFoundHint(ref, lookup) {
574
577
  }
575
578
  function makeInfoCommand() {
576
579
  return new Command("info").description("Show asset metadata, deps, deploy status").argument("<ref>", "Asset reference (kind:name)").option("--project-dir <path>", "Project directory", process.cwd()).action(async (ref, opts) => {
577
- const projectDir = path35__default.resolve(opts.projectDir);
580
+ const projectDir = path36__default.resolve(opts.projectDir);
578
581
  const am2 = new AssetManager({ projectDir });
579
582
  const lookup = await resolveInfoEntry(am2, ref, { projectDir });
580
583
  const entry = lookup.entry;
@@ -610,7 +613,7 @@ function makeCreateCommand() {
610
613
  new Option("-k, --kind <kind>", "Asset kind").default("skill").choices([...ASSET_KINDS])
611
614
  ).option("-d, --dir <dir>", "Target directory (default: cwd)").action((name, opts) => {
612
615
  const am2 = new AssetManager({ projectDir: process.cwd() });
613
- const destDir = opts.dir ? path35__default.resolve(opts.dir) : process.cwd();
616
+ const destDir = opts.dir ? path36__default.resolve(opts.dir) : process.cwd();
614
617
  const result = am2.create(name, opts.kind, destDir);
615
618
  if (result.ok) logOk(`Created ${kindColor(opts.kind)}: ${pc5.dim(result.path)}`);
616
619
  else {
@@ -621,7 +624,7 @@ function makeCreateCommand() {
621
624
  }
622
625
  function makeDoctorCommand() {
623
626
  return new Command("doctor").description("Scan for missing dependency chains").argument("[name]", "Check a specific asset (kind:name)").option("--project-dir <path>", "Project directory", process.cwd()).action(async (name, opts) => {
624
- const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
627
+ const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
625
628
  const issues = await am2.doctor();
626
629
  if (issues.length === 0) {
627
630
  logOk("No missing dependencies.");
@@ -649,20 +652,20 @@ function claudeSkillRoots() {
649
652
  const roots = [];
650
653
  const override = process.env.SKAILE_CLAUDE_SKILLS_DIR;
651
654
  if (override) roots.push(override);
652
- roots.push(path35.join(os.homedir(), ".claude", "skills"));
655
+ roots.push(path36.join(os.homedir(), ".claude", "skills"));
653
656
  return roots;
654
657
  }
655
658
  function resolveImportSource(nameOrPath) {
656
- const asPath = path35.resolve(nameOrPath);
659
+ const asPath = path36.resolve(nameOrPath);
657
660
  if (fs12.existsSync(asPath)) {
658
- const dir = fs12.statSync(asPath).isDirectory() ? asPath : path35.dirname(asPath);
659
- const skillFile = path35.join(dir, "SKILL.md");
661
+ const dir = fs12.statSync(asPath).isDirectory() ? asPath : path36.dirname(asPath);
662
+ const skillFile = path36.join(dir, "SKILL.md");
660
663
  if (fs12.existsSync(skillFile)) return { dir, skillFile, via: "path" };
661
664
  }
662
- if (!nameOrPath.includes(path35.sep) && !nameOrPath.startsWith(".")) {
665
+ if (!nameOrPath.includes(path36.sep) && !nameOrPath.startsWith(".")) {
663
666
  for (const root of claudeSkillRoots()) {
664
- const dir = path35.join(root, nameOrPath);
665
- const skillFile = path35.join(dir, "SKILL.md");
667
+ const dir = path36.join(root, nameOrPath);
668
+ const skillFile = path36.join(dir, "SKILL.md");
666
669
  if (fs12.existsSync(skillFile)) return { dir, skillFile, via: "claude-skills" };
667
670
  }
668
671
  }
@@ -728,8 +731,8 @@ ${description}
728
731
  `;
729
732
  };
730
733
  function ensureDomain(libraryPath, domain, opts = {}) {
731
- const dir = path35.join(libraryPath, domain);
732
- const domainFile = path35.join(dir, "DOMAIN.md");
734
+ const dir = path36.join(libraryPath, domain);
735
+ const domainFile = path36.join(dir, "DOMAIN.md");
733
736
  const publisher = opts.publisher ?? slugifyAssetName(domain);
734
737
  if (fs12.existsSync(domainFile)) {
735
738
  return { dir, publisher, created: false };
@@ -741,7 +744,7 @@ function ensureDomain(libraryPath, domain, opts = {}) {
741
744
  }
742
745
  function listDomains(libraryPath) {
743
746
  if (!fs12.existsSync(libraryPath)) return [];
744
- return fs12.readdirSync(libraryPath, { withFileTypes: true }).filter((e) => e.isDirectory() && fs12.existsSync(path35.join(libraryPath, e.name, "DOMAIN.md"))).map((e) => e.name).sort();
747
+ return fs12.readdirSync(libraryPath, { withFileTypes: true }).filter((e) => e.isDirectory() && fs12.existsSync(path36.join(libraryPath, e.name, "DOMAIN.md"))).map((e) => e.name).sort();
745
748
  }
746
749
  function upsertManifestAsset(libraryPath, input) {
747
750
  const manifest = loadSkPublishManifest(libraryPath) ?? { assets: [] };
@@ -812,10 +815,10 @@ function makeAssetCommand() {
812
815
  }
813
816
  const rawSkill = fs12.readFileSync(src.skillFile, "utf8");
814
817
  const norm = opts.normalize ? normalizeSkillContent(rawSkill, {
815
- fallbackName: path35.basename(src.dir),
818
+ fallbackName: path36.basename(src.dir),
816
819
  version: opts.version,
817
820
  stage: opts.stage
818
- }) : { content: rawSkill, name: path35.basename(src.dir), changed: false, notes: [] };
821
+ }) : { content: rawSkill, name: path36.basename(src.dir), changed: false, notes: [] };
819
822
  if (!opts.normalize && !isValidAssetName(norm.name)) {
820
823
  logWarn(
821
824
  `Name "${norm.name}" is not canonical (kebab-case); \`skaile validate\` will reject this manifest entry. Drop --no-normalize to slugify it.`
@@ -826,17 +829,17 @@ function makeAssetCommand() {
826
829
  if (opts.domain) {
827
830
  const dom = ensureDomain(target.path, opts.domain);
828
831
  if (dom.created) logOk(`Scaffolded domain ${S.cmd(opts.domain)} \u2192 ${dom.dir}`);
829
- destParent = path35.join(dom.dir, "skills");
832
+ destParent = path36.join(dom.dir, "skills");
830
833
  publisher = dom.publisher;
831
834
  }
832
835
  fs12.mkdirSync(destParent, { recursive: true });
833
- const destDir = path35.join(destParent, norm.name);
836
+ const destDir = path36.join(destParent, norm.name);
834
837
  if (fs12.existsSync(destDir)) {
835
838
  logErr(`Destination already exists: ${destDir}`);
836
839
  process.exit(1);
837
840
  }
838
841
  fs12.cpSync(src.dir, destDir, { recursive: true });
839
- fs12.writeFileSync(path35.join(destDir, "SKILL.md"), norm.content, "utf8");
842
+ fs12.writeFileSync(path36.join(destDir, "SKILL.md"), norm.content, "utf8");
840
843
  for (const note of norm.notes) logInfo(` \u2022 ${note}`);
841
844
  const fm = parseFrontmatter(norm.content).data;
842
845
  const descRaw = fm.description;
@@ -844,7 +847,7 @@ function makeAssetCommand() {
844
847
  for (const f of checkAgentSkillConformance(fm, { dirName: norm.name })) {
845
848
  logWarn(`conformance: ${f.field} \u2014 ${f.message}`);
846
849
  }
847
- const root = path35.relative(target.path, destDir);
850
+ const root = path36.relative(target.path, destDir);
848
851
  const up = upsertManifestAsset(target.path, {
849
852
  kind: "skill",
850
853
  name: norm.name,
@@ -905,10 +908,10 @@ function makeAssetCommand() {
905
908
  );
906
909
  process.exit(1);
907
910
  }
908
- const basename2 = path35.basename(srcPath);
909
- const destDir = target.structure === "domain" && opts.domain ? path35.join(target.path, opts.domain) : target.path;
911
+ const basename2 = path36.basename(srcPath);
912
+ const destDir = target.structure === "domain" && opts.domain ? path36.join(target.path, opts.domain) : target.path;
910
913
  fs12.mkdirSync(destDir, { recursive: true });
911
- const destPath = path35.join(destDir, basename2);
914
+ const destPath = path36.join(destDir, basename2);
912
915
  if (fs12.existsSync(destPath)) {
913
916
  logErr(`Destination already exists: ${destPath}`);
914
917
  process.exit(1);
@@ -921,7 +924,7 @@ function makeAssetCommand() {
921
924
  fs12.renameSync(srcPath, destPath);
922
925
  break;
923
926
  case "link":
924
- fs12.symlinkSync(path35.resolve(srcPath), destPath);
927
+ fs12.symlinkSync(path36.resolve(srcPath), destPath);
925
928
  break;
926
929
  }
927
930
  if (target.backend === "git" && opts.commit) {
@@ -978,17 +981,17 @@ function makeAssetCommand() {
978
981
  }
979
982
  const manifestPath = def.manifest.path;
980
983
  const candidateSubpath = typeof manifestPath === "string" && manifestPath.length > 0 ? manifestPath : def.name;
981
- const srcPath = path35.join(lib.path, candidateSubpath);
984
+ const srcPath = path36.join(lib.path, candidateSubpath);
982
985
  if (!fs12.existsSync(srcPath)) {
983
986
  logErr(`Asset path not found: ${srcPath}`);
984
987
  process.exit(1);
985
988
  }
986
- const destPath = path35.join(target, candidateSubpath);
987
- fs12.mkdirSync(path35.dirname(destPath), { recursive: true });
989
+ const destPath = path36.join(target, candidateSubpath);
990
+ fs12.mkdirSync(path36.dirname(destPath), { recursive: true });
988
991
  if (opts.mode === "copy") {
989
992
  fs12.cpSync(srcPath, destPath, { recursive: true });
990
993
  } else {
991
- fs12.symlinkSync(path35.resolve(srcPath), destPath);
994
+ fs12.symlinkSync(path36.resolve(srcPath), destPath);
992
995
  }
993
996
  logOk(`Installed ${ref} \u2192 ${destPath} (${opts.mode})`);
994
997
  } finally {
@@ -1053,14 +1056,14 @@ function makeAuthCommand() {
1053
1056
  }
1054
1057
  function collectCacheTargets(scope) {
1055
1058
  const out = [];
1056
- out.push(path35__default.join(scope.projectDir, ".skaile", "cache"));
1057
- out.push(path35__default.join(scope.projectDir, ".skaile", "store-cache"));
1058
- out.push(path35__default.join(scope.projectDir, ".skaile", "repos"));
1059
+ out.push(path36__default.join(scope.projectDir, ".skaile", "cache"));
1060
+ out.push(path36__default.join(scope.projectDir, ".skaile", "store-cache"));
1061
+ out.push(path36__default.join(scope.projectDir, ".skaile", "repos"));
1059
1062
  if (scope.global) {
1060
1063
  out.push(globalCacheRoot());
1061
- const home = process.env.SKAILE_HOME ?? path35__default.join(homedir(), ".skaile");
1062
- out.push(path35__default.join(home, "repos"));
1063
- out.push(path35__default.join(home, "catalog-cache"));
1064
+ const home = process.env.SKAILE_HOME ?? path36__default.join(homedir(), ".skaile");
1065
+ out.push(path36__default.join(home, "repos"));
1066
+ out.push(path36__default.join(home, "catalog-cache"));
1064
1067
  }
1065
1068
  return out;
1066
1069
  }
@@ -1074,7 +1077,7 @@ function dirSize(target) {
1074
1077
  function dirSizeOfDir(dir) {
1075
1078
  let total = 0;
1076
1079
  for (const ent of readdirSync(dir, { withFileTypes: true })) {
1077
- const child = path35__default.join(dir, ent.name);
1080
+ const child = path36__default.join(dir, ent.name);
1078
1081
  if (ent.isSymbolicLink()) continue;
1079
1082
  if (ent.isDirectory()) total += dirSizeOfDir(child);
1080
1083
  else if (ent.isFile()) total += statSync(child).size;
@@ -1100,7 +1103,7 @@ function makeCacheCommand() {
1100
1103
  const cmd = new Command("cache").description("Inspect and reclaim the re-derivable cache");
1101
1104
  cmd.command("clean").description("Remove the project cache (.skaile/cache); --global also clears ~/.skaile/cache").option("--global", "Also clear the global cache (sources + catalog) and legacy dirs").option("--dry-run", "Show what would be removed without doing it").option("-y, --yes", "Skip confirmation prompt").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
1102
1105
  const targets = collectCacheTargets({
1103
- projectDir: path35__default.resolve(opts.projectDir),
1106
+ projectDir: path36__default.resolve(opts.projectDir),
1104
1107
  global: opts.global
1105
1108
  }).filter((t) => existsSync(t));
1106
1109
  if (targets.length === 0) {
@@ -1130,12 +1133,12 @@ function makeCacheCommand() {
1130
1133
  for (const r of removed) logOk(`Removed ${r}`);
1131
1134
  });
1132
1135
  cmd.command("dir").description("Print the resolved cache roots").option("--global", "Include the global cache root").option("--project-dir <path>", "Project directory", process.cwd()).action((opts) => {
1133
- console.log(path35__default.join(path35__default.resolve(opts.projectDir), ".skaile", "cache"));
1136
+ console.log(path36__default.join(path36__default.resolve(opts.projectDir), ".skaile", "cache"));
1134
1137
  if (opts.global) console.log(globalCacheRoot());
1135
1138
  });
1136
1139
  cmd.command("size").description("Show cache disk usage per directory").option("--global", "Include the global cache").option("--project-dir <path>", "Project directory", process.cwd()).action((opts) => {
1137
1140
  const targets = collectCacheTargets({
1138
- projectDir: path35__default.resolve(opts.projectDir),
1141
+ projectDir: path36__default.resolve(opts.projectDir),
1139
1142
  global: opts.global
1140
1143
  });
1141
1144
  console.log();
@@ -1151,7 +1154,7 @@ function makeCatalogCommand() {
1151
1154
  const catalog = new Command("catalog").description("Catalog source health and configuration");
1152
1155
  catalog.command("test").description("Probe the configured catalog source and report status").option("--project-dir <path>", "Project directory (for project-level config overlay)").option("--url <url>", "Override the catalog URL for this probe").option("--force", "Probe the network even in air-gapped mode (cache_ttl: 0)").action(async (opts) => {
1153
1156
  const { resolveConfig, isLocalCatalogUrl, trpcGetUrl } = await import('../library/index.js');
1154
- const projectDir = opts.projectDir ? path35__default.resolve(opts.projectDir) : void 0;
1157
+ const projectDir = opts.projectDir ? path36__default.resolve(opts.projectDir) : void 0;
1155
1158
  const cfg = resolveConfig({ projectDir });
1156
1159
  const baseUrl = opts.url ?? cfg.catalog.url;
1157
1160
  if (isLocalCatalogUrl(baseUrl)) {
@@ -1169,7 +1172,7 @@ function makeCatalogCommand() {
1169
1172
  });
1170
1173
  catalog.command("info").description("Print the resolved catalog configuration (url, framing, cacheTtlMs)").option("--project-dir <path>", "Project directory (for project-level config overlay)").action(async (opts) => {
1171
1174
  const { resolveConfig } = await import('../library/index.js');
1172
- const projectDir = opts.projectDir ? path35__default.resolve(opts.projectDir) : void 0;
1175
+ const projectDir = opts.projectDir ? path36__default.resolve(opts.projectDir) : void 0;
1173
1176
  const cfg = resolveConfig({ projectDir });
1174
1177
  console.log(`url: ${cfg.catalog.url}`);
1175
1178
  console.log(`framing: ${cfg.catalog.framing}`);
@@ -1178,7 +1181,7 @@ function makeCatalogCommand() {
1178
1181
  return catalog;
1179
1182
  }
1180
1183
  async function runLocalCatalogTest(projectDir) {
1181
- const { resolveCatalogSource } = await import('../open-library-32XAI2LH.js');
1184
+ const { resolveCatalogSource } = await import('../open-library-7OIUAGAH.js');
1182
1185
  let resolved;
1183
1186
  try {
1184
1187
  resolved = await resolveCatalogSource({ projectDir });
@@ -1330,9 +1333,9 @@ function findSkills(domain) {
1330
1333
  }
1331
1334
  function walkSkills(dir, domain, out) {
1332
1335
  for (const entry of fs12__default.readdirSync(dir, { withFileTypes: true })) {
1333
- const full = path35__default.join(dir, entry.name);
1336
+ const full = path36__default.join(dir, entry.name);
1334
1337
  if (entry.isDirectory()) {
1335
- const skillMd = path35__default.join(full, "SKILL.md");
1338
+ const skillMd = path36__default.join(full, "SKILL.md");
1336
1339
  if (fs12__default.existsSync(skillMd)) {
1337
1340
  out.push({ name: entry.name, path: full, skillPath: skillMd, domain });
1338
1341
  } else {
@@ -1361,7 +1364,7 @@ function resolveFlowIds() {
1361
1364
  }
1362
1365
  }
1363
1366
  function resolveSessionIds(projectDir) {
1364
- const sessionsDir = path35__default.join(projectDir, ".skaile", "sessions");
1367
+ const sessionsDir = path36__default.join(projectDir, ".skaile", "sessions");
1365
1368
  if (!fs12__default.existsSync(sessionsDir)) return [];
1366
1369
  try {
1367
1370
  return fs12__default.readdirSync(sessionsDir).filter((f) => f.endsWith(".json")).map((f) => f.slice(0, -".json".length));
@@ -1417,20 +1420,19 @@ function resolveDynamic(words, cword) {
1417
1420
  if (cmd === "config" && ["get", "set"].includes(sub) && isLast(3)) return CONFIG_KEYS;
1418
1421
  return null;
1419
1422
  }
1420
- var PERSONAL_KEYS = /* @__PURE__ */ new Set(["driver", "model", "provider"]);
1423
+ var PERSONAL_KEYS = /* @__PURE__ */ new Set(["driver", "model"]);
1421
1424
  var API_KEY_PREFIX = "apiKey.";
1422
1425
  function collectWorkspaceDefaults(projectDir) {
1423
1426
  const wsDefaults = {};
1424
- try {
1425
- const ws = resolveSkWorkspaceConfig(projectDir);
1426
- const p7 = ws.agent_config?.default ?? {};
1427
- if (p7.driver) wsDefaults.driver = p7.driver;
1428
- if (p7.provider) wsDefaults.provider = p7.provider;
1429
- if (p7.model) wsDefaults.model = p7.model;
1430
- if (p7.skills_dir) wsDefaults.skills_dir = p7.skills_dir;
1431
- if (p7.agents_dir) wsDefaults.agents_dir = p7.agents_dir;
1432
- if (p7.prompts_dir) wsDefaults.prompts_dir = p7.prompts_dir;
1433
- } catch {
1427
+ const ws = resolveSkWorkspaceConfig(projectDir);
1428
+ const p7 = ws.agent_config?.default ?? {};
1429
+ if (p7.driver) wsDefaults.driver = p7.driver;
1430
+ if (p7.model) wsDefaults.model = p7.model;
1431
+ if (p7.skills_dir) wsDefaults.skills_dir = p7.skills_dir;
1432
+ if (p7.agents_dir) wsDefaults.agents_dir = p7.agents_dir;
1433
+ if (p7.prompts_dir) wsDefaults.prompts_dir = p7.prompts_dir;
1434
+ for (const [role, target] of Object.entries(ws.roles ?? {})) {
1435
+ wsDefaults[`@${role}`] = target;
1434
1436
  }
1435
1437
  return wsDefaults;
1436
1438
  }
@@ -1438,7 +1440,7 @@ function printEffectiveSection(config) {
1438
1440
  console.log();
1439
1441
  console.log(S.heading(" Effective Config"));
1440
1442
  console.log(` ${S.rule(40)}`);
1441
- for (const key of ["driver", "provider", "model"]) {
1443
+ for (const key of ["driver", "model"]) {
1442
1444
  const value = config[key];
1443
1445
  if (value !== void 0) {
1444
1446
  console.log(` ${S.label(`${key}:`.padEnd(16))} ${value}`);
@@ -1454,19 +1456,49 @@ function printWorkspaceDefaultsSection(wsDefaults) {
1454
1456
  console.log(` ${S.label(`${key}:`.padEnd(16))} ${value}`);
1455
1457
  }
1456
1458
  }
1457
- function printApiKeysSection(config) {
1458
- if (!config.apiKeys || Object.keys(config.apiKeys).length === 0) return;
1459
+ function printModelSelectionSection(config, projectDir) {
1460
+ const view = loadRegistryView({ projectDir });
1461
+ const legacy = deriveRegistryFromLegacyApiKeys(config.apiKeys);
1462
+ const registry = Object.keys(legacy.providers).length > 0 ? mergeRegistries([
1463
+ { layer: "catalog", providers: legacy.providers },
1464
+ { layer: "user", providers: view.merged.providers }
1465
+ ]) : view.merged;
1459
1466
  console.log();
1460
- console.log(` ${S.heading("API Keys")}`);
1467
+ console.log(` ${S.heading("Model selection")}`);
1461
1468
  console.log(` ${S.rule(40)}`);
1462
- for (const [provider, key] of Object.entries(config.apiKeys)) {
1463
- const fromEnv = !!process.env[`${provider.toUpperCase()}_API_KEY`];
1464
- if (key) {
1469
+ const selector = config.model;
1470
+ if (!selector) {
1471
+ console.log(` ${S.dim("no model: selector \u2014 the driver applies its own default")}`);
1472
+ } else {
1473
+ const resolved = parseModelRef(selector, registry, config.roles);
1474
+ if (!resolved) {
1475
+ console.log(` ${S.label("selector:".padEnd(16))} ${selector}`);
1465
1476
  console.log(
1466
- ` ${S.label(`${provider}:`.padEnd(16))} ****${key.slice(-4)}` + (fromEnv ? ` ${S.dim("[env]")}` : "")
1477
+ ` ${S.dim("no AI provider is configured \u2014 add one with")} ${S.cmd("skaile providers add <id> --preset <preset>")}`
1467
1478
  );
1479
+ } else {
1480
+ const entry = registry.providers[resolved.providerId];
1481
+ console.log(` ${S.label("selector:".padEnd(16))} ${selector}`);
1482
+ console.log(
1483
+ ` ${S.label("resolves to:".padEnd(16))} ${resolved.providerId}${resolved.providerModelId ? ` / ${resolved.providerModelId}` : ""}`
1484
+ );
1485
+ const endpoint = entry ? resolveEntryBaseUrl(entry) : void 0;
1486
+ if (endpoint) console.log(` ${S.label("endpoint:".padEnd(16))} ${endpoint}`);
1487
+ if (entry?.credential) {
1488
+ console.log(
1489
+ ` ${S.label("credential:".padEnd(16))} ${entry.credential.kind}${entry.credential.ref ? ` ${entry.credential.ref}` : ""}`
1490
+ );
1491
+ }
1492
+ for (const warning of resolved.warnings) logWarn(warning);
1468
1493
  }
1469
1494
  }
1495
+ const configured = view.merged.order;
1496
+ if (configured.length > 0) {
1497
+ console.log(
1498
+ ` ${S.label("providers:".padEnd(16))} ${configured.join(", ")} ${S.dim("(skaile providers list)")}`
1499
+ );
1500
+ }
1501
+ if (legacy.deprecation) logWarn(legacy.deprecation);
1470
1502
  }
1471
1503
  function printResolvedPathsSection(config) {
1472
1504
  const fw = config.driver ?? "omp";
@@ -1480,48 +1512,100 @@ function printResolvedPathsSection(config) {
1480
1512
  console.log(` ${S.label("prompts:".padEnd(16))} ${config.promptsDir ?? paths.promptsDir}`);
1481
1513
  }
1482
1514
  async function showConfig(opts) {
1483
- const projectDir = opts.projectDir ? path35__default.resolve(opts.projectDir) : process.cwd();
1484
- const config = await resolveSettings(projectDir);
1485
- const wsDefaults = collectWorkspaceDefaults(projectDir);
1515
+ const projectDir = opts.projectDir ? path36__default.resolve(opts.projectDir) : process.cwd();
1516
+ let config;
1517
+ let wsDefaults;
1518
+ try {
1519
+ config = await resolveSettings(projectDir);
1520
+ wsDefaults = collectWorkspaceDefaults(projectDir);
1521
+ } catch (error) {
1522
+ logErr(error instanceof Error ? error.message : String(error));
1523
+ process.exit(1);
1524
+ }
1486
1525
  printEffectiveSection(config);
1487
1526
  printWorkspaceDefaultsSection(wsDefaults);
1488
- printApiKeysSection(config);
1527
+ printModelSelectionSection(config, projectDir);
1489
1528
  printResolvedPathsSection(config);
1490
1529
  console.log();
1491
1530
  }
1531
+ function setApiKeySugar(provider, value, projectDir) {
1532
+ const envName = `${provider.toUpperCase().replace(/[^A-Z0-9]/g, "_")}_API_KEY`;
1533
+ try {
1534
+ const added = addProviderEntry({
1535
+ id: provider,
1536
+ presetId: provider,
1537
+ credentialRef: `env:${envName}`,
1538
+ projectDir,
1539
+ force: true
1540
+ });
1541
+ logOk(`Configured ${pc5.bold(added.id)} in the ${added.layer} registry`);
1542
+ console.log(S.dim(` \u2192 ${added.path}`));
1543
+ } catch (error) {
1544
+ if (!(error instanceof ProviderRegistryWriteError)) throw error;
1545
+ logErr(error.message);
1546
+ console.log(
1547
+ ` ${S.dim("Define the endpoint explicitly:")} ${S.cmd(`skaile providers add ${provider} --preset custom --credential env:${envName}`)}`
1548
+ );
1549
+ process.exit(1);
1550
+ }
1551
+ logInfo(
1552
+ `The key itself is never stored by skaile \u2014 export it: ${S.cmd(`export ${envName}=${value.slice(0, 2)}\u2026`)}`
1553
+ );
1554
+ console.log(` ${S.dim("Verify with:")} ${S.cmd(`skaile providers test ${provider}`)}`);
1555
+ }
1492
1556
  function makeConfigCommand() {
1493
1557
  const cmd = new Command("config").description("Manage personal config (.skaile/settings.json)");
1494
1558
  cmd.command("show").description("Show effective config with sources").option("--project-dir <path>", "Project directory").action((opts) => showConfig(opts));
1495
1559
  cmd.command("get <key>").description("Get an effective config value").option("--project-dir <path>", "Project directory").action(async (key, opts) => {
1496
- const projectDir = opts.projectDir ? path35__default.resolve(opts.projectDir) : process.cwd();
1560
+ const projectDir = opts.projectDir ? path36__default.resolve(opts.projectDir) : process.cwd();
1497
1561
  const config = await resolveSettings(projectDir);
1498
1562
  const value = config[key];
1499
1563
  console.log(value ?? S.dim("(not set)"));
1500
1564
  });
1501
- cmd.command("set <key> <value>").description("Set a personal config value (driver, model, provider, apiKey.<provider>)").option("--project-dir <path>", "Project directory").option("--global", "Write to ~/.skaile/settings.json instead of project-local").action(async (key, value, opts) => {
1502
- const projectDir = opts.projectDir ? path35__default.resolve(opts.projectDir) : process.cwd();
1565
+ cmd.command("set <key> <value>").description("Set a personal config value (driver, model, apiKey.<provider>)").option("--project-dir <path>", "Project directory").option("--global", "Write to ~/.skaile/settings.json instead of project-local").action(async (key, value, opts) => {
1566
+ const projectDir = opts.projectDir ? path36__default.resolve(opts.projectDir) : process.cwd();
1567
+ if (key === "provider" || key === "cloud" || key === "cloudConfig") {
1568
+ logErr(
1569
+ `'${key}' is no longer a setting \u2014 an endpoint is an AI provider registry entry and a session selects one with a model reference.
1570
+ Define it: skaile providers add <id> --preset <preset>
1571
+ Select it: skaile config set model <providerId>/<modelId>`
1572
+ );
1573
+ process.exit(1);
1574
+ }
1503
1575
  const isApiKey = key.startsWith(API_KEY_PREFIX);
1504
1576
  if (!PERSONAL_KEYS.has(key) && !isApiKey) {
1505
1577
  logErr(
1506
1578
  `'${key}' is not a personal setting.
1507
1579
  Personal keys: ${[...PERSONAL_KEYS].join(", ")}, ${API_KEY_PREFIX}<provider>
1508
- Project config (framework, paths, resources) belongs in skaile.yaml`
1580
+ Project config (driver, model, paths, resources) belongs in skaile.yaml`
1509
1581
  );
1510
1582
  process.exit(1);
1511
1583
  }
1512
- const filePath = opts.global ? globalSettingsPath() : projectSettingsPath(projectDir);
1513
- const existing = await loadSettings(filePath);
1514
1584
  if (isApiKey) {
1515
- const provider = key.slice(API_KEY_PREFIX.length);
1516
- existing.apiKeys = { ...existing.apiKeys, [provider]: value };
1517
- await saveSettings(existing, filePath);
1518
- logOk(`Set ${pc5.bold(`apiKeys.${provider}`)} = ****${value.slice(-4)}`);
1519
- } else {
1520
- existing[key] = value;
1521
- await saveSettings(existing, filePath);
1522
- logOk(`Set ${pc5.bold(key)} = ${value}`);
1585
+ setApiKeySugar(key.slice(API_KEY_PREFIX.length), value, projectDir);
1586
+ return;
1523
1587
  }
1588
+ const filePath = opts.global ? globalSettingsPath() : projectSettingsPath(projectDir);
1589
+ const existing = await loadSettings(filePath);
1590
+ await saveSettings({ ...existing, [key]: value }, filePath);
1591
+ logOk(`Set ${pc5.bold(key)} = ${value}`);
1524
1592
  console.log(S.dim(` \u2192 ${filePath}`));
1593
+ if (key === "model") {
1594
+ const view = loadRegistryView({ projectDir });
1595
+ const resolved = parseModelRef(value, view.merged);
1596
+ if (!resolved) {
1597
+ logWarn(
1598
+ "no AI provider is configured yet \u2014 add one with `skaile providers add <id> --preset <preset>`"
1599
+ );
1600
+ } else {
1601
+ console.log(
1602
+ S.dim(
1603
+ ` \u2192 resolves to ${resolved.providerId}${resolved.providerModelId ? `/${resolved.providerModelId}` : ""}`
1604
+ )
1605
+ );
1606
+ for (const warning of resolved.warnings) logWarn(warning);
1607
+ }
1608
+ }
1525
1609
  });
1526
1610
  cmd.action(() => showConfig({}));
1527
1611
  return cmd;
@@ -1817,8 +1901,8 @@ function makeConnectorCommand() {
1817
1901
  async (driver, opts) => {
1818
1902
  const { installNpmPackages } = await import('../connectors/index.js');
1819
1903
  const { scanDirectory: scanDirectory2, factoryAssetRoots: factoryAssetRoots2, WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
1820
- const projectDir = path35__default.resolve(opts.projectDir);
1821
- const yamlPath = path35__default.join(projectDir, "skaile.yaml");
1904
+ const projectDir = path36__default.resolve(opts.projectDir);
1905
+ const yamlPath = path36__default.join(projectDir, "skaile.yaml");
1822
1906
  if (!existsSync(yamlPath)) {
1823
1907
  logErr("No skaile.yaml found in current directory. Run 'skaile init' first.");
1824
1908
  process.exit(1);
@@ -1878,8 +1962,8 @@ ${installResult.output}`);
1878
1962
  );
1879
1963
  cmd.command("remove <id>").option("--project-dir <path>", "Workspace directory", process.cwd()).description("Remove a connector from skaile.yaml by its instance ID").action(async (id, opts) => {
1880
1964
  const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
1881
- const projectDir = path35__default.resolve(opts.projectDir);
1882
- const yamlPath = path35__default.join(projectDir, "skaile.yaml");
1965
+ const projectDir = path36__default.resolve(opts.projectDir);
1966
+ const yamlPath = path36__default.join(projectDir, "skaile.yaml");
1883
1967
  if (!existsSync(yamlPath)) {
1884
1968
  logErr("No skaile.yaml found in current directory.");
1885
1969
  process.exit(1);
@@ -1896,7 +1980,7 @@ ${installResult.output}`);
1896
1980
  cmd.command("status [id]").option("--project-dir <path>", "Workspace directory", process.cwd()).description("Connect and report health status for one or all connectors").action(async (id, opts) => {
1897
1981
  const res = await import('../connectors/index.js');
1898
1982
  res.registerBuiltinConnectors();
1899
- const projectDir = path35__default.resolve(opts.projectDir);
1983
+ const projectDir = path36__default.resolve(opts.projectDir);
1900
1984
  const declarations = res.loadConnectorDeclarations(projectDir);
1901
1985
  if (declarations.length === 0) {
1902
1986
  console.log("No connectors configured in skaile.yaml.");
@@ -1920,7 +2004,7 @@ ${installResult.output}`);
1920
2004
  await manager.disconnectAll();
1921
2005
  });
1922
2006
  cmd.command("list").description("List all configured connectors").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (opts) => {
1923
- const projectDir = path35__default.resolve(opts.projectDir);
2007
+ const projectDir = path36__default.resolve(opts.projectDir);
1924
2008
  const manager = await connectConnectors(projectDir);
1925
2009
  try {
1926
2010
  console.log(JSON.stringify(manager.listConnectors(), null, 2));
@@ -1929,7 +2013,7 @@ ${installResult.output}`);
1929
2013
  }
1930
2014
  });
1931
2015
  cmd.command("sync [id]").description("Re-sync a filesystem-face connector or all of them (git pull, S3 refresh, etc.)").option("--all", "Sync all connectors").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (id, opts) => {
1932
- const projectDir = path35__default.resolve(opts.projectDir);
2016
+ const projectDir = path36__default.resolve(opts.projectDir);
1933
2017
  const manager = await connectConnectors(projectDir);
1934
2018
  try {
1935
2019
  if (opts.all) {
@@ -1953,7 +2037,7 @@ ${installResult.output}`);
1953
2037
  }
1954
2038
  });
1955
2039
  cmd.command("ops <id>").description("List available operations for a connector").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (id, opts) => {
1956
- const projectDir = path35__default.resolve(opts.projectDir);
2040
+ const projectDir = path36__default.resolve(opts.projectDir);
1957
2041
  const manager = await connectConnectors(projectDir);
1958
2042
  try {
1959
2043
  if (!manager.has(id)) {
@@ -1968,7 +2052,7 @@ ${installResult.output}`);
1968
2052
  }
1969
2053
  });
1970
2054
  cmd.command("read <id> <resource-path>").description("Read content from a connector").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (id, resourcePath, opts) => {
1971
- const projectDir = path35__default.resolve(opts.projectDir);
2055
+ const projectDir = path36__default.resolve(opts.projectDir);
1972
2056
  const manager = await connectConnectors(projectDir);
1973
2057
  try {
1974
2058
  const content = await manager.read(id, resourcePath);
@@ -1978,7 +2062,7 @@ ${installResult.output}`);
1978
2062
  }
1979
2063
  });
1980
2064
  cmd.command("write <id> <resource-path> <content>").description("Write content to a connector at a path").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (id, resourcePath, content, opts) => {
1981
- const projectDir = path35__default.resolve(opts.projectDir);
2065
+ const projectDir = path36__default.resolve(opts.projectDir);
1982
2066
  const manager = await connectConnectors(projectDir);
1983
2067
  try {
1984
2068
  await manager.write(id, resourcePath, { data: content });
@@ -1988,7 +2072,7 @@ ${installResult.output}`);
1988
2072
  }
1989
2073
  });
1990
2074
  cmd.command("entries <id> [resource-path]").description("List entries in a connector (files, keys, rows, etc)").option("--project-dir <path>", "Workspace directory", process.cwd()).option("--recursive", "Include nested entries").option("--limit <n>", "Maximum entries to return", parsePositiveIntOption).action(async (id, resourcePath, opts) => {
1991
- const projectDir = path35__default.resolve(opts.projectDir);
2075
+ const projectDir = path36__default.resolve(opts.projectDir);
1992
2076
  const manager = await connectConnectors(projectDir);
1993
2077
  try {
1994
2078
  const entries = await manager.list(id, resourcePath, {
@@ -2001,7 +2085,7 @@ ${installResult.output}`);
2001
2085
  }
2002
2086
  });
2003
2087
  cmd.command("search <id> <query>").description("Search within a connector for matching content").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (id, query, opts) => {
2004
- const projectDir = path35__default.resolve(opts.projectDir);
2088
+ const projectDir = path36__default.resolve(opts.projectDir);
2005
2089
  const manager = await connectConnectors(projectDir);
2006
2090
  try {
2007
2091
  const results = await manager.search(id, query);
@@ -2011,7 +2095,7 @@ ${installResult.output}`);
2011
2095
  }
2012
2096
  });
2013
2097
  cmd.command("delete <id> <resource-path>").description("Delete an entry from a connector").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (id, resourcePath, opts) => {
2014
- const projectDir = path35__default.resolve(opts.projectDir);
2098
+ const projectDir = path36__default.resolve(opts.projectDir);
2015
2099
  const manager = await connectConnectors(projectDir);
2016
2100
  try {
2017
2101
  const ok = await manager.delete(id, resourcePath);
@@ -2021,7 +2105,7 @@ ${installResult.output}`);
2021
2105
  }
2022
2106
  });
2023
2107
  cmd.command("run <id> <op> [args...]").description("Run a custom adapter operation (e.g. git log, sqlite query)").option("--project-dir <path>", "Workspace directory", process.cwd()).allowUnknownOption().action(async (id, op, args, opts) => {
2024
- const projectDir = path35__default.resolve(opts.projectDir);
2108
+ const projectDir = path36__default.resolve(opts.projectDir);
2025
2109
  const manager = await connectConnectors(projectDir);
2026
2110
  try {
2027
2111
  if (!manager.has(id)) {
@@ -2130,7 +2214,7 @@ function envRecord() {
2130
2214
  async function buildDeployContext(projectDir) {
2131
2215
  const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
2132
2216
  const config = resolveSkWorkspaceConfig2(projectDir);
2133
- const workspaceId = config.name ?? path35__default.basename(projectDir);
2217
+ const workspaceId = config.name ?? path36__default.basename(projectDir);
2134
2218
  let log;
2135
2219
  try {
2136
2220
  const { createLogger } = await import('../core/logging.js');
@@ -2162,13 +2246,13 @@ async function ensureTargetsRegistered(projectDir) {
2162
2246
  const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
2163
2247
  const config = resolveSkWorkspaceConfig2(projectDir);
2164
2248
  if (config.plugins && config.plugins.length > 0) {
2165
- const { ensurePluginsLoaded } = await import('../plugin-store-QJNBPIQK.js');
2249
+ const { ensurePluginsLoaded } = await import('../plugin-store-V5BMOYGS.js');
2166
2250
  const result = await ensurePluginsLoaded(projectDir, config.plugins, pluginRegistry);
2167
2251
  for (const f of result.failed) logWarn(f.error);
2168
2252
  }
2169
2253
  }
2170
2254
  async function runUp(opts) {
2171
- const projectDir = path35__default.resolve(opts.projectDir);
2255
+ const projectDir = path36__default.resolve(opts.projectDir);
2172
2256
  await ensureTargetsRegistered(projectDir);
2173
2257
  const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
2174
2258
  const { resolveDeployTarget, pluginRegistry } = await import('../plugin-registry/index.js');
@@ -2236,7 +2320,7 @@ async function restoreFromHandle(projectDir) {
2236
2320
  return { target, handle, ctx };
2237
2321
  }
2238
2322
  async function runDown(opts) {
2239
- const projectDir = path35__default.resolve(opts.projectDir);
2323
+ const projectDir = path36__default.resolve(opts.projectDir);
2240
2324
  const restored = await restoreFromHandle(projectDir);
2241
2325
  if (!restored) return;
2242
2326
  await restored.handle.stop();
@@ -2245,7 +2329,7 @@ async function runDown(opts) {
2245
2329
  logOk(`Stopped ${S.cmd(restored.target.id)} and cleared the handle.`);
2246
2330
  }
2247
2331
  async function runStatus(opts) {
2248
- const projectDir = path35__default.resolve(opts.projectDir);
2332
+ const projectDir = path36__default.resolve(opts.projectDir);
2249
2333
  const restored = await restoreFromHandle(projectDir);
2250
2334
  if (!restored) return;
2251
2335
  const health = await restored.handle.health();
@@ -2259,7 +2343,7 @@ async function runStatus(opts) {
2259
2343
  console.log();
2260
2344
  }
2261
2345
  async function runLogs(opts) {
2262
- const projectDir = path35__default.resolve(opts.projectDir);
2346
+ const projectDir = path36__default.resolve(opts.projectDir);
2263
2347
  const restored = await restoreFromHandle(projectDir);
2264
2348
  if (!restored) return;
2265
2349
  if (!restored.handle.logs) {
@@ -2283,7 +2367,7 @@ function makeDeployCommand() {
2283
2367
  }
2284
2368
  function makeDiffCommand() {
2285
2369
  return new Command("diff").description("Show changes between deployed and source versions").argument("<ref>", "Asset reference (kind:name)").option("--project-dir <path>", "Project directory", process.cwd()).action(async (ref, opts) => {
2286
- const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
2370
+ const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
2287
2371
  const result = await am2.diff(ref);
2288
2372
  if (result === null) {
2289
2373
  logInfo("No differences (or asset not found).");
@@ -2295,7 +2379,7 @@ function makeDiffCommand() {
2295
2379
  function makeFlowCommand() {
2296
2380
  const cmd = new Command("flow").description("Manage flows");
2297
2381
  cmd.command("list").description("List available flows").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
2298
- const flows = discoverFlows(path35__default.resolve(opts.projectDir));
2382
+ const flows = discoverFlows(path36__default.resolve(opts.projectDir));
2299
2383
  if (flows.length === 0) {
2300
2384
  logInfo("No flows found.");
2301
2385
  return;
@@ -2310,7 +2394,7 @@ function makeFlowCommand() {
2310
2394
  console.log();
2311
2395
  });
2312
2396
  cmd.command("show <id>").description("Show flow details and node graph").option("--project-dir <path>", "Project directory", process.cwd()).action(async (id, opts) => {
2313
- const flows = discoverFlows(path35__default.resolve(opts.projectDir));
2397
+ const flows = discoverFlows(path36__default.resolve(opts.projectDir));
2314
2398
  const flow = flows.find((f) => f.id === id);
2315
2399
  if (!flow) {
2316
2400
  logErr(`Flow not found: ${id}`);
@@ -2342,7 +2426,7 @@ function makeFlowCommand() {
2342
2426
  function makeHistoryCommand() {
2343
2427
  const cmd = new Command("history").description("Show recent add/remove/update actions");
2344
2428
  cmd.argument("[limit]", "Number of entries to show", "20").option("--project-dir <path>", "Project directory", process.cwd()).action((limitStr, opts) => {
2345
- const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
2429
+ const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
2346
2430
  const limit = parseInt(limitStr, 10) || 20;
2347
2431
  const entries = am2.history(limit);
2348
2432
  if (entries.length === 0) {
@@ -2362,7 +2446,7 @@ function makeHistoryCommand() {
2362
2446
  console.log();
2363
2447
  });
2364
2448
  cmd.command("clear").description("Clear action history").option("--project-dir <path>", "Project directory", process.cwd()).action((opts) => {
2365
- const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
2449
+ const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
2366
2450
  am2.clearHistory();
2367
2451
  logOk("History cleared.");
2368
2452
  });
@@ -2375,7 +2459,7 @@ var MCP_SERVER_ENTRY = {
2375
2459
  env: {}
2376
2460
  };
2377
2461
  function pluginDir(projectDir) {
2378
- return path35__default.join(projectDir, ".claude", "plugins", "skaile");
2462
+ return path36__default.join(projectDir, ".claude", "plugins", "skaile");
2379
2463
  }
2380
2464
  async function readJsonStrict(p7) {
2381
2465
  let raw;
@@ -2393,7 +2477,7 @@ async function readJsonStrict(p7) {
2393
2477
  }
2394
2478
  }
2395
2479
  async function writeJson(p7, value) {
2396
- await fs5.mkdir(path35__default.dirname(p7), { recursive: true });
2480
+ await fs5.mkdir(path36__default.dirname(p7), { recursive: true });
2397
2481
  await fs5.writeFile(p7, `${JSON.stringify(value, null, 2)}
2398
2482
  `);
2399
2483
  }
@@ -2401,8 +2485,8 @@ async function copyDir(src, dest) {
2401
2485
  await fs5.mkdir(dest, { recursive: true });
2402
2486
  const entries = await fs5.readdir(src, { withFileTypes: true });
2403
2487
  for (const entry of entries) {
2404
- const srcPath = path35__default.join(src, entry.name);
2405
- const destPath = path35__default.join(dest, entry.name);
2488
+ const srcPath = path36__default.join(src, entry.name);
2489
+ const destPath = path36__default.join(dest, entry.name);
2406
2490
  if (entry.isDirectory()) await copyDir(srcPath, destPath);
2407
2491
  else await fs5.copyFile(srcPath, destPath);
2408
2492
  }
@@ -2411,14 +2495,14 @@ async function install(projectDir, opts) {
2411
2495
  return opts?.full ? installFullPlugin(projectDir) : installMcp(projectDir);
2412
2496
  }
2413
2497
  async function installMcp(projectDir) {
2414
- const mcpPath = path35__default.join(projectDir, ".claude", "mcp.json");
2498
+ const mcpPath = path36__default.join(projectDir, ".claude", "mcp.json");
2415
2499
  const existing = await readJsonStrict(mcpPath) ?? {};
2416
2500
  const mcpServers = { ...existing.mcpServers ?? {} };
2417
2501
  const previous = mcpServers[SKAILE_MCP_NAME];
2418
2502
  const matches = previous && JSON.stringify(previous) === JSON.stringify(MCP_SERVER_ENTRY);
2419
2503
  let warning;
2420
2504
  if (previous && !matches) {
2421
- warning = `overwrote existing ${SKAILE_MCP_NAME} entry in ${path35__default.relative(projectDir, mcpPath)}`;
2505
+ warning = `overwrote existing ${SKAILE_MCP_NAME} entry in ${path36__default.relative(projectDir, mcpPath)}`;
2422
2506
  }
2423
2507
  mcpServers[SKAILE_MCP_NAME] = MCP_SERVER_ENTRY;
2424
2508
  await writeJson(mcpPath, { ...existing, mcpServers });
@@ -2427,15 +2511,15 @@ async function installMcp(projectDir) {
2427
2511
  async function installFullPlugin(projectDir) {
2428
2512
  const dir = pluginDir(projectDir);
2429
2513
  for (const [rel, content] of Object.entries(buildClaudePluginFiles())) {
2430
- const dest = path35__default.join(dir, rel);
2431
- await fs5.mkdir(path35__default.dirname(dest), { recursive: true });
2514
+ const dest = path36__default.join(dir, rel);
2515
+ await fs5.mkdir(path36__default.dirname(dest), { recursive: true });
2432
2516
  await fs5.writeFile(dest, content);
2433
2517
  }
2434
- const projectSkillsDir = path35__default.join(projectDir, ".skaile", "skills");
2518
+ const projectSkillsDir = path36__default.join(projectDir, ".skaile", "skills");
2435
2519
  if (existsSync(projectSkillsDir)) {
2436
- await copyDir(projectSkillsDir, path35__default.join(dir, "skills"));
2520
+ await copyDir(projectSkillsDir, path36__default.join(dir, "skills"));
2437
2521
  }
2438
- const settingsPath = path35__default.join(projectDir, ".claude", "settings.json");
2522
+ const settingsPath = path36__default.join(projectDir, ".claude", "settings.json");
2439
2523
  const settings = await readJsonStrict(settingsPath) ?? {};
2440
2524
  const plugins = settings.plugins ?? [];
2441
2525
  if (!plugins.includes(dir)) plugins.push(dir);
@@ -2443,8 +2527,8 @@ async function installFullPlugin(projectDir) {
2443
2527
  return { changed: true, method: "plugin" };
2444
2528
  }
2445
2529
  async function uninstall(projectDir) {
2446
- const settingsPath = path35__default.join(projectDir, ".claude", "settings.json");
2447
- const mcpPath = path35__default.join(projectDir, ".claude", "mcp.json");
2530
+ const settingsPath = path36__default.join(projectDir, ".claude", "settings.json");
2531
+ const mcpPath = path36__default.join(projectDir, ".claude", "mcp.json");
2448
2532
  const dir = pluginDir(projectDir);
2449
2533
  let changed = false;
2450
2534
  const settings = await readJsonStrict(settingsPath);
@@ -2478,12 +2562,12 @@ async function uninstall(projectDir) {
2478
2562
  async function detectInstall(projectDir) {
2479
2563
  const dir = pluginDir(projectDir);
2480
2564
  const settings = await readJsonStrict(
2481
- path35__default.join(projectDir, ".claude", "settings.json")
2565
+ path36__default.join(projectDir, ".claude", "settings.json")
2482
2566
  );
2483
- if (existsSync(path35__default.join(dir, ".claude-plugin", "plugin.json")) && settings?.plugins?.includes(dir)) {
2567
+ if (existsSync(path36__default.join(dir, ".claude-plugin", "plugin.json")) && settings?.plugins?.includes(dir)) {
2484
2568
  return { method: "plugin", pluginPath: dir };
2485
2569
  }
2486
- const mcp = await readJsonStrict(path35__default.join(projectDir, ".claude", "mcp.json"));
2570
+ const mcp = await readJsonStrict(path36__default.join(projectDir, ".claude", "mcp.json"));
2487
2571
  if (mcp?.mcpServers && SKAILE_MCP_NAME in mcp.mcpServers) {
2488
2572
  return { method: "mcp" };
2489
2573
  }
@@ -2492,7 +2576,7 @@ async function detectInstall(projectDir) {
2492
2576
  async function enable(projectDir) {
2493
2577
  const detected = await detectInstall(projectDir);
2494
2578
  if (!detected) throw new Error("plugin not installed for claude-code");
2495
- const settingsPath = path35__default.join(projectDir, ".claude", "settings.json");
2579
+ const settingsPath = path36__default.join(projectDir, ".claude", "settings.json");
2496
2580
  const settings = await readJsonStrict(settingsPath) ?? {};
2497
2581
  if (detected.method === "plugin") {
2498
2582
  const disabled2 = settings.disabledPlugins ?? [];
@@ -2514,7 +2598,7 @@ async function enable(projectDir) {
2514
2598
  async function disable(projectDir) {
2515
2599
  const detected = await detectInstall(projectDir);
2516
2600
  if (!detected) throw new Error("plugin not installed for claude-code");
2517
- const settingsPath = path35__default.join(projectDir, ".claude", "settings.json");
2601
+ const settingsPath = path36__default.join(projectDir, ".claude", "settings.json");
2518
2602
  const settings = await readJsonStrict(settingsPath) ?? {};
2519
2603
  if (detected.method === "plugin") {
2520
2604
  const list2 = settings.disabledPlugins ?? [];
@@ -2534,12 +2618,12 @@ async function disable(projectDir) {
2534
2618
  return { changed: true };
2535
2619
  }
2536
2620
  async function status(projectDir) {
2537
- const settingsPath = path35__default.join(projectDir, ".claude", "settings.json");
2538
- const mcpPath = path35__default.join(projectDir, ".claude", "mcp.json");
2621
+ const settingsPath = path36__default.join(projectDir, ".claude", "settings.json");
2622
+ const mcpPath = path36__default.join(projectDir, ".claude", "mcp.json");
2539
2623
  const dir = pluginDir(projectDir);
2540
2624
  const settings = await readJsonStrict(settingsPath);
2541
2625
  const mcp = await readJsonStrict(mcpPath);
2542
- const pluginInstalled = !!(existsSync(path35__default.join(dir, ".claude-plugin", "plugin.json")) && settings?.plugins?.includes(dir));
2626
+ const pluginInstalled = !!(existsSync(path36__default.join(dir, ".claude-plugin", "plugin.json")) && settings?.plugins?.includes(dir));
2543
2627
  const mcpInstalled = !!(mcp?.mcpServers && SKAILE_MCP_NAME in mcp.mcpServers);
2544
2628
  if (!pluginInstalled && !mcpInstalled) {
2545
2629
  return {
@@ -2557,7 +2641,7 @@ async function status(projectDir) {
2557
2641
  installed: "yes",
2558
2642
  enabled: disabled2 ? "no" : "yes",
2559
2643
  method: "plugin",
2560
- location: path35__default.relative(projectDir, dir)
2644
+ location: path36__default.relative(projectDir, dir)
2561
2645
  };
2562
2646
  }
2563
2647
  const disabled = settings?.disabledMcpjsonServers?.includes(SKAILE_MCP_NAME) ?? false;
@@ -2566,7 +2650,7 @@ async function status(projectDir) {
2566
2650
  installed: "yes",
2567
2651
  enabled: disabled ? "no" : "yes",
2568
2652
  method: "mcp",
2569
- location: path35__default.relative(projectDir, mcpPath)
2653
+ location: path36__default.relative(projectDir, mcpPath)
2570
2654
  };
2571
2655
  }
2572
2656
  var SKAILE_MCP_NAME2 = "skaile-workspace";
@@ -2593,7 +2677,7 @@ async function readConfig(p7) {
2593
2677
  }
2594
2678
  }
2595
2679
  async function writeConfig(p7, value) {
2596
- await fs5.mkdir(path35__default.dirname(p7), { recursive: true });
2680
+ await fs5.mkdir(path36__default.dirname(p7), { recursive: true });
2597
2681
  const cleaned = {};
2598
2682
  for (const [k, v] of Object.entries(value)) {
2599
2683
  if (v === void 0) continue;
@@ -2602,7 +2686,7 @@ async function writeConfig(p7, value) {
2602
2686
  await fs5.writeFile(p7, stringify$1(cleaned));
2603
2687
  }
2604
2688
  function configPath(projectDir) {
2605
- return path35__default.join(projectDir, ".codex", "config.toml");
2689
+ return path36__default.join(projectDir, ".codex", "config.toml");
2606
2690
  }
2607
2691
  async function install2(projectDir) {
2608
2692
  const p7 = configPath(projectDir);
@@ -2613,7 +2697,7 @@ async function install2(projectDir) {
2613
2697
  const matches = previous && JSON.stringify(previous) === JSON.stringify(next);
2614
2698
  let warning;
2615
2699
  if (previous && !matches) {
2616
- warning = `overwrote existing ${SKAILE_MCP_NAME2} entry in ${path35__default.relative(projectDir, p7)}`;
2700
+ warning = `overwrote existing ${SKAILE_MCP_NAME2} entry in ${path36__default.relative(projectDir, p7)}`;
2617
2701
  }
2618
2702
  if (matches) return { changed: false, method: "toml" };
2619
2703
  servers[SKAILE_MCP_NAME2] = next;
@@ -2654,12 +2738,12 @@ async function status2(projectDir) {
2654
2738
  installed: "yes",
2655
2739
  enabled: "n/a",
2656
2740
  method: "mcp",
2657
- location: path35__default.relative(projectDir, p7)
2741
+ location: path36__default.relative(projectDir, p7)
2658
2742
  };
2659
2743
  }
2660
2744
  async function install3(projectDir) {
2661
- const extDir = path35__default.join(projectDir, ".omp", "extensions");
2662
- const extPath = path35__default.join(extDir, "skaile.ts");
2745
+ const extDir = path36__default.join(projectDir, ".omp", "extensions");
2746
+ const extPath = path36__default.join(extDir, "skaile.ts");
2663
2747
  await fs5.mkdir(extDir, { recursive: true });
2664
2748
  const { WorkspacePlugin } = await import('../workspace-plugin/index.js');
2665
2749
  const plugin = new WorkspacePlugin({ projectDir });
@@ -2674,7 +2758,7 @@ async function install3(projectDir) {
2674
2758
  return { changed: true, method: "generated" };
2675
2759
  }
2676
2760
  async function uninstall3(projectDir) {
2677
- const extPath = path35__default.join(projectDir, ".omp", "extensions", "skaile.ts");
2761
+ const extPath = path36__default.join(projectDir, ".omp", "extensions", "skaile.ts");
2678
2762
  try {
2679
2763
  await fs5.unlink(extPath);
2680
2764
  return { changed: true };
@@ -2683,14 +2767,14 @@ async function uninstall3(projectDir) {
2683
2767
  }
2684
2768
  }
2685
2769
  async function status3(projectDir) {
2686
- const extPath = path35__default.join(projectDir, ".omp", "extensions", "skaile.ts");
2770
+ const extPath = path36__default.join(projectDir, ".omp", "extensions", "skaile.ts");
2687
2771
  if (existsSync(extPath)) {
2688
2772
  return {
2689
2773
  backend: "omp",
2690
2774
  installed: "yes",
2691
2775
  enabled: "n/a",
2692
2776
  method: "extension",
2693
- location: path35__default.relative(projectDir, extPath)
2777
+ location: path36__default.relative(projectDir, extPath)
2694
2778
  };
2695
2779
  }
2696
2780
  return {
@@ -2753,7 +2837,7 @@ async function installCodex(projectDir) {
2753
2837
  console.log(` ${S.dim("\u2192")} Restart Codex CLI to pick up the change.`);
2754
2838
  }
2755
2839
  async function runInstall(opts) {
2756
- const projectDir = path35__default.resolve(opts.projectDir);
2840
+ const projectDir = path36__default.resolve(opts.projectDir);
2757
2841
  const targets = resolveDriver(opts.driver);
2758
2842
  let exitCode = 0;
2759
2843
  if (targets.includes("claude-code")) {
@@ -2787,7 +2871,7 @@ async function uninstallCodex(projectDir) {
2787
2871
  else logInfo(`codex: not installed`);
2788
2872
  }
2789
2873
  async function runUninstall(opts) {
2790
- const projectDir = path35__default.resolve(opts.projectDir);
2874
+ const projectDir = path36__default.resolve(opts.projectDir);
2791
2875
  const targets = resolveDriver(opts.driver);
2792
2876
  let exitCode = 0;
2793
2877
  if (targets.includes("claude-code")) {
@@ -2830,7 +2914,7 @@ async function toggleTarget(t, projectDir, action3) {
2830
2914
  });
2831
2915
  }
2832
2916
  async function runToggle(opts, action3) {
2833
- const projectDir = path35__default.resolve(opts.projectDir);
2917
+ const projectDir = path36__default.resolve(opts.projectDir);
2834
2918
  const requestedAll = opts.driver === "all";
2835
2919
  const targets = resolveDriver(opts.driver);
2836
2920
  const usageError = checkToggleSupported(targets, requestedAll, action3);
@@ -2842,7 +2926,7 @@ async function runToggle(opts, action3) {
2842
2926
  return exitCode;
2843
2927
  }
2844
2928
  async function runStatus2(opts) {
2845
- const projectDir = path35__default.resolve(opts.projectDir);
2929
+ const projectDir = path36__default.resolve(opts.projectDir);
2846
2930
  const targets = resolveDriver(opts.driver);
2847
2931
  const rows = [];
2848
2932
  let exitCode = 0;
@@ -2913,7 +2997,7 @@ async function runHook(event) {
2913
2997
  await plugin.shutdown();
2914
2998
  return;
2915
2999
  }
2916
- const store = new PluginStore(path35__default.join(projectDir, ".skaile", "plugin-state.json"));
3000
+ const store = new PluginStore(path36__default.join(projectDir, ".skaile", "plugin-state.json"));
2917
3001
  await store.load();
2918
3002
  const status4 = store.get("connector:status");
2919
3003
  if (status4 && typeof status4 === "object" && Object.keys(status4).length > 0) {
@@ -2989,7 +3073,7 @@ async function indexLibrary(lib, index) {
2989
3073
  }
2990
3074
  }
2991
3075
  function domainPublisher(libraryPath, domain) {
2992
- const domainFile = path35.join(libraryPath, domain, "DOMAIN.md");
3076
+ const domainFile = path36.join(libraryPath, domain, "DOMAIN.md");
2993
3077
  if (!fs12.existsSync(domainFile)) return void 0;
2994
3078
  try {
2995
3079
  const { data } = parseFrontmatter(fs12.readFileSync(domainFile, "utf8"));
@@ -3072,7 +3156,7 @@ function makeLibraryCommand() {
3072
3156
  cmd.command("init <name>").description("Create a new local library at ~/.skaile/libraries/<name>").option("--git <url>", "Initialize as a git library tracking <url>").option("--owner", "Mark as owner (default for local)").option("--contributor", "Mark as contributor").option("--reader", "Mark as reader").action(
3073
3157
  async (name, opts) => {
3074
3158
  const libDir = resolveLibraryDir();
3075
- const libPath = path35.join(libDir, name);
3159
+ const libPath = path36.join(libDir, name);
3076
3160
  const ownership = opts.contributor ? "contributor" : opts.reader ? "reader" : "owner";
3077
3161
  const { manager, close } = await openLibraryManager();
3078
3162
  try {
@@ -3144,21 +3228,21 @@ function makeLibraryCommand() {
3144
3228
  }
3145
3229
  const effectiveKind = opts.kind ?? kind;
3146
3230
  const am2 = new AssetManager({ projectDir: process.cwd() });
3147
- const destDir = opts.dir ? path35.join(target.path, opts.dir) : target.path;
3231
+ const destDir = opts.dir ? path36.join(target.path, opts.dir) : target.path;
3148
3232
  const res = am2.create(name, effectiveKind, destDir);
3149
3233
  if (!res.ok) {
3150
3234
  logErr(res.path);
3151
3235
  process.exit(1);
3152
3236
  }
3153
3237
  logOk(`Created ${effectiveKind}: ${pc5.dim(res.path)}`);
3154
- const domain2 = opts.dir ? opts.dir.split(path35.sep)[0] : void 0;
3238
+ const domain2 = opts.dir ? opts.dir.split(path36.sep)[0] : void 0;
3155
3239
  const publisher = resolveLibraryPublisher(target, opts, domain2, getStoreIdentity());
3156
3240
  stampAssetPublisher(res.path, publisher);
3157
3241
  ensureManifestPublisher(target.path, publisher);
3158
3242
  upsertManifestAsset(target.path, {
3159
3243
  kind: effectiveKind,
3160
3244
  name,
3161
- root: path35.relative(target.path, res.path) || name,
3245
+ root: path36.relative(target.path, res.path) || name,
3162
3246
  version: "0.1.0"
3163
3247
  });
3164
3248
  const idx = await indexLibrary(target, library);
@@ -3233,7 +3317,7 @@ function makeLibraryCommand() {
3233
3317
  const { manager, close } = await openLibraryManager();
3234
3318
  try {
3235
3319
  const target = await resolveTargetLibrary(manager, opts.library);
3236
- const domainFile = path35.join(target.path, name, "DOMAIN.md");
3320
+ const domainFile = path36.join(target.path, name, "DOMAIN.md");
3237
3321
  if (!existsSync(domainFile)) {
3238
3322
  logErr(`Domain "${name}" not found in "${target.name}" (no ${domainFile}).`);
3239
3323
  process.exit(1);
@@ -3256,8 +3340,8 @@ function makeLibraryCommand() {
3256
3340
  const { manager, close } = await openLibraryManager();
3257
3341
  try {
3258
3342
  const lib = await manager.requireLibrary(oldName);
3259
- const parent = path35.dirname(lib.path);
3260
- const newPath = path35.join(parent, newName);
3343
+ const parent = path36.dirname(lib.path);
3344
+ const newPath = path36.join(parent, newName);
3261
3345
  if (fs12.existsSync(newPath)) {
3262
3346
  logErr(`Target directory already exists: ${newPath}`);
3263
3347
  process.exit(1);
@@ -3417,16 +3501,16 @@ function makeLibraryCommand() {
3417
3501
  });
3418
3502
  cmd.command("publish <lib>").description("Push + register the library's manifest atomically (needs git backend)").option("--asset <ref>", "Publish only the single asset matching this ref/name").option("--create-repo", "Provision + link a public github repo if the library has no remote").option("--ref <gitref>", "Git ref to ingest (default: the library branch or main)").option("--dry-run", "Print the plan; push nothing and call no store endpoint").action(
3419
3503
  async (lib, opts) => {
3420
- const { runLibraryPublish } = await import('../library-publish-CUPDG5NI.js');
3504
+ const { runLibraryPublish } = await import('../library-publish-YPHKEA6L.js');
3421
3505
  await withStoreErrorHandling(() => runLibraryPublish(lib, opts));
3422
3506
  }
3423
3507
  );
3424
3508
  cmd.command("register <lib>").description("Register the library's manifest without pushing (bytes already on github)").option("--asset <ref>", "Publish only the single asset matching this ref/name").option("--ref <gitref>", "Git ref to ingest (default: the library branch or main)").option("--dry-run", "Print the plan; call no store endpoint").action(async (lib, opts) => {
3425
- const { runLibraryRegister } = await import('../library-publish-CUPDG5NI.js');
3509
+ const { runLibraryRegister } = await import('../library-publish-YPHKEA6L.js');
3426
3510
  await withStoreErrorHandling(() => runLibraryRegister(lib, opts));
3427
3511
  });
3428
3512
  cmd.command("yank <lib>").description("Retract the library's published assets from the store").option("--asset <ref>", "Yank only the single asset matching this ref/name").action(async (lib, opts) => {
3429
- const { runLibraryYank } = await import('../library-publish-CUPDG5NI.js');
3513
+ const { runLibraryYank } = await import('../library-publish-YPHKEA6L.js');
3430
3514
  await withStoreErrorHandling(() => runLibraryYank(lib, opts));
3431
3515
  });
3432
3516
  return cmd;
@@ -3443,14 +3527,14 @@ function stampAssetPublisher(assetDir, publisher) {
3443
3527
  const markers = ["SKILL.md", "AGENT.md", "CONTRACT.md"];
3444
3528
  let markerFile;
3445
3529
  for (const m of markers) {
3446
- if (fs12.existsSync(path35.join(assetDir, m))) {
3447
- markerFile = path35.join(assetDir, m);
3530
+ if (fs12.existsSync(path36.join(assetDir, m))) {
3531
+ markerFile = path36.join(assetDir, m);
3448
3532
  break;
3449
3533
  }
3450
3534
  }
3451
3535
  if (!markerFile) {
3452
3536
  const promptMd = fs12.readdirSync(assetDir).find((f) => f.endsWith(".prompt.md"));
3453
- if (promptMd) markerFile = path35.join(assetDir, promptMd);
3537
+ if (promptMd) markerFile = path36.join(assetDir, promptMd);
3454
3538
  }
3455
3539
  if (!markerFile) return;
3456
3540
  try {
@@ -3477,7 +3561,7 @@ function ensureManifestPublisher(libraryPath, publisher) {
3477
3561
  async function syncManifestWithDisk(libraryPath, libraryName) {
3478
3562
  const publisher = loadSkPublishManifest(libraryPath)?.publisher ?? slugifyAssetName(libraryName);
3479
3563
  for (const e of await scanDirectory(libraryPath, publisher)) {
3480
- const root = path35.relative(libraryPath, path35.dirname(e.source)) || e.name;
3564
+ const root = path36.relative(libraryPath, path36.dirname(e.source)) || e.name;
3481
3565
  upsertManifestAsset(libraryPath, { kind: e.kind, name: e.name, root, version: e.version });
3482
3566
  }
3483
3567
  }
@@ -3519,9 +3603,9 @@ async function printOverallStatus(projectDir, asJson) {
3519
3603
  } catch {
3520
3604
  secretsStrategy = "unavailable";
3521
3605
  }
3522
- const resolvedProjectDir = path35.resolve(projectDir);
3523
- const hasWorkspaceConfig = existsSync(path35.join(resolvedProjectDir, "skaile.yaml"));
3524
- const hasLockFile = existsSync(path35.join(resolvedProjectDir, "skaile.lock.yaml"));
3606
+ const resolvedProjectDir = path36.resolve(projectDir);
3607
+ const hasWorkspaceConfig = existsSync(path36.join(resolvedProjectDir, "skaile.yaml"));
3608
+ const hasLockFile = existsSync(path36.join(resolvedProjectDir, "skaile.lock.yaml"));
3525
3609
  let assignments = [];
3526
3610
  if (hasWorkspaceConfig) {
3527
3611
  try {
@@ -4148,7 +4232,7 @@ function scheduleSoftDepPreview() {
4148
4232
  }
4149
4233
  async function loadAssets() {
4150
4234
  softDepPreviewCache.clear();
4151
- const { gatherAssetFeeds } = await import('../asset-feeds-QF7LGRUX.js');
4235
+ const { gatherAssetFeeds } = await import('../asset-feeds-VEPD5ZU7.js');
4152
4236
  const { entries, domains, notes } = await gatherAssetFeeds(am, am.projectDir);
4153
4237
  if (notes.length > 0) {
4154
4238
  state.message = notes.map((n) => `[${n.feed}] ${n.message}`).join(" \u2022 ");
@@ -4170,7 +4254,7 @@ function rebuildSourceTree() {
4170
4254
  rebuildVisibleSources();
4171
4255
  }
4172
4256
  function sourceOrgRepo(s) {
4173
- const parts = s.path.split(path35__default.sep).filter(Boolean);
4257
+ const parts = s.path.split(path36__default.sep).filter(Boolean);
4174
4258
  if (parts.length < 2) return null;
4175
4259
  return { org: parts[parts.length - 2], repo: parts[parts.length - 1] };
4176
4260
  }
@@ -4354,14 +4438,14 @@ function reconcileCollapsedSets(rows) {
4354
4438
  async function loadSourcesAndLibraries() {
4355
4439
  try {
4356
4440
  const [{ openLibraryManager: openLibraryManager2 }, { skaileHomeDir }, { getGlobalCacheDir: getGlobalCacheDir2 }] = await Promise.all([
4357
- import('../open-library-32XAI2LH.js'),
4441
+ import('../open-library-7OIUAGAH.js'),
4358
4442
  import('../library/index.js'),
4359
4443
  import('../core/index.js')
4360
4444
  ]);
4361
4445
  const { manager, library, close } = await openLibraryManager2();
4362
4446
  try {
4363
4447
  const newRoot = getGlobalCacheDir2();
4364
- const legacyRoot = path35__default.join(skaileHomeDir(), "sources");
4448
+ const legacyRoot = path36__default.join(skaileHomeDir(), "sources");
4365
4449
  const isSourceRow = (l) => l.path.startsWith(newRoot) || l.path.startsWith(legacyRoot);
4366
4450
  const libs = await manager.listLibraries();
4367
4451
  const defs = await library.listAssetDefs();
@@ -5421,13 +5505,13 @@ async function run(projectDir) {
5421
5505
  }
5422
5506
  function makeManageCommand() {
5423
5507
  return new Command("manage").description("Interactive TUI for managing assets, sources, and libraries").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
5424
- await run(path35__default.resolve(opts.projectDir));
5508
+ await run(path36__default.resolve(opts.projectDir));
5425
5509
  });
5426
5510
  }
5427
5511
  function makeMcpServerCommand() {
5428
5512
  return new Command("mcp-server").description("Start skaile workspace MCP server (stdio transport)").option("--project-dir <path>", "Project directory (default: cwd)", process.cwd()).action(async (opts) => {
5429
- const path38 = await import('path');
5430
- const projectDir = path38.default.resolve(opts.projectDir);
5513
+ const path39 = await import('path');
5514
+ const projectDir = path39.default.resolve(opts.projectDir);
5431
5515
  const { LogStore, StdoutSink, registerLogStore } = await import('../core/logging.js');
5432
5516
  registerLogStore(
5433
5517
  new LogStore({
@@ -5458,14 +5542,362 @@ function makeMcpServerCommand() {
5458
5542
  await plugin.runMcpServerStdio();
5459
5543
  });
5460
5544
  }
5545
+
5546
+ // cli/src/commands/migrate-legacy-entry.ts
5547
+ var ANTHROPIC_VERSION_HEADER = { "anthropic-version": "2023-06-01" };
5548
+ var PRESET_ALIASES = { gemini: "google" };
5549
+ function legacyCloudConfig(raw) {
5550
+ if (!raw || typeof raw !== "object") return void 0;
5551
+ const out = {};
5552
+ if (raw.region) out.region = raw.region;
5553
+ if (raw.project_id) out.projectId = raw.project_id;
5554
+ if (raw.resource) out.resource = raw.resource;
5555
+ if (raw.base_url) out.baseUrl = raw.base_url;
5556
+ return Object.keys(out).length > 0 ? out : void 0;
5557
+ }
5558
+ function directEntry(provider, env) {
5559
+ const preset = AI_PROVIDER_PRESETS[PRESET_ALIASES[provider] ?? provider];
5560
+ const envBaseUrl = preset?.base_url_env ? env[preset.base_url_env]?.trim() : void 0;
5561
+ const baseUrl = envBaseUrl || preset?.base_url;
5562
+ const envName = preset?.credential.env ?? `${provider.toUpperCase().replace(/[^A-Z0-9]/g, "_")}_API_KEY`;
5563
+ return {
5564
+ kind: "llm",
5565
+ label: preset?.label ?? provider,
5566
+ // `openai-completions` is the only defensible guess for a provider the
5567
+ // catalog has never heard of: every unlisted vendor the old settings
5568
+ // cascade accepted speaks the OpenAI chat wire format.
5569
+ surface: preset?.surface ?? "openai-completions",
5570
+ ...baseUrl ? { base_url: baseUrl } : {},
5571
+ ...preset?.headers ? { headers: { ...preset.headers } } : {},
5572
+ ...preset?.discovery ? { discovery: { ...preset.discovery } } : {},
5573
+ credential: { kind: preset?.credential.kind ?? "bearer", ref: `env:${envName}` }
5574
+ };
5575
+ }
5576
+ function cloudEntry(cloud, cfg, env) {
5577
+ switch (cloud) {
5578
+ case "bedrock": {
5579
+ const region = cfg?.region ?? env.AWS_REGION ?? env.AWS_DEFAULT_REGION;
5580
+ const common = {
5581
+ kind: "llm",
5582
+ label: "AWS Bedrock",
5583
+ surface: "bedrock-converse-stream",
5584
+ credential: { kind: "sigv4" }
5585
+ };
5586
+ return region ? { ...common, transport: "bedrock", params: { region } } : { ...common };
5587
+ }
5588
+ case "vertex": {
5589
+ const project = cfg?.projectId ?? env.ANTHROPIC_VERTEX_PROJECT_ID;
5590
+ const location = cfg?.region ?? env.CLOUD_ML_REGION;
5591
+ const common = {
5592
+ kind: "llm",
5593
+ label: "Google Vertex AI",
5594
+ surface: "google-vertex",
5595
+ credential: { kind: "google_adc" }
5596
+ };
5597
+ return project && location ? { ...common, transport: "vertex", params: { project, location, publisher: "anthropic" } } : { ...common };
5598
+ }
5599
+ case "azure": {
5600
+ const foundryCredential = env.ANTHROPIC_FOUNDRY_API_KEY ? { kind: "api_key_header", ref: "env:ANTHROPIC_FOUNDRY_API_KEY" } : { kind: "azure_entra" };
5601
+ const common = {
5602
+ kind: "llm",
5603
+ label: "Claude on Microsoft Foundry",
5604
+ surface: "anthropic-messages",
5605
+ headers: { ...ANTHROPIC_VERSION_HEADER },
5606
+ credential: foundryCredential
5607
+ };
5608
+ if (cfg?.resource)
5609
+ return { ...common, transport: "foundry", params: { resource: cfg.resource } };
5610
+ if (!cfg?.baseUrl) return { ...common };
5611
+ const hostLabel = cfg.baseUrl.replace(/^[a-z][a-z0-9+.-]*:\/\//i, "").split(/[./:]/)[0];
5612
+ return hostLabel ? { ...common, transport: "foundry", params: { resource: hostLabel }, base_url: cfg.baseUrl } : { ...common, base_url: cfg.baseUrl };
5613
+ }
5614
+ default: {
5615
+ const baseUrl = cfg?.baseUrl ?? env.ANTHROPIC_BASE_URL;
5616
+ const usesApiKeyCarrier = env.ANTHROPIC_API_KEY && env.ANTHROPIC_AUTH_TOKEN === void 0;
5617
+ const credential = usesApiKeyCarrier ? { kind: "api_key_header", ref: "env:ANTHROPIC_API_KEY" } : { kind: "bearer", ref: "env:ANTHROPIC_AUTH_TOKEN" };
5618
+ return {
5619
+ kind: "llm",
5620
+ label: "Anthropic-compatible gateway",
5621
+ surface: "anthropic-messages",
5622
+ headers: { ...ANTHROPIC_VERSION_HEADER },
5623
+ ...baseUrl ? { base_url: baseUrl } : {},
5624
+ credential
5625
+ };
5626
+ }
5627
+ }
5628
+ }
5629
+ function legacyProfileEntry(inputs = {}) {
5630
+ const env = inputs.env ?? process.env;
5631
+ const provider = (inputs.provider ?? "anthropic").trim() || "anthropic";
5632
+ const cloud = inputs.cloud && inputs.cloud !== "default" ? inputs.cloud : "default";
5633
+ return cloud === "default" ? directEntry(provider, env) : cloudEntry(cloud, inputs.cloudConfig, env);
5634
+ }
5635
+
5636
+ // cli/src/commands/migrate-providers.ts
5637
+ var LEGACY_PROFILE_KEYS = ["provider", "cloud", "cloud_config", "cloudConfig"];
5638
+ var AGENT_CONFIG_KEYS = ["agent-config", "agent_config", "agentConfig"];
5639
+ var FLAT_PROFILE_FIELDS = [
5640
+ "driver",
5641
+ "provider",
5642
+ "cloud",
5643
+ "model",
5644
+ "thinking",
5645
+ "effort",
5646
+ "skills_dir",
5647
+ "agents_dir",
5648
+ "prompts_dir"
5649
+ ];
5650
+ function slugId(value) {
5651
+ const slug = value.trim().toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/^[^a-z0-9]+/, "");
5652
+ return slug || "provider";
5653
+ }
5654
+ function presetIdFor(provider, cloud) {
5655
+ const id = cloud === "default" ? provider === "gemini" ? "google" : provider : cloud === "azure" ? "foundry" : cloud === "gateway" ? void 0 : cloud;
5656
+ return id && getProviderPreset(id) ? id : void 0;
5657
+ }
5658
+ function withCredentialRef(entry, provider, cloud) {
5659
+ if (entry.credential && entry.credential.kind !== "none") return entry;
5660
+ if (cloud === "gateway") {
5661
+ const credential2 = { kind: "bearer", ref: "env:ANTHROPIC_AUTH_TOKEN" };
5662
+ return { ...entry, credential: credential2 };
5663
+ }
5664
+ const preset = getProviderPreset(presetIdFor(provider, cloud) ?? "");
5665
+ const name = preset?.credential.env ?? `${provider.toUpperCase().replace(/[^A-Z0-9]/g, "_")}_API_KEY`;
5666
+ const credential = {
5667
+ kind: preset?.credential.kind ?? "bearer",
5668
+ ref: `env:${name}`
5669
+ };
5670
+ return { ...entry, credential };
5671
+ }
5672
+ function workspaceConfigFiles(dir) {
5673
+ let names;
5674
+ try {
5675
+ names = readdirSync(dir);
5676
+ } catch {
5677
+ return [];
5678
+ }
5679
+ return names.filter((name) => isWorkspaceConfigFilename(name)).sort().map((name) => path36__default.join(dir, name));
5680
+ }
5681
+ function readAgentConfigBlock(raw) {
5682
+ const key = AGENT_CONFIG_KEYS.find((candidate) => raw[candidate] !== void 0);
5683
+ if (!key) return void 0;
5684
+ const block = raw[key];
5685
+ if (typeof block !== "object" || block === null || Array.isArray(block)) return void 0;
5686
+ const profiles = block;
5687
+ const flat = FLAT_PROFILE_FIELDS.some((field) => typeof profiles[field] === "string");
5688
+ return flat ? { key, profiles: { default: profiles }, flat } : { key, profiles, flat };
5689
+ }
5690
+ function planProviderMigration(options) {
5691
+ const projectDir = path36__default.resolve(options.projectDir);
5692
+ const registryPath = options.workspace ? workspaceProviderRegistryPath(projectDir) : userProviderRegistryPath();
5693
+ const plan = {
5694
+ registryPath,
5695
+ entries: [],
5696
+ providers: {},
5697
+ files: [],
5698
+ conflicts: [],
5699
+ warnings: []
5700
+ };
5701
+ for (const file of workspaceConfigFiles(projectDir)) {
5702
+ let raw;
5703
+ try {
5704
+ raw = parseDocument(readFileSync(file, "utf-8")).toJS() ?? {};
5705
+ } catch (error) {
5706
+ plan.warnings.push(
5707
+ `${path36__default.basename(file)}: not valid YAML (${error instanceof Error ? error.message : String(error)}) \u2014 skipped`
5708
+ );
5709
+ continue;
5710
+ }
5711
+ let touched = false;
5712
+ const rawProviders = raw.providers;
5713
+ if (typeof rawProviders === "object" && rawProviders !== null && !Array.isArray(rawProviders)) {
5714
+ for (const [id, entry] of Object.entries(rawProviders)) {
5715
+ if (typeof entry === "object" && entry !== null && !Array.isArray(entry)) {
5716
+ plan.providers[id] = entry;
5717
+ }
5718
+ }
5719
+ touched = true;
5720
+ }
5721
+ const block = readAgentConfigBlock(raw);
5722
+ for (const [profile, raw_] of Object.entries(block?.profiles ?? {})) {
5723
+ if (typeof raw_ !== "object" || raw_ === null || Array.isArray(raw_)) continue;
5724
+ const value = raw_;
5725
+ if (!LEGACY_PROFILE_KEYS.some((key) => value[key] !== void 0)) continue;
5726
+ const provider = typeof value.provider === "string" ? value.provider.trim() : "anthropic";
5727
+ const rawCloud = typeof value.cloud === "string" ? value.cloud.trim() : "default";
5728
+ const cloud = rawCloud === "" ? "default" : rawCloud;
5729
+ const model = typeof value.model === "string" ? value.model.trim() : void 0;
5730
+ const cloudConfig = legacyCloudConfig(
5731
+ value.cloud_config ?? value.cloudConfig
5732
+ );
5733
+ const derivedEntry = legacyProfileEntry({
5734
+ provider,
5735
+ cloud,
5736
+ ...cloudConfig ? { cloudConfig } : {},
5737
+ env: options.env ?? process.env
5738
+ });
5739
+ const providerId = cloud === "default" ? slugId(provider) : `${slugId(provider)}-${slugId(cloud)}`;
5740
+ const presetId = presetIdFor(provider, cloud);
5741
+ const entry = withCredentialRef(
5742
+ presetId ? { ...derivedEntry, preset: presetId } : derivedEntry,
5743
+ provider,
5744
+ cloud
5745
+ );
5746
+ plan.entries.push({
5747
+ file,
5748
+ profile,
5749
+ providerId,
5750
+ entry,
5751
+ ...model ? { modelRef: `${providerId}/${model}` } : {},
5752
+ legacy: { provider, cloud }
5753
+ });
5754
+ if (!model) {
5755
+ plan.warnings.push(
5756
+ `${path36__default.basename(file)}: profile '${profile}' had no model: \u2014 it now resolves against registry order. Pin it with 'model: ${providerId}/<modelId>'.`
5757
+ );
5758
+ }
5759
+ touched = true;
5760
+ }
5761
+ if (touched) plan.files.push(file);
5762
+ }
5763
+ const existing = loadProviderRegistryFile(registryPath, options.workspace ? "workspace" : "user").document.providers;
5764
+ const proposed = [
5765
+ ...plan.entries.map((e) => [e.providerId, e.entry]),
5766
+ ...Object.entries(plan.providers)
5767
+ ];
5768
+ for (const [id, entry] of proposed) {
5769
+ const current = existing[id];
5770
+ if (current && JSON.stringify(current) !== JSON.stringify(entry)) plan.conflicts.push(id);
5771
+ }
5772
+ return plan;
5773
+ }
5774
+ function rewriteWorkspaceFile(file, entries) {
5775
+ const doc = parseDocument(readFileSync(file, "utf-8"));
5776
+ const raw = doc.toJS() ?? {};
5777
+ doc.delete("providers");
5778
+ const block = readAgentConfigBlock(raw);
5779
+ if (block) {
5780
+ for (const entry of entries) {
5781
+ const base = block.flat ? [block.key] : [block.key, entry.profile];
5782
+ for (const key of LEGACY_PROFILE_KEYS) doc.deleteIn([...base, key]);
5783
+ if (entry.modelRef) doc.setIn([...base, "model"], entry.modelRef);
5784
+ }
5785
+ }
5786
+ writeFileSync(file, doc.toString());
5787
+ }
5788
+ function applyProviderMigration(plan, options) {
5789
+ const existing = loadProviderRegistryFile(
5790
+ plan.registryPath,
5791
+ options.workspace ? "workspace" : "user"
5792
+ ).document.providers;
5793
+ const toWrite = [
5794
+ ...plan.entries.map((e) => [e.providerId, e.entry]),
5795
+ ...Object.entries(plan.providers)
5796
+ ];
5797
+ for (const [id, entry] of toWrite) {
5798
+ if (existing[id] && JSON.stringify(existing[id]) === JSON.stringify(entry)) continue;
5799
+ addProviderEntry({
5800
+ id,
5801
+ entry,
5802
+ projectDir: options.projectDir,
5803
+ ...options.workspace ? { workspace: true } : {},
5804
+ force: true
5805
+ });
5806
+ }
5807
+ const written = [];
5808
+ for (const file of plan.files) {
5809
+ rewriteWorkspaceFile(
5810
+ file,
5811
+ plan.entries.filter((entry) => entry.file === file)
5812
+ );
5813
+ written.push(file);
5814
+ }
5815
+ return { registryPath: plan.registryPath, written };
5816
+ }
5817
+ function printPlan(plan) {
5818
+ console.log();
5819
+ console.log(` ${S.heading("Provider migration")}`);
5820
+ for (const entry of plan.entries) {
5821
+ const base = entry.entry.base_url ?? S.dim("(transport-derived)");
5822
+ console.log(
5823
+ ` ${S.label(`${path36__default.basename(entry.file)} ${entry.profile}`)} provider: ${entry.legacy.provider}, cloud: ${entry.legacy.cloud}`
5824
+ );
5825
+ console.log(` \u2192 providers.yml ${S.bold(entry.providerId)} ${base}`);
5826
+ console.log(
5827
+ ` \u2192 credential ${entry.entry.credential?.kind ?? "none"}${entry.entry.credential?.ref ? ` ${entry.entry.credential.ref}` : ""}`
5828
+ );
5829
+ console.log(
5830
+ ` \u2192 skaile.yaml ${entry.modelRef ? `model: ${entry.modelRef}` : S.dim("(no model: to carry over)")}`
5831
+ );
5832
+ }
5833
+ for (const id of Object.keys(plan.providers)) {
5834
+ console.log(` ${S.label("providers:")} ${id} \u2192 providers.yml`);
5835
+ }
5836
+ console.log();
5837
+ }
5838
+ async function runMigrateProviders(opts) {
5839
+ const projectDir = opts.projectDir ? path36__default.resolve(opts.projectDir) : process.cwd();
5840
+ const plan = planProviderMigration({ projectDir, workspace: opts.workspace });
5841
+ for (const warning of plan.warnings) logWarn(warning);
5842
+ if (plan.entries.length === 0 && Object.keys(plan.providers).length === 0) {
5843
+ logOk("Nothing to migrate \u2014 every skaile.yaml here is already in selector form.");
5844
+ console.log(
5845
+ ` ${S.dim("Providers are defined in")} ${S.cmd(plan.registryPath)} ${S.dim("\u2014 see")} ${S.cmd("skaile providers list")}`
5846
+ );
5847
+ return;
5848
+ }
5849
+ printPlan(plan);
5850
+ if (plan.conflicts.length > 0 && !opts.force) {
5851
+ logErr(
5852
+ `${plan.conflicts.join(", ")} already exist(s) in ${plan.registryPath} with different settings. Review the entries, then re-run with --force to overwrite them.`
5853
+ );
5854
+ process.exit(1);
5855
+ }
5856
+ if (opts.dryRun) {
5857
+ logInfo("--dry-run: nothing written.");
5858
+ return;
5859
+ }
5860
+ try {
5861
+ const result = applyProviderMigration(plan, {
5862
+ projectDir,
5863
+ ...opts.workspace ? { workspace: true } : {},
5864
+ force: true
5865
+ });
5866
+ logOk(
5867
+ `Wrote ${plan.entries.length + Object.keys(plan.providers).length} entr(ies) to ${result.registryPath}`
5868
+ );
5869
+ for (const file of result.written) console.log(S.dim(` \u2192 rewrote ${file}`));
5870
+ } catch (error) {
5871
+ if (error instanceof ProviderRegistryWriteError) {
5872
+ logErr(error.message);
5873
+ process.exit(1);
5874
+ }
5875
+ throw error;
5876
+ }
5877
+ const refs = new Set(
5878
+ plan.entries.map((entry) => entry.entry.credential?.ref).filter((ref) => !!ref?.startsWith("env:")).map((ref) => ref.slice(4))
5879
+ );
5880
+ if (refs.size > 0) {
5881
+ console.log();
5882
+ logInfo(
5883
+ `The secrets stay out of both files \u2014 export ${[...refs].join(", ")} (or point the entry at a cmd:/platform: reference).`
5884
+ );
5885
+ }
5886
+ console.log(` ${S.dim("Verify with:")} ${S.cmd("skaile providers list")}`);
5887
+ }
5888
+ function makeMigrateCommand() {
5889
+ const cmd = new Command("migrate").description("One-time config migrations");
5890
+ cmd.command("providers").description("Move agent-config provider/cloud/cloud_config into the AI provider registry").option("--project-dir <path>", "Project directory").option("--workspace", "Write <workspace>/.skaile/providers.yml instead of the user file").option("--dry-run", "Print what would change and write nothing").option("--force", "Overwrite registry entries that already exist with other settings").action((opts) => runMigrateProviders(opts));
5891
+ return cmd;
5892
+ }
5461
5893
  function makeNpxCommand() {
5462
5894
  const npx = new Command("npx").description("Compatibility shim for npx skills syntax");
5463
5895
  const skills = npx.command("skills").description("Skill installation from external repos");
5464
5896
  skills.command("add <url>").description(
5465
5897
  "Clone a repo, register it in the project's skaile.yaml sources[], and install a skill from it"
5466
5898
  ).requiredOption("--skill <name>", "Skill name to install from the repo").option("--project-dir <path>", "Project directory", process.cwd()).option("--target <agent>", "Agent framework", "claude-code").option("--global", "Deploy globally").action(async (url, opts) => {
5467
- const projectDir = path35__default.resolve(opts.projectDir);
5468
- const projYaml = path35__default.join(projectDir, "skaile.yaml");
5899
+ const projectDir = path36__default.resolve(opts.projectDir);
5900
+ const projYaml = path36__default.join(projectDir, "skaile.yaml");
5469
5901
  if (!existsSync(projYaml)) {
5470
5902
  logErr(`No skaile.yaml in ${projectDir} \u2014 run \`skaile init\` first.`);
5471
5903
  process.exit(1);
@@ -5478,11 +5910,11 @@ function makeNpxCommand() {
5478
5910
  }
5479
5911
  const spinner4 = p5.spinner();
5480
5912
  const key = sourceCacheKey(url);
5481
- const clonePath = path35__default.join(getGlobalCacheDir(), key);
5913
+ const clonePath = path36__default.join(getGlobalCacheDir(), key);
5482
5914
  spinner4.start(`Cloning ${url}`);
5483
5915
  try {
5484
5916
  if (!existsSync(clonePath)) {
5485
- mkdirSync(path35__default.dirname(clonePath), { recursive: true });
5917
+ mkdirSync(path36__default.dirname(clonePath), { recursive: true });
5486
5918
  execSync(`git clone ${url} ${clonePath}`, { stdio: "ignore" });
5487
5919
  }
5488
5920
  spinner4.stop(`Cloned to ${key}`);
@@ -5528,7 +5960,7 @@ function makeNpxCommand() {
5528
5960
  return npx;
5529
5961
  }
5530
5962
  function resolvePublisher(clonePath, url) {
5531
- const manifestPath = path35__default.join(clonePath, SKAILE_MANIFEST_FILENAME);
5963
+ const manifestPath = path36__default.join(clonePath, SKAILE_MANIFEST_FILENAME);
5532
5964
  if (existsSync(manifestPath)) {
5533
5965
  try {
5534
5966
  const { manifest } = decodeSkaileManifest(readFileSync(manifestPath, "utf8"));
@@ -5541,12 +5973,12 @@ function resolvePublisher(clonePath, url) {
5541
5973
  return url.match(/github\.com[/:]([^/]+)\/[^/]+/)?.[1];
5542
5974
  }
5543
5975
  function resolveSkillName(clonePath, requested) {
5544
- const skillsDir = path35__default.join(clonePath, "skills");
5545
- if (existsSync(path35__default.join(skillsDir, requested, "SKILL.md"))) return requested;
5976
+ const skillsDir = path36__default.join(clonePath, "skills");
5977
+ if (existsSync(path36__default.join(skillsDir, requested, "SKILL.md"))) return requested;
5546
5978
  if (!existsSync(skillsDir)) return requested;
5547
5979
  for (const entry of readdirSync(skillsDir, { withFileTypes: true })) {
5548
5980
  if (!entry.isDirectory()) continue;
5549
- const md = path35__default.join(skillsDir, entry.name, "SKILL.md");
5981
+ const md = path36__default.join(skillsDir, entry.name, "SKILL.md");
5550
5982
  if (!existsSync(md)) continue;
5551
5983
  try {
5552
5984
  const { data } = parseFrontmatter(readFileSync(md, "utf8"));
@@ -5561,7 +5993,7 @@ function makeOutdatedCommand() {
5561
5993
  new Option("--target <agent>", "Driver target").default("claude-code").choices(SUPPORTED_DRIVER_TARGETS)
5562
5994
  ).action((name, opts) => {
5563
5995
  const am2 = new AssetManager({
5564
- projectDir: path35__default.resolve(opts.projectDir),
5996
+ projectDir: path36__default.resolve(opts.projectDir),
5565
5997
  driverTarget: opts.target
5566
5998
  });
5567
5999
  const entries = am2.outdated();
@@ -5590,7 +6022,7 @@ function makeOutdatedCommand() {
5590
6022
  function makePatchCommand() {
5591
6023
  const cmd = new Command("patch").description("Patch workflow for skill improvement");
5592
6024
  cmd.command("extract <ref>").alias("start").description("Extract asset for local editing").option("--project-dir <path>", "Project directory", process.cwd()).action(async (ref, opts) => {
5593
- const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
6025
+ const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
5594
6026
  try {
5595
6027
  const dest = await am2.patch(ref);
5596
6028
  logOk(`Extracted to ${S.dim(dest)}`);
@@ -5601,7 +6033,7 @@ function makePatchCommand() {
5601
6033
  }
5602
6034
  });
5603
6035
  cmd.command("commit <ref>").description("Generate .patch file from edits").option("--project-dir <path>", "Project directory", process.cwd()).action(async (ref, opts) => {
5604
- const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
6036
+ const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
5605
6037
  try {
5606
6038
  const patchFile = await am2.patchCommit(ref);
5607
6039
  logOk(`Patch saved to ${S.dim(patchFile)}`);
@@ -5612,7 +6044,7 @@ function makePatchCommand() {
5612
6044
  }
5613
6045
  });
5614
6046
  cmd.command("submit <ref>").description("Apply patch to repo clone and prepare for PR").option("--project-dir <path>", "Project directory", process.cwd()).action(async (ref, opts) => {
5615
- const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
6047
+ const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
5616
6048
  try {
5617
6049
  await am2.patchSubmit(ref);
5618
6050
  logOk("Patch applied to repo clone and committed.");
@@ -5625,7 +6057,7 @@ function makePatchCommand() {
5625
6057
  }
5626
6058
  });
5627
6059
  cmd.command("remove <ref>").description("Remove local patch after upstream merge").option("--project-dir <path>", "Project directory", process.cwd()).action((ref, opts) => {
5628
- const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
6060
+ const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
5629
6061
  am2.patchRemove(ref);
5630
6062
  logOk(`Patch removed for ${ref}`);
5631
6063
  });
@@ -5643,7 +6075,7 @@ function action2(fn) {
5643
6075
  };
5644
6076
  }
5645
6077
  async function reconcileAndReport(projectDir, plugins) {
5646
- const { reconcilePlugins } = await import('../plugin-store-QJNBPIQK.js');
6078
+ const { reconcilePlugins } = await import('../plugin-store-V5BMOYGS.js');
5647
6079
  if (plugins.length === 0) {
5648
6080
  logInfo("No plugins declared \u2014 nothing to reconcile.");
5649
6081
  return;
@@ -5657,10 +6089,10 @@ async function reconcileAndReport(projectDir, plugins) {
5657
6089
  }
5658
6090
  }
5659
6091
  async function runInstall2(spec, opts) {
5660
- const projectDir = path35__default.resolve(opts.projectDir);
6092
+ const projectDir = path36__default.resolve(opts.projectDir);
5661
6093
  const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
5662
- const { specName } = await import('../plugin-store-QJNBPIQK.js');
5663
- const yamlPath = path35__default.join(projectDir, "skaile.yaml");
6094
+ const { specName } = await import('../plugin-store-V5BMOYGS.js');
6095
+ const yamlPath = path36__default.join(projectDir, "skaile.yaml");
5664
6096
  const editor = WorkspaceYamlEditor2.load(yamlPath);
5665
6097
  const replaced = editor.addPlugin(spec, specName);
5666
6098
  editor.save();
@@ -5669,10 +6101,10 @@ async function runInstall2(spec, opts) {
5669
6101
  await reconcileAndReport(projectDir, editor.getPlugins());
5670
6102
  }
5671
6103
  async function runRemove(name, opts) {
5672
- const projectDir = path35__default.resolve(opts.projectDir);
6104
+ const projectDir = path36__default.resolve(opts.projectDir);
5673
6105
  const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
5674
- const { specName } = await import('../plugin-store-QJNBPIQK.js');
5675
- const yamlPath = path35__default.join(projectDir, "skaile.yaml");
6106
+ const { specName } = await import('../plugin-store-V5BMOYGS.js');
6107
+ const yamlPath = path36__default.join(projectDir, "skaile.yaml");
5676
6108
  const editor = WorkspaceYamlEditor2.load(yamlPath);
5677
6109
  const removed = editor.removePlugin(name, specName);
5678
6110
  if (!removed) {
@@ -5684,7 +6116,7 @@ async function runRemove(name, opts) {
5684
6116
  await reconcileAndReport(projectDir, editor.getPlugins());
5685
6117
  }
5686
6118
  async function runList(opts) {
5687
- const projectDir = path35__default.resolve(opts.projectDir);
6119
+ const projectDir = path36__default.resolve(opts.projectDir);
5688
6120
  const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
5689
6121
  const config = resolveSkWorkspaceConfig2(projectDir);
5690
6122
  const declared = config.plugins ?? [];
@@ -5699,7 +6131,7 @@ async function runList(opts) {
5699
6131
  const registry = createPluginRegistry();
5700
6132
  if (declared.length > 0) {
5701
6133
  try {
5702
- const { loadPlugins } = await import('../plugin-store-QJNBPIQK.js');
6134
+ const { loadPlugins } = await import('../plugin-store-V5BMOYGS.js');
5703
6135
  const result = await loadPlugins(projectDir, declared, registry);
5704
6136
  for (const f of result.failed) logWarn(f.error);
5705
6137
  } catch (err) {
@@ -5874,7 +6306,7 @@ function neededSources(config, lock) {
5874
6306
  }
5875
6307
  function sourcesWithSidecar(sources) {
5876
6308
  const dir = getStoreManifestsDir();
5877
- return sources.filter((s) => existsSync(path35.join(dir, `${storeManifestSlug(s.url)}.yaml`))).map((s) => s.url);
6309
+ return sources.filter((s) => existsSync(path36.join(dir, `${storeManifestSlug(s.url)}.yaml`))).map((s) => s.url);
5878
6310
  }
5879
6311
  function compact(obj) {
5880
6312
  const out = {};
@@ -5966,8 +6398,8 @@ function redactSecrets(preset, findings) {
5966
6398
  }
5967
6399
  return { preset: next, keys };
5968
6400
  }
5969
- function placeholderKey(itemId, path38) {
5970
- return `${itemId}_${path38}`.replace(/[^a-zA-Z0-9]+/g, "_").replace(/^_+|_+$/g, "").toUpperCase();
6401
+ function placeholderKey(itemId, path39) {
6402
+ return `${itemId}_${path39}`.replace(/[^a-zA-Z0-9]+/g, "_").replace(/^_+|_+$/g, "").toUpperCase();
5971
6403
  }
5972
6404
  function setAtPath(root, segments, value) {
5973
6405
  let node = root;
@@ -5990,7 +6422,7 @@ function makePresetCommand() {
5990
6422
  cmd.command("init [name]").description("Scaffold a new .preset.yaml file").option("--dir <path>", "Output directory", process.cwd()).action(async (name, opts) => {
5991
6423
  const presetName = name ?? "my-preset";
5992
6424
  const filename = `${presetName}.preset.yaml`;
5993
- const outPath = path35__default.join(path35__default.resolve(opts.dir), filename);
6425
+ const outPath = path36__default.join(path36__default.resolve(opts.dir), filename);
5994
6426
  if (existsSync(outPath)) {
5995
6427
  logErr(`File already exists: ${outPath}`);
5996
6428
  logInfo("Choose a different name or remove the existing file.");
@@ -6023,7 +6455,7 @@ function makePresetCommand() {
6023
6455
  return cmd;
6024
6456
  }
6025
6457
  async function runPresetExport(name, opts) {
6026
- const projectDir = path35__default.resolve(opts.projectDir);
6458
+ const projectDir = path36__default.resolve(opts.projectDir);
6027
6459
  const file = loadSkWorkspaceConfig(projectDir);
6028
6460
  if (!file) {
6029
6461
  logErr(`No skaile.yaml found in ${projectDir}`);
@@ -6033,7 +6465,7 @@ async function runPresetExport(name, opts) {
6033
6465
  const presetName = name ?? file.config.name ?? "my-preset";
6034
6466
  let lock = null;
6035
6467
  try {
6036
- lock = readLock(path35__default.join(projectDir, "skaile.lock.yaml"));
6468
+ lock = readLock(path36__default.join(projectDir, "skaile.lock.yaml"));
6037
6469
  } catch {
6038
6470
  lock = null;
6039
6471
  }
@@ -6074,7 +6506,7 @@ async function runPresetExport(name, opts) {
6074
6506
  const contents = header ? `${header}
6075
6507
  ${body}` : body;
6076
6508
  if (opts.out && opts.dir !== process.cwd()) logWarn("--dir is ignored when --out is set.");
6077
- const outPath = opts.out ? path35__default.resolve(opts.out) : path35__default.join(path35__default.resolve(opts.dir), `${presetName}.preset.yaml`);
6509
+ const outPath = opts.out ? path36__default.resolve(opts.out) : path36__default.join(path36__default.resolve(opts.dir), `${presetName}.preset.yaml`);
6078
6510
  if (existsSync(outPath) && !opts.force) {
6079
6511
  logErr(`File already exists: ${outPath}`);
6080
6512
  logInfo("Pass --force to overwrite, or choose a different --out/--dir.");
@@ -6086,7 +6518,7 @@ ${body}` : body;
6086
6518
  logErr(`Failed to write ${outPath}: ${e.message}`);
6087
6519
  process.exit(1);
6088
6520
  }
6089
- logOk(`Exported ${S.brand(path35__default.basename(outPath))}`);
6521
+ logOk(`Exported ${S.brand(path36__default.basename(outPath))}`);
6090
6522
  logInfo(`Path: ${outPath}`);
6091
6523
  if (unresolved.length > 0) {
6092
6524
  console.error(S.err("This file is NOT safe to share."));
@@ -6127,13 +6559,13 @@ function collectInput(value, acc) {
6127
6559
  return acc;
6128
6560
  }
6129
6561
  async function runPresetApply(filePath, opts) {
6130
- const projectDir = path35__default.resolve(opts.projectDir);
6562
+ const projectDir = path36__default.resolve(opts.projectDir);
6131
6563
  const file = loadSkWorkspaceConfig(projectDir);
6132
6564
  if (!file) {
6133
6565
  logErr("No skaile.yaml \u2014 run `skaile init` first");
6134
6566
  process.exit(1);
6135
6567
  }
6136
- const resolved = path35__default.resolve(filePath);
6568
+ const resolved = path36__default.resolve(filePath);
6137
6569
  if (!existsSync(resolved)) {
6138
6570
  logErr(`File not found: ${resolved}`);
6139
6571
  process.exit(1);
@@ -6349,7 +6781,7 @@ async function reportNestedPresetRefs(preset) {
6349
6781
  }
6350
6782
  async function checkPresetCycles(preset, resolved) {
6351
6783
  const { detectCycles } = await import('../discovery/index.js');
6352
- const presetRef = path35__default.basename(resolved, ".preset.yaml");
6784
+ const presetRef = path36__default.basename(resolved, ".preset.yaml");
6353
6785
  const edges = [];
6354
6786
  for (const item of preset.items) {
6355
6787
  if (item.ref) {
@@ -6401,7 +6833,7 @@ function printPresetSummary(preset, placeholderCount, hasWarnings) {
6401
6833
  }
6402
6834
  }
6403
6835
  async function runPresetValidate(filePath) {
6404
- const resolved = path35__default.resolve(filePath);
6836
+ const resolved = path36__default.resolve(filePath);
6405
6837
  const preset = await loadPresetForValidation(resolved);
6406
6838
  await reportNestedPresetRefs(preset);
6407
6839
  await checkPresetCycles(preset, resolved);
@@ -6451,14 +6883,14 @@ items:
6451
6883
  }
6452
6884
  function makeRebuildCommand() {
6453
6885
  return new Command("rebuild").description("Re-snapshot inline-snapshot composition items and bump prompt version").argument("[agent]", "Agent name or path (defaults to current project agent)").option("--project-dir <dir>", "Project directory", process.cwd()).action(async (agentArg, opts) => {
6454
- const projectDir = path35__default.resolve(opts.projectDir);
6886
+ const projectDir = path36__default.resolve(opts.projectDir);
6455
6887
  let agentDir;
6456
6888
  if (agentArg) {
6457
6889
  if (agentArg.includes("/") || agentArg.includes("\\")) {
6458
- agentDir = path35__default.resolve(projectDir, agentArg);
6890
+ agentDir = path36__default.resolve(projectDir, agentArg);
6459
6891
  } else {
6460
6892
  const resolved = resolveAgentDir(projectDir);
6461
- agentDir = resolved ?? path35__default.resolve(projectDir, agentArg);
6893
+ agentDir = resolved ?? path36__default.resolve(projectDir, agentArg);
6462
6894
  }
6463
6895
  } else {
6464
6896
  const resolved = resolveAgentDir(projectDir);
@@ -6550,8 +6982,8 @@ function makeFlowEventHandler() {
6550
6982
  };
6551
6983
  }
6552
6984
  function makeRunCommand() {
6553
- const cmd = new Command("run").description("Start a flow or run a single-shot text prompt").argument("[flow-id-or-text...]", "Flow ID or text prompt").option("--project-dir <path>", "Project directory", process.cwd()).option("--driver <name>", "Driver backend (claude-sdk, codex, omp)").option("--provider <name>", "LLM provider").option("--model <name>", "Model override").option("--label <label>", "Human-readable session label").option("--dry-run", "Print plan without executing").option("--skill <name>", "Skill name (for single-shot mode)").action(async (positional, opts) => {
6554
- const projectDir = path35__default.resolve(opts.projectDir);
6985
+ const cmd = new Command("run").description("Start a flow or run a single-shot text prompt").argument("[flow-id-or-text...]", "Flow ID or text prompt").option("--project-dir <path>", "Project directory", process.cwd()).option("--driver <name>", "Driver backend (claude-sdk, codex, omp)").option("--model <name>", "Model override").option("--label <label>", "Human-readable session label").option("--dry-run", "Print plan without executing").option("--skill <name>", "Skill name (for single-shot mode)").action(async (positional, opts) => {
6986
+ const projectDir = path36__default.resolve(opts.projectDir);
6555
6987
  const cliDriver = opts.driver;
6556
6988
  const dryRun = opts.dryRun ?? false;
6557
6989
  let flowId = positional[0];
@@ -6577,12 +7009,10 @@ function makeRunCommand() {
6577
7009
  }
6578
7010
  const config = await resolveSettings(projectDir, {
6579
7011
  driver: cliDriver,
6580
- model: opts.model,
6581
- provider: opts.provider
7012
+ model: opts.model
6582
7013
  });
6583
7014
  const driver = config.driver ?? "omp";
6584
7015
  const model = config.model;
6585
- const provider = config.provider;
6586
7016
  const flowPath = findFlowFile(flowId, projectAiAssetsRoots(projectDir), projectDir);
6587
7017
  if (!flowPath) {
6588
7018
  const textPrompt = positional.join(" ");
@@ -6599,7 +7029,6 @@ function makeRunCommand() {
6599
7029
  projectDir,
6600
7030
  driver: config.driver,
6601
7031
  model: config.model,
6602
- provider: config.provider,
6603
7032
  message: textPrompt,
6604
7033
  skill: opts.skill
6605
7034
  });
@@ -6636,7 +7065,6 @@ function makeRunCommand() {
6636
7065
  flowPath,
6637
7066
  driver,
6638
7067
  model,
6639
- provider,
6640
7068
  sessionLabel: opts.label,
6641
7069
  dryRun,
6642
7070
  onEvent: makeFlowEventHandler(),
@@ -6652,7 +7080,7 @@ function makeRunCommand() {
6652
7080
  }
6653
7081
  function makeResumeCommand() {
6654
7082
  const cmd = new Command("resume").description("Resume current session").option("--project-dir <path>", "Project directory", process.cwd()).option("--session <run-id>", "Target session by runId").option("--dry-run", "Print plan without executing").action(async (opts) => {
6655
- const projectDir = path35__default.resolve(opts.projectDir);
7083
+ const projectDir = path36__default.resolve(opts.projectDir);
6656
7084
  const sessionId = opts.session;
6657
7085
  const dryRun = opts.dryRun ?? false;
6658
7086
  const session = sessionId ? await loadSessionById(projectDir, sessionId) : await loadSession(projectDir);
@@ -6679,7 +7107,7 @@ function makeResumeCommand() {
6679
7107
  }
6680
7108
  function makeStatusCommand() {
6681
7109
  return new Command("status").description("Show current session state").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
6682
- const projectDir = path35__default.resolve(opts.projectDir);
7110
+ const projectDir = path36__default.resolve(opts.projectDir);
6683
7111
  const session = await loadSession(projectDir);
6684
7112
  if (!session) {
6685
7113
  logInfo("No active session.");
@@ -6704,17 +7132,17 @@ function makeStatusCommand() {
6704
7132
  }
6705
7133
  function makeClearCommand() {
6706
7134
  return new Command("clear").description("Unset current session pointer").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
6707
- const projectDir = path35__default.resolve(opts.projectDir);
7135
+ const projectDir = path36__default.resolve(opts.projectDir);
6708
7136
  await clearSession(projectDir);
6709
7137
  logOk("Session cleared.");
6710
7138
  });
6711
7139
  }
6712
7140
  function makeReplCommand() {
6713
- return new Command("repl").description("Start an interactive agent session").option("--project-dir <path>", "Project directory").option("--driver <name>", "Driver backend (claude-sdk, omp)").option("--provider <name>", "LLM provider").option("--model <name>", "Model override").option("--resume", "Resume last session").option("--resume-session <id>", "Resume specific session").action(async (opts) => {
7141
+ return new Command("repl").description("Start an interactive agent session").option("--project-dir <path>", "Project directory").option("--driver <name>", "Driver backend (claude-sdk, omp)").option("--model <name>", "Model override").option("--resume", "Resume last session").option("--resume-session <id>", "Resume specific session").action(async (opts) => {
6714
7142
  const { findWorkspaceRoot } = await import('../core/index.js');
6715
7143
  const { startRepl } = await import('../tui/index.js');
6716
7144
  const os2 = await import('os');
6717
- const userCwd = path35__default.resolve(opts.projectDir ?? process.cwd());
7145
+ const userCwd = path36__default.resolve(opts.projectDir ?? process.cwd());
6718
7146
  const workspaceRoot = findWorkspaceRoot(userCwd);
6719
7147
  let projectDir;
6720
7148
  let agentCwd;
@@ -6736,12 +7164,12 @@ function makeReplCommand() {
6736
7164
  p5.cancel("Cancelled.");
6737
7165
  process.exit(0);
6738
7166
  }
6739
- const tmpDir = fs12__default.mkdtempSync(path35__default.join(os2.tmpdir(), "skaile-repl-"));
7167
+ const tmpDir = fs12__default.mkdtempSync(path36__default.join(os2.tmpdir(), "skaile-repl-"));
6740
7168
  projectDir = tmpDir;
6741
7169
  agentCwd = userCwd;
6742
7170
  logOk(`Temporary workspace: ${S.cmd(tmpDir)}`);
6743
7171
  if (!driverOverride) {
6744
- const claudeDir = path35__default.join(os2.homedir(), ".claude");
7172
+ const claudeDir = path36__default.join(os2.homedir(), ".claude");
6745
7173
  if (fs12__default.existsSync(claudeDir)) {
6746
7174
  driverOverride = "claude-sdk";
6747
7175
  logInfo(`Detected ${S.cmd("~/.claude")} \u2192 using ${S.cmd("claude-sdk")} backend`);
@@ -6757,7 +7185,6 @@ function makeReplCommand() {
6757
7185
  cwd: agentCwd !== projectDir ? agentCwd : void 0,
6758
7186
  driver: driverOverride,
6759
7187
  model: opts.model,
6760
- provider: opts.provider,
6761
7188
  resume: opts.resume,
6762
7189
  resumeSessionId: opts.resumeSession
6763
7190
  });
@@ -6805,12 +7232,12 @@ function makeServeCommand() {
6805
7232
  );
6806
7233
  }
6807
7234
  async function ensurePluginsLoadedForServe(projectDir) {
6808
- const { logInfo: logInfo2, logWarn: logWarn2 } = await import('../helpers-DXZOHX25.js');
7235
+ const { logInfo: logInfo2, logWarn: logWarn2 } = await import('../helpers-72W3NZ2L.js');
6809
7236
  try {
6810
7237
  const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
6811
7238
  const config = resolveSkWorkspaceConfig2(projectDir);
6812
7239
  if (!config.plugins || config.plugins.length === 0) return;
6813
- const { ensurePluginsLoaded } = await import('../plugin-store-QJNBPIQK.js');
7240
+ const { ensurePluginsLoaded } = await import('../plugin-store-V5BMOYGS.js');
6814
7241
  const { pluginRegistry } = await import('../plugin-registry/index.js');
6815
7242
  const result = await ensurePluginsLoaded(projectDir, config.plugins, pluginRegistry);
6816
7243
  if (result.loaded.length > 0) {
@@ -6824,14 +7251,14 @@ async function ensurePluginsLoadedForServe(projectDir) {
6824
7251
  }
6825
7252
  }
6826
7253
  async function runCompileTest(opts) {
6827
- const { logOk: logOk2, logErr: logErr2, logInfo: logInfo2, S: S2 } = await import('../helpers-DXZOHX25.js');
7254
+ const { logOk: logOk2, logErr: logErr2, logInfo: logInfo2, S: S2 } = await import('../helpers-72W3NZ2L.js');
6828
7255
  const { tmpdir } = await import('os');
6829
7256
  const { dirname: dirname4, join: join7, resolve: resolve5 } = await import('path');
6830
7257
  const { fileURLToPath: fileURLToPath2 } = await import('url');
6831
7258
  const { unlinkSync, existsSync: existsSync15 } = await import('fs');
6832
7259
  const { spawn } = await import('child_process');
6833
7260
  const { portableSpawnSync: portableSpawnSync2 } = await import('../core/index.js');
6834
- const { MONOREPO_ROOT } = await import('../paths-CZEH643M.js');
7261
+ const { MONOREPO_ROOT } = await import('../paths-XLSP5K6C.js');
6835
7262
  if (MONOREPO_ROOT === null) {
6836
7263
  logErr2("--compile-test is only available inside the skaile-dev workspace.");
6837
7264
  logInfo2("Run it from a checkout of skaile-ai/skaile-dev (the monorepo shell).");
@@ -7313,7 +7740,7 @@ function resolveMode(opts) {
7313
7740
  if (opts.forceLocal && opts.forceRemote) {
7314
7741
  throw new Error("Cannot use both --local and --remote");
7315
7742
  }
7316
- const startDir = path35__default.resolve(opts.projectDir ?? process.cwd());
7743
+ const startDir = path36__default.resolve(opts.projectDir ?? process.cwd());
7317
7744
  const localDb = findLogsDb(startDir);
7318
7745
  if (opts.forceLocal) {
7319
7746
  if (!localDb) {
@@ -7346,14 +7773,14 @@ function resolveMode(opts) {
7346
7773
  function findLogsDb(startDir) {
7347
7774
  let dir = startDir;
7348
7775
  for (let i = 0; i < MAX_WALK_LEVELS; i++) {
7349
- const candidate = path35__default.join(dir, ".skaile", "logs.db");
7776
+ const candidate = path36__default.join(dir, ".skaile", "logs.db");
7350
7777
  if (existsSync(candidate)) {
7351
7778
  try {
7352
7779
  if (statSync(candidate).isFile()) return candidate;
7353
7780
  } catch {
7354
7781
  }
7355
7782
  }
7356
- const parent = path35__default.dirname(dir);
7783
+ const parent = path36__default.dirname(dir);
7357
7784
  if (parent === dir) return void 0;
7358
7785
  dir = parent;
7359
7786
  }
@@ -7379,7 +7806,7 @@ function readApiToken() {
7379
7806
  }
7380
7807
  function readGlobalSettings() {
7381
7808
  try {
7382
- const settingsPath = path35__default.join(homedir(), ".skaile", "settings.json");
7809
+ const settingsPath = path36__default.join(homedir(), ".skaile", "settings.json");
7383
7810
  if (!existsSync(settingsPath)) return {};
7384
7811
  return JSON.parse(readFileSync(settingsPath, "utf8"));
7385
7812
  } catch {
@@ -7528,7 +7955,7 @@ function parsePositiveInt(value, flag) {
7528
7955
  function makeSessionCommand() {
7529
7956
  const cmd = new Command("session").description("Manage sessions");
7530
7957
  cmd.command("list").description("List all sessions for a project").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
7531
- const projectDir = path35__default.resolve(opts.projectDir);
7958
+ const projectDir = path36__default.resolve(opts.projectDir);
7532
7959
  const sessions = await listSessions(projectDir);
7533
7960
  const current = await loadSession(projectDir);
7534
7961
  if (sessions.length === 0) {
@@ -7556,7 +7983,7 @@ function makeSessionCommand() {
7556
7983
  console.log();
7557
7984
  });
7558
7985
  cmd.command("show <run-id>").description("Show a specific session").option("--project-dir <path>", "Project directory", process.cwd()).action(async (runId, opts) => {
7559
- const projectDir = path35__default.resolve(opts.projectDir);
7986
+ const projectDir = path36__default.resolve(opts.projectDir);
7560
7987
  const session = await loadSessionById(projectDir, runId);
7561
7988
  if (!session) {
7562
7989
  logErr(`Session not found: ${runId}`);
@@ -7565,12 +7992,12 @@ function makeSessionCommand() {
7565
7992
  console.log(JSON.stringify(session, null, 2));
7566
7993
  });
7567
7994
  cmd.command("switch <run-id>").description("Switch the current session").option("--project-dir <path>", "Project directory", process.cwd()).action(async (runId, opts) => {
7568
- const projectDir = path35__default.resolve(opts.projectDir);
7995
+ const projectDir = path36__default.resolve(opts.projectDir);
7569
7996
  await setCurrentSession(projectDir, runId);
7570
7997
  logOk(`Switched to session: ${S.dim(runId.slice(0, 8))}`);
7571
7998
  });
7572
7999
  cmd.command("delete <run-id>").description("Delete a session").option("--project-dir <path>", "Project directory", process.cwd()).action(async (runId, opts) => {
7573
- const projectDir = path35__default.resolve(opts.projectDir);
8000
+ const projectDir = path36__default.resolve(opts.projectDir);
7574
8001
  await deleteSession(projectDir, runId);
7575
8002
  logOk(`Deleted session: ${S.dim(runId.slice(0, 8))}`);
7576
8003
  });
@@ -7638,7 +8065,7 @@ async function showAsset(am2, kind, name) {
7638
8065
  function makeShowCommand() {
7639
8066
  return new Command("show").description("Show deployed assets overview, or print asset content").argument("[kind]", "Asset kind (skill, agent, prompt, flow, bundle, contract)").argument("[name]", "Asset name").option("--project-dir <path>", "Project directory", process.cwd()).option("--target <agent>", "Agent framework", "claude-code").action(async (kind, name, opts) => {
7640
8067
  const am2 = new AssetManager({
7641
- projectDir: path35__default.resolve(opts.projectDir),
8068
+ projectDir: path36__default.resolve(opts.projectDir),
7642
8069
  driverTarget: opts.target
7643
8070
  });
7644
8071
  if (!kind) {
@@ -7706,9 +8133,9 @@ function makeStoreCommand() {
7706
8133
  process.exit(2);
7707
8134
  });
7708
8135
  store.command("search <query>").description("Search the AI Asset Store catalog by name, description, or publisher").option("--kind <kind>", "Filter by asset kind (skill, agent, prompt, flow, \u2026)").option("-C, --project-dir <dir>", "Project directory (catalog config overlay)", process.cwd()).action(async (query, opts) => {
7709
- const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-32XAI2LH.js');
8136
+ const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-7OIUAGAH.js');
7710
8137
  try {
7711
- const remote = await openCatalogSource2({ projectDir: path35__default.resolve(opts.projectDir) });
8138
+ const remote = await openCatalogSource2({ projectDir: path36__default.resolve(opts.projectDir) });
7712
8139
  const assets = await remote.listAssets(opts.kind ? { kind: opts.kind } : {});
7713
8140
  const results = filterCatalogAssets(assets, query);
7714
8141
  if (results.length === 0) {
@@ -7739,10 +8166,10 @@ function makeStoreCommand() {
7739
8166
  }
7740
8167
  });
7741
8168
  store.command("show <ref>").description("Show a store asset's details + provenance (source, files, integrity)").option("-C, --project-dir <dir>", "Project directory (catalog config overlay)", process.cwd()).action(async (ref, opts) => {
7742
- const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-32XAI2LH.js');
7743
- const { supportsInstallManifest } = await import('../project-RRHUCVXW.js');
8169
+ const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-7OIUAGAH.js');
8170
+ const { supportsInstallManifest } = await import('../project-KNAZV4B3.js');
7744
8171
  try {
7745
- const remote = await openCatalogSource2({ projectDir: path35__default.resolve(opts.projectDir) });
8172
+ const remote = await openCatalogSource2({ projectDir: path36__default.resolve(opts.projectDir) });
7746
8173
  const asset = await remote.resolve(ref);
7747
8174
  if (!asset) {
7748
8175
  logErr(`Not found in store: ${ref} (try a full ref, e.g. skill:@publisher/name#version)`);
@@ -7861,7 +8288,7 @@ function printTree(node, prefix = "", isLast = true) {
7861
8288
  }
7862
8289
  function makeTreeCommand() {
7863
8290
  return new Command("tree").description("Show full dependency tree").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
7864
- const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
8291
+ const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
7865
8292
  const root = am2.tree();
7866
8293
  if (root.children.length === 0) {
7867
8294
  logInfo("No dependencies in lock file. Run `skaile install` first.");
@@ -7887,7 +8314,7 @@ function makeUpdateCommand() {
7887
8314
  try {
7888
8315
  const catalogSpinner = p5.spinner();
7889
8316
  catalogSpinner.start("Refreshing catalog cache");
7890
- const remote = await openCatalogSource({ projectDir: path35__default.resolve(opts.projectDir) });
8317
+ const remote = await openCatalogSource({ projectDir: path36__default.resolve(opts.projectDir) });
7891
8318
  const result2 = await remote.refresh();
7892
8319
  catalogSpinner.stop(
7893
8320
  `Catalog refreshed: ${S.heading(String(result2.assetsCached))} assets cached`
@@ -7899,7 +8326,7 @@ function makeUpdateCommand() {
7899
8326
  }
7900
8327
  }
7901
8328
  if (opts.catalogOnly) return;
7902
- const projectDir = path35__default.resolve(opts.projectDir);
8329
+ const projectDir = path36__default.resolve(opts.projectDir);
7903
8330
  if (await shouldSyncSources(opts)) {
7904
8331
  const syncSpinner = p5.spinner();
7905
8332
  syncSpinner.start("Syncing sources");
@@ -7960,7 +8387,7 @@ function findManifestCandidates(rootPath) {
7960
8387
  return;
7961
8388
  }
7962
8389
  for (const entry of entries) {
7963
- const fullPath = path35__default.join(dir, entry.name);
8390
+ const fullPath = path36__default.join(dir, entry.name);
7964
8391
  if (entry.isDirectory()) {
7965
8392
  if (!SKIP_DIRS.has(entry.name)) walk(fullPath);
7966
8393
  } else if (entry.isFile()) {
@@ -8013,13 +8440,13 @@ function parseManifestCandidate(c, absRoot) {
8013
8440
  const parsed = c.filePath.endsWith(".json") ? JSON.parse(content) : parse(content);
8014
8441
  return { kind: "value", parsed };
8015
8442
  } catch (e) {
8016
- const relPath = path35__default.relative(absRoot, c.filePath);
8443
+ const relPath = path36__default.relative(absRoot, c.filePath);
8017
8444
  logErr(`${relPath} \u2014 parse error: ${e instanceof Error ? e.message : String(e)}`);
8018
8445
  return { kind: "error" };
8019
8446
  }
8020
8447
  }
8021
8448
  function validateManifestCandidate(c, parsed, absRoot, registry, strictConformance) {
8022
- const relPath = path35__default.relative(absRoot, c.filePath);
8449
+ const relPath = path36__default.relative(absRoot, c.filePath);
8023
8450
  let errors = 0;
8024
8451
  let warnings = 0;
8025
8452
  const identityError = checkManifestIdentity(c.kind, parsed);
@@ -8028,7 +8455,7 @@ function validateManifestCandidate(c, parsed, absRoot, registry, strictConforman
8028
8455
  errors++;
8029
8456
  }
8030
8457
  if (c.kind === "skill" && parsed && typeof parsed === "object") {
8031
- const dirName = path35__default.basename(path35__default.dirname(c.filePath));
8458
+ const dirName = path36__default.basename(path36__default.dirname(c.filePath));
8032
8459
  const findings = checkAgentSkillConformance(parsed, { dirName });
8033
8460
  for (const f of findings) {
8034
8461
  const line = `${relPath} [skill conformance] \u2014 ${f.field}: ${f.message}`;
@@ -8056,7 +8483,7 @@ function validateManifestCandidate(c, parsed, absRoot, registry, strictConforman
8056
8483
  return { errors, warnings };
8057
8484
  }
8058
8485
  function validateManifests(rootPath, strictConformance) {
8059
- const absRoot = path35__default.resolve(rootPath);
8486
+ const absRoot = path36__default.resolve(rootPath);
8060
8487
  if (!fs12__default.existsSync(absRoot)) {
8061
8488
  logErr(`Path does not exist: ${absRoot}`);
8062
8489
  return { total: 0, errors: 1, warnings: 0 };
@@ -8094,7 +8521,7 @@ function findWorkspaceManifests(rootPath) {
8094
8521
  return;
8095
8522
  }
8096
8523
  for (const entry of entries) {
8097
- const full = path35__default.join(dir, entry.name);
8524
+ const full = path36__default.join(dir, entry.name);
8098
8525
  if (entry.isDirectory()) {
8099
8526
  if (!SKIP_DIRS.has(entry.name)) walk(full);
8100
8527
  } else if (entry.isFile() && /(^|\.)skaile\.yaml$/.test(entry.name)) {
@@ -8157,11 +8584,11 @@ function validateWorkspaceAssets(parsed, relPath) {
8157
8584
  return errors;
8158
8585
  }
8159
8586
  function validateWorkspaceManifests(rootPath) {
8160
- const absRoot = path35__default.resolve(rootPath);
8587
+ const absRoot = path36__default.resolve(rootPath);
8161
8588
  const files = findWorkspaceManifests(absRoot);
8162
8589
  let errors = 0;
8163
8590
  for (const file of files) {
8164
- const relPath = path35__default.relative(absRoot, file);
8591
+ const relPath = path36__default.relative(absRoot, file);
8165
8592
  let parsed;
8166
8593
  try {
8167
8594
  parsed = parse(fs12__default.readFileSync(file, "utf-8")) ?? {};
@@ -8181,20 +8608,20 @@ function collectAssetVersions() {
8181
8608
  if (!fs12__default.existsSync(AI_RESOURCES)) return assets;
8182
8609
  const domains = fs12__default.readdirSync(AI_RESOURCES, { withFileTypes: true }).filter((d) => d.isDirectory() && !EXCLUDED_DOMAINS.has(d.name));
8183
8610
  for (const d of domains) {
8184
- const domainDir = path35__default.join(AI_RESOURCES, d.name);
8185
- const skillsDir = path35__default.join(domainDir, "skills");
8611
+ const domainDir = path36__default.join(AI_RESOURCES, d.name);
8612
+ const skillsDir = path36__default.join(domainDir, "skills");
8186
8613
  if (fs12__default.existsSync(skillsDir)) {
8187
8614
  collectSkillVersions(skillsDir, d.name, assets);
8188
8615
  }
8189
- const agentsDir = path35__default.join(domainDir, "agents");
8616
+ const agentsDir = path36__default.join(domainDir, "agents");
8190
8617
  if (fs12__default.existsSync(agentsDir)) {
8191
8618
  collectAgentVersions(agentsDir, d.name, assets);
8192
8619
  }
8193
- const flowsDir = path35__default.join(domainDir, "flows");
8620
+ const flowsDir = path36__default.join(domainDir, "flows");
8194
8621
  if (fs12__default.existsSync(flowsDir)) {
8195
8622
  collectFlowVersions(flowsDir, d.name, assets);
8196
8623
  }
8197
- const promptsDir = path35__default.join(domainDir, "prompts");
8624
+ const promptsDir = path36__default.join(domainDir, "prompts");
8198
8625
  if (fs12__default.existsSync(promptsDir)) {
8199
8626
  collectPromptVersions(promptsDir, d.name, assets);
8200
8627
  }
@@ -8204,7 +8631,7 @@ function collectAssetVersions() {
8204
8631
  function collectFlowVersions(dir, domain, out) {
8205
8632
  for (const f of fs12__default.readdirSync(dir)) {
8206
8633
  if (!f.endsWith(".flow.yaml")) continue;
8207
- const fp = path35__default.join(dir, f);
8634
+ const fp = path36__default.join(dir, f);
8208
8635
  const content = fs12__default.readFileSync(fp, "utf-8");
8209
8636
  const parsed = parse(content);
8210
8637
  out.push({
@@ -8219,7 +8646,7 @@ function collectFlowVersions(dir, domain, out) {
8219
8646
  function collectPromptVersions(dir, domain, out) {
8220
8647
  for (const f of fs12__default.readdirSync(dir)) {
8221
8648
  if (!f.endsWith(".prompt.md")) continue;
8222
- const fp = path35__default.join(dir, f);
8649
+ const fp = path36__default.join(dir, f);
8223
8650
  const content = fs12__default.readFileSync(fp, "utf-8");
8224
8651
  const fm = parseSkillFrontmatter(content);
8225
8652
  out.push({
@@ -8234,8 +8661,8 @@ function collectPromptVersions(dir, domain, out) {
8234
8661
  function collectSkillVersions(dir, domain, out) {
8235
8662
  for (const entry of fs12__default.readdirSync(dir, { withFileTypes: true })) {
8236
8663
  if (!entry.isDirectory()) continue;
8237
- const full = path35__default.join(dir, entry.name);
8238
- const skillMd = path35__default.join(full, "SKILL.md");
8664
+ const full = path36__default.join(dir, entry.name);
8665
+ const skillMd = path36__default.join(full, "SKILL.md");
8239
8666
  if (fs12__default.existsSync(skillMd)) {
8240
8667
  const content = fs12__default.readFileSync(skillMd, "utf-8");
8241
8668
  const fm = parseSkillFrontmatter(content);
@@ -8254,7 +8681,7 @@ function collectSkillVersions(dir, domain, out) {
8254
8681
  function collectAgentVersions(dir, domain, out) {
8255
8682
  for (const entry of fs12__default.readdirSync(dir, { withFileTypes: true })) {
8256
8683
  if (!entry.isDirectory()) continue;
8257
- const agentYaml = path35__default.join(dir, entry.name, "agent.yaml");
8684
+ const agentYaml = path36__default.join(dir, entry.name, "agent.yaml");
8258
8685
  if (!fs12__default.existsSync(agentYaml)) continue;
8259
8686
  const content = fs12__default.readFileSync(agentYaml, "utf-8");
8260
8687
  const parsed = parse(content);
@@ -8287,7 +8714,7 @@ function filterToChangedAssets(assets) {
8287
8714
  encoding: "utf-8"
8288
8715
  });
8289
8716
  const changedFiles = new Set(
8290
- diffOutput.trim().split("\n").filter(Boolean).map((f) => path35__default.resolve(AI_RESOURCES, f))
8717
+ diffOutput.trim().split("\n").filter(Boolean).map((f) => path36__default.resolve(AI_RESOURCES, f))
8291
8718
  );
8292
8719
  return assets.filter((a) => changedFiles.has(a.filePath));
8293
8720
  } catch {
@@ -8313,7 +8740,7 @@ function checkVersionBumps(assets) {
8313
8740
  let warnings = 0;
8314
8741
  for (const a of assets) {
8315
8742
  if (!a.version) continue;
8316
- const relPath = path35__default.relative(AI_RESOURCES, a.filePath);
8743
+ const relPath = path36__default.relative(AI_RESOURCES, a.filePath);
8317
8744
  try {
8318
8745
  const headContent = execSync(`git show HEAD:${relPath}`, {
8319
8746
  cwd: AI_RESOURCES,
@@ -8345,7 +8772,7 @@ function checkFlowVersionPins(assets) {
8345
8772
  pins = flowSkillVersionPins(loadFlow(f.filePath));
8346
8773
  } catch (err) {
8347
8774
  logWarn(
8348
- `flow:${f.name} (${path35__default.relative(AI_RESOURCES, f.filePath)}) \u2014 could not be read: ${err instanceof Error ? err.message : err}`
8775
+ `flow:${f.name} (${path36__default.relative(AI_RESOURCES, f.filePath)}) \u2014 could not be read: ${err instanceof Error ? err.message : err}`
8349
8776
  );
8350
8777
  warnings++;
8351
8778
  continue;
@@ -8395,7 +8822,7 @@ function makeValidateCommand() {
8395
8822
  "--strict-conformance",
8396
8823
  "Treat Agent Skills (agentskills.io) standard findings as errors"
8397
8824
  ).action((targetPath, opts) => {
8398
- const absPath = path35__default.resolve(targetPath);
8825
+ const absPath = path36__default.resolve(targetPath);
8399
8826
  logInfo(`Validating manifests in ${absPath}`);
8400
8827
  const { total, errors, warnings } = validateManifests(
8401
8828
  absPath,
@@ -8445,7 +8872,7 @@ function makeValidateCommand() {
8445
8872
  let errors = 0;
8446
8873
  for (const domain of modifiedDomains) {
8447
8874
  const changelogModified = modifiedFiles.some(
8448
- (f) => f === `${domain}/CHANGELOG.md` || f === path35__default.join(domain, "CHANGELOG.md")
8875
+ (f) => f === `${domain}/CHANGELOG.md` || f === path36__default.join(domain, "CHANGELOG.md")
8449
8876
  );
8450
8877
  if (changelogModified) {
8451
8878
  logOk(`${domain}/CHANGELOG.md updated`);
@@ -8551,7 +8978,7 @@ function whyEmptyMessage(ref, declared) {
8551
8978
  }
8552
8979
  function makeWhyCommand() {
8553
8980
  return new Command("why").description("Show why an asset is installed (dependency chain)").argument("<ref>", "Asset reference (kind:name)").option("--project-dir <path>", "Project directory", process.cwd()).action(async (ref, opts) => {
8554
- const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
8981
+ const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
8555
8982
  const chain = am2.why(ref);
8556
8983
  if (chain.length === 0) {
8557
8984
  let declared;
@@ -8585,7 +9012,7 @@ function makeWhyCommand() {
8585
9012
  var _defaultFormatHelp = Help.prototype.formatHelp;
8586
9013
  var pkg = JSON.parse(
8587
9014
  readFileSync(
8588
- path35__default.resolve(path35__default.dirname(fileURLToPath(import.meta.url)), "../../package.json"),
9015
+ path36__default.resolve(path36__default.dirname(fileURLToPath(import.meta.url)), "../../package.json"),
8589
9016
  "utf-8"
8590
9017
  )
8591
9018
  );
@@ -8706,7 +9133,7 @@ program.command("init [project-dir]").description("Initialize a project director
8706
9133
  (projectDir, opts) => runInit(projectDir, opts)
8707
9134
  );
8708
9135
  async function runInit(projectDir, opts) {
8709
- const { mkdirSync: mkdirSync5, writeFileSync: writeFileSync5 } = await import('fs');
9136
+ const { mkdirSync: mkdirSync5, writeFileSync: writeFileSync6 } = await import('fs');
8710
9137
  const { stringify: stringify2 } = await import('yaml');
8711
9138
  const { DRIVER_TARGETS, SUPPORTED_DRIVER_TARGETS: SUPPORTED_DRIVER_TARGETS2 } = await import('../core/index.js');
8712
9139
  const backend = opts.backend;
@@ -8715,31 +9142,31 @@ async function runInit(projectDir, opts) {
8715
9142
  process.exitCode = 1;
8716
9143
  return;
8717
9144
  }
8718
- const resolved = path35__default.resolve(projectDir ?? ".");
8719
- const projectName = path35__default.basename(resolved);
9145
+ const resolved = path36__default.resolve(projectDir ?? ".");
9146
+ const projectName = path36__default.basename(resolved);
8720
9147
  const created = [];
8721
9148
  const { existsSync: existsSync15 } = await import('fs');
8722
9149
  if (!existsSync15(resolved)) {
8723
9150
  mkdirSync5(resolved, { recursive: true });
8724
9151
  created.push(".");
8725
9152
  }
8726
- const skaileDir = path35__default.join(resolved, ".skaile");
9153
+ const skaileDir = path36__default.join(resolved, ".skaile");
8727
9154
  if (!existsSync15(skaileDir)) {
8728
- mkdirSync5(path35__default.join(skaileDir, "sessions"), { recursive: true });
9155
+ mkdirSync5(path36__default.join(skaileDir, "sessions"), { recursive: true });
8729
9156
  created.push(".skaile/");
8730
9157
  }
8731
- const settingsPath = path35__default.join(skaileDir, "settings.json");
9158
+ const settingsPath = path36__default.join(skaileDir, "settings.json");
8732
9159
  if (!existsSync15(settingsPath)) {
8733
- writeFileSync5(settingsPath, "{}\n");
9160
+ writeFileSync6(settingsPath, "{}\n");
8734
9161
  created.push(".skaile/settings.json");
8735
9162
  }
8736
- const wsConfigPath = path35__default.join(resolved, "skaile.yaml");
9163
+ const wsConfigPath = path36__default.join(resolved, "skaile.yaml");
8737
9164
  if (!existsSync15(wsConfigPath)) {
8738
- writeFileSync5(wsConfigPath, stringify2(buildInitWorkspaceConfig(projectName, backend)));
9165
+ writeFileSync6(wsConfigPath, stringify2(buildInitWorkspaceConfig(projectName, backend)));
8739
9166
  created.push("skaile.yaml");
8740
9167
  }
8741
9168
  for (const dir of new Set(Object.values(DRIVER_TARGETS[backend].local))) {
8742
- const full = path35__default.join(resolved, dir);
9169
+ const full = path36__default.join(resolved, dir);
8743
9170
  if (!existsSync15(full)) {
8744
9171
  mkdirSync5(full, { recursive: true });
8745
9172
  created.push(`${dir}/`);
@@ -8771,32 +9198,34 @@ function buildInitWorkspaceConfig(projectName, backend) {
8771
9198
  }
8772
9199
  async function initGitScaffold(resolved, created) {
8773
9200
  const { execSync: execSync3 } = await import('child_process');
8774
- const { existsSync: existsSync15, readFileSync: readFileSync9, writeFileSync: writeFileSync5 } = await import('fs');
8775
- const gitignorePath = path35__default.join(resolved, ".gitignore");
9201
+ const { existsSync: existsSync15, readFileSync: readFileSync10, writeFileSync: writeFileSync6 } = await import('fs');
9202
+ const gitignorePath = path36__default.join(resolved, ".gitignore");
8776
9203
  const entries = [
8777
9204
  "node_modules/",
8778
9205
  ".skaile/sessions/",
8779
9206
  ".skaile/cache/",
8780
9207
  // skaile-created artifacts that must never be committed: the per-session log
8781
9208
  // DB (SQLite incl. -shm/-wal, ends in .db — not caught by *.log), personal
8782
- // settings (holds API keys), and the install history.
9209
+ // settings (holds API keys), the workspace AI provider registry (endpoints
9210
+ // and credential references are per-machine), and the install history.
8783
9211
  ".skaile/logs.db*",
8784
9212
  ".skaile/settings.json",
9213
+ ".skaile/providers.yml",
8785
9214
  ".skaile/history.yaml",
8786
9215
  "*.log",
8787
9216
  ".env",
8788
9217
  ".env.local"
8789
9218
  ];
8790
- const existing = existsSync15(gitignorePath) ? readFileSync9(gitignorePath, "utf-8") : "";
9219
+ const existing = existsSync15(gitignorePath) ? readFileSync10(gitignorePath, "utf-8") : "";
8791
9220
  const have = new Set(existing.split("\n").map((l) => l.trim()));
8792
9221
  const append = entries.filter((e) => !have.has(e));
8793
9222
  if (append.length > 0) {
8794
9223
  const prefix = existing && !existing.endsWith("\n") ? "\n" : "";
8795
- writeFileSync5(gitignorePath, `${existing + prefix}${append.join("\n")}
9224
+ writeFileSync6(gitignorePath, `${existing + prefix}${append.join("\n")}
8796
9225
  `);
8797
9226
  if (!existing) created.push(".gitignore");
8798
9227
  }
8799
- if (!existsSync15(path35__default.join(resolved, ".git"))) {
9228
+ if (!existsSync15(path36__default.join(resolved, ".git"))) {
8800
9229
  try {
8801
9230
  execSync3("git init", { cwd: resolved, stdio: "pipe" });
8802
9231
  created.push(".git/");
@@ -8826,7 +9255,7 @@ async function bootstrapUserConfig() {
8826
9255
  }
8827
9256
  async function hydrateInitSources(resolved, created) {
8828
9257
  try {
8829
- const { ensureSourcesCloned } = await import('../ensure-sources-GEJGBQIP.js');
9258
+ const { ensureSourcesCloned } = await import('../ensure-sources-B3VWHD5M.js');
8830
9259
  const hydrate = ensureSourcesCloned(resolved, { quiet: true });
8831
9260
  for (const n of hydrate.cloned) created.push(`~/.skaile/cache/sources/${n}/`);
8832
9261
  if (hydrate.failed.length > 0) {
@@ -8842,7 +9271,7 @@ function printInitSummary(resolved, projectDir, created) {
8842
9271
  logOk(`Initialized project at ${S.heading(resolved)}`);
8843
9272
  console.log();
8844
9273
  console.log(S.heading(" Next steps:"));
8845
- const isCurrentDir = resolved === path35__default.resolve(".");
9274
+ const isCurrentDir = resolved === path36__default.resolve(".");
8846
9275
  let step = 1;
8847
9276
  if (!isCurrentDir) {
8848
9277
  console.log(` ${S.dim(`${step}.`)} ${S.cmd(`cd ${projectDir}`)}`);
@@ -8866,7 +9295,7 @@ function printInitSummary(resolved, projectDir, created) {
8866
9295
  console.log();
8867
9296
  }
8868
9297
  program.command("setup").description("Interactive provider setup wizard").action(async () => {
8869
- const { cmdSetup } = await import('../setup-CIRH5BYB.js');
9298
+ const { cmdSetup } = await import('../setup-TG4KECRQ.js');
8870
9299
  await cmdSetup([], { projectDir: process.cwd() });
8871
9300
  });
8872
9301
  program.addCommand(makeInstallCommand());
@@ -8874,6 +9303,8 @@ program.addCommand(makeCheckCommand());
8874
9303
  program.addCommand(makeCleanCommand());
8875
9304
  program.addCommand(makeCacheCommand());
8876
9305
  program.addCommand(makeConfigCommand());
9306
+ program.addCommand(makeProvidersCommand());
9307
+ program.addCommand(makeMigrateCommand());
8877
9308
  program.addCommand(makeAddCommand());
8878
9309
  program.addCommand(makeRemoveCommand());
8879
9310
  program.addCommand(makeListCommand());