@skaile/workspaces 4.33.0 → 4.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +3 -3
  3. package/dist/{asset-feeds-CZGV7GCG.js → asset-feeds-NL3526ZV.js} +11 -11
  4. package/dist/{asset-feeds-CZGV7GCG.js.map → asset-feeds-NL3526ZV.js.map} +1 -1
  5. package/dist/asset-manager/catalog-deployer.js +5 -5
  6. package/dist/asset-manager/index.js +11 -11
  7. package/dist/asset-manager/installer.js +8 -8
  8. package/dist/asset-manager/renderers.js +2 -2
  9. package/dist/asset-manager/src/index.d.ts +30 -24
  10. package/dist/asset-manager/src/index.d.ts.map +1 -1
  11. package/dist/asset-manager/src/renderers.d.ts +2 -2
  12. package/dist/bridge/drivers/claude-sdk.js +9 -9
  13. package/dist/bridge/drivers/codex.js +8 -8
  14. package/dist/bridge/drivers/continue.js +10 -10
  15. package/dist/bridge/drivers/continue.js.map +1 -1
  16. package/dist/bridge/drivers/echo.js +2 -2
  17. package/dist/bridge/drivers/gemini.js +6 -6
  18. package/dist/bridge/drivers/goose.js +10 -10
  19. package/dist/bridge/drivers/goose.js.map +1 -1
  20. package/dist/bridge/drivers/omp.js +3 -3
  21. package/dist/bridge/drivers/omp.js.map +1 -1
  22. package/dist/bridge/drivers/opencode.js +11 -11
  23. package/dist/bridge/drivers/opencode.js.map +1 -1
  24. package/dist/bridge/drivers/qwen.js +6 -6
  25. package/dist/bridge/index.js +10 -10
  26. package/dist/bridge/src/capability-dispatch.d.ts +1 -1
  27. package/dist/bridge/src/drivers/_subprocess-cli.d.ts +3 -3
  28. package/dist/bridge/src/drivers/continue.d.ts +1 -1
  29. package/dist/bridge/src/drivers/gemini.d.ts +3 -3
  30. package/dist/bridge/src/drivers/goose.d.ts +1 -1
  31. package/dist/bridge/src/drivers/opencode.d.ts +1 -1
  32. package/dist/bridge/src/provider-materialize/continue-config-yaml.d.ts +2 -2
  33. package/dist/bridge/src/provider-materialize/credential-env.d.ts +4 -4
  34. package/dist/bridge/src/provider-materialize/env-drivers.d.ts +18 -18
  35. package/dist/bridge/src/provider-materialize/goose-custom-providers.d.ts +1 -1
  36. package/dist/bridge/src/provider-materialize/opencode-config.d.ts +1 -1
  37. package/dist/bridge/src/provider-materialize/session-config-home.d.ts +5 -5
  38. package/dist/bridge/src/registry.d.ts +10 -10
  39. package/dist/bridge/src/types.d.ts +9 -9
  40. package/dist/{chunk-AAPFZCQX.js → chunk-24X2GGSC.js} +6 -6
  41. package/dist/{chunk-AAPFZCQX.js.map → chunk-24X2GGSC.js.map} +1 -1
  42. package/dist/{chunk-WPISSDEI.js → chunk-3ELIPWCH.js} +6 -6
  43. package/dist/{chunk-WPISSDEI.js.map → chunk-3ELIPWCH.js.map} +1 -1
  44. package/dist/{chunk-HL6SZ7Z3.js → chunk-5YXKEM7Q.js} +7 -7
  45. package/dist/{chunk-HL6SZ7Z3.js.map → chunk-5YXKEM7Q.js.map} +1 -1
  46. package/dist/{chunk-HXC5VF3L.js → chunk-66A35U4V.js} +36 -35
  47. package/dist/chunk-66A35U4V.js.map +1 -0
  48. package/dist/{chunk-ENUCD5MW.js → chunk-75LXFKQR.js} +4 -4
  49. package/dist/{chunk-ENUCD5MW.js.map → chunk-75LXFKQR.js.map} +1 -1
  50. package/dist/{chunk-GMXG2JGN.js → chunk-7ERHZQ7O.js} +3 -3
  51. package/dist/{chunk-GMXG2JGN.js.map → chunk-7ERHZQ7O.js.map} +1 -1
  52. package/dist/{chunk-JULFGNQN.js → chunk-7HJ6SFFF.js} +3 -3
  53. package/dist/{chunk-JULFGNQN.js.map → chunk-7HJ6SFFF.js.map} +1 -1
  54. package/dist/{chunk-DKCFWSVW.js → chunk-7LBPHRRP.js} +3 -3
  55. package/dist/chunk-7LBPHRRP.js.map +1 -0
  56. package/dist/{chunk-A7WRTOFI.js → chunk-AKO6XHGV.js} +5 -5
  57. package/dist/{chunk-A7WRTOFI.js.map → chunk-AKO6XHGV.js.map} +1 -1
  58. package/dist/{chunk-3C6Q6TCZ.js → chunk-AO7TCPOS.js} +62 -18
  59. package/dist/chunk-AO7TCPOS.js.map +1 -0
  60. package/dist/{chunk-54A5QAIV.js → chunk-C3256F2F.js} +2 -2
  61. package/dist/{chunk-54A5QAIV.js.map → chunk-C3256F2F.js.map} +1 -1
  62. package/dist/{chunk-2JANXYTJ.js → chunk-DHLE66FV.js} +3 -3
  63. package/dist/{chunk-2JANXYTJ.js.map → chunk-DHLE66FV.js.map} +1 -1
  64. package/dist/{chunk-BR2IXOWX.js → chunk-DOF77WEV.js} +6 -6
  65. package/dist/{chunk-BR2IXOWX.js.map → chunk-DOF77WEV.js.map} +1 -1
  66. package/dist/{chunk-MENCWIHW.js → chunk-EB4ZTESQ.js} +4 -4
  67. package/dist/chunk-EB4ZTESQ.js.map +1 -0
  68. package/dist/{chunk-XUVQSDNV.js → chunk-GKTFGCQZ.js} +3 -3
  69. package/dist/chunk-GKTFGCQZ.js.map +1 -0
  70. package/dist/{chunk-GTVQUHBN.js → chunk-GORUF3YZ.js} +10 -10
  71. package/dist/{chunk-GTVQUHBN.js.map → chunk-GORUF3YZ.js.map} +1 -1
  72. package/dist/{chunk-ACDHNOT7.js → chunk-IFUQ6XBQ.js} +87 -10
  73. package/dist/chunk-IFUQ6XBQ.js.map +1 -0
  74. package/dist/{chunk-6J4WBP3C.js → chunk-IGNY4C6K.js} +21 -21
  75. package/dist/{chunk-6J4WBP3C.js.map → chunk-IGNY4C6K.js.map} +1 -1
  76. package/dist/{chunk-I6NZG7WX.js → chunk-J4ANCOQ4.js} +6 -6
  77. package/dist/chunk-J4ANCOQ4.js.map +1 -0
  78. package/dist/{chunk-5RHPNNWP.js → chunk-JRIU5GA7.js} +3 -3
  79. package/dist/{chunk-5RHPNNWP.js.map → chunk-JRIU5GA7.js.map} +1 -1
  80. package/dist/{chunk-F3HNW354.js → chunk-KIFJWSNC.js} +3 -3
  81. package/dist/{chunk-F3HNW354.js.map → chunk-KIFJWSNC.js.map} +1 -1
  82. package/dist/{chunk-DF7C3KZK.js → chunk-LRCSWOZO.js} +14 -14
  83. package/dist/chunk-LRCSWOZO.js.map +1 -0
  84. package/dist/{chunk-TAZMDZFP.js → chunk-MTWZ7KHZ.js} +3 -3
  85. package/dist/{chunk-TAZMDZFP.js.map → chunk-MTWZ7KHZ.js.map} +1 -1
  86. package/dist/{chunk-QDRQKQOU.js → chunk-N2UGG6WV.js} +3 -3
  87. package/dist/{chunk-QDRQKQOU.js.map → chunk-N2UGG6WV.js.map} +1 -1
  88. package/dist/{chunk-4T25XCWX.js → chunk-NVQLE4MK.js} +3 -3
  89. package/dist/{chunk-4T25XCWX.js.map → chunk-NVQLE4MK.js.map} +1 -1
  90. package/dist/{chunk-C4JDLXPI.js → chunk-QJOOD3OV.js} +3 -3
  91. package/dist/{chunk-C4JDLXPI.js.map → chunk-QJOOD3OV.js.map} +1 -1
  92. package/dist/{chunk-NPS765HV.js → chunk-RHESVS7V.js} +9 -9
  93. package/dist/{chunk-NPS765HV.js.map → chunk-RHESVS7V.js.map} +1 -1
  94. package/dist/{chunk-6GSZLKA5.js → chunk-T762W5CI.js} +3 -3
  95. package/dist/chunk-T762W5CI.js.map +1 -0
  96. package/dist/{chunk-3ZE7X5Y6.js → chunk-TB3LJ6NA.js} +3 -3
  97. package/dist/{chunk-3ZE7X5Y6.js.map → chunk-TB3LJ6NA.js.map} +1 -1
  98. package/dist/{chunk-N7B3LZ7V.js → chunk-TGE33MKN.js} +2 -2
  99. package/dist/{chunk-N7B3LZ7V.js.map → chunk-TGE33MKN.js.map} +1 -1
  100. package/dist/{chunk-DRAI3JH5.js → chunk-TGJIX77V.js} +11 -11
  101. package/dist/chunk-TGJIX77V.js.map +1 -0
  102. package/dist/{chunk-UWJAJP6T.js → chunk-TTITGVXV.js} +2 -2
  103. package/dist/{chunk-UWJAJP6T.js.map → chunk-TTITGVXV.js.map} +1 -1
  104. package/dist/{chunk-N3AH66VX.js → chunk-TUTVTGMG.js} +4 -4
  105. package/dist/{chunk-N3AH66VX.js.map → chunk-TUTVTGMG.js.map} +1 -1
  106. package/dist/{chunk-HGPSZXZP.js → chunk-VOXFI3XS.js} +3 -3
  107. package/dist/{chunk-HGPSZXZP.js.map → chunk-VOXFI3XS.js.map} +1 -1
  108. package/dist/{chunk-SK36WO2Z.js → chunk-XTOTP7MJ.js} +2 -2
  109. package/dist/{chunk-SK36WO2Z.js.map → chunk-XTOTP7MJ.js.map} +1 -1
  110. package/dist/cli/index.js +119 -119
  111. package/dist/cli/index.js.map +1 -1
  112. package/dist/cli/src/commands/catalog.d.ts +1 -1
  113. package/dist/cli/src/commands/integration.d.ts +2 -2
  114. package/dist/cli/src/commands/plugin/claude-code.d.ts +2 -2
  115. package/dist/cli/src/commands/plugin/codex.d.ts +2 -2
  116. package/dist/cli/src/commands/plugin/omp.d.ts +2 -2
  117. package/dist/cli/src/commands/plugin/types.d.ts +13 -13
  118. package/dist/cli/src/commands/plugin/types.d.ts.map +1 -1
  119. package/dist/cli/src/commands/run.d.ts +1 -1
  120. package/dist/connectors/config.js +3 -3
  121. package/dist/connectors/index.js +13 -13
  122. package/dist/connectors/src/connect-failure-carry-over.d.ts +38 -0
  123. package/dist/connectors/src/connect-failure-carry-over.d.ts.map +1 -0
  124. package/dist/connectors/src/connector-manager.d.ts +15 -0
  125. package/dist/connectors/src/connector-manager.d.ts.map +1 -1
  126. package/dist/connectors/src/index.d.ts +1 -0
  127. package/dist/connectors/src/index.d.ts.map +1 -1
  128. package/dist/core/driver-targets.js +1 -1
  129. package/dist/core/index.js +5 -5
  130. package/dist/core/runtime-assets.js +3 -3
  131. package/dist/core/src/driver-targets.d.ts +8 -8
  132. package/dist/core/src/index.d.ts +8 -2
  133. package/dist/core/src/index.d.ts.map +1 -1
  134. package/dist/core/src/settings.d.ts +1 -1
  135. package/dist/core/src/workspace-config.d.ts +16 -15
  136. package/dist/core/src/workspace-config.d.ts.map +1 -1
  137. package/dist/core/store.js +2 -2
  138. package/dist/core/workspace-config.js +2 -2
  139. package/dist/deploy/index.js +5 -5
  140. package/dist/discovery/index.js +2 -2
  141. package/dist/{ensure-sources-JGKHWDC4.js → ensure-sources-DVPPPCBS.js} +14 -14
  142. package/dist/{ensure-sources-JGKHWDC4.js.map → ensure-sources-DVPPPCBS.js.map} +1 -1
  143. package/dist/factory-assets/connectors/box.js +13 -13
  144. package/dist/factory-assets/connectors/deploy.js +13 -13
  145. package/dist/factory-assets/connectors/devserver.js +13 -13
  146. package/dist/factory-assets/connectors/flow/CONNECTOR.md +2 -2
  147. package/dist/factory-assets/connectors/flow/adapter.js +13 -13
  148. package/dist/factory-assets/connectors/flow/engine.js +6 -6
  149. package/dist/factory-assets/connectors/flow/run-flow.d.ts +1 -1
  150. package/dist/factory-assets/connectors/flow/run-flow.js +14 -14
  151. package/dist/factory-assets/connectors/flow/subprompt-runner.d.ts +3 -3
  152. package/dist/factory-assets/connectors/flow/subprompt-runner.d.ts.map +1 -1
  153. package/dist/factory-assets/connectors/flow.js +13 -13
  154. package/dist/factory-assets/connectors/git.js +13 -13
  155. package/dist/factory-assets/connectors/gmail.js +13 -13
  156. package/dist/factory-assets/connectors/googledrive.js +13 -13
  157. package/dist/factory-assets/connectors/local.js +13 -13
  158. package/dist/factory-assets/connectors/mattermost.js +13 -13
  159. package/dist/factory-assets/connectors/memory.js +13 -13
  160. package/dist/factory-assets/connectors/minio.js +13 -13
  161. package/dist/factory-assets/connectors/postgres.js +13 -13
  162. package/dist/factory-assets/connectors/s3.js +13 -13
  163. package/dist/factory-assets/connectors/sharepoint.js +13 -13
  164. package/dist/factory-assets/connectors/sqlite.js +13 -13
  165. package/dist/factory-assets/connectors/static-server.js +13 -13
  166. package/dist/factory-assets/connectors/tunnel.js +13 -13
  167. package/dist/factory-assets/connectors/webdav.js +13 -13
  168. package/dist/factory-assets/connectors/xstate-store.js +13 -13
  169. package/dist/factory-assets/connectors/xstate.js +13 -13
  170. package/dist/{flows-QTUSWYKY.js → flows-X7JFAVRR.js} +8 -8
  171. package/dist/{flows-QTUSWYKY.js.map → flows-X7JFAVRR.js.map} +1 -1
  172. package/dist/{helpers-6X4HJKWS.js → helpers-KLO5VUVZ.js} +14 -14
  173. package/dist/{helpers-6X4HJKWS.js.map → helpers-KLO5VUVZ.js.map} +1 -1
  174. package/dist/library/index.js +8 -8
  175. package/dist/{library-publish-MGN3N73A.js → library-publish-X6JGR7K3.js} +18 -18
  176. package/dist/{library-publish-MGN3N73A.js.map → library-publish-X6JGR7K3.js.map} +1 -1
  177. package/dist/{open-library-4PFE2CJ7.js → open-library-S2ZFKJUK.js} +16 -16
  178. package/dist/{open-library-4PFE2CJ7.js.map → open-library-S2ZFKJUK.js.map} +1 -1
  179. package/dist/{paths-IOOMNHTC.js → paths-OI5IIS22.js} +8 -8
  180. package/dist/{paths-IOOMNHTC.js.map → paths-OI5IIS22.js.map} +1 -1
  181. package/dist/plugin-registry/src/targets.d.ts +5 -5
  182. package/dist/plugin-registry/src/targets.d.ts.map +1 -1
  183. package/dist/{plugin-store-OIIPB2MQ.js → plugin-store-C67RLSPD.js} +7 -7
  184. package/dist/{plugin-store-OIIPB2MQ.js.map → plugin-store-C67RLSPD.js.map} +1 -1
  185. package/dist/{project-MD4HQ62C.js → project-7VOTYB7O.js} +15 -15
  186. package/dist/{project-MD4HQ62C.js.map → project-7VOTYB7O.js.map} +1 -1
  187. package/dist/resolver/index.js +5 -5
  188. package/dist/runner/index.js +18 -18
  189. package/dist/runner/src/manifest.d.ts +1 -1
  190. package/dist/runner/src/resources.d.ts.map +1 -1
  191. package/dist/runner/src/serve.d.ts +47 -1
  192. package/dist/runner/src/serve.d.ts.map +1 -1
  193. package/dist/runner/src/session-builder.d.ts +2 -2
  194. package/dist/runner/src/session-stimulus.d.ts +5 -0
  195. package/dist/runner/src/session-stimulus.d.ts.map +1 -1
  196. package/dist/runner/src/session.d.ts +1 -1
  197. package/dist/runner/src/session.d.ts.map +1 -1
  198. package/dist/sdk/asset-manager.js +11 -11
  199. package/dist/sdk/bridge.js +10 -10
  200. package/dist/sdk/core.js +5 -5
  201. package/dist/sdk/flow.js +6 -6
  202. package/dist/sdk/index.js +18 -18
  203. package/dist/sdk/resolver.js +5 -5
  204. package/dist/sdk/runner.js +18 -18
  205. package/dist/{setup-PB35G5SG.js → setup-RO3PGJYS.js} +19 -19
  206. package/dist/{setup-PB35G5SG.js.map → setup-RO3PGJYS.js.map} +1 -1
  207. package/dist/{skills-DH75K326.js → skills-4YTVHMOH.js} +7 -7
  208. package/dist/{skills-DH75K326.js.map → skills-4YTVHMOH.js.map} +1 -1
  209. package/dist/{source-Y5OF6IZU.js → source-ZZLLOP2U.js} +17 -17
  210. package/dist/{source-Y5OF6IZU.js.map → source-ZZLLOP2U.js.map} +1 -1
  211. package/dist/{source-manifest-publish-YWFVYTEI.js → source-manifest-publish-7WRQDIXO.js} +19 -19
  212. package/dist/{source-manifest-publish-YWFVYTEI.js.map → source-manifest-publish-7WRQDIXO.js.map} +1 -1
  213. package/dist/tui/index.js +18 -18
  214. package/dist/types/manifests.js +1 -1
  215. package/dist/types/src/manifests/agent.d.ts +4 -4
  216. package/dist/types/src/runtime.d.ts +4 -4
  217. package/dist/workspace-plugin/adapters/mcp.js +7 -7
  218. package/dist/workspace-plugin/adapters/omp.js +7 -7
  219. package/dist/workspace-plugin/index.js +1 -1
  220. package/dist/workspace-plugin/src/plugin.d.ts +1 -1
  221. package/package.json +1 -1
  222. package/dist/chunk-3C6Q6TCZ.js.map +0 -1
  223. package/dist/chunk-6GSZLKA5.js.map +0 -1
  224. package/dist/chunk-ACDHNOT7.js.map +0 -1
  225. package/dist/chunk-DF7C3KZK.js.map +0 -1
  226. package/dist/chunk-DKCFWSVW.js.map +0 -1
  227. package/dist/chunk-DRAI3JH5.js.map +0 -1
  228. package/dist/chunk-HXC5VF3L.js.map +0 -1
  229. package/dist/chunk-I6NZG7WX.js.map +0 -1
  230. package/dist/chunk-MENCWIHW.js.map +0 -1
  231. package/dist/chunk-XUVQSDNV.js.map +0 -1
