@skaile/workspaces 0.22.0-beta.0 → 0.22.0-beta.1

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 (260) hide show
  1. package/CHANGELOG.md +136 -0
  2. package/dist/{asset-feeds-PJDJ3QYI.js → asset-feeds-QXCSAJRN.js} +9 -9
  3. package/dist/{asset-feeds-PJDJ3QYI.js.map → asset-feeds-QXCSAJRN.js.map} +1 -1
  4. package/dist/asset-manager/catalog-deployer.d.ts +2 -0
  5. package/dist/asset-manager/contrib.d.ts +2 -0
  6. package/dist/asset-manager/fragments.d.ts +2 -0
  7. package/dist/asset-manager/history.d.ts +2 -0
  8. package/dist/asset-manager/index.d.ts +2 -0
  9. package/dist/asset-manager/index.js +7 -7
  10. package/dist/asset-manager/installer.d.ts +2 -0
  11. package/dist/asset-manager/installer.js +6 -6
  12. package/dist/asset-manager/renderers.d.ts +2 -0
  13. package/dist/asset-manager/src/index.d.ts +18 -7
  14. package/dist/asset-manager/src/index.d.ts.map +1 -1
  15. package/dist/asset-manager/src/installer.d.ts +3 -3
  16. package/dist/asset-manager/src/installer.d.ts.map +1 -1
  17. package/dist/base-assets/connectors/deploy.d.ts +2 -0
  18. package/dist/base-assets/connectors/deploy.js +8 -8
  19. package/dist/base-assets/connectors/devserver.d.ts +2 -0
  20. package/dist/base-assets/connectors/devserver.js +8 -8
  21. package/dist/base-assets/connectors/flow/adapter.js +8 -8
  22. package/dist/base-assets/connectors/flow/engine.d.ts +2 -0
  23. package/dist/base-assets/connectors/flow/run-flow.js +9 -9
  24. package/dist/base-assets/connectors/flow.d.ts +2 -0
  25. package/dist/base-assets/connectors/flow.js +8 -8
  26. package/dist/base-assets/connectors/git.d.ts +2 -0
  27. package/dist/base-assets/connectors/git.js +8 -8
  28. package/dist/base-assets/connectors/gmail.d.ts +2 -0
  29. package/dist/base-assets/connectors/gmail.js +8 -8
  30. package/dist/base-assets/connectors/googledrive.d.ts +2 -0
  31. package/dist/base-assets/connectors/googledrive.js +8 -8
  32. package/dist/base-assets/connectors/local.d.ts +2 -0
  33. package/dist/base-assets/connectors/local.js +8 -8
  34. package/dist/base-assets/connectors/mattermost.d.ts +2 -0
  35. package/dist/base-assets/connectors/mattermost.js +8 -8
  36. package/dist/base-assets/connectors/memory.d.ts +2 -0
  37. package/dist/base-assets/connectors/memory.js +8 -8
  38. package/dist/base-assets/connectors/minio.d.ts +2 -0
  39. package/dist/base-assets/connectors/minio.js +8 -8
  40. package/dist/base-assets/connectors/postgres.d.ts +2 -0
  41. package/dist/base-assets/connectors/postgres.js +8 -8
  42. package/dist/base-assets/connectors/s3.d.ts +2 -0
  43. package/dist/base-assets/connectors/s3.js +8 -8
  44. package/dist/base-assets/connectors/sharepoint.d.ts +2 -0
  45. package/dist/base-assets/connectors/sharepoint.js +8 -8
  46. package/dist/base-assets/connectors/sqlite.d.ts +2 -0
  47. package/dist/base-assets/connectors/sqlite.js +8 -8
  48. package/dist/base-assets/connectors/static-server.d.ts +2 -0
  49. package/dist/base-assets/connectors/static-server.js +8 -8
  50. package/dist/base-assets/connectors/tunnel.d.ts +2 -0
  51. package/dist/base-assets/connectors/tunnel.js +8 -8
  52. package/dist/base-assets/connectors/webdav.d.ts +2 -0
  53. package/dist/base-assets/connectors/webdav.js +8 -8
  54. package/dist/base-assets/connectors/xstate-store.d.ts +2 -0
  55. package/dist/base-assets/connectors/xstate-store.js +8 -8
  56. package/dist/base-assets/connectors/xstate.d.ts +2 -0
  57. package/dist/base-assets/connectors/xstate.js +8 -8
  58. package/dist/bridge/drivers/claude-sdk.d.ts +2 -0
  59. package/dist/bridge/drivers/claude-sdk.js +2 -2
  60. package/dist/bridge/drivers/codex.d.ts +2 -0
  61. package/dist/bridge/drivers/codex.js +2 -2
  62. package/dist/bridge/drivers/echo.d.ts +2 -0
  63. package/dist/bridge/drivers/echo.js +2 -2
  64. package/dist/bridge/drivers/omp.d.ts +2 -0
  65. package/dist/bridge/drivers/omp.js +2 -2
  66. package/dist/bridge/index.d.ts +2 -0
  67. package/dist/bridge/index.js +3 -3
  68. package/dist/bridge/src/registry.d.ts +4 -2
  69. package/dist/bridge/src/registry.d.ts.map +1 -1
  70. package/dist/{chunk-UZVHJ7LX.js → chunk-3ECS5PFD.js} +4 -4
  71. package/dist/{chunk-UZVHJ7LX.js.map → chunk-3ECS5PFD.js.map} +1 -1
  72. package/dist/{chunk-WIR34WMU.js → chunk-4AZKT2BU.js} +13 -13
  73. package/dist/chunk-4AZKT2BU.js.map +1 -0
  74. package/dist/{chunk-UZRY5UI2.js → chunk-6E6PKKAD.js} +68 -3
  75. package/dist/chunk-6E6PKKAD.js.map +1 -0
  76. package/dist/{chunk-IGQEXBBG.js → chunk-6VTG73UY.js} +13 -9
  77. package/dist/chunk-6VTG73UY.js.map +1 -0
  78. package/dist/{chunk-GKM6MDUC.js → chunk-APAOQLPT.js} +3 -3
  79. package/dist/{chunk-GKM6MDUC.js.map → chunk-APAOQLPT.js.map} +1 -1
  80. package/dist/{chunk-SL6JVGRD.js → chunk-D7K72XEY.js} +3 -3
  81. package/dist/{chunk-SL6JVGRD.js.map → chunk-D7K72XEY.js.map} +1 -1
  82. package/dist/{chunk-CSDQBWE6.js → chunk-DKGDOALM.js} +5 -5
  83. package/dist/{chunk-CSDQBWE6.js.map → chunk-DKGDOALM.js.map} +1 -1
  84. package/dist/{chunk-TTY56FQQ.js → chunk-GFNW72LW.js} +17 -5
  85. package/dist/chunk-GFNW72LW.js.map +1 -0
  86. package/dist/{chunk-X5Y4EGZB.js → chunk-I3UEM3FX.js} +36 -8
  87. package/dist/chunk-I3UEM3FX.js.map +1 -0
  88. package/dist/{chunk-TKOLD2O7.js → chunk-J3VKAEQP.js} +497 -143
  89. package/dist/chunk-J3VKAEQP.js.map +1 -0
  90. package/dist/{chunk-KA46DUM4.js → chunk-JHF66MCK.js} +49 -3
  91. package/dist/chunk-JHF66MCK.js.map +1 -0
  92. package/dist/{chunk-G6GKWGOW.js → chunk-LT4DLEYE.js} +6 -6
  93. package/dist/chunk-LT4DLEYE.js.map +1 -0
  94. package/dist/{chunk-XHFMUGDD.js → chunk-M5TE6YI5.js} +3 -3
  95. package/dist/{chunk-XHFMUGDD.js.map → chunk-M5TE6YI5.js.map} +1 -1
  96. package/dist/{chunk-J2FCO6TM.js → chunk-NJLHHZIW.js} +2 -2
  97. package/dist/{chunk-J2FCO6TM.js.map → chunk-NJLHHZIW.js.map} +1 -1
  98. package/dist/{chunk-MO4JPTRD.js → chunk-PTIHB2TV.js} +5 -5
  99. package/dist/{chunk-MO4JPTRD.js.map → chunk-PTIHB2TV.js.map} +1 -1
  100. package/dist/{chunk-RENHNO4J.js → chunk-UMOENHVH.js} +206 -137
  101. package/dist/chunk-UMOENHVH.js.map +1 -0
  102. package/dist/{chunk-NGC7ZQI4.js → chunk-V3QMSM5I.js} +38 -43
  103. package/dist/chunk-V3QMSM5I.js.map +1 -0
  104. package/dist/{chunk-2DNSSQ22.js → chunk-VCYXVP2S.js} +263 -177
  105. package/dist/chunk-VCYXVP2S.js.map +1 -0
  106. package/dist/{chunk-F3MGZ5E6.js → chunk-XIHFJVOD.js} +3 -3
  107. package/dist/{chunk-F3MGZ5E6.js.map → chunk-XIHFJVOD.js.map} +1 -1
  108. package/dist/cli/index.d.ts +2 -0
  109. package/dist/cli/index.js +102 -100
  110. package/dist/cli/index.js.map +1 -1
  111. package/dist/cli/src/commands/deploy.d.ts.map +1 -1
  112. package/dist/cli/src/commands/manage.d.ts +1 -1
  113. package/dist/cli/src/commands/project.d.ts.map +1 -1
  114. package/dist/cli/src/commands/source.d.ts.map +1 -1
  115. package/dist/cli/src/commands/update.d.ts.map +1 -1
  116. package/dist/cli/src/ensure-sources.d.ts.map +1 -1
  117. package/dist/client/index.d.ts +2 -0
  118. package/dist/connectors/config.d.ts +2 -0
  119. package/dist/connectors/config.js +6 -6
  120. package/dist/connectors/index.d.ts +2 -0
  121. package/dist/connectors/index.js +8 -8
  122. package/dist/connectors/rclone-config.d.ts +2 -0
  123. package/dist/connectors/rclone.d.ts +2 -0
  124. package/dist/connectors-shared/index.d.ts +2 -0
  125. package/dist/core/discovery.d.ts +2 -0
  126. package/dist/core/driver-targets.d.ts +2 -0
  127. package/dist/core/framework.d.ts +2 -0
  128. package/dist/core/index.d.ts +2 -0
  129. package/dist/core/index.js +5 -5
  130. package/dist/core/logging.d.ts +2 -0
  131. package/dist/core/manifest.d.ts +2 -0
  132. package/dist/core/manifest.js +2 -2
  133. package/dist/core/models.d.ts +2 -0
  134. package/dist/core/models.js +1 -1
  135. package/dist/core/runtime-assets.d.ts +2 -0
  136. package/dist/core/runtime-assets.js +4 -4
  137. package/dist/core/src/index.d.ts +7 -5
  138. package/dist/core/src/index.d.ts.map +1 -1
  139. package/dist/core/src/lock.d.ts +47 -26
  140. package/dist/core/src/lock.d.ts.map +1 -1
  141. package/dist/core/src/models.d.ts +53 -47
  142. package/dist/core/src/models.d.ts.map +1 -1
  143. package/dist/core/src/repo-manager.d.ts +62 -34
  144. package/dist/core/src/repo-manager.d.ts.map +1 -1
  145. package/dist/core/src/runtime-assets.d.ts.map +1 -1
  146. package/dist/core/src/walker.d.ts +52 -0
  147. package/dist/core/src/walker.d.ts.map +1 -0
  148. package/dist/core/src/workspace-config.d.ts +160 -45
  149. package/dist/core/src/workspace-config.d.ts.map +1 -1
  150. package/dist/core/src/workspace-yaml-editor.d.ts +33 -16
  151. package/dist/core/src/workspace-yaml-editor.d.ts.map +1 -1
  152. package/dist/core/store.d.ts +2 -0
  153. package/dist/core/workspace-config.d.ts +2 -0
  154. package/dist/core/workspace-config.js +3 -3
  155. package/dist/deploy/index.d.ts +2 -0
  156. package/dist/deploy/index.js +34 -15
  157. package/dist/deploy/index.js.map +1 -1
  158. package/dist/deploy/src/targets/container-runtime.d.ts +1 -0
  159. package/dist/deploy/src/targets/container-runtime.d.ts.map +1 -1
  160. package/dist/deploy/src/targets/docker.d.ts +1 -0
  161. package/dist/deploy/src/targets/docker.d.ts.map +1 -1
  162. package/dist/deploy/src/targets/local.d.ts.map +1 -1
  163. package/dist/deploy/src/targets/podman.d.ts +1 -0
  164. package/dist/deploy/src/targets/podman.d.ts.map +1 -1
  165. package/dist/discovery/index.d.ts +2 -0
  166. package/dist/discovery/index.js +3 -3
  167. package/dist/discovery/src/source-config.d.ts +2 -2
  168. package/dist/{ensure-sources-COGVKY44.js → ensure-sources-SL2S4UEX.js} +20 -16
  169. package/dist/ensure-sources-SL2S4UEX.js.map +1 -0
  170. package/dist/library/index.d.ts +2 -0
  171. package/dist/library/index.js +4 -4
  172. package/dist/library/src/remote/remote-catalog-source.d.ts +17 -0
  173. package/dist/library/src/remote/remote-catalog-source.d.ts.map +1 -1
  174. package/dist/open-library-M4DB3D3J.js +13 -0
  175. package/dist/{open-library-DWAQFUSQ.js.map → open-library-M4DB3D3J.js.map} +1 -1
  176. package/dist/plugin-registry/index.d.ts +2 -0
  177. package/dist/plugin-registry/index.js +1 -1
  178. package/dist/plugin-registry/src/deploy-handle.d.ts +17 -1
  179. package/dist/plugin-registry/src/deploy-handle.d.ts.map +1 -1
  180. package/dist/plugin-registry/src/deploy-helpers.d.ts +69 -0
  181. package/dist/plugin-registry/src/deploy-helpers.d.ts.map +1 -0
  182. package/dist/plugin-registry/src/index.d.ts +6 -4
  183. package/dist/plugin-registry/src/index.d.ts.map +1 -1
  184. package/dist/plugin-registry/src/internal.d.ts.map +1 -1
  185. package/dist/plugin-registry/src/registry.d.ts +1 -0
  186. package/dist/plugin-registry/src/registry.d.ts.map +1 -1
  187. package/dist/plugin-registry/src/targets.d.ts +4 -0
  188. package/dist/plugin-registry/src/targets.d.ts.map +1 -1
  189. package/dist/{plugin-store-6OENKNFW.js → plugin-store-AJ3FGXIC.js} +8 -8
  190. package/dist/{plugin-store-6OENKNFW.js.map → plugin-store-AJ3FGXIC.js.map} +1 -1
  191. package/dist/plugins/index.d.ts +2 -0
  192. package/dist/resolver/index.d.ts +2 -0
  193. package/dist/runner/index.d.ts +2 -0
  194. package/dist/runner/index.js +13 -13
  195. package/dist/runner/prompt-assembly.d.ts +2 -0
  196. package/dist/runner/src/resources.d.ts.map +1 -1
  197. package/dist/runner/src/serve.d.ts.map +1 -1
  198. package/dist/sdk/asset-manager.d.ts +2 -0
  199. package/dist/sdk/asset-manager.js +7 -7
  200. package/dist/sdk/bridge.d.ts +2 -0
  201. package/dist/sdk/bridge.js +3 -3
  202. package/dist/sdk/client.d.ts +2 -0
  203. package/dist/sdk/core.d.ts +2 -0
  204. package/dist/sdk/core.js +5 -5
  205. package/dist/sdk/flow.d.ts +2 -0
  206. package/dist/sdk/index.d.ts +2 -0
  207. package/dist/sdk/index.js +49 -16
  208. package/dist/sdk/index.js.map +1 -1
  209. package/dist/sdk/resolver.d.ts +2 -0
  210. package/dist/sdk/runner.d.ts +2 -0
  211. package/dist/sdk/runner.js +13 -13
  212. package/dist/sdk/session.d.ts +2 -0
  213. package/dist/sdk/src/local-runtime.d.ts +8 -0
  214. package/dist/sdk/src/local-runtime.d.ts.map +1 -1
  215. package/dist/sdk/src/transport.d.ts +7 -1
  216. package/dist/sdk/src/transport.d.ts.map +1 -1
  217. package/dist/sdk/store.d.ts +2 -0
  218. package/dist/sdk/telemetry.d.ts +2 -0
  219. package/dist/sdk/transport/ws/client.d.ts +2 -0
  220. package/dist/sdk/transport/ws/server.d.ts +2 -0
  221. package/dist/sdk/transport/ws.d.ts +2 -0
  222. package/dist/sdk/transport.d.ts +2 -0
  223. package/dist/sdk/types.d.ts +2 -0
  224. package/dist/secrets/index.d.ts +2 -0
  225. package/dist/session/index.d.ts +2 -0
  226. package/dist/{setup-ACMP3QZC.js → setup-GBSQX7JF.js} +10 -10
  227. package/dist/{setup-ACMP3QZC.js.map → setup-GBSQX7JF.js.map} +1 -1
  228. package/dist/store/index.d.ts +2 -0
  229. package/dist/store/react.d.ts +2 -0
  230. package/dist/store/vue.d.ts +2 -0
  231. package/dist/store-client-5WBRUC5U.js +14 -0
  232. package/dist/{store-client-ZSLNOOQG.js.map → store-client-5WBRUC5U.js.map} +1 -1
  233. package/dist/telemetry/index.d.ts +2 -0
  234. package/dist/transport/index.d.ts +2 -0
  235. package/dist/transport/ws/client.d.ts +2 -0
  236. package/dist/transport/ws/server.d.ts +2 -0
  237. package/dist/transport/ws.d.ts +2 -0
  238. package/dist/tui/index.d.ts +2 -0
  239. package/dist/tui/index.js +13 -13
  240. package/dist/types/index.d.ts +2 -0
  241. package/dist/types/manifests.d.ts +2 -0
  242. package/dist/workspace-plugin/adapters/mcp.d.ts +2 -0
  243. package/dist/workspace-plugin/adapters/omp.d.ts +2 -0
  244. package/dist/workspace-plugin/index.d.ts +2 -0
  245. package/dist/workspace-plugin/index.js +1 -1
  246. package/package.json +4 -2
  247. package/dist/chunk-2DNSSQ22.js.map +0 -1
  248. package/dist/chunk-G6GKWGOW.js.map +0 -1
  249. package/dist/chunk-IGQEXBBG.js.map +0 -1
  250. package/dist/chunk-KA46DUM4.js.map +0 -1
  251. package/dist/chunk-NGC7ZQI4.js.map +0 -1
  252. package/dist/chunk-RENHNO4J.js.map +0 -1
  253. package/dist/chunk-TKOLD2O7.js.map +0 -1
  254. package/dist/chunk-TTY56FQQ.js.map +0 -1
  255. package/dist/chunk-UZRY5UI2.js.map +0 -1
  256. package/dist/chunk-WIR34WMU.js.map +0 -1
  257. package/dist/chunk-X5Y4EGZB.js.map +0 -1
  258. package/dist/ensure-sources-COGVKY44.js.map +0 -1
  259. package/dist/open-library-DWAQFUSQ.js +0 -13
  260. package/dist/store-client-ZSLNOOQG.js +0 -14
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../bridge/src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,KAAK,cAAc,EAAkB,MAAM,oCAAoC,CAAC;AACzF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW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G;AACH,wBAAsB,sBAAsB,CAC1C,QAAQ,GAAE,cAA+B,GACxC,OAAO,CAAC,IAAI,CAAC,CAqBf;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,YAAY,CAChC,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,WAAW,EACnB,GAAG,CAAC,EAAE,aAAa,GAClB,OAAO,CAAC,WAAW,CAAC,CAGtB;AA2BD;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,IAAI,UAAU,EAAE,CAoB1C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC9B,OAAO,CAAC,UAAU,EAAE,CAAC,CAGvB"}
@@ -1,6 +1,6 @@
1
1
  import { logErr } from './chunk-4NDWKA64.js';
