@skaile/workspaces 4.11.0 → 4.13.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 (293) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/{asset-feeds-3TOP4ZKE.js → asset-feeds-AAQOGRLM.js} +14 -13
  3. package/dist/asset-feeds-AAQOGRLM.js.map +1 -0
  4. package/dist/asset-manager/catalog-deployer.js +10 -9
  5. package/dist/asset-manager/index.js +14 -13
  6. package/dist/asset-manager/installer.js +10 -9
  7. package/dist/bridge/drivers/claude-sdk.js +229 -26
  8. package/dist/bridge/drivers/claude-sdk.js.map +1 -1
  9. package/dist/bridge/drivers/codex.js +12 -11
  10. package/dist/bridge/drivers/codex.js.map +1 -1
  11. package/dist/bridge/drivers/continue.js +14 -12
  12. package/dist/bridge/drivers/continue.js.map +1 -1
  13. package/dist/bridge/drivers/echo.js +11 -8
  14. package/dist/bridge/drivers/echo.js.map +1 -1
  15. package/dist/bridge/drivers/gemini.js +10 -8
  16. package/dist/bridge/drivers/goose.js +13 -11
  17. package/dist/bridge/drivers/goose.js.map +1 -1
  18. package/dist/bridge/drivers/omp.js +8 -6
  19. package/dist/bridge/drivers/omp.js.map +1 -1
  20. package/dist/bridge/drivers/opencode.js +15 -12
  21. package/dist/bridge/drivers/opencode.js.map +1 -1
  22. package/dist/bridge/drivers/qwen.js +10 -8
  23. package/dist/bridge/drivers/qwen.js.map +1 -1
  24. package/dist/bridge/index.js +14 -13
  25. package/dist/bridge/src/cloud.d.ts.map +1 -1
  26. package/dist/bridge/src/drivers/claude-sdk.d.ts +18 -1
  27. package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
  28. package/dist/bridge/src/drivers/echo.d.ts.map +1 -1
  29. package/dist/bridge/src/drivers/omp-models-yml.d.ts.map +1 -1
  30. package/dist/bridge/src/mcp-tool-schema-filter.d.ts +44 -0
  31. package/dist/bridge/src/mcp-tool-schema-filter.d.ts.map +1 -0
  32. package/dist/bridge/src/provider-materialize/continue-config-yaml.d.ts.map +1 -1
  33. package/dist/bridge/src/provider-materialize/env-drivers.d.ts +20 -5
  34. package/dist/bridge/src/provider-materialize/env-drivers.d.ts.map +1 -1
  35. package/dist/bridge/src/provider-materialize/opencode-config.d.ts.map +1 -1
  36. package/dist/bridge/src/types.d.ts +6 -2
  37. package/dist/bridge/src/types.d.ts.map +1 -1
  38. package/dist/{chunk-MKZOK4JU.js → chunk-2FBPAR2V.js} +3 -3
  39. package/dist/{chunk-MKZOK4JU.js.map → chunk-2FBPAR2V.js.map} +1 -1
  40. package/dist/{chunk-CJXSTOGW.js → chunk-4JGTXBQB.js} +4 -4
  41. package/dist/{chunk-CJXSTOGW.js.map → chunk-4JGTXBQB.js.map} +1 -1
  42. package/dist/{chunk-OUJVFZWJ.js → chunk-4SIMGJIU.js} +4 -9
  43. package/dist/chunk-4SIMGJIU.js.map +1 -0
  44. package/dist/{chunk-AT2TJEWG.js → chunk-65VAYFIJ.js} +11 -11
  45. package/dist/chunk-65VAYFIJ.js.map +1 -0
  46. package/dist/{chunk-JM2LRJ46.js → chunk-6Y3ICAPP.js} +3 -3
  47. package/dist/{chunk-JM2LRJ46.js.map → chunk-6Y3ICAPP.js.map} +1 -1
  48. package/dist/{chunk-7IRJ4K4F.js → chunk-7IH3RKKK.js} +3 -3
  49. package/dist/{chunk-7IRJ4K4F.js.map → chunk-7IH3RKKK.js.map} +1 -1
  50. package/dist/{chunk-JECDED7B.js → chunk-7NRF7BQB.js} +5 -5
  51. package/dist/{chunk-JECDED7B.js.map → chunk-7NRF7BQB.js.map} +1 -1
  52. package/dist/{chunk-O3DHAGBO.js → chunk-A2T4WIZL.js} +6 -5
  53. package/dist/chunk-A2T4WIZL.js.map +1 -0
  54. package/dist/chunk-ALLCAFHQ.js +365 -0
  55. package/dist/chunk-ALLCAFHQ.js.map +1 -0
  56. package/dist/chunk-BDFR5MHE.js +141 -0
  57. package/dist/chunk-BDFR5MHE.js.map +1 -0
  58. package/dist/{chunk-W4IPN3DD.js → chunk-BOFL7GIF.js} +62 -10
  59. package/dist/chunk-BOFL7GIF.js.map +1 -0
  60. package/dist/{chunk-WXB6YEHZ.js → chunk-BRNGJTHH.js} +3 -3
  61. package/dist/{chunk-WXB6YEHZ.js.map → chunk-BRNGJTHH.js.map} +1 -1
  62. package/dist/chunk-C3CAXQMA.js +8 -0
  63. package/dist/chunk-C3CAXQMA.js.map +1 -0
  64. package/dist/{chunk-35PMOWAD.js → chunk-CPIAQTYM.js} +4 -4
  65. package/dist/chunk-CPIAQTYM.js.map +1 -0
  66. package/dist/{chunk-REYJKU7T.js → chunk-DHMBE5J7.js} +12 -364
  67. package/dist/chunk-DHMBE5J7.js.map +1 -0
  68. package/dist/{chunk-KSIRR5PL.js → chunk-DPLIN2RA.js} +3 -3
  69. package/dist/{chunk-KSIRR5PL.js.map → chunk-DPLIN2RA.js.map} +1 -1
  70. package/dist/{chunk-PBCNRS7Q.js → chunk-EUHB2BD2.js} +6 -6
  71. package/dist/{chunk-PBCNRS7Q.js.map → chunk-EUHB2BD2.js.map} +1 -1
  72. package/dist/{chunk-6XKQEDF7.js → chunk-FKWGIDUG.js} +6 -5
  73. package/dist/chunk-FKWGIDUG.js.map +1 -0
  74. package/dist/{chunk-ILG4BXYE.js → chunk-GZZPKAV5.js} +27 -3
  75. package/dist/chunk-GZZPKAV5.js.map +1 -0
  76. package/dist/{chunk-M5H4DWIA.js → chunk-HGPSZXZP.js} +3 -3
  77. package/dist/{chunk-M5H4DWIA.js.map → chunk-HGPSZXZP.js.map} +1 -1
  78. package/dist/{chunk-L3PZINDD.js → chunk-HXTBOZL6.js} +8 -8
  79. package/dist/{chunk-L3PZINDD.js.map → chunk-HXTBOZL6.js.map} +1 -1
  80. package/dist/{chunk-IGGHUTOW.js → chunk-HZBRHZPI.js} +4 -4
  81. package/dist/{chunk-IGGHUTOW.js.map → chunk-HZBRHZPI.js.map} +1 -1
  82. package/dist/{chunk-VLXODO37.js → chunk-IQFSXFYG.js} +3 -3
  83. package/dist/{chunk-VLXODO37.js.map → chunk-IQFSXFYG.js.map} +1 -1
  84. package/dist/{chunk-3HKYCT2M.js → chunk-JMKB7IB4.js} +4 -6
  85. package/dist/chunk-JMKB7IB4.js.map +1 -0
  86. package/dist/{chunk-S2MT6SDZ.js → chunk-KTSV5TDX.js} +107 -48
  87. package/dist/chunk-KTSV5TDX.js.map +1 -0
  88. package/dist/{chunk-IECQMSQ5.js → chunk-KUH4EKQQ.js} +4 -129
  89. package/dist/chunk-KUH4EKQQ.js.map +1 -0
  90. package/dist/{chunk-3YTFHHMI.js → chunk-LCKZCLXA.js} +3 -3
  91. package/dist/{chunk-3YTFHHMI.js.map → chunk-LCKZCLXA.js.map} +1 -1
  92. package/dist/{chunk-GXACG5ZE.js → chunk-N6XJGVSK.js} +50 -41
  93. package/dist/chunk-N6XJGVSK.js.map +1 -0
  94. package/dist/{chunk-SIGVAFRJ.js → chunk-NC7YSNBP.js} +10 -10
  95. package/dist/{chunk-SIGVAFRJ.js.map → chunk-NC7YSNBP.js.map} +1 -1
  96. package/dist/{chunk-UXUDNBJM.js → chunk-NKRAHM7T.js} +3 -3
  97. package/dist/{chunk-UXUDNBJM.js.map → chunk-NKRAHM7T.js.map} +1 -1
  98. package/dist/{chunk-WILO77HE.js → chunk-NXTLDFLA.js} +4 -4
  99. package/dist/{chunk-WILO77HE.js.map → chunk-NXTLDFLA.js.map} +1 -1
  100. package/dist/{chunk-FAI2SMFE.js → chunk-P2DLXBZK.js} +4 -4
  101. package/dist/{chunk-FAI2SMFE.js.map → chunk-P2DLXBZK.js.map} +1 -1
  102. package/dist/{chunk-2HUQUTJ3.js → chunk-PE3A6FFW.js} +4 -4
  103. package/dist/{chunk-2HUQUTJ3.js.map → chunk-PE3A6FFW.js.map} +1 -1
  104. package/dist/{chunk-DMUY5C3X.js → chunk-PHURDPQO.js} +10 -8
  105. package/dist/chunk-PHURDPQO.js.map +1 -0
  106. package/dist/{chunk-3T5DRUNZ.js → chunk-PQF3NDQH.js} +5 -5
  107. package/dist/{chunk-3T5DRUNZ.js.map → chunk-PQF3NDQH.js.map} +1 -1
  108. package/dist/{chunk-7BUZQVRR.js → chunk-Q6NDQ6BH.js} +4 -4
  109. package/dist/{chunk-7BUZQVRR.js.map → chunk-Q6NDQ6BH.js.map} +1 -1
  110. package/dist/{chunk-HO4UO25I.js → chunk-QWGSKDD7.js} +91 -7
  111. package/dist/chunk-QWGSKDD7.js.map +1 -0
  112. package/dist/{chunk-2D5BYAL6.js → chunk-RQLL7L72.js} +3 -3
  113. package/dist/{chunk-2D5BYAL6.js.map → chunk-RQLL7L72.js.map} +1 -1
  114. package/dist/{chunk-3XXQPHGL.js → chunk-T3YUSWVK.js} +4 -4
  115. package/dist/{chunk-3XXQPHGL.js.map → chunk-T3YUSWVK.js.map} +1 -1
  116. package/dist/{chunk-MMLXSVQ3.js → chunk-UOJW2DOZ.js} +5 -5
  117. package/dist/{chunk-MMLXSVQ3.js.map → chunk-UOJW2DOZ.js.map} +1 -1
  118. package/dist/{chunk-ELPR5XBG.js → chunk-V4RGCKYC.js} +5 -3
  119. package/dist/chunk-V4RGCKYC.js.map +1 -0
  120. package/dist/{chunk-UKJMQZV6.js → chunk-VOEBLPXO.js} +2 -2
  121. package/dist/chunk-VOEBLPXO.js.map +1 -0
  122. package/dist/{chunk-7SNYWCQS.js → chunk-WIQDBNMF.js} +3 -3
  123. package/dist/{chunk-7SNYWCQS.js.map → chunk-WIQDBNMF.js.map} +1 -1
  124. package/dist/{chunk-A3X4LDOD.js → chunk-WQPLZUXU.js} +6 -6
  125. package/dist/{chunk-A3X4LDOD.js.map → chunk-WQPLZUXU.js.map} +1 -1
  126. package/dist/{chunk-7ZJXFQ42.js → chunk-WZQWZJYL.js} +3 -3
  127. package/dist/{chunk-7ZJXFQ42.js.map → chunk-WZQWZJYL.js.map} +1 -1
  128. package/dist/{chunk-BXV6RLF4.js → chunk-XKPFQ3JT.js} +4 -4
  129. package/dist/{chunk-BXV6RLF4.js.map → chunk-XKPFQ3JT.js.map} +1 -1
  130. package/dist/{chunk-KLMXMW6Z.js → chunk-XPDB4O4H.js} +3 -3
  131. package/dist/{chunk-KLMXMW6Z.js.map → chunk-XPDB4O4H.js.map} +1 -1
  132. package/dist/{chunk-GUZNTYHE.js → chunk-YXUVOWEU.js} +4 -4
  133. package/dist/{chunk-GUZNTYHE.js.map → chunk-YXUVOWEU.js.map} +1 -1
  134. package/dist/{chunk-I3UWSGEB.js → chunk-ZK7DQRB2.js} +3 -3
  135. package/dist/{chunk-I3UWSGEB.js.map → chunk-ZK7DQRB2.js.map} +1 -1
  136. package/dist/{chunk-KJM7Y2FW.js → chunk-ZUOZV7CS.js} +7 -7
  137. package/dist/{chunk-KJM7Y2FW.js.map → chunk-ZUOZV7CS.js.map} +1 -1
  138. package/dist/cli/index.js +76 -69
  139. package/dist/cli/index.js.map +1 -1
  140. package/dist/cli/src/commands/migrate-legacy-entry.d.ts.map +1 -1
  141. package/dist/cli/src/commands/project.d.ts.map +1 -1
  142. package/dist/cli/src/store-auth.d.ts.map +1 -1
  143. package/dist/connectors/config.js +5 -13
  144. package/dist/connectors/index.js +22 -20
  145. package/dist/connectors/src/config.d.ts.map +1 -1
  146. package/dist/connectors/src/connector-manager.d.ts.map +1 -1
  147. package/dist/connectors/src/materialized-connectors.d.ts.map +1 -1
  148. package/dist/connectors/src/secrets.d.ts.map +1 -1
  149. package/dist/core/index.js +9 -8
  150. package/dist/core/logging.js +3 -2
  151. package/dist/core/manifest.js +2 -2
  152. package/dist/core/provider-registry-credentials.js +2 -2
  153. package/dist/core/provider-registry.js +1 -1
  154. package/dist/core/runtime-assets.js +5 -4
  155. package/dist/core/src/index.d.ts +3 -3
  156. package/dist/core/src/index.d.ts.map +1 -1
  157. package/dist/core/src/logging/create-logger.d.ts.map +1 -1
  158. package/dist/core/src/logging/index.d.ts +1 -0
  159. package/dist/core/src/logging/index.d.ts.map +1 -1
  160. package/dist/core/src/logging/redact.d.ts +33 -0
  161. package/dist/core/src/logging/redact.d.ts.map +1 -0
  162. package/dist/core/src/logging/retention-value.d.ts +7 -0
  163. package/dist/core/src/logging/retention-value.d.ts.map +1 -0
  164. package/dist/core/src/logging/retention.d.ts.map +1 -1
  165. package/dist/core/src/logging/sanitize.d.ts +11 -0
  166. package/dist/core/src/logging/sanitize.d.ts.map +1 -1
  167. package/dist/core/src/provider-registry.d.ts +22 -0
  168. package/dist/core/src/provider-registry.d.ts.map +1 -1
  169. package/dist/core/src/workspace-config.d.ts +51 -2
  170. package/dist/core/src/workspace-config.d.ts.map +1 -1
  171. package/dist/core/workspace-config.js +4 -3
  172. package/dist/deploy/index.js +9 -8
  173. package/dist/deploy/index.js.map +1 -1
  174. package/dist/discovery/index.js +3 -3
  175. package/dist/{ensure-sources-2OC2X3ZM.js → ensure-sources-PSWARJPK.js} +17 -16
  176. package/dist/ensure-sources-PSWARJPK.js.map +1 -0
  177. package/dist/factory-assets/connectors/box.js +22 -20
  178. package/dist/factory-assets/connectors/deploy.js +22 -20
  179. package/dist/factory-assets/connectors/devserver.js +22 -20
  180. package/dist/factory-assets/connectors/flow/CONNECTOR.md +4 -2
  181. package/dist/factory-assets/connectors/flow/adapter.js +22 -20
  182. package/dist/factory-assets/connectors/flow/contract/schema.d.ts +12 -0
  183. package/dist/factory-assets/connectors/flow/contract/schema.d.ts.map +1 -1
  184. package/dist/factory-assets/connectors/flow/contract.js +4 -3
  185. package/dist/factory-assets/connectors/flow/engine/node-shape.d.ts.map +1 -1
  186. package/dist/factory-assets/connectors/flow/engine.js +13 -11
  187. package/dist/factory-assets/connectors/flow/prompt-fragments.js +3 -2
  188. package/dist/factory-assets/connectors/flow/run-flow.js +24 -22
  189. package/dist/factory-assets/connectors/flow/subprompt-runner.d.ts.map +1 -1
  190. package/dist/factory-assets/connectors/flow.js +22 -20
  191. package/dist/factory-assets/connectors/git/driver.d.ts.map +1 -1
  192. package/dist/factory-assets/connectors/git.js +22 -20
  193. package/dist/factory-assets/connectors/gmail.js +22 -20
  194. package/dist/factory-assets/connectors/googledrive.js +22 -20
  195. package/dist/factory-assets/connectors/local.js +22 -20
  196. package/dist/factory-assets/connectors/mattermost.js +22 -20
  197. package/dist/factory-assets/connectors/memory.js +22 -20
  198. package/dist/factory-assets/connectors/minio.js +22 -20
  199. package/dist/factory-assets/connectors/postgres.js +22 -20
  200. package/dist/factory-assets/connectors/s3.js +22 -20
  201. package/dist/factory-assets/connectors/sharepoint.js +22 -20
  202. package/dist/factory-assets/connectors/sqlite.js +22 -20
  203. package/dist/factory-assets/connectors/static-server.js +22 -20
  204. package/dist/factory-assets/connectors/tunnel.js +22 -20
  205. package/dist/factory-assets/connectors/webdav.js +22 -20
  206. package/dist/factory-assets/connectors/xstate-store.js +22 -20
  207. package/dist/factory-assets/connectors/xstate.js +22 -20
  208. package/dist/flows-7EB63Q2Q.js +24 -0
  209. package/dist/{flows-H6FL4NZU.js.map → flows-7EB63Q2Q.js.map} +1 -1
  210. package/dist/{helpers-RPJUSSG3.js → helpers-LHHGL2NL.js} +17 -16
  211. package/dist/{helpers-RPJUSSG3.js.map → helpers-LHHGL2NL.js.map} +1 -1
  212. package/dist/library/index.js +12 -11
  213. package/dist/library/install.js +1 -15
  214. package/dist/library/src/install/install-from-manifest.d.ts.map +1 -1
  215. package/dist/{library-publish-AAD6GTIF.js → library-publish-4SBO437O.js} +24 -22
  216. package/dist/library-publish-4SBO437O.js.map +1 -0
  217. package/dist/open-library-SF2F7NDS.js +37 -0
  218. package/dist/{open-library-HDOM4MLS.js.map → open-library-SF2F7NDS.js.map} +1 -1
  219. package/dist/paths-IK6Y4OIU.js +20 -0
  220. package/dist/{paths-RL6NZW5X.js.map → paths-IK6Y4OIU.js.map} +1 -1
  221. package/dist/{plugin-store-ZTAJCMTY.js → plugin-store-LUJ4GXSO.js} +11 -10
  222. package/dist/plugin-store-LUJ4GXSO.js.map +1 -0
  223. package/dist/{project-2B52FKAY.js → project-ZHPOPJBE.js} +18 -17
  224. package/dist/{project-2B52FKAY.js.map → project-ZHPOPJBE.js.map} +1 -1
  225. package/dist/resolver/index.js +10 -9
  226. package/dist/run-group-engine/index.js.map +1 -1
  227. package/dist/run-group-engine/src/rollup.d.ts.map +1 -1
  228. package/dist/runner/index.js +33 -31
  229. package/dist/runner/src/capability-registry.d.ts +13 -1
  230. package/dist/runner/src/capability-registry.d.ts.map +1 -1
  231. package/dist/runner/src/codex-init.d.ts.map +1 -1
  232. package/dist/runner/src/compaction/orchestrator.d.ts.map +1 -1
  233. package/dist/runner/src/compaction/strategy.d.ts +8 -5
  234. package/dist/runner/src/compaction/strategy.d.ts.map +1 -1
  235. package/dist/runner/src/lifecycle-handler.d.ts.map +1 -1
  236. package/dist/runner/src/log-content.d.ts +22 -0
  237. package/dist/runner/src/log-content.d.ts.map +1 -0
  238. package/dist/runner/src/logging-bootstrap.d.ts +6 -1
  239. package/dist/runner/src/logging-bootstrap.d.ts.map +1 -1
  240. package/dist/runner/src/serve.d.ts.map +1 -1
  241. package/dist/runner/src/session-builder.d.ts.map +1 -1
  242. package/dist/sdk/asset-manager.js +14 -13
  243. package/dist/sdk/bridge.js +14 -13
  244. package/dist/sdk/core.js +9 -8
  245. package/dist/sdk/flow.js +13 -11
  246. package/dist/sdk/index.js +33 -31
  247. package/dist/sdk/index.js.map +1 -1
  248. package/dist/sdk/resolver.js +10 -9
  249. package/dist/sdk/runner.js +33 -31
  250. package/dist/{setup-MVBITSVT.js → setup-3NXXR7SH.js} +23 -22
  251. package/dist/setup-3NXXR7SH.js.map +1 -0
  252. package/dist/skills-YB5RHUAT.js +24 -0
  253. package/dist/{skills-Y6MU2NRI.js.map → skills-YB5RHUAT.js.map} +1 -1
  254. package/dist/source-C2OYNI3T.js +38 -0
  255. package/dist/{source-53PY7DXF.js.map → source-C2OYNI3T.js.map} +1 -1
  256. package/dist/{source-manifest-publish-ALRZKEBO.js → source-manifest-publish-BKS763DB.js} +25 -23
  257. package/dist/source-manifest-publish-BKS763DB.js.map +1 -0
  258. package/dist/tui/index.js +33 -31
  259. package/dist/tui/index.js.map +1 -1
  260. package/dist/types/src/manifests/preset.d.ts +5 -5
  261. package/dist/workspace-plugin/adapters/mcp.js +15 -14
  262. package/dist/workspace-plugin/adapters/omp.js +7 -7
  263. package/dist/workspace-plugin/adapters/omp.js.map +1 -1
  264. package/dist/workspace-plugin/index.js +4 -3
  265. package/dist/workspace-plugin/src/adapters/omp.d.ts.map +1 -1
  266. package/package.json +3 -1
  267. package/dist/asset-feeds-3TOP4ZKE.js.map +0 -1
  268. package/dist/chunk-35PMOWAD.js.map +0 -1
  269. package/dist/chunk-3HKYCT2M.js.map +0 -1
  270. package/dist/chunk-6XKQEDF7.js.map +0 -1
  271. package/dist/chunk-AT2TJEWG.js.map +0 -1
  272. package/dist/chunk-DMUY5C3X.js.map +0 -1
  273. package/dist/chunk-ELPR5XBG.js.map +0 -1
  274. package/dist/chunk-GXACG5ZE.js.map +0 -1
  275. package/dist/chunk-HO4UO25I.js.map +0 -1
  276. package/dist/chunk-IECQMSQ5.js.map +0 -1
  277. package/dist/chunk-ILG4BXYE.js.map +0 -1
  278. package/dist/chunk-O3DHAGBO.js.map +0 -1
  279. package/dist/chunk-OUJVFZWJ.js.map +0 -1
  280. package/dist/chunk-REYJKU7T.js.map +0 -1
  281. package/dist/chunk-S2MT6SDZ.js.map +0 -1
  282. package/dist/chunk-UKJMQZV6.js.map +0 -1
  283. package/dist/chunk-W4IPN3DD.js.map +0 -1
  284. package/dist/ensure-sources-2OC2X3ZM.js.map +0 -1
  285. package/dist/flows-H6FL4NZU.js +0 -23
  286. package/dist/library-publish-AAD6GTIF.js.map +0 -1
  287. package/dist/open-library-HDOM4MLS.js +0 -35
  288. package/dist/paths-RL6NZW5X.js +0 -19
  289. package/dist/plugin-store-ZTAJCMTY.js.map +0 -1
  290. package/dist/setup-MVBITSVT.js.map +0 -1
  291. package/dist/skills-Y6MU2NRI.js +0 -23
  292. package/dist/source-53PY7DXF.js +0 -36
  293. package/dist/source-manifest-publish-ALRZKEBO.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import { tryWithFsDeadline, withFsDeadline, fsDeadlineMs } from './chunk-MKZOK4JU.js';
