@skaile/workspaces 6.2.0 → 6.4.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 (300) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/ai-sdk.d.ts +2 -0
  3. package/dist/ai-sdk.js +123 -0
  4. package/dist/ai-sdk.js.map +1 -0
  5. package/dist/app-sdk/index.js +1 -1
  6. package/dist/{asset-feeds-KPKCE64E.js → asset-feeds-UJSYGKCX.js} +20 -20
  7. package/dist/{asset-feeds-KPKCE64E.js.map → asset-feeds-UJSYGKCX.js.map} +1 -1
  8. package/dist/asset-manager/catalog-deployer.js +7 -7
  9. package/dist/asset-manager/index.js +12 -12
  10. package/dist/asset-manager/installer.js +8 -8
  11. package/dist/asset-manager/renderers.js +7 -7
  12. package/dist/asset-manager/src/index.d.ts +42 -15
  13. package/dist/asset-manager/src/index.d.ts.map +1 -1
  14. package/dist/asset-manager/src/install-instances.d.ts +2 -0
  15. package/dist/asset-manager/src/install-instances.d.ts.map +1 -1
  16. package/dist/asset-manager/src/installer.d.ts.map +1 -1
  17. package/dist/bridge/harnesses/claude-sdk.js +13 -12
  18. package/dist/bridge/harnesses/claude-sdk.js.map +1 -1
  19. package/dist/bridge/harnesses/codex.js +12 -11
  20. package/dist/bridge/harnesses/codex.js.map +1 -1
  21. package/dist/bridge/harnesses/continue.js +11 -10
  22. package/dist/bridge/harnesses/continue.js.map +1 -1
  23. package/dist/bridge/harnesses/echo.js +6 -5
  24. package/dist/bridge/harnesses/echo.js.map +1 -1
  25. package/dist/bridge/harnesses/gemini.js +8 -7
  26. package/dist/bridge/harnesses/goose.js +11 -10
  27. package/dist/bridge/harnesses/goose.js.map +1 -1
  28. package/dist/bridge/harnesses/omp.js +8 -7
  29. package/dist/bridge/harnesses/omp.js.map +1 -1
  30. package/dist/bridge/harnesses/opencode.js +11 -10
  31. package/dist/bridge/harnesses/opencode.js.map +1 -1
  32. package/dist/bridge/harnesses/qwen.js +8 -7
  33. package/dist/bridge/harnesses/qwen.js.map +1 -1
  34. package/dist/bridge/index.js +18 -16
  35. package/dist/bridge/src/ai-sdk.d.ts +51 -0
  36. package/dist/bridge/src/ai-sdk.d.ts.map +1 -0
  37. package/dist/bridge/src/harness-model-check.d.ts +11 -7
  38. package/dist/bridge/src/harness-model-check.d.ts.map +1 -1
  39. package/dist/bridge/src/index.d.ts +1 -0
  40. package/dist/bridge/src/index.d.ts.map +1 -1
  41. package/dist/bridge/src/provider-registry-load.d.ts +30 -0
  42. package/dist/bridge/src/provider-registry-load.d.ts.map +1 -0
  43. package/dist/{chunk-7DRFKAJZ.js → chunk-24D7IW5O.js} +8 -7
  44. package/dist/chunk-24D7IW5O.js.map +1 -0
  45. package/dist/{chunk-ITFCWMOY.js → chunk-2WOA3TKK.js} +12 -12
  46. package/dist/chunk-2WOA3TKK.js.map +1 -0
  47. package/dist/{chunk-QPWR3YMY.js → chunk-3ENE6ZOF.js} +4 -4
  48. package/dist/{chunk-QPWR3YMY.js.map → chunk-3ENE6ZOF.js.map} +1 -1
  49. package/dist/{chunk-ICSGNT5P.js → chunk-45KLCFQB.js} +8 -27
  50. package/dist/chunk-45KLCFQB.js.map +1 -0
  51. package/dist/{chunk-Q5RN4PWV.js → chunk-5NHBLKKU.js} +3 -3
  52. package/dist/{chunk-Q5RN4PWV.js.map → chunk-5NHBLKKU.js.map} +1 -1
  53. package/dist/{chunk-RQMIZONH.js → chunk-5T3DTK7A.js} +43 -24
  54. package/dist/chunk-5T3DTK7A.js.map +1 -0
  55. package/dist/{chunk-X37JUNEW.js → chunk-6UP2EDFN.js} +4 -313
  56. package/dist/chunk-6UP2EDFN.js.map +1 -0
  57. package/dist/{chunk-KJSC2ZD6.js → chunk-6WQGJF65.js} +18 -6
  58. package/dist/chunk-6WQGJF65.js.map +1 -0
  59. package/dist/{chunk-BOT64P3U.js → chunk-6X3GDPCB.js} +4 -3
  60. package/dist/chunk-6X3GDPCB.js.map +1 -0
  61. package/dist/{chunk-T2VBPVWZ.js → chunk-76WSWPOB.js} +15 -7
  62. package/dist/{chunk-T2VBPVWZ.js.map → chunk-76WSWPOB.js.map} +1 -1
  63. package/dist/{chunk-BRK5QZKI.js → chunk-ABVWUM2E.js} +27 -17
  64. package/dist/chunk-ABVWUM2E.js.map +1 -0
  65. package/dist/{chunk-MM4YO3EL.js → chunk-ACBL7X62.js} +3 -3
  66. package/dist/{chunk-MM4YO3EL.js.map → chunk-ACBL7X62.js.map} +1 -1
  67. package/dist/{chunk-VUJXZDCY.js → chunk-BOS7P2Y4.js} +3 -3
  68. package/dist/{chunk-VUJXZDCY.js.map → chunk-BOS7P2Y4.js.map} +1 -1
  69. package/dist/{chunk-PNUM7GUY.js → chunk-BUU2DLPC.js} +3 -3
  70. package/dist/{chunk-PNUM7GUY.js.map → chunk-BUU2DLPC.js.map} +1 -1
  71. package/dist/{chunk-BEYNH2LS.js → chunk-BX7PSWJA.js} +4 -4
  72. package/dist/{chunk-BEYNH2LS.js.map → chunk-BX7PSWJA.js.map} +1 -1
  73. package/dist/{chunk-URCJIV7T.js → chunk-C7TQARGC.js} +3 -3
  74. package/dist/{chunk-URCJIV7T.js.map → chunk-C7TQARGC.js.map} +1 -1
  75. package/dist/{chunk-E5NQRHEB.js → chunk-CK3CJSRY.js} +3 -3
  76. package/dist/{chunk-E5NQRHEB.js.map → chunk-CK3CJSRY.js.map} +1 -1
  77. package/dist/{chunk-GF5JXQIZ.js → chunk-DCJ4BION.js} +2 -2
  78. package/dist/{chunk-GF5JXQIZ.js.map → chunk-DCJ4BION.js.map} +1 -1
  79. package/dist/{chunk-5LQ62LNT.js → chunk-DF5WJC3Q.js} +4 -4
  80. package/dist/{chunk-5LQ62LNT.js.map → chunk-DF5WJC3Q.js.map} +1 -1
  81. package/dist/{chunk-QK7AG5AV.js → chunk-E237FGGX.js} +4 -4
  82. package/dist/{chunk-QK7AG5AV.js.map → chunk-E237FGGX.js.map} +1 -1
  83. package/dist/{chunk-K3R2UKG7.js → chunk-EXRQKOY6.js} +12 -12
  84. package/dist/{chunk-K3R2UKG7.js.map → chunk-EXRQKOY6.js.map} +1 -1
  85. package/dist/chunk-G63KOHFS.js +32 -0
  86. package/dist/chunk-G63KOHFS.js.map +1 -0
  87. package/dist/{chunk-6CYKTHNT.js → chunk-GBXQFJ4G.js} +8 -8
  88. package/dist/{chunk-6CYKTHNT.js.map → chunk-GBXQFJ4G.js.map} +1 -1
  89. package/dist/{chunk-6GWSDPBP.js → chunk-GTMANMBZ.js} +3 -3
  90. package/dist/{chunk-6GWSDPBP.js.map → chunk-GTMANMBZ.js.map} +1 -1
  91. package/dist/{chunk-JJJ2G4K2.js → chunk-HSF665NV.js} +5 -5
  92. package/dist/{chunk-JJJ2G4K2.js.map → chunk-HSF665NV.js.map} +1 -1
  93. package/dist/{chunk-I7LC5TDY.js → chunk-HTGTNN2B.js} +3 -3
  94. package/dist/{chunk-I7LC5TDY.js.map → chunk-HTGTNN2B.js.map} +1 -1
  95. package/dist/{chunk-PMWRM4EJ.js → chunk-HXZ3FQQN.js} +14 -14
  96. package/dist/{chunk-PMWRM4EJ.js.map → chunk-HXZ3FQQN.js.map} +1 -1
  97. package/dist/{chunk-2XM3ZH36.js → chunk-IYZAJ2J2.js} +16 -13
  98. package/dist/chunk-IYZAJ2J2.js.map +1 -0
  99. package/dist/{chunk-3HACK2Z7.js → chunk-IZV3HDVG.js} +5 -5
  100. package/dist/{chunk-3HACK2Z7.js.map → chunk-IZV3HDVG.js.map} +1 -1
  101. package/dist/{chunk-U673DB5U.js → chunk-JSWMRYLM.js} +4 -3
  102. package/dist/chunk-JSWMRYLM.js.map +1 -0
  103. package/dist/{chunk-TSTRH4SM.js → chunk-L45IHRDH.js} +3 -3
  104. package/dist/{chunk-TSTRH4SM.js.map → chunk-L45IHRDH.js.map} +1 -1
  105. package/dist/{chunk-27SXN33H.js → chunk-L4OYPFLB.js} +3 -3
  106. package/dist/{chunk-27SXN33H.js.map → chunk-L4OYPFLB.js.map} +1 -1
  107. package/dist/{chunk-QIHL3YPL.js → chunk-O7KAQQAI.js} +4 -4
  108. package/dist/{chunk-QIHL3YPL.js.map → chunk-O7KAQQAI.js.map} +1 -1
  109. package/dist/{chunk-Z3IRZBXB.js → chunk-P7EL7QRD.js} +14 -14
  110. package/dist/{chunk-Z3IRZBXB.js.map → chunk-P7EL7QRD.js.map} +1 -1
  111. package/dist/{chunk-QXKUFROW.js → chunk-PTBX55QF.js} +4 -4
  112. package/dist/{chunk-QXKUFROW.js.map → chunk-PTBX55QF.js.map} +1 -1
  113. package/dist/{chunk-5JPW27BI.js → chunk-Q4XWCVFA.js} +7 -7
  114. package/dist/{chunk-5JPW27BI.js.map → chunk-Q4XWCVFA.js.map} +1 -1
  115. package/dist/chunk-QJQQNBVT.js +315 -0
  116. package/dist/chunk-QJQQNBVT.js.map +1 -0
  117. package/dist/{chunk-M4OG2YN4.js → chunk-QSIFEHSN.js} +3 -3
  118. package/dist/{chunk-M4OG2YN4.js.map → chunk-QSIFEHSN.js.map} +1 -1
  119. package/dist/{chunk-7Y6S4XLL.js → chunk-RKI35EAN.js} +3 -3
  120. package/dist/{chunk-7Y6S4XLL.js.map → chunk-RKI35EAN.js.map} +1 -1
  121. package/dist/{chunk-OCQNUV4T.js → chunk-SISUT7VR.js} +7 -7
  122. package/dist/{chunk-OCQNUV4T.js.map → chunk-SISUT7VR.js.map} +1 -1
  123. package/dist/{chunk-7H6XRCPG.js → chunk-TDKZL5ZC.js} +3 -3
  124. package/dist/{chunk-7H6XRCPG.js.map → chunk-TDKZL5ZC.js.map} +1 -1
  125. package/dist/{chunk-LRBP3234.js → chunk-TF5CWJQZ.js} +5 -5
  126. package/dist/{chunk-LRBP3234.js.map → chunk-TF5CWJQZ.js.map} +1 -1
  127. package/dist/{chunk-PKBLJI23.js → chunk-TGB4E5Z6.js} +188 -52
  128. package/dist/chunk-TGB4E5Z6.js.map +1 -0
  129. package/dist/{chunk-KB56WBQ3.js → chunk-TPQKFX6X.js} +4 -4
  130. package/dist/{chunk-KB56WBQ3.js.map → chunk-TPQKFX6X.js.map} +1 -1
  131. package/dist/{chunk-TZERN27L.js → chunk-U3SXCVR7.js} +3 -3
  132. package/dist/{chunk-TZERN27L.js.map → chunk-U3SXCVR7.js.map} +1 -1
  133. package/dist/{chunk-KPKGWXUJ.js → chunk-U6S5CXKB.js} +3 -3
  134. package/dist/{chunk-KPKGWXUJ.js.map → chunk-U6S5CXKB.js.map} +1 -1
  135. package/dist/{chunk-JFLQICIU.js → chunk-UAOHR6AL.js} +4 -4
  136. package/dist/{chunk-JFLQICIU.js.map → chunk-UAOHR6AL.js.map} +1 -1
  137. package/dist/{chunk-KXJMQTOU.js → chunk-UBLZALKP.js} +3 -3
  138. package/dist/{chunk-KXJMQTOU.js.map → chunk-UBLZALKP.js.map} +1 -1
  139. package/dist/{chunk-BIRW3HOG.js → chunk-UUKCPPTQ.js} +3 -3
  140. package/dist/{chunk-BIRW3HOG.js.map → chunk-UUKCPPTQ.js.map} +1 -1
  141. package/dist/{chunk-BY5WIRCU.js → chunk-UVTN4O7N.js} +42 -17
  142. package/dist/chunk-UVTN4O7N.js.map +1 -0
  143. package/dist/{chunk-COAFAYBS.js → chunk-V4OXHEWY.js} +3 -3
  144. package/dist/{chunk-COAFAYBS.js.map → chunk-V4OXHEWY.js.map} +1 -1
  145. package/dist/{chunk-SJNZ4WPA.js → chunk-VSCLUPGZ.js} +31 -28
  146. package/dist/chunk-VSCLUPGZ.js.map +1 -0
  147. package/dist/{chunk-JMIKGAUA.js → chunk-VV2DJT4I.js} +15 -5
  148. package/dist/chunk-VV2DJT4I.js.map +1 -0
  149. package/dist/{chunk-JCPD4QRM.js → chunk-VZU67OKK.js} +2 -2
  150. package/dist/{chunk-JCPD4QRM.js.map → chunk-VZU67OKK.js.map} +1 -1
  151. package/dist/{chunk-MAZ3UXJK.js → chunk-WENTJ5KP.js} +4 -4
  152. package/dist/{chunk-MAZ3UXJK.js.map → chunk-WENTJ5KP.js.map} +1 -1
  153. package/dist/{chunk-ZWJCRHP3.js → chunk-YFGXYQW4.js} +3 -3
  154. package/dist/{chunk-ZWJCRHP3.js.map → chunk-YFGXYQW4.js.map} +1 -1
  155. package/dist/{chunk-S2H3RBK7.js → chunk-YJNE4V2M.js} +16 -9
  156. package/dist/chunk-YJNE4V2M.js.map +1 -0
  157. package/dist/{chunk-PJJSBZZP.js → chunk-ZWCGJYR7.js} +3 -3
  158. package/dist/{chunk-PJJSBZZP.js.map → chunk-ZWCGJYR7.js.map} +1 -1
  159. package/dist/{claude-code-BBMNVH2J.js → claude-code-UBT4ZME7.js} +4 -4
  160. package/dist/{claude-code-BBMNVH2J.js.map → claude-code-UBT4ZME7.js.map} +1 -1
  161. package/dist/cli/index.js +107 -91
  162. package/dist/cli/index.js.map +1 -1
  163. package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
  164. package/dist/cli/src/commands/library-index.d.ts.map +1 -1
  165. package/dist/cli/src/commands/plugin-registry-cmd.d.ts.map +1 -1
  166. package/dist/cli/src/commands/preset-cmd.d.ts.map +1 -1
  167. package/dist/cli/src/commands/providers.d.ts.map +1 -1
  168. package/dist/cli/src/helpers.d.ts +10 -2
  169. package/dist/cli/src/helpers.d.ts.map +1 -1
  170. package/dist/cli/src/plugin-store/index.d.ts +1 -1
  171. package/dist/cli/src/plugin-store/index.d.ts.map +1 -1
  172. package/dist/cli/src/plugin-store/reconcile.d.ts.map +1 -1
  173. package/dist/cli/src/plugin-store/spec.d.ts +19 -14
  174. package/dist/cli/src/plugin-store/spec.d.ts.map +1 -1
  175. package/dist/cli/src/setup.d.ts.map +1 -1
  176. package/dist/connectors/config.js +4 -4
  177. package/dist/connectors/index.js +22 -20
  178. package/dist/{connectors-47EM6C2P.js → connectors-4WH32NK2.js} +25 -23
  179. package/dist/{connectors-47EM6C2P.js.map → connectors-4WH32NK2.js.map} +1 -1
  180. package/dist/connectors-shared/index.js +2 -2
  181. package/dist/core/index.js +6 -6
  182. package/dist/core/manifest.js +1 -1
  183. package/dist/core/publish-manifest.js +2 -2
  184. package/dist/core/runtime-assets.js +4 -4
  185. package/dist/core/src/index.d.ts +1 -1
  186. package/dist/core/src/index.d.ts.map +1 -1
  187. package/dist/core/src/lock.d.ts.map +1 -1
  188. package/dist/core/src/manifest.d.ts +9 -3
  189. package/dist/core/src/manifest.d.ts.map +1 -1
  190. package/dist/core/src/workspace-config.d.ts +15 -0
  191. package/dist/core/src/workspace-config.d.ts.map +1 -1
  192. package/dist/core/src/workspace-yaml-editor.d.ts.map +1 -1
  193. package/dist/core/workspace-config.js +3 -3
  194. package/dist/deploy/index.js +6 -6
  195. package/dist/discovery/index.js +3 -3
  196. package/dist/{ensure-sources-K5EFNC3L.js → ensure-sources-UC2RBYMP.js} +27 -25
  197. package/dist/ensure-sources-UC2RBYMP.js.map +1 -0
  198. package/dist/factory-assets/connectors/box.js +22 -20
  199. package/dist/factory-assets/connectors/deploy.js +22 -20
  200. package/dist/factory-assets/connectors/devserver.js +22 -20
  201. package/dist/factory-assets/connectors/flow/adapter.js +22 -20
  202. package/dist/factory-assets/connectors/flow/engine.js +7 -7
  203. package/dist/factory-assets/connectors/flow/run-flow.js +24 -22
  204. package/dist/factory-assets/connectors/flow.js +22 -20
  205. package/dist/factory-assets/connectors/git.js +22 -20
  206. package/dist/factory-assets/connectors/gmail.js +22 -20
  207. package/dist/factory-assets/connectors/googledrive.js +22 -20
  208. package/dist/factory-assets/connectors/local.js +22 -20
  209. package/dist/factory-assets/connectors/mattermost.js +22 -20
  210. package/dist/factory-assets/connectors/memory.js +22 -20
  211. package/dist/factory-assets/connectors/minio.js +22 -20
  212. package/dist/factory-assets/connectors/postgres.js +22 -20
  213. package/dist/factory-assets/connectors/s3.js +22 -20
  214. package/dist/factory-assets/connectors/sharepoint.js +22 -20
  215. package/dist/factory-assets/connectors/sqlite.js +22 -20
  216. package/dist/factory-assets/connectors/static-server.js +22 -20
  217. package/dist/factory-assets/connectors/tunnel.js +22 -20
  218. package/dist/factory-assets/connectors/webdav.js +22 -20
  219. package/dist/factory-assets/connectors/xstate-store.js +22 -20
  220. package/dist/factory-assets/connectors/xstate.js +22 -20
  221. package/dist/{flows-KLBNSKLO.js → flows-LYTKNGKE.js} +11 -11
  222. package/dist/{flows-KLBNSKLO.js.map → flows-LYTKNGKE.js.map} +1 -1
  223. package/dist/{helpers-LUSV2ICC.js → helpers-SSSKT5XK.js} +27 -25
  224. package/dist/{helpers-LUSV2ICC.js.map → helpers-SSSKT5XK.js.map} +1 -1
  225. package/dist/library/index.js +9 -9
  226. package/dist/library/install.js +3 -3
  227. package/dist/{library-publish-XMRCKRNR.js → library-publish-GQMNTAKK.js} +52 -50
  228. package/dist/library-publish-GQMNTAKK.js.map +1 -0
  229. package/dist/model-endpoint/index.js +10 -9
  230. package/dist/open-library-XGUCUJYE.js +58 -0
  231. package/dist/{open-library-XBR46DJL.js.map → open-library-XGUCUJYE.js.map} +1 -1
  232. package/dist/{open-registry-W562DCDL.js → open-registry-DIFEPDF6.js} +13 -13
  233. package/dist/{open-registry-W562DCDL.js.map → open-registry-DIFEPDF6.js.map} +1 -1
  234. package/dist/{paths-2AZXB3QL.js → paths-G4GFJLE2.js} +9 -9
  235. package/dist/{paths-2AZXB3QL.js.map → paths-G4GFJLE2.js.map} +1 -1
  236. package/dist/{plugin-store-36SIL4TV.js → plugin-store-BBLDFD3L.js} +9 -9
  237. package/dist/{plugin-store-36SIL4TV.js.map → plugin-store-BBLDFD3L.js.map} +1 -1
  238. package/dist/{project-D7GN7WLS.js → project-LB745WVZ.js} +48 -46
  239. package/dist/{project-D7GN7WLS.js.map → project-LB745WVZ.js.map} +1 -1
  240. package/dist/resolver/index.js +7 -7
  241. package/dist/runner/index.js +38 -36
  242. package/dist/runner/src/capability-roundtrip.d.ts +4 -1
  243. package/dist/runner/src/capability-roundtrip.d.ts.map +1 -1
  244. package/dist/sdk/asset-manager.js +12 -12
  245. package/dist/sdk/bridge.js +18 -16
  246. package/dist/sdk/core.js +6 -6
  247. package/dist/sdk/flow.js +7 -7
  248. package/dist/sdk/index.js +38 -36
  249. package/dist/sdk/index.js.map +1 -1
  250. package/dist/sdk/resolver.js +7 -7
  251. package/dist/sdk/runner.js +38 -36
  252. package/dist/sdk/session.js +2 -2
  253. package/dist/sdk/transport/ws/server.js +7 -7
  254. package/dist/sdk/transport/ws.js +7 -7
  255. package/dist/sdk/transport.js +7 -7
  256. package/dist/sdk/types.js +1 -1
  257. package/dist/{serve-preflight-CGA5G3AE.js → serve-preflight-NPWI4MV6.js} +28 -26
  258. package/dist/serve-preflight-NPWI4MV6.js.map +1 -0
  259. package/dist/session/index.js +2 -2
  260. package/dist/{setup-IBDNJAOU.js → setup-X6ZYH2MW.js} +33 -28
  261. package/dist/setup-X6ZYH2MW.js.map +1 -0
  262. package/dist/{skills-CTTO7SZK.js → skills-62PXDBPJ.js} +12 -12
  263. package/dist/{skills-CTTO7SZK.js.map → skills-62PXDBPJ.js.map} +1 -1
  264. package/dist/{source-2DJ5KNOI.js → source-LAYCTRHP.js} +48 -46
  265. package/dist/{source-2DJ5KNOI.js.map → source-LAYCTRHP.js.map} +1 -1
  266. package/dist/{source-manifest-publish-IYWUMUCY.js → source-manifest-publish-3S6PJ25W.js} +50 -48
  267. package/dist/source-manifest-publish-3S6PJ25W.js.map +1 -0
  268. package/dist/transport/index.js +7 -7
  269. package/dist/transport/ws/server.js +7 -7
  270. package/dist/transport/ws.js +7 -7
  271. package/dist/tui/index.js +38 -36
  272. package/dist/tui/index.js.map +1 -1
  273. package/dist/types/index.js +1 -1
  274. package/dist/types/src/capabilities.d.ts +9 -1
  275. package/dist/types/src/capabilities.d.ts.map +1 -1
  276. package/dist/workspace-plugin/adapters/mcp.js +29 -27
  277. package/dist/workspace-plugin/adapters/omp.js +14 -14
  278. package/dist/workspace-plugin/index.js +1 -1
  279. package/package.json +27 -1
  280. package/dist/chunk-2XM3ZH36.js.map +0 -1
  281. package/dist/chunk-7DRFKAJZ.js.map +0 -1
  282. package/dist/chunk-BOT64P3U.js.map +0 -1
  283. package/dist/chunk-BRK5QZKI.js.map +0 -1
  284. package/dist/chunk-BY5WIRCU.js.map +0 -1
  285. package/dist/chunk-ICSGNT5P.js.map +0 -1
  286. package/dist/chunk-ITFCWMOY.js.map +0 -1
  287. package/dist/chunk-JMIKGAUA.js.map +0 -1
  288. package/dist/chunk-KJSC2ZD6.js.map +0 -1
  289. package/dist/chunk-PKBLJI23.js.map +0 -1
  290. package/dist/chunk-RQMIZONH.js.map +0 -1
  291. package/dist/chunk-S2H3RBK7.js.map +0 -1
  292. package/dist/chunk-SJNZ4WPA.js.map +0 -1
  293. package/dist/chunk-U673DB5U.js.map +0 -1
  294. package/dist/chunk-X37JUNEW.js.map +0 -1
  295. package/dist/ensure-sources-K5EFNC3L.js.map +0 -1
  296. package/dist/library-publish-XMRCKRNR.js.map +0 -1
  297. package/dist/open-library-XBR46DJL.js +0 -56
  298. package/dist/serve-preflight-CGA5G3AE.js.map +0 -1
  299. package/dist/setup-IBDNJAOU.js.map +0 -1
  300. package/dist/source-manifest-publish-IYWUMUCY.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../cli/src/commands/validate.ts"],"names":["parseYaml","parsed","a","c"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmFA,IAAM,+BAAoC,IAAI,GAAA,CAAI,CAAC,SAAA,EAAW,QAAA,EAAU,MAAM,CAAC,CAAA;AAE/E,IAAM,SAAA,uBAAgB,GAAA,CAAI;AAAA,EACxB,cAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,aAAA;AAAA,EACA,GAAG;AACL,CAAC,CAAA;AAQD,SAAS,uBAAuB,QAAA,EAAuC;AACrE,EAAA,MAAM,aAAkC,EAAC;AAEzC,EAAA,SAAS,KAAK,GAAA,EAAmB;AAC/B,IAAA,IAAI,OAAA;AACJ,IAAA,IAAI;AACF,MAAA,OAAA,GAAU,GAAG,WAAA,CAAY,GAAA,EAAK,EAAE,aAAA,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CAAA;AAChC,MAAA;AAAA,IACF;AAEA,IAAA,KAAA,MAAW,IAAA,IAAQ,OAAA,EAAS,KAAA,CAAM,CAAA,EAAG,IAAI,CAAA,QAAA,CAAU,CAAA;AACnD,IAAA,KAAA,MAAW,IAAA,IAAQ,KAAA,EAAO,MAAA,CAAO,CAAA,EAAG,IAAI,CAAA,mCAAA,CAAqC,CAAA;AAC7E,IAAA,KAAA,MAAW,SAAS,OAAA,EAAS;AAC3B,MAAA,MAAA,CAAO,CAAA,EAAG,KAAK,CAAA,sEAAA,CAAmE,CAAA;AAAA,IACpF;AAEA,IAAA,IAAI,MAAM,MAAA,GAAS,OAAA,CAAQ,SAAS,CAAA,EAAG,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA,EACvD,CAAC,CAAA;AAEH,EAAA,OAAO,GAAA;AACT","file":"chunk-Z3IRZBXB.js","sourcesContent":["/**\n * Validate asset versions, changelogs, and manifest schemas across asset repos.\n */\n\nimport { execFileSync } from \"node:child_process\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport {\n ASSET_NAME_HINT,\n type ConnectorDeclaration,\n decodeSkaileYaml,\n isInsideProject,\n symlinkEscapeOfProject,\n isValidAssetName,\n isValidPublisher,\n loadSkPublishManifest,\n localConnectorMountDir,\n parseAssetRef,\n resolveRuntimeAssets,\n SKAILE_MANIFEST_FILENAME,\n readAssetBody,\n} from \"@skaile/workspaces/core\";\nimport {\n flowSkillVersionPins,\n loadFlow,\n} from \"@skaile/workspaces/factory-assets/connectors/flow/engine\";\nimport { parseManifestFile } from \"@skaile/workspaces/discovery\";\nimport { withYamlQuotingHint } from \"@skaile/workspaces/core/manifest\";\nimport { isNonAssetPath } from \"@skaile/workspaces/core/publish-manifest\";\nimport {\n assertManifestEditable,\n missingRootAssets,\n scanUnlistedAssets,\n UNLISTED_SCAN_SKIP_DIRS,\n} from \"@skaile/workspaces/library\";\nimport type { IAssetKindRegistry } from \"@skaile/workspaces/plugins\";\nimport type { FlowVersionNode } from \"@skaile/workspaces/resolver\";\nimport { validateFlowVersions } from \"@skaile/workspaces/resolver\";\nimport { Command } from \"commander\";\nimport { parse as parseYaml } from \"yaml\";\nimport { type ComposeRefContext, composeRefContext } from \"../agent-checks.ts\";\nimport { unknownHarnessErrors, unknownKeyWarnings } from \"../config-checks.ts\";\nimport { logErr, logInfo, logOk, logWarn } from \"../helpers.ts\";\nimport { getKindRegistry } from \"../open-registry.ts\";\nimport {\n checkAsset,\n checkAssetFile,\n declaredVersion,\n findEntryManifestFile,\n invalidSemverText,\n MANIFEST_GLOBS,\n manifestParseErrorText,\n} from \"../skill-checks.ts\";\nimport {\n manifestEntryNameProblems,\n invalidPublisherMessage,\n manifestFilesProblems,\n manifestPublisherProblems,\n manifestRootProblems,\n manifestRequiresProblems,\n registeredAssetKeys,\n rejectRemovedDomainOption,\n removedDomainOption,\n reportLibrarySymlinks,\n unresolvedManifestDependencies,\n warnIgnoredDomainFiles,\n warnLegacyBundleFiles,\n} from \"./library-index.ts\";\nimport { assetEntryRef, manifestVersionMismatchMessage } from \"./publish-core.ts\";\nimport { checkAgentInstances } from \"./validate-instances.ts\";\n\n// ---------------------------------------------------------------------------\n// Manifest schema validation (skaile validate [path])\n// ---------------------------------------------------------------------------\n\n// The manifest file patterns live in skill-checks.ts (`MANIFEST_GLOBS`): `library index` names\n// the kind of a file it cannot parse with the same table.\n\n/**\n * `.claude`, `.codex` and `.omp` hold the copies `skaile add` deploys for the harnesses (and\n * the harness's own state): a project `validate .` checks what the author owns, not the\n * deployed bytes of an asset published elsewhere (p853).\n */\nconst HARNESS_DIRS: ReadonlySet<string> = new Set([\".claude\", \".codex\", \".omp\"]);\n/** Directories to skip during tree walk. */\nconst SKIP_DIRS = new Set([\n \"node_modules\",\n \"dist\",\n \".git\",\n \".skaile\",\n \"__pycache__\",\n ...HARNESS_DIRS,\n]);\n\ninterface ManifestCandidate {\n filePath: string;\n kind: string;\n}\n\n/** Recursively walk a directory tree and find manifest candidates. */\nfunction findManifestCandidates(rootPath: string): ManifestCandidate[] {\n const candidates: ManifestCandidate[] = [];\n\n function walk(dir: string): void {\n let entries: fs.Dirent[];\n try {\n entries = fs.readdirSync(dir, { withFileTypes: true });\n } catch {\n return;\n }\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name);\n if (entry.isDirectory()) {\n if (!SKIP_DIRS.has(entry.name)) walk(fullPath);\n } else if (entry.isFile()) {\n for (const glob of MANIFEST_GLOBS) {\n if (glob.pattern.test(fullPath)) {\n candidates.push({ filePath: fullPath, kind: glob.kind });\n break;\n }\n }\n }\n }\n }\n\n walk(rootPath);\n return candidates;\n}\n\n/**\n * Parse a single manifest candidate's bytes with the indexer's own parser\n * (`parseManifestFile`), so a manifest `library index` cannot parse — an empty\n * `SKILL.md`, no frontmatter, invalid YAML — is an error here too. On failure\n * the error is already logged; count it.\n */\nfunction parseManifestCandidate(\n c: ManifestCandidate,\n absRoot: string,\n): { kind: \"value\"; parsed: unknown; body?: string } | { kind: \"error\" } {\n const content = fs.readFileSync(c.filePath, \"utf-8\");\n const res = parseManifestFile(c.filePath, content);\n if (!res.ok) {\n logErr(\n `${path.relative(absRoot, c.filePath)} [${c.kind}] — ${manifestParseErrorText(res.reason)}`,\n );\n return { kind: \"error\" };\n }\n return {\n kind: \"value\",\n parsed: res.data,\n body: readAssetBody(c.filePath, content),\n };\n}\n\n/**\n * The library root a validated path belongs to: the nearest directory at or above `absRoot`\n * that holds a `skaile.yaml`, else `absRoot` itself.\n */\nfunction libraryRootOf(absRoot: string): string {\n for (let dir = absRoot; ; dir = path.dirname(dir)) {\n if (fs.existsSync(path.join(dir, SKAILE_MANIFEST_FILENAME))) return dir;\n if (path.dirname(dir) === dir) return absRoot;\n }\n}\n\n/**\n * Validate a single parsed manifest candidate against identity rules + the kind\n * registry. Returns the error/warning deltas this candidate contributes.\n */\nfunction validateManifestCandidate(\n c: ManifestCandidate,\n parsed: unknown,\n body: string | undefined,\n absRoot: string,\n registry: IAssetKindRegistry,\n strictConformance: boolean,\n composeRefs: ComposeRefContext,\n): { errors: number; warnings: number } {\n const relPath = path.relative(absRoot, c.filePath);\n let errors = 0;\n let warnings = 0;\n\n // The shared per-asset checks (also run by `library index` and the publish plan):\n // errors fail validate; advisories are warnings (exit code unchanged) unless\n // --strict-conformance escalates the agentskills.io conformance ones to errors.\n const dirName = path.basename(path.dirname(c.filePath)); // the manifest's folder\n const checked = checkAsset(\n c.kind,\n (parsed ?? {}) as Record<string, unknown>,\n body,\n dirName,\n registry,\n fs.readFileSync(c.filePath, \"utf-8\"),\n path.basename(c.filePath),\n { dir: path.dirname(c.filePath), libraryRoot: libraryRootOf(absRoot), composeRefs },\n );\n for (const f of checked.errors) {\n logErr(`${relPath} [${f.tag}] — ${f.text}`);\n errors++;\n }\n for (const f of checked.advisories) {\n const line = `${relPath} [${f.tag}] — ${f.text}`;\n // An untouched scaffold body is an error: a passing `validate` means the asset can be published.\n if ((f.conformance && strictConformance) || f.scaffoldBody) {\n logErr(line);\n errors++;\n } else {\n logWarn(line);\n warnings++;\n }\n }\n\n return { errors, warnings };\n}\n\n/**\n * The `kind:name` identity of every asset manifest under `root`, read quietly: a manifest\n * that does not parse holds no identity (its own validation reports the error).\n */\nexport function scanIdentities(root: string): Set<string> {\n const identities = new Set<string>();\n for (const c of findManifestCandidates(root)) {\n let parsed: unknown;\n try {\n const res = parseManifestFile(c.filePath, fs.readFileSync(c.filePath, \"utf-8\"));\n if (!res.ok) continue;\n parsed = res.data;\n } catch {\n continue;\n }\n if (parsed === null || typeof parsed !== \"object\") continue;\n const identity = (parsed as Record<string, unknown>)[c.kind === \"flow\" ? \"id\" : \"name\"];\n if (typeof identity === \"string\" && identity.length > 0)\n identities.add(`${c.kind}:${identity}`);\n }\n return identities;\n}\n\n/** Validate all manifest files in a directory tree using the kind registry. */\nexport function validateManifests(\n rootPath: string,\n strictConformance: boolean,\n registeredAssets: ReadonlySet<string> = new Set(),\n): { total: number; errors: number; warnings: number } {\n const absRoot = path.resolve(rootPath);\n if (!fs.existsSync(absRoot)) {\n logErr(`Path does not exist: ${absRoot}`);\n return { total: 0, errors: 1, warnings: 0 };\n }\n\n const registry: IAssetKindRegistry = getKindRegistry();\n const candidates = findManifestCandidates(absRoot);\n // Symlinks are refused with the text `library index` and the publish plan print (p520). In a\n // library (a `skaile.manifest.yaml` at the root) any symlink is refused, as `git add -A`\n // would publish it; elsewhere (a project) only those inside an asset folder or aliasing one.\n // A link elsewhere in a project is not refused: the connector real-path check judges a\n // `mountPath` link (p1332).\n const isLibrary = fs.existsSync(path.join(absRoot, SKAILE_MANIFEST_FILENAME));\n // A project's deployed harness folders (`add --link` makes `.claude/skills/x` a link to the\n // project's own `skills/x`) are not sources: they are skipped here as in the manifest walk.\n let errors = reportLibrarySymlinks(absRoot, {\n wholeTree: isLibrary,\n skipDirs: isLibrary ? undefined : HARNESS_DIRS,\n });\n let warnings = 0;\n\n // kind:name → directory of the first manifest seen; a second directory with the same\n // identity cannot be told apart by `add`/`publish` (and `library index` skips it).\n const seenIdentity = new Map<string, string>();\n // `composes:` refs resolve against the assets of the whole library (the scanned tree plus,\n // when `validate` got a sub-directory, its siblings under the enclosing library root) and the\n // registered libraries of its publisher: a ref no library holds fails `skaile add` (p415).\n const libraryRoot = libraryRootOf(absRoot);\n const composeRefs = composeRefContext(\n scanIdentities(libraryRoot),\n registeredAssets,\n loadSkPublishManifest(libraryRoot)?.publisher,\n );\n for (const c of candidates) {\n const parseResult = parseManifestCandidate(c, absRoot);\n if (parseResult.kind === \"error\") {\n errors++;\n continue;\n }\n\n const delta = validateManifestCandidate(\n c,\n parseResult.parsed,\n parseResult.body,\n absRoot,\n registry,\n strictConformance,\n composeRefs,\n );\n errors += delta.errors;\n warnings += delta.warnings;\n const obj = parseResult.parsed as Record<string, unknown> | null;\n const identity = obj && typeof obj === \"object\" ? obj[c.kind === \"flow\" ? \"id\" : \"name\"] : null;\n if (typeof identity === \"string\" && identity.length > 0) {\n const dir = path.dirname(c.filePath);\n const key = `${c.kind}:${identity}`;\n const first = seenIdentity.get(key);\n if (first === undefined) {\n seenIdentity.set(key, dir);\n } else if (first !== dir) {\n logErr(\n `${path.relative(absRoot, c.filePath)} [${c.kind}] — ${key} is also defined in ${path.relative(absRoot, first) || \".\"}; ` +\n \"two directories cannot share a kind and name (`skaile library index` keeps only the first).\",\n );\n errors++;\n }\n }\n }\n\n return { total: candidates.length, errors, warnings };\n}\n\n/** Recursively find every `skaile.yaml` / `*.skaile.yaml` workspace manifest. */\nfunction findWorkspaceManifests(rootPath: string): string[] {\n const out: string[] = [];\n function walk(dir: string): void {\n let entries: fs.Dirent[];\n try {\n entries = fs.readdirSync(dir, { withFileTypes: true });\n } catch {\n return;\n }\n for (const entry of entries) {\n const full = path.join(dir, entry.name);\n if (entry.isDirectory()) {\n if (!SKIP_DIRS.has(entry.name)) walk(full);\n } else if (entry.isFile() && /(^|\\.)skaile\\.yaml$/.test(entry.name)) {\n out.push(full);\n }\n }\n }\n walk(rootPath);\n return out;\n}\n\n/**\n * Validate the dependency refs and asset identities declared in every\n * `skaile.yaml` under a tree. This is the manifest-level mirror of the\n * per-file identity check: it parses each `dependencies[]` /\n * `overrides[].ref` through `parseAssetRef` (the exact code path that produced\n * the original \"publisher required …\" / \"invalid asset name …\" hard error) and\n * checks each `assets[].name` against the canonical name grammar.\n */\n/**\n * Collect every `[field, ref]` pair to validate from a workspace manifest:\n * each string in `dependencies[]` and each `overrides[].ref`.\n */\nfunction collectWorkspaceRefFields(parsed: Record<string, unknown>): Array<[string, string]> {\n const refFields: Array<[string, string]> = [];\n if (Array.isArray(parsed.dependencies)) {\n for (const d of parsed.dependencies) {\n if (typeof d === \"string\") refFields.push([\"dependencies\", d]);\n }\n }\n if (Array.isArray(parsed.overrides)) {\n for (const o of parsed.overrides) {\n const ref = (o as Record<string, unknown>)?.ref;\n if (typeof ref === \"string\") refFields.push([\"overrides.ref\", ref]);\n }\n }\n return refFields;\n}\n\n/** Parse each declared ref through `parseAssetRef`; returns the error count. */\nfunction validateWorkspaceRefs(refFields: Array<[string, string]>, relPath: string): number {\n let errors = 0;\n for (const [field, ref] of refFields) {\n try {\n const parsedRef = parseAssetRef(ref);\n // The library-side slug rule (`library index`, the publish plan) holds for a project's\n // `dependencies:` too: `add` cannot resolve such a ref, so `check` fails on it (p1080).\n const publisher = parsedRef.publisher?.replace(/^@/, \"\");\n if (publisher !== undefined && !isValidPublisher(publisher)) {\n logErr(`${relPath} [${field}] — ${ref}: ${invalidPublisherMessage(publisher)}`);\n errors++;\n }\n } catch (e) {\n logErr(`${relPath} [${field}] — ${e instanceof Error ? e.message : String(e)}`);\n errors++;\n }\n }\n return errors;\n}\n\n/** Validate `assets[].name` against the canonical name/ref grammar. */\nfunction validateWorkspaceAssets(parsed: Record<string, unknown>, relPath: string): number {\n if (!Array.isArray(parsed.assets)) return 0;\n let errors = 0;\n const topPublisher = typeof parsed.publisher === \"string\" ? parsed.publisher : undefined;\n for (const a of parsed.assets) {\n const asset = a as Record<string, unknown>;\n const name = asset?.name;\n const kind = typeof asset?.kind === \"string\" ? asset.kind : \"skill\";\n if (typeof name !== \"string\" || name.length === 0) continue;\n const publisher = typeof asset?.publisher === \"string\" ? asset.publisher : topPublisher;\n if (publisher !== undefined) {\n try {\n parseAssetRef(`${kind}:@${publisher}/${name}`);\n } catch (e) {\n logErr(`${relPath} [assets] — ${e instanceof Error ? e.message : String(e)}`);\n errors++;\n }\n } else if (!isValidAssetName(name)) {\n logErr(`${relPath} [assets] — invalid asset name \"${name}\" — ${ASSET_NAME_HINT}`);\n errors++;\n }\n }\n return errors;\n}\n\n/** `skaile.yaml` connector diagnostics that fail `validate` (the runner cannot mount it right). */\nconst CONNECTOR_ERROR_CODES: readonly string[] = [\n \"connector_missing_driver\",\n \"connector_missing_id\",\n \"connector_duplicate_id\",\n \"connector_invalid_access\",\n];\n\n/**\n * A `local` connector's `mountPath` is mounted read-write as given: one that does not exist\n * fails (`serve` refuses it too), one outside the project is a warning, one that reaches outside\n * through a symlink fails (p833).\n */\nfunction validateLocalConnectorMountPaths(\n projectDir: string,\n relPath: string,\n connectors: ReadonlyArray<ConnectorDeclaration>,\n): number {\n let errors = 0;\n for (const c of connectors) {\n if (c.driver !== \"local\" || c.mount) continue;\n const dir = localConnectorMountDir(c, projectDir);\n if (!dir) continue;\n const escapesTo = symlinkEscapeOfProject(dir, projectDir);\n if (!fs.existsSync(dir)) {\n logErr(\n `${relPath} [connectors] — connector_mount_path_missing: connectors.${c.id}.mountPath: ${dir} does not exist; create the directory or fix the path`,\n );\n errors++;\n } else if (escapesTo !== null) {\n logErr(\n `${relPath} [connectors] — connector_mount_path_symlink: connectors.${c.id}.mountPath: ${dir} is a symlink to ${escapesTo}, outside the project ${projectDir}; point mountPath at the real directory`,\n );\n errors++;\n } else if (!isInsideProject(dir, projectDir)) {\n logWarn(\n `${relPath} [connectors] — connectors.${c.id}.mountPath: ${dir} is outside the project ${projectDir}; the agent reads${c.access === \"read-write\" ? \" and writes\" : \"\"} there`,\n );\n }\n }\n return errors;\n}\n\nasync function validateWorkspaceManifests(rootPath: string): Promise<{\n total: number;\n errors: number;\n}> {\n const absRoot = path.resolve(rootPath);\n const files = findWorkspaceManifests(absRoot);\n let errors = 0;\n\n for (const file of files) {\n const relPath = path.relative(absRoot, file);\n let parsed: Record<string, unknown>;\n let text = \"\";\n try {\n text = fs.readFileSync(file, \"utf-8\");\n parsed = (parseYaml(text) ?? {}) as Record<string, unknown>;\n } catch (e) {\n const message = e instanceof Error ? e.message : String(e);\n logErr(`${relPath} — parse error: ${withYamlQuotingHint(message, text)}`);\n errors++;\n continue;\n }\n // A root that is no mapping, or a `dependencies:`/`sources:` of the wrong shape, is one\n // parse-error line, as `check` prints it (p1421, p1620).\n const unreadable = decodeSkaileYaml(text).diagnostics.find(\n (d) => d.code === \"non_object_root\" || d.code === \"invalid_value_shape\",\n );\n if (unreadable) {\n logErr(`${relPath} — parse error: ${unreadable.message}`);\n errors++;\n continue;\n }\n\n errors += validateWorkspaceRefs(collectWorkspaceRefFields(parsed), relPath);\n errors += validateWorkspaceAssets(parsed, relPath);\n for (const d of checkAgentInstances(path.dirname(file), parsed)) {\n const line = `${relPath} [agents] — ${d.code}: ${d.path ? `${d.path}: ` : \"\"}${d.message}`;\n if (d.severity === \"error\") {\n logErr(line);\n errors++;\n } else {\n logWarn(line);\n }\n }\n // A connector the runner cannot mount or mounts wrongly: no `driver` (or the old `adapter`\n // spelling), no `id`, a duplicate `id`, an `access` that is neither read-only nor read-write.\n const decoded = decodeSkaileYaml(fs.readFileSync(file, \"utf-8\"));\n for (const d of decoded.diagnostics) {\n if (!CONNECTOR_ERROR_CODES.includes(d.code)) continue;\n logErr(`${relPath} [connectors] — ${d.code}: ${d.path ? `${d.path}: ` : \"\"}${d.message}`);\n errors++;\n }\n // A key skaile.yaml no longer accepts (a legacy `provider:`): every command that reads the\n // file stops on it, so `validate` must not call the file valid (p1352).\n for (const d of decoded.diagnostics) {\n if (d.code !== \"legacy_key_rejected\") continue;\n logErr(relPath === \"skaile.yaml\" ? d.message : `${relPath} — ${d.message}`);\n errors++;\n }\n // The 5.x `driver` key of an agent-config profile: still read as `harness` until 7.0\n // (warning); setting both keys is an error.\n for (const d of decoded.diagnostics) {\n if (d.code !== \"deprecated_harness_key\" && d.code !== \"harness_key_conflict\") continue;\n const line = `${relPath} [agent-config] — ${d.code}: ${d.message}`;\n if (d.severity === \"error\") {\n logErr(line);\n errors++;\n } else {\n logWarn(line);\n }\n }\n // A mistyped key warns (p1474); a `harness:` no harness registers, plugins included, fails (p1022).\n for (const line of unknownKeyWarnings(decoded.diagnostics, relPath)) logWarn(line);\n for (const line of await unknownHarnessErrors(path.dirname(file), decoded.config, relPath)) {\n logErr(line);\n errors++;\n }\n errors += validateLocalConnectorMountPaths(\n path.dirname(file),\n relPath,\n decoded.config?.connectors ?? [],\n );\n // A `driver` no catalog entry provides: `serve` cannot mount it either. The text is the one\n // `serve` logs as `validation_warning`. An unreachable source (not cloned yet) may hold the\n // driver, so nothing is reported while one is missing.\n if ((decoded.config?.connectors ?? []).length > 0) {\n const assets = await resolveRuntimeAssets(path.dirname(file));\n if (!assets.warnings.some((w) => w.code === \"repo_unavailable\")) {\n for (const w of assets.warnings) {\n if (w.code !== \"missing_driver\" || !w.name) continue;\n logErr(`${relPath} [connectors] — ${w.code}: ${w.message}`);\n errors++;\n }\n }\n }\n }\n\n return { total: files.length, errors };\n}\n\n/**\n * Check the library's publication manifest (`skaile.manifest.yaml` at the\n * validated root): every first-party `root:` must still exist. An entry whose\n * directory was deleted would otherwise stay publishable; the fix is\n * `skaile library index <lib>`, which drops it.\n */\nfunction validatePublishManifestRoots(rootPath: string): number {\n const absRoot = path.resolve(rootPath);\n const manifest = loadSkPublishManifest(absRoot);\n if (!manifest) return 0;\n const missing = missingRootAssets(absRoot, manifest);\n for (const a of missing) {\n logErr(\n `${SKAILE_MANIFEST_FILENAME} [assets] — ${assetEntryRef(a, manifest)}: root \"${a.root}\" does not exist. ` +\n \"Run `skaile library index <library>` to drop the entry, or restore the directory.\",\n );\n }\n return missing.length;\n}\n\n/**\n * An asset directory the library's manifest does not list is an error: `add` refuses it (`not\n * listed in its skaile.manifest.yaml`), the publish plan does not ship it, yet `git add -A`\n * commits its files. The fix is `skaile library index <lib>`, which lists it (p1193). A directory\n * that holds a kind + name the manifest already names elsewhere is the duplicate check's finding.\n * An asset that already fails its own check is not listed here: `library index` refuses it, so\n * \"run `library index`\" would send the author round in a circle; the check line names the real\n * fix (p871).\n */\nasync function validatePublishManifestUnlisted(rootPath: string): Promise<number> {\n const absRoot = path.resolve(rootPath);\n const manifest = loadSkPublishManifest(absRoot);\n if (!manifest) return 0;\n const registry = getKindRegistry();\n const libraryRoot = libraryRootOf(absRoot);\n const composeRefs = composeRefContext(\n scanIdentities(libraryRoot),\n await registeredAssetKeys(libraryRoot),\n manifest.publisher,\n );\n const unlisted = (\n await scanUnlistedAssets(\n absRoot,\n manifest.publisher ?? path.basename(absRoot),\n registry,\n UNLISTED_SCAN_SKIP_DIRS,\n )\n ).filter(\n (u) =>\n !u.registeredAt &&\n !u.parseFailure && // a file that does not parse has its own parse error\n checkAssetFile(u.entry.source, u.entry.kind, registry, absRoot, composeRefs).length === 0,\n );\n for (const u of unlisted) {\n logErr(\n `${path.relative(absRoot, u.entry.source)} [${u.entry.kind}] — ${u.entry.kind}:${u.entry.name} is on disk but not in ${SKAILE_MANIFEST_FILENAME}, so it is not published. ` +\n \"Run `skaile library index <library>` to list it, or delete the directory.\",\n );\n }\n return unlisted.length;\n}\n\n/**\n * Check every `assets[].dependencies` entry of the publication manifest with the\n * same syntax rule (and message) `library index` applies, so a malformed ref\n * fails `validate` instead of being silently dropped by the manifest decoder.\n */\nfunction validatePublishManifestRequires(rootPath: string): number {\n const problems = manifestRequiresProblems(path.resolve(rootPath));\n for (const p of problems) {\n logErr(\n `${SKAILE_MANIFEST_FILENAME} [assets] — ${p.asset}: ${p.message}. ` +\n \"Use the `kind:@<publisher>/name[#version]` form.\",\n );\n }\n return problems.length;\n}\n\n/**\n * Check the publisher of the publication manifest (top-level and every\n * `assets[].publisher`) against the one publisher slug rule `library create`, `library\n * index` and the publish plan apply, with the same message.\n */\nfunction validatePublishManifestPublisherSlugs(rootPath: string): number {\n const problems = manifestPublisherProblems(path.resolve(rootPath));\n for (const message of problems) logErr(message);\n return problems.length;\n}\n\n/**\n * Check every first-party `assets[].root` and `files:` entry of the publication manifest stays\n * inside the library and crosses no symlink ({@link manifestRootProblems},\n * {@link manifestFilesProblems}), the refusal `library index` and the publish plan print too: a\n * path outside the library is never found by `add` (p701, p1403), a missing file is no asset (p1404).\n */\nfunction validatePublishManifestRootPaths(rootPath: string): number {\n const problems = [\n ...manifestRootProblems(path.resolve(rootPath)),\n ...manifestFilesProblems(path.resolve(rootPath)),\n ...manifestEntryNameProblems(path.resolve(rootPath)),\n ];\n for (const message of problems) logErr(message);\n return problems.length;\n}\n\n/**\n * Parse the publication manifest the way `library index` and `library publish` open it, so a\n * `skaile.manifest.yaml` that does not parse fails `validate` too, with the file and line.\n * Without the file there is nothing to check.\n */\nfunction validatePublishManifestParses(rootPath: string): number {\n try {\n assertManifestEditable(path.resolve(rootPath));\n return 0;\n } catch (err) {\n logErr(err instanceof Error ? err.message : String(err));\n return 1;\n }\n}\n\n/**\n * Warn when a first-party `assets[].version` of the publication manifest differs\n * from the version in the asset's own manifest file. The file is the source of\n * truth — `skaile library index` rewrites the entry from it — so a hand-edited\n * manifest version is silently overwritten by the next index. Returns the warning count.\n */\nfunction validatePublishManifestVersions(rootPath: string): number {\n const absRoot = path.resolve(rootPath);\n const manifest = loadSkPublishManifest(absRoot);\n if (!manifest || manifest.source) return 0;\n let warnings = 0;\n for (const a of manifest.assets ?? []) {\n if (a.source || !a.version) continue;\n const file = findEntryManifestFile(absRoot, a);\n if (!file) continue;\n const res = parseManifestFile(file, fs.readFileSync(file, \"utf-8\"));\n if (!res.ok) continue; // reported by the per-file parse check\n const fileVersion = declaredVersion(res.data);\n if (fileVersion === undefined || fileVersion === a.version) continue;\n logWarn(\n manifestVersionMismatchMessage(\n assetEntryRef(a, manifest),\n a.version,\n toPosix(path.relative(absRoot, file)),\n fileVersion,\n ),\n );\n warnings++;\n }\n return warnings;\n}\n\n/**\n * Warn when a first-party asset file still carries a `metadata.publisher` that\n * differs from the publisher the manifest resolves for it (`assets[].publisher`,\n * else the top-level `publisher`). The manifest is the only source of an\n * asset's publisher; the file value is ignored by every resolver, so a stale\n * one only misleads the reader. Returns the warning count.\n */\nfunction validatePublishManifestPublishers(rootPath: string): number {\n const absRoot = path.resolve(rootPath);\n const manifest = loadSkPublishManifest(absRoot);\n if (!manifest || manifest.source) return 0;\n const bare = (p: string) => p.trim().replace(/^@/, \"\");\n let warnings = 0;\n for (const a of manifest.assets ?? []) {\n const resolved = a.publisher ?? manifest.publisher;\n if (a.source || !resolved) continue;\n const file = findEntryManifestFile(absRoot, a);\n if (!file) continue;\n const res = parseManifestFile(file, fs.readFileSync(file, \"utf-8\"));\n if (!res.ok) continue; // reported by the per-file parse check\n const meta = (res.data as Record<string, unknown>).metadata;\n const declared =\n meta !== null && typeof meta === \"object\"\n ? (meta as Record<string, unknown>).publisher\n : null;\n if (typeof declared !== \"string\" || bare(declared) === bare(resolved)) continue;\n logWarn(\n `${toPosix(path.relative(absRoot, file))} [publisher] — metadata.publisher \"${bare(declared)}\" differs from ` +\n `the manifest publisher \"${bare(resolved)}\" for ${assetEntryRef(a, manifest)}. The manifest wins and the ` +\n \"file value is ignored: delete `metadata.publisher` from the file, or set the publisher in \" +\n `${SKAILE_MANIFEST_FILENAME}.`,\n );\n warnings++;\n }\n return warnings;\n}\n\n/** Root-relative path prefixes excluded from version/changelog checks. */\nconst EXCLUDED_PATHS = [\"skaileup-shared/\", \"external/\", \"docs/\"];\n\n/** Normalise to forward slashes so prefix and set comparisons work on any OS. */\nfunction toPosix(p: string): string {\n return p.split(path.sep).join(\"/\");\n}\n\n/** True when a root-relative path sits under one of {@link EXCLUDED_PATHS}. */\nfunction isExcludedPath(relPath: string): boolean {\n const rel = toPosix(relPath);\n return EXCLUDED_PATHS.some((prefix) => rel.startsWith(prefix));\n}\n\ninterface AssetVersion {\n kind: \"skill\" | \"agent\" | \"flow\" | \"prompt\" | \"preset\" | \"contract\";\n name: string;\n version: string;\n filePath: string;\n}\n\n/** Manifest candidates whose kind carries a version `validate versions` checks. */\nconst VERSIONED_KINDS: Record<string, true> = {\n skill: true,\n agent: true,\n flow: true,\n prompt: true,\n preset: true,\n contract: true,\n};\n\n/** Read one manifest candidate's identity and version; unreadable YAML yields an empty version. */\nfunction readAssetVersion(c: ManifestCandidate): AssetVersion {\n const kind = c.kind as AssetVersion[\"kind\"];\n const fileName = path.basename(c.filePath);\n const dirName = path.basename(path.dirname(c.filePath));\n const content = fs.readFileSync(c.filePath, \"utf-8\");\n if (c.filePath.endsWith(\".md\")) {\n // The version `library index` records (top-level `version`, else `metadata.version`).\n const res = parseManifestFile(c.filePath, content);\n const data = res.ok ? (res.data as Record<string, unknown>) : {};\n const stem = fileName.replace(/\\.prompt\\.md$/, \"\");\n return {\n kind,\n name: typeof data.name === \"string\" ? data.name : kind === \"prompt\" ? stem : dirName,\n version: declaredVersion(data) ?? \"\",\n filePath: c.filePath,\n };\n }\n let parsed: Record<string, unknown> | null = null;\n try {\n parsed = parseYaml(content);\n } catch {\n // Reported by the default `skaile validate`; here the asset just has no readable version.\n }\n if (kind === \"flow\") {\n return {\n kind,\n name: String(parsed?.id ?? fileName.replace(\".flow.yaml\", \"\")),\n version: String(parsed?.version ?? \"\"),\n filePath: c.filePath,\n };\n }\n return {\n kind,\n name: String(parsed?.name ?? dirName),\n version: String(parsed?.version ?? \"\"),\n filePath: c.filePath,\n };\n}\n\n/**\n * Walk `root` at any depth and collect the version of every skill, agent, flow, prompt,\n * preset and contract — the same tree walk the default `validate` uses, so a library laid out\n * as `<root>/<asset>/SKILL.md` is covered as well as `skills/<asset>/SKILL.md`.\n */\nfunction collectAssetVersions(root: string): AssetVersion[] {\n if (!fs.existsSync(root)) return [];\n const assets: AssetVersion[] = [];\n for (const c of findManifestCandidates(root)) {\n if (!VERSIONED_KINDS[c.kind]) continue;\n // Only the YAML flow form and `agent.yaml` / `AGENT.md` carry a readable version here.\n if (c.filePath.endsWith(\".flow.json\")) continue;\n if (isExcludedPath(path.relative(root, c.filePath))) continue;\n assets.push(readAssetVersion(c));\n }\n return assets;\n}\n\n/** Root-relative posix location of an asset file, for messages. */\nfunction assetLocation(a: AssetVersion, root: string): string {\n return toPosix(path.relative(root, a.filePath));\n}\n\n/**\n * Nearest ancestor directory of `assetRelPath` (root-relative, posix) that\n * holds a `CHANGELOG.md`, walking up from the asset's own directory to and\n * including `root`, never above it. Returns the changelog's root-relative\n * path, or `null` when no ancestor has one.\n */\nfunction findChangelogUnit(assetRelPath: string, root: string): string | null {\n let dir = path.posix.dirname(toPosix(assetRelPath));\n for (;;) {\n const candidate = dir === \".\" ? \"CHANGELOG.md\" : `${dir}/CHANGELOG.md`;\n if (fs.existsSync(path.join(root, candidate))) return candidate;\n if (dir === \".\") return null;\n dir = path.posix.dirname(dir);\n }\n}\n\n/** Outcome of {@link checkChangelogUnits}. All paths are root-relative posix. */\nexport interface ChangelogCheck {\n /** Changelog units whose `CHANGELOG.md` is among the modified files. */\n updated: string[];\n /** Changelog units covering a modified asset whose `CHANGELOG.md` is not modified. */\n stale: string[];\n /** Modified assets with no `CHANGELOG.md` in any ancestor up to the root. */\n orphans: string[];\n}\n\n/**\n * Group the modified asset files by their nearest-ancestor `CHANGELOG.md` and\n * report which units were updated alongside them. Assets under\n * {@link EXCLUDED_PATHS} are ignored.\n *\n * @param modifiedFiles - Changed paths relative to `root`.\n * @param root - The asset root (`ai-assets/`); the walk up never leaves it.\n */\nexport function checkChangelogUnits(modifiedFiles: string[], root: string): ChangelogCheck {\n const modified = new Set(modifiedFiles.map(toPosix));\n const assetPattern = /(SKILL\\.md|agent\\.yaml|\\.flow\\.yaml|\\.prompt\\.md)$/;\n const units = new Set<string>();\n const orphans: string[] = [];\n for (const f of modified) {\n if (!assetPattern.test(f) || isExcludedPath(f)) continue;\n const unit = findChangelogUnit(f, root);\n if (unit) units.add(unit);\n else orphans.push(f);\n }\n const updated = [...units].filter((u) => modified.has(u));\n const stale = [...units].filter((u) => !modified.has(u));\n return { updated, stale, orphans };\n}\n\n/** Extract version from file content using proper YAML parsing */\nfunction extractVersionFromContent(filePath: string, content: string): string | null {\n if (filePath.endsWith(\".yaml\")) {\n const parsed = parseYaml(content);\n return parsed?.version ?? null;\n }\n // SKILL.md / .prompt.md — YAML frontmatter\n const fmMatch = content.match(/^---\\n([\\s\\S]*?)\\n---/);\n if (!fmMatch) return null;\n const parsed = parseYaml(fmMatch[1]);\n return parsed?.metadata?.version ?? parsed?.version ?? null;\n}\n\n/** Check every asset has a present + semver-valid version. */\nfunction checkAssetVersions(\n assets: AssetVersion[],\n root: string,\n): { errors: number; warnings: number } {\n let errors = 0;\n const warnings = 0;\n for (const a of assets) {\n const location = assetLocation(a, root);\n if (!a.version) {\n logErr(`${a.kind}:${a.name} (${location}) — missing version`);\n errors++;\n continue;\n }\n const invalid = invalidSemverText(a.version);\n if (invalid) {\n logErr(`${a.kind}:${a.name} (${location}) — ${invalid}`);\n errors++;\n }\n }\n return { errors, warnings };\n}\n\n/** In --changed-only mode, warn when a changed asset's version was not bumped. */\nfunction checkVersionBumps(assets: AssetVersion[], root: string): number {\n let warnings = 0;\n for (const a of assets) {\n if (!a.version) continue; // already flagged above\n // `HEAD:./<path>` is relative to `root` (the cwd), not the repository top level.\n const relPath = toPosix(path.relative(root, a.filePath));\n try {\n const headContent = execFileSync(\"git\", [\"show\", `HEAD:./${relPath}`], {\n cwd: root,\n encoding: \"utf-8\",\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n const headVersion = extractVersionFromContent(a.filePath, headContent);\n if (headVersion && headVersion === a.version) {\n logWarn(\n `${a.kind}:${a.name} (${assetLocation(a, root)}) — file changed but version not bumped (${a.version})`,\n );\n warnings++;\n }\n } catch {\n // New file (no HEAD version) — that's fine\n }\n }\n return warnings;\n}\n\n/**\n * Validate flow node skill-version pins against the discovered skill versions.\n *\n * Flows are read through `loadFlow`, which normalizes legacy v1 documents into\n * the strict v2 shape — reading the authored YAML directly would miss every v2\n * pin, since those ride in `run.assets` rather than `node.data.version`.\n */\nfunction checkFlowVersionPins(\n assets: AssetVersion[],\n root: string,\n): { errors: number; warnings: number } {\n const flows = assets.filter((a) => a.kind === \"flow\");\n const skillVersionMap = new Map<string, string>();\n for (const a of assets.filter((a) => a.kind === \"skill\")) {\n skillVersionMap.set(a.name, a.version);\n }\n\n let errors = 0;\n let warnings = 0;\n for (const f of flows) {\n let pins: FlowVersionNode[];\n try {\n pins = flowSkillVersionPins(loadFlow(f.filePath));\n } catch (err) {\n // An unreadable flow is a gap in the check, not an absence of findings.\n // Report the path, not `f.name`: that id comes from a raw-YAML read that\n // falls back to the filename stem exactly when the file is unusable.\n logWarn(\n `flow:${f.name} (${path.relative(root, f.filePath)}) — could not be read: ` +\n `${err instanceof Error ? err.message : err}`,\n );\n warnings++;\n continue;\n }\n\n if (pins.length === 0) continue;\n const checks = validateFlowVersions(pins, skillVersionMap);\n for (const c of checks.filter((c) => !c.satisfied)) {\n logErr(\n `flow:${f.name} node ${c.nodeId} — wants ${c.requested}, found ${c.actual || \"(none)\"}`,\n );\n errors++;\n }\n }\n return { errors, warnings };\n}\n\n/**\n * Root of a `validate versions` / `validate changelog` run: the explicit `[path]`, else the\n * library the shell is in (the nearest directory at or above the cwd that holds\n * `skaile.manifest.yaml`), else the cwd itself, as plain `validate` reads it. The bundled\n * factory assets are never a default (p1194). Returns `null` after printing an error when\n * the path does not exist, or when the root holds no library (see {@link isCheckableRoot}).\n */\nfunction resolveCheckRoot(pathArg: string | undefined): string | null {\n let root = process.cwd();\n if (pathArg) {\n root = path.resolve(pathArg);\n if (!fs.existsSync(root)) {\n logErr(`Path does not exist: ${root}`);\n return null;\n }\n } else {\n for (let dir = root; ; dir = path.dirname(dir)) {\n if (fs.existsSync(path.join(dir, SKAILE_MANIFEST_FILENAME))) {\n root = dir;\n break;\n }\n if (path.dirname(dir) === dir) break;\n }\n }\n if (!isCheckableRoot(root)) {\n logErr(\n `Nothing to check in ${root}: no ${SKAILE_MANIFEST_FILENAME} and no versioned asset (skill, agent, flow, prompt, contract or preset) found. Run it in a library or pass the library directory.`,\n );\n return null;\n }\n return root;\n}\n\n/** Whether `root` is a library: it holds a library manifest or at least one versioned asset. */\nfunction isCheckableRoot(root: string): boolean {\n return (\n fs.existsSync(path.join(root, SKAILE_MANIFEST_FILENAME)) ||\n collectAssetVersions(root).length > 0\n );\n}\n\n/** `true` when `root` lies inside a git work tree. */\nfunction isInGitWorkTree(root: string): boolean {\n try {\n return (\n execFileSync(\"git\", [\"rev-parse\", \"--is-inside-work-tree\"], {\n cwd: root,\n encoding: \"utf-8\",\n stdio: [\"ignore\", \"pipe\", \"ignore\"],\n }).trim() === \"true\"\n );\n } catch {\n return false;\n }\n}\n\n/** `true` when the git work tree at `root` has at least one commit (`HEAD` resolves). */\nfunction hasCommit(root: string): boolean {\n try {\n execFileSync(\"git\", [\"rev-parse\", \"--verify\", \"--quiet\", \"HEAD\"], {\n cwd: root,\n stdio: [\"ignore\", \"ignore\", \"ignore\"],\n });\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Run `git diff --name-only --relative <ref>` in `root` and return the changed paths\n * (relative to `root`), plus — with `untracked` — the new files git does not track yet.\n * No git work tree prints `<what> needs a git repository`; any other git failure — a bad\n * ref, no `git` — prints one `git diff failed in <root>: <first stderr line>` line. Both\n * return `null`; git's own usage text never reaches the terminal.\n *\n * @param what The command that needs git, for the message (`--changed-only`, `changelog`).\n */\nfunction changedFiles(\n root: string,\n ref: string,\n what: string,\n opts: { untracked?: boolean } = {},\n): string[] | null {\n if (!isInGitWorkTree(root)) {\n logErr(`${what} needs a git repository: ${root} is not inside a git work tree.`);\n return null;\n }\n if (ref === \"HEAD\" && !hasCommit(root)) {\n logErr(\n `${what} compares with the last commit, and ${root} has no commit yet. Commit the library first (\\`skaile library commit <name>\\`), then run it again.`,\n );\n return null;\n }\n try {\n const out = execFileSync(\n \"git\",\n [\"diff\", \"--name-only\", \"--relative\", \"--end-of-options\", ref],\n {\n cwd: root,\n encoding: \"utf-8\",\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n },\n );\n const changed = out.trim().split(\"\\n\").filter(Boolean);\n if (opts.untracked) {\n // New files git does not track yet (`--others` paths are relative to `root`).\n const fresh = execFileSync(\"git\", [\"ls-files\", \"--others\", \"--exclude-standard\"], {\n cwd: root,\n encoding: \"utf-8\",\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n changed.push(...fresh.trim().split(\"\\n\").filter(Boolean));\n }\n return changed;\n } catch (err) {\n const stderr = err instanceof Error && \"stderr\" in err ? String(err.stderr).trim() : \"\";\n const reason = (stderr || (err instanceof Error ? err.message : String(err))).split(\"\\n\")[0];\n logErr(`git diff failed in ${root}: ${reason}`);\n return null;\n }\n}\n\n/**\n * The directory whose files belong to `a`: the asset's own folder for a skill, agent, contract,\n * or a prompt/flow/preset that sits in a folder named after it — the folder `library create`\n * scaffolds. A single prompt/flow/preset file next to others is its own asset (`null`).\n */\nfunction assetOwnDir(a: AssetVersion): string | null {\n const dir = path.dirname(a.filePath);\n if ([\"skill\", \"agent\", \"contract\"].includes(a.kind) || path.basename(dir) === a.name) return dir;\n return null;\n}\n\n/**\n * `true` when `a` changed: its asset file, or any file under its folder that a deploy ships\n * (the lock hash covers them, minus the deploy ignore list), is among `changedAbs`.\n */\nfunction assetChanged(a: AssetVersion, changedAbs: ReadonlySet<string>): boolean {\n if (changedAbs.has(a.filePath)) return true;\n const dir = assetOwnDir(a);\n if (dir === null) return false;\n for (const f of changedAbs) {\n const rel = path.relative(dir, f);\n if (rel.startsWith(\"..\") || path.isAbsolute(rel)) continue;\n if (!isNonAssetPath(toPosix(rel))) return true;\n }\n return false;\n}\n\n/** Body of `skaile validate versions` — semver + bump + flow-pin checks. */\nfunction runVersionsCheck(\n pathArg: string | undefined,\n opts: { changedOnly?: boolean; strict?: boolean },\n): void {\n const root = resolveCheckRoot(pathArg);\n if (root === null) {\n process.exit(1);\n return;\n }\n let assets = collectAssetVersions(root);\n // A directory with no asset has nothing to check: `Checked 0 assets / All versions valid` would\n // read as a pass, so it fails as `validate` does for a path with no manifests (p1194).\n if (assets.length === 0) {\n logErr(\n `Nothing to check in ${root}: no versioned asset (skill, agent, flow, prompt, contract or preset) found. Pass the library directory.`,\n );\n process.exit(1);\n return;\n }\n\n // Filter to changed files only if requested\n if (opts.changedOnly) {\n const changed = changedFiles(root, \"HEAD\", \"--changed-only\", { untracked: true });\n if (changed === null) {\n process.exit(1);\n return;\n }\n const changedAbs = new Set(changed.map((f) => path.resolve(root, f)));\n assets = assets.filter((a) => assetChanged(a, changedAbs));\n }\n\n logInfo(`Checking versions in ${root}`);\n const versionCheck = checkAssetVersions(assets, root);\n let errors = versionCheck.errors;\n let warnings = versionCheck.warnings;\n\n // In --changed-only mode, check if version was actually bumped\n if (opts.changedOnly) {\n warnings += checkVersionBumps(assets, root);\n }\n\n const pinCheck = checkFlowVersionPins(assets, root);\n errors += pinCheck.errors;\n warnings += pinCheck.warnings;\n\n // Summary\n console.log();\n logInfo(`Checked ${assets.length} assets`);\n if (errors === 0 && warnings === 0) {\n logOk(\"All versions valid\");\n } else {\n if (errors > 0) logErr(`${errors} error(s)`);\n if (warnings > 0) logWarn(`${warnings} warning(s)`);\n }\n\n if (errors > 0 || (opts.strict && warnings > 0)) {\n process.exit(1);\n }\n}\n\n/**\n * Creates the `skaile validate` command group.\n *\n * Validates asset manifests, version fields, and changelogs in an asset\n * repository tree. Subcommands: default `validate [path]` (schema check),\n * `versions` (semver + flow pin validation), `changelog` (modified assets\n * must have an updated nearest-ancestor CHANGELOG.md).\n *\n * @returns Configured {@link Command} ready for `program.addCommand()`.\n * @docLink cli/commands/validate#make-validate-command\n */\nexport function makeValidateCommand(): Command {\n const cmd = new Command(\"validate\").description(\n \"Validate asset manifests, versions, and changelogs\",\n );\n\n // Default action: skaile validate [path]\n cmd\n .argument(\"[path]\", \"Path to asset repo or directory to validate\", \".\")\n .option(\n \"--strict-conformance\",\n \"Treat Agent Skills (agentskills.io) standard findings as errors\",\n )\n .action(async (targetPath: string, opts: { strictConformance?: boolean }) => {\n const absPath = path.resolve(targetPath);\n if (fs.existsSync(absPath) && !fs.statSync(absPath).isDirectory()) {\n logErr(`${absPath} is not a directory: nothing to validate. Pass the library directory.`);\n process.exit(1);\n return;\n }\n logInfo(`Validating manifests in ${absPath}`);\n const { total, errors, warnings } = validateManifests(\n absPath,\n opts.strictConformance ?? false,\n await registeredAssetKeys(libraryRootOf(absPath)),\n );\n const ws = await validateWorkspaceManifests(absPath);\n const rootErrors = validatePublishManifestRoots(absPath);\n const slugErrors = validatePublishManifestPublisherSlugs(absPath);\n const rootPathErrors = validatePublishManifestRootPaths(absPath);\n const parseErrors = validatePublishManifestParses(absPath);\n const requiresErrors = validatePublishManifestRequires(absPath);\n const unlistedErrors = await validatePublishManifestUnlisted(absPath);\n const versionWarnings = validatePublishManifestVersions(absPath);\n const publisherWarnings = validatePublishManifestPublishers(absPath);\n // Advisory and offline: a dependency no registered library holds may live in a\n // library that is not registered on this machine.\n const dependencyProblems = await unresolvedManifestDependencies(absPath);\n for (const w of dependencyProblems) logWarn(w);\n const dependencyWarnings = dependencyProblems.length;\n const totalErrors =\n errors +\n ws.errors +\n rootErrors +\n slugErrors +\n rootPathErrors +\n parseErrors +\n requiresErrors +\n unlistedErrors;\n console.log();\n warnIgnoredDomainFiles(absPath);\n warnLegacyBundleFiles(absPath);\n logInfo(`Scanned ${total} asset manifest(s) and ${ws.total} skaile.yaml file(s)`);\n // Nothing scanned and no library manifest: a directory with nothing in it is not valid,\n // it is not validated (p745).\n if (\n total === 0 &&\n ws.total === 0 &&\n totalErrors === 0 &&\n !fs.existsSync(path.join(absPath, SKAILE_MANIFEST_FILENAME))\n ) {\n logErr(\n `Nothing to validate in ${absPath}: no asset manifest, skaile.yaml or ${SKAILE_MANIFEST_FILENAME} found.`,\n );\n process.exit(1);\n return;\n }\n const totalWarnings = warnings + versionWarnings + publisherWarnings + dependencyWarnings;\n if (totalWarnings > 0) logWarn(`${totalWarnings} warning(s)`);\n if (totalErrors === 0) {\n logOk(\"All manifests valid\");\n } else {\n logErr(`${totalErrors} validation error(s)`);\n process.exit(1);\n }\n });\n\n cmd\n .command(\"versions\")\n .description(\"Check version fields and flow version pins\")\n .argument(\"[path]\", \"Library or asset directory (default: the current library)\")\n .option(\"--changed-only\", \"Only check assets modified since last commit\")\n .option(\"--strict\", \"Exit 1 on warnings (for CI)\")\n .addOption(removedDomainOption())\n .action(\n (\n pathArg: string | undefined,\n opts: { changedOnly?: boolean; strict?: boolean; domain?: string },\n ) => {\n rejectRemovedDomainOption(opts);\n runVersionsCheck(pathArg, opts);\n },\n );\n\n cmd\n .command(\"changelog\")\n .description(\"Check that modified assets have an updated nearest CHANGELOG.md\")\n .argument(\"[path]\", \"Library or asset directory (default: the current library)\")\n .option(\"--base <ref>\", \"Git base ref for diff\", \"HEAD\")\n .action((pathArg: string | undefined, opts: { base: string }) => {\n const root = resolveCheckRoot(pathArg);\n if (root === null) {\n process.exit(1);\n return;\n }\n const modifiedFiles = changedFiles(root, opts.base, \"changelog\");\n if (modifiedFiles === null) {\n process.exit(1);\n return;\n }\n const { updated, stale, orphans } = checkChangelogUnits(modifiedFiles, root);\n\n if (updated.length + stale.length + orphans.length === 0) {\n logOk(\"No modified assets found\");\n return;\n }\n\n for (const unit of updated) logOk(`${unit} updated`);\n for (const unit of stale) logErr(`${unit} not updated (assets were modified)`);\n for (const asset of orphans) {\n logErr(`${asset} — no CHANGELOG.md in any ancestor directory up to the asset root`);\n }\n\n if (stale.length + orphans.length > 0) process.exit(1);\n });\n\n return cmd;\n}\n"]}