@@ -116,7 +116,7 @@ export interface BridgeCapabilityHooks {
116
116
  sessionId: string;
117
117
  }
118
118
  /**
119
- * Static metadata for a registered agent driver backend.
119
+ * Static metadata for a registered agent driver (the harness it drives).
120
120
  *
121
121
  * Declared once in `@skaile/workspaces/types` — it is protocol surface (the
122
122
  * platform reads `surfaces` to decide which AI provider registry entries a
@@ -789,7 +789,7 @@ export type AgentEvent = {
789
789
  [k: string]: any;
790
790
  };
791
791
  /**
792
- * Abstract base class for agent driver backends.
792
+ * Abstract base class for agent drivers.
793
793
  *
794
794
  * Wraps an LLM coding agent behind a single `prompt()` interface.
795
795
  * All drivers emit `'agent-event'` with {@link AgentEvent} payloads.
@@ -815,11 +815,11 @@ export declare abstract class AgentDriver extends EventEmitter {
815
815
  /** Static metadata describing this driver's capabilities. */
816
816
  abstract readonly driverInfo: DriverInfo;
817
817
  /**
818
- * Initialises the driver backend — spawns the child process (omp) or loads
819
- * the SDK module (claude-sdk). Resolves when the backend is ready to accept
818
+ * Initialises the driver's harness — spawns the child process (omp) or loads
819
+ * the SDK module (claude-sdk). Resolves when the harness is ready to accept
820
820
  * prompts. Idempotent: calling `start()` on an already-running driver is a no-op.
821
821
  *
822
- * @throws {Error} When the backend binary is missing or the SDK cannot be loaded.
822
+ * @throws {Error} When the harness binary is missing or the SDK cannot be loaded.
823
823
  */