2
- import { createLogger } from './chunk-W4IPN3DD.js';
1
+ import { tryWithFsDeadline, withFsDeadline, fsDeadlineMs } from './chunk-2FBPAR2V.js';
2
+ import { createLogger } from './chunk-BOFL7GIF.js';
3
3
  import { stat, mkdir, cp, writeFile, rm } from 'fs/promises';
4
4
  import { resolve, sep, join } from 'path';
5
5
 
@@ -155,5 +155,5 @@ function resolveFlowSkills(flow, allEntries) {
155
155
  }
156
156
 
157
157
  export { WORKSPACE_MOUNT_ENV_VAR, deployAll, deployCatalogEntry, findAiAssetsRoot, isUnderWorkspaceMount, resolveFlowSkills, undeployCatalogEntry, workspaceMountDirs };
158
- //# sourceMappingURL=chunk-7BUZQVRR.js.map
159
- //# sourceMappingURL=chunk-7BUZQVRR.js.map
158
+ //# sourceMappingURL=chunk-Q6NDQ6BH.js.map
159
+ //# sourceMappingURL=chunk-Q6NDQ6BH.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../asset-manager/src/catalog-deployer.ts"],"names":[],"mappings":";;;;;AA2GA,IAAM,uBAAA,GAA0B,CAAA;AAGhC,IAAM,qBAAA,GAAwB,CAAA;AAE9B,IAAI,cAAA;AAEJ,SAAS,GAAA,GAAuC;AAC9C,EAAA,cAAA,KAAmB,aAAa,EAAE,IAAA,EAAM,QAAA,EAAU,OAAA,EAAS,oBAAoB,CAAA;AAC/E,EAAA,OAAO,cAAA;AACT;AAOA,IAAM,2BAAA,GAA8B,mBAAA;AAS7B,IAAM,uBAAA,GAA0B;AAYhC,SAAS,kBAAA,GAA+B;AAC7C,EAAA,MAAM,GAAA,GAAM,OAAA,CAAQ,GAAA,CAAI,uBAAuB,CAAA;AAC/C,EAAA,IAAI,GAAA,KAAQ,MAAA,EAAW,OAAO,CAAC,2BAA2B,CAAA;AAC1D,EAAA,OAAO,GAAA,CACJ,MAAM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,CAAE,CAAA;AAAA,IAC9C;AAAA,EACF;AAEA,EAAA,OAAO,MAAA;AACT;AAeO,SAAS,iBAAA,CACd,MACA,UAAA,EAC2F;AAC3F,EAAA,MAAM,YAAA,uBAAmB,GAAA,EAAkC;AAC3D,EAAA,KAAA,MAAW,KAAK,UAAA,EAAY;AAC1B,IAAA,IAAI,EAAE,IAAA,KAAS,OAAA,eAAsB,GAAA,CAAI,CAAA,CAAE,MAAM,CAAC,CAAA;AAAA,EACpD;AAEA,EAAA,MAAM,WAAmC,EAAC;AAC1C,EAAA,MAAM,WAAmC,EAAC;AAC1C,EAAA,MAAM,UAAoB,EAAC;AAE3B,EAAA,KAAA,MAAW,IAAA,IAAQ,IAAA,CAAK,eAAA,IAAmB,EAAC,EAAG;AAC7C,IAAA,MAAM,KAAA,GAAQ,YAAA,CAAa,GAAA,CAAI,IAAI,CAAA;AACnC,IAAA,IAAI,KAAA,EAAO,QAAA,CAAS,IAAA,CAAK,KAAK,CAAA;AAAA,SACzB,OAAA,CAAQ,KAAK,IAAI,CAAA;AAAA,EACxB;AAEA,EAAA,KAAA,MAAW,IAAA,IAAQ,IAAA,CAAK,eAAA,IAAmB,EAAC,EAAG;AAC7C,IAAA,MAAM,KAAA,GAAQ,YAAA,CAAa,GAAA,CAAI,IAAI,CAAA;AACnC,IAAA,IAAI,KAAA,EAAO,QAAA,CAAS,IAAA,CAAK,KAAK,CAAA;AAAA,EAEhC;AAEA,EAAA,OAAO,EAAE,QAAA,EAAU,QAAA,EAAU,OAAA,EAAQ;AACvC","file":"chunk-7BUZQVRR.js","sourcesContent":["/**\n * Platform-triggered asset deployment.\n *\n * Takes catalog entries (with source_path relative to ai-assets/) and deploys\n * them to a session's .claude/skills/ directory. Handles skill context injection\n * and catalog priority-based name resolution.\n */\n\nimport { cp, mkdir, rm, stat, writeFile } from \"node:fs/promises\";\nimport { join, resolve, sep } from \"node:path\";\nimport { fsDeadlineMs, tryWithFsDeadline, withFsDeadline } from \"@skaile/workspaces/core\";\nimport { createLogger } from \"@skaile/workspaces/core/logging\";\n\n// ---------------------------------------------------------------------------\n// Types (formerly in catalog-compiler.ts, inlined after tear-out in Task 1.5)\n// ---------------------------------------------------------------------------\n\n/**\n * A single user-facing input parameter declared in a SKILL.md.\n *\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport interface InputSpec {\n /** Input parameter key used in skill invocation. */\n key: string;\n /** Whether the input must be provided before running the skill. */\n required?: boolean;\n /** Question string shown to the user when collecting this input. */\n prompt?: string;\n /** Short display label for UI forms. */\n label?: string;\n /** Input data type hint (e.g. `\"string\"`, `\"number\"`, `\"file\"`). */\n type?: string;\n /** Additional guidance text shown alongside the input field. */\n hint?: string;\n}\n\n/**\n * A compiled catalog entry (skill or flow).\n *\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport interface CatalogEntryCompiled {\n /** Unique ID in `domain/name` form (e.g. `skaileup-conceptualization/cf_overview`). */\n id: string;\n /** Asset kind. */\n kind: \"skill\" | \"flow\";\n /** Human-readable asset name. */\n name: string;\n /** One-line description. */\n description: string;\n /** Semantic version string. */\n version: string;\n /** Maturity stage. */\n stage: \"alpha\" | \"beta\" | \"stable\";\n /** Searchable keywords. */\n keywords: string[];\n /** User-facing input specifications. */\n inputs: InputSpec[];\n /** Domain directory name. */\n source_domain: string;\n /** Asset path relative to assetsRoot. */\n source_path: string;\n /** Optional icon identifier. */\n icon?: string;\n /** Flow-only: required skill names. */\n required_skills?: string[];\n /** Flow-only: optional skill names. */\n optional_skills?: string[];\n}\n\n/**\n * Options controlling how platform-triggered skill deployment is performed.\n *\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport interface DeployFromCatalogOptions {\n /** Root directory of ai-assets (where `source_path` in catalog entries is relative to). */\n assetsRoot: string;\n /** Target directory for deployed skills (e.g. `/workspace/.claude/skills/`). */\n skillsDir: string;\n /** Optional context markdown appended to the deployed skill directory as `CONTEXT.md`. */\n context?: string;\n}\n\n/**\n * Result of a platform-triggered batch skill deployment.\n *\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport interface DeployResult {\n /** IDs of catalog entries successfully deployed. */\n deployed: string[];\n /** IDs of catalog entries skipped (non-skill kinds). */\n skipped: string[];\n /** Error messages for entries that could not be deployed. */\n errors: string[];\n}\n\n// ---------------------------------------------------------------------------\n// Workspace-mount awareness\n// ---------------------------------------------------------------------------\n\n/**\n * Multiplier applied to the base filesystem deadline for whole-tree operations\n * (recursive copy / remove), which legitimately outlast a single `stat`.\n */\nconst TREE_OP_DEADLINE_FACTOR = 4;\n\n/** Default number of parent levels {@link findAiAssetsRoot} inspects. */\nconst AI_ASSETS_WALK_LEVELS = 6;\n\nlet deployerLogger: ReturnType<typeof createLogger> | undefined;\n\nfunction log(): ReturnType<typeof createLogger> {\n deployerLogger ??= createLogger({ kind: \"runner\", subkind: \"catalog-deployer\" });\n return deployerLogger;\n}\n\n/**\n * Where the agent container binds its rclone FUSE mount. Nothing under this\n * path is a safe place to read an asset tree from: the mount is remote\n * (SharePoint / OneDrive / WebDAV) and can wedge indefinitely.\n */\nconst DEFAULT_WORKSPACE_MOUNT_DIR = \"/skaile/workspace\";\n\n/**\n * Env override for the workspace-mount path(s), comma-separated.\n *\n * Set it when the runner binds the mount somewhere other than\n * {@link DEFAULT_WORKSPACE_MOUNT_DIR}; set it to the empty string to disable\n * the guard entirely (single-machine dev, where nothing is a network mount).\n */\nexport const WORKSPACE_MOUNT_ENV_VAR = \"SKAILE_WORKSPACE_MOUNT_DIR\";\n\n/**\n * Resolve the directories treated as network mounts.\n *\n * Read per call rather than cached: the runner mutates `process.env` while\n * wiring a session, so a module-load snapshot would pin a pre-configuration\n * value.\n *\n * @returns Absolute mount paths; empty when the guard is disabled.\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport function workspaceMountDirs(): string[] {\n const raw = process.env[WORKSPACE_MOUNT_ENV_VAR];\n if (raw === undefined) return [DEFAULT_WORKSPACE_MOUNT_DIR];\n return raw\n .split(\",\")\n .map((segment) => segment.trim())\n .filter((segment) => segment.length > 0)\n .map((segment) => resolve(segment));\n}\n\n/**\n * Is `candidate` at, or inside, one of the known workspace mount paths?\n *\n * Pure path arithmetic — deliberately no filesystem access, because the whole\n * point is to decide *before* touching a path that might be unresponsive.\n *\n * @param candidate - Path to test.\n * @param mountDirs - Mount roots; defaults to {@link workspaceMountDirs}.\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport function isUnderWorkspaceMount(\n candidate: string,\n mountDirs: string[] = workspaceMountDirs(),\n): boolean {\n const target = resolve(candidate);\n return mountDirs.some((dir) => {\n const root = resolve(dir);\n return target === root || target.startsWith(root + sep);\n });\n}\n\n/**\n * Walk upward from `startDir` looking for an `ai-assets/` directory.\n *\n * Two properties matter beyond \"find the folder\":\n *\n * 1. **Never synchronous.** The walk probes up to six directories; any one of\n * them can be on a FUSE mount, and the former `existsSync` chain blocked the\n * event loop on the first unresponsive probe. Each probe is now awaited and\n * deadline-bounded, so a wedged mount costs one skipped candidate.\n * 2. **Never resolves onto a mount.** A hit under the workspace mount is\n * skipped with a warning rather than returned: accepting it would wire every\n * later skill deploy — a recursive copy — to a remote filesystem. The walk\n * continues upward, so a legitimate `ai-assets/` in a parent still wins.\n *\n * Only a **directory** counts. An `ai-assets` file would otherwise be returned\n * as a root and every later `join(root, source_path)` would fail with ENOTDIR.\n *\n * @param startDir - Directory to start from (typically the project dir).\n * @param opts - `levels` caps the upward walk; `mountDirs` overrides the mount\n * roots (defaults to {@link workspaceMountDirs}).\n * @returns Absolute path to the `ai-assets/` directory, or `null` if none is\n * reachable within `levels`.\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport async function findAiAssetsRoot(\n startDir: string,\n opts?: { levels?: number; mountDirs?: string[] },\n): Promise<string | null> {\n const mountDirs = opts?.mountDirs ?? workspaceMountDirs();\n const levels = opts?.levels ?? AI_ASSETS_WALK_LEVELS;\n let dir = resolve(startDir);\n // Every level of a `/skaile/workspace/...` start dir is under the mount, so\n // an unconditional warn would fire once per level for one lookup. Collect and\n // report once — the operator needs the fact, not six copies of it.\n const refused: string[] = [];\n\n for (let i = 0; i < levels; i++) {\n const candidate = join(dir, \"ai-assets\");\n if (isUnderWorkspaceMount(candidate, mountDirs)) {\n refused.push(candidate);\n } else {\n const isDir = await tryWithFsDeadline(\n `stat ${candidate}`,\n async () => (await stat(candidate)).isDirectory(),\n false,\n );\n if (isDir) {\n if (refused.length > 0) warnRefused(refused, mountDirs);\n return candidate;\n }\n }\n const parent = resolve(dir, \"..\");\n if (parent === dir) break; // filesystem root — nothing further up\n dir = parent;\n }\n if (refused.length > 0) warnRefused(refused, mountDirs);\n return null;\n}\n\n/** Single warning for every `ai-assets` candidate skipped for sitting on a mount. */\nfunction warnRefused(refused: string[], mountDirs: string[]): void {\n log().warn(\n \"findAiAssetsRoot refused candidates under a workspace mount — deploying skills from a network mount can stall the session\",\n { refused, mountDirs },\n );\n}\n\n/**\n * Deploy a single catalog entry to the session skills directory.\n *\n * Copies the entire skill source directory into `skillsDir/<entry.name>/`.\n * If `context` is provided, a separate `CONTEXT.md` is written alongside\n * `SKILL.md` so the source file is never modified.\n *\n * Only `skill` entries are deployable; other kinds return an error.\n *\n * **Async by necessity.** This runs from the `session_init` command handler\n * with the WebSocket live, and both `assetsRoot` and `skillsDir` can sit on a\n * network mount. The former `cpSync`/`rmSync` pair parked the event loop for\n * the whole copy; every call is now awaited and deadline-bounded, so an\n * unresponsive mount fails one deployment instead of the session.\n *\n * @param entry - Compiled catalog entry to deploy.\n * @param options - Deployment target and optional context.\n * @returns `{ success: true }` on success, `{ success: false, error }` on failure.\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport async function deployCatalogEntry(\n entry: CatalogEntryCompiled,\n options: DeployFromCatalogOptions,\n): Promise<{ success: boolean; error?: string }> {\n const { assetsRoot, skillsDir, context } = options;\n\n if (entry.kind !== \"skill\") {\n return { success: false, error: `Cannot deploy ${entry.kind} directly — only skills` };\n }\n\n const sourcePath = join(assetsRoot, entry.source_path);\n const skillMdPath = join(sourcePath, \"SKILL.md\");\n\n const hasSkillMd = await tryWithFsDeadline(\n `stat ${skillMdPath}`,\n async () => {\n await stat(skillMdPath);\n return true;\n },\n false,\n );\n if (!hasSkillMd) {\n return { success: false, error: `SKILL.md not found at ${skillMdPath}` };\n }\n\n const destDir = join(skillsDir, entry.name);\n\n try {\n await withFsDeadline(`mkdir ${destDir}`, () => mkdir(destDir, { recursive: true }));\n\n // Copy the entire skill directory\n await withFsDeadline(\n `cp ${sourcePath} -> ${destDir}`,\n () => cp(sourcePath, destDir, { recursive: true }),\n fsDeadlineMs() * TREE_OP_DEADLINE_FACTOR,\n );\n\n // Write context to a separate CONTEXT.md — never modify the original SKILL.md.\n // The agent discovers both files in the skill directory.\n const contextPath = join(destDir, \"CONTEXT.md\");\n if (context) {\n await withFsDeadline(`write ${contextPath}`, () =>\n writeFile(contextPath, `# Additional Context\\n\\n${context}\\n`, \"utf8\"),\n );\n } else {\n // `force: true` makes this a single call: a stale CONTEXT.md is removed,\n // an absent one is a no-op. The former existsSync probe only added a\n // second trip to the same possibly-wedged mount.\n await withFsDeadline(`rm ${contextPath}`, () => rm(contextPath, { force: true }));\n }\n } catch (err) {\n return { success: false, error: err instanceof Error ? err.message : String(err) };\n }\n\n return { success: true };\n}\n\n/**\n * Remove a deployed skill directory from the session skills directory.\n *\n * @param name - Skill name (directory basename under `skillsDir`).\n * @param skillsDir - Absolute path to the session skills directory.\n * @returns `true` if the skill was found and removed; `false` if it was not\n * deployed, or if the directory could not be reached within the deadline.\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport async function undeployCatalogEntry(name: string, skillsDir: string): Promise<boolean> {\n const destDir = join(skillsDir, name);\n const exists = await tryWithFsDeadline(\n `stat ${destDir}`,\n async () => {\n await stat(destDir);\n return true;\n },\n false,\n );\n if (!exists) return false;\n await withFsDeadline(\n `rm -r ${destDir}`,\n () => rm(destDir, { recursive: true, force: true }),\n fsDeadlineMs() * TREE_OP_DEADLINE_FACTOR,\n );\n return true;\n}\n\n/**\n * Deploy multiple catalog entries in a single batch operation.\n *\n * Non-skill entries (flows, agents, etc.) are automatically skipped and\n * recorded in `result.skipped`. Deployment failures are collected in\n * `result.errors` without aborting the rest of the batch.\n *\n * @param entries - Compiled catalog entries to deploy.\n * @param options - Deployment target and optional context.\n * @returns Aggregated {@link DeployResult} with deployed, skipped, and error lists.\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport async function deployAll(\n entries: CatalogEntryCompiled[],\n options: DeployFromCatalogOptions,\n): Promise<DeployResult> {\n const result: DeployResult = { deployed: [], skipped: [], errors: [] };\n\n for (const entry of entries) {\n if (entry.kind !== \"skill\") {\n result.skipped.push(entry.id);\n continue;\n }\n\n // Serial on purpose: concurrent recursive copies onto one mount multiply\n // the queue depth on the exact resource that is already the bottleneck.\n const r = await deployCatalogEntry(entry, options);\n if (r.success) {\n result.deployed.push(entry.id);\n } else {\n result.errors.push(`${entry.id}: ${r.error}`);\n }\n }\n\n return result;\n}\n\n/**\n * Resolve a flow's skill dependencies from the full catalog entry list.\n *\n * Partitions `flow.required_skills` and `flow.optional_skills` into resolved\n * entries and a list of names that could not be found. Missing optional skills\n * are silently ignored (they do not appear in `missing`).\n *\n * @param flow - Compiled flow entry whose skill dependencies should be resolved.\n * @param allEntries - Full set of compiled catalog entries to search.\n * @returns Object containing resolved `required` entries, resolved `optional` entries,\n * and `missing` skill names that were listed as required but not found.\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport function resolveFlowSkills(\n flow: CatalogEntryCompiled,\n allEntries: CatalogEntryCompiled[],\n): { required: CatalogEntryCompiled[]; optional: CatalogEntryCompiled[]; missing: string[] } {\n const skillsByName = new Map<string, CatalogEntryCompiled>();\n for (const e of allEntries) {\n if (e.kind === \"skill\") skillsByName.set(e.name, e);\n }\n\n const required: CatalogEntryCompiled[] = [];\n const optional: CatalogEntryCompiled[] = [];\n const missing: string[] = [];\n\n for (const name of flow.required_skills ?? []) {\n const entry = skillsByName.get(name);\n if (entry) required.push(entry);\n else missing.push(name);\n }\n\n for (const name of flow.optional_skills ?? []) {\n const entry = skillsByName.get(name);\n if (entry) optional.push(entry);\n // Optional skills don't count as missing\n }\n\n return { required, optional, missing };\n}\n"]}
1
+ {"version":3,"sources":["../asset-manager/src/catalog-deployer.ts"],"names":[],"mappings":";;;;;AA2GA,IAAM,uBAAA,GAA0B,CAAA;AAGhC,IAAM,qBAAA,GAAwB,CAAA;AAE9B,IAAI,cAAA;AAEJ,SAAS,GAAA,GAAuC;AAC9C,EAAA,cAAA,KAAmB,aAAa,EAAE,IAAA,EAAM,QAAA,EAAU,OAAA,EAAS,oBAAoB,CAAA;AAC/E,EAAA,OAAO,cAAA;AACT;AAOA,IAAM,2BAAA,GAA8B,mBAAA;AAS7B,IAAM,uBAAA,GAA0B;AAYhC,SAAS,kBAAA,GAA+B;AAC7C,EAAA,MAAM,GAAA,GAAM,OAAA,CAAQ,GAAA,CAAI,uBAAuB,CAAA;AAC/C,EAAA,IAAI,GAAA,KAAQ,MAAA,EAAW,OAAO,CAAC,2BAA2B,CAAA;AAC1D,EAAA,OAAO,GAAA,CACJ,MAAM,GAAG,CAAA,CACT,IAAI,CAAC,OAAA,KAAY,OAAA,CAAQ,IAAA,EAAM,CAAA,CAC/B,OAAO,CAAC,OAAA,KAAY,OAAA,CAAQ,MAAA,GAAS,CAAC,CAAA,CACtC,IAAI,CAAC,OAAA,KAAY,OAAA,CAAQ,OAAO,CAAC,CAAA;AACtC;AAYO,SAAS,qBAAA,CACd,SAAA,EACA,SAAA,GAAsB,kBAAA,EAAmB,EAChC;AACT,EAAA,MAAM,MAAA,GAAS,QAAQ,SAAS,CAAA;AAChC,EAAA,OAAO,SAAA,CAAU,IAAA,CAAK,CAAC,GAAA,KAAQ;AAC7B,IAAA,MAAM,IAAA,GAAO,QAAQ,GAAG,CAAA;AACxB,IAAA,OAAO,MAAA,KAAW,IAAA,IAAQ,MAAA,CAAO,UAAA,CA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AAQ,YAAA,CAAa,GAAA,CAAI,IAAI,CAAA;AACnC,IAAA,IAAI,KAAA,EAAO,QAAA,CAAS,IAAA,CAAK,KAAK,CAAA;AAAA,SACzB,OAAA,CAAQ,KAAK,IAAI,CAAA;AAAA,EACxB;AAEA,EAAA,KAAA,MAAW,IAAA,IAAQ,IAAA,CAAK,eAAA,IAAmB,EAAC,EAAG;AAC7C,IAAA,MAAM,KAAA,GAAQ,YAAA,CAAa,GAAA,CAAI,IAAI,CAAA;AACnC,IAAA,IAAI,KAAA,EAAO,QAAA,CAAS,IAAA,CAAK,KAAK,CAAA;AAAA,EAEhC;AAEA,EAAA,OAAO,EAAE,QAAA,EAAU,QAAA,EAAU,OAAA,EAAQ;AACvC","file":"chunk-Q6NDQ6BH.js","sourcesContent":["/**\n * Platform-triggered asset deployment.\n *\n * Takes catalog entries (with source_path relative to ai-assets/) and deploys\n * them to a session's .claude/skills/ directory. Handles skill context injection\n * and catalog priority-based name resolution.\n */\n\nimport { cp, mkdir, rm, stat, writeFile } from \"node:fs/promises\";\nimport { join, resolve, sep } from \"node:path\";\nimport { fsDeadlineMs, tryWithFsDeadline, withFsDeadline } from \"@skaile/workspaces/core\";\nimport { createLogger } from \"@skaile/workspaces/core/logging\";\n\n// ---------------------------------------------------------------------------\n// Types (formerly in catalog-compiler.ts, inlined after tear-out in Task 1.5)\n// ---------------------------------------------------------------------------\n\n/**\n * A single user-facing input parameter declared in a SKILL.md.\n *\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport interface InputSpec {\n /** Input parameter key used in skill invocation. */\n key: string;\n /** Whether the input must be provided before running the skill. */\n required?: boolean;\n /** Question string shown to the user when collecting this input. */\n prompt?: string;\n /** Short display label for UI forms. */\n label?: string;\n /** Input data type hint (e.g. `\"string\"`, `\"number\"`, `\"file\"`). */\n type?: string;\n /** Additional guidance text shown alongside the input field. */\n hint?: string;\n}\n\n/**\n * A compiled catalog entry (skill or flow).\n *\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport interface CatalogEntryCompiled {\n /** Unique ID in `domain/name` form (e.g. `skaileup-conceptualization/cf_overview`). */\n id: string;\n /** Asset kind. */\n kind: \"skill\" | \"flow\";\n /** Human-readable asset name. */\n name: string;\n /** One-line description. */\n description: string;\n /** Semantic version string. */\n version: string;\n /** Maturity stage. */\n stage: \"alpha\" | \"beta\" | \"stable\";\n /** Searchable keywords. */\n keywords: string[];\n /** User-facing input specifications. */\n inputs: InputSpec[];\n /** Domain directory name. */\n source_domain: string;\n /** Asset path relative to assetsRoot. */\n source_path: string;\n /** Optional icon identifier. */\n icon?: string;\n /** Flow-only: required skill names. */\n required_skills?: string[];\n /** Flow-only: optional skill names. */\n optional_skills?: string[];\n}\n\n/**\n * Options controlling how platform-triggered skill deployment is performed.\n *\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport interface DeployFromCatalogOptions {\n /** Root directory of ai-assets (where `source_path` in catalog entries is relative to). */\n assetsRoot: string;\n /** Target directory for deployed skills (e.g. `/workspace/.claude/skills/`). */\n skillsDir: string;\n /** Optional context markdown appended to the deployed skill directory as `CONTEXT.md`. */\n context?: string;\n}\n\n/**\n * Result of a platform-triggered batch skill deployment.\n *\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport interface DeployResult {\n /** IDs of catalog entries successfully deployed. */\n deployed: string[];\n /** IDs of catalog entries skipped (non-skill kinds). */\n skipped: string[];\n /** Error messages for entries that could not be deployed. */\n errors: string[];\n}\n\n// ---------------------------------------------------------------------------\n// Workspace-mount awareness\n// ---------------------------------------------------------------------------\n\n/**\n * Multiplier applied to the base filesystem deadline for whole-tree operations\n * (recursive copy / remove), which legitimately outlast a single `stat`.\n */\nconst TREE_OP_DEADLINE_FACTOR = 4;\n\n/** Default number of parent levels {@link findAiAssetsRoot} inspects. */\nconst AI_ASSETS_WALK_LEVELS = 6;\n\nlet deployerLogger: ReturnType<typeof createLogger> | undefined;\n\nfunction log(): ReturnType<typeof createLogger> {\n deployerLogger ??= createLogger({ kind: \"runner\", subkind: \"catalog-deployer\" });\n return deployerLogger;\n}\n\n/**\n * Where the agent container binds its rclone FUSE mount. Nothing under this\n * path is a safe place to read an asset tree from: the mount is remote\n * (SharePoint / OneDrive / WebDAV) and can wedge indefinitely.\n */\nconst DEFAULT_WORKSPACE_MOUNT_DIR = \"/skaile/workspace\";\n\n/**\n * Env override for the workspace-mount path(s), comma-separated.\n *\n * Set it when the runner binds the mount somewhere other than\n * {@link DEFAULT_WORKSPACE_MOUNT_DIR}; set it to the empty string to disable\n * the guard entirely (single-machine dev, where nothing is a network mount).\n */\nexport const WORKSPACE_MOUNT_ENV_VAR = \"SKAILE_WORKSPACE_MOUNT_DIR\";\n\n/**\n * Resolve the directories treated as network mounts.\n *\n * Read per call rather than cached: the runner mutates `process.env` while\n * wiring a session, so a module-load snapshot would pin a pre-configuration\n * value.\n *\n * @returns Absolute mount paths; empty when the guard is disabled.\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport function workspaceMountDirs(): string[] {\n const raw = process.env[WORKSPACE_MOUNT_ENV_VAR];\n if (raw === undefined) return [DEFAULT_WORKSPACE_MOUNT_DIR];\n return raw\n .split(\",\")\n .map((segment) => segment.trim())\n .filter((segment) => segment.length > 0)\n .map((segment) => resolve(segment));\n}\n\n/**\n * Is `candidate` at, or inside, one of the known workspace mount paths?\n *\n * Pure path arithmetic — deliberately no filesystem access, because the whole\n * point is to decide *before* touching a path that might be unresponsive.\n *\n * @param candidate - Path to test.\n * @param mountDirs - Mount roots; defaults to {@link workspaceMountDirs}.\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport function isUnderWorkspaceMount(\n candidate: string,\n mountDirs: string[] = workspaceMountDirs(),\n): boolean {\n const target = resolve(candidate);\n return mountDirs.some((dir) => {\n const root = resolve(dir);\n return target === root || target.startsWith(root + sep);\n });\n}\n\n/**\n * Walk upward from `startDir` looking for an `ai-assets/` directory.\n *\n * Two properties matter beyond \"find the folder\":\n *\n * 1. **Never synchronous.** The walk probes up to six directories; any one of\n * them can be on a FUSE mount, and the former `existsSync` chain blocked the\n * event loop on the first unresponsive probe. Each probe is now awaited and\n * deadline-bounded, so a wedged mount costs one skipped candidate.\n * 2. **Never resolves onto a mount.** A hit under the workspace mount is\n * skipped with a warning rather than returned: accepting it would wire every\n * later skill deploy — a recursive copy — to a remote filesystem. The walk\n * continues upward, so a legitimate `ai-assets/` in a parent still wins.\n *\n * Only a **directory** counts. An `ai-assets` file would otherwise be returned\n * as a root and every later `join(root, source_path)` would fail with ENOTDIR.\n *\n * @param startDir - Directory to start from (typically the project dir).\n * @param opts - `levels` caps the upward walk; `mountDirs` overrides the mount\n * roots (defaults to {@link workspaceMountDirs}).\n * @returns Absolute path to the `ai-assets/` directory, or `null` if none is\n * reachable within `levels`.\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport async function findAiAssetsRoot(\n startDir: string,\n opts?: { levels?: number; mountDirs?: string[] },\n): Promise<string | null> {\n const mountDirs = opts?.mountDirs ?? workspaceMountDirs();\n const levels = opts?.levels ?? AI_ASSETS_WALK_LEVELS;\n let dir = resolve(startDir);\n // Every level of a `/skaile/workspace/...` start dir is under the mount, so\n // an unconditional warn would fire once per level for one lookup. Collect and\n // report once — the operator needs the fact, not six copies of it.\n const refused: string[] = [];\n\n for (let i = 0; i < levels; i++) {\n const candidate = join(dir, \"ai-assets\");\n if (isUnderWorkspaceMount(candidate, mountDirs)) {\n refused.push(candidate);\n } else {\n const isDir = await tryWithFsDeadline(\n `stat ${candidate}`,\n async () => (await stat(candidate)).isDirectory(),\n false,\n );\n if (isDir) {\n if (refused.length > 0) warnRefused(refused, mountDirs);\n return candidate;\n }\n }\n const parent = resolve(dir, \"..\");\n if (parent === dir) break; // filesystem root — nothing further up\n dir = parent;\n }\n if (refused.length > 0) warnRefused(refused, mountDirs);\n return null;\n}\n\n/** Single warning for every `ai-assets` candidate skipped for sitting on a mount. */\nfunction warnRefused(refused: string[], mountDirs: string[]): void {\n log().warn(\n \"findAiAssetsRoot refused candidates under a workspace mount — deploying skills from a network mount can stall the session\",\n { refused, mountDirs },\n );\n}\n\n/**\n * Deploy a single catalog entry to the session skills directory.\n *\n * Copies the entire skill source directory into `skillsDir/<entry.name>/`.\n * If `context` is provided, a separate `CONTEXT.md` is written alongside\n * `SKILL.md` so the source file is never modified.\n *\n * Only `skill` entries are deployable; other kinds return an error.\n *\n * **Async by necessity.** This runs from the `session_init` command handler\n * with the WebSocket live, and both `assetsRoot` and `skillsDir` can sit on a\n * network mount. The former `cpSync`/`rmSync` pair parked the event loop for\n * the whole copy; every call is now awaited and deadline-bounded, so an\n * unresponsive mount fails one deployment instead of the session.\n *\n * @param entry - Compiled catalog entry to deploy.\n * @param options - Deployment target and optional context.\n * @returns `{ success: true }` on success, `{ success: false, error }` on failure.\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport async function deployCatalogEntry(\n entry: CatalogEntryCompiled,\n options: DeployFromCatalogOptions,\n): Promise<{ success: boolean; error?: string }> {\n const { assetsRoot, skillsDir, context } = options;\n\n if (entry.kind !== \"skill\") {\n return { success: false, error: `Cannot deploy ${entry.kind} directly — only skills` };\n }\n\n const sourcePath = join(assetsRoot, entry.source_path);\n const skillMdPath = join(sourcePath, \"SKILL.md\");\n\n const hasSkillMd = await tryWithFsDeadline(\n `stat ${skillMdPath}`,\n async () => {\n await stat(skillMdPath);\n return true;\n },\n false,\n );\n if (!hasSkillMd) {\n return { success: false, error: `SKILL.md not found at ${skillMdPath}` };\n }\n\n const destDir = join(skillsDir, entry.name);\n\n try {\n await withFsDeadline(`mkdir ${destDir}`, () => mkdir(destDir, { recursive: true }));\n\n // Copy the entire skill directory\n await withFsDeadline(\n `cp ${sourcePath} -> ${destDir}`,\n () => cp(sourcePath, destDir, { recursive: true }),\n fsDeadlineMs() * TREE_OP_DEADLINE_FACTOR,\n );\n\n // Write context to a separate CONTEXT.md — never modify the original SKILL.md.\n // The agent discovers both files in the skill directory.\n const contextPath = join(destDir, \"CONTEXT.md\");\n if (context) {\n await withFsDeadline(`write ${contextPath}`, () =>\n writeFile(contextPath, `# Additional Context\\n\\n${context}\\n`, \"utf8\"),\n );\n } else {\n // `force: true` makes this a single call: a stale CONTEXT.md is removed,\n // an absent one is a no-op. The former existsSync probe only added a\n // second trip to the same possibly-wedged mount.\n await withFsDeadline(`rm ${contextPath}`, () => rm(contextPath, { force: true }));\n }\n } catch (err) {\n return { success: false, error: err instanceof Error ? err.message : String(err) };\n }\n\n return { success: true };\n}\n\n/**\n * Remove a deployed skill directory from the session skills directory.\n *\n * @param name - Skill name (directory basename under `skillsDir`).\n * @param skillsDir - Absolute path to the session skills directory.\n * @returns `true` if the skill was found and removed; `false` if it was not\n * deployed, or if the directory could not be reached within the deadline.\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport async function undeployCatalogEntry(name: string, skillsDir: string): Promise<boolean> {\n const destDir = join(skillsDir, name);\n const exists = await tryWithFsDeadline(\n `stat ${destDir}`,\n async () => {\n await stat(destDir);\n return true;\n },\n false,\n );\n if (!exists) return false;\n await withFsDeadline(\n `rm -r ${destDir}`,\n () => rm(destDir, { recursive: true, force: true }),\n fsDeadlineMs() * TREE_OP_DEADLINE_FACTOR,\n );\n return true;\n}\n\n/**\n * Deploy multiple catalog entries in a single batch operation.\n *\n * Non-skill entries (flows, agents, etc.) are automatically skipped and\n * recorded in `result.skipped`. Deployment failures are collected in\n * `result.errors` without aborting the rest of the batch.\n *\n * @param entries - Compiled catalog entries to deploy.\n * @param options - Deployment target and optional context.\n * @returns Aggregated {@link DeployResult} with deployed, skipped, and error lists.\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport async function deployAll(\n entries: CatalogEntryCompiled[],\n options: DeployFromCatalogOptions,\n): Promise<DeployResult> {\n const result: DeployResult = { deployed: [], skipped: [], errors: [] };\n\n for (const entry of entries) {\n if (entry.kind !== \"skill\") {\n result.skipped.push(entry.id);\n continue;\n }\n\n // Serial on purpose: concurrent recursive copies onto one mount multiply\n // the queue depth on the exact resource that is already the bottleneck.\n const r = await deployCatalogEntry(entry, options);\n if (r.success) {\n result.deployed.push(entry.id);\n } else {\n result.errors.push(`${entry.id}: ${r.error}`);\n }\n }\n\n return result;\n}\n\n/**\n * Resolve a flow's skill dependencies from the full catalog entry list.\n *\n * Partitions `flow.required_skills` and `flow.optional_skills` into resolved\n * entries and a list of names that could not be found. Missing optional skills\n * are silently ignored (they do not appear in `missing`).\n *\n * @param flow - Compiled flow entry whose skill dependencies should be resolved.\n * @param allEntries - Full set of compiled catalog entries to search.\n * @returns Object containing resolved `required` entries, resolved `optional` entries,\n * and `missing` skill names that were listed as required but not found.\n * @docLink packages/asset-manager/concepts#catalog-deployer\n */\nexport function resolveFlowSkills(\n flow: CatalogEntryCompiled,\n allEntries: CatalogEntryCompiled[],\n): { required: CatalogEntryCompiled[]; optional: CatalogEntryCompiled[]; missing: string[] } {\n const skillsByName = new Map<string, CatalogEntryCompiled>();\n for (const e of allEntries) {\n if (e.kind === \"skill\") skillsByName.set(e.name, e);\n }\n\n const required: CatalogEntryCompiled[] = [];\n const optional: CatalogEntryCompiled[] = [];\n const missing: string[] = [];\n\n for (const name of flow.required_skills ?? []) {\n const entry = skillsByName.get(name);\n if (entry) required.push(entry);\n else missing.push(name);\n }\n\n for (const name of flow.optional_skills ?? []) {\n const entry = skillsByName.get(name);\n if (entry) optional.push(entry);\n // Optional skills don't count as missing\n }\n\n return { required, optional, missing };\n}\n"]}
@@ -1,7 +1,8 @@
1
1
  import { SUPPORTED_DRIVER_TARGETS, globalBackendRoot } from './chunk-MENCWIHW.js';
