@skaile/workspaces 0.50.0 → 0.53.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 (181) hide show
  1. package/CHANGELOG.md +232 -0
  2. package/dist/asset-feeds-OEGJ6NOF.js +205 -0
  3. package/dist/asset-feeds-OEGJ6NOF.js.map +1 -0
  4. package/dist/asset-manager/index.js +8 -8
  5. package/dist/asset-manager/installer.js +7 -7
  6. package/dist/asset-manager/src/index.d.ts +83 -7
  7. package/dist/asset-manager/src/index.d.ts.map +1 -1
  8. package/dist/asset-manager/src/installer.d.ts.map +1 -1
  9. package/dist/{chunk-P4BDTJMI.js → chunk-2D5YE3FL.js} +4 -4
  10. package/dist/{chunk-P4BDTJMI.js.map → chunk-2D5YE3FL.js.map} +1 -1
  11. package/dist/{chunk-4IGNQG6E.js → chunk-2ZK7M2SG.js} +3 -3
  12. package/dist/{chunk-4IGNQG6E.js.map → chunk-2ZK7M2SG.js.map} +1 -1
  13. package/dist/{chunk-SXT6BAQJ.js → chunk-3IHBGDCG.js} +2 -2
  14. package/dist/{chunk-SXT6BAQJ.js.map → chunk-3IHBGDCG.js.map} +1 -1
  15. package/dist/{chunk-SDAKQCOB.js → chunk-3KPNDTMR.js} +3 -3
  16. package/dist/{chunk-SDAKQCOB.js.map → chunk-3KPNDTMR.js.map} +1 -1
  17. package/dist/{chunk-2Y4HIITD.js → chunk-7ZWLZ5H3.js} +13 -9
  18. package/dist/chunk-7ZWLZ5H3.js.map +1 -0
  19. package/dist/{chunk-6IDBWPK2.js → chunk-BQCGFPHW.js} +4 -3
  20. package/dist/chunk-BQCGFPHW.js.map +1 -0
  21. package/dist/chunk-BXC5547R.js +377 -0
  22. package/dist/chunk-BXC5547R.js.map +1 -0
  23. package/dist/{chunk-3A3OACI2.js → chunk-EOINYN5T.js} +2 -2
  24. package/dist/{chunk-3A3OACI2.js.map → chunk-EOINYN5T.js.map} +1 -1
  25. package/dist/{chunk-XGCXFX7X.js → chunk-F3HNW354.js} +3 -3
  26. package/dist/{chunk-XGCXFX7X.js.map → chunk-F3HNW354.js.map} +1 -1
  27. package/dist/{chunk-33WB7VFV.js → chunk-LKOMH3QC.js} +3 -3
  28. package/dist/{chunk-33WB7VFV.js.map → chunk-LKOMH3QC.js.map} +1 -1
  29. package/dist/{chunk-O4JH3KUE.js → chunk-MENCWIHW.js} +11 -3
  30. package/dist/chunk-MENCWIHW.js.map +1 -0
  31. package/dist/{chunk-PBO6SCT2.js → chunk-NXC6IEL4.js} +37 -14
  32. package/dist/chunk-NXC6IEL4.js.map +1 -0
  33. package/dist/{chunk-EBSIZYM6.js → chunk-QLLFCQU5.js} +12 -12
  34. package/dist/chunk-QLLFCQU5.js.map +1 -0
  35. package/dist/{chunk-X46FY45B.js → chunk-SKADPHAM.js} +12 -8
  36. package/dist/chunk-SKADPHAM.js.map +1 -0
  37. package/dist/{chunk-C5RYGUF4.js → chunk-TCNYSHPM.js} +157 -31
  38. package/dist/chunk-TCNYSHPM.js.map +1 -0
  39. package/dist/{chunk-JXHULIOA.js → chunk-UTHEIPEY.js} +387 -42
  40. package/dist/chunk-UTHEIPEY.js.map +1 -0
  41. package/dist/{chunk-LV73DB4G.js → chunk-V4BGVOJC.js} +26 -22
  42. package/dist/chunk-V4BGVOJC.js.map +1 -0
  43. package/dist/{chunk-ZJ3VRPOI.js → chunk-VE2UIJ7Y.js} +11 -15
  44. package/dist/chunk-VE2UIJ7Y.js.map +1 -0
  45. package/dist/{chunk-H74X4TSR.js → chunk-VGT2R662.js} +6 -6
  46. package/dist/{chunk-H74X4TSR.js.map → chunk-VGT2R662.js.map} +1 -1
  47. package/dist/{chunk-WBF7JLTY.js → chunk-W53D5Q52.js} +4 -4
  48. package/dist/{chunk-WBF7JLTY.js.map → chunk-W53D5Q52.js.map} +1 -1
  49. package/dist/{chunk-HNORRENR.js → chunk-WD2NRI3T.js} +5 -5
  50. package/dist/{chunk-HNORRENR.js.map → chunk-WD2NRI3T.js.map} +1 -1
  51. package/dist/cli/index.js +679 -477
  52. package/dist/cli/index.js.map +1 -1
  53. package/dist/cli/src/asset-feeds.d.ts +17 -3
  54. package/dist/cli/src/asset-feeds.d.ts.map +1 -1
  55. package/dist/cli/src/commands/catalog.d.ts +3 -2
  56. package/dist/cli/src/commands/catalog.d.ts.map +1 -1
  57. package/dist/cli/src/commands/manage.d.ts +47 -8
  58. package/dist/cli/src/commands/manage.d.ts.map +1 -1
  59. package/dist/cli/src/commands/project.d.ts.map +1 -1
  60. package/dist/cli/src/commands/source.d.ts +32 -0
  61. package/dist/cli/src/commands/source.d.ts.map +1 -1
  62. package/dist/cli/src/commands/update.d.ts +7 -0
  63. package/dist/cli/src/commands/update.d.ts.map +1 -1
  64. package/dist/connectors/config.js +7 -7
  65. package/dist/connectors/index.js +9 -9
  66. package/dist/connectors/src/config.d.ts +5 -13
  67. package/dist/connectors/src/config.d.ts.map +1 -1
  68. package/dist/connectors/src/index.d.ts +1 -1
  69. package/dist/connectors/src/index.d.ts.map +1 -1
  70. package/dist/core/driver-targets.js +1 -1
  71. package/dist/core/index.js +6 -6
  72. package/dist/core/manifest.js +1 -1
  73. package/dist/core/runtime-assets.js +4 -3
  74. package/dist/core/src/cache-paths.d.ts +6 -0
  75. package/dist/core/src/cache-paths.d.ts.map +1 -1
  76. package/dist/core/src/driver-targets.d.ts +12 -7
  77. package/dist/core/src/driver-targets.d.ts.map +1 -1
  78. package/dist/core/src/index.d.ts +3 -3
  79. package/dist/core/src/index.d.ts.map +1 -1
  80. package/dist/core/src/manifest.d.ts +6 -6
  81. package/dist/core/src/manifest.d.ts.map +1 -1
  82. package/dist/core/src/workspace-config.d.ts +36 -0
  83. package/dist/core/src/workspace-config.d.ts.map +1 -1
  84. package/dist/core/store.js +2 -2
  85. package/dist/core/workspace-config.js +3 -2
  86. package/dist/deploy/index.js +6 -6
  87. package/dist/discovery/index.js +2 -2
  88. package/dist/discovery/src/atomization-conventions.d.ts +30 -0
  89. package/dist/discovery/src/atomization-conventions.d.ts.map +1 -0
  90. package/dist/discovery/src/builtin-providers.d.ts.map +1 -1
  91. package/dist/discovery/src/discover-manifest.d.ts.map +1 -1
  92. package/dist/discovery/src/discover.d.ts +38 -0
  93. package/dist/discovery/src/discover.d.ts.map +1 -1
  94. package/dist/discovery/src/index.d.ts +5 -2
  95. package/dist/discovery/src/index.d.ts.map +1 -1
  96. package/dist/discovery/src/reference-lint.d.ts +112 -0
  97. package/dist/discovery/src/reference-lint.d.ts.map +1 -0
  98. package/dist/discovery/src/requires-graph.d.ts +1 -1
  99. package/dist/discovery/src/tree-entries.d.ts +9 -1
  100. package/dist/discovery/src/tree-entries.d.ts.map +1 -1
  101. package/dist/{ensure-sources-EE7Z2HKS.js → ensure-sources-GJOXWVWO.js} +8 -8
  102. package/dist/{ensure-sources-EE7Z2HKS.js.map → ensure-sources-GJOXWVWO.js.map} +1 -1
  103. package/dist/factory-assets/connectors/deploy.js +9 -9
  104. package/dist/factory-assets/connectors/devserver.js +9 -9
  105. package/dist/factory-assets/connectors/flow/adapter.js +9 -9
  106. package/dist/factory-assets/connectors/flow/engine/flow-kind-provider.d.ts +1 -1
  107. package/dist/factory-assets/connectors/flow/engine/flow-kind-provider.d.ts.map +1 -1
  108. package/dist/factory-assets/connectors/flow/engine.js +7 -7
  109. package/dist/factory-assets/connectors/flow/run-flow.js +10 -10
  110. package/dist/factory-assets/connectors/flow.js +9 -9
  111. package/dist/factory-assets/connectors/git.js +9 -9
  112. package/dist/factory-assets/connectors/gmail/adapter.d.ts.map +1 -1
  113. package/dist/factory-assets/connectors/gmail.js +9 -9
  114. package/dist/factory-assets/connectors/googledrive.js +9 -9
  115. package/dist/factory-assets/connectors/local.js +9 -9
  116. package/dist/factory-assets/connectors/mattermost/adapter.d.ts.map +1 -1
  117. package/dist/factory-assets/connectors/mattermost.js +9 -9
  118. package/dist/factory-assets/connectors/memory.js +9 -9
  119. package/dist/factory-assets/connectors/minio/adapter.d.ts.map +1 -1
  120. package/dist/factory-assets/connectors/minio.js +9 -9
  121. package/dist/factory-assets/connectors/postgres/adapter.d.ts.map +1 -1
  122. package/dist/factory-assets/connectors/postgres.js +9 -9
  123. package/dist/factory-assets/connectors/s3/driver.d.ts.map +1 -1
  124. package/dist/factory-assets/connectors/s3.js +9 -9
  125. package/dist/factory-assets/connectors/sharepoint.js +9 -9
  126. package/dist/factory-assets/connectors/sqlite/adapter.d.ts.map +1 -1
  127. package/dist/factory-assets/connectors/sqlite.js +9 -9
  128. package/dist/factory-assets/connectors/static-server.js +9 -9
  129. package/dist/factory-assets/connectors/tunnel.js +9 -9
  130. package/dist/factory-assets/connectors/webdav.js +9 -9
  131. package/dist/factory-assets/connectors/xstate-store.js +9 -9
  132. package/dist/factory-assets/connectors/xstate.js +9 -9
  133. package/dist/{flows-AAHXXXCH.js → flows-AGPIE6JM.js} +3 -3
  134. package/dist/{flows-AAHXXXCH.js.map → flows-AGPIE6JM.js.map} +1 -1
  135. package/dist/library/index.js +8 -8
  136. package/dist/library/install.js +6 -6
  137. package/dist/open-library-ERKRGH4B.js +23 -0
  138. package/dist/{open-library-TXJMFG34.js.map → open-library-ERKRGH4B.js.map} +1 -1
  139. package/dist/paths-D6RUQ522.js +15 -0
  140. package/dist/{paths-OMVC4UWY.js.map → paths-D6RUQ522.js.map} +1 -1
  141. package/dist/{plugin-store-JWJHIPUT.js → plugin-store-SGNJTBYS.js} +8 -8
  142. package/dist/{plugin-store-JWJHIPUT.js.map → plugin-store-SGNJTBYS.js.map} +1 -1
  143. package/dist/runner/index.js +11 -11
  144. package/dist/runner/src/serve.d.ts +6 -4
  145. package/dist/runner/src/serve.d.ts.map +1 -1
  146. package/dist/sdk/asset-manager.js +8 -8
  147. package/dist/sdk/core.js +6 -6
  148. package/dist/sdk/flow.js +7 -7
  149. package/dist/sdk/index.js +17 -11
  150. package/dist/sdk/index.js.map +1 -1
  151. package/dist/sdk/runner.js +11 -11
  152. package/dist/sdk/src/transport.d.ts +2 -0
  153. package/dist/sdk/src/transport.d.ts.map +1 -1
  154. package/dist/{setup-ETNBVZQA.js → setup-IV2JFW3T.js} +8 -8
  155. package/dist/{setup-ETNBVZQA.js.map → setup-IV2JFW3T.js.map} +1 -1
  156. package/dist/source-FGOMQMZT.js +24 -0
  157. package/dist/source-FGOMQMZT.js.map +1 -0
  158. package/dist/store-client-GJT2XQ5Z.js +15 -0
  159. package/dist/{store-client-SLFAAKSV.js.map → store-client-GJT2XQ5Z.js.map} +1 -1
  160. package/dist/tui/index.js +11 -11
  161. package/dist/types/src/transport.d.ts +12 -0
  162. package/dist/types/src/transport.d.ts.map +1 -1
  163. package/dist/workspace-plugin/adapters/mcp.js +1 -1
  164. package/dist/workspace-plugin/adapters/omp.js +3 -3
  165. package/dist/workspace-plugin/index.js +1 -1
  166. package/package.json +1 -1
  167. package/dist/asset-feeds-O6R6J4RI.js +0 -128
  168. package/dist/asset-feeds-O6R6J4RI.js.map +0 -1
  169. package/dist/chunk-2Y4HIITD.js.map +0 -1
  170. package/dist/chunk-6IDBWPK2.js.map +0 -1
  171. package/dist/chunk-C5RYGUF4.js.map +0 -1
  172. package/dist/chunk-EBSIZYM6.js.map +0 -1
  173. package/dist/chunk-JXHULIOA.js.map +0 -1
  174. package/dist/chunk-LV73DB4G.js.map +0 -1
  175. package/dist/chunk-O4JH3KUE.js.map +0 -1
  176. package/dist/chunk-PBO6SCT2.js.map +0 -1
  177. package/dist/chunk-X46FY45B.js.map +0 -1
  178. package/dist/chunk-ZJ3VRPOI.js.map +0 -1
  179. package/dist/open-library-TXJMFG34.js +0 -23
  180. package/dist/paths-OMVC4UWY.js +0 -15
  181. package/dist/store-client-SLFAAKSV.js +0 -15