2
- import { knowledgeKindProvider } from './chunk-KA46DUM4.js';
3
- import { createDefaultRegistry } from './chunk-SL6JVGRD.js';
2
+ import { knowledgeKindProvider } from './chunk-JHF66MCK.js';
3
+ import { createDefaultRegistry } from './chunk-D7K72XEY.js';
4
4
  import { flowKindProvider } from './chunk-ICS76R4T.js';
5
5
 
6
6
  // cli/src/open-registry.ts
@@ -97,5 +97,5 @@ async function openLibraryManager() {
97
97
  }
98
98
 
99
99
  export { createFullRegistry, openCatalogSource, openLibrary, openLibraryManager, resolveCatalogSource };
100
- //# sourceMappingURL=chunk-UZVHJ7LX.js.map
101
- //# sourceMappingURL=chunk-UZVHJ7LX.js.map
100
+ //# sourceMappingURL=chunk-3ECS5PFD.js.map
101
+ //# sourceMappingURL=chunk-3ECS5PFD.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../cli/src/open-registry.ts","../cli/src/open-library.ts"],"names":["source"],"mappings":";;;;;;AA2BO,SAAS,kBAAA,GAAwC;AACtD,EAAA,MAAM,WAAW,qBAAA,EAAsB;AACvC,EAAA,QAAA,CAAS,SAAS,gBAAgB,CAA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*\n * Bootstraps the registry with all built-in providers (9 core + preset)\n * from @skaile/discovery, plus the extension kind providers (flow from\n * @skaile/workspaces/base-assets/connectors/flow/engine, knowledge from @skaile/library).\n *\n * This is the single registration point for the CLI. All code paths\n * that need a registry (source sync, lib-status, etc.) should use this.\n */\n\nimport { flowKindProvider } from \"@skaile/workspaces/base-assets/connectors/flow/engine\";\nimport type { AssetKindRegistry } from \"@skaile/workspaces/discovery\";\nimport { createDefaultRegistry } from \"@skaile/workspaces/discovery\";\nimport { knowledgeKindProvider } from \"@skaile/workspaces/library\";\n\n/**\n * Create a fully-configured AssetKindRegistry with all known providers.\n *\n * Registers:\n * - 9 core kinds (skill, agent, connector, mount, mcp-server, contract, prompt, persona, ruleset)\n * - preset (composition entity)\n * - flow (extension, from @skaile/workspaces/base-assets/connectors/flow/engine)\n * - knowledge (extension, from @skaile/library)\n *\n * @returns An unfrozen registry (auto-freezes on first read)\n */\nexport function createFullRegistry(): AssetKindRegistry {\n const registry = createDefaultRegistry();\n registry.register(flowKindProvider);\n registry.register(knowledgeKindProvider);\n return registry;\n}\n","/**\n * open-library.ts — shared helpers to open the LocalIndex and the configured\n * Catalog source.\n *\n * Lazy-loads the `@skaile/workspaces/library` subpath and returns the\n * LocalIndex instance (backed by `@libsql/client`; runs on Node and Bun).\n * The catalog-source helper reads\n * `~/.skaile/config.yaml` (and project-level overlay if `projectDir` is given)\n * to decide between {@link RemoteCatalogSource} (default — points at\n * `https://skaile.store`) and a {@link LocalCatalogSource} bound to the most\n * recent local library registered via `skaile source add`.\n */\n\nimport { logErr } from \"./helpers.ts\";\nimport { createFullRegistry } from \"./open-registry.ts\";\n\n/**\n * Open the LocalIndex with the full kind registry. Exits with code 1\n * if the library directory cannot be created.\n *\n * @returns A `LocalIndex` instance ready for use.\n * @docLink cli/dev-guide#open-library\n */\nexport async function openLibrary() {\n try {\n const { LocalIndex } = await import(\"@skaile/workspaces/library\");\n return new LocalIndex({ kindRegistry: createFullRegistry() });\n } catch (err) {\n logErr(`Could not open LocalIndex: ${err instanceof Error ? err.message : String(err)}`);\n process.exit(1);\n }\n}\n\n/**\n * Resolve the configured **remote** Catalog source for the CLI.\n *\n * Reads `~/.skaile/config.yaml` (plus the optional project-level overlay) and\n * returns a {@link RemoteCatalogSource} pointing at `catalog.url` (default:\n * `https://skaile.store`). The `cache_ttl: 0` config flag flips the source\n * into air-gapped mode: network reads are disabled, only `skaile update`\n * performs refreshes.\n *\n * **Local-mode rejection.** If the resolved config has `catalog.url: local`\n * this helper throws — callers wanting the dispatched local-or-remote source\n * must use {@link resolveCatalogSource}. Remote-only consumers like\n * `skaile update --catalog-only` rely on this strict behaviour.\n *\n * @param opts - Project directory (overlays project config) and explicit overrides.\n * @returns A configured {@link RemoteCatalogSource}.\n * @throws When `catalog.url` is the `local` sentinel.\n * @docLink cli/dev-guide#open-library\n */\nexport async function openCatalogSource(opts?: {\n projectDir?: string;\n baseUrlOverride?: string;\n /** Override the user-config path for tests. */\n userConfigFile?: string;\n}): Promise<\n | import(\"@skaile/workspaces/library\").RemoteCatalogSource\n | import(\"@skaile/workspaces/library\").RestCatalogSource\n> {\n const { resolveConfig, RemoteCatalogSource, RestCatalogSource, isLocalCatalogUrl } = await import(\n \"@skaile/workspaces/library\"\n );\n const cfg = resolveConfig({\n projectDir: opts?.projectDir,\n userConfigFile: opts?.userConfigFile,\n });\n const baseUrl = opts?.baseUrlOverride ?? cfg.catalog.url;\n if (isLocalCatalogUrl(baseUrl)) {\n throw new Error(\n \"catalog.url is set to 'local' — remote catalog is disabled. \" +\n \"Use `skaile source add <path>` + `skaile source sync` for local sources, \" +\n \"or set `catalog.url: https://skaile.store` in ~/.skaile/config.yaml.\",\n );\n }\n const cacheTtlMs = cfg.catalog.cache_ttl * 1000;\n if (cfg.catalog.framing === \"rest\") {\n return new RestCatalogSource({ baseUrl, cacheTtlMs });\n }\n return new RemoteCatalogSource({ baseUrl, cacheTtlMs });\n}\n\n/**\n * Resolved catalog source plus a close handle for releasing any underlying\n * resources (e.g. the `LocalIndex` SQLite connection in local mode).\n *\n * Callers MUST invoke `close()` when done — typically in a `finally` block.\n * For remote-mode sources `close()` is a no-op, but the contract is uniform\n * so consumers don't have to branch.\n *\n * @docLink cli/dev-guide#open-library\n */\nexport interface ResolvedCatalogSource {\n /** The {@link ICatalogSource} ready for use. */\n source: import(\"@skaile/workspaces/library\").ICatalogSource;\n /** Release any underlying resources (SQLite handle in local mode). */\n close(): void;\n}\n\n/**\n * Resolve the configured Catalog source — local or remote — based on\n * `~/.skaile/config.yaml`.\n *\n * Dispatch:\n * - `catalog.url: local` → opens {@link LocalIndex}, picks the most recently\n * registered local library whose `path` still exists on disk, and returns a\n * {@link LocalCatalogSource} bound to that library. Throws if no usable\n * local library is registered.\n * - any URL → returns {@link RemoteCatalogSource} (same as\n * {@link openCatalogSource}).\n *\n * The returned `close()` releases the underlying `LocalIndex` SQLite handle\n * in local mode (no-op in remote mode). Callers MUST invoke it — typically in\n * a `finally` block — to satisfy `library/CLAUDE.md` § \"Notes for Consumers\".\n *\n * @param opts - Project directory (overlays project config) and explicit overrides.\n * @returns A `ResolvedCatalogSource` carrying the source and a close handle.\n * @throws When `local` is configured but no usable local library is registered.\n * @docLink cli/dev-guide#open-library\n */\nexport async function resolveCatalogSource(opts?: {\n projectDir?: string;\n baseUrlOverride?: string;\n /** Override the user-config path for tests. */\n userConfigFile?: string;\n}): Promise<ResolvedCatalogSource> {\n const {\n resolveConfig,\n RemoteCatalogSource,\n RestCatalogSource,\n LocalCatalogSource,\n isLocalCatalogUrl,\n } = await import(\"@skaile/workspaces/library\");\n const cfg = resolveConfig({\n projectDir: opts?.projectDir,\n userConfigFile: opts?.userConfigFile,\n });\n const baseUrl = opts?.baseUrlOverride ?? cfg.catalog.url;\n\n if (isLocalCatalogUrl(baseUrl)) {\n const fs = await import(\"node:fs\");\n const library = await openLibrary();\n try {\n const sources = await library.listSources();\n type LibraryRow = (typeof sources)[number];\n // Type-narrow: `path` is required for local libraries after the filter.\n const usable = sources\n .filter(\n (s): s is LibraryRow & { path: string } =>\n s.backend === \"local\" && typeof s.path === \"string\" && s.path.length > 0,\n )\n .sort((a, b) => b.createdAt.getTime() - a.createdAt.getTime());\n\n if (usable.length === 0) {\n throw new Error(\n \"catalog.url is set to 'local' but no local library is registered. \" +\n \"Run `skaile source add <path>` first, then `skaile source sync`.\",\n );\n }\n\n // Prefer the most recently added library whose path still exists.\n const present = usable.find((s) => fs.existsSync(s.path));\n if (!present) {\n const head = usable[0];\n throw new Error(\n `catalog.url is set to 'local' but every registered local library has a missing path on disk. ` +\n `Most recent: ${head.path} (library ${head.id}). ` +\n `Re-register with \\`skaile source add <existing-path>\\` or run \\`skaile source list\\` to inspect.`,\n );\n }\n\n const source = new LocalCatalogSource(\n library,\n present.id,\n present.path,\n createFullRegistry(),\n );\n return { source, close: () => library.close() };\n } catch (err) {\n // Release the handle on any failure during dispatch — otherwise the\n // SQLite WAL state leaks for the lifetime of the process.\n library.close();\n throw err;\n }\n }\n\n const cacheTtlMs = cfg.catalog.cache_ttl * 1000;\n const source =\n cfg.catalog.framing === \"rest\"\n ? new RestCatalogSource({ baseUrl, cacheTtlMs })\n : new RemoteCatalogSource({ baseUrl, cacheTtlMs });\n return { source, close: () => {} };\n}\n\n/**\n * Open the LibraryManager bound to the active LocalIndex.\n * Caller owns lifetime — must call `close()` (returned helper closes the\n * underlying LocalIndex).\n *\n * @docLink cli/dev-guide#open-library\n */\nexport async function openLibraryManager(): Promise<{\n manager: import(\"@skaile/workspaces/library\").LibraryManager;\n library: import(\"@skaile/workspaces/library\").LocalIndex;\n close: () => void;\n}> {\n const { LibraryManager } = await import(\"@skaile/workspaces/library\");\n const library = await openLibrary();\n const manager = new LibraryManager(library);\n return { manager, library, close: () => library.close() };\n}\n"]}
1
+ {"version":3,"sources":["../cli/src/open-registry.ts","../cli/src/open-library.ts"],"names":["source"],"mappings":";;;;;;AA2BO,SAAS,kBAAA,GAAwC;AACtD,EAAA,MAAM,WAAW,qBAAA,EA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esContent":["/**\n * open-registry.ts — shared helper to create a full AssetKindRegistry.\n *\n * Bootstraps the registry with all built-in providers (9 core + preset)\n * from @skaile/discovery, plus the extension kind providers (flow from\n * @skaile/workspaces/base-assets/connectors/flow/engine, knowledge from @skaile/library).\n *\n * This is the single registration point for the CLI. All code paths\n * that need a registry (source sync, lib-status, etc.) should use this.\n */\n\nimport { flowKindProvider } from \"@skaile/workspaces/base-assets/connectors/flow/engine\";\nimport type { AssetKindRegistry } from \"@skaile/workspaces/discovery\";\nimport { createDefaultRegistry } from \"@skaile/workspaces/discovery\";\nimport { knowledgeKindProvider } from \"@skaile/workspaces/library\";\n\n/**\n * Create a fully-configured AssetKindRegistry with all known providers.\n *\n * Registers:\n * - 9 core kinds (skill, agent, connector, mount, mcp-server, contract, prompt, persona, ruleset)\n * - preset (composition entity)\n * - flow (extension, from @skaile/workspaces/base-assets/connectors/flow/engine)\n * - knowledge (extension, from @skaile/library)\n *\n * @returns An unfrozen registry (auto-freezes on first read)\n */\nexport function createFullRegistry(): AssetKindRegistry {\n const registry = createDefaultRegistry();\n registry.register(flowKindProvider);\n registry.register(knowledgeKindProvider);\n return registry;\n}\n","/**\n * open-library.ts — shared helpers to open the LocalIndex and the configured\n * Catalog source.\n *\n * Lazy-loads the `@skaile/workspaces/library` subpath and returns the\n * LocalIndex instance (backed by `@libsql/client`; runs on Node and Bun).\n * The catalog-source helper reads\n * `~/.skaile/config.yaml` (and project-level overlay if `projectDir` is given)\n * to decide between {@link RemoteCatalogSource} (default — points at\n * `https://skaile.store`) and a {@link LocalCatalogSource} bound to the most\n * recent local library registered via `skaile source add`.\n */\n\nimport { logErr } from \"./helpers.ts\";\nimport { createFullRegistry } from \"./open-registry.ts\";\n\n/**\n * Open the LocalIndex with the full kind registry. Exits with code 1\n * if the library directory cannot be created.\n *\n * @returns A `LocalIndex` instance ready for use.\n * @docLink cli/dev-guide#open-library\n */\nexport async function openLibrary() {\n try {\n const { LocalIndex } = await import(\"@skaile/workspaces/library\");\n return new LocalIndex({ kindRegistry: createFullRegistry() });\n } catch (err) {\n logErr(`Could not open LocalIndex: ${err instanceof Error ? err.message : String(err)}`);\n process.exit(1);\n }\n}\n\n/**\n * Resolve the configured **remote** Catalog source for the CLI.\n *\n * Reads `~/.skaile/config.yaml` (plus the optional project-level overlay) and\n * returns a {@link RemoteCatalogSource} pointing at `catalog.url` (default:\n * `https://skaile.store`). The `cache_ttl: 0` config flag flips the source\n * into air-gapped mode: network reads are disabled, only `skaile update`\n * performs refreshes.\n *\n * **Local-mode rejection.** If the resolved config has `catalog.url: local`\n * this helper throws — callers wanting the dispatched local-or-remote source\n * must use {@link resolveCatalogSource}. Remote-only consumers like\n * `skaile update --catalog-only` rely on this strict behaviour.\n *\n * @param opts - Project directory (overlays project config) and explicit overrides.\n * @returns A configured {@link RemoteCatalogSource}.\n * @throws When `catalog.url` is the `local` sentinel.\n * @docLink cli/dev-guide#open-library\n */\nexport async function openCatalogSource(opts?: {\n projectDir?: string;\n baseUrlOverride?: string;\n /** Override the user-config path for tests. */\n userConfigFile?: string;\n}): Promise<\n | import(\"@skaile/workspaces/library\").RemoteCatalogSource\n | import(\"@skaile/workspaces/library\").RestCatalogSource\n> {\n const { resolveConfig, RemoteCatalogSource, RestCatalogSource, isLocalCatalogUrl } = await import(\n \"@skaile/workspaces/library\"\n );\n const cfg = resolveConfig({\n projectDir: opts?.projectDir,\n userConfigFile: opts?.userConfigFile,\n });\n const baseUrl = opts?.baseUrlOverride ?? cfg.catalog.url;\n if (isLocalCatalogUrl(baseUrl)) {\n throw new Error(\n \"catalog.url is set to 'local' — remote catalog is disabled. \" +\n \"Use `skaile source add <path>` + `skaile source sync` for local sources, \" +\n \"or set `catalog.url: https://skaile.store` in ~/.skaile/config.yaml.\",\n );\n }\n const cacheTtlMs = cfg.catalog.cache_ttl * 1000;\n if (cfg.catalog.framing === \"rest\") {\n return new RestCatalogSource({ baseUrl, cacheTtlMs });\n }\n return new RemoteCatalogSource({ baseUrl, cacheTtlMs });\n}\n\n/**\n * Resolved catalog source plus a close handle for releasing any underlying\n * resources (e.g. the `LocalIndex` SQLite connection in local mode).\n *\n * Callers MUST invoke `close()` when done — typically in a `finally` block.\n * For remote-mode sources `close()` is a no-op, but the contract is uniform\n * so consumers don't have to branch.\n *\n * @docLink cli/dev-guide#open-library\n */\nexport interface ResolvedCatalogSource {\n /** The {@link ICatalogSource} ready for use. */\n source: import(\"@skaile/workspaces/library\").ICatalogSource;\n /** Release any underlying resources (SQLite handle in local mode). */\n close(): void;\n}\n\n/**\n * Resolve the configured Catalog source — local or remote — based on\n * `~/.skaile/config.yaml`.\n *\n * Dispatch:\n * - `catalog.url: local` → opens {@link LocalIndex}, picks the most recently\n * registered local library whose `path` still exists on disk, and returns a\n * {@link LocalCatalogSource} bound to that library. Throws if no usable\n * local library is registered.\n * - any URL → returns {@link RemoteCatalogSource} (same as\n * {@link openCatalogSource}).\n *\n * The returned `close()` releases the underlying `LocalIndex` SQLite handle\n * in local mode (no-op in remote mode). Callers MUST invoke it — typically in\n * a `finally` block — to satisfy `library/CLAUDE.md` § \"Notes for Consumers\".\n *\n * @param opts - Project directory (overlays project config) and explicit overrides.\n * @returns A `ResolvedCatalogSource` carrying the source and a close handle.\n * @throws When `local` is configured but no usable local library is registered.\n * @docLink cli/dev-guide#open-library\n */\nexport async function resolveCatalogSource(opts?: {\n projectDir?: string;\n baseUrlOverride?: string;\n /** Override the user-config path for tests. */\n userConfigFile?: string;\n}): Promise<ResolvedCatalogSource> {\n const {\n resolveConfig,\n RemoteCatalogSource,\n RestCatalogSource,\n LocalCatalogSource,\n isLocalCatalogUrl,\n } = await import(\"@skaile/workspaces/library\");\n const cfg = resolveConfig({\n projectDir: opts?.projectDir,\n userConfigFile: opts?.userConfigFile,\n });\n const baseUrl = opts?.baseUrlOverride ?? cfg.catalog.url;\n\n if (isLocalCatalogUrl(baseUrl)) {\n const fs = await import(\"node:fs\");\n const library = await openLibrary();\n try {\n const sources = await library.listSources();\n type LibraryRow = (typeof sources)[number];\n // Type-narrow: `path` is required for local libraries after the filter.\n const usable = sources\n .filter(\n (s): s is LibraryRow & { path: string } =>\n s.backend === \"local\" && typeof s.path === \"string\" && s.path.length > 0,\n )\n .sort((a, b) => b.createdAt.getTime() - a.createdAt.getTime());\n\n if (usable.length === 0) {\n throw new Error(\n \"catalog.url is set to 'local' but no local library is registered. \" +\n \"Run `skaile source add <path>` first, then `skaile source sync`.\",\n );\n }\n\n // Prefer the most recently added library whose path still exists.\n const present = usable.find((s) => fs.existsSync(s.path));\n if (!present) {\n const head = usable[0];\n throw new Error(\n `catalog.url is set to 'local' but every registered local library has a missing path on disk. ` +\n `Most recent: ${head.path} (library ${head.id}). ` +\n `Re-register with \\`skaile source add <existing-path>\\` or run \\`skaile source list\\` to inspect.`,\n );\n }\n\n const source = new LocalCatalogSource(\n library,\n present.id,\n present.path,\n createFullRegistry(),\n );\n return { source, close: () => library.close() };\n } catch (err) {\n // Release the handle on any failure during dispatch — otherwise the\n // SQLite WAL state leaks for the lifetime of the process.\n library.close();\n throw err;\n }\n }\n\n const cacheTtlMs = cfg.catalog.cache_ttl * 1000;\n const source =\n cfg.catalog.framing === \"rest\"\n ? new RestCatalogSource({ baseUrl, cacheTtlMs })\n : new RemoteCatalogSource({ baseUrl, cacheTtlMs });\n return { source, close: () => {} };\n}\n\n/**\n * Open the LibraryManager bound to the active LocalIndex.\n * Caller owns lifetime — must call `close()` (returned helper closes the\n * underlying LocalIndex).\n *\n * @docLink cli/dev-guide#open-library\n */\nexport async function openLibraryManager(): Promise<{\n manager: import(\"@skaile/workspaces/library\").LibraryManager;\n library: import(\"@skaile/workspaces/library\").LocalIndex;\n close: () => void;\n}> {\n const { LibraryManager } = await import(\"@skaile/workspaces/library\");\n const library = await openLibrary();\n const manager = new LibraryManager(library);\n return { manager, library, close: () => library.close() };\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { parseDep } from './chunk-X5Y4EGZB.js';
1
+ import { parseDep } from './chunk-I3UEM3FX.js';
2
2
  import { readFileSync, readdirSync, statSync } from 'fs';
3
3
  import { basename, dirname, join, relative } from 'path';
4
4
  import { parse } from 'yaml';
@@ -35,7 +35,7 @@ function fromSkillMd(filePath, repoName) {
35
35
  kind,
36
36
  description: String(meta.description ?? ""),
37
37
  source: filePath,
38
- repository: repoName,
38
+ publisher: repoName,
39
39
  version: extractVersion(meta),
40
40
  requires: parseRequires(meta),
41
41
  dependencies: []
@@ -48,7 +48,7 @@ function fromAgentMd(filePath, repoName) {
48
48
  kind: "agent",
49
49
  description: String(meta.description ?? ""),
50
50
  source: filePath,
51
- repository: repoName,
51
+ publisher: repoName,
52
52
  version: extractVersion(meta),
53
53
  requires: parseRequires(meta),
54
54
  dependencies: []
@@ -125,7 +125,7 @@ function fromAgentYaml(filePath, repoName) {
125
125
  kind: "agent",
126
126
  description: String(meta.description ?? ""),
127
127
  source: filePath,
128
- repository: repoName,
128
+ publisher: repoName,
129
129
  version: String(meta.version ?? ""),
130
130
  requires,
131
131
  dependencies: []
@@ -139,7 +139,7 @@ function fromPromptMd(filePath, repoName) {
139
139
  kind: "prompt",
140
140
  description: String(meta.description ?? ""),
141
141
  source: filePath,
142
- repository: repoName,
142
+ publisher: repoName,
143
143
  version: extractVersion(meta),
144
144
  requires: parseRequires(meta),
145
145
  dependencies: []
@@ -157,7 +157,7 @@ function fromFlowYaml(filePath, repoName) {
157
157
  kind: "flow",
158
158
  description: String(meta.description ?? ""),
159
159
  source: filePath,
160
- repository: repoName,
160
+ publisher: repoName,
161
161
  version: String(meta.version ?? ""),
162
162
  requires: parseRequires(meta),
163
163
  dependencies: []
@@ -177,7 +177,7 @@ function fromBundleYaml(filePath, repoName) {
177
177
  kind: "bundle",
178
178
  description: String(meta.description ?? ""),
179
179
  source: filePath,
180
- repository: repoName,
180
+ publisher: repoName,
181
181
  version: String(meta.version ?? ""),
182
182
  requires: parseRequires(meta),
183
183
  dependencies
@@ -190,7 +190,7 @@ function fromContractMd(filePath, repoName) {
190
190
  kind: "contract",
191
191
  description: String(meta.description ?? ""),
192
192
  source: filePath,
193
- repository: repoName,
193
+ publisher: repoName,
194
194
  version: extractVersion(meta),
195
195
  requires: parseRequires(meta),
196
196
  dependencies: []
@@ -217,7 +217,7 @@ function fromMcpServerMd(filePath, repoName) {
217
217
  kind: "mcp-server",
218
218
  description: String(meta.description ?? ""),
219
219
  source: filePath,
220
- repository: repoName,
220
+ publisher: repoName,
221
221
  version: extractVersion(meta),
222
222
  requires: parseRequires(meta),
223
223
  dependencies: [],
@@ -235,7 +235,7 @@ function fromKnowledgeYaml(filePath, repoName) {
235
235
  kind: "knowledge",
236
236
  description: String(meta.description ?? ""),
237
237
  source: filePath,
238
- repository: repoName,
238
+ publisher: repoName,
239
239
  version: String(meta.version ?? ""),
240
240
  requires: parseRequires(meta),
241
241
  dependencies: []
@@ -250,7 +250,7 @@ function fromConnectorMd(filePath, repoName) {
250
250
  kind: "connector",
251
251
  description: String(meta.description ?? ""),
252
252
  source: filePath,
253
- repository: repoName,
253
+ publisher: repoName,
254
254
  version: extractVersion(meta),
255
255
  requires: parseRequires(meta),
256
256
  dependencies: [],
@@ -351,5 +351,5 @@ function scanDirectory(root, repoName) {
351
351
  }
352
352
 
353
353
  export { fromAgentMd, fromAgentYaml, fromBundleYaml, fromConnectorMd, fromContractMd, fromFlowYaml, fromKnowledgeYaml, fromMcpServerMd, fromPromptMd, fromSkillMd, parseFrontmatter, parseRequires, scanDirectory, walkDir };
354
- //# sourceMappingURL=chunk-WIR34WMU.js.map
355
- //# sourceMappingURL=chunk-WIR34WMU.js.map
354
+ //# sourceMappingURL=chunk-4AZKT2BU.js.map
355
+ //# sourceMappingURL=chunk-4AZKT2BU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../core/src/manifest.ts"],"names":[],"mappings":";;;;;AAkCO,SAAS,iBAAiB,IAAA,EAAiC;AAChE,EAAA,MAAM,CAAA,GAAI,IAAA,CAAK,KAAA,CAAM,0BAA0B,CAAA;AAC/C,EAAA,IAA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G,YAAA,CAAa,UAAU,QAAQ,CAAA,EAAG,QAAQ,CAAA;AAAA,IACvD,CAAA,CAAA,MAAQ;AAAA,IAAC;AAAA,EACX;AAEA,EAAA,OAAO,CAAC,GAAG,OAAA,CAAQ,MAAA,EAAQ,CAAA;AAC7B","file":"chunk-4AZKT2BU.js","sourcesContent":["/**\n * Manifest parsing — reads SKILL.md, AGENT.md, agent.yaml, CONTRACT.md,\n * CONNECTOR.md, *.prompt.md, *.flow.yaml, *.bundle.yaml files and\n * produces CatalogEntry objects.\n * Used by @skaile/asset-manager for on-demand repo scanning.\n */\n\nimport { readdirSync, readFileSync, statSync } from \"node:fs\";\nimport { basename, dirname, join, relative } from \"node:path\";\nimport { parse } from \"yaml\";\nimport type { AssetKind, CatalogEntry, Dependency } from \"./models.js\";\nimport { parseDep } from \"./models.js\";\n\n// ── Frontmatter helpers ───────────────────────────────────────────────────────\n\n/**\n * Result of parsing YAML frontmatter from a markdown file.\n * @docLink packages/core/concepts#frontmatter-result\n */\nexport interface FrontmatterResult {\n /** Parsed YAML data. Empty object if no frontmatter block is present. */\n data: Record<string, unknown>;\n /** Markdown body below the frontmatter block (trimmed). */\n body: string;\n}\n\n/**\n * Parse YAML frontmatter from a markdown file (`---` delimited).\n * Returns `{ data: {}, body: text }` when no frontmatter block is present.\n *\n * @param text - Raw file contents\n * @returns Parsed frontmatter data and the remaining body text\n * @docLink packages/core/concepts#parse-frontmatter\n */\nexport function parseFrontmatter(text: string): FrontmatterResult {\n const m = text.match(/^---\\s*\\n([\\s\\S]*?)\\n---/);\n if (!m) return { data: {}, body: text.trim() };\n try {\n const data = (parse(m[1]!) as Record<string, unknown>) ?? {};\n const body = text.slice(m[0].length).trim();\n return { data, body };\n } catch {\n return { data: {}, body: text.trim() };\n }\n}\n\n/** Extract version from frontmatter, checking both top-level and metadata.version. */\nfunction extractVersion(meta: Record<string, unknown>): string {\n return String(\n meta.version ?? (meta.metadata as Record<string, unknown> | undefined)?.version ?? \"\",\n );\n}\n\n/**\n * Parse the `requires:` field from manifest frontmatter into typed `Dependency` objects.\n * Accepts a comma-separated string or an array of `\"kind:name\"` strings. Reads from either\n * the root or `metadata.requires` (matching `extractVersion`'s dual-location behavior) so\n * skill authors can follow the agentskills.io convention of placing skaile extensions under\n * `metadata:` while remaining backward-compatible with root-level declarations.\n *\n * @param meta - Parsed frontmatter data object\n * @returns Array of `Dependency` objects (empty when `requires` is absent)\n * @docLink packages/core/concepts#parse-requires\n */\nexport function parseRequires(meta: Record<string, unknown>): Dependency[] {\n const raw = meta.requires ?? (meta.metadata as Record<string, unknown> | undefined)?.requires;\n if (!raw) return [];\n const list =\n typeof raw === \"string\"\n ? raw.split(\",\").map((s) => s.trim())\n : Array.isArray(raw)\n ? (raw as string[])\n : [];\n return list.filter(Boolean).map(parseDep);\n}\n\n// ── Manifest parsers ──────────────────────────────────────────────────────────\n\n/**\n * Parse a `SKILL.md` file into a `CatalogEntry`.\n * The `kind` field defaults to `\"skill\"` but can be overridden to `\"agent\"` or `\"prompt\"`\n * via the `type:` frontmatter key. Falls back to the parent directory name when `name:` is absent.\n *\n * @param filePath - Absolute path to the `SKILL.md` file\n * @param repoName - Repository name used as the `repository` field of the entry\n * @returns Populated `CatalogEntry` with kind, name, description, version, and requires\n * @docLink packages/core/concepts#from-skill-md\n */\nexport function fromSkillMd(filePath: string, repoName: string): CatalogEntry {\n const { data: meta } = parseFrontmatter(readFileSync(filePath, \"utf8\"));\n let kind = String(meta.type ?? \"skill\") as AssetKind;\n if (![\"skill\", \"agent\", \"prompt\", \"persona\", \"ruleset\", \"knowledge\"].includes(kind))\n kind = \"skill\";\n return {\n name: String(meta.name ?? basename(dirname(filePath))),\n kind,\n description: String(meta.description ?? \"\"),\n source: filePath,\n publisher: repoName,\n version: extractVersion(meta),\n requires: parseRequires(meta),\n dependencies: [],\n };\n}\n\n/**\n * Parse an `AGENT.md` file into a `CatalogEntry` with `kind: \"agent\"`.\n * Falls back to the parent directory name when `name:` is absent.\n *\n * @param filePath - Absolute path to the `AGENT.md` file\n * @param repoName - Repository name used as the `repository` field of the entry\n * @returns Populated `CatalogEntry` with kind `\"agent\"`\n * @docLink packages/core/concepts#from-agent-md\n */\nexport function fromAgentMd(filePath: string, repoName: string): CatalogEntry {\n const { data: meta } = parseFrontmatter(readFileSync(filePath, \"utf8\"));\n return {\n name: String(meta.name ?? basename(dirname(filePath))),\n kind: \"agent\",\n description: String(meta.description ?? \"\"),\n source: filePath,\n publisher: repoName,\n version: extractVersion(meta),\n requires: parseRequires(meta),\n dependencies: [],\n };\n}\n\n/**\n * Parse an `agent.yaml` file into a `CatalogEntry` with `kind: \"agent\"`.\n * Collects sub-agent dependencies from `requires[]` (new format) and `dependencies[]`\n * (legacy format), skill abilities from `abilities[]`, and contracts from `contracts[]`.\n *\n * @param filePath - Absolute path to the `agent.yaml` file\n * @param repoName - Repository name used as the `repository` field of the entry\n * @returns Populated `CatalogEntry` with kind `\"agent\"` and full dependency graph\n * @docLink packages/core/concepts#from-agent-yaml\n */\nexport function fromAgentYaml(filePath: string, repoName: string): CatalogEntry {\n let meta: Record<string, unknown> = {};\n try {\n meta = (parse(readFileSync(filePath, \"utf8\")) as Record<string, unknown>) ?? {};\n } catch {}\n\n const requires: Dependency[] = [];\n\n // Sub-agent dependencies from requires[] (new format: {name, source, ...})\n const agentRequires = meta.requires;\n if (Array.isArray(agentRequires)) {\n for (const d of agentRequires) {\n if (typeof d === \"object\" && d !== null && \"name\" in d) {\n requires.push({\n kind: \"agent\",\n name: String((d as Record<string, unknown>).name),\n });\n }\n }\n }\n\n // Legacy sub-agent dependencies from dependencies[] (old format: {name, ...})\n const deps = meta.dependencies;\n if (Array.isArray(deps)) {\n for (const d of deps) {\n if (typeof d === \"object\" && d !== null && \"name\" in d) {\n requires.push({\n kind: \"agent\",\n name: String((d as Record<string, unknown>).name),\n });\n }\n }\n }\n\n // Skill abilities referenced in the system prompt\n const abilities = meta.abilities;\n if (Array.isArray(abilities)) {\n for (const a of abilities) {\n if (typeof a === \"string\" && a) {\n requires.push({ kind: \"skill\", name: a });\n }\n }\n }\n\n // Contracts referenced in the system prompt (co-located in skills dir)\n const contracts = meta.contracts;\n if (Array.isArray(contracts)) {\n for (const c of contracts) {\n if (typeof c === \"string\" && c) {\n requires.push({ kind: \"contract\", name: c });\n }\n }\n }\n\n // Mixin composition fields — track catalog refs as requires so `skaile install`\n // automatically pulls them. Local paths (. or /) are skipped — not catalog assets.\n for (const [field, defaultKind] of [\n [\"persona\", \"persona\"],\n [\"rules\", \"ruleset\"],\n [\"knowledge\", \"knowledge\"],\n ] as const) {\n const refs = meta[field];\n if (!Array.isArray(refs)) continue;\n for (const r of refs) {\n if (typeof r !== \"string\" || !r) continue;\n if (r.startsWith(\".\") || r.startsWith(\"/\")) continue; // local path — skip\n // Normalize: if no kind: prefix, inject the default kind\n const normalized = r.includes(\":\") ? r : `${defaultKind}:${r}`;\n // Strip @repo and #pin — only kind:name matters for requires\n const colonIdx = normalized.indexOf(\":\");\n const kind = normalized.slice(0, colonIdx).trim();\n let name = normalized.slice(colonIdx + 1).trim();\n const atIdx = name.indexOf(\"@\");\n if (atIdx !== -1) name = name.slice(0, atIdx).trim();\n const hashIdx = name.indexOf(\"#\");\n if (hashIdx !== -1) name = name.slice(0, hashIdx).trim();\n if (name) requires.push({ kind, name });\n }\n }\n\n return {\n name: String(meta.name ?? basename(dirname(filePath))),\n kind: \"agent\",\n description: String(meta.description ?? \"\"),\n source: filePath,\n publisher: repoName,\n version: String(meta.version ?? \"\"),\n requires,\n dependencies: [],\n };\n}\n\n/**\n * Parse a `*.prompt.md` file into a `CatalogEntry` with `kind: \"prompt\"`.\n * The name defaults to the filename stem (without the `.prompt.md` suffix)\n * when no `name:` frontmatter key is present.\n *\n * @param filePath - Absolute path to the `.prompt.md` file\n * @param repoName - Repository name used as the `repository` field of the entry\n * @returns Populated `CatalogEntry` with kind `\"prompt\"`\n * @docLink packages/core/concepts#from-prompt-md\n */\nexport function fromPromptMd(filePath: string, repoName: string): CatalogEntry {\n const { data: meta } = parseFrontmatter(readFileSync(filePath, \"utf8\"));\n const name = String(meta.name ?? basename(filePath).replace(/\\.prompt\\.md$/, \"\"));\n return {\n name,\n kind: \"prompt\",\n description: String(meta.description ?? \"\"),\n source: filePath,\n publisher: repoName,\n version: extractVersion(meta),\n requires: parseRequires(meta),\n dependencies: [],\n };\n}\n\n/**\n * Parse a `*.flow.yaml` or `*.flow.json` file into a `CatalogEntry` with `kind: \"flow\"`.\n * The name resolves from `name:` or `id:` frontmatter, falling back to the filename stem.\n *\n * @param filePath - Absolute path to the flow definition file\n * @param repoName - Repository name used as the `repository` field of the entry\n * @returns Populated `CatalogEntry` with kind `\"flow\"`\n * @docLink packages/core/concepts#from-flow-yaml\n */\nexport function fromFlowYaml(filePath: string, repoName: string): CatalogEntry {\n let meta: Record<string, unknown> = {};\n try {\n meta = (parse(readFileSync(filePath, \"utf8\")) as Record<string, unknown>) ?? {};\n } catch {}\n\n const stem = basename(filePath)\n .replace(/\\.flow\\.yaml$/, \"\")\n .replace(/\\.flow\\.json$/, \"\");\n return {\n name: String(meta.name ?? meta.id ?? stem),\n kind: \"flow\",\n description: String(meta.description ?? \"\"),\n source: filePath,\n publisher: repoName,\n version: String(meta.version ?? \"\"),\n requires: parseRequires(meta),\n dependencies: [],\n };\n}\n\n/**\n * Parse a `*.bundle.yaml` file into a `CatalogEntry` with `kind: \"bundle\"`.\n * Bundles declare a flat list of string `dependencies` (asset refs) rather than\n * typed `Dependency` objects; both `requires` and `dependencies` are populated.\n *\n * @param filePath - Absolute path to the bundle YAML file\n * @param repoName - Repository name used as the `repository` field of the entry\n * @returns Populated `CatalogEntry` with kind `\"bundle\"`\n * @docLink packages/core/concepts#from-bundle-yaml\n */\nexport function fromBundleYaml(filePath: string, repoName: string): CatalogEntry {\n let meta: Record<string, unknown> = {};\n try {\n meta = (parse(readFileSync(filePath, \"utf8\")) as Record<string, unknown>) ?? {};\n } catch {}\n\n const name = String(meta.name ?? basename(filePath).replace(/\\.bundle\\.yaml$/, \"\"));\n\n const deps = meta.dependencies;\n const dependencies = Array.isArray(deps) ? (deps as string[]).filter(Boolean) : [];\n\n return {\n name,\n kind: \"bundle\",\n description: String(meta.description ?? \"\"),\n source: filePath,\n publisher: repoName,\n version: String(meta.version ?? \"\"),\n requires: parseRequires(meta),\n dependencies,\n };\n}\n\n/**\n * Parse a `CONTRACT.md` file into a `CatalogEntry` with `kind: \"contract\"`.\n * Falls back to the parent directory name when `name:` is absent.\n *\n * @param filePath - Absolute path to the `CONTRACT.md` file\n * @param repoName - Repository name used as the `repository` field of the entry\n * @returns Populated `CatalogEntry` with kind `\"contract\"`\n * @docLink packages/core/concepts#from-contract-md\n */\nexport function fromContractMd(filePath: string, repoName: string): CatalogEntry {\n const { data: meta } = parseFrontmatter(readFileSync(filePath, \"utf8\"));\n return {\n name: String(meta.name ?? basename(dirname(filePath))),\n kind: \"contract\",\n description: String(meta.description ?? \"\"),\n source: filePath,\n publisher: repoName,\n version: extractVersion(meta),\n requires: parseRequires(meta),\n dependencies: [],\n };\n}\n\n/**\n * Parse an `MCP.md` file into a `CatalogEntry` with `kind: \"mcp-server\"`.\n * Falls back to the parent directory name when `name:` is absent.\n *\n * Frontmatter fields (catalog identity):\n * - `name` — server name (default: parent dir name)\n * - `description` — short description\n * - `version` — semver\n * - `keywords` — array of discovery tags\n *\n * Frontmatter fields (runtime defaults, stored in `metadata`):\n * - `transport` — \"stdio\" | \"sse\" | \"http\" (default: \"stdio\")\n * - `command` — command to execute (stdio)\n * - `args` — command arguments (stdio)\n * - `env` — environment variables (stdio)\n * - `url` — server URL (sse/http)\n * - `headers` — HTTP headers (sse/http)\n *\n * When `mcp:name` appears in `skaile.yaml` `dependencies`, the runner reads\n * these defaults from `metadata` to build a `McpServerDeclaration` without\n * requiring verbose inline config.\n *\n * @param filePath - Absolute path to the `MCP.md` file\n * @param repoName - Repository name used as the `repository` field of the entry\n * @returns Populated `CatalogEntry` with kind `\"mcp-server\"`\n * @docLink packages/core/concepts#from-mcp-server-md\n */\nexport function fromMcpServerMd(filePath: string, repoName: string): CatalogEntry {\n const { data: meta } = parseFrontmatter(readFileSync(filePath, \"utf8\"));\n\n // Extract runtime defaults into metadata\n const metadata: Record<string, unknown> = {};\n if (meta.transport) metadata.transport = String(meta.transport);\n if (meta.command) metadata.command = String(meta.command);\n if (Array.isArray(meta.args)) metadata.args = meta.args.map(String);\n if (meta.env && typeof meta.env === \"object\" && !Array.isArray(meta.env)) {\n metadata.env = meta.env as Record<string, string>;\n }\n if (meta.url) metadata.url = String(meta.url);\n if (meta.headers && typeof meta.headers === \"object\" && !Array.isArray(meta.headers)) {\n metadata.headers = meta.headers as Record<string, string>;\n }\n if (meta.recipe && typeof meta.recipe === \"object\" && !Array.isArray(meta.recipe)) {\n metadata.recipe = meta.recipe;\n }\n\n return {\n name: String(meta.name ?? basename(dirname(filePath))),\n kind: \"mcp-server\",\n description: String(meta.description ?? \"\"),\n source: filePath,\n publisher: repoName,\n version: extractVersion(meta),\n requires: parseRequires(meta),\n dependencies: [],\n metadata: Object.keys(metadata).length > 0 ? metadata : undefined,\n };\n}\n\n/**\n * Parse a `knowledge.yaml` file into a `CatalogEntry` with `kind: \"knowledge\"`.\n * Falls back to the parent directory name when `name:` is absent.\n *\n * @param filePath - Absolute path to the `knowledge.yaml` file\n * @param repoName - Repository name used as the `repository` field of the entry\n * @returns Populated `CatalogEntry` with kind `\"knowledge\"`\n * @docLink packages/core/concepts#from-knowledge-yaml\n */\nexport function fromKnowledgeYaml(filePath: string, repoName: string): CatalogEntry {\n let meta: Record<string, unknown> = {};\n try {\n meta = (parse(readFileSync(filePath, \"utf8\")) as Record<string, unknown>) ?? {};\n } catch {}\n return {\n name: String(meta.name ?? basename(dirname(filePath))),\n kind: \"knowledge\",\n description: String(meta.description ?? \"\"),\n source: filePath,\n publisher: repoName,\n version: String(meta.version ?? \"\"),\n requires: parseRequires(meta),\n dependencies: [],\n };\n}\n\n/**\n * Parse a `CONNECTOR.md` file into a `CatalogEntry` with `kind: \"connector\"`.\n * Falls back to the parent directory name when `name:` is absent.\n *\n * Frontmatter fields (catalog identity):\n * - `name` — connector name (default: parent dir name)\n * - `description` — short description\n * - `version` — semver\n *\n * Frontmatter fields (runtime defaults, stored in `metadata`):\n * - `entry` — adapter entry point (default: \"./adapter.ts\")\n * - `npm_deps` — npm dependencies required by the adapter\n * - `fields` — configuration fields the adapter expects\n * - `health_check` — whether to run a health check on connect\n *\n * The markdown body (below the frontmatter) is stored in `metadata.body`\n * so the runner can inject the connector's skill description into the\n * system prompt when `expose_as_skill` is enabled.\n *\n * @param filePath - Absolute path to the `CONNECTOR.md` file\n * @param repoName - Repository name used as the `repository` field of the entry\n * @returns Populated `CatalogEntry` with kind `\"connector\"`\n * @docLink packages/core/concepts#from-connector-md\n */\nexport function fromConnectorMd(filePath: string, repoName: string): CatalogEntry {\n const text = readFileSync(filePath, \"utf-8\");\n const { data: meta, body } = parseFrontmatter(text);\n const name = String(meta.name ?? basename(dirname(filePath)));\n return {\n name,\n kind: \"connector\" as AssetKind,\n description: String(meta.description ?? \"\"),\n source: filePath,\n publisher: repoName,\n version: extractVersion(meta),\n requires: parseRequires(meta),\n dependencies: [],\n metadata: {\n entry: meta.entry ?? \"./adapter.ts\",\n npm_deps: meta.npm_deps ?? {},\n fields: meta.fields ?? [],\n health_check: meta.health_check ?? null,\n body,\n },\n };\n}\n\n// ── Recursive walker ──────────────────────────────────────────────────────────\n\ninterface WalkEntry {\n path: string;\n name: string;\n}\n\n/**\n * Recursively yield every file entry under `dir`, sorted alphabetically at each level.\n * Skips `.git` and `node_modules` directories and follows symlinks (resolving to\n * the stat target). `node_modules` is excluded because Bun's `node_modules/.bun/...`\n * layout contains symlink farms that form cycles when packages reference each other\n * transitively — entering them causes unbounded recursion in this walker.\n *\n * @param dir - Absolute path to the directory to walk\n * @docLink packages/core/concepts#walk-dir\n */\nexport function* walkDir(dir: string): Generator<WalkEntry> {\n let dirEntries: import(\"node:fs\").Dirent<string>[];\n try {\n dirEntries = readdirSync(dir, { withFileTypes: true, encoding: \"utf8\" });\n } catch {\n return;\n }\n for (const e of dirEntries.sort((a, b) => (a.name < b.name ? -1 : 1))) {\n const full = join(dir, e.name);\n if (e.isSymbolicLink()) {\n try {\n if (statSync(full).isDirectory()) yield* walkDir(full);\n else yield { path: full, name: e.name };\n } catch {}\n } else if (e.isDirectory()) {\n if (e.name !== \".git\" && e.name !== \"node_modules\") yield* walkDir(full);\n } else if (e.isFile()) {\n yield { path: full, name: e.name };\n }\n }\n}\n\n// ── Public scanner ────────────────────────────────────────────────────────────\n\n/**\n * Directory names that hold assets of a given kind. The parent of one of these\n * is the asset's domain — the folder that groups skills/flows/agents/... that\n * belong together.\n */\nconst KIND_DIRS = new Set([\n \"skills\",\n \"agents\",\n \"agent\",\n \"flows\",\n \"connectors\",\n \"prompts\",\n \"bundles\",\n \"contracts\",\n \"knowledge\",\n \"mcp-servers\",\n \"mcp\",\n \"profiles\",\n]);\n\n/**\n * Manifest filenames that live INSIDE a folder named after the asset itself\n * (`<domain.../>/<asset-name>/SKILL.md`). For these, the asset's parent path\n * is two segments above the file.\n *\n * Bare-file manifests (`*.prompt.md`, `*.bundle.yaml`, `*.flow.yaml`,\n * `*.flow.json`) sit directly under the domain folder, so their parent path\n * is one segment above the file.\n */\nconst FOLDER_MANIFESTS = new Set([\n \"SKILL.md\",\n \"AGENT.md\",\n \"agent.yaml\",\n \"CONTRACT.md\",\n \"MCP.md\",\n \"CONNECTOR.md\",\n \"knowledge.yaml\",\n]);\n\n/**\n * Derive the domain for an asset.\n *\n * 1. If any segment in the path matches a known kind directory (`skills/`,\n * `flows/`, ...), return the **full path** from root to that kind dir's\n * parent (e.g. `skaileup/impl-quality/contracts/x/CONTRACT.md` →\n * `\"skaileup/impl-quality\"`). Returning only the immediate parent would\n * break hierarchy when the layout nests `<wrapper>/<domain>/<kind>/...`.\n * 2. Otherwise return the full path from root to the asset's parent folder,\n * `/`-joined. The number of segments stripped depends on whether the\n * manifest is folder-style (strip file + asset folder) or bare-file\n * (strip just the file).\n */\nfunction deriveDomain(root: string, filePath: string): string {\n const segs = relative(root, filePath).split(\"/\");\n for (let i = 1; i < segs.length; i++) {\n if (KIND_DIRS.has(segs[i]!)) return segs.slice(0, i).join(\"/\");\n }\n const fileName = segs[segs.length - 1] ?? \"\";\n const stripCount = FOLDER_MANIFESTS.has(fileName) ? 2 : 1;\n if (segs.length > stripCount) return segs.slice(0, segs.length - stripCount).join(\"/\");\n return \"\";\n}\n\n/**\n * Walk `root` recursively and return a `CatalogEntry` for every recognized asset manifest found.\n *\n * Recognized filenames: `SKILL.md`, `AGENT.md`, `agent.yaml`, `CONTRACT.md`, `MCP.md`,\n * `CONNECTOR.md`, `*.prompt.md`, `*.bundle.yaml`, `*.flow.yaml`, `*.flow.json`.\n *\n * When two entries share the same `kind:name` key, the one with the alphabetically\n * later source path wins (consistent with catalog precedence rules).\n *\n * @param root - Absolute path to the directory tree to scan\n * @param repoName - Repository name attached to every produced entry\n * @returns Array of deduplicated `CatalogEntry` objects, one per manifest file\n * @docLink packages/core/concepts#scan-directory\n */\nexport function scanDirectory(root: string, repoName: string): CatalogEntry[] {\n const entries = new Map<string, CatalogEntry>();\n\n function add(e: CatalogEntry): void {\n const key = `${e.kind}:${e.name}`;\n const existing = entries.get(key);\n if (!existing) {\n entries.set(key, e);\n return;\n }\n // Among duplicates, alphabetically later source path wins\n if (e.source > existing.source) entries.set(key, e);\n }\n\n for (const { path: filePath, name } of walkDir(root)) {\n const domain = deriveDomain(root, filePath);\n try {\n if (name === \"SKILL.md\") add({ ...fromSkillMd(filePath, repoName), domain });\n else if (name === \"AGENT.md\") add({ ...fromAgentMd(filePath, repoName), domain });\n else if (name === \"agent.yaml\") add({ ...fromAgentYaml(filePath, repoName), domain });\n else if (name === \"CONTRACT.md\") add({ ...fromContractMd(filePath, repoName), domain });\n else if (name === \"MCP.md\") add({ ...fromMcpServerMd(filePath, repoName), domain });\n else if (name === \"CONNECTOR.md\") add({ ...fromConnectorMd(filePath, repoName), domain });\n else if (name === \"knowledge.yaml\") add({ ...fromKnowledgeYaml(filePath, repoName), domain });\n else if (name.endsWith(\".prompt.md\")) add({ ...fromPromptMd(filePath, repoName), domain });\n else if (name.endsWith(\".bundle.yaml\"))\n add({ ...fromBundleYaml(filePath, repoName), domain });\n else if (name.endsWith(\".flow.yaml\") || name.endsWith(\".flow.json\"))\n add({ ...fromFlowYaml(filePath, repoName), domain });\n } catch {}\n }\n\n return [...entries.values()];\n}\n"]}
@@ -1,3 +1,5 @@
1
+ import * as z from 'zod';
2
+
1
3
  // plugin-registry/src/errors.ts
2
4
  var RegistrationError = class extends Error {
3
5
  constructor(kind, id) {
@@ -47,6 +49,9 @@ var MapPluginRegistry = class {
47
49
  }
48
50
  store.set(t.id, t);
49
51
  }
52
+ unregister(kind, id) {
53
+ return this.stores[kind].delete(id);
54
+ }
50
55
  get(kind, id) {
51
56
  return this.stores[kind].get(id);
52
57
  }
@@ -63,6 +68,12 @@ function createPluginRegistry() {
63
68
  var pluginRegistry = createPluginRegistry();
64
69
 
65
70
  // plugin-registry/src/deploy-handle.ts
71
+ function listDeployTargets(registry = pluginRegistry) {
72
+ return registry.list("deployTarget");
73
+ }
74
+ function getDeployTarget(id, registry = pluginRegistry) {
75
+ return registry.get("deployTarget", id);
76
+ }
66
77
  async function resolveDeployTarget(yaml, override, registry = pluginRegistry) {
67
78
  if (override) {
68
79
  const target2 = registry.get("deployTarget", override.target);
@@ -90,7 +101,61 @@ async function resolveDeployTarget(yaml, override, registry = pluginRegistry) {
90
101
  provenance: { source: "default" }
91
102
  };
92
103
  }
104
+ var buildStrategySchema = z.enum(["local", "remote", "managed"]);
105
+ async function sleep(ms, signal) {
106
+ return await new Promise((resolve, reject) => {
107
+ const timer = setTimeout(() => {
108
+ signal.removeEventListener("abort", onAbort);
109
+ resolve();
110
+ }, ms);
111
+ const onAbort = () => {
112
+ clearTimeout(timer);
113
+ reject(new Error("aborted while polling"));
114
+ };
115
+ if (signal.aborted) onAbort();
116
+ else signal.addEventListener("abort", onAbort);
117
+ });
118
+ }
119
+ async function pollUntil(opts) {
120
+ const deadline = Date.now() + opts.timeoutMs;
121
+ for (; ; ) {
122
+ if (await opts.check()) return;
123
+ if (Date.now() > deadline) {
124
+ throw new Error(opts.timeoutMessage ?? "timed out");
125
+ }
126
+ await sleep(opts.intervalMs, opts.signal);
127
+ }
128
+ }
129
+ function makeDeployHandle(opts) {
130
+ let state = opts.initialState;
131
+ const handle = {
132
+ wsUrl: opts.wsUrl,
133
+ wsAuth: opts.ctx.wsAuth ? "<redacted>" : void 0,
134
+ get state() {
135
+ return state;
136
+ },
137
+ payload: opts.payload,
138
+ async waitReady(timeoutMs) {
139
+ const effective = timeoutMs ?? opts.defaultReadyTimeoutMs;
140
+ try {
141
+ await opts.ready(effective, opts.ctx.signal);
142
+ state = "ready";
143
+ } catch (err) {
144
+ state = "errored";
145
+ throw err;
146
+ }
147
+ },
148
+ health: opts.health,
149
+ async stop() {
150
+ state = "stopping";
151
+ await opts.stop();
152
+ state = "stopped";
153
+ }
154
+ };
155
+ if (opts.logs) handle.logs = opts.logs;
156
+ return handle;
157
+ }
93
158
 
94
- export { ApiVersionMismatchError, DeployTargetNotFoundError, MissingTargetError, RegistrationError, createPluginRegistry, pluginRegistry, resolveDeployTarget };
95
- //# sourceMappingURL=chunk-UZRY5UI2.js.map
96
- //# sourceMappingURL=chunk-UZRY5UI2.js.map
159
+ export { ApiVersionMismatchError, DeployTargetNotFoundError, MissingTargetError, RegistrationError, buildStrategySchema, createPluginRegistry, getDeployTarget, listDeployTargets, makeDeployHandle, pluginRegistry, pollUntil, resolveDeployTarget, sleep };
160
+ //# sourceMappingURL=chunk-6E6PKKAD.js.map
161
+ //# sourceMappingURL=chunk-6E6PKKAD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../plugin-registry/src/errors.ts","../plugin-registry/src/internal.ts","../plugin-registry/src/deploy-handle.ts","../plugin-registry/src/deploy-hel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AAA,CAAM,IAAA,CAAK,UAAA,EAAY,IAAA,CAAK,MAAM,CAAA;AAAA,EAC1C;AACF;AAuBO,SAAS,iBAAoB,IAAA,EAAmD;AACrF,EAAA,IAAI,QAA+B,IAAA,CAAK,YAAA;AACxC,EAAA,MAAM,MAAA,GAA0B;AAAA,IAC9B,OAAO,IAAA,CAAK,KAAA;AAAA,IACZ,MAAA,EAAQ,IAAA,CAAK,GAAA,CAAI,MAAA,GAAS,YAAA,GAAe,MAAA;AAAA,IACzC,IAAI,KAAA,GAAQ;AACV,MAAA,OAAO,KAAA;AAAA,IACT,CAAA;AAAA,IACA,SAAS,IAAA,CAAK,OAAA;AAAA,IACd,MAAM,UAAU,SAAA,EAAoB;AAClC,MAAA,MAAM,SAAA,GAAY,aAAa,IAAA,CAAK,qBAAA;AACpC,MAAA,IAAI;AACF,QAAA,MAAM,IAAA,CAAK,KAAA,CAAM,SAAA,EAAW,IAAA,CAAK,IAAI,MAAM,CAAA;AAC3C,QAAA,KAAA,GAAQ,OAAA;AAAA,MACV,SAAS,GAAA,EAAK;AACZ,QAAA,KAAA,GAAQ,SAAA;AACR,QAAA,MAAM,GAAA;AAAA,MACR;AAAA,IACF,CAAA;AAAA,IACA,QAAQ,IAAA,CAAK,MAAA;AAAA,IACb,MAAM,IAAA,GAAO;AACX,MAAA,KAAA,GAAQ,UAAA;AACR,MAAA,MAAM,KAAK,IAAA,EAAK;AAChB,MAAA,KAAA,GAAQ,SAAA;AAAA,IACV;AAAA,GACF;AACA,EAAA,IAAI,IAAA,CAAK,IAAA,EAAM,MAAA,CAAO,IAAA,GAAO,IAAA,CAAK,IAAA;AAClC,EAAA,OAAO,MAAA;AACT","file":"chunk-6E6PKKAD.js","sourcesContent":["/**\n * Error types thrown by the plugin registry and deploy resolution.\n *\n * Each carries a stable `.name` so callers can branch on identity without\n * importing the class (cross-package / cross-bundle `instanceof` is unreliable).\n */\n\n/** Thrown by `register()` when a target id is already registered for its kind. */\nexport class RegistrationError extends Error {\n constructor(kind: string, id: string) {\n super(`A \"${kind}\" target with id \"${id}\" is already registered.`);\n this.name = \"RegistrationError\";\n }\n}\n\n/** Thrown when a lookup by id finds no registered target for the given kind. */\nexport class MissingTargetError extends Error {\n constructor(kind: string, id: string) {\n super(`No \"${kind}\" target registered with id \"${id}\".`);\n this.name = \"MissingTargetError\";\n }\n}\n\n/** Thrown by `register()` when a target declares an unsupported `apiVersion`. */\nexport class ApiVersionMismatchError extends Error {\n constructor(kind: string, id: string, got: unknown) {\n super(\n `Target \"${id}\" (kind \"${kind}\") declares apiVersion ${String(got)}; registry requires apiVersion 1.`,\n );\n this.name = \"ApiVersionMismatchError\";\n }\n}\n\n/** Thrown by `resolveDeployTarget()` when the requested deploy target id is unknown. */\nexport class DeployTargetNotFoundError extends Error {\n constructor(id: string) {\n super(`No deploy target registered with id \"${id}\".`);\n this.name = \"DeployTargetNotFoundError\";\n }\n}\n","/**\n * Map-backed `PluginRegistry` implementation + the process-wide singleton.\n *\n * Storage is one Map per kind. Registration rejects duplicate ids\n * (`RegistrationError`) and any target not on `apiVersion: 1`\n * (`ApiVersionMismatchError`).\n */\n\nimport { ApiVersionMismatchError, RegistrationError } from \"./errors.js\";\nimport type { PluginRegistry, Target, TargetKind, TargetMeta } from \"./registry.js\";\n\ntype AnyTarget = { id: string; displayName: string; apiVersion: unknown };\n\nclass MapPluginRegistry implements PluginRegistry {\n readonly apiVersion = 1 as const;\n\n // One Map per kind keeps lookups kind-scoped — a driver and a connector may\n // share an id without colliding.\n private readonly stores: Record<TargetKind, Map<string, AnyTarget>> = {\n driver: new Map(),\n connector: new Map(),\n deployTarget: new Map(),\n };\n\n register<K extends TargetKind>(kind: K, target: Target<K>): void {\n const t = target as unknown as AnyTarget;\n if (t.apiVersion !== 1) {\n throw new ApiVersionMismatchError(kind, t.id, t.apiVersion);\n }\n const store = this.stores[kind];\n if (store.has(t.id)) {\n throw new RegistrationError(kind, t.id);\n }\n store.set(t.id, t);\n }\n\n unregister<K extends TargetKind>(kind: K, id: string): boolean {\n return this.stores[kind].delete(id);\n }\n\n get<K extends TargetKind>(kind: K, id: string): Target<K> | undefined {\n return this.stores[kind].get(id) as Target<K> | undefined;\n }\n\n list<K extends TargetKind>(kind: K): readonly TargetMeta[] {\n return [...this.stores[kind].values()].map((t) => ({\n id: t.id,\n displayName: t.displayName,\n }));\n }\n}\n\n/** Create a fresh, isolated registry — used by tests so cases never share state. */\nexport function createPluginRegistry(): PluginRegistry {\n return new MapPluginRegistry();\n}\n\n/** Process-wide default registry. Built-ins and loaded plugins register here. */\nexport const pluginRegistry: PluginRegistry = createPluginRegistry();\n","/**\n * Deploy handle contract + the `resolveDeployTarget` precedence resolver.\n *\n * A `DeployHandle` is the live, restorable result of standing up a workspace on\n * a deploy target. `resolveDeployTarget` picks which target+config to use with\n * an explicit override > yaml > default chain.\n */\n\nimport { DeployTargetNotFoundError } from \"./errors.js\";\nimport { pluginRegistry } from \"./internal.js\";\nimport type { PluginRegistry, TargetMeta } from \"./registry.js\";\nimport type { DeployTarget } from \"./targets.js\";\n\n/**\n * Live handle to a deployed workspace. `payload` is the target's own opaque\n * persistence slice (written to `.skaile/deploy/handle.json` and fed back into\n * `restore()`); the registry wrapper never inspects it.\n */\nexport interface DeployHandle<S = unknown> {\n readonly wsUrl: string;\n /** Redacted form of the auth token, safe to log. */\n readonly wsAuth?: string;\n readonly state: \"starting\" | \"ready\" | \"stopping\" | \"stopped\" | \"errored\";\n readonly payload: S;\n waitReady(timeoutMs?: number): Promise<void>;\n health(): Promise<{ healthy: boolean; detail?: string }>;\n logs?(opts?: { sinceMs?: number; follow?: boolean }): AsyncIterable<{ ts: number; line: string }>;\n stop(): Promise<void>;\n}\n\n/**\n * List the registered deploy targets as lightweight `{ id, displayName }` rows,\n * the symmetric counterpart to `listDrivers()` / `listConnectors()`. Reads the\n * process-wide `pluginRegistry` by default, so call\n * `registerBuiltinDeployTargets()` (and load any plugins) first — unregistered\n * targets do not appear. Enough to populate a target picker without resolving a\n * config; use `getDeployTarget(id)` for the full target.\n */\nexport function listDeployTargets(\n registry: PluginRegistry = pluginRegistry,\n): readonly TargetMeta[] {\n return registry.list(\"deployTarget\");\n}\n\n/**\n * Look up a single registered deploy target by id, or `undefined` if none is\n * registered under that id. Thin wrapper over `pluginRegistry.get`, mirroring\n * `getConnector()`; unlike `resolveDeployTarget` it neither applies the\n * override/yaml/default precedence nor parses a config.\n */\nexport function getDeployTarget(\n id: string,\n registry: PluginRegistry = pluginRegistry,\n): DeployTarget | undefined {\n return registry.get(\"deployTarget\", id);\n}\n\n/** Outcome of `resolveDeployTarget`: the chosen target, its parsed config, and where it came from. */\nexport interface DeployResolution {\n target: DeployTarget;\n config: unknown;\n provenance: { source: \"default\" | \"yaml\" | \"override\"; reason?: string };\n}\n\n/**\n * Resolve which deploy target + config to use, with explicit precedence:\n * CLI override > `skaile.yaml` `deploy:` block > the built-in `local` default.\n * Config is parsed through the chosen target's `configSchema`, so validation\n * failures propagate to the caller.\n */\nexport async function resolveDeployTarget(\n yaml: { deploy?: { target: string; config?: unknown } },\n override?: { target: string; config?: unknown; reason: string },\n registry: PluginRegistry = pluginRegistry,\n): Promise<DeployResolution> {\n if (override) {\n const target = registry.get(\"deployTarget\", override.target);\n if (!target) throw new DeployTargetNotFoundError(override.target);\n return {\n target,\n config: target.configSchema.parse(override.config ?? {}),\n provenance: { source: \"override\", reason: override.reason },\n };\n }\n if (yaml.deploy) {\n const target = registry.get(\"deployTarget\", yaml.deploy.target);\n if (!target) throw new DeployTargetNotFoundError(yaml.deploy.target);\n return {\n target,\n config: target.configSchema.parse(yaml.deploy.config ?? {}),\n provenance: { source: \"yaml\" },\n };\n }\n const target = registry.get(\"deployTarget\", \"local\");\n if (!target) throw new DeployTargetNotFoundError(\"local\");\n return {\n target,\n config: target.configSchema.parse({}),\n provenance: { source: \"default\" },\n };\n}\n","/**\n * Shared building blocks for `DeployTarget` implementations.\n *\n * These lift the byte-for-byte duplication that had accumulated across the\n * provider packages (the `buildStrategy` enum, an abort-aware `sleep`, the\n * poll-until-ready loop, and the `DeployHandle` wrapper) into one authoritative\n * place — the package that already owns the `DeployHandle` contract.\n */\n\nimport * as z from \"zod\";\nimport type { DeployContext } from \"./context.js\";\nimport type { DeployHandle } from \"./deploy-handle.js\";\n\n/**\n * The authoritative build-strategy enum shared by every deploy target.\n * `local`/`managed` need an operator-supplied image; `remote` builds one.\n */\nexport const buildStrategySchema = z.enum([\"local\", \"remote\", \"managed\"]);\n\nexport type BuildStrategy = z.infer<typeof buildStrategySchema>;\n\n/**\n * Abort-aware sleep. Resolves after `ms`, or rejects immediately if `signal`\n * aborts first (so a cancelled deploy stops polling promptly).\n */\nexport async function sleep(ms: number, signal: AbortSignal): Promise<void> {\n return await new Promise<void>((resolve, reject) => {\n const timer = setTimeout(() => {\n signal.removeEventListener(\"abort\", onAbort);\n resolve();\n }, ms);\n const onAbort = () => {\n clearTimeout(timer);\n reject(new Error(\"aborted while polling\"));\n };\n if (signal.aborted) onAbort();\n else signal.addEventListener(\"abort\", onAbort);\n });\n}\n\n/** Options for {@link pollUntil}. */\nexport interface PollUntilOptions {\n /** Predicate polled until it returns true. */\n check: () => Promise<boolean>;\n /** Deadline relative to `Date.now()` at the first failing check. */\n timeoutMs: number;\n /** Delay between attempts, via the abort-aware {@link sleep}. */\n intervalMs: number;\n signal: AbortSignal;\n /** Descriptive message for the timeout error; defaults to \"timed out\". */\n timeoutMessage?: string;\n}\n\n/**\n * Poll `check()` until it returns true. Sleeps `intervalMs` between attempts\n * and throws once `Date.now()` passes the deadline. Generalizes the readiness\n * loops the deploy providers each re-implemented.\n */\nexport async function pollUntil(opts: PollUntilOptions): Promise<void> {\n const deadline = Date.now() + opts.timeoutMs;\n for (;;) {\n if (await opts.check()) return;\n if (Date.now() > deadline) {\n throw new Error(opts.timeoutMessage ?? \"timed out\");\n }\n await sleep(opts.intervalMs, opts.signal);\n }\n}\n\n/** Options for {@link makeDeployHandle}. */\nexport interface MakeDeployHandleOptions<S> {\n wsUrl: string;\n /** Source of `wsAuth` redaction and the abort `signal` for the ready routine. */\n ctx: DeployContext;\n payload: S;\n initialState: DeployHandle[\"state\"];\n /** Timeout passed to `ready` when `waitReady` is called without one. */\n defaultReadyTimeoutMs: number;\n /** Readiness routine; receives the EFFECTIVE timeout (caller's or the default). */\n ready: (timeoutMs: number, signal: AbortSignal) => Promise<void>;\n health: () => Promise<{ healthy: boolean; detail?: string }>;\n stop: () => Promise<void>;\n logs?: DeployHandle<S>[\"logs\"];\n}\n\n/**\n * Build a `DeployHandle` from per-target seams, replacing the wrapper each\n * provider had copy-pasted. Unlike those wrappers, `waitReady(timeoutMs)`\n * forwards the caller's timeout to `ready` instead of discarding it.\n */\nexport function makeDeployHandle<S>(opts: MakeDeployHandleOptions<S>): DeployHandle<S> {\n let state: DeployHandle[\"state\"] = opts.initialState;\n const handle: DeployHandle<S> = {\n wsUrl: opts.wsUrl,\n wsAuth: opts.ctx.wsAuth ? \"<redacted>\" : undefined,\n get state() {\n return state;\n },\n payload: opts.payload,\n async waitReady(timeoutMs?: number) {\n const effective = timeoutMs ?? opts.defaultReadyTimeoutMs;\n try {\n await opts.ready(effective, opts.ctx.signal);\n state = \"ready\";\n } catch (err) {\n state = \"errored\";\n throw err;\n }\n },\n health: opts.health,\n async stop() {\n state = \"stopping\";\n await opts.stop();\n state = \"stopped\";\n },\n };\n if (opts.logs) handle.logs = opts.logs;\n return handle;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { pluginRegistry } from './chunk-UZRY5UI2.js';
1
+ import { pluginRegistry } from './chunk-6E6PKKAD.js';
2
2
  import { createLogger } from './chunk-24UIWON4.js';
3
3
  import { EventEmitter } from 'events';
4
4
 
@@ -169,6 +169,10 @@ async function registerBuiltinDrivers(registry = pluginRegistry) {
169
169
  if (registry === pluginRegistry) _driversRegistered = true;
170
170
  }
171
171
  async function createDriver(id, config, ctx) {
172
+ const target = await resolveDriverTarget(id);
173
+ return target.create(config, ctx ?? {});
174
+ }
175
+ async function resolveDriverTarget(id) {
172
176
  await registerBuiltinDrivers();
173
177
  const target = pluginRegistry.get("driver", id);
174
178
  if (!target) {
@@ -179,7 +183,7 @@ async function createDriver(id, config, ctx) {
179
183
  `Unknown agent driver: "${id}". Available: ${listDrivers().map((d) => d.id).join(", ")}`
180
184
  );
181
185
  }
182
- return target.create(config, ctx ?? {});
186
+ return target;
183
187
  }
184
188
  function listDrivers() {
185
189
  const merged = /* @__PURE__ */ new Map();
@@ -188,22 +192,22 @@ function listDrivers() {
188
192
  }
189
193
  for (const meta of pluginRegistry.list("driver")) {
190
194
  if (!merged.has(meta.id)) {
195
+ const target = pluginRegistry.get("driver", meta.id);
191
196
  merged.set(meta.id, {
192
197
  id: meta.id,
193
198
  name: meta.displayName,
194
- modelAgnostic: false,
195
- supportsInBandAbort: false
199
+ modelAgnostic: target?.modelAgnostic ?? false,
200
+ supportsInBandAbort: target?.supportsInBandAbort ?? false
196
201
  });
197
202
  }
198
203
  }
199
204
  return [...merged.values()];
200
205
  }
201
206
  async function listModelsForDriver(driverId, apiKeys) {
202
- await registerBuiltinDrivers();
203
- const target = pluginRegistry.get("driver", driverId);
204
- return await target?.listModels?.(apiKeys) ?? [];
207
+ const target = await resolveDriverTarget(driverId);
208
+ return await target.listModels?.(apiKeys) ?? [];
205
209
  }
206
210
 
207
211
  export { AgentDriver, BUILTIN_DRIVER_CATALOG, DRIVER_CATALOG, createDriver, getBridgeLogger, listDrivers, listModelsForDriver, registerBuiltinDrivers };
208
- //# sourceMappingURL=chunk-IGQEXBBG.js.map
209
- //# sourceMappingURL=chunk-IGQEXBBG.js.map
212
+ //# sourceMappingURL=chunk-6VTG73UY.js.map
213
+ //# sourceMappingURL=chunk-6VTG73UY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../bridge/src/logger.ts","../bridge/src/types.ts","../bridge/src/registry.ts"],"names":[],"mappings":";;;;;AAuBO,SAAS,gBAAgB,OAAA,EAAyB;AACvD,EAAA,OAAO,YAAA,CAAa,EAAE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ger via `getBridgeLogger(subkind)` at\n * construction time. Falls back to an off-mode Logger (stdout only) when\n * no LogStore is registered — see @skaile/workspaces/core/logging for details.\n */\n\nimport { createLogger } from \"@skaile/workspaces/core/logging\";\nimport type { Logger } from \"@skaile/workspaces/types\";\n\n/**\n * Construct a bridge-scoped Logger for a given driver subkind.\n *\n * Creates a `Logger` with `kind: \"bridge\"` and the specified `subkind`. Falls back to\n * an off-mode Logger (stdout only) when no `LogStore` is registered — see\n * `@skaile/workspaces/core/logging` for details. Each driver calls this once at construction\n * time; never re-construct per call.\n *\n * @param subkind - Driver id, e.g. `\"claude-sdk\"`, `\"omp\"`, `\"echo\"`, `\"codex\"`.\n * @returns A `Logger` scoped to `bridge:<subkind>`.\n * @docLink packages/bridge/api-reference#logger\n */\nexport function getBridgeLogger(subkind: string): Logger {\n return createLogger({ kind: \"bridge\", subkind });\n}\n","import { EventEmitter } from \"node:events\";\nimport type { Span, TelemetryProvider, Trace } from \"@skaile/workspaces/telemetry\";\nimport type {\n Capability,\n CredentialMint,\n RenderInvokedEvent,\n TokenUsage,\n} from \"@skaile/workspaces/types\";\nimport type { ModelEntry } from \"./models.js\";\n\n/**\n * Minimal LLM tool descriptor used by the capability dispatch path. Mirrors\n * the runner's `LLMTool` shape so drivers can consume registry output without\n * importing `@skaile/workspaces/runner` (which would create a circular dep).\n *\n * @category Capabilities\n * @since 2.0.0\n * @docLink packages/bridge/concepts#bridge-capability-tool\n */\nexport interface BridgeCapabilityTool {\n /** Capability name; used as the LLM-visible tool name. */\n name: string;\n /** Human/LLM-readable description. */\n description: string;\n /** JSON Schema for the tool's input parameters. */\n parameters: Record<string, unknown>;\n}\n\n/**\n * Render-cap event emission callback used by the bridge when the LLM invokes\n * a capability that carries a `render` spec. The runner provides the actual\n * sink (transport.send / sendEvent); the bridge only emits.\n *\n * @category Capabilities\n * @since 2.0.0\n * @docLink packages/bridge/concepts#bridge-render-emit\n */\nexport type BridgeRenderEmit = (event: RenderInvokedEvent) => void;\n\n/**\n * Text-event emission callback for render-capability fallbacks. When a\n * `RenderCapability` carries `render.fallback` and the LLM invokes it, the\n * bridge substitutes `{{prop}}` placeholders (top-level keys of `props`,\n * optional dotted-path traversal `{{user.name}}`) and pushes the rendered\n * string through this callback so clients without a render layer still see\n * a textual representation. No-op when `fallback` is absent.\n *\n * @category Capabilities\n * @since 2.0.0\n * @docLink packages/bridge/concepts#bridge-text-emit\n */\nexport type BridgeTextEmit = (text: string) => void;\n\n/**\n * Bundle of capability dispatch hooks. Registered into the driver via\n * `AgentConfig.capabilities`; the driver routes registered LLM tool calls\n * back into `invoke()` instead of using its native dispatch path.\n *\n * The runner constructs this from a `CapabilityRegistry` instance and threads\n * it through `createAgentSession()`. Drivers that don't yet implement\n * capability dispatch ignore the field — legacy v1 paths stay intact.\n *\n * @category Capabilities\n * @since 2.0.0\n * @docLink packages/bridge/concepts#bridge-capability-hooks\n */\nexport interface BridgeCapabilityHooks {\n /** Build the LLM tool descriptor list from the registry. Called per turn so registration changes take effect. */\n composeTools(): BridgeCapabilityTool[];\n /** Resolve a wire-format Capability descriptor by name. Used by the bridge to inspect `fireAndForget` / `render`. */\n resolve(name: string): Capability | null;\n /** Validate input + dispatch through the registry. Logging is wired by the registry. */\n invoke(name: string, input: unknown): Promise<unknown>;\n /** Emit a render-invoked event. The runner forwards via the WebSocket transport. */\n emitRender?: BridgeRenderEmit;\n /** Emit a text fallback for render capabilities with `render.fallback`. */\n emitText?: BridgeTextEmit;\n /** Session id passed through to the runner's per-handler logger. */\n sessionId: string;\n}\n\n/**\n * Static metadata for a registered agent driver backend.\n *\n * Returned by {@link listDrivers} and exposed on every {@link AgentDriver} instance\n * via `driverInfo`.\n *\n * @docLink packages/bridge/concepts#driver-info\n */\nexport interface DriverInfo {\n /** Stable machine identifier used to look up the driver in the registry (e.g. `\"omp\"`, `\"claude-sdk\"`). */\n id: string;\n /** Human-readable display name shown in UIs and logs. */\n name: string;\n /** `true` when the driver can target any LLM provider; `false` for Anthropic-only drivers. */\n modelAgnostic: boolean;\n /**\n * `true` when the driver supports mid-stream abort via `abort()` without killing the process.\n * Drivers that return `false` can only be stopped via `kill()`.\n */\n supportsInBandAbort: boolean;\n}\n\n/**\n * Codex-specific tuning options passed through `DriverOptions.codex`.\n *\n * @remarks These are forwarded verbatim to the Codex driver and have no effect on other drivers.\n * @docLink packages/bridge/concepts#codex-driver-options\n */\nexport interface CodexDriverOptions {\n /** Controls whether Codex may auto-apply edits without user approval. */\n approvalPolicy?: \"never\" | \"on-request\" | \"on-failure\" | \"untrusted\";\n /** Filesystem sandbox level for the Codex process. */\n sandboxMode?: \"read-only\" | \"workspace-write\" | \"danger-full-access\";\n /** Reasoning budget passed to the model. */\n reasoningEffort?: \"minimal\" | \"low\" | \"medium\" | \"high\" | \"xhigh\";\n /** When `true`, the Codex sandbox is allowed to make outbound network requests. */\n networkAccessEnabled?: boolean;\n /** Extra directories made accessible to the Codex sandbox in addition to `cwd`. */\n additionalDirectories?: string[];\n}\n\n/**\n * Driver-specific configuration bag.\n *\n * Fields are keyed by driver ID so that callers can pass driver-specific options\n * through the common {@link AgentConfig} without breaking other drivers.\n *\n * @docLink packages/bridge/concepts#driver-options\n */\nexport interface DriverOptions {\n /** Codex-specific options. Ignored by all other drivers. */\n codex?: CodexDriverOptions;\n}\n\n/**\n * Configuration passed to a driver when it is created via {@link createDriver}.\n *\n * All fields are shared across drivers; driver-specific behaviour is documented\n * per field. Fields that are silently ignored by a driver are marked accordingly.\n *\n * @docLink packages/bridge/concepts#agent-config\n */\nexport interface AgentConfig {\n /** Absolute path to the working directory the agent operates in. */\n cwd: string;\n /**\n * LLM provider name (e.g. `\"anthropic\"`, `\"openai\"`, `\"google\"`).\n * Combined with `model` as `provider/model` for omp's `--model` flag.\n * Ignored by claude-sdk (always Anthropic).\n */\n provider?: string;\n /**\n * LLM model identifier (e.g. `\"claude-sonnet-4-5\"`, `\"gpt-4o\"`).\n * For omp: passed as `--model [provider/]model`.\n * For claude-sdk: passed as the `model` query option.\n */\n model?: string;\n /**\n * Provider API keys keyed by provider name (e.g. `{ anthropic: \"sk-...\" }`).\n * Drivers inject the relevant key into the environment or SDK options.\n */\n apiKeys?: Record<string, string>;\n /**\n * Additional environment variables merged into the child process environment.\n * For omp: merged with `process.env` before spawn. For claude-sdk: accessed\n * via `env.ANTHROPIC_API_KEY` as an alternative to `apiKeys.anthropic`.\n */\n env?: Record<string, string>;\n /** Inline system prompt — written to .omp/system.md and passed via --append-system-prompt (omp driver) */\n systemPrompt?: string;\n /** Path to project .omp/ directory (PI_CODING_AGENT_DIR for omp driver) */\n agentDir?: string;\n /** SSH key path — injected as GIT_SSH_COMMAND */\n sshKeyPath?: string;\n /** Pre-assign a UUID as the session ID for a new session (claude-sdk: passed as sessionId option) */\n sessionId?: string;\n /** Resume this specific past session by UUID instead of starting fresh (claude-sdk: passed as resume option) */\n resumeSessionId?: string;\n /** Maximum agentic turns per query (claude-sdk: passed as maxTurns option) */\n maxTurns?: number;\n /** Agent name — selects a deployed sub-agent definition as the main agent identity.\n * claude-sdk: passed as `agent` option to query() → reads .claude/agents/<name>.md natively.\n * omp: ignored (omp uses agentDir/PI_CODING_AGENT_DIR instead). */\n agentName?: string;\n /** In-process SDK MCP servers for custom tool injection (Claude SDK only, ignored by other drivers) */\n mcpServers?: Record<string, unknown>;\n /** Tool restrictions from agent.yaml — applied to the main agent session */\n tools?: {\n /** Tool names that the agent is allowed to invoke. An empty array means no restriction. */\n allowed?: string[];\n /** Tool names that the agent is explicitly forbidden from invoking. */\n denied?: string[];\n };\n /** Thinking mode for Claude models: adaptive (Claude decides), enabled (always think), disabled (no thinking). */\n thinking?: \"adaptive\" | \"enabled\" | \"disabled\";\n /** Reasoning effort level for Claude models. */\n effort?: \"low\" | \"medium\" | \"high\" | \"max\";\n /** Driver-specific configuration bag. */\n driverOptions?: DriverOptions;\n /**\n * Protocol v2 capability dispatch hooks. When present, the driver uses the\n * registry as the source of LLM tool definitions and routes invocations\n * through `capabilities.invoke()`. Absent → legacy v1 path (existing\n * mcpServers / native dispatch).\n *\n * @since 2.0.0\n */\n capabilities?: BridgeCapabilityHooks;\n /**\n * The platform's `AIProviderConfig.id` for the AI credential currently\n * provisioned into this driver. The runner reads this off `AgentConfig`\n * during 401 mediation and passes it as `configId` in\n * `request_access_token { kind: 'ai-credentials' }`. The driver itself\n * does not consume this field — only the runner uses it.\n *\n * Set by the platform agent-gateway in `ConfigureCommandV2` for mediated\n * sessions. Standalone runners (CLI / forge / Claude plugin) leave it\n * undefined; the runner falls back to surfacing the auth error to the\n * user without mediating.\n *\n * Spec: `_devlog/specs/2026-05-07-unified-credential-mediation.md`\n * § \"Wire `aiProviderConfigId` end-to-end\".\n *\n * @since 3.3.0\n */\n aiProviderConfigId?: string;\n /**\n * Optional callback invoked by the driver when the underlying agent\n * surfaces an `authentication_error`. In Protocol v3 the runner mediates\n * the refresh via the `host.refresh_credential` capability and returns a\n * typed {@link CredentialMint}. The driver inspects the discriminator:\n *\n * - `mint.ok === true`: a fresh credential is now provisioned. The\n * driver re-attempts the in-flight prompt once.\n * - `mint.ok === false`: refresh failed (`code` carries a stable reason\n * such as `revoked`, `not-configured`, `provider-error`,\n * `backend-error`). The driver surfaces the original `AuthError` to\n * the caller.\n *\n * `args.configId` carries the platform `AIProviderConfig.id` the driver\n * was provisioned with (mirrors {@link AgentConfig.aiProviderConfigId}).\n * The runner uses it to scope the refresh to the correct AI credential.\n *\n * When omitted, the driver throws `AuthError` immediately as before\n * (standalone CLI / forge mode — there is no platform mediator to ask).\n *\n * Centralising auth-retry inside the driver means every consumer of\n * `driver.prompt(...)` (serve handler, compaction orchestrator, flow\n * orchestrator, …) gets self-healing for free — there is no per-call-site\n * wrapping.\n *\n * Spec: `_devlog/specs/2026-05-10-deterministic-session-bootstrap.md`\n * § \"host.refresh_credential capability\".\n *\n * @since 3.4.0\n */\n onAuthError?: (args: { configId: string }) => Promise<CredentialMint>;\n}\n\n/**\n * A single message in an agent conversation.\n *\n * Emitted as part of {@link AgentEvent} variants (`message_start`, `message_update`, `message_end`).\n *\n * @docLink packages/bridge/concepts#agent-message\n */\nexport interface AgentMessage {\n /** Originator of the message. */\n role: \"user\" | \"assistant\" | \"tool\";\n /** Message body — either a plain string or a list of typed content blocks. */\n content: string | ContentBlock[];\n /** Tool invocations made by the assistant in this message. */\n toolCalls?: ToolCall[];\n /** For `role === \"tool\"`: the name of the tool whose result this message carries. */\n toolName?: string;\n /** For `role === \"tool\"`: `true` when the tool returned an error. */\n isError?: boolean;\n /** Optional structured payload for tool results. */\n data?: unknown;\n}\n\n/**\n * A typed block within an {@link AgentMessage}'s content array.\n *\n * Mirrors the Anthropic content block schema but is driver-agnostic.\n *\n * @docLink packages/bridge/concepts#content-block\n */\nexport interface ContentBlock {\n /** Block discriminant. */\n type: \"text\" | \"tool_use\" | \"tool_result\" | \"thinking\";\n /** Present for `text` and `thinking` blocks. */\n text?: string;\n /** Tool use / tool result correlation ID. */\n id?: string;\n /** Tool name (present on `tool_use` blocks). */\n name?: string;\n /** Tool input arguments (present on `tool_use` blocks). */\n input?: any;\n /** Serialised tool result content (present on `tool_result` blocks). */\n content?: string;\n}\n\n/**\n * A single tool invocation made by the agent within a message.\n *\n * @docLink packages/bridge/concepts#tool-call\n */\nexport interface ToolCall {\n /** Correlation ID used to match the call with its result. */\n id: string;\n /** Name of the tool being invoked. */\n name: string;\n /** Arguments passed to the tool. */\n input: any;\n}\n\n/**\n * Error classification for agent failures.\n *\n * Used to determine whether a failure is retryable and to surface actionable\n * hints to the user. See `bridge/CLAUDE.md` for the full category-to-behaviour matrix.\n *\n * @see AgentError\n * @docLink packages/bridge/concepts#error-category\n */\nexport type ErrorCategory =\n | \"auth\"\n | \"rate_limit\"\n | \"model\"\n | \"network\"\n | \"config\"\n | \"process\"\n | \"validation\"\n | \"unknown\";\n\n/**\n * Structured error payload emitted inside the `error` {@link AgentEvent}.\n *\n * Consumers should inspect `retryable` before deciding to surface a retry button,\n * and `hint` to provide an actionable message to the user.\n *\n * @docLink packages/bridge/concepts#agent-error\n */\nexport interface AgentError {\n /** Human-readable error description. */\n message: string;\n /** Coarse failure classification used for retry logic and telemetry. */\n category: ErrorCategory;\n /** HTTP status code if the error originated from an API response. */\n statusCode?: number;\n /** `true` when the caller may safely retry the same operation. */\n retryable: boolean;\n /** Short actionable advice suitable for display in the UI. */\n hint?: string;\n}\n\n/**\n * Metadata for a slash command exposed by the active agent runtime.\n *\n * @docLink packages/bridge/concepts#slash-command-info\n */\nexport interface SlashCommandInfo {\n /** Command name without the leading slash (e.g. `\"compact\"`). */\n name: string;\n /** One-line description shown in command pickers. */\n description: string;\n /** Placeholder text describing what argument the command expects. */\n argumentHint?: string;\n}\n\n/**\n * Discriminated union of all events emitted by a driver on the `'agent-event'` channel.\n *\n * @remarks\n * Consumers listen via `driver.on('agent-event', (event: AgentEvent) => ...)`.\n * The `[k: string]: any` index signature on most variants allows drivers to attach\n * driver-specific fields (e.g. `_textDelta`) without breaking the union.\n *\n * @docLink packages/bridge/concepts#agent-event\n */\nexport type AgentEvent =\n | { type: \"message_start\"; message: AgentMessage; [k: string]: any }\n | { type: \"message_update\"; message: AgentMessage; [k: string]: any }\n | { type: \"message_end\"; message: AgentMessage; [k: string]: any }\n | { type: \"turn_end\"; toolResults?: AgentMessage[]; [k: string]: any }\n | { type: \"agent_end\"; [k: string]: any }\n | {\n type: \"result\";\n subtype: string;\n summary?: string;\n costUsd?: number;\n /** Per-turn token usage when the driver tracks it. Added in 3.1.0. */\n tokens?: TokenUsage;\n errors?: string[];\n [k: string]: any;\n }\n | { type: \"error\"; error: string; detail?: AgentError; fatal?: boolean; [k: string]: any }\n | { type: \"tool_call\"; name?: string; tool?: { name: string }; [k: string]: any }\n | { type: \"tool_execution_end\"; toolName?: string; [k: string]: any }\n | { type: \"commands_available\"; commands: SlashCommandInfo[] }\n | { type: \"session_info\"; driverSessionId: string; sessionFile?: string }\n | { type: \"ui_render\"; [k: string]: any }\n | { type: \"ui_render_update\"; [k: string]: any }\n | { type: \"ui_clear\"; [k: string]: any }\n // Phase 3 (resume cascade) — driver-emitted resume outcome.\n | {\n type: \"resume_failed\";\n resumeSessionId: string;\n reason: \"signature_mismatch\" | \"model_mismatch\" | \"jsonl_lost\" | \"jsonl_poisoned\";\n [k: string]: any;\n };\n\n/**\n * Abstract base class for agent driver backends.\n *\n * Wraps an LLM coding agent behind a single `prompt()` interface.\n * All drivers emit `'agent-event'` with {@link AgentEvent} payloads.\n *\n * @remarks\n * Subclasses must implement `start`, `prompt`, `abort`, `kill`, and `isRunning`.\n * Implementations should never emit an event name other than `'agent-event'` as\n * the public streaming channel — internal events (`'ready'`, `'exit'`, etc.) are\n * driver-private.\n *\n * @example\n * ```ts\n * const driver = createDriver('omp', config);\n * driver.on('agent-event', (event) => console.log(event.type));\n * await driver.start();\n * await driver.prompt('Refactor the auth module');\n * driver.kill();\n * ```\n *\n * @docLink packages/bridge/concepts#agent-driver\n */\nexport abstract class AgentDriver extends EventEmitter {\n /** Static metadata describing this driver's capabilities. */\n abstract readonly driverInfo: DriverInfo;\n\n /**\n * Initialises the driver backend — spawns the child process (omp) or loads\n * the SDK module (claude-sdk). Resolves when the backend is ready to accept\n * prompts. Idempotent: calling `start()` on an already-running driver is a no-op.\n *\n * @throws {Error} When the backend binary is missing or the SDK cannot be loaded.\n */\n abstract start(): Promise<void>;\n\n /**\n * Sends a user message to the agent and resolves when the agent's turn completes\n * (i.e. after the `agent_end` event has been emitted).\n *\n * @param message - Plain-text user prompt to send to the agent.\n * @throws {Error} When the driver is not running or the underlying backend reports a fatal error.\n */\n abstract prompt(message: string): Promise<void>;\n\n /**\n * Sends an in-band abort signal to the agent, requesting it to stop the current\n * turn without terminating the process. The driver remains usable after `abort()`.\n *\n * @remarks Only meaningful when `driverInfo.supportsInBandAbort` is `true`.\n * For other drivers, prefer `kill()` followed by creating a new driver instance.\n */\n abstract abort(): Promise<void>;\n\n /**\n * Terminates the agent backend immediately (SIGTERM for subprocess drivers,\n * `close()` for in-process drivers). The driver instance must not be reused\n * after `kill()`.\n */\n abstract kill(): void;\n\n /** `true` when the backend is alive and able to accept new prompts. */\n abstract get isRunning(): boolean;\n\n /** Optional provider-native session/thread identifier for resume support. */\n get runtimeSessionId(): string | undefined {\n return undefined;\n }\n\n /** Slash commands discovered from the agent runtime. Override in drivers that support introspection. */\n getSlashCommands(): SlashCommandInfo[] {\n return [];\n }\n\n // ── Live reconfiguration ────────────────────────────────────────────────\n\n /**\n * Live-update driver configuration. The new values take effect on the next\n * prompt() call. Only model/thinking/effort are reconfigurable mid-session.\n *\n * Subclasses that store config locally should override this to apply the\n * patch to their own config field. The base implementation is a no-op.\n */\n reconfigure(patch: Partial<Pick<AgentConfig, \"model\" | \"thinking\" | \"effort\">>): void {\n // No-op — subclasses override to apply to their own config.\n void patch;\n }\n\n /**\n * Returns the model identifier currently configured on this driver.\n * Subclasses that store config locally should override this.\n */\n getModel(): string | undefined {\n return undefined;\n }\n\n // ── Compaction support ──────────────────────────────────────────────────\n\n /**\n * Returns the token usage from the most recent completed turn.\n * Returns `null` if usage data is unavailable (e.g. driver doesn't track it).\n *\n * Widened in 3.1.0 to return the full `TokenUsage` shape (input / output /\n * cache-read / cache-creation / reasoning). All fields are optional so\n * drivers can populate just what their provider reports. Existing callers\n * that read only `inputTokens` / `outputTokens` keep working — those fields\n * are still present and carry the same semantics as before.\n */\n getTokenUsage(): TokenUsage | null {\n return null;\n }\n\n /**\n * Returns the model's context window size in tokens.\n * Returns `null` if unknown.\n */\n getContextWindow(): number | null {\n return null;\n }\n\n /**\n * Returns the list of models available to this driver without starting a session.\n * Drivers that can enumerate their own models override this method.\n * Returns an empty array by default.\n */\n async listModels(): Promise<ModelEntry[]> {\n return [];\n }\n\n /**\n * Closes the current conversation session and prepares for a fresh start.\n * The next `prompt()` call will begin a new session without prior history.\n * The driver remains usable after `resetSession()`.\n */\n abstract resetSession(): Promise<void>;\n\n // ── Telemetry ─────────────────────────────────────────────────────────────\n\n protected _telemetry?: TelemetryProvider;\n protected _activeTrace?: Trace;\n protected _activeTurnSpan?: Span;\n private _turnStartTime?: number;\n\n /**\n * Attach a telemetry provider and active trace to this driver.\n * Called by the runner after creating the driver but before start().\n */\n setTelemetry(provider: TelemetryProvider, trace: Trace): void {\n this._telemetry = provider;\n this._activeTrace = trace;\n }\n\n /**\n * Begin a turn span. Called by the runner before prompt().\n * Pass a parent span (e.g. the turn span from the orchestrator) for nesting.\n * Returns the span so the runner can annotate it further.\n */\n beginTurnSpan(\n parent?: Trace | Span,\n attrs?: Record<string, string | number | boolean>,\n ): Span | undefined {\n if (!this._telemetry || !this._activeTrace) return undefined;\n this._turnStartTime = Date.now();\n this._activeTurnSpan = this._telemetry.startSpan(parent ?? this._activeTrace, {\n name: \"llm_generation\",\n kind: \"llm_generation\",\n attributes: attrs,\n });\n return this._activeTurnSpan;\n }\n\n /**\n * End the current turn span with generation data.\n * Called by the runner after agent_end. Model and provider are passed\n * explicitly — the driver base class does not access config directly.\n */\n endTurnSpan(result?: {\n model?: string;\n provider?: string;\n inputTokens?: number;\n outputTokens?: number;\n stopReason?: string;\n error?: string;\n }): void {\n if (!this._telemetry || !this._activeTurnSpan) return;\n const durationMs = this._turnStartTime ? Date.now() - this._turnStartTime : 0;\n\n if (result?.inputTokens !== undefined || result?.outputTokens !== undefined) {\n this._telemetry.logGeneration(this._activeTurnSpan, {\n model: result?.model ?? \"unknown\",\n provider: result?.provider ?? \"unknown\",\n inputTokens: result.inputTokens,\n outputTokens: result.outputTokens,\n durationMs,\n stopReason: result.stopReason,\n });\n }\n\n this._telemetry.endSpan(this._activeTurnSpan, {\n status: result?.error ? \"error\" : \"ok\",\n error: result?.error,\n attributes: { \"skaile.turn.duration_ms\": durationMs },\n });\n\n this._activeTurnSpan = undefined;\n this._turnStartTime = undefined;\n }\n}\n\n/**\n * Factory function signature registered in the driver registry.\n *\n * @param config - Configuration for the new driver instance.\n * @returns A freshly constructed (not yet started) {@link AgentDriver}.\n * @docLink packages/bridge/concepts#driver-factory\n */\nexport type DriverFactory = (config: AgentConfig) => AgentDriver;\n","import type { DriverContext } from \"@skaile/workspaces/plugin-registry\";\nimport { type PluginRegistry, pluginRegistry } from \"@skaile/workspaces/plugin-registry\";\nimport type { ModelEntry } from \"./models.js\";\nimport type { AgentConfig, AgentDriver, DriverInfo } from \"./types.js\";\n\n// Build-time backend gating. `bun build --compile --define:__INCLUDE_*__=...`\n// folds these to literal booleans so an excluded backend's driver module and\n// its SDK are dead-code-stripped from the binary. Under tsup / vitest / bun\n// run-on-source no `--define` runs and the `typeof` guard defaults to `true` —\n// every backend is available (the SDKs stay optional peers).\ndeclare const __INCLUDE_CLAUDE_SDK__: boolean;\ndeclare const __INCLUDE_CODEX__: boolean;\nconst INCLUDE_CLAUDE_SDK =\n typeof __INCLUDE_CLAUDE_SDK__ === \"undefined\" ? true : __INCLUDE_CLAUDE_SDK__;\nconst INCLUDE_CODEX = typeof __INCLUDE_CODEX__ === \"undefined\" ? true : __INCLUDE_CODEX__;\n\n/**\n * Static capability metadata for every built-in backend.\n *\n * Pure data — this object imports no driver module and references no backend\n * SDK. {@link listDrivers} returns it (merged with any third-party drivers)\n * so selection UIs can enumerate every backend without loading a single\n * driver module. The matching driver module's `DriverTarget` is registered\n * into the plugin registry by {@link registerBuiltinDrivers}.\n *\n * @docLink packages/bridge/api-reference#registry\n */\nexport const BUILTIN_DRIVER_CATALOG: Record<string, DriverInfo> = {\n omp: {\n id: \"omp\",\n name: \"omp (oh-my-pi)\",\n modelAgnostic: true,\n supportsInBandAbort: true,\n },\n \"claude-sdk\": {\n id: \"claude-sdk\",\n name: \"Claude Agent SDK\",\n modelAgnostic: false,\n supportsInBandAbort: true,\n },\n codex: {\n id: \"codex\",\n name: \"OpenAI Codex\",\n modelAgnostic: false,\n supportsInBandAbort: true,\n },\n echo: {\n id: \"echo\",\n name: \"Echo (E2E mock)\",\n modelAgnostic: true,\n supportsInBandAbort: false,\n },\n};\n\n/**\n * Back-compat alias for {@link BUILTIN_DRIVER_CATALOG}. Consumers and tests that\n * predate the plugin-registry refactor still import `DRIVER_CATALOG`.\n *\n * @docLink packages/bridge/api-reference#registry\n */\nexport const DRIVER_CATALOG = BUILTIN_DRIVER_CATALOG;\n\nlet _driversRegistered = false;\n\n/**\n * Register every built-in driver's `DriverTarget` into the plugin registry.\n *\n * This is the single id → module map in bridge core. Every specifier is a\n * literal string so `bun --compile` can statically bundle the driver module\n * (and, transitively, its SDK). The in-process-SDK backends (`claude-sdk`,\n * `codex`) are wrapped in build-constant guards so an excluded backend's\n * `await import` folds to dead code in the compiled binary. `omp` and `echo`\n * carry no SDK weight and are always available.\n *\n * **Static import discipline.** Every `import()` specifier below must be a\n * string literal — never aliased through a variable. Indirection defeats\n * `bun --compile`'s static analysis and silently drops the module from the\n * binary.\n *\n * Idempotent: guarded by a module flag so a second call is a no-op (a duplicate\n * `register` would otherwise throw `RegistrationError`).\n *\n * @docLink packages/bridge/api-reference#registry\n */\nexport async function registerBuiltinDrivers(\n registry: PluginRegistry = pluginRegistry,\n): Promise<void> {\n if (registry === pluginRegistry && _driversRegistered) return;\n\n if (!registry.get(\"driver\", \"omp\")) {\n const m = await import(\"@skaile/workspaces/drivers/omp\");\n registry.register(\"driver\", m.ompDriverTarget);\n }\n if (!registry.get(\"driver\", \"echo\")) {\n const m = await import(\"@skaile/workspaces/drivers/echo\");\n registry.register(\"driver\", m.echoDriverTarget);\n }\n if (INCLUDE_CLAUDE_SDK && !registry.get(\"driver\", \"claude-sdk\")) {\n const m = await import(\"@skaile/workspaces/drivers/claude-sdk\");\n registry.register(\"driver\", m.claudeSdkDriverTarget);\n }\n if (INCLUDE_CODEX && !registry.get(\"driver\", \"codex\")) {\n const m = await import(\"@skaile/workspaces/drivers/codex\");\n registry.register(\"driver\", m.codexDriverTarget);\n }\n\n if (registry === pluginRegistry) _driversRegistered = true;\n}\n\n/**\n * Creates a new driver instance for the given backend id.\n *\n * Ensures the built-in driver targets are registered (idempotent), then looks\n * up the target in the plugin registry and calls its `create()`. The returned\n * driver has not been started yet — call `driver.start()` before sending\n * prompts.\n *\n * @param id - Registered driver identifier (e.g. `\"omp\"`, `\"claude-sdk\"`).\n * @param config - Configuration forwarded to the driver constructor.\n * @param ctx - Optional driver context (logger / abort signal). Defaults to `{}`.\n * @returns A freshly constructed (not yet started) {@link AgentDriver}.\n * @throws {Error} When `id` is a known backend excluded from this build, or\n * when `id` does not match any registered driver at all.\n * @docLink packages/bridge/api-reference#registry\n */\nexport async function createDriver(\n id: string,\n config: AgentConfig,\n ctx?: DriverContext,\n): Promise<AgentDriver> {\n const target = await resolveDriverTarget(id);\n return target.create(config, ctx ?? {});\n}\n\n/**\n * Resolve a registered driver target by id, ensuring the built-ins are\n * registered first. Throws the canonical \"not bundled\" / \"unknown driver\"\n * errors so every caller (`createDriver`, `listModelsForDriver`) reports an\n * unrecognized id the same way instead of silently degrading.\n *\n * @throws {Error} When `id` is a known backend excluded from this build, or\n * when `id` does not match any registered driver at all.\n */\nasync function resolveDriverTarget(id: string) {\n await registerBuiltinDrivers();\n const target = pluginRegistry.get(\"driver\", id);\n if (!target) {\n if (id in BUILTIN_DRIVER_CATALOG) {\n throw new Error(`Agent driver \"${id}\" is not bundled in this build.`);\n }\n throw new Error(\n `Unknown agent driver: \"${id}\". Available: ${listDrivers()\n .map((d) => d.id)\n .join(\", \")}`,\n );\n }\n return target;\n}\n\n/**\n * Returns the capability metadata for every available driver.\n *\n * Enumerates every built-in backend from {@link BUILTIN_DRIVER_CATALOG} without\n * loading a single driver module or backend SDK, then merges in any third-party\n * driver targets registered into the plugin registry that are not already in\n * the catalog. Use this to populate driver selection UIs.\n *\n * @returns Array of {@link DriverInfo} objects, one per available driver.\n * @docLink packages/bridge/api-reference#registry\n */\nexport function listDrivers(): DriverInfo[] {\n const merged = new Map<string, DriverInfo>();\n for (const info of Object.values(BUILTIN_DRIVER_CATALOG)) {\n merged.set(info.id, info);\n }\n for (const meta of pluginRegistry.list(\"driver\")) {\n if (!merged.has(meta.id)) {\n // Third-party drivers carry no DriverInfo row; read the capability flags\n // off the registered target (defaulting to conservative false) so a\n // model-agnostic / in-band-abort backend can still advertise them.\n const target = pluginRegistry.get(\"driver\", meta.id);\n merged.set(meta.id, {\n id: meta.id,\n name: meta.displayName,\n modelAgnostic: target?.modelAgnostic ?? false,\n supportsInBandAbort: target?.supportsInBandAbort ?? false,\n });\n }\n }\n return [...merged.values()];\n}\n\n/**\n * List models available to a specific driver without starting a full agent session.\n *\n * Ensures the built-in driver targets are registered (idempotent), then\n * delegates to the target's optional `listModels()`. API keys are forwarded so\n * drivers can authenticate against provider REST APIs if needed. Throws on an\n * unknown / not-bundled id (same contract as {@link createDriver}); returns `[]`\n * only when the target exists but exposes no `listModels`.\n *\n * @param driverId - Registered driver id (e.g. `\"omp\"`, `\"claude-sdk\"`, `\"codex\"`).\n * @param apiKeys - Provider API keys keyed by provider name (e.g. `{ anthropic: \"sk-...\" }`).\n * Pass `settings.apiKeys ?? {}` from forge-assistant's resolved settings.\n * @throws {Error} When `driverId` is unknown or excluded from this build.\n * @docLink packages/bridge/api-reference#registry\n */\nexport async function listModelsForDriver(\n driverId: string,\n apiKeys: Record<string, string>,\n): Promise<ModelEntry[]> {\n const target = await resolveDriverTarget(driverId);\n return (await target.listModels?.(apiKeys)) ?? [];\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { resolveSkWorkspaceConfig } from './chunk-TKOLD2O7.js';
1
+ import { resolveSkWorkspaceConfig } from './chunk-J3VKAEQP.js';
2
2
  import { createLogger } from './chunk-24UIWON4.js';
3
3
 
4
4
  // connectors/src/secrets.ts
@@ -302,5 +302,5 @@ function resolveAuthRef(auth, mountId) {
302
302
  }
303
303
 
304
304
  export { EnvSecretProvider, ForgeSecretProvider, InMemorySecretProvider, LegacyAuthGrammarError, LockedSecretProvider, OAuthRequiredError, PreMintedSecretProvider, SecretProviderChain, createCliSecretProviderChain, createForgeSecretProviderChain, loadConnectorDeclarations, resolveAuth, resolveAuthRef, resolveBackendAuthFor };
305
- //# sourceMappingURL=chunk-GKM6MDUC.js.map
306
- //# sourceMappingURL=chunk-GKM6MDUC.js.map
305
+ //# sourceMappingURL=chunk-APAOQLPT.js.map
306
+ //# sourceMappingURL=chunk-APAOQLPT.js.map