824
824
  abstract start(): Promise<void>;
825
825
  /**
@@ -827,7 +827,7 @@ export declare abstract class AgentDriver extends EventEmitter {
827
827
  * (i.e. after the `agent_end` event has been emitted).
828
828
  *
829
829
  * @param message - Plain-text user prompt to send to the agent.
830
- * @throws {Error} When the driver is not running or the underlying backend reports a fatal error.
830
+ * @throws {Error} When the driver is not running or the underlying harness reports a fatal error.
831
831
  */
832
832
  abstract prompt(message: string): Promise<void>;
833
833
  /** Preserve text-only callers; drivers must explicitly support attachments. */
@@ -843,14 +843,14 @@ export declare abstract class AgentDriver extends EventEmitter {
843
843
  */
844
844
  abstract abort(): Promise<void>;
845
845
  /**
846
- * Terminates the agent backend immediately (SIGTERM for subprocess drivers,
846
+ * Terminates the agent harness immediately (SIGTERM for subprocess drivers,
847
847
  * `close()` for in-process drivers). The driver instance must not be reused
848
848
  * after `kill()`.
849
849
  */
850
850
  abstract kill(): void;
851
- /** Stop the driver and await owned process/state cleanup when the backend supports it. */
851
+ /** Stop the driver and await owned process/state cleanup when the harness supports it. */
852
852
  dispose(): Promise<void>;
853
- /** `true` when the backend is alive and able to accept new prompts. */
853
+ /** `true` when the harness is alive and able to accept new prompts. */
854
854
  abstract get isRunning(): boolean;
855
855
  /** Optional provider-native session/thread identifier for resume support. */
856
856
  get runtimeSessionId(): string | undefined;
@@ -1,7 +1,7 @@
1
- import { logErr } from './chunk-C4JDLXPI.js';
2
- import { flowKindProvider } from './chunk-JULFGNQN.js';
3
- import { knowledgeKindProvider } from './chunk-BR2IXOWX.js';
4
- import { createDefaultRegistry } from './chunk-HGPSZXZP.js';
1
+ import { logErr } from './chunk-QJOOD3OV.js';
2
+ import { flowKindProvider } from './chunk-7HJ6SFFF.js';
3
+ import { knowledgeKindProvider } from './chunk-DOF77WEV.js';
4
+ import { createDefaultRegistry } from './chunk-VOXFI3XS.js';
5
5
 
6
6
  // cli/src/open-registry.ts
7
7
  function createFullRegistry() {
@@ -103,5 +103,5 @@ async function openLibraryManager() {
103
103
  }
104
104
 
105
105
  export { LocalCatalogDisabledError, createFullRegistry, openCatalogSource, openLibrary, openLibraryManager, resolveCatalogSource };
106
- //# sourceMappingURL=chunk-AAPFZCQX.js.map
107
- //# sourceMappingURL=chunk-AAPFZCQX.js.map
106
+ //# sourceMappingURL=chunk-24X2GGSC.js.map
107
+ //# sourceMappingURL=chunk-24X2GGSC.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,W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EAAY;AAClC,EAAA,MAAM,OAAA,GAAU,IAAI,cAAA,CAAe,OAAO,CAAA;AAC1C,EAAA,OAAO,EAAE,OAAA,EAAS,OAAA,EAAS,OAAO,MAAM,OAAA,CAAQ,OAAM,EAAE;AAC1D","file":"chunk-AAPFZCQX.js","sourcesContent":["/**\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/factory-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 type { AssetKindRegistry } from \"@skaile/workspaces/discovery\";\nimport { createDefaultRegistry } from \"@skaile/workspaces/discovery\";\nimport { flowKindProvider } from \"@skaile/workspaces/factory-assets/connectors/flow/engine\";\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/factory-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/** Thrown by {@link openCatalogSource} when `catalog.url` is the `local` sentinel. */\nexport class LocalCatalogDisabledError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"LocalCatalogDisabledError\";\n }\n}\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 LocalCatalogDisabledError(\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,EAAsB;AACvC,EAAA,QAAA,CAAS,SAAS,gBAAgB,CAAA;AAClC,EAAA,QAAA,CAAS,SAAS,qBAAqB,CAAA;AACvC,EAAA,OAAO,QAAA;AACT;;;ACfO,IAAM,yBAAA,GAAN,cAAwC,KAAA,CAAM;AAAA,EACnD,YAAY,OAAA,EAAiB;AAC3B,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,2BAAA;AAAA,EACd;AACF;AASA,eAAsB,WAAA,GAAc;AAClC,EAAA,IAAI;AACF,IAAA,MAAM,EAAE,UAAA,EAAW,GAAI,MAAM,OAAO,oBAA4B,CAAA;AAChE,IAAA,OAAO,IAAI,UAAA,CAAW,EAAE,YAAA,EAAc,kBAAA,IAAsB,CAAA;AAAA,EAC9D,SAAS,GAAA,EAAK;AACZ,IAAA,MAAA,CAAO,CAAA,2BAAA,EAA8B,eAAe,KAAA,GAAQ,GAAA,CAAI,UAAU,MAAA,CAAO,GAAG,CAAC,CAAA,CAAE,CAAA;AACvF,IAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA,EAChB;AACF;AAqBA,eAAsB,kBAAkB,IAAA,EAQtC;AACA,EAAA,MAAM,EAAE,eAAe,mBAAA,EAAqB,iBAAA,EAAmB,mBAAkB,GAAI,MAAM,OACzF,oBACF,CAAA;AACA,EAAA,MAAM,MAAM,aAAA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A,CAAQ,OAAA,KAAY,MAAA,GACpB,IAAI,iBAAA,CAAkB,EAAE,OAAA,EAAS,UAAA,EAAY,CAAA,GAC7C,IAAI,oBAAoB,EAAE,OAAA,EAAS,YAAY,CAAA;AACrD,EAAA,OAAO,EAAE,MAAA,EAAQ,KAAA,EAAO,MAAM;AAAA,EAAC,CAAA,EAAE;AACnC;AASA,eAAsB,kBAAA,GAInB;AACD,EAAA,MAAM,EAAE,cAAA,EAAe,GAAI,MAAM,OAAO,oBAA4B,CAAA;AACpE,EAAA,MAAM,OAAA,GAAU,MAAM,WAAA,EAAY;AAClC,EAAA,MAAM,OAAA,GAAU,IAAI,cAAA,CAAe,OAAO,CAAA;AAC1C,EAAA,OAAO,EAAE,OAAA,EAAS,OAAA,EAAS,OAAO,MAAM,OAAA,CAAQ,OAAM,EAAE;AAC1D","file":"chunk-24X2GGSC.js","sourcesContent":["/**\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/factory-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 type { AssetKindRegistry } from \"@skaile/workspaces/discovery\";\nimport { createDefaultRegistry } from \"@skaile/workspaces/discovery\";\nimport { flowKindProvider } from \"@skaile/workspaces/factory-assets/connectors/flow/engine\";\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/factory-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/** Thrown by {@link openCatalogSource} when `catalog.url` is the `local` sentinel. */\nexport class LocalCatalogDisabledError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"LocalCatalogDisabledError\";\n }\n}\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 LocalCatalogDisabledError(\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,7 +1,7 @@
1
- import { factoryAssetRoots } from './chunk-5RHPNNWP.js';
2
- import { deployedBase } from './chunk-F3HNW354.js';
3
- import { globalSkaileDir, resolveSkWorkspaceConfig } from './chunk-DF7C3KZK.js';
4
- import { SUPPORTED_DRIVER_TARGETS } from './chunk-MENCWIHW.js';
1
+ import { factoryAssetRoots } from './chunk-JRIU5GA7.js';
2
+ import { deployedBase } from './chunk-KIFJWSNC.js';
3
+ import { globalSkaileDir, resolveSkWorkspaceConfig } from './chunk-LRCSWOZO.js';
4
+ import { SUPPORTED_DRIVER_TARGETS } from './chunk-EB4ZTESQ.js';
5
5
  import { validateRegistry, mergeRegistries, validateMergedRegistry } from './chunk-MJHSLODD.js';
6
6
  import fs, { existsSync, writeFileSync, readFileSync, mkdirSync, cpSync, readdirSync } from 'fs';
7
7
  import os, { homedir } from 'os';
@@ -916,5 +916,5 @@ var WorkspaceYamlEditor = class _WorkspaceYamlEditor {
916
916
  };
917
917
 
918
918
  export { ManifestYamlEditor, PROVIDERS_FILENAME, SETTINGS_DEFAULTS, WorkspaceYamlEditor, aiResourceRoots, applyPatch, buildLockFile, checkAgentSkillConformance, computeHash, defaultLibraryDir, extractForPatch, generatePatch, globalSettingsPath, listPatches, loadProviderRegistry, loadProviderRegistryFile, loadSettings, mapLegacyFields, maskApiKey, migrateSettings, projectSettingsPath, readLock, readPatch, readPluginsLockSlice, resolveLibraryDir, resolveSettings, savePatch, saveProviderRegistryFile, saveSettings, skaileHomeDir, userProviderRegistryPath, verifyLock, walkForSettings, workspaceProviderRegistryPath, writeLock, writePluginsLockSlice };
919
- //# sourceMappingURL=chunk-WPISSDEI.js.map
920
- //# sourceMappingURL=chunk-WPISSDEI.js.map
919
+ //# sourceMappingURL=chunk-3ELIPWCH.js.map
920
+ //# sourceMappingURL=chunk-3ELIPWCH.js.map