@@ -1 +1 @@
1
- {"version":3,"sources":["../workspace-plugin/src/tools/flows.ts"],"names":[],"mappings":";;;;;AAmBA,eAAsB,SAAS,UAAA,EAAyC;AACtE,EAAA,IAAI;AACF,IAAA,MAAM,UAAA,GAAa,iBAAiB,UAAU,CAAA;AAC9C,IAAA,IAAI,CAAC,UAA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9C,IAAA,IAAI,CAAC,UAAA,EAAY,OAAO,GAAA,CAAI,CAAA,4BAAA,EAA+B,KAAK,CAAA,oBAAA,CAAsB,CAAA;AAEtF,IAAA,MAAM,EAAE,YAAA,EAAa,GAAI,MAAM,OAC7B,4CACF,CAAA;AACA,IAAA,MAAM,KAAA,GAAQ,aAAa,UAAU,CAAA;AACrC,IAAA,MAAM,IAAA,GAAO,MAAM,IAAA,CAAK,CAAC,MAAW,CAAA,CAAE,EAAA,KAAO,QAAQ,MAAM,CAAA;AAC3D,IAAA,IAAI,CAAC,IAAA,EAAM,OAAO,IAAI,CAAA,gBAAA,EAAmB,OAAA,CAAQ,MAAM,CAAA,CAAE,CAAA;AACzD,IAAA,OAAO,OAAO,IAAI,CAAA;AAAA,EACpB,SAAS,CAAA,EAAY;AACnB,IAAA,OAAO,IAAI,CAAA,YAAa,KAAA,GAAQ,EAAE,OAAA,GAAU,MAAA,CAAO,CAAC,CAAC,CAAA;AAAA,EACvD;AACF","file":"chunk-3A3OACI2.js","sourcesContent":["// src/tools/flows.ts\n\nimport type { ToolResult } from \"../types.js\";\nimport { err, okJson } from \"../types.js\";\nimport { findAiAssetsRoot } from \"../utils/ai-assets.js\";\nimport { readAllSessions } from \"./sessions.js\";\n\n// ── Flow tools ────────────────────────────────────────────────────────────────\n\n/**\n * List all flow definitions available in the project's `ai-assets` directory.\n *\n * Returns a JSON array of summary objects `{ id, name, nodeCount }`.\n * Returns an empty array when no `ai-assets` root is found.\n *\n * @param projectDir - Absolute path to the skaile project root.\n *\n * @docLink packages/workspace-plugin/concepts#tool-delivery\n */\nexport async function flowList(projectDir: string): Promise<ToolResult> {\n try {\n const assetsRoot = findAiAssetsRoot(projectDir);\n if (!assetsRoot) return okJson([]);\n const { loadAllFlows } = await import(\n \"@skaile/workspaces/factory-assets/connectors/flow/engine\"\n );\n const flows = loadAllFlows(assetsRoot);\n const summary = flows.map((f: any) => ({\n id: f.id,\n name: f.name ?? f.id,\n nodeCount: f.nodes?.length ?? 0,\n }));\n return okJson(summary);\n } catch (e: unknown) {\n return err(e instanceof Error ? e.message : String(e));\n }\n}\n\n/**\n * Show the full flow definition (nodes, edges, metadata) for a specific flow.\n *\n * @param projectDir - Absolute path to the skaile project root.\n * @param flowId - Flow ID as returned by {@link flowList}.\n *\n * @docLink packages/workspace-plugin/concepts#tool-delivery\n */\nexport async function flowShow(projectDir: string, flowId: string): Promise<ToolResult> {\n try {\n const assetsRoot = findAiAssetsRoot(projectDir);\n if (!assetsRoot) return err(`Flow not found: ${flowId}`);\n const { loadAllFlows } = await import(\n \"@skaile/workspaces/factory-assets/connectors/flow/engine\"\n );\n const flows = loadAllFlows(assetsRoot);\n const flow = flows.find((f: any) => f.id === flowId);\n if (!flow) return err(`Flow not found: ${flowId}`);\n return okJson(flow);\n } catch (e: unknown) {\n return err(e instanceof Error ? e.message : String(e));\n }\n}\n\n/**\n * List all past and active flow run sessions for the workspace.\n *\n * Delegates to {@link readAllSessions} (reads `.skaile/sessions/*.json`),\n * sorted newest-first by `updatedAt`.\n *\n * @param projectDir - Absolute path to the skaile project root.\n *\n * @docLink packages/workspace-plugin/concepts#tool-delivery\n */\nexport async function flowListSessions(projectDir: string): Promise<ToolResult> {\n try {\n const sessions = await readAllSessions(projectDir);\n return okJson(sessions);\n } catch (e: unknown) {\n return err(e instanceof Error ? e.message : String(e));\n }\n}\n\n/**\n * Get driver metadata for a specific flow run session.\n *\n * @param projectDir - Absolute path to the skaile project root.\n * @param runId - Run ID from {@link flowListSessions}.\n *\n * @docLink packages/workspace-plugin/concepts#tool-delivery\n */\nexport async function flowGetSession(projectDir: string, runId: string): Promise<ToolResult> {\n try {\n const sessions = await readAllSessions(projectDir);\n const session = sessions.find((s) => s.runId === runId);\n if (!session) return err(`Session not found: ${runId}`);\n return okJson(session);\n } catch (e: unknown) {\n return err(e instanceof Error ? e.message : String(e));\n }\n}\n\n/**\n * Resolve and return the flow definition that was used in a past session.\n *\n * Looks up the session by `runId`, reads its `flowId`, then returns the full\n * flow definition from `ai-assets`.\n *\n * @param projectDir - Absolute path to the skaile project root.\n * @param runId - Run ID from {@link flowListSessions}.\n *\n * @docLink packages/workspace-plugin/concepts#tool-delivery\n */\nexport async function flowFindFlowForSession(\n projectDir: string,\n runId: string,\n): Promise<ToolResult> {\n try {\n const sessions = await readAllSessions(projectDir);\n const session = sessions.find((s) => s.runId === runId);\n if (!session) return err(`Session not found: ${runId}`);\n\n const assetsRoot = findAiAssetsRoot(projectDir);\n if (!assetsRoot) return err(`Flow not found for session: ${runId} (no ai-assets root)`);\n\n const { loadAllFlows } = await import(\n \"@skaile/workspaces/factory-assets/connectors/flow/engine\"\n );\n const flows = loadAllFlows(assetsRoot);\n const flow = flows.find((f: any) => f.id === session.flowId);\n if (!flow) return err(`Flow not found: ${session.flowId}`);\n return okJson(flow);\n } catch (e: unknown) {\n return err(e instanceof Error ? e.message : String(e));\n }\n}\n"]}
1
+ {"version":3,"sources":["../workspace-plugin/src/tools/flows.ts"],"names":[],"mappings":";;;;;AAmBA,eAAsB,SAAS,UAAA,EAAyC;AACtE,EAAA,IAAI;AACF,IAAA,MAAM,UAAA,GAAa,iBAAiB,UAAU,CAAA;AAC9C,IAAA,IAAI,CAAC,UAAA,EAAY,OAAO,MAAA,CAAO,EAAE,CAAA;AACjC,IAAA,MAAM,EAAE,YAAA,EAAa,GAAI,MAAM,OAC7B,4CACF,CAAA;AACA,IAAA,MAAM,KAAA,GAAQ,aAAa,UAAU,CAAA;AACrC,IAAA,MAAM,OAAA,GAAU,KAAA,CAAM,GAAA,CAAI,CAAC,CAAA,MAAY;AAAA,MACrC,IAAI,CAAA,CAAE,EAAA;AAAA,MACN,IAAA,EAAM,CAAA,CAAE,IAAA,IAAQ,CAAA,CAAE,EAAA;AAAA,MAClB,SAAA,EAAW,CAAA,CAAE,KAAA,EAAO,MAAA,IAAU;AAAA,KAChC,CAAE,CAAA;AACF,IAAA,OAAO,OAAO,OAAO,CAAA;AAAA,EACvB,SAAS,CAAA,EAAY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pB,SAAS,CAAA,EAAY;AACnB,IAAA,OAAO,IAAI,CAAA,YAAa,KAAA,GAAQ,EAAE,OAAA,GAAU,MAAA,CAAO,CAAC,CAAC,CAAA;AAAA,EACvD;AACF","file":"chunk-EOINYN5T.js","sourcesContent":["// src/tools/flows.ts\n\nimport type { ToolResult } from \"../types.js\";\nimport { err, okJson } from \"../types.js\";\nimport { findAiAssetsRoot } from \"../utils/ai-assets.js\";\nimport { readAllSessions } from \"./sessions.js\";\n\n// ── Flow tools ────────────────────────────────────────────────────────────────\n\n/**\n * List all flow definitions available in the project's `ai-assets` directory.\n *\n * Returns a JSON array of summary objects `{ id, name, nodeCount }`.\n * Returns an empty array when no `ai-assets` root is found.\n *\n * @param projectDir - Absolute path to the skaile project root.\n *\n * @docLink packages/workspace-plugin/concepts#tool-delivery\n */\nexport async function flowList(projectDir: string): Promise<ToolResult> {\n try {\n const assetsRoot = findAiAssetsRoot(projectDir);\n if (!assetsRoot) return okJson([]);\n const { loadAllFlows } = await import(\n \"@skaile/workspaces/factory-assets/connectors/flow/engine\"\n );\n const flows = loadAllFlows(assetsRoot);\n const summary = flows.map((f: any) => ({\n id: f.id,\n name: f.name ?? f.id,\n nodeCount: f.nodes?.length ?? 0,\n }));\n return okJson(summary);\n } catch (e: unknown) {\n return err(e instanceof Error ? e.message : String(e));\n }\n}\n\n/**\n * Show the full flow definition (nodes, edges, metadata) for a specific flow.\n *\n * @param projectDir - Absolute path to the skaile project root.\n * @param flowId - Flow ID as returned by {@link flowList}.\n *\n * @docLink packages/workspace-plugin/concepts#tool-delivery\n */\nexport async function flowShow(projectDir: string, flowId: string): Promise<ToolResult> {\n try {\n const assetsRoot = findAiAssetsRoot(projectDir);\n if (!assetsRoot) return err(`Flow not found: ${flowId}`);\n const { loadAllFlows } = await import(\n \"@skaile/workspaces/factory-assets/connectors/flow/engine\"\n );\n const flows = loadAllFlows(assetsRoot);\n const flow = flows.find((f: any) => f.id === flowId);\n if (!flow) return err(`Flow not found: ${flowId}`);\n return okJson(flow);\n } catch (e: unknown) {\n return err(e instanceof Error ? e.message : String(e));\n }\n}\n\n/**\n * List all past and active flow run sessions for the workspace.\n *\n * Delegates to {@link readAllSessions} (reads `.skaile/sessions/*.json`),\n * sorted newest-first by `updatedAt`.\n *\n * @param projectDir - Absolute path to the skaile project root.\n *\n * @docLink packages/workspace-plugin/concepts#tool-delivery\n */\nexport async function flowListSessions(projectDir: string): Promise<ToolResult> {\n try {\n const sessions = await readAllSessions(projectDir);\n return okJson(sessions);\n } catch (e: unknown) {\n return err(e instanceof Error ? e.message : String(e));\n }\n}\n\n/**\n * Get driver metadata for a specific flow run session.\n *\n * @param projectDir - Absolute path to the skaile project root.\n * @param runId - Run ID from {@link flowListSessions}.\n *\n * @docLink packages/workspace-plugin/concepts#tool-delivery\n */\nexport async function flowGetSession(projectDir: string, runId: string): Promise<ToolResult> {\n try {\n const sessions = await readAllSessions(projectDir);\n const session = sessions.find((s) => s.runId === runId);\n if (!session) return err(`Session not found: ${runId}`);\n return okJson(session);\n } catch (e: unknown) {\n return err(e instanceof Error ? e.message : String(e));\n }\n}\n\n/**\n * Resolve and return the flow definition that was used in a past session.\n *\n * Looks up the session by `runId`, reads its `flowId`, then returns the full\n * flow definition from `ai-assets`.\n *\n * @param projectDir - Absolute path to the skaile project root.\n * @param runId - Run ID from {@link flowListSessions}.\n *\n * @docLink packages/workspace-plugin/concepts#tool-delivery\n */\nexport async function flowFindFlowForSession(\n projectDir: string,\n runId: string,\n): Promise<ToolResult> {\n try {\n const sessions = await readAllSessions(projectDir);\n const session = sessions.find((s) => s.runId === runId);\n if (!session) return err(`Session not found: ${runId}`);\n\n const assetsRoot = findAiAssetsRoot(projectDir);\n if (!assetsRoot) return err(`Flow not found for session: ${runId} (no ai-assets root)`);\n\n const { loadAllFlows } = await import(\n \"@skaile/workspaces/factory-assets/connectors/flow/engine\"\n );\n const flows = loadAllFlows(assetsRoot);\n const flow = flows.find((f: any) => f.id === session.flowId);\n if (!flow) return err(`Flow not found: ${session.flowId}`);\n return okJson(flow);\n } catch (e: unknown) {\n return err(e instanceof Error ? e.message : String(e));\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { DRIVER_TARGETS } from './chunk-O4JH3KUE.js';
1
+ import { DRIVER_TARGETS } from './chunk-MENCWIHW.js';
2
2
  import { lstatSync } from 'fs';
3
3
  import { homedir } from 'os';
4
4
  import { resolve, join } from 'path';
@@ -27,5 +27,5 @@ function isDeployed(kind, name, target, globalInstall, cwd) {
27
27
  }
28
28
 
29
29
  export { deployedBase, deployedDir, isDeployed };
30
- //# sourceMappingURL=chunk-XGCXFX7X.js.map
31
- //# sourceMappingURL=chunk-XGCXFX7X.js.map
30
+ //# sourceMappingURL=chunk-F3HNW354.js.map
31
+ //# sourceMappingURL=chunk-F3HNW354.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../core/src/store.ts"],"names":[],"mappings":";;;;;AA4BO,SAAS,YAAA,CACd,IAAA,EACA,MAAA,EACA,aAAA,EACA,GAAA,EACQ;AACR,EAAA,MAAM,SAAA,GAAY,eAAe,MAAM,CAAA;AACvC,EAAA,IAAI,CAAC,SAAA,EAAW,MAAM,IAAI,KAAA,CAAM,CAAA,wBAAA,EAA2B,MAAM,CAAA,CAAA,CAAG,CAAA;AACpE,EAAA,MAAM,KAAA,GAAQ,gBAAgB,QAAA,GAAW,OAAA;AACzC,EAAA,MAAM,KAAA,GAAQ,UAAU,KAAK,CAAA;AAC7B,EAAA,MAAM,OAAA,GAAU,KAAA,CAAM,IAAI,CAAA,IAAK,MAAM,KAAA,IAAS,EAAA;AAC9C,EAAA,IAAI,aAAA,EAAe;AACjB,IAAA,OAAO,OAAA,CAAQ,OAAA,CAAQ,IAAA,EAAM,OAAA,EAAS,CAAA;AAAA,EACxC;AACA,EAAA,OAAO,OAAA,CAAQ,GAAA,IAAO,OAAA,CAAQ,GAAA,IAAO,OAAO,CAAA;AAC9C;AAaO,SAAS,WAAA,CACd,IAAA,EACA,IAAA,EACA,MAAA,EACA,eACA,GAAA,EACQ;AACR,EAAA,OAAO,KAAK,YAAA,CAAa,IAAA,EAAM,QAAQ,aAAA,EAAe,GAAG,GAAG,IAAI,CAAA;AAClE;AAcO,SAAS,UAAA,CACd,IAAA,EACA,IAAA,EACA,MAAA,EACA,eACA,GAAA,EACS;AACT,EAAA,IAAI;AACF,IAAA,SAAA,CAAU,YAAY,IAAA,EAAM,IAAA,EAAM,MAAA,EAAQ,aAAA,EAAe,GAAG,CAAC,CAAA;AAC7D,IAAA,OAAO,IAAA;AAAA,EACT,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,KAAA;AAAA,EACT;AACF","file":"chunk-XGCXFX7X.js","sourcesContent":["/**\n * Deploy-target helpers — resolve framework-specific install paths.\n *\n * This module contains only deploy path resolution. All catalog, repository,\n * and history I/O has moved to @skaile/asset-manager (project-local).\n */\n\nimport { lstatSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { join, resolve } from \"node:path\";\nimport type { DriverTarget } from \"./driver-targets.js\";\nimport { type AiComponent, DRIVER_TARGETS } from \"./driver-targets.js\";\n\n// ── Deploy-target helpers ─────────────────────────────────────────────────────\n\n/**\n * Resolve the base deploy directory for an asset kind in a given driver target + scope.\n * For local scope, the path is relative to `cwd` (defaults to `process.cwd()`).\n * For global scope, `~` is expanded to the home directory.\n *\n * @param kind - Asset component type (e.g. `\"skill\"`, `\"agent\"`)\n * @param target - Driver target identifier (e.g. `\"claude-code\"`, `\"omp\"`)\n * @param globalInstall - `true` for user-global install, `false` for project-local\n * @param cwd - Working directory for project-local installs (default: `process.cwd()`)\n * @returns Absolute path to the base deploy directory\n * @throws When `target` is not found in `DRIVER_TARGETS`\n * @docLink packages/core/concepts#deployed-base\n */\nexport function deployedBase(\n kind: AiComponent,\n target: DriverTarget,\n globalInstall: boolean,\n cwd?: string,\n): string {\n const targetMap = DRIVER_TARGETS[target];\n if (!targetMap) throw new Error(`Unknown deploy target: '${target}'`);\n const scope = globalInstall ? \"global\" : \"local\";\n const paths = targetMap[scope];\n const destStr = paths[kind] ?? paths.skill ?? \"\";\n if (globalInstall) {\n return destStr.replace(/^~/, homedir());\n }\n return resolve(cwd ?? process.cwd(), destStr);\n}\n\n/**\n * Return the full deploy path for a named asset: `<deployedBase>/<name>`.\n *\n * @param kind - Asset component type\n * @param name - Asset name (becomes the directory/file name under the base)\n * @param target - Driver target identifier\n * @param globalInstall - `true` for user-global, `false` for project-local\n * @param cwd - Working directory for local installs\n * @returns Absolute path to the asset's deploy directory\n * @docLink packages/core/concepts#deployed-dir\n */\nexport function deployedDir(\n kind: AiComponent,\n name: string,\n target: DriverTarget,\n globalInstall: boolean,\n cwd?: string,\n): string {\n return join(deployedBase(kind, target, globalInstall, cwd), name);\n}\n\n/**\n * Check whether an asset is already deployed at its expected location.\n * Uses `lstatSync` so symlinks are treated as deployed.\n *\n * @param kind - Asset component type\n * @param name - Asset name\n * @param target - Driver target identifier\n * @param globalInstall - `true` for user-global, `false` for project-local\n * @param cwd - Working directory for local installs\n * @returns `true` if the deploy path exists, `false` otherwise\n * @docLink packages/core/concepts#is-deployed\n */\nexport function isDeployed(\n kind: AiComponent,\n name: string,\n target: DriverTarget,\n globalInstall: boolean,\n cwd?: string,\n): boolean {\n try {\n lstatSync(deployedDir(kind, name, target, globalInstall, cwd));\n return true;\n } catch {\n return false;\n }\n}\n"]}
1
+ {"version":3,"sources":["../core/src/store.ts"],"names":[],"mappings":";;;;;AA4BO,SAAS,YAAA,CACd,IAAA,EACA,MAAA,EACA,aAAA,EACA,GAAA,EACQ;AACR,EAAA,MAAM,SAAA,GAAY,eAAe,MAAM,CAAA;AACvC,EAAA,IAAI,CAAC,SAAA,EAAW,MAAM,IAAI,KAAA,CAAM,CAAA,wBAAA,EAA2B,MAAM,CAAA,CAAA,CAAG,CAAA;AACpE,EAAA,MAAM,KAAA,GAAQ,gBAAgB,QAAA,GAAW,OAAA;AACzC,EAAA,MAAM,KAAA,GAAQ,UAAU,KAAK,CAAA;AAC7B,EAAA,MAAM,OAAA,GAAU,KAAA,CAAM,IAAI,CAAA,IAAK,MAAM,KAAA,IAAS,EAAA;AAC9C,EAAA,IAAI,aAAA,EAAe;AACjB,IAAA,OAAO,OAAA,CAAQ,OAAA,CAAQ,IAAA,EAAM,OAAA,EAAS,CAAA;AAAA,EACxC;AACA,EAAA,OAAO,OAAA,CAAQ,GAAA,IAAO,OAAA,CAAQ,GAAA,IAAO,OAAO,CAAA;AAC9C;AAaO,SAAS,WAAA,CACd,IAAA,EACA,IAAA,EACA,MAAA,EACA,eACA,GAAA,EACQ;AACR,EAAA,OAAO,KAAK,YAAA,CAAa,IAAA,EAAM,QAAQ,aAAA,EAAe,GAAG,GAAG,IAAI,CAAA;AAClE;AAcO,SAAS,UAAA,CACd,IAAA,EACA,IAAA,EACA,MAAA,EACA,eACA,GAAA,EACS;AACT,EAAA,IAAI;AACF,IAAA,SAAA,CAAU,YAAY,IAAA,EAAM,IAAA,EAAM,MAAA,EAAQ,aAAA,EAAe,GAAG,CAAC,CAAA;AAC7D,IAAA,OAAO,IAAA;AAAA,EACT,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,KAAA;AAAA,EACT;AACF","file":"chunk-F3HNW354.js","sourcesContent":["/**\n * Deploy-target helpers — resolve framework-specific install paths.\n *\n * This module contains only deploy path resolution. All catalog, repository,\n * and history I/O has moved to @skaile/asset-manager (project-local).\n */\n\nimport { lstatSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { join, resolve } from \"node:path\";\nimport type { DriverTarget } from \"./driver-targets.js\";\nimport { type AiComponent, DRIVER_TARGETS } from \"./driver-targets.js\";\n\n// ── Deploy-target helpers ─────────────────────────────────────────────────────\n\n/**\n * Resolve the base deploy directory for an asset kind in a given driver target + scope.\n * For local scope, the path is relative to `cwd` (defaults to `process.cwd()`).\n * For global scope, `~` is expanded to the home directory.\n *\n * @param kind - Asset component type (e.g. `\"skill\"`, `\"agent\"`)\n * @param target - Driver target identifier (e.g. `\"claude-code\"`, `\"omp\"`)\n * @param globalInstall - `true` for user-global install, `false` for project-local\n * @param cwd - Working directory for project-local installs (default: `process.cwd()`)\n * @returns Absolute path to the base deploy directory\n * @throws When `target` is not found in `DRIVER_TARGETS`\n * @docLink packages/core/concepts#deployed-base\n */\nexport function deployedBase(\n kind: AiComponent,\n target: DriverTarget,\n globalInstall: boolean,\n cwd?: string,\n): string {\n const targetMap = DRIVER_TARGETS[target];\n if (!targetMap) throw new Error(`Unknown deploy target: '${target}'`);\n const scope = globalInstall ? \"global\" : \"local\";\n const paths = targetMap[scope];\n const destStr = paths[kind] ?? paths.skill ?? \"\";\n if (globalInstall) {\n return destStr.replace(/^~/, homedir());\n }\n return resolve(cwd ?? process.cwd(), destStr);\n}\n\n/**\n * Return the full deploy path for a named asset: `<deployedBase>/<name>`.\n *\n * @param kind - Asset component type\n * @param name - Asset name (becomes the directory/file name under the base)\n * @param target - Driver target identifier\n * @param globalInstall - `true` for user-global, `false` for project-local\n * @param cwd - Working directory for local installs\n * @returns Absolute path to the asset's deploy directory\n * @docLink packages/core/concepts#deployed-dir\n */\nexport function deployedDir(\n kind: AiComponent,\n name: string,\n target: DriverTarget,\n globalInstall: boolean,\n cwd?: string,\n): string {\n return join(deployedBase(kind, target, globalInstall, cwd), name);\n}\n\n/**\n * Check whether an asset is already deployed at its expected location.\n * Uses `lstatSync` so symlinks are treated as deployed.\n *\n * @param kind - Asset component type\n * @param name - Asset name\n * @param target - Driver target identifier\n * @param globalInstall - `true` for user-global, `false` for project-local\n * @param cwd - Working directory for local installs\n * @returns `true` if the deploy path exists, `false` otherwise\n * @docLink packages/core/concepts#is-deployed\n */\nexport function isDeployed(\n kind: AiComponent,\n name: string,\n target: DriverTarget,\n globalInstall: boolean,\n cwd?: string,\n): boolean {\n try {\n lstatSync(deployedDir(kind, name, target, globalInstall, cwd));\n return true;\n } catch {\n return false;\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { factoryAssetRoots } from './chunk-WBF7JLTY.js';
1
+ import { factoryAssetRoots } from './chunk-W53D5Q52.js';
2
2
  import fs from 'fs';
3
3
  import os from 'os';
4
4
  import path from 'path';
@@ -24,5 +24,5 @@ function aiResourceRoots() {
24
24
  }
25
25
 
26
26
  export { AI_RESOURCES, MONOREPO_ROOT, aiResourceRoots };
27
- //# sourceMappingURL=chunk-33WB7VFV.js.map
28
- //# sourceMappingURL=chunk-33WB7VFV.js.map
27
+ //# sourceMappingURL=chunk-LKOMH3QC.js.map
28
+ //# sourceMappingURL=chunk-LKOMH3QC.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../cli/src/paths.ts"],"names":[],"mappings":";;;;;;AAMA,IAAM,WAAW,IAAA,CAAK,OAAA,CAAQ,aAAA,CAAc,MAAA,CAAA,IAAA,CAAY,GAAG,CAAC,CAAA;AAW5D,SAAS,iBAAiB,IAAA,EAA6B;AACrD,EAAA,IAAI,GAAA,GAAM,IAAA;AACV,EAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,CAAA,EAAG,CAAA,EAAA,EAAK;AAC1B,IAAA,IAAI,EAAA,CAAG,WAAW,IAAA,CAAK,IAAA,CAAK,KAAK,YAAY,CAAC,GAAG,OAAO,GAAA;AACxD,IAAA,MAAM,MAAA,GAAS,IAAA,CAAK,OAAA,CAAQ,GAAG,CAAA;AAC/B,IAAA,IAAI,WAAW,GAAA,EAAK;AACpB,IAAA,GAAA,GAAM,MAAA;AAAA,EACR;AACA,EAAA,OAAO,IAAA;AACT;AAYO,IAAM,aAAA,GAA+B,iBAAiB,QAAQ;AAc9D,IAAM,YAAA,GACX,iBAAA,EAAkB,CAAE,CAAC,CAAA,IAAK,IAAA,CAAK,IAAA,CAAK,EAAA,CAAG,OAAA,EAAQ,EAAG,SAAA,EAAW,WAAW;AAoBnE,SAAS,eAAA,GAA4B;AAC1C,EAAA,MAAM,KAAA,GAAkB,CAAC,GAAG,iBAAA,EAAmB,CAAA;AAC/C,EAAA,KAAA,CAAM,IAAA,CAAK,KAAK,IAAA,CAAK,EAAA,CAAG,SAAQ,EAAG,SAAA,EAAW,WAAW,CAAC,CAAA;AAC1D,EAAA,OAAO,CAAC,GAAG,IAAI,GAAA,CAAI,KAAK,CAAC,CAAA,CAAE,MAAA,CAAO,CAAC,CAAA,KAAM,EAAA,CAAG,UAAA,CAAW,CAAC,CAAC,CAAA;AAC3D","file":"chunk-33WB7VFV.js","sourcesContent":["import fs from \"node:fs\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { factoryAssetRoots } from \"@skaile/workspaces/core\";\n\nconst __ownDir = path.dirname(fileURLToPath(import.meta.url));\n\n/**\n * Walk up from `from` looking for the monorepo marker (`biome.json`, the\n * repo-root shared tooling config). Returns the matching directory or `null`\n * when none is found within eight levels — the latter is the typical case when\n * `@skaile/workspaces` has been installed via `npm i` without a skaile-dev\n * workspace context. Used only to gate dev-only commands (e.g.\n * `serve --compile-test`); first-party content is located via\n * {@link aiResourceRoots}, not this.\n */\nfunction findMonorepoRoot(from: string): string | null {\n let dir = from;\n for (let i = 0; i < 8; i++) {\n if (fs.existsSync(path.join(dir, \"biome.json\"))) return dir;\n const parent = path.dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n return null;\n}\n\n/**\n * Absolute path to the monorepo root, or `null` when the CLI is running\n * outside the skaile-dev workspace (typical for `npm i -g` installs).\n *\n * Consumers that only make sense inside the workspace (e.g.\n * `skaile serve --compile-test`) MUST check for `null` and report a\n * \"monorepo-only feature\" error before proceeding.\n *\n * @docLink cli/dev-guide#paths\n */\nexport const MONOREPO_ROOT: string | null = findMonorepoRoot(__ownDir);\n\n/**\n * Default content root used by path display and the `validate` command.\n *\n * The primary first-party `factory-assets/` root resolved through the shared\n * `factoryAssetRoots()` helper — the `SKAILE_FACTORY_ASSETS_DIR` override when\n * set, else the in-repo source during dev / bundled `dist/factory-assets/` after\n * `npm i`. Falls back to `~/.skaile/libraries/` — the user-library directory\n * managed by `skaile library add` — when the package cannot be located.\n * Consumers `fs.existsSync` first and degrade to \"no skills / flows discovered\".\n *\n * @docLink cli/dev-guide#paths\n */\nexport const AI_RESOURCES: string =\n factoryAssetRoots()[0] ?? path.join(os.homedir(), \".skaile\", \"libraries\");\n\n/**\n * All content roots that skill / flow discovery should walk, in priority order,\n * filtered to those that exist on disk and de-duplicated.\n *\n * - The first-party `factory-assets/` roots from the shared `factoryAssetRoots()`\n * helper — the `SKAILE_FACTORY_ASSETS_DIR` override layer (when set) ahead of\n * the bundled tree (in-repo source in dev, `dist/factory-assets/` after\n * install). No monorepo special-case.\n * - The user-library dir `~/.skaile/libraries/`.\n *\n * Order is significant: `findSkills` / flow discovery dedupe first-root-wins, so\n * the env override shadows the bundled tree on a name clash.\n *\n * This is the discovery surface used by `findSkills`, flow discovery, and the\n * completion resolvers.\n *\n * @docLink cli/dev-guide#paths\n */\nexport function aiResourceRoots(): string[] {\n const roots: string[] = [...factoryAssetRoots()];\n roots.push(path.join(os.homedir(), \".skaile\", \"libraries\"));\n return [...new Set(roots)].filter((r) => fs.existsSync(r));\n}\n"]}
1
+ {"version":3,"sources":["../cli/src/paths.ts"],"names":[],"mappings":";;;;;;AAMA,IAAM,WAAW,IAAA,CAAK,OAAA,CAAQ,aAAA,CAAc,MAAA,CAAA,IAAA,CAAY,GAAG,CAAC,CAAA;AAW5D,SAAS,iBAAiB,IAAA,EAA6B;AACrD,EAAA,IAAI,GAAA,GAAM,IAAA;AACV,EAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,CAAA,EAAG,CAAA,EAAA,EAAK;AAC1B,IAAA,IAAI,EAAA,CAAG,WAAW,IAAA,CAAK,IAAA,CAAK,KAAK,YAAY,CAAC,GAAG,OAAO,GAAA;AACxD,IAAA,MAAM,MAAA,GAAS,IAAA,CAAK,OAAA,CAAQ,GAAG,CAAA;AAC/B,IAAA,IAAI,WAAW,GAAA,EAAK;AACpB,IAAA,GAAA,GAAM,MAAA;AAAA,EACR;AACA,EAAA,OAAO,IAAA;AACT;AAYO,IAAM,aAAA,GAA+B,iBAAiB,QAAQ;AAc9D,IAAM,YAAA,GACX,iBAAA,EAAkB,CAAE,CAAC,CAAA,IAAK,IAAA,CAAK,IAAA,CAAK,EAAA,CAAG,OAAA,EAAQ,EAAG,SAAA,EAAW,WAAW;AAoBnE,SAAS,eAAA,GAA4B;AAC1C,EAAA,MAAM,KAAA,GAAkB,CAAC,GAAG,iBAAA,EAAmB,CAAA;AAC/C,EAAA,KAAA,CAAM,IAAA,CAAK,KAAK,IAAA,CAAK,EAAA,CAAG,SAAQ,EAAG,SAAA,EAAW,WAAW,CAAC,CAAA;AAC1D,EAAA,OAAO,CAAC,GAAG,IAAI,GAAA,CAAI,KAAK,CAAC,CAAA,CAAE,MAAA,CAAO,CAAC,CAAA,KAAM,EAAA,CAAG,UAAA,CAAW,CAAC,CAAC,CAAA;AAC3D","file":"chunk-LKOMH3QC.js","sourcesContent":["import fs from \"node:fs\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { factoryAssetRoots } from \"@skaile/workspaces/core\";\n\nconst __ownDir = path.dirname(fileURLToPath(import.meta.url));\n\n/**\n * Walk up from `from` looking for the monorepo marker (`biome.json`, the\n * repo-root shared tooling config). Returns the matching directory or `null`\n * when none is found within eight levels — the latter is the typical case when\n * `@skaile/workspaces` has been installed via `npm i` without a skaile-dev\n * workspace context. Used only to gate dev-only commands (e.g.\n * `serve --compile-test`); first-party content is located via\n * {@link aiResourceRoots}, not this.\n */\nfunction findMonorepoRoot(from: string): string | null {\n let dir = from;\n for (let i = 0; i < 8; i++) {\n if (fs.existsSync(path.join(dir, \"biome.json\"))) return dir;\n const parent = path.dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n return null;\n}\n\n/**\n * Absolute path to the monorepo root, or `null` when the CLI is running\n * outside the skaile-dev workspace (typical for `npm i -g` installs).\n *\n * Consumers that only make sense inside the workspace (e.g.\n * `skaile serve --compile-test`) MUST check for `null` and report a\n * \"monorepo-only feature\" error before proceeding.\n *\n * @docLink cli/dev-guide#paths\n */\nexport const MONOREPO_ROOT: string | null = findMonorepoRoot(__ownDir);\n\n/**\n * Default content root used by path display and the `validate` command.\n *\n * The primary first-party `factory-assets/` root resolved through the shared\n * `factoryAssetRoots()` helper — the `SKAILE_FACTORY_ASSETS_DIR` override when\n * set, else the in-repo source during dev / bundled `dist/factory-assets/` after\n * `npm i`. Falls back to `~/.skaile/libraries/` — the user-library directory\n * managed by `skaile library add` — when the package cannot be located.\n * Consumers `fs.existsSync` first and degrade to \"no skills / flows discovered\".\n *\n * @docLink cli/dev-guide#paths\n */\nexport const AI_RESOURCES: string =\n factoryAssetRoots()[0] ?? path.join(os.homedir(), \".skaile\", \"libraries\");\n\n/**\n * All content roots that skill / flow discovery should walk, in priority order,\n * filtered to those that exist on disk and de-duplicated.\n *\n * - The first-party `factory-assets/` roots from the shared `factoryAssetRoots()`\n * helper — the `SKAILE_FACTORY_ASSETS_DIR` override layer (when set) ahead of\n * the bundled tree (in-repo source in dev, `dist/factory-assets/` after\n * install). No monorepo special-case.\n * - The user-library dir `~/.skaile/libraries/`.\n *\n * Order is significant: `findSkills` / flow discovery dedupe first-root-wins, so\n * the env override shadows the bundled tree on a name clash.\n *\n * This is the discovery surface used by `findSkills`, flow discovery, and the\n * completion resolvers.\n *\n * @docLink cli/dev-guide#paths\n */\nexport function aiResourceRoots(): string[] {\n const roots: string[] = [...factoryAssetRoots()];\n roots.push(path.join(os.homedir(), \".skaile\", \"libraries\"));\n return [...new Set(roots)].filter((r) => fs.existsSync(r));\n}\n"]}
@@ -1,3 +1,6 @@
1
+ import { homedir } from 'os';
2
+ import { join } from 'path';
3
+
1
4
  // core/src/driver-targets.ts
2
5
  var DRIVER_TARGETS = {
3
6
  "claude-code": {
@@ -50,7 +53,12 @@ var DRIVER_TARGETS = {
50
53
  }
51
54
  };
52
55
  var SUPPORTED_DRIVER_TARGETS = Object.keys(DRIVER_TARGETS);
56
+ function globalBackendRoot(target) {
57
+ const skillPath = DRIVER_TARGETS[target].global.skill;
58
+ const firstSegment = skillPath.replace(/^~\//, "").split("/")[0];
59
+ return join(homedir(), firstSegment);
60
+ }
53
61
 
54
- export { DRIVER_TARGETS, SUPPORTED_DRIVER_TARGETS };
55
- //# sourceMappingURL=chunk-O4JH3KUE.js.map
56
- //# sourceMappingURL=chunk-O4JH3KUE.js.map
62
+ export { DRIVER_TARGETS, SUPPORTED_DRIVER_TARGETS, globalBackendRoot };
63
+ //# sourceMappingURL=chunk-MENCWIHW.js.map
64
+ //# sourceMappingURL=chunk-MENCWIHW.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../core/src/driver-targets.ts"],"names":[],"mappings":";;;;AAoDO,IAAM,cAAA,GAAoD;AAAA,EAC/D,aAAA,EAAe;AAAA,IACb,KAAA,EAAO;AAAA,MACL,KAAA,EAAO,gBAAA;AAAA,MACP,KAAA,EAAO,gBAAA;AAAA,MACP,MAAA,EAAQ,kBAAA;AAAA,MACR,IAAA,EAAM,eAAA;AAAA,MACN,QAAA,EAAU;AAAA,KACZ;AAAA,IACA,MAAA,EAAQ;AAAA,MACN,KAAA,EAAO,kBAAA;AAAA,MACP,KAAA,EAAO,kBAAA;AAAA,MACP,MAAA,EAAQ,oBAAA;AAAA,MACR,IAAA,EAAM,iBAAA;AAAA,MACN,QAAA,EAAU;AAAA;AACZ,GACF;AAAA,EACA,GAAA,EAAK;AAAA,IACH,KAAA,EAAO;AAAA,MACL,KAAA,EAAO,aAAA;AAAA,MACP,KAAA,EAAO,aAAA;AAAA,MACP,MAAA,EAAQ,cAAA;AAAA,MACR,IAAA,EAAM,eAAA;AAAA,MACN,QAAA,EAAU;AAAA,KACZ;AAAA,IACA,MAAA,EAAQ;AAAA,MACN,KAAA,EAAO,eAAA;AAAA,MACP,KAAA,EAAO,eAAA;AAAA,MACP,MAAA,EAAQ,gBAAA;AAAA,MACR,IAAA,EAAM,iBAAA;AAAA,MACN,QAAA,EAAU;AAAA;AACZ,GACF;AAAA,EACA,KAAA,EAAO;AAAA,IACL,KAAA,EAAO;AAAA,MACL,KAAA,EAAO,eAAA;AAAA,MACP,KAAA,EAAO,eAAA;AAAA,MACP,MAAA,EAAQ,cAAA;AAAA,MACR,IAAA,EAAM,eAAA;AAAA,MACN,QAAA,EAAU;AAAA,KACZ;AAAA,IACA,MAAA,EAAQ;AAAA,MACN,KAAA,EAAO,iBAAA;AAAA,MACP,KAAA,EAAO,iBAAA;AAAA,MACP,MAAA,EAAQ,gBAAA;AAAA,MACR,IAAA,EAAM,iBAAA;AAAA,MACN,QAAA,EAAU;AAAA;AACZ;AAEJ;AAOO,IAAM,wBAAA,GAA2B,MAAA,CAAO,IAAA,CAAK,cAAc;AAa3D,SAAS,kBAAkB,MAAA,EAA8B;AAC9D,EAAA,MAAM,SAAA,GAAY,cAAA,CAAe,MAAM,CAAA,CAAE,MAAA,CAAO,KAAA;AAChD,EAAA,MAAM,YAAA,GAAe,UAAU,OAAA,CAAQ,MAAA,EAAQ,EAAE,CAAA,CAAE,KAAA,CAAM,GAAG,CAAA,CAAE,CAAC,CAAA;AAC/D,EAAA,OAAO,IAAA,CAAK,OAAA,EAAQ,EAAG,YAAY,CAAA;AACrC","file":"chunk-MENCWIHW.js","sourcesContent":["/**\n * Driver targets — maps agent tool identifiers to their install paths.\n *\n * Only backends with a full bridge driver (runtime execution) are included.\n * Render-only targets (cursor, roo, github-copilot, gemini, amp) were removed —\n * add them back when a bridge driver is implemented.\n */\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\n\n/**\n * All supported coding-agent driver target identifiers.\n * Only backends with a full bridge driver (runtime execution) are included.\n * @docLink packages/core/concepts#driver-target\n */\nexport type DriverTarget = \"claude-code\" | \"omp\" | \"codex\";\n\n/**\n * Filesystem install path configuration for a single driver target.\n * Paths are relative to the project root (`local`) or the home directory (`global`).\n * `~` in global paths is expanded to `$HOME` by `deployedBase`.\n * @docLink packages/core/concepts#agent-target\n */\nexport interface AgentTarget {\n /** Project-relative install paths for each AI component type. */\n local: Record<AiComponent, string>;\n /** Home-relative install paths for each AI component type (`~` = `$HOME`). */\n global: Record<AiComponent, string>;\n}\n\n/**\n * The distinct asset types that can be installed into a driver target directory.\n * Used as keys in `AgentTarget.local` and `AgentTarget.global`.\n * @docLink packages/core/concepts#ai-component\n */\nexport type AiComponent = \"skill\" | \"agent\" | \"prompt\" | \"flow\" | \"contract\";\n\n/**\n * Filesystem install path configuration for every supported driver target.\n * `local` paths are relative to the project root; `global` paths are home-relative (`~` = `$HOME`).\n *\n * Only targets with a full bridge driver are included. Removed targets:\n * cursor — no bridge driver\n * roo — no bridge driver\n * github-copilot — no bridge driver\n * gemini — no bridge driver\n * amp — no bridge driver\n * windsurf — no file-based agent support\n * cline — no file-based agent support\n * continue — no file-based agent support\n * @docLink packages/core/concepts#driver-targets\n */\nexport const DRIVER_TARGETS: Record<DriverTarget, AgentTarget> = {\n \"claude-code\": {\n local: {\n skill: \".claude/skills\",\n agent: \".claude/agents\",\n prompt: \".claude/commands\",\n flow: \".skaile/flows\",\n contract: \".claude/contracts\",\n },\n global: {\n skill: \"~/.claude/skills\",\n agent: \"~/.claude/agents\",\n prompt: \"~/.claude/commands\",\n flow: \"~/.skaile/flows\",\n contract: \"~/.claude/contracts\",\n },\n },\n omp: {\n local: {\n skill: \".omp/skills\",\n agent: \".omp/agents\",\n prompt: \".omp/prompts\",\n flow: \".skaile/flows\",\n contract: \".omp/contracts\",\n },\n global: {\n skill: \"~/.omp/skills\",\n agent: \"~/.omp/agents\",\n prompt: \"~/.omp/prompts\",\n flow: \"~/.skaile/flows\",\n contract: \"~/.omp/contracts\",\n },\n },\n codex: {\n local: {\n skill: \".codex/skills\",\n agent: \".codex/agents\",\n prompt: \".codex/rules\",\n flow: \".skaile/flows\",\n contract: \".codex/contracts\",\n },\n global: {\n skill: \"~/.codex/skills\",\n agent: \"~/.codex/agents\",\n prompt: \"~/.codex/rules\",\n flow: \"~/.skaile/flows\",\n contract: \"~/.codex/contracts\",\n },\n },\n};\n\n/**\n * Array of all `DriverTarget` values that support file-based asset installation\n * (skills, agents, prompts, flows, contracts).\n * @docLink packages/core/concepts#supported-driver-targets\n */\nexport const SUPPORTED_DRIVER_TARGETS = Object.keys(DRIVER_TARGETS) as DriverTarget[];\n\n/**\n * Absolute path to a driver target's **global backend root** — the home-relative\n * directory that identifies the backend on disk (e.g. `~/.claude`, `~/.omp`,\n * `~/.codex`). Derived from the first path segment of the target's global skill\n * path. Used by `resolveGlobalBackends` to auto-detect which backends the user\n * runs globally (a backend \"exists globally\" when this dir is present).\n *\n * @param target - Driver target identifier.\n * @returns Absolute path to the backend's home-relative root dir.\n * @docLink packages/core/concepts#global-backend-root\n */\nexport function globalBackendRoot(target: DriverTarget): string {\n const skillPath = DRIVER_TARGETS[target].global.skill; // e.g. \"~/.claude/skills\"\n const firstSegment = skillPath.replace(/^~\\//, \"\").split(\"/\")[0]; // \".claude\"\n return join(homedir(), firstSegment);\n}\n"]}
@@ -1,6 +1,7 @@
1
1
  import { decodeSkaileManifest, SKAILE_MANIFEST_FILENAME } from './chunk-DZCK7GRW.js';
2
- import { scanDirectory, parseFrontmatter, bundleDepRefs, fromMcpServerMdContent } from './chunk-6IDBWPK2.js';
2
+ import { scanDirectory, parseFrontmatter, bundleDepRefs, fromMcpServerMdContent } from './chunk-BQCGFPHW.js';
3
3
  import { isValidAssetName, slugifyAssetName, parseAssetRef, assetRefToStr } from './chunk-GEEW6SY2.js';
4
+ import { SUPPORTED_DRIVER_TARGETS, globalBackendRoot } from './chunk-MENCWIHW.js';
4
5
  import { existsSync, mkdirSync, renameSync, readdirSync, rmdirSync, readFileSync, writeFileSync, rmSync, lstatSync, symlinkSync, cpSync } from 'fs';
5
6
  import { homedir } from 'os';
6
7
  import { join, dirname, resolve, relative, parse as parse$1, basename } from 'path';
@@ -10,10 +11,12 @@ import semver from 'semver';
10
11
  import { createHash } from 'crypto';
11
12
  import fg from 'fast-glob';
12
13
 
14
+ function globalSkaileDir() {
15
+ return process.env.SKAILE_HOME ?? join(homedir(), ".skaile");
16
+ }
13
17
  function globalCacheRoot() {
14
18
  if (process.env.SKAILE_CACHE_DIR) return process.env.SKAILE_CACHE_DIR;
15
- const home = process.env.SKAILE_HOME ?? join(homedir(), ".skaile");
16
- return join(home, "cache");
19
+ return join(globalSkaileDir(), "cache");
17
20
  }
18
21
  var migratedWholeTree = /* @__PURE__ */ new Set();
19
22
  function migrateLegacyDir(newPath, legacyPath) {
@@ -54,8 +57,6 @@ function __resetCacheMigrationMemo() {
54
57
  migratedWholeTree.clear();
55
58
  mergedEntries.clear();
56
59
  }
57
-
58
- // core/src/repo-manager.ts
59
60
  function hasOwnGit(dir) {
60
61
  return existsSync(join(dir, ".git"));
61
62
  }
@@ -674,7 +675,7 @@ function walkWithManifest(clone, manifestPath, index) {
674
675
  files,
675
676
  sha256: a.sha256 ?? compositeSha256(files),
676
677
  metadata: resolved.metadata,
677
- deps: a.dependencies ?? bundleDeps(repoRoot, files, a.kind)
678
+ deps: a.dependencies ?? manifestDeps(repoRoot, files, a.kind)
678
679
  };
679
680
  applyStoreListingMetadata(candidate, a, manifest, resolved.frontmatter);
680
681
  push(index, `${assetPublisher}/${a.kind}:${name}`, candidate);
@@ -794,7 +795,7 @@ function walkFilenameConvention(clone, index) {
794
795
  files,
795
796
  sha256: compositeSha256(files),
796
797
  metadata: readMetadata(clone.localPath, files, e.kind),
797
- deps: bundleDeps(clone.localPath, files, e.kind)
798
+ deps: manifestDeps(clone.localPath, files, e.kind)
798
799
  };
799
800
  push(index, `${publisher}/${e.kind}:${e.name}`, candidate);
800
801
  }
@@ -830,10 +831,11 @@ function readContentFrontmatter(repoRoot, files, kind) {
830
831
  return void 0;
831
832
  }
832
833
  }
833
- function bundleDeps(repoRoot, files, kind) {
834
- if (kind !== "bundle") return void 0;
835
- const bf = files.find((f) => f.path.endsWith(".bundle.yaml") || f.path.endsWith("BUNDLE.md"));
836
- return bf ? bundleDepRefs(join(repoRoot, bf.path)) : void 0;
834
+ function manifestDeps(repoRoot, files, kind) {
835
+ const ext = kind === "bundle" ? [".bundle.yaml", "BUNDLE.md"] : kind === "flow" ? [".flow.yaml", ".flow.json"] : null;
836
+ if (!ext) return void 0;
837
+ const mf = files.find((f) => ext.some((e) => f.path.endsWith(e)));
838
+ return mf ? bundleDepRefs(join(repoRoot, mf.path)) : void 0;
837
839
  }
838
840
  function push(index, key, candidate) {
839
841
  const arr = index.get(key) ?? [];
@@ -959,6 +961,17 @@ function resolveSkWorkspaceConfig(projectDir, opts) {
959
961
  if (configs.length > 0) return configs.reduce(mergeSkWorkspaceConfigs);
960
962
  return {};
961
963
  }
964
+ function resolveGlobalSkWorkspaceConfig() {
965
+ const file = loadSkWorkspaceConfig(globalSkaileDir(), SK_WORKSPACE_DEFAULT_NAME);
966
+ const legacy = file?.diagnostics?.find((x) => x.code === "legacy_key_rejected");
967
+ if (legacy) throw new Error(legacy.message);
968
+ return file?.config ?? {};
969
+ }
970
+ function resolveGlobalBackends() {
971
+ const explicit = resolveGlobalSkWorkspaceConfig().global_backends;
972
+ if (explicit && explicit.length > 0) return [...new Set(explicit)];
973
+ return SUPPORTED_DRIVER_TARGETS.filter((t) => existsSync(globalBackendRoot(t)));
974
+ }
962
975
  function findWorkspaceRoot(startDir) {
963
976
  let dir = resolve(startDir);
964
977
  const root = parse$1(dir).root;
@@ -1004,6 +1017,8 @@ function mergeSkWorkspaceConfigs(base, overlay) {
1004
1017
  telemetry: overlay.telemetry ?? base.telemetry,
1005
1018
  // dependencies: concatenate and dedupe
1006
1019
  dependencies: dedupe([...base.dependencies ?? [], ...overlay.dependencies ?? []]),
1020
+ // global_backends: user-scope SSOT key — overlay wins entirely
1021
+ global_backends: overlay.global_backends ?? base.global_backends,
1007
1022
  // sources: dedupe by url — overlay entry wins for the same url
1008
1023
  sources: dedupeByKey([...base.sources ?? [], ...overlay.sources ?? []], "url"),
1009
1024
  // stores: dedupe by url — overlay wins
@@ -1234,6 +1249,13 @@ function normalizeDependencySection(raw, config) {
1234
1249
  if (Array.isArray(raw.dependencies)) {
1235
1250
  config.dependencies = raw.dependencies.filter((d) => typeof d === "string");
1236
1251
  }
1252
+ const rawBackends = raw["global-backends"] ?? raw.global_backends;
1253
+ if (Array.isArray(rawBackends)) {
1254
+ const valid = rawBackends.filter(
1255
+ (b) => SUPPORTED_DRIVER_TARGETS.includes(b)
1256
+ );
1257
+ if (valid.length > 0) config.global_backends = [...new Set(valid)];
1258
+ }
1237
1259
  if (Array.isArray(raw.sources)) {
1238
1260
  const entries = [];
1239
1261
  for (const item of raw.sources) {
@@ -1371,6 +1393,7 @@ var CANONICAL_KEY_ORDER = [
1371
1393
  "description",
1372
1394
  "agent_config",
1373
1395
  "dependencies",
1396
+ "global_backends",
1374
1397
  "plugins",
1375
1398
  "sources",
1376
1399
  "stores",
@@ -1752,6 +1775,6 @@ function resolveAgentDir(projectDir) {
1752
1775
  return resolve(projectDir, definition);
1753
1776
  }
1754
1777
 
1755
- export { COMPACTION_DEFAULTS, CanonicalRefConflictError, DEFAULT_RECIPE_ATTR, SKAILE_YAML_DEFAULT, SKAILE_YAML_SUFFIX, SK_WORKSPACE_DEFAULT_NAME, SK_WORKSPACE_SUFFIX, __resetCacheMigrationMemo, buildProvenanceIndex, checkRepoStatus, checkoutPin, cloneRepo, decodeSkaileYaml, deriveSingleMaterializedMcpDeclaration, encodeSkaileYaml, ensureRepo, findWorkspaceRoot, getGlobalCacheDir, getRepoCommit, globalCacheRoot, isWorkspaceConfigFilename, linkRepo, listSkWorkspaceConfigs, loadMcpServerDeclarations, loadSkWorkspaceConfig, mergeLegacyEntriesInto, mergeSkWorkspaceConfigs, migrateLegacyDir, normalizeConfig, pullRepo, readLinks, resolveAgentDir, resolveAll, resolveAsset, resolveSkWorkspaceConfig, saveSkWorkspaceConfig, scanRepo, sourceCacheKey, sourceShortName, stageMaterializedSkills, unlinkRepo, validateAssetRecipeAttr, validateAssetRecipeFlake, workspaceConfigFilename, workspaceNameFromFilename, writeLinks };
1756
- //# sourceMappingURL=chunk-PBO6SCT2.js.map
1757
- //# sourceMappingURL=chunk-PBO6SCT2.js.map
1778
+ export { COMPACTION_DEFAULTS, CanonicalRefConflictError, DEFAULT_RECIPE_ATTR, SKAILE_YAML_DEFAULT, SKAILE_YAML_SUFFIX, SK_WORKSPACE_DEFAULT_NAME, SK_WORKSPACE_SUFFIX, __resetCacheMigrationMemo, buildProvenanceIndex, checkRepoStatus, checkoutPin, cloneRepo, decodeSkaileYaml, deriveSingleMaterializedMcpDeclaration, encodeSkaileYaml, ensureRepo, findWorkspaceRoot, getGlobalCacheDir, getRepoCommit, globalCacheRoot, globalSkaileDir, isWorkspaceConfigFilename, linkRepo, listSkWorkspaceConfigs, loadMcpServerDeclarations, loadSkWorkspaceConfig, mergeLegacyEntriesInto, mergeSkWorkspaceConfigs, migrateLegacyDir, normalizeConfig, pullRepo, readLinks, resolveAgentDir, resolveAll, resolveAsset, resolveGlobalBackends, resolveGlobalSkWorkspaceConfig, resolveSkWorkspaceConfig, saveSkWorkspaceConfig, scanRepo, sourceCacheKey, sourceShortName, stageMaterializedSkills, unlinkRepo, validateAssetRecipeAttr, validateAssetRecipeFlake, workspaceConfigFilename, workspaceNameFromFilename, writeLinks };
1779
+ //# sourceMappingURL=chunk-NXC6IEL4.js.map
1780
+ //# sourceMappingURL=chunk-NXC6IEL4.js.map