2
2
  import { decodeSkaileManifest, SKAILE_MANIFEST_FILENAME } from './chunk-P4VHQA4N.js';
3
- import { scanDirectory, parseFrontmatter, bundleDepRefs, fromMcpServerMdContent, withFsDeadline, tryWithFsDeadline, fsDeadlineMs } from './chunk-MKZOK4JU.js';
3
+ import { scanDirectory, parseFrontmatter, bundleDepRefs, fromMcpServerMdContent, withFsDeadline, tryWithFsDeadline, fsDeadlineMs } from './chunk-2FBPAR2V.js';
4
4
  import { isValidAssetName, slugifyAssetName, parseAssetRef, assetRefToStr } from './chunk-GEEW6SY2.js';
5
+ import { isRetentionValue } from './chunk-C3CAXQMA.js';
5
6
  import { existsSync, mkdirSync, renameSync, readdirSync, rmdirSync, readFileSync, writeFileSync, lstatSync, symlinkSync, rmSync, constants } from 'fs';
6
7
  import { readdir, stat, cp, rm, open, readFile } from 'fs/promises';
7
8
  import { homedir } from 'os';
@@ -952,12 +953,27 @@ function validateAssetRecipeAttr(attr) {
952
953
  }
953
954
  }
954
955
  var KNOWN_NETWORK_MODES = ["open", "off", "allowlist"];