1
+ {"version":3,"sources":["../cli/src/commands/validate.ts"],"names":["parseYaml","parsed","a","c"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmFA,IAAM,+BAAoC,IAAI,GAAA,CAAI,CAAC,SAAA,EAAW,QAAA,EAAU,MAAM,CAAC,CAAA;AAE/E,IAAM,SAAA,uBAAgB,GAAA,CAAI;AAAA,EACxB,cAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,aAAA;AAAA,EACA,GAAG;AACL,CAAC,CAAA;AAQD,SAAS,uBAAuB,QAAA,EAAuC;AACrE,EAAA,MAAM,aAAkC,EAAC;AAEzC,EAAA,SAAS,KAAK,GAAA,EAAmB;AAC/B,IAAA,IAAI,OAAA;AACJ,IAAA,IAAI;AACF,MAAA,OAAA,GAAU,GAAG,WAAA,CAAY,GAAA,EAAK,EAAE,aAAA,EAAe,MAAM,CAAA;AAAA,IACvD,CAAA,CAAA,MAAQ;AACN,MAAA;AAAA,IACF;AACA,IAAA,KAAA,MAAW,SAAS,OAAA,EAAS;AAC3B,MAAA,MAAM,QAAA,GAAW,IAAA,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,MAAW,IAAA,IAAQ,KAAA,EAAO,MAAA,CAAO,CAAA,EAAG,IAAI,CAAA,mCAAA,CAAqC,CAAA;AAC7E,IAAA,KAAA,MAAW,SAAS,OAAA,EAAS;AAC3B,MAAA,MAAA,CAAO,CAAA,EAAG,KAAK,CAAA,sEAAA,CAAmE,CAAA;AAAA,IACpF;AAEA,IAAA,IAAI,MAAM,MAAA,GAAS,OAAA,CAAQ,SAAS,CAAA,EAAG,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA,EACvD,CAAC,CAAA;AAEH,EAAA,OAAO,GAAA;AACT","file":"chunk-P7EL7QRD.js","sourcesContent":["/**\n * Validate asset versions, changelogs, and manifest schemas across asset repos.\n */\n\nimport { execFileSync } from \"node:child_process\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport {\n ASSET_NAME_HINT,\n type ConnectorDeclaration,\n decodeSkaileYaml,\n isInsideProject,\n symlinkEscapeOfProject,\n isValidAssetName,\n isValidPublisher,\n loadSkPublishManifest,\n localConnectorMountDir,\n parseAssetRef,\n resolveRuntimeAssets,\n SKAILE_MANIFEST_FILENAME,\n readAssetBody,\n} from \"@skaile/workspaces/core\";\nimport {\n flowSkillVersionPins,\n loadFlow,\n} from \"@skaile/workspaces/factory-assets/connectors/flow/engine\";\nimport { parseManifestFile } from \"@skaile/workspaces/discovery\";\nimport { withYamlQuotingHint } from \"@skaile/workspaces/core/manifest\";\nimport { isNonAssetPath } from \"@skaile/workspaces/core/publish-manifest\";\nimport {\n assertManifestEditable,\n missingRootAssets,\n scanUnlistedAssets,\n UNLISTED_SCAN_SKIP_DIRS,\n} from \"@skaile/workspaces/library\";\nimport type { IAssetKindRegistry } from \"@skaile/workspaces/plugins\";\nimport type { FlowVersionNode } from \"@skaile/workspaces/resolver\";\nimport { validateFlowVersions } from \"@skaile/workspaces/resolver\";\nimport { Command } from \"commander\";\nimport { parse as parseYaml } from \"yaml\";\nimport { type ComposeRefContext, composeRefContext } from \"../agent-checks.ts\";\nimport { unknownHarnessErrors, unknownKeyWarnings } from \"../config-checks.ts\";\nimport { logErr, logInfo, logOk, logWarn } from \"../helpers.ts\";\nimport { getKindRegistry } from \"../open-registry.ts\";\nimport {\n checkAsset,\n checkAssetFile,\n declaredVersion,\n findEntryManifestFile,\n invalidSemverText,\n MANIFEST_GLOBS,\n manifestParseErrorText,\n} from \"../skill-checks.ts\";\nimport {\n manifestEntryNameProblems,\n invalidPublisherMessage,\n manifestFilesProblems,\n manifestPublisherProblems,\n manifestRootProblems,\n manifestRequiresProblems,\n registeredAssetKeys,\n rejectRemovedDomainOption,\n removedDomainOption,\n reportLibrarySymlinks,\n unresolvedManifestDependencies,\n warnIgnoredDomainFiles,\n warnLegacyBundleFiles,\n} from \"./library-index.ts\";\nimport { assetEntryRef, manifestVersionMismatchMessage } from \"./publish-core.ts\";\nimport { checkAgentInstances } from \"./validate-instances.ts\";\n\n// ---------------------------------------------------------------------------\n// Manifest schema validation (skaile validate [path])\n// ---------------------------------------------------------------------------\n\n// The manifest file patterns live in skill-checks.ts (`MANIFEST_GLOBS`): `library index` names\n// the kind of a file it cannot parse with the same table.\n\n/**\n * `.claude`, `.codex` and `.omp` hold the copies `skaile add` deploys for the harnesses (and\n * the harness's own state): a project `validate .` checks what the author owns, not the\n * deployed bytes of an asset published elsewhere (p853).\n */\nconst HARNESS_DIRS: ReadonlySet<string> = new Set([\".claude\", \".codex\", \".omp\"]);\n/** Directories to skip during tree walk. */\nconst SKIP_DIRS = new Set([\n \"node_modules\",\n \"dist\",\n \".git\",\n \".skaile\",\n \"__pycache__\",\n ...HARNESS_DIRS,\n]);\n\ninterface ManifestCandidate {\n filePath: string;\n kind: string;\n}\n\n/** Recursively walk a directory tree and find manifest candidates. */\nfunction findManifestCandidates(rootPath: string): ManifestCandidate[] {\n const candidates: ManifestCandidate[] = [];\n\n function walk(dir: string): void {\n let entries: fs.Dirent[];\n try {\n entries = fs.readdirSync(dir, { withFileTypes: true });\n } catch {\n return;\n }\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name);\n if (entry.isDirectory()) {\n if (!SKIP_DIRS.has(entry.name)) walk(fullPath);\n } else if (entry.isFile()) {\n for (const glob of MANIFEST_GLOBS) {\n if (glob.pattern.test(fullPath)) {\n candidates.push({ filePath: fullPath, kind: glob.kind });\n break;\n }\n }\n }\n }\n }\n\n walk(rootPath);\n return candidates;\n}\n\n/**\n * Parse a single manifest candidate's bytes with the indexer's own parser\n * (`parseManifestFile`), so a manifest `library index` cannot parse — an empty\n * `SKILL.md`, no frontmatter, invalid YAML — is an error here too. On failure\n * the error is already logged; count it.\n */\nfunction parseManifestCandidate(\n c: ManifestCandidate,\n absRoot: string,\n): { kind: \"value\"; parsed: unknown; body?: string } | { kind: \"error\" } {\n const content = fs.readFileSync(c.filePath, \"utf-8\");\n const res = parseManifestFile(c.filePath, content);\n if (!res.ok) {\n logErr(\n `${path.relative(absRoot, c.filePath)} [${c.kind}] — ${manifestParseErrorText(res.reason)}`,\n );\n return { kind: \"error\" };\n }\n return {\n kind: \"value\",\n parsed: res.data,\n body: readAssetBody(c.filePath, content),\n };\n}\n\n/**\n * The library root a validated path belongs to: the nearest directory at or above `absRoot`\n * that holds a `skaile.yaml`, else `absRoot` itself.\n */\nfunction libraryRootOf(absRoot: string): string {\n for (let dir = absRoot; ; dir = path.dirname(dir)) {\n if (fs.existsSync(path.join(dir, SKAILE_MANIFEST_FILENAME))) return dir;\n if (path.dirname(dir) === dir) return absRoot;\n }\n}\n\n/**\n * Validate a single parsed manifest candidate against identity rules + the kind\n * registry. Returns the error/warning deltas this candidate contributes.\n */\nfunction validateManifestCandidate(\n c: ManifestCandidate,\n parsed: unknown,\n body: string | undefined,\n absRoot: string,\n registry: IAssetKindRegistry,\n strictConformance: boolean,\n composeRefs: ComposeRefContext,\n): { errors: number; warnings: number } {\n const relPath = path.relative(absRoot, c.filePath);\n let errors = 0;\n let warnings = 0;\n\n // The shared per-asset checks (also run by `library index` and the publish plan):\n // errors fail validate; advisories are warnings (exit code unchanged) unless\n // --strict-conformance escalates the agentskills.io conformance ones to errors.\n const dirName = path.basename(path.dirname(c.filePath)); // the manifest's folder\n const checked = checkAsset(\n c.kind,\n (parsed ?? {}) as Record<string, unknown>,\n body,\n dirName,\n registry,\n fs.readFileSync(c.filePath, \"utf-8\"),\n path.basename(c.filePath),\n { dir: path.dirname(c.filePath), libraryRoot: libraryRootOf(absRoot), composeRefs },\n );\n for (const f of checked.errors) {\n logErr(`${relPath} [${f.tag}] — ${f.text}`);\n errors++;\n }\n for (const f of checked.advisories) {\n const line = `${relPath} [${f.tag}] — ${f.text}`;\n // An untouched scaffold body is an error: a passing `validate` means the asset can be published.\n if ((f.conformance && strictConformance) || f.scaffoldBody) {\n logErr(line);\n errors++;\n } else {\n logWarn(line);\n warnings++;\n }\n }\n\n return { errors, warnings };\n}\n\n/**\n * The `kind:name` identity of every asset manifest under `root`, read quietly: a manifest\n * that does not parse holds no identity (its own validation reports the error).\n */\nexport function scanIdentities(root: string): Set<string> {\n const identities = new Set<string>();\n for (const c of findManifestCandidates(root)) {\n let parsed: unknown;\n try {\n const res = parseManifestFile(c.filePath, fs.readFileSync(c.filePath, \"utf-8\"));\n if (!res.ok) continue;\n parsed = res.data;\n } catch {\n continue;\n }\n if (parsed === null || typeof parsed !== \"object\") continue;\n const identity = (parsed as Record<string, unknown>)[c.kind === \"flow\" ? \"id\" : \"name\"];\n if (typeof identity === \"string\" && identity.length > 0)\n identities.add(`${c.kind}:${identity}`);\n }\n return identities;\n}\n\n/** Validate all manifest files in a directory tree using the kind registry. */\nexport function validateManifests(\n rootPath: string,\n strictConformance: boolean,\n registeredAssets: ReadonlySet<string> = new Set(),\n): { total: number; errors: number; warnings: number } {\n const absRoot = path.resolve(rootPath);\n if (!fs.existsSync(absRoot)) {\n logErr(`Path does not exist: ${absRoot}`);\n return { total: 0, errors: 1, warnings: 0 };\n }\n\n const registry: IAssetKindRegistry = getKindRegistry();\n const candidates = findManifestCandidates(absRoot);\n // Symlinks are refused with the text `library index` and the publish plan print (p520). In a\n // library (a `skaile.manifest.yaml` at the root) any symlink is refused, as `git add -A`\n // would publish it; elsewhere (a project) only those inside an asset folder or aliasing one.\n // A link elsewhere in a project is not refused: the connector real-path check judges a\n // `mountPath` link (p1332).\n const isLibrary = fs.existsSync(path.join(absRoot, SKAILE_MANIFEST_FILENAME));\n // A project's deployed harness folders (`add --link` makes `.claude/skills/x` a link to the\n // project's own `skills/x`) are not sources: they are skipped here as in the manifest walk.\n let errors = reportLibrarySymlinks(absRoot, {\n wholeTree: isLibrary,\n skipDirs: isLibrary ? undefined : HARNESS_DIRS,\n });\n let warnings = 0;\n\n // kind:name → directory of the first manifest seen; a second directory with the same\n // identity cannot be told apart by `add`/`publish` (and `library index` skips it).\n const seenIdentity = new Map<string, string>();\n // `composes:` refs resolve against the assets of the whole library (the scanned tree plus,\n // when `validate` got a sub-directory, its siblings under the enclosing library root) and the\n // registered libraries of its publisher: a ref no library holds fails `skaile add` (p415).\n const libraryRoot = libraryRootOf(absRoot);\n const composeRefs = composeRefContext(\n scanIdentities(libraryRoot),\n registeredAssets,\n loadSkPublishManifest(libraryRoot)?.publisher,\n );\n for (const c of candidates) {\n const parseResult = parseManifestCandidate(c, absRoot);\n if (parseResult.kind === \"error\") {\n errors++;\n continue;\n }\n\n const delta = validateManifestCandidate(\n c,\n parseResult.parsed,\n parseResult.body,\n absRoot,\n registry,\n strictConformance,\n composeRefs,\n );\n errors += delta.errors;\n warnings += delta.warnings;\n const obj = parseResult.parsed as Record<string, unknown> | null;\n const identity = obj && typeof obj === \"object\" ? obj[c.kind === \"flow\" ? \"id\" : \"name\"] : null;\n if (typeof identity === \"string\" && identity.length > 0) {\n const dir = path.dirname(c.filePath);\n const key = `${c.kind}:${identity}`;\n const first = seenIdentity.get(key);\n if (first === undefined) {\n seenIdentity.set(key, dir);\n } else if (first !== dir) {\n logErr(\n `${path.relative(absRoot, c.filePath)} [${c.kind}] — ${key} is also defined in ${path.relative(absRoot, first) || \".\"}; ` +\n \"two directories cannot share a kind and name (`skaile library index` keeps only the first).\",\n );\n errors++;\n }\n }\n }\n\n return { total: candidates.length, errors, warnings };\n}\n\n/** Recursively find every `skaile.yaml` / `*.skaile.yaml` workspace manifest. */\nfunction findWorkspaceManifests(rootPath: string): string[] {\n const out: string[] = [];\n function walk(dir: string): void {\n let entries: fs.Dirent[];\n try {\n entries = fs.readdirSync(dir, { withFileTypes: true });\n } catch {\n return;\n }\n for (const entry of entries) {\n const full = path.join(dir, entry.name);\n if (entry.isDirectory()) {\n if (!SKIP_DIRS.has(entry.name)) walk(full);\n } else if (entry.isFile() && /(^|\\.)skaile\\.yaml$/.test(entry.name)) {\n out.push(full);\n }\n }\n }\n walk(rootPath);\n return out;\n}\n\n/**\n * Validate the dependency refs and asset identities declared in every\n * `skaile.yaml` under a tree. This is the manifest-level mirror of the\n * per-file identity check: it parses each `dependencies[]` /\n * `overrides[].ref` through `parseAssetRef` (the exact code path that produced\n * the original \"publisher required …\" / \"invalid asset name …\" hard error) and\n * checks each `assets[].name` against the canonical name grammar.\n */\n/**\n * Collect every `[field, ref]` pair to validate from a workspace manifest:\n * each string in `dependencies[]` and each `overrides[].ref`.\n */\nfunction collectWorkspaceRefFields(parsed: Record<string, unknown>): Array<[string, string]> {\n const refFields: Array<[string, string]> = [];\n if (Array.isArray(parsed.dependencies)) {\n for (const d of parsed.dependencies) {\n if (typeof d === \"string\") refFields.push([\"dependencies\", d]);\n }\n }\n if (Array.isArray(parsed.overrides)) {\n for (const o of parsed.overrides) {\n const ref = (o as Record<string, unknown>)?.ref;\n if (typeof ref === \"string\") refFields.push([\"overrides.ref\", ref]);\n }\n }\n return refFields;\n}\n\n/** Parse each declared ref through `parseAssetRef`; returns the error count. */\nfunction validateWorkspaceRefs(refFields: Array<[string, string]>, relPath: string): number {\n let errors = 0;\n for (const [field, ref] of refFields) {\n try {\n const parsedRef = parseAssetRef(ref);\n // The library-side slug rule (`library index`, the publish plan) holds for a project's\n // `dependencies:` too: `add` cannot resolve such a ref, so `check` fails on it (p1080).\n const publisher = parsedRef.publisher?.replace(/^@/, \"\");\n if (publisher !== undefined && !isValidPublisher(publisher)) {\n logErr(`${relPath} [${field}] — ${ref}: ${invalidPublisherMessage(publisher)}`);\n errors++;\n }\n } catch (e) {\n logErr(`${relPath} [${field}] — ${e instanceof Error ? e.message : String(e)}`);\n errors++;\n }\n }\n return errors;\n}\n\n/** Validate `assets[].name` against the canonical name/ref grammar. */\nfunction validateWorkspaceAssets(parsed: Record<string, unknown>, relPath: string): number {\n if (!Array.isArray(parsed.assets)) return 0;\n let errors = 0;\n const topPublisher = typeof parsed.publisher === \"string\" ? parsed.publisher : undefined;\n for (const a of parsed.assets) {\n const asset = a as Record<string, unknown>;\n const name = asset?.name;\n const kind = typeof asset?.kind === \"string\" ? asset.kind : \"skill\";\n if (typeof name !== \"string\" || name.length === 0) continue;\n const publisher = typeof asset?.publisher === \"string\" ? asset.publisher : topPublisher;\n if (publisher !== undefined) {\n try {\n parseAssetRef(`${kind}:@${publisher}/${name}`);\n } catch (e) {\n logErr(`${relPath} [assets] — ${e instanceof Error ? e.message : String(e)}`);\n errors++;\n }\n } else if (!isValidAssetName(name)) {\n logErr(`${relPath} [assets] — invalid asset name \"${name}\" — ${ASSET_NAME_HINT}`);\n errors++;\n }\n }\n return errors;\n}\n\n/** `skaile.yaml` connector diagnostics that fail `validate` (the runner cannot mount it right). */\nconst CONNECTOR_ERROR_CODES: readonly string[] = [\n \"connector_missing_driver\",\n \"connector_missing_id\",\n \"connector_duplicate_id\",\n \"connector_invalid_access\",\n];\n\n/**\n * A `local` connector's `mountPath` is mounted read-write as given: one that does not exist\n * fails (`serve` refuses it too), one outside the project is a warning, one that reaches outside\n * through a symlink fails (p833).\n */\nfunction validateLocalConnectorMountPaths(\n projectDir: string,\n relPath: string,\n connectors: ReadonlyArray<ConnectorDeclaration>,\n): number {\n let errors = 0;\n for (const c of connectors) {\n if (c.driver !== \"local\" || c.mount) continue;\n const dir = localConnectorMountDir(c, projectDir);\n if (!dir) continue;\n const escapesTo = symlinkEscapeOfProject(dir, projectDir);\n if (!fs.existsSync(dir)) {\n logErr(\n `${relPath} [connectors] — connector_mount_path_missing: connectors.${c.id}.mountPath: ${dir} does not exist; create the directory or fix the path`,\n );\n errors++;\n } else if (escapesTo !== null) {\n logErr(\n `${relPath} [connectors] — connector_mount_path_symlink: connectors.${c.id}.mountPath: ${dir} is a symlink to ${escapesTo}, outside the project ${projectDir}; point mountPath at the real directory`,\n );\n errors++;\n } else if (!isInsideProject(dir, projectDir)) {\n logWarn(\n `${relPath} [connectors] — connectors.${c.id}.mountPath: ${dir} is outside the project ${projectDir}; the agent reads${c.access === \"read-write\" ? \" and writes\" : \"\"} there`,\n );\n }\n }\n return errors;\n}\n\nasync function validateWorkspaceManifests(rootPath: string): Promise<{\n total: number;\n errors: number;\n}> {\n const absRoot = path.resolve(rootPath);\n const files = findWorkspaceManifests(absRoot);\n let errors = 0;\n\n for (const file of files) {\n const relPath = path.relative(absRoot, file);\n let parsed: Record<string, unknown>;\n let text = \"\";\n try {\n text = fs.readFileSync(file, \"utf-8\");\n parsed = (parseYaml(text) ?? {}) as Record<string, unknown>;\n } catch (e) {\n const message = e instanceof Error ? e.message : String(e);\n logErr(`${relPath} — parse error: ${withYamlQuotingHint(message, text)}`);\n errors++;\n continue;\n }\n // A root that is no mapping, or a `dependencies:`/`sources:` of the wrong shape, is one\n // parse-error line, as `check` prints it (p1421, p1620).\n const unreadable = decodeSkaileYaml(text).diagnostics.find(\n (d) => d.code === \"non_object_root\" || d.code === \"invalid_value_shape\",\n );\n if (unreadable) {\n logErr(`${relPath} — parse error: ${unreadable.message}`);\n errors++;\n continue;\n }\n\n errors += validateWorkspaceRefs(collectWorkspaceRefFields(parsed), relPath);\n errors += validateWorkspaceAssets(parsed, relPath);\n for (const d of checkAgentInstances(path.dirname(file), parsed)) {\n const line = `${relPath} [agents] — ${d.code}: ${d.path ? `${d.path}: ` : \"\"}${d.message}`;\n if (d.severity === \"error\") {\n logErr(line);\n errors++;\n } else {\n logWarn(line);\n }\n }\n // A connector the runner cannot mount or mounts wrongly: no `driver` (or the old `adapter`\n // spelling), no `id`, a duplicate `id`, an `access` that is neither read-only nor read-write.\n const decoded = decodeSkaileYaml(fs.readFileSync(file, \"utf-8\"));\n for (const d of decoded.diagnostics) {\n if (!CONNECTOR_ERROR_CODES.includes(d.code)) continue;\n logErr(`${relPath} [connectors] — ${d.code}: ${d.path ? `${d.path}: ` : \"\"}${d.message}`);\n errors++;\n }\n // A key skaile.yaml no longer accepts (a legacy `provider:`): every command that reads the\n // file stops on it, so `validate` must not call the file valid (p1352).\n for (const d of decoded.diagnostics) {\n if (d.code !== \"legacy_key_rejected\") continue;\n logErr(relPath === \"skaile.yaml\" ? d.message : `${relPath} — ${d.message}`);\n errors++;\n }\n // The 5.x `driver` key of an agent-config profile: still read as `harness` until 7.0\n // (warning); setting both keys is an error.\n for (const d of decoded.diagnostics) {\n if (d.code !== \"deprecated_harness_key\" && d.code !== \"harness_key_conflict\") continue;\n const line = `${relPath} [agent-config] — ${d.code}: ${d.message}`;\n if (d.severity === \"error\") {\n logErr(line);\n errors++;\n } else {\n logWarn(line);\n }\n }\n // A mistyped key warns (p1474); a `harness:` no harness registers, plugins included, fails (p1022).\n for (const line of unknownKeyWarnings(decoded.diagnostics, relPath)) logWarn(line);\n for (const line of await unknownHarnessErrors(path.dirname(file), decoded.config, relPath)) {\n logErr(line);\n errors++;\n }\n errors += validateLocalConnectorMountPaths(\n path.dirname(file),\n relPath,\n decoded.config?.connectors ?? [],\n );\n // A `driver` no catalog entry provides: `serve` cannot mount it either. The text is the one\n // `serve` logs as `validation_warning`. An unreachable source (not cloned yet) may hold the\n // driver, so nothing is reported while one is missing.\n if ((decoded.config?.connectors ?? []).length > 0) {\n const assets = await resolveRuntimeAssets(path.dirname(file));\n if (!assets.warnings.some((w) => w.code === \"repo_unavailable\")) {\n for (const w of assets.warnings) {\n if (w.code !== \"missing_driver\" || !w.name) continue;\n logErr(`${relPath} [connectors] — ${w.code}: ${w.message}`);\n errors++;\n }\n }\n }\n }\n\n return { total: files.length, errors };\n}\n\n/**\n * Check the library's publication manifest (`skaile.manifest.yaml` at the\n * validated root): every first-party `root:` must still exist. An entry whose\n * directory was deleted would otherwise stay publishable; the fix is\n * `skaile library index <lib>`, which drops it.\n */\nfunction validatePublishManifestRoots(rootPath: string): number {\n const absRoot = path.resolve(rootPath);\n const manifest = loadSkPublishManifest(absRoot);\n if (!manifest) return 0;\n const missing = missingRootAssets(absRoot, manifest);\n for (const a of missing) {\n logErr(\n `${SKAILE_MANIFEST_FILENAME} [assets] — ${assetEntryRef(a, manifest)}: root \"${a.root}\" does not exist. ` +\n \"Run `skaile library index <library>` to drop the entry, or restore the directory.\",\n );\n }\n return missing.length;\n}\n\n/**\n * An asset directory the library's manifest does not list is an error: `add` refuses it (`not\n * listed in its skaile.manifest.yaml`), the publish plan does not ship it, yet `git add -A`\n * commits its files. The fix is `skaile library index <lib>`, which lists it (p1193). A directory\n * that holds a kind + name the manifest already names elsewhere is the duplicate check's finding.\n * An asset that already fails its own check is not listed here: `library index` refuses it, so\n * \"run `library index`\" would send the author round in a circle; the check line names the real\n * fix (p871).\n */\nasync function validatePublishManifestUnlisted(rootPath: string): Promise<number> {\n const absRoot = path.resolve(rootPath);\n const manifest = loadSkPublishManifest(absRoot);\n if (!manifest) return 0;\n const registry = getKindRegistry();\n const libraryRoot = libraryRootOf(absRoot);\n const composeRefs = composeRefContext(\n scanIdentities(libraryRoot),\n await registeredAssetKeys(libraryRoot),\n manifest.publisher,\n );\n const unlisted = (\n await scanUnlistedAssets(\n absRoot,\n manifest.publisher ?? path.basename(absRoot),\n registry,\n UNLISTED_SCAN_SKIP_DIRS,\n )\n ).filter(\n (u) =>\n !u.registeredAt &&\n !u.parseFailure && // a file that does not parse has its own parse error\n checkAssetFile(u.entry.source, u.entry.kind, registry, absRoot, composeRefs).length === 0,\n );\n for (const u of unlisted) {\n logErr(\n `${path.relative(absRoot, u.entry.source)} [${u.entry.kind}] — ${u.entry.kind}:${u.entry.name} is on disk but not in ${SKAILE_MANIFEST_FILENAME}, so it is not published. ` +\n \"Run `skaile library index <library>` to list it, or delete the directory.\",\n );\n }\n return unlisted.length;\n}\n\n/**\n * Check every `assets[].dependencies` entry of the publication manifest with the\n * same syntax rule (and message) `library index` applies, so a malformed ref\n * fails `validate` instead of being silently dropped by the manifest decoder.\n */\nfunction validatePublishManifestRequires(rootPath: string): number {\n const problems = manifestRequiresProblems(path.resolve(rootPath));\n for (const p of problems) {\n logErr(\n `${SKAILE_MANIFEST_FILENAME} [assets] — ${p.asset}: ${p.message}. ` +\n \"Use the `kind:@<publisher>/name[#version]` form.\",\n );\n }\n return problems.length;\n}\n\n/**\n * Check the publisher of the publication manifest (top-level and every\n * `assets[].publisher`) against the one publisher slug rule `library create`, `library\n * index` and the publish plan apply, with the same message.\n */\nfunction validatePublishManifestPublisherSlugs(rootPath: string): number {\n const problems = manifestPublisherProblems(path.resolve(rootPath));\n for (const message of problems) logErr(message);\n return problems.length;\n}\n\n/**\n * Check every first-party `assets[].root` and `files:` entry of the publication manifest stays\n * inside the library and crosses no symlink ({@link manifestRootProblems},\n * {@link manifestFilesProblems}), the refusal `library index` and the publish plan print too: a\n * path outside the library is never found by `add` (p701, p1403), a missing file is no asset (p1404).\n */\nfunction validatePublishManifestRootPaths(rootPath: string): number {\n const problems = [\n ...manifestRootProblems(path.resolve(rootPath)),\n ...manifestFilesProblems(path.resolve(rootPath)),\n ...manifestEntryNameProblems(path.resolve(rootPath)),\n ];\n for (const message of problems) logErr(message);\n return problems.length;\n}\n\n/**\n * Parse the publication manifest the way `library index` and `library publish` open it, so a\n * `skaile.manifest.yaml` that does not parse fails `validate` too, with the file and line.\n * Without the file there is nothing to check.\n */\nfunction validatePublishManifestParses(rootPath: string): number {\n try {\n assertManifestEditable(path.resolve(rootPath));\n return 0;\n } catch (err) {\n logErr(err instanceof Error ? err.message : String(err));\n return 1;\n }\n}\n\n/**\n * Warn when a first-party `assets[].version` of the publication manifest differs\n * from the version in the asset's own manifest file. The file is the source of\n * truth — `skaile library index` rewrites the entry from it — so a hand-edited\n * manifest version is silently overwritten by the next index. Returns the warning count.\n */\nfunction validatePublishManifestVersions(rootPath: string): number {\n const absRoot = path.resolve(rootPath);\n const manifest = loadSkPublishManifest(absRoot);\n if (!manifest || manifest.source) return 0;\n let warnings = 0;\n for (const a of manifest.assets ?? []) {\n if (a.source || !a.version) continue;\n const file = findEntryManifestFile(absRoot, a);\n if (!file) continue;\n const res = parseManifestFile(file, fs.readFileSync(file, \"utf-8\"));\n if (!res.ok) continue; // reported by the per-file parse check\n const fileVersion = declaredVersion(res.data);\n if (fileVersion === undefined || fileVersion === a.version) continue;\n logWarn(\n manifestVersionMismatchMessage(\n assetEntryRef(a, manifest),\n a.version,\n toPosix(path.relative(absRoot, file)),\n fileVersion,\n ),\n );\n warnings++;\n }\n return warnings;\n}\n\n/**\n * Warn when a first-party asset file still carries a `metadata.publisher` that\n * differs from the publisher the manifest resolves for it (`assets[].publisher`,\n * else the top-level `publisher`). The manifest is the only source of an\n * asset's publisher; the file value is ignored by every resolver, so a stale\n * one only misleads the reader. Returns the warning count.\n */\nfunction validatePublishManifestPublishers(rootPath: string): number {\n const absRoot = path.resolve(rootPath);\n const manifest = loadSkPublishManifest(absRoot);\n if (!manifest || manifest.source) return 0;\n const bare = (p: string) => p.trim().replace(/^@/, \"\");\n let warnings = 0;\n for (const a of manifest.assets ?? []) {\n const resolved = a.publisher ?? manifest.publisher;\n if (a.source || !resolved) continue;\n const file = findEntryManifestFile(absRoot, a);\n if (!file) continue;\n const res = parseManifestFile(file, fs.readFileSync(file, \"utf-8\"));\n if (!res.ok) continue; // reported by the per-file parse check\n const meta = (res.data as Record<string, unknown>).metadata;\n const declared =\n meta !== null && typeof meta === \"object\"\n ? (meta as Record<string, unknown>).publisher\n : null;\n if (typeof declared !== \"string\" || bare(declared) === bare(resolved)) continue;\n logWarn(\n `${toPosix(path.relative(absRoot, file))} [publisher] — metadata.publisher \"${bare(declared)}\" differs from ` +\n `the manifest publisher \"${bare(resolved)}\" for ${assetEntryRef(a, manifest)}. The manifest wins and the ` +\n \"file value is ignored: delete `metadata.publisher` from the file, or set the publisher in \" +\n `${SKAILE_MANIFEST_FILENAME}.`,\n );\n warnings++;\n }\n return warnings;\n}\n\n/** Root-relative path prefixes excluded from version/changelog checks. */\nconst EXCLUDED_PATHS = [\"skaileup-shared/\", \"external/\", \"docs/\"];\n\n/** Normalise to forward slashes so prefix and set comparisons work on any OS. */\nfunction toPosix(p: string): string {\n return p.split(path.sep).join(\"/\");\n}\n\n/** True when a root-relative path sits under one of {@link EXCLUDED_PATHS}. */\nfunction isExcludedPath(relPath: string): boolean {\n const rel = toPosix(relPath);\n return EXCLUDED_PATHS.some((prefix) => rel.startsWith(prefix));\n}\n\ninterface AssetVersion {\n kind: \"skill\" | \"agent\" | \"flow\" | \"prompt\" | \"preset\" | \"contract\";\n name: string;\n version: string;\n filePath: string;\n}\n\n/** Manifest candidates whose kind carries a version `validate versions` checks. */\nconst VERSIONED_KINDS: Record<string, true> = {\n skill: true,\n agent: true,\n flow: true,\n prompt: true,\n preset: true,\n contract: true,\n};\n\n/** Read one manifest candidate's identity and version; unreadable YAML yields an empty version. */\nfunction readAssetVersion(c: ManifestCandidate): AssetVersion {\n const kind = c.kind as AssetVersion[\"kind\"];\n const fileName = path.basename(c.filePath);\n const dirName = path.basename(path.dirname(c.filePath));\n const content = fs.readFileSync(c.filePath, \"utf-8\");\n if (c.filePath.endsWith(\".md\")) {\n // The version `library index` records (top-level `version`, else `metadata.version`).\n const res = parseManifestFile(c.filePath, content);\n const data = res.ok ? (res.data as Record<string, unknown>) : {};\n const stem = fileName.replace(/\\.prompt\\.md$/, \"\");\n return {\n kind,\n name: typeof data.name === \"string\" ? data.name : kind === \"prompt\" ? stem : dirName,\n version: declaredVersion(data) ?? \"\",\n filePath: c.filePath,\n };\n }\n let parsed: Record<string, unknown> | null = null;\n try {\n parsed = parseYaml(content);\n } catch {\n // Reported by the default `skaile validate`; here the asset just has no readable version.\n }\n if (kind === \"flow\") {\n return {\n kind,\n name: String(parsed?.id ?? fileName.replace(\".flow.yaml\", \"\")),\n version: String(parsed?.version ?? \"\"),\n filePath: c.filePath,\n };\n }\n return {\n kind,\n name: String(parsed?.name ?? dirName),\n version: String(parsed?.version ?? \"\"),\n filePath: c.filePath,\n };\n}\n\n/**\n * Walk `root` at any depth and collect the version of every skill, agent, flow, prompt,\n * preset and contract — the same tree walk the default `validate` uses, so a library laid out\n * as `<root>/<asset>/SKILL.md` is covered as well as `skills/<asset>/SKILL.md`.\n */\nfunction collectAssetVersions(root: string): AssetVersion[] {\n if (!fs.existsSync(root)) return [];\n const assets: AssetVersion[] = [];\n for (const c of findManifestCandidates(root)) {\n if (!VERSIONED_KINDS[c.kind]) continue;\n // Only the YAML flow form and `agent.yaml` / `AGENT.md` carry a readable version here.\n if (c.filePath.endsWith(\".flow.json\")) continue;\n if (isExcludedPath(path.relative(root, c.filePath))) continue;\n assets.push(readAssetVersion(c));\n }\n return assets;\n}\n\n/** Root-relative posix location of an asset file, for messages. */\nfunction assetLocation(a: AssetVersion, root: string): string {\n return toPosix(path.relative(root, a.filePath));\n}\n\n/**\n * Nearest ancestor directory of `assetRelPath` (root-relative, posix) that\n * holds a `CHANGELOG.md`, walking up from the asset's own directory to and\n * including `root`, never above it. Returns the changelog's root-relative\n * path, or `null` when no ancestor has one.\n */\nfunction findChangelogUnit(assetRelPath: string, root: string): string | null {\n let dir = path.posix.dirname(toPosix(assetRelPath));\n for (;;) {\n const candidate = dir === \".\" ? \"CHANGELOG.md\" : `${dir}/CHANGELOG.md`;\n if (fs.existsSync(path.join(root, candidate))) return candidate;\n if (dir === \".\") return null;\n dir = path.posix.dirname(dir);\n }\n}\n\n/** Outcome of {@link checkChangelogUnits}. All paths are root-relative posix. */\nexport interface ChangelogCheck {\n /** Changelog units whose `CHANGELOG.md` is among the modified files. */\n updated: string[];\n /** Changelog units covering a modified asset whose `CHANGELOG.md` is not modified. */\n stale: string[];\n /** Modified assets with no `CHANGELOG.md` in any ancestor up to the root. */\n orphans: string[];\n}\n\n/**\n * Group the modified asset files by their nearest-ancestor `CHANGELOG.md` and\n * report which units were updated alongside them. Assets under\n * {@link EXCLUDED_PATHS} are ignored.\n *\n * @param modifiedFiles - Changed paths relative to `root`.\n * @param root - The asset root (`ai-assets/`); the walk up never leaves it.\n */\nexport function checkChangelogUnits(modifiedFiles: string[], root: string): ChangelogCheck {\n const modified = new Set(modifiedFiles.map(toPosix));\n const assetPattern = /(SKILL\\.md|agent\\.yaml|\\.flow\\.yaml|\\.prompt\\.md)$/;\n const units = new Set<string>();\n const orphans: string[] = [];\n for (const f of modified) {\n if (!assetPattern.test(f) || isExcludedPath(f)) continue;\n const unit = findChangelogUnit(f, root);\n if (unit) units.add(unit);\n else orphans.push(f);\n }\n const updated = [...units].filter((u) => modified.has(u));\n const stale = [...units].filter((u) => !modified.has(u));\n return { updated, stale, orphans };\n}\n\n/** Extract version from file content using proper YAML parsing */\nfunction extractVersionFromContent(filePath: string, content: string): string | null {\n if (filePath.endsWith(\".yaml\")) {\n const parsed = parseYaml(content);\n return parsed?.version ?? null;\n }\n // SKILL.md / .prompt.md — YAML frontmatter\n const fmMatch = content.match(/^---\\n([\\s\\S]*?)\\n---/);\n if (!fmMatch) return null;\n const parsed = parseYaml(fmMatch[1]);\n return parsed?.metadata?.version ?? parsed?.version ?? null;\n}\n\n/** Check every asset has a present + semver-valid version. */\nfunction checkAssetVersions(\n assets: AssetVersion[],\n root: string,\n): { errors: number; warnings: number } {\n let errors = 0;\n const warnings = 0;\n for (const a of assets) {\n const location = assetLocation(a, root);\n if (!a.version) {\n logErr(`${a.kind}:${a.name} (${location}) — missing version`);\n errors++;\n continue;\n }\n const invalid = invalidSemverText(a.version);\n if (invalid) {\n logErr(`${a.kind}:${a.name} (${location}) — ${invalid}`);\n errors++;\n }\n }\n return { errors, warnings };\n}\n\n/** In --changed-only mode, warn when a changed asset's version was not bumped. */\nfunction checkVersionBumps(assets: AssetVersion[], root: string): number {\n let warnings = 0;\n for (const a of assets) {\n if (!a.version) continue; // already flagged above\n // `HEAD:./<path>` is relative to `root` (the cwd), not the repository top level.\n const relPath = toPosix(path.relative(root, a.filePath));\n try {\n const headContent = execFileSync(\"git\", [\"show\", `HEAD:./${relPath}`], {\n cwd: root,\n encoding: \"utf-8\",\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n const headVersion = extractVersionFromContent(a.filePath, headContent);\n if (headVersion && headVersion === a.version) {\n logWarn(\n `${a.kind}:${a.name} (${assetLocation(a, root)}) — file changed but version not bumped (${a.version})`,\n );\n warnings++;\n }\n } catch {\n // New file (no HEAD version) — that's fine\n }\n }\n return warnings;\n}\n\n/**\n * Validate flow node skill-version pins against the discovered skill versions.\n *\n * Flows are read through `loadFlow`, which normalizes legacy v1 documents into\n * the strict v2 shape — reading the authored YAML directly would miss every v2\n * pin, since those ride in `run.assets` rather than `node.data.version`.\n */\nfunction checkFlowVersionPins(\n assets: AssetVersion[],\n root: string,\n): { errors: number; warnings: number } {\n const flows = assets.filter((a) => a.kind === \"flow\");\n const skillVersionMap = new Map<string, string>();\n for (const a of assets.filter((a) => a.kind === \"skill\")) {\n skillVersionMap.set(a.name, a.version);\n }\n\n let errors = 0;\n let warnings = 0;\n for (const f of flows) {\n let pins: FlowVersionNode[];\n try {\n pins = flowSkillVersionPins(loadFlow(f.filePath));\n } catch (err) {\n // An unreadable flow is a gap in the check, not an absence of findings.\n // Report the path, not `f.name`: that id comes from a raw-YAML read that\n // falls back to the filename stem exactly when the file is unusable.\n logWarn(\n `flow:${f.name} (${path.relative(root, f.filePath)}) — could not be read: ` +\n `${err instanceof Error ? err.message : err}`,\n );\n warnings++;\n continue;\n }\n\n if (pins.length === 0) continue;\n const checks = validateFlowVersions(pins, skillVersionMap);\n for (const c of checks.filter((c) => !c.satisfied)) {\n logErr(\n `flow:${f.name} node ${c.nodeId} — wants ${c.requested}, found ${c.actual || \"(none)\"}`,\n );\n errors++;\n }\n }\n return { errors, warnings };\n}\n\n/**\n * Root of a `validate versions` / `validate changelog` run: the explicit `[path]`, else the\n * library the shell is in (the nearest directory at or above the cwd that holds\n * `skaile.manifest.yaml`), else the cwd itself, as plain `validate` reads it. The bundled\n * factory assets are never a default (p1194). Returns `null` after printing an error when\n * the path does not exist, or when the root holds no library (see {@link isCheckableRoot}).\n */\nfunction resolveCheckRoot(pathArg: string | undefined): string | null {\n let root = process.cwd();\n if (pathArg) {\n root = path.resolve(pathArg);\n if (!fs.existsSync(root)) {\n logErr(`Path does not exist: ${root}`);\n return null;\n }\n } else {\n for (let dir = root; ; dir = path.dirname(dir)) {\n if (fs.existsSync(path.join(dir, SKAILE_MANIFEST_FILENAME))) {\n root = dir;\n break;\n }\n if (path.dirname(dir) === dir) break;\n }\n }\n if (!isCheckableRoot(root)) {\n logErr(\n `Nothing to check in ${root}: no ${SKAILE_MANIFEST_FILENAME} and no versioned asset (skill, agent, flow, prompt, contract or preset) found. Run it in a library or pass the library directory.`,\n );\n return null;\n }\n return root;\n}\n\n/** Whether `root` is a library: it holds a library manifest or at least one versioned asset. */\nfunction isCheckableRoot(root: string): boolean {\n return (\n fs.existsSync(path.join(root, SKAILE_MANIFEST_FILENAME)) ||\n collectAssetVersions(root).length > 0\n );\n}\n\n/** `true` when `root` lies inside a git work tree. */\nfunction isInGitWorkTree(root: string): boolean {\n try {\n return (\n execFileSync(\"git\", [\"rev-parse\", \"--is-inside-work-tree\"], {\n cwd: root,\n encoding: \"utf-8\",\n stdio: [\"ignore\", \"pipe\", \"ignore\"],\n }).trim() === \"true\"\n );\n } catch {\n return false;\n }\n}\n\n/** `true` when the git work tree at `root` has at least one commit (`HEAD` resolves). */\nfunction hasCommit(root: string): boolean {\n try {\n execFileSync(\"git\", [\"rev-parse\", \"--verify\", \"--quiet\", \"HEAD\"], {\n cwd: root,\n stdio: [\"ignore\", \"ignore\", \"ignore\"],\n });\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Run `git diff --name-only --relative <ref>` in `root` and return the changed paths\n * (relative to `root`), plus — with `untracked` — the new files git does not track yet.\n * No git work tree prints `<what> needs a git repository`; any other git failure — a bad\n * ref, no `git` — prints one `git diff failed in <root>: <first stderr line>` line. Both\n * return `null`; git's own usage text never reaches the terminal.\n *\n * @param what The command that needs git, for the message (`--changed-only`, `changelog`).\n */\nfunction changedFiles(\n root: string,\n ref: string,\n what: string,\n opts: { untracked?: boolean } = {},\n): string[] | null {\n if (!isInGitWorkTree(root)) {\n logErr(`${what} needs a git repository: ${root} is not inside a git work tree.`);\n return null;\n }\n if (ref === \"HEAD\" && !hasCommit(root)) {\n logErr(\n `${what} compares with the last commit, and ${root} has no commit yet. Commit the library first (\\`skaile library commit <name>\\`), then run it again.`,\n );\n return null;\n }\n try {\n const out = execFileSync(\n \"git\",\n [\"diff\", \"--name-only\", \"--relative\", \"--end-of-options\", ref],\n {\n cwd: root,\n encoding: \"utf-8\",\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n },\n );\n const changed = out.trim().split(\"\\n\").filter(Boolean);\n if (opts.untracked) {\n // New files git does not track yet (`--others` paths are relative to `root`).\n const fresh = execFileSync(\"git\", [\"ls-files\", \"--others\", \"--exclude-standard\"], {\n cwd: root,\n encoding: \"utf-8\",\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n changed.push(...fresh.trim().split(\"\\n\").filter(Boolean));\n }\n return changed;\n } catch (err) {\n const stderr = err instanceof Error && \"stderr\" in err ? String(err.stderr).trim() : \"\";\n const reason = (stderr || (err instanceof Error ? err.message : String(err))).split(\"\\n\")[0];\n logErr(`git diff failed in ${root}: ${reason}`);\n return null;\n }\n}\n\n/**\n * The directory whose files belong to `a`: the asset's own folder for a skill, agent, contract,\n * or a prompt/flow/preset that sits in a folder named after it — the folder `library create`\n * scaffolds. A single prompt/flow/preset file next to others is its own asset (`null`).\n */\nfunction assetOwnDir(a: AssetVersion): string | null {\n const dir = path.dirname(a.filePath);\n if ([\"skill\", \"agent\", \"contract\"].includes(a.kind) || path.basename(dir) === a.name) return dir;\n return null;\n}\n\n/**\n * `true` when `a` changed: its asset file, or any file under its folder that a deploy ships\n * (the lock hash covers them, minus the deploy ignore list), is among `changedAbs`.\n */\nfunction assetChanged(a: AssetVersion, changedAbs: ReadonlySet<string>): boolean {\n if (changedAbs.has(a.filePath)) return true;\n const dir = assetOwnDir(a);\n if (dir === null) return false;\n for (const f of changedAbs) {\n const rel = path.relative(dir, f);\n if (rel.startsWith(\"..\") || path.isAbsolute(rel)) continue;\n if (!isNonAssetPath(toPosix(rel))) return true;\n }\n return false;\n}\n\n/** Body of `skaile validate versions` — semver + bump + flow-pin checks. */\nfunction runVersionsCheck(\n pathArg: string | undefined,\n opts: { changedOnly?: boolean; strict?: boolean },\n): void {\n const root = resolveCheckRoot(pathArg);\n if (root === null) {\n process.exit(1);\n return;\n }\n let assets = collectAssetVersions(root);\n // A directory with no asset has nothing to check: `Checked 0 assets / All versions valid` would\n // read as a pass, so it fails as `validate` does for a path with no manifests (p1194).\n if (assets.length === 0) {\n logErr(\n `Nothing to check in ${root}: no versioned asset (skill, agent, flow, prompt, contract or preset) found. Pass the library directory.`,\n );\n process.exit(1);\n return;\n }\n\n // Filter to changed files only if requested\n if (opts.changedOnly) {\n const changed = changedFiles(root, \"HEAD\", \"--changed-only\", { untracked: true });\n if (changed === null) {\n process.exit(1);\n return;\n }\n const changedAbs = new Set(changed.map((f) => path.resolve(root, f)));\n assets = assets.filter((a) => assetChanged(a, changedAbs));\n }\n\n logInfo(`Checking versions in ${root}`);\n const versionCheck = checkAssetVersions(assets, root);\n let errors = versionCheck.errors;\n let warnings = versionCheck.warnings;\n\n // In --changed-only mode, check if version was actually bumped\n if (opts.changedOnly) {\n warnings += checkVersionBumps(assets, root);\n }\n\n const pinCheck = checkFlowVersionPins(assets, root);\n errors += pinCheck.errors;\n warnings += pinCheck.warnings;\n\n // Summary\n console.log();\n logInfo(`Checked ${assets.length} assets`);\n if (errors === 0 && warnings === 0) {\n logOk(\"All versions valid\");\n } else {\n if (errors > 0) logErr(`${errors} error(s)`);\n if (warnings > 0) logWarn(`${warnings} warning(s)`);\n }\n\n if (errors > 0 || (opts.strict && warnings > 0)) {\n process.exit(1);\n }\n}\n\n/**\n * Creates the `skaile validate` command group.\n *\n * Validates asset manifests, version fields, and changelogs in an asset\n * repository tree. Subcommands: default `validate [path]` (schema check),\n * `versions` (semver + flow pin validation), `changelog` (modified assets\n * must have an updated nearest-ancestor CHANGELOG.md).\n *\n * @returns Configured {@link Command} ready for `program.addCommand()`.\n * @docLink cli/commands/validate#make-validate-command\n */\nexport function makeValidateCommand(): Command {\n const cmd = new Command(\"validate\").description(\n \"Validate asset manifests, versions, and changelogs\",\n );\n\n // Default action: skaile validate [path]\n cmd\n .argument(\"[path]\", \"Path to asset repo or directory to validate\", \".\")\n .option(\n \"--strict-conformance\",\n \"Treat Agent Skills (agentskills.io) standard findings as errors\",\n )\n .action(async (targetPath: string, opts: { strictConformance?: boolean }) => {\n const absPath = path.resolve(targetPath);\n if (fs.existsSync(absPath) && !fs.statSync(absPath).isDirectory()) {\n logErr(`${absPath} is not a directory: nothing to validate. Pass the library directory.`);\n process.exit(1);\n return;\n }\n logInfo(`Validating manifests in ${absPath}`);\n const { total, errors, warnings } = validateManifests(\n absPath,\n opts.strictConformance ?? false,\n await registeredAssetKeys(libraryRootOf(absPath)),\n );\n const ws = await validateWorkspaceManifests(absPath);\n const rootErrors = validatePublishManifestRoots(absPath);\n const slugErrors = validatePublishManifestPublisherSlugs(absPath);\n const rootPathErrors = validatePublishManifestRootPaths(absPath);\n const parseErrors = validatePublishManifestParses(absPath);\n const requiresErrors = validatePublishManifestRequires(absPath);\n const unlistedErrors = await validatePublishManifestUnlisted(absPath);\n const versionWarnings = validatePublishManifestVersions(absPath);\n const publisherWarnings = validatePublishManifestPublishers(absPath);\n // Advisory and offline: a dependency no registered library holds may live in a\n // library that is not registered on this machine.\n const dependencyProblems = await unresolvedManifestDependencies(absPath);\n for (const w of dependencyProblems) logWarn(w);\n const dependencyWarnings = dependencyProblems.length;\n const totalErrors =\n errors +\n ws.errors +\n rootErrors +\n slugErrors +\n rootPathErrors +\n parseErrors +\n requiresErrors +\n unlistedErrors;\n console.log();\n warnIgnoredDomainFiles(absPath);\n warnLegacyBundleFiles(absPath);\n logInfo(`Scanned ${total} asset manifest(s) and ${ws.total} skaile.yaml file(s)`);\n // Nothing scanned and no library manifest: a directory with nothing in it is not valid,\n // it is not validated (p745).\n if (\n total === 0 &&\n ws.total === 0 &&\n totalErrors === 0 &&\n !fs.existsSync(path.join(absPath, SKAILE_MANIFEST_FILENAME))\n ) {\n logErr(\n `Nothing to validate in ${absPath}: no asset manifest, skaile.yaml or ${SKAILE_MANIFEST_FILENAME} found.`,\n );\n process.exit(1);\n return;\n }\n const totalWarnings = warnings + versionWarnings + publisherWarnings + dependencyWarnings;\n if (totalWarnings > 0) logWarn(`${totalWarnings} warning(s)`);\n if (totalErrors === 0) {\n logOk(\"All manifests valid\");\n } else {\n logErr(`${totalErrors} validation error(s)`);\n process.exit(1);\n }\n });\n\n cmd\n .command(\"versions\")\n .description(\"Check version fields and flow version pins\")\n .argument(\"[path]\", \"Library or asset directory (default: the current library)\")\n .option(\"--changed-only\", \"Only check assets modified since last commit\")\n .option(\"--strict\", \"Exit 1 on warnings (for CI)\")\n .addOption(removedDomainOption())\n .action(\n (\n pathArg: string | undefined,\n opts: { changedOnly?: boolean; strict?: boolean; domain?: string },\n ) => {\n rejectRemovedDomainOption(opts);\n runVersionsCheck(pathArg, opts);\n },\n );\n\n cmd\n .command(\"changelog\")\n .description(\"Check that modified assets have an updated nearest CHANGELOG.md\")\n .argument(\"[path]\", \"Library or asset directory (default: the current library)\")\n .option(\"--base <ref>\", \"Git base ref for diff\", \"HEAD\")\n .action((pathArg: string | undefined, opts: { base: string }) => {\n const root = resolveCheckRoot(pathArg);\n if (root === null) {\n process.exit(1);\n return;\n }\n const modifiedFiles = changedFiles(root, opts.base, \"changelog\");\n if (modifiedFiles === null) {\n process.exit(1);\n return;\n }\n const { updated, stale, orphans } = checkChangelogUnits(modifiedFiles, root);\n\n if (updated.length + stale.length + orphans.length === 0) {\n logOk(\"No modified assets found\");\n return;\n }\n\n for (const unit of updated) logOk(`${unit} updated`);\n for (const unit of stale) logErr(`${unit} not updated (assets were modified)`);\n for (const asset of orphans) {\n logErr(`${asset} — no CHANGELOG.md in any ancestor directory up to the asset root`);\n }\n\n if (stale.length + orphans.length > 0) process.exit(1);\n });\n\n return cmd;\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { resolveAgentExec } from './chunk-7DN6JKP2.js';
2
- import { BUILTIN_HARNESS_CATALOG } from './chunk-X37JUNEW.js';
3
- import { tryWithFsDeadline, fsDeadlineMs, withFsDeadline } from './chunk-JMIKGAUA.js';
2
+ import { BUILTIN_HARNESS_CATALOG } from './chunk-QJQQNBVT.js';
3
+ import { tryWithFsDeadline, fsDeadlineMs, withFsDeadline } from './chunk-VV2DJT4I.js';
4
4
  import { entryTransport, normalizeAnthropicBaseUrl, resolveEntryBaseUrl, registryEntries, parseModelRef } from './chunk-RXGPFAMN.js';
5
5
  import { createWriteStream, createReadStream } from 'fs';
6
6
  import { unlink, rename, readdir, stat } from 'fs/promises';
@@ -569,5 +569,5 @@ function sessionSurfaceNotice(registry, modelRef) {
569
569
  }
570
570
 
571
571
  export { ANTHROPIC_DEFAULT_BASE_URL, APPROVE_ONCE, DENY, agentTranscriptStore, approvalCardOf, buildClaudeEndpointEnv, claudeEndpointMode, localTranscriptStore, probeResumeTranscript, resolveClaudeConfigDir, scrubPoisonedTranscript, sessionSurfaceNotice, transcriptStoreForRuntime, unsupportedSurfaceNotice };
572
- //# sourceMappingURL=chunk-QXKUFROW.js.map
573
- //# sourceMappingURL=chunk-QXKUFROW.js.map
572
+ //# sourceMappingURL=chunk-PTBX55QF.js.map
573
+ //# sourceMappingURL=chunk-PTBX55QF.js.map