956
+ var KNOWN_LOG_MODES = { persistent: true, ephemeral: true, off: true };
957
+ var KNOWN_LOG_LEVELS = { debug: true, info: true, warn: true, error: true };
955
958
  var COMPACTION_DEFAULTS = {
956
959
  enabled: true,
957
- thresholdPercent: 80,
960
+ largeWindowThresholdPercent: 40,
961
+ smallWindowThresholdPercent: 80,
962
+ largeWindowMinTokens: 1e6,
958
963
  minCooldownMs: 12e4,
959
964
  manualCompactEnabled: false
960
965
  };
966
+ function usableCompactionNumber(value) {
967
+ return typeof value === "number" && Number.isFinite(value) && value > 0;
968
+ }
969
+ function resolveCompactionThresholdPercent(contextWindow, config = {}) {
970
+ if (usableCompactionNumber(config.thresholdPercent)) return config.thresholdPercent;
971
+ const largeWindowMinTokens = usableCompactionNumber(config.largeWindowMinTokens) ? config.largeWindowMinTokens : COMPACTION_DEFAULTS.largeWindowMinTokens;
972
+ if (contextWindow >= largeWindowMinTokens) {
973
+ return usableCompactionNumber(config.largeWindowThresholdPercent) ? config.largeWindowThresholdPercent : COMPACTION_DEFAULTS.largeWindowThresholdPercent;
974
+ }
975
+ return usableCompactionNumber(config.smallWindowThresholdPercent) ? config.smallWindowThresholdPercent : COMPACTION_DEFAULTS.smallWindowThresholdPercent;
976
+ }
961
977
  var SKAILE_YAML_SUFFIX = ".skaile.yaml";
962
978
  var SKAILE_YAML_DEFAULT = "skaile.yaml";
963
979
  var SK_WORKSPACE_SUFFIX = SKAILE_YAML_SUFFIX;
@@ -1104,9 +1120,30 @@ function mergeSkWorkspaceConfigs(base, overlay) {
1104
1120
  // plugins: concatenate + dedupe (like dependencies)
1105
1121
  plugins: dedupe([...base.plugins ?? [], ...overlay.plugins ?? []]),
1106
1122
  // deploy: overlay wins entirely (scalar-like selection)
1107
- deploy: overlay.deploy ?? base.deploy
1123
+ deploy: overlay.deploy ?? base.deploy,
1124
+ // compaction, patches: per-key, overlay wins — a project can raise one tier
1125
+ // without restating the rest. Absent from both stays absent.
1126
+ compaction: mergeKeyed(base.compaction, overlay.compaction),
1127
+ patches: mergeKeyed(base.patches, overlay.patches),
1128
+ // logging: per-key, overlay wins; retention per key one level down.
1129
+ logging: mergeLoggingConfig(base.logging, overlay.logging)
1108
1130
  };
1109
1131
  }
1132
+ function mergeLoggingConfig(base, overlay) {
1133
+ const merged = mergeKeyed(base, overlay);
1134
+ if (!merged) return void 0;
1135
+ const retention = mergeKeyed(base?.retention, overlay?.retention);
1136
+ if (retention) merged.retention = retention;
1137
+ return merged;
1138
+ }
1139
+ function mergeKeyed(base, overlay) {
1140
+ if (!base && !overlay) return void 0;
1141
+ const merged = { ...base };
1142
+ for (const [key, value] of Object.entries(overlay ?? {})) {
1143
+ if (value !== void 0) merged[key] = value;
1144
+ }
1145
+ return merged;
1146
+ }
1110
1147
  function mergeAgentConfig(base, overlay) {
1111
1148
  return {
1112
1149
  definition: overlay?.definition ?? base?.definition,
@@ -1381,6 +1418,52 @@ function normalizeStructuralSections(raw, config, diagnostics) {
1381
1418
  if (raw.patches && typeof raw.patches === "object" && !Array.isArray(raw.patches)) {
1382
1419
  config.patches = raw.patches;
1383
1420
  }
1421
+ const logging = normalizeLoggingSection(raw.logging, diagnostics);
1422
+ if (logging) config.logging = logging;
1423
+ }
1424
+ function normalizeLoggingSection(raw, diagnostics) {
1425
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) return void 0;
1426
+ const block = raw;
1427
+ const logging = {};
1428
+ const pick = (key, known) => {
1429
+ const value = block[key];
1430
+ if (value === void 0) return void 0;
1431
+ if (typeof value === "string" && Object.hasOwn(known, value)) return value;
1432
+ diagnostics.push({
1433
+ code: `unknown_log_${key}`,
1434
+ severity: "warning",
1435
+ message: `Unknown logging.${key} "${String(value)}" \u2014 expected one of: ${Object.keys(known).join(", ")}. The default is used.`,
1436
+ path: `logging.${key}`
1437
+ });
1438
+ return void 0;
1439
+ };
1440
+ const mode = pick("mode", KNOWN_LOG_MODES);
1441
+ if (mode) logging.mode = mode;
1442
+ const level = pick("level", KNOWN_LOG_LEVELS);
1443
+ if (level) logging.level = level;
1444
+ const retention = normalizeLogRetention(block.retention, diagnostics);
1445
+ if (retention) logging.retention = retention;
1446
+ return Object.keys(logging).length > 0 ? logging : void 0;
1447
+ }
1448
+ function normalizeLogRetention(raw, diagnostics) {
1449
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) return void 0;
1450
+ const block = raw;
1451
+ const retention = {};
1452
+ for (const key of ["maxEntries", "maxAgeDays"]) {
1453
+ const value = block[key];
1454
+ if (value === void 0) continue;
1455
+ if (isRetentionValue(value)) {
1456
+ retention[key] = value;
1457
+ continue;
1458
+ }
1459
+ diagnostics.push({
1460
+ code: "invalid_log_retention",
1461
+ severity: "warning",
1462
+ message: `Invalid logging.retention.${key} ${JSON.stringify(value)} \u2014 expected a number of 0 or more. The default is used.`,
1463
+ path: `logging.retention.${key}`
1464
+ });
1465
+ }
1466
+ return Object.keys(retention).length > 0 ? retention : void 0;
1384
1467
  }
1385
1468
  function normalizeDependencySection(raw, config) {
1386
1469
  if (Array.isArray(raw.dependencies)) {
@@ -1557,7 +1640,8 @@ var CANONICAL_KEY_ORDER = [
1557
1640
  "secrets",
1558
1641
  "telemetry",
1559
1642
  "compaction",
1560
- "patches"
1643
+ "patches",
1644
+ "logging"
1561
1645
  ];
1562
1646
  var CONFIG_KEY_TO_YAML = {
1563
1647
  agent_config: "agent-config"
@@ -2095,6 +2179,6 @@ function resolveAgentDir(projectDir) {
2095
2179
  return resolve(projectDir, definition);
2096
2180
  }
2097
2181
 
2098
- export { COMPACTION_DEFAULTS, CanonicalRefConflictError, DEFAULT_RECIPE_ATTR, SKAILE_YAML_DEFAULT, SKAILE_YAML_SUFFIX, SKILL_ALLOWLIST_FILE, SKILL_ALLOWLIST_VERSION, SK_WORKSPACE_DEFAULT_NAME, SK_WORKSPACE_SUFFIX, STAGED_SKILL_MARKER, __resetCacheMigrationMemo, buildProvenanceIndex, checkRepoStatus, checkoutPin, cloneRepo, coerceVersion, decodeSkaileYaml, deriveSingleMaterializedMcpDeclaration, encodeSkaileYaml, ensureRepo, findWorkspaceRoot, getGlobalCacheDir, getRepoCommit, globalCacheRoot, globalSkaileDir, isStagedSkillMarkerFor, isWorkspaceConfigFilename, linkRepo, listSkWorkspaceConfigs, loadMcpServerDeclarations, loadSkWorkspaceConfig, matchPin, mergeLegacyEntriesInto, mergeLegacyEntriesKeyed, mergeSkWorkspaceConfigs, migrateLegacyDir, normalizeConfig, pullRepo, pullRepoResult, readLinks, readSkillAllowList, resolveAgentDir, resolveAll, resolveAsset, resolveGlobalBackends, resolveGlobalSkWorkspaceConfig, resolveSkWorkspaceConfig, resolveSourcePublisher, saveSkWorkspaceConfig, scanRepo, sourceCacheKey, sourceShortName, stageMaterializedSkills, stagedSkillMarkerState, storeManifestSlug, unlinkRepo, unstageSkill, validateAssetRecipeAttr, validateAssetRecipeFlake, workspaceConfigFilename, workspaceNameFromFilename, writeLinks };
2099
- //# sourceMappingURL=chunk-HO4UO25I.js.map
2100
- //# sourceMappingURL=chunk-HO4UO25I.js.map
2182
+ export { COMPACTION_DEFAULTS, CanonicalRefConflictError, DEFAULT_RECIPE_ATTR, SKAILE_YAML_DEFAULT, SKAILE_YAML_SUFFIX, SKILL_ALLOWLIST_FILE, SKILL_ALLOWLIST_VERSION, SK_WORKSPACE_DEFAULT_NAME, SK_WORKSPACE_SUFFIX, STAGED_SKILL_MARKER, __resetCacheMigrationMemo, buildProvenanceIndex, checkRepoStatus, checkoutPin, cloneRepo, coerceVersion, decodeSkaileYaml, deriveSingleMaterializedMcpDeclaration, encodeSkaileYaml, ensureRepo, findWorkspaceRoot, getGlobalCacheDir, getRepoCommit, globalCacheRoot, globalSkaileDir, isStagedSkillMarkerFor, isWorkspaceConfigFilename, linkRepo, listSkWorkspaceConfigs, loadMcpServerDeclarations, loadSkWorkspaceConfig, matchPin, mergeLegacyEntriesInto, mergeLegacyEntriesKeyed, mergeSkWorkspaceConfigs, migrateLegacyDir, normalizeConfig, pullRepo, pullRepoResult, readLinks, readSkillAllowList, resolveAgentDir, resolveAll, resolveAsset, resolveCompactionThresholdPercent, resolveGlobalBackends, resolveGlobalSkWorkspaceConfig, resolveSkWorkspaceConfig, resolveSourcePublisher, saveSkWorkspaceConfig, scanRepo, sourceCacheKey, sourceShortName, stageMaterializedSkills, stagedSkillMarkerState, storeManifestSlug, unlinkRepo, unstageSkill, validateAssetRecipeAttr, validateAssetRecipeFlake, workspaceConfigFilename, workspaceNameFromFilename, writeLinks };
2183
+ //# sourceMappingURL=chunk-QWGSKDD7.js.map
2184
+ //# sourceMappingURL=chunk-QWGSKDD7.js.map