@skaile/workspaces 6.9.0 → 6.10.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 (345) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/ai-sdk.js +8 -8
  3. package/dist/{asset-feeds-JWRIWLVX.js → asset-feeds-UG3PG423.js} +22 -22
  4. package/dist/{asset-feeds-JWRIWLVX.js.map → asset-feeds-UG3PG423.js.map} +1 -1
  5. package/dist/asset-manager/catalog-deployer.js +8 -8
  6. package/dist/asset-manager/history.js +8 -8
  7. package/dist/asset-manager/index.js +14 -14
  8. package/dist/asset-manager/installer.js +9 -9
  9. package/dist/asset-manager/renderers.js +8 -8
  10. package/dist/asset-manager/src/harness-switch-state.d.ts +30 -0
  11. package/dist/asset-manager/src/harness-switch-state.d.ts.map +1 -0
  12. package/dist/asset-manager/src/index.d.ts +49 -12
  13. package/dist/asset-manager/src/index.d.ts.map +1 -1
  14. package/dist/asset-manager/src/mcp-config.d.ts +6 -0
  15. package/dist/asset-manager/src/mcp-config.d.ts.map +1 -1
  16. package/dist/bridge/codex-app-server.js +1 -2
  17. package/dist/bridge/harnesses/claude-sdk.js +11 -11
  18. package/dist/bridge/harnesses/codex.js +15 -1926
  19. package/dist/bridge/harnesses/codex.js.map +1 -1
  20. package/dist/bridge/harnesses/continue.js +11 -11
  21. package/dist/bridge/harnesses/echo.js +3 -3
  22. package/dist/bridge/harnesses/gemini.js +6 -6
  23. package/dist/bridge/harnesses/goose.js +11 -11
  24. package/dist/bridge/harnesses/omp.js +61 -9
  25. package/dist/bridge/harnesses/omp.js.map +1 -1
  26. package/dist/bridge/harnesses/opencode.js +11 -11
  27. package/dist/bridge/harnesses/qwen.js +6 -6
  28. package/dist/bridge/index.js +17 -16
  29. package/dist/bridge/src/harness-model-check.d.ts +5 -4
  30. package/dist/bridge/src/harness-model-check.d.ts.map +1 -1
  31. package/dist/bridge/src/harnesses/codex.d.ts +13 -0
  32. package/dist/bridge/src/harnesses/codex.d.ts.map +1 -1
  33. package/dist/bridge/src/harnesses/omp.d.ts +22 -0
  34. package/dist/bridge/src/harnesses/omp.d.ts.map +1 -1
  35. package/dist/bridge/src/index.d.ts +1 -0
  36. package/dist/bridge/src/index.d.ts.map +1 -1
  37. package/dist/{chunk-XPKUFOS3.js → chunk-2D6HZAO5.js} +8 -8
  38. package/dist/{chunk-XPKUFOS3.js.map → chunk-2D6HZAO5.js.map} +1 -1
  39. package/dist/chunk-2MUUPRIG.js +688 -0
  40. package/dist/chunk-2MUUPRIG.js.map +1 -0
  41. package/dist/{chunk-TMQFOJ6F.js → chunk-2PVYDAFN.js} +3 -3
  42. package/dist/{chunk-TMQFOJ6F.js.map → chunk-2PVYDAFN.js.map} +1 -1
  43. package/dist/{chunk-YGT3CGPD.js → chunk-2U67XYZM.js} +3 -3
  44. package/dist/{chunk-YGT3CGPD.js.map → chunk-2U67XYZM.js.map} +1 -1
  45. package/dist/{chunk-5NTB64PW.js → chunk-375HN3FD.js} +18 -14
  46. package/dist/chunk-375HN3FD.js.map +1 -0
  47. package/dist/{chunk-23Q5LT4U.js → chunk-4I4SBOCS.js} +345 -88
  48. package/dist/chunk-4I4SBOCS.js.map +1 -0
  49. package/dist/{chunk-WPLZGT5Z.js → chunk-4Z4RULWQ.js} +59 -31
  50. package/dist/chunk-4Z4RULWQ.js.map +1 -0
  51. package/dist/{chunk-72BDCGBB.js → chunk-5JBMYZNA.js} +3 -3
  52. package/dist/{chunk-72BDCGBB.js.map → chunk-5JBMYZNA.js.map} +1 -1
  53. package/dist/{chunk-3EPRTMXY.js → chunk-5KQFR4D7.js} +6 -6
  54. package/dist/{chunk-3EPRTMXY.js.map → chunk-5KQFR4D7.js.map} +1 -1
  55. package/dist/{chunk-KNY356I3.js → chunk-5KSGZP3E.js} +11 -4
  56. package/dist/chunk-5KSGZP3E.js.map +1 -0
  57. package/dist/{chunk-DZRN3SNG.js → chunk-5P7LTPBR.js} +5 -5
  58. package/dist/{chunk-DZRN3SNG.js.map → chunk-5P7LTPBR.js.map} +1 -1
  59. package/dist/{chunk-PTJZCOBH.js → chunk-6O7VDKX3.js} +2 -2
  60. package/dist/{chunk-PTJZCOBH.js.map → chunk-6O7VDKX3.js.map} +1 -1
  61. package/dist/{chunk-B2DGCYVC.js → chunk-7DUOKE73.js} +27 -33
  62. package/dist/chunk-7DUOKE73.js.map +1 -0
  63. package/dist/{chunk-V5KG6CCV.js → chunk-7HRZACI4.js} +7 -2
  64. package/dist/chunk-7HRZACI4.js.map +1 -0
  65. package/dist/{chunk-U3FI4DVT.js → chunk-7K73MCI6.js} +7 -5
  66. package/dist/chunk-7K73MCI6.js.map +1 -0
  67. package/dist/{chunk-SE6OL7Y5.js → chunk-BCID52M5.js} +6 -6
  68. package/dist/{chunk-SE6OL7Y5.js.map → chunk-BCID52M5.js.map} +1 -1
  69. package/dist/{chunk-FZO64PLQ.js → chunk-BNLXZXZN.js} +81 -8
  70. package/dist/chunk-BNLXZXZN.js.map +1 -0
  71. package/dist/{chunk-O3FYOS64.js → chunk-C5UKYTTD.js} +13 -23
  72. package/dist/chunk-C5UKYTTD.js.map +1 -0
  73. package/dist/{chunk-LYVLDGML.js → chunk-CG63XGVV.js} +3 -3
  74. package/dist/{chunk-LYVLDGML.js.map → chunk-CG63XGVV.js.map} +1 -1
  75. package/dist/{chunk-4ROXSQEG.js → chunk-CJO3XKO7.js} +4 -4
  76. package/dist/{chunk-4ROXSQEG.js.map → chunk-CJO3XKO7.js.map} +1 -1
  77. package/dist/{chunk-OSABUEWA.js → chunk-CVUMZTNO.js} +4 -4
  78. package/dist/{chunk-OSABUEWA.js.map → chunk-CVUMZTNO.js.map} +1 -1
  79. package/dist/{chunk-E675QKFG.js → chunk-DOMRBOJZ.js} +5 -5
  80. package/dist/{chunk-E675QKFG.js.map → chunk-DOMRBOJZ.js.map} +1 -1
  81. package/dist/{chunk-GTAHU4N4.js → chunk-EB2LKPI6.js} +4 -4
  82. package/dist/{chunk-GTAHU4N4.js.map → chunk-EB2LKPI6.js.map} +1 -1
  83. package/dist/{chunk-GZL6RN4Z.js → chunk-FXBKBOI5.js} +169 -49
  84. package/dist/chunk-FXBKBOI5.js.map +1 -0
  85. package/dist/{chunk-AERQFD6T.js → chunk-GA4GUDTL.js} +4 -4
  86. package/dist/{chunk-AERQFD6T.js.map → chunk-GA4GUDTL.js.map} +1 -1
  87. package/dist/{chunk-NJVHGS7X.js → chunk-HE3TZYNG.js} +4 -4
  88. package/dist/{chunk-NJVHGS7X.js.map → chunk-HE3TZYNG.js.map} +1 -1
  89. package/dist/chunk-HLFLET7S.js +2443 -0
  90. package/dist/chunk-HLFLET7S.js.map +1 -0
  91. package/dist/{chunk-Y2BQWZXT.js → chunk-HQUF6O4B.js} +27 -56
  92. package/dist/chunk-HQUF6O4B.js.map +1 -0
  93. package/dist/{chunk-T5EIWWEJ.js → chunk-IMO4EHND.js} +5 -5
  94. package/dist/{chunk-T5EIWWEJ.js.map → chunk-IMO4EHND.js.map} +1 -1
  95. package/dist/{chunk-TUOHA6BM.js → chunk-IOXFT5D7.js} +3 -3
  96. package/dist/{chunk-TUOHA6BM.js.map → chunk-IOXFT5D7.js.map} +1 -1
  97. package/dist/{chunk-5AQLCRR7.js → chunk-JDZUQFN7.js} +4 -4
  98. package/dist/{chunk-5AQLCRR7.js.map → chunk-JDZUQFN7.js.map} +1 -1
  99. package/dist/{chunk-SQMDFM4N.js → chunk-KE5HDORU.js} +2 -2
  100. package/dist/{chunk-SQMDFM4N.js.map → chunk-KE5HDORU.js.map} +1 -1
  101. package/dist/{chunk-PTJTOPE5.js → chunk-KOI7QFDH.js} +3 -3
  102. package/dist/{chunk-PTJTOPE5.js.map → chunk-KOI7QFDH.js.map} +1 -1
  103. package/dist/{chunk-NDBHEOIA.js → chunk-KRL53RZB.js} +8 -8
  104. package/dist/{chunk-NDBHEOIA.js.map → chunk-KRL53RZB.js.map} +1 -1
  105. package/dist/{chunk-7QYBKUAS.js → chunk-LKBRBVVS.js} +3 -3
  106. package/dist/{chunk-7QYBKUAS.js.map → chunk-LKBRBVVS.js.map} +1 -1
  107. package/dist/{chunk-USSP43U3.js → chunk-LQWOU7S2.js} +3 -3
  108. package/dist/{chunk-USSP43U3.js.map → chunk-LQWOU7S2.js.map} +1 -1
  109. package/dist/{chunk-4KPQ6ILH.js → chunk-MEU2HHGV.js} +18 -9
  110. package/dist/chunk-MEU2HHGV.js.map +1 -0
  111. package/dist/{chunk-QC5BYUED.js → chunk-MS2IXLTC.js} +4 -4
  112. package/dist/{chunk-QC5BYUED.js.map → chunk-MS2IXLTC.js.map} +1 -1
  113. package/dist/{chunk-X2B5GMJO.js → chunk-NCJSYU6A.js} +16 -14
  114. package/dist/chunk-NCJSYU6A.js.map +1 -0
  115. package/dist/{chunk-CFTTXUM2.js → chunk-NFFBYG2W.js} +3 -3
  116. package/dist/{chunk-CFTTXUM2.js.map → chunk-NFFBYG2W.js.map} +1 -1
  117. package/dist/{chunk-AVRTZAH2.js → chunk-NTFP2XF4.js} +10 -10
  118. package/dist/chunk-NTFP2XF4.js.map +1 -0
  119. package/dist/{chunk-V2CONXKD.js → chunk-PSPFWTJI.js} +4 -4
  120. package/dist/{chunk-V2CONXKD.js.map → chunk-PSPFWTJI.js.map} +1 -1
  121. package/dist/{chunk-C7L5MFUL.js → chunk-PTXQMTCG.js} +3 -3
  122. package/dist/{chunk-C7L5MFUL.js.map → chunk-PTXQMTCG.js.map} +1 -1
  123. package/dist/{chunk-Y242OE4B.js → chunk-QBJQ426X.js} +3 -3
  124. package/dist/{chunk-Y242OE4B.js.map → chunk-QBJQ426X.js.map} +1 -1
  125. package/dist/{chunk-QBUJTVMY.js → chunk-R3ZNAPBV.js} +3 -3
  126. package/dist/{chunk-QBUJTVMY.js.map → chunk-R3ZNAPBV.js.map} +1 -1
  127. package/dist/{chunk-4WB4KSSQ.js → chunk-RTFH2QR2.js} +3 -3
  128. package/dist/{chunk-4WB4KSSQ.js.map → chunk-RTFH2QR2.js.map} +1 -1
  129. package/dist/{chunk-5KWQMCH7.js → chunk-RZ5R6GDJ.js} +5 -5
  130. package/dist/{chunk-5KWQMCH7.js.map → chunk-RZ5R6GDJ.js.map} +1 -1
  131. package/dist/{chunk-MDCI4RSG.js → chunk-RZL4TOK3.js} +20 -6
  132. package/dist/chunk-RZL4TOK3.js.map +1 -0
  133. package/dist/{chunk-LMADWO4Q.js → chunk-SBAUZ7XH.js} +4 -4
  134. package/dist/{chunk-LMADWO4Q.js.map → chunk-SBAUZ7XH.js.map} +1 -1
  135. package/dist/{chunk-MPRWVZXF.js → chunk-SKG6G4HO.js} +108 -44
  136. package/dist/chunk-SKG6G4HO.js.map +1 -0
  137. package/dist/{chunk-HQAPUPBE.js → chunk-V2VDTQ7A.js} +3 -3
  138. package/dist/{chunk-HQAPUPBE.js.map → chunk-V2VDTQ7A.js.map} +1 -1
  139. package/dist/{chunk-GNUA7XT2.js → chunk-VS6XC5JE.js} +3 -3
  140. package/dist/{chunk-GNUA7XT2.js.map → chunk-VS6XC5JE.js.map} +1 -1
  141. package/dist/{chunk-5J6JWGY4.js → chunk-WDG5IVEA.js} +3 -3
  142. package/dist/{chunk-5J6JWGY4.js.map → chunk-WDG5IVEA.js.map} +1 -1
  143. package/dist/{chunk-M4G2SVXI.js → chunk-XWCV2A2F.js} +4 -4
  144. package/dist/{chunk-M4G2SVXI.js.map → chunk-XWCV2A2F.js.map} +1 -1
  145. package/dist/{chunk-UWD7YBDR.js → chunk-ZLDAPZIX.js} +4 -4
  146. package/dist/{chunk-UWD7YBDR.js.map → chunk-ZLDAPZIX.js.map} +1 -1
  147. package/dist/{claude-code-YRJIGXTL.js → claude-code-CMFGCDMX.js} +5 -5
  148. package/dist/{claude-code-YRJIGXTL.js.map → claude-code-CMFGCDMX.js.map} +1 -1
  149. package/dist/cli/index.js +322 -196
  150. package/dist/cli/index.js.map +1 -1
  151. package/dist/cli/src/commands/asset-cmd.d.ts.map +1 -1
  152. package/dist/cli/src/commands/catalog.d.ts.map +1 -1
  153. package/dist/cli/src/commands/config.d.ts.map +1 -1
  154. package/dist/cli/src/commands/connector.d.ts.map +1 -1
  155. package/dist/cli/src/commands/harness-preflight.d.ts +3 -1
  156. package/dist/cli/src/commands/harness-preflight.d.ts.map +1 -1
  157. package/dist/cli/src/commands/harness.d.ts.map +1 -1
  158. package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
  159. package/dist/cli/src/commands/library-index.d.ts +3 -3
  160. package/dist/cli/src/commands/library-index.d.ts.map +1 -1
  161. package/dist/cli/src/commands/migrate-files.d.ts +8 -0
  162. package/dist/cli/src/commands/migrate-files.d.ts.map +1 -1
  163. package/dist/cli/src/commands/migrate-harness.d.ts.map +1 -1
  164. package/dist/cli/src/commands/migrate-providers.d.ts.map +1 -1
  165. package/dist/cli/src/commands/migrate.d.ts.map +1 -1
  166. package/dist/cli/src/commands/outdated.d.ts.map +1 -1
  167. package/dist/cli/src/commands/project.d.ts.map +1 -1
  168. package/dist/cli/src/commands/run.d.ts.map +1 -1
  169. package/dist/cli/src/commands/serve-preflight.d.ts +7 -5
  170. package/dist/cli/src/commands/serve-preflight.d.ts.map +1 -1
  171. package/dist/cli/src/commands/serve.d.ts.map +1 -1
  172. package/dist/cli/src/commands/source.d.ts.map +1 -1
  173. package/dist/cli/src/commands/validate.d.ts.map +1 -1
  174. package/dist/cli/src/config-checks.d.ts +50 -12
  175. package/dist/cli/src/config-checks.d.ts.map +1 -1
  176. package/dist/cli/src/ensure-sources.d.ts.map +1 -1
  177. package/dist/cli/src/harness-error.d.ts +7 -0
  178. package/dist/cli/src/harness-error.d.ts.map +1 -1
  179. package/dist/cli/src/helpers.d.ts.map +1 -1
  180. package/dist/connectors/config.js +5 -5
  181. package/dist/connectors/index.js +20 -19
  182. package/dist/connectors/src/index.d.ts +1 -1
  183. package/dist/connectors/src/index.d.ts.map +1 -1
  184. package/dist/connectors/src/managed-gitconfig.d.ts +12 -0
  185. package/dist/connectors/src/managed-gitconfig.d.ts.map +1 -1
  186. package/dist/{connectors-JKT32HZT.js → connectors-P5M2D4MH.js} +23 -22
  187. package/dist/{connectors-JKT32HZT.js.map → connectors-P5M2D4MH.js.map} +1 -1
  188. package/dist/core/index.js +7 -7
  189. package/dist/core/logging.js +1 -1
  190. package/dist/core/manifest.js +2 -2
  191. package/dist/core/models.js +1 -1
  192. package/dist/core/publish-manifest.js +3 -3
  193. package/dist/core/ref.js +1 -1
  194. package/dist/core/runtime-assets.js +5 -5
  195. package/dist/core/src/index.d.ts +2 -2
  196. package/dist/core/src/index.d.ts.map +1 -1
  197. package/dist/core/src/lock.d.ts +7 -1
  198. package/dist/core/src/lock.d.ts.map +1 -1
  199. package/dist/core/src/models.d.ts.map +1 -1
  200. package/dist/core/src/repo-manager.d.ts +28 -0
  201. package/dist/core/src/repo-manager.d.ts.map +1 -1
  202. package/dist/core/src/run-state-ignore.d.ts +5 -3
  203. package/dist/core/src/run-state-ignore.d.ts.map +1 -1
  204. package/dist/core/src/workspace-config.d.ts.map +1 -1
  205. package/dist/core/workspace-config.js +4 -4
  206. package/dist/deploy/index.js +7 -7
  207. package/dist/discovery/index.js +4 -4
  208. package/dist/{ensure-sources-GUJODKY5.js → ensure-sources-MOGLBEUF.js} +31 -29
  209. package/dist/ensure-sources-MOGLBEUF.js.map +1 -0
  210. package/dist/factory-assets/connectors/box.js +20 -19
  211. package/dist/factory-assets/connectors/deploy.js +20 -19
  212. package/dist/factory-assets/connectors/devserver.js +20 -19
  213. package/dist/factory-assets/connectors/flow/adapter.js +20 -19
  214. package/dist/factory-assets/connectors/flow/engine.js +8 -8
  215. package/dist/factory-assets/connectors/flow/run-flow.js +22 -21
  216. package/dist/factory-assets/connectors/flow.js +20 -19
  217. package/dist/factory-assets/connectors/git/exec.d.ts +7 -0
  218. package/dist/factory-assets/connectors/git/exec.d.ts.map +1 -1
  219. package/dist/factory-assets/connectors/git/repo.d.ts.map +1 -1
  220. package/dist/factory-assets/connectors/git.js +20 -19
  221. package/dist/factory-assets/connectors/gmail/adapter.d.ts.map +1 -1
  222. package/dist/factory-assets/connectors/gmail.js +20 -19
  223. package/dist/factory-assets/connectors/googledrive.js +20 -19
  224. package/dist/factory-assets/connectors/local.js +20 -19
  225. package/dist/factory-assets/connectors/mattermost.js +20 -19
  226. package/dist/factory-assets/connectors/memory.js +20 -19
  227. package/dist/factory-assets/connectors/minio/adapter.d.ts.map +1 -1
  228. package/dist/factory-assets/connectors/minio.js +20 -19
  229. package/dist/factory-assets/connectors/postgres/adapter.d.ts.map +1 -1
  230. package/dist/factory-assets/connectors/postgres.js +20 -19
  231. package/dist/factory-assets/connectors/s3/driver.d.ts.map +1 -1
  232. package/dist/factory-assets/connectors/s3.js +20 -19
  233. package/dist/factory-assets/connectors/sharepoint.js +20 -19
  234. package/dist/factory-assets/connectors/sqlite/adapter.d.ts.map +1 -1
  235. package/dist/factory-assets/connectors/sqlite.js +20 -19
  236. package/dist/factory-assets/connectors/static-server.js +20 -19
  237. package/dist/factory-assets/connectors/tunnel.js +20 -19
  238. package/dist/factory-assets/connectors/webdav.js +20 -19
  239. package/dist/factory-assets/connectors/xstate-store.js +20 -19
  240. package/dist/factory-assets/connectors/xstate.js +20 -19
  241. package/dist/{flows-UCP6ZUYS.js → flows-J64L5MGJ.js} +12 -12
  242. package/dist/{flows-UCP6ZUYS.js.map → flows-J64L5MGJ.js.map} +1 -1
  243. package/dist/{helpers-SO53MRHF.js → helpers-JL5AEGDT.js} +28 -26
  244. package/dist/{helpers-SO53MRHF.js.map → helpers-JL5AEGDT.js.map} +1 -1
  245. package/dist/library/index.js +10 -10
  246. package/dist/library/install.js +4 -4
  247. package/dist/library/src/index.d.ts +2 -2
  248. package/dist/library/src/index.d.ts.map +1 -1
  249. package/dist/library/src/library.d.ts +6 -2
  250. package/dist/library/src/library.d.ts.map +1 -1
  251. package/dist/library/src/local/db.d.ts.map +1 -1
  252. package/dist/library/src/local/library.d.ts +10 -3
  253. package/dist/library/src/local/library.d.ts.map +1 -1
  254. package/dist/library/src/local/local-catalog-source.d.ts +0 -9
  255. package/dist/library/src/local/local-catalog-source.d.ts.map +1 -1
  256. package/dist/library/src/local/schema.d.ts +27 -20
  257. package/dist/library/src/local/schema.d.ts.map +1 -1
  258. package/dist/library/src/manifest-writer.d.ts +13 -0
  259. package/dist/library/src/manifest-writer.d.ts.map +1 -1
  260. package/dist/library/src/remote/index.d.ts +1 -1
  261. package/dist/library/src/remote/index.d.ts.map +1 -1
  262. package/dist/library/src/remote/remote-catalog-source.d.ts +6 -0
  263. package/dist/library/src/remote/remote-catalog-source.d.ts.map +1 -1
  264. package/dist/library/src/sync/git-driver.d.ts.map +1 -1
  265. package/dist/{library-publish-Z5E3YZCZ.js → library-publish-DZNNZNMB.js} +49 -50
  266. package/dist/library-publish-DZNNZNMB.js.map +1 -0
  267. package/dist/model-endpoint/index.js +10 -10
  268. package/dist/open-library-OJREQ22B.js +61 -0
  269. package/dist/{open-library-A5OB72FD.js.map → open-library-OJREQ22B.js.map} +1 -1
  270. package/dist/{open-registry-BHBHQMBA.js → open-registry-OEU6QUK2.js} +14 -14
  271. package/dist/{open-registry-BHBHQMBA.js.map → open-registry-OEU6QUK2.js.map} +1 -1
  272. package/dist/paths-PXBWY532.js +22 -0
  273. package/dist/{paths-77PXOXZY.js.map → paths-PXBWY532.js.map} +1 -1
  274. package/dist/{plugin-store-XQP2CRYH.js → plugin-store-ZC3EGZ3D.js} +10 -10
  275. package/dist/{plugin-store-XQP2CRYH.js.map → plugin-store-ZC3EGZ3D.js.map} +1 -1
  276. package/dist/{project-KTEUN7KR.js → project-52UABBD5.js} +45 -46
  277. package/dist/{project-KTEUN7KR.js.map → project-52UABBD5.js.map} +1 -1
  278. package/dist/resolver/index.js +8 -8
  279. package/dist/runner/index.js +35 -35
  280. package/dist/runner/src/agent-loop.d.ts.map +1 -1
  281. package/dist/runner/src/serve.d.ts.map +1 -1
  282. package/dist/runner/src/turn-end-contract.d.ts.map +1 -1
  283. package/dist/runner/src/turn-scheduler.d.ts +8 -0
  284. package/dist/runner/src/turn-scheduler.d.ts.map +1 -1
  285. package/dist/sdk/asset-manager.js +14 -14
  286. package/dist/sdk/bridge.js +17 -16
  287. package/dist/sdk/core.js +7 -7
  288. package/dist/sdk/flow.js +8 -8
  289. package/dist/sdk/index.js +35 -35
  290. package/dist/sdk/resolver.js +8 -8
  291. package/dist/sdk/runner.js +35 -35
  292. package/dist/sdk/transport/ws/server.js +8 -8
  293. package/dist/sdk/transport/ws.js +8 -8
  294. package/dist/sdk/transport.js +8 -8
  295. package/dist/{serve-preflight-ODQGVUFL.js → serve-preflight-HOQ7CGYR.js} +30 -30
  296. package/dist/{serve-preflight-ODQGVUFL.js.map → serve-preflight-HOQ7CGYR.js.map} +1 -1
  297. package/dist/{setup-QJDI5YAW.js → setup-JIDZ372C.js} +29 -27
  298. package/dist/setup-JIDZ372C.js.map +1 -0
  299. package/dist/{skills-DE2BDQ6G.js → skills-5D4KDVPJ.js} +13 -13
  300. package/dist/{skills-DE2BDQ6G.js.map → skills-5D4KDVPJ.js.map} +1 -1
  301. package/dist/{source-FKOUYMEM.js → source-P6ZFSSZZ.js} +47 -46
  302. package/dist/{source-FKOUYMEM.js.map → source-P6ZFSSZZ.js.map} +1 -1
  303. package/dist/{source-manifest-publish-JA4TY4Z6.js → source-manifest-publish-Y36FHVDS.js} +49 -48
  304. package/dist/source-manifest-publish-Y36FHVDS.js.map +1 -0
  305. package/dist/transport/index.js +8 -8
  306. package/dist/transport/src/ws/server.d.ts.map +1 -1
  307. package/dist/transport/ws/server.js +8 -8
  308. package/dist/transport/ws.js +8 -8
  309. package/dist/tui/index.js +35 -35
  310. package/dist/workspace-plugin/adapters/mcp.js +27 -26
  311. package/dist/workspace-plugin/adapters/omp.js +14 -14
  312. package/dist/workspace-plugin/index.js +2 -2
  313. package/package.json +1 -1
  314. package/dist/chunk-23Q5LT4U.js.map +0 -1
  315. package/dist/chunk-4KPQ6ILH.js.map +0 -1
  316. package/dist/chunk-5NTB64PW.js.map +0 -1
  317. package/dist/chunk-AVRTZAH2.js.map +0 -1
  318. package/dist/chunk-B2DGCYVC.js.map +0 -1
  319. package/dist/chunk-FZO64PLQ.js.map +0 -1
  320. package/dist/chunk-GYBDWW6K.js +0 -160
  321. package/dist/chunk-GYBDWW6K.js.map +0 -1
  322. package/dist/chunk-GYPPVANR.js +0 -357
  323. package/dist/chunk-GYPPVANR.js.map +0 -1
  324. package/dist/chunk-GZL6RN4Z.js.map +0 -1
  325. package/dist/chunk-JY2JXCL6.js +0 -334
  326. package/dist/chunk-JY2JXCL6.js.map +0 -1
  327. package/dist/chunk-KNY356I3.js.map +0 -1
  328. package/dist/chunk-LOO5CB5M.js +0 -12
  329. package/dist/chunk-LOO5CB5M.js.map +0 -1
  330. package/dist/chunk-MDCI4RSG.js.map +0 -1
  331. package/dist/chunk-MPRWVZXF.js.map +0 -1
  332. package/dist/chunk-O3FYOS64.js.map +0 -1
  333. package/dist/chunk-U3FI4DVT.js.map +0 -1
  334. package/dist/chunk-V3EJYOP2.js +0 -299
  335. package/dist/chunk-V3EJYOP2.js.map +0 -1
  336. package/dist/chunk-V5KG6CCV.js.map +0 -1
  337. package/dist/chunk-WPLZGT5Z.js.map +0 -1
  338. package/dist/chunk-X2B5GMJO.js.map +0 -1
  339. package/dist/chunk-Y2BQWZXT.js.map +0 -1
  340. package/dist/ensure-sources-GUJODKY5.js.map +0 -1
  341. package/dist/library-publish-Z5E3YZCZ.js.map +0 -1
  342. package/dist/open-library-A5OB72FD.js +0 -59
  343. package/dist/paths-77PXOXZY.js +0 -22
  344. package/dist/setup-QJDI5YAW.js.map +0 -1
  345. package/dist/source-manifest-publish-JA4TY4Z6.js.map +0 -1
@@ -1,299 +0,0 @@
1
- import { listHarnesses } from './chunk-SQMDFM4N.js';
2
- import { softDepName } from './chunk-23Q5LT4U.js';
3
- import { readLock, LockParseError } from './chunk-4KPQ6ILH.js';
4
- import { SKAILE_YAML_DEFAULT, resolveSkWorkspaceConfig } from './chunk-FZO64PLQ.js';
5
- import { SUPPORTED_HARNESSES } from './chunk-VTETQCR6.js';
6
- import { existsSync, readdirSync, readFileSync } from 'fs';
7
- import { homedir } from 'os';
8
- import path from 'path';
9
- import pc from 'picocolors';
10
- import { Option } from 'commander';
11
-
12
- function unknownHarnessMessage(harness) {
13
- const known = listHarnesses().map((d) => d.id);
14
- if (known.includes(harness)) return void 0;
15
- return `Unknown agent harness: "${harness}". Available: ${known.join(", ")}. ${DEPLOY_COMMANDS} take: ${SUPPORTED_HARNESSES.join(", ")}.`;
16
- }
17
- var DEPLOY_COMMANDS = "harness set, init --harness and add --harness";
18
- function unknownHarnessTargetMessage(harness, extra = []) {
19
- const targets = [...SUPPORTED_HARNESSES, ...extra];
20
- const registered = listHarnesses().map((d) => d.id);
21
- return `Unknown agent harness: "${harness}". Available: ${targets.join(", ")}. run, repl and config set harness take: ${registered.join(", ")}.`;
22
- }
23
- var warnedDriverFlag = false;
24
- function warnDriverFlagDeprecated() {
25
- if (warnedDriverFlag) return;
26
- warnedDriverFlag = true;
27
- console.error("--driver is deprecated; use --harness");
28
- }
29
- function driverAliasOption() {
30
- return new Option("--driver <name>", "Deprecated alias of --harness").hideHelp();
31
- }
32
- function foldDriverFlag(opts, fallback) {
33
- const { driver, ...rest } = opts;
34
- if (driver !== void 0) warnDriverFlagDeprecated();
35
- return { ...rest, harness: rest.harness ?? driver ?? fallback };
36
- }
37
- function friendlyHarnessError(err) {
38
- const e = err;
39
- if (!e) return null;
40
- const isSpawnEnoent = e.code === "ENOENT" && (e.syscall?.startsWith("spawn") === true || /^spawn .*ENOENT/.test(e.message ?? ""));
41
- const isConfig = e.category === "config" || e.detail?.category === "config";
42
- if (!isSpawnEnoent && !isConfig) return null;
43
- const hint = e.hint ?? e.detail?.hint;
44
- const base = hint ?? "The configured agent binary is not installed or not on your PATH.";
45
- return `${base}
46
- Try a different harness with \`--harness claude-sdk\`.`;
47
- }
48
- function harnessErrorNotes(err) {
49
- const e = err;
50
- const notes = [];
51
- const category = e?.category ?? e?.detail?.category;
52
- const hint = e?.hint ?? e?.detail?.hint;
53
- if (hint && category !== "config") notes.push(hint);
54
- else if (category === "auth") notes.push("Check your API key or login.");
55
- if (e?.logSessionId) {
56
- notes.push(`Full records: .skaile/logs.db (skaile session logs ${e.logSessionId}).`);
57
- }
58
- return notes;
59
- }
60
-
61
- // cli/src/helpers.ts
62
- var S = {
63
- brand: (s) => pc.cyan(pc.bold(s)),
64
- cmd: (s) => pc.cyan(s),
65
- heading: (s) => pc.bold(s),
66
- bold: (s) => pc.bold(s),
67
- dim: (s) => pc.dim(s),
68
- ok: (s) => pc.green(s),
69
- warn: (s) => pc.yellow(s),
70
- err: (s) => pc.red(s),
71
- label: (s) => pc.dim(s),
72
- rule: (w = 40) => pc.dim("\u2500".repeat(w))
73
- };
74
- var KIND_COLORS = {
75
- skill: pc.blue,
76
- agent: pc.magenta,
77
- prompt: pc.yellow,
78
- flow: pc.green,
79
- preset: pc.cyan,
80
- contract: pc.red,
81
- connector: pc.green,
82
- knowledge: pc.cyan,
83
- persona: pc.cyan,
84
- ruleset: pc.cyan,
85
- "mcp-server": pc.magenta
86
- };
87
- function fitWidth(s, width) {
88
- if (width <= 0) return "";
89
- if (s.length > width) return width === 1 ? "\u2026" : `${s.slice(0, width - 1)}\u2026`;
90
- return s.padEnd(width);
91
- }
92
- function kindColor(kind) {
93
- const colorFn = KIND_COLORS[kind] ?? pc.dim;
94
- return colorFn(kind);
95
- }
96
- var KIND_COL_WIDTH = 10;
97
- var TARGET_DEFAULT_HINT = "default: the project's configured harness, else claude-code";
98
- function kindColorPad(kind, width = KIND_COL_WIDTH) {
99
- const colorFn = KIND_COLORS[kind] ?? pc.dim;
100
- return colorFn(fitWidth(kind, width));
101
- }
102
- function colorRef(ref) {
103
- const colonIdx = ref.indexOf(":");
104
- if (colonIdx === -1) return ref;
105
- const kind = ref.slice(0, colonIdx);
106
- const rest = ref.slice(colonIdx);
107
- return `${kindColor(kind)}${rest}`;
108
- }
109
- function logOk(msg) {
110
- console.log(` ${pc.green("\u2713")} ${msg}`);
111
- }
112
- function logErr(msg) {
113
- console.error(` ${pc.red("\u2717")} ${msg}`);
114
- }
115
- function logWarn(msg) {
116
- console.log(` ${pc.yellow("!")} ${msg}`);
117
- }
118
- function logWarnErr(msg) {
119
- console.error(` ${pc.yellow("!")} ${msg}`);
120
- }
121
- function warnPlaceholderBodies(bodies, descriptions) {
122
- const refs = [.../* @__PURE__ */ new Set([...bodies ?? [], ...descriptions ?? []])];
123
- for (const ref of refs) {
124
- const parts = [
125
- ...descriptions?.includes(ref) ? ["description"] : [],
126
- ...bodies?.includes(ref) ? ["body"] : []
127
- ];
128
- const both = parts.length > 1;
129
- logWarn(
130
- `${ref} ${parts.join(" and ")} ${both ? "are" : "is"} still the scaffold placeholder; write ${both ? "them" : "it"} (\`skaile validate\` fails ${both ? "them" : "it"})`
131
- );
132
- }
133
- }
134
- function logInfo(msg) {
135
- console.log(` ${pc.dim("\xB7")} ${msg}`);
136
- }
137
- var activeCommandPath;
138
- function setActiveCommand(cmd) {
139
- const names = [];
140
- for (let c = cmd; c && c.parent; c = c.parent) {
141
- names.unshift(c.name());
142
- }
143
- activeCommandPath = names.length > 0 ? names.join(" ") : void 0;
144
- }
145
- function nearestParentProject(dir) {
146
- for (let up = path.dirname(dir); up !== dir; dir = up, up = path.dirname(dir)) {
147
- if (existsSync(path.join(up, SKAILE_YAML_DEFAULT))) return up;
148
- }
149
- return void 0;
150
- }
151
- function logNoProject(projectDir) {
152
- const dir = path.resolve(projectDir);
153
- logErr(`No ${S.cmd("skaile.yaml")} found. Run ${S.cmd("skaile init")} to create one.`);
154
- const parent = nearestParentProject(dir);
155
- if (parent) {
156
- const command = activeCommandPath ?? process.argv.slice(2).find((a) => !a.startsWith("-")) ?? "<command>";
157
- logErr(
158
- `${S.cmd(parent)} holds a ${S.cmd("skaile.yaml")}: run from there or put the option after the command name: ${S.cmd(`skaile ${command} --project-dir ${parent}`)}.`
159
- );
160
- }
161
- }
162
- function requireProjectConfig(projectDir, opts = {}) {
163
- const dir = path.resolve(projectDir);
164
- if (!existsSync(path.join(dir, SKAILE_YAML_DEFAULT))) {
165
- if (opts.allowMissing) return;
166
- logNoProject(dir);
167
- process.exit(1);
168
- }
169
- try {
170
- resolveSkWorkspaceConfig(dir);
171
- } catch (err) {
172
- logErr(err instanceof Error ? err.message : String(err));
173
- process.exit(1);
174
- }
175
- try {
176
- readLock(path.join(dir, "skaile.lock.yaml"));
177
- } catch (err) {
178
- if (err instanceof LockParseError) {
179
- logErr(err.message);
180
- process.exit(1);
181
- }
182
- }
183
- }
184
- function deferredWarnings() {
185
- const held = [];
186
- let live = false;
187
- return {
188
- push: (msg) => {
189
- if (live) logWarn(msg);
190
- else held.push(msg);
191
- },
192
- flush: () => {
193
- for (const msg of held.splice(0)) logWarn(msg);
194
- live = true;
195
- }
196
- };
197
- }
198
- var STALE_COPY_LIST_MAX = 5;
199
- function warnStaleHarnessCopies(am) {
200
- let stale;
201
- try {
202
- stale = am.listStaleHarnessCopies();
203
- } catch {
204
- return;
205
- }
206
- for (const harness of SUPPORTED_HARNESSES) {
207
- const rel = stale.filter((s) => s.harness === harness).map((s) => path.relative(am.projectDir, s.path));
208
- if (rel.length === 0) continue;
209
- const dir = `${rel[0]?.split(path.sep)[0] ?? harness}/`;
210
- const shown = rel.slice(0, STALE_COPY_LIST_MAX).join(", ");
211
- const more = rel.length > STALE_COPY_LIST_MAX ? `, +${rel.length - STALE_COPY_LIST_MAX} more` : "";
212
- logWarn(
213
- `Stale ${S.cmd(dir)} copies no longer managed (deploying to ${am.harness}): ${shown}${more}. Delete them with ${S.cmd(`skaile harness set ${am.harness} --clean`)}, or pass ${S.cmd(`--target ${harness}`)} to keep using ${dir}.`
214
- );
215
- }
216
- }
217
- function bareSoftDepName(ref) {
218
- return softDepName(ref);
219
- }
220
- function formatSoftDepHint(edge) {
221
- const suffix = edge.toRef ? ` \u2014 run \`skaile add ${edge.toRef}\` to include it.` : "";
222
- return `${bareSoftDepName(edge.from)} references ${bareSoftDepName(edge.to)} (soft dependency)${suffix}`;
223
- }
224
- function formatSoftDepSection(targets) {
225
- if (targets.length === 0) return [];
226
- const out = [` ${S.label("Soft dependencies (inferred)")}:`];
227
- for (const t of targets) out.push(` ${S.dim("\xB7")} ${t} ${S.dim("(soft)")}`);
228
- return out;
229
- }
230
- function formatSoftDepAddPreview(name, targets) {
231
- if (targets.length === 0) return "";
232
- return S.dim(`${name} references ${targets.join(", ")} (soft dep, not auto-added)`);
233
- }
234
- function formatSoftDepRemovePreview(name, targets) {
235
- if (targets.length === 0) return "";
236
- return S.dim(`removing ${name} would orphan ${targets.join(", ")} (soft dep)`);
237
- }
238
- function formatRelativeTime(date) {
239
- const diff = Date.now() - date.getTime();
240
- const seconds = Math.floor(diff / 1e3);
241
- if (seconds < 60) return "just now";
242
- const minutes = Math.floor(seconds / 60);
243
- if (minutes < 60) return `${minutes}m ago`;
244
- const hours = Math.floor(minutes / 60);
245
- if (hours < 24) return `${hours}h ago`;
246
- const days = Math.floor(hours / 24);
247
- return `${days}d ago`;
248
- }
249
- function reportLegacyOmpCopies(removed, kept = []) {
250
- for (const p of removed) {
251
- logInfo(
252
- S.dim(`removed the old omp copy ${p.replace(homedir(), "~")} (omp reads ~/.omp/agent)`)
253
- );
254
- }
255
- for (const p of kept) {
256
- logWarn(
257
- `${p.replace(homedir(), "~")} is an old omp location and skaile did not write this copy, so it was kept: delete it if you do not need it`
258
- );
259
- }
260
- }
261
- function parseHarnessFilter(raw) {
262
- if (!raw) return void 0;
263
- const ids = raw.split(",").map((s) => s.trim()).filter(Boolean);
264
- const out = [];
265
- for (const id of ids) {
266
- if (!SUPPORTED_HARNESSES.includes(id)) {
267
- logErr(unknownHarnessTargetMessage(id));
268
- process.exit(1);
269
- }
270
- out.push(id);
271
- }
272
- return out.length > 0 ? out : void 0;
273
- }
274
- var SUB_AGENT_MARKER = "You are a sub-agent:";
275
- function warnFilesOnlyDelegates(projectDir, target) {
276
- if (target !== "codex") return;
277
- const dir = path.join(projectDir, ".codex", "skaile-agents");
278
- let names;
279
- try {
280
- names = readdirSync(dir).filter((f) => f.endsWith(".md"));
281
- } catch {
282
- return;
283
- }
284
- const delegates = names.filter((f) => {
285
- try {
286
- return readFileSync(path.join(dir, f), "utf8").includes(SUB_AGENT_MARKER);
287
- } catch {
288
- return false;
289
- }
290
- }).map((f) => f.replace(/\.md$/, "")).sort();
291
- if (delegates.length === 0) return;
292
- logWarn(
293
- `codex: delegate agents are files only (${delegates.join(", ")}): Codex does not load .codex/agents as sub-agents, so the orchestrator cannot call them`
294
- );
295
- }
296
-
297
- export { KIND_COL_WIDTH, S, TARGET_DEFAULT_HINT, bareSoftDepName, colorRef, deferredWarnings, driverAliasOption, fitWidth, foldDriverFlag, formatRelativeTime, formatSoftDepAddPreview, formatSoftDepHint, formatSoftDepRemovePreview, formatSoftDepSection, friendlyHarnessError, harnessErrorNotes, kindColor, kindColorPad, logErr, logInfo, logNoProject, logOk, logWarn, logWarnErr, parseHarnessFilter, reportLegacyOmpCopies, requireProjectConfig, setActiveCommand, unknownHarnessMessage, unknownHarnessTargetMessage, warnFilesOnlyDelegates, warnPlaceholderBodies, warnStaleHarnessCopies };
298
- //# sourceMappingURL=chunk-V3EJYOP2.js.map
299
- //# sourceMappingURL=chunk-V3EJYOP2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../cli/src/harness-error.ts","../cli/src/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;AAWO,SAAS,sBAAsB,OAAA,EAAqC;AACzE,EAAA,MAAM,QAAQ,aAAA,EAAc,CAAE,IAAI,CAAC,CAAA,KAAM,EAAE,EAAE,CAAA;AAC7C,EAAA,IAAI,KAAA,CAAM,QAAA,CAAS,OAAO,CAAA,EAAG,OAAO,MAAA;AACpC,EAAA,OACE,CAAA,wBAAA,EAA2B,OAAO,CAAA,cAAA,EAAiB,KAAA,CAAM,IAAA,CAAK,IAAI,CAAC,CAAA,EAAA,EAChE,eAAe,CAAA,OAAA,EAA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,UAAU,eAAe,CAAA;AAC3D,EAAA,IAAI,KAAA;AACJ,EAAA,IAAI;AACF,IAAA,KAAA,GAAQ,WAAA,CAAY,GAAG,CAAA,CAAE,MAAA,CAAO,CAAC,CAAA,KAAM,CAAA,CAAE,QAAA,CAAS,KAAK,CAAC,CAAA;AAAA,EAC1D,CAAA,CAAA,MAAQ;AACN,IAAA;AAAA,EACF;AACA,EAAA,MAAM,SAAA,GAAY,KAAA,CACf,MAAA,CAAO,CAAC,CAAA,KAAM;AACb,IAAA,IAAI;AACF,MAAA,OAAO,YAAA,CAAa,KAAK,IAAA,CAAK,GAAA,EAAK,CAAC,CAAA,EAAG,MAAM,CAAA,CAAE,QAAA,CAAS,gBAAgB,CAAA;AAAA,IAC1E,CAAA,CAAA,MAAQ;AACN,MAAA,OAAO,KAAA;AAAA,IACT;AAAA,EACF,CAAC,CAAA,CACA,GAAA,CAAI,CAAC,CAAA,KAAM,CAAA,CAAE,OAAA,CAAQ,OAAA,EAAS,EAAE,CAAC,CAAA,CACjC,IAAA,EAAK;AACR,EAAA,IAAI,SAAA,CAAU,WAAW,CAAA,EAAG;AAC5B,EAAA,OAAA;AAAA,IACE,CAAA,uCAAA,EAA0C,SAAA,CAAU,IAAA,CAAK,IAAI,CAAC,CAAA,wFAAA;AAAA,GAChE;AACF","file":"chunk-V3EJYOP2.js","sourcesContent":["import { listHarnesses } from \"@skaile/workspaces/bridge\";\nimport { SUPPORTED_HARNESSES } from \"@skaile/workspaces/core\";\nimport { Option } from \"commander\";\n\n/**\n * The refusal for a harness name nothing registers, or `undefined` when it is known. One check\n * for `run` (also with `--dry-run`, so the plan never names a harness the real run refuses),\n * `repl` and `config set harness` (p1022). Load the project's plugins first: a plugin's harness\n * counts. The line names the other command group's names too (p1753), see\n * {@link unknownHarnessTargetMessage}.\n */\nexport function unknownHarnessMessage(harness: string): string | undefined {\n const known = listHarnesses().map((d) => d.id);\n if (known.includes(harness)) return undefined;\n return (\n `Unknown agent harness: \"${harness}\". Available: ${known.join(\", \")}. ` +\n `${DEPLOY_COMMANDS} take: ${SUPPORTED_HARNESSES.join(\", \")}.`\n );\n}\n\n/** The commands that write harness files, so they take the harness targets only. */\nconst DEPLOY_COMMANDS = \"harness set, init --harness and add --harness\";\n\n/**\n * The refusal for a name that is no harness target, for the commands that deploy files\n * (`harness set`, `init --harness`, `add --harness`, `integration --harness`). Same wording as\n * {@link unknownHarnessMessage}: the list is the targets, and the line names the commands that\n * run a session and take every registered harness (p1753).\n *\n * @param harness - The name the user typed.\n * @param extra - Further names the command takes, such as `all`.\n */\nexport function unknownHarnessTargetMessage(\n harness: string,\n extra: readonly string[] = [],\n): string {\n const targets = [...SUPPORTED_HARNESSES, ...extra];\n const registered = listHarnesses().map((d) => d.id);\n return (\n `Unknown agent harness: \"${harness}\". Available: ${targets.join(\", \")}. ` +\n `run, repl and config set harness take: ${registered.join(\", \")}.`\n );\n}\n\nlet warnedDriverFlag = false;\n\n/** Print the `--driver` deprecation line to stderr, once per process. */\nexport function warnDriverFlagDeprecated(): void {\n if (warnedDriverFlag) return;\n warnedDriverFlag = true;\n console.error(\"--driver is deprecated; use --harness\");\n}\n\n/**\n * The hidden `--driver <name>` option every command with `--harness <name>` keeps for one\n * major release: an alias that sets the same value (`--harness` wins when both are given).\n */\nexport function driverAliasOption(): Option {\n return new Option(\"--driver <name>\", \"Deprecated alias of --harness\").hideHelp();\n}\n\n/**\n * Fold a parsed `--driver` alias into `harness`: when `--driver` was given, print the\n * deprecation line once and use its value unless `--harness` (or `fallback`, when neither\n * flag was given) already decided. Returns `opts` with `harness` set and `driver` removed.\n */\nexport function foldDriverFlag<T extends { harness?: string; driver?: string }>(\n opts: T,\n fallback?: string,\n): Omit<T, \"driver\"> & { harness?: string } {\n const { driver, ...rest } = opts;\n if (driver !== undefined) warnDriverFlagDeprecated();\n return { ...rest, harness: rest.harness ?? driver ?? fallback };\n}\n\n/**\n * Turn a harness-start/prompt failure into a friendly, actionable message when the\n * cause is a missing/unusable agent binary; otherwise return `null` so the caller\n * surfaces the raw error unchanged.\n *\n * The bridge classifies these as `category: \"config\"` and carries a `hint`, but the\n * shape reaching the CLI varies: omp's `start()` rejects with the raw spawn error\n * (`code === \"ENOENT\"`), while the subprocess CLI harnesses reject with the classified\n * `AgentError` attached under `.detail`. Duck-type across all of them.\n */\nexport function friendlyHarnessError(err: unknown): string | null {\n const e = err as\n | {\n code?: string;\n syscall?: string;\n message?: string;\n category?: string;\n hint?: string;\n detail?: { category?: string; hint?: string };\n }\n | null\n | undefined;\n if (!e) return null;\n\n // A missing binary is a *spawn* ENOENT (`syscall: \"spawn <bin>\"` / \"spawn … ENOENT\");\n // a bare ENOENT from connector/mount setup is a different failure, not the harness.\n const isSpawnEnoent =\n e.code === \"ENOENT\" &&\n (e.syscall?.startsWith(\"spawn\") === true || /^spawn .*ENOENT/.test(e.message ?? \"\"));\n const isConfig = e.category === \"config\" || e.detail?.category === \"config\";\n if (!isSpawnEnoent && !isConfig) return null;\n\n const hint = e.hint ?? e.detail?.hint;\n const base = hint ?? \"The configured agent binary is not installed or not on your PATH.\";\n return `${base}\\nTry a different harness with \\`--harness claude-sdk\\`.`;\n}\n\n/**\n * Lines that follow the single `✗` line of a failed turn: the classifier's hint\n * (or, for a rejected credential, a pointer at the key), and where the full\n * records are. The JSON records themselves are not printed on the terminal:\n * they live in the project's log database. The pointer names the session whose records\n * the failure left (`logSessionId`); a failure before any session started has none and\n * gets no pointer.\n */\nexport function harnessErrorNotes(err: unknown): string[] {\n const e = err as\n | {\n category?: string;\n hint?: string;\n logSessionId?: string;\n detail?: { category?: string; hint?: string };\n }\n | null\n | undefined;\n const notes: string[] = [];\n const category = e?.category ?? e?.detail?.category;\n const hint = e?.hint ?? e?.detail?.hint;\n if (hint && category !== \"config\") notes.push(hint);\n else if (category === \"auth\") notes.push(\"Check your API key or login.\");\n if (e?.logSessionId) {\n notes.push(`Full records: .skaile/logs.db (skaile session logs ${e.logSessionId}).`);\n }\n return notes;\n}\n","import { existsSync, readdirSync, readFileSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport path from \"node:path\";\nimport { softDepName } from \"@skaile/workspaces/asset-manager\";\nimport {\n type HarnessName,\n LockParseError,\n readLock,\n resolveSkWorkspaceConfig,\n SKAILE_YAML_DEFAULT,\n SUPPORTED_HARNESSES,\n} from \"@skaile/workspaces/core\";\nimport pc from \"picocolors\";\nimport { unknownHarnessTargetMessage } from \"./harness-error.ts\";\n\n/**\n * Terminal styling helpers used across all CLI commands.\n *\n * @docLink cli/dev-guide#helpers\n */\nexport const S = {\n brand: (s: string) => pc.cyan(pc.bold(s)),\n cmd: (s: string) => pc.cyan(s),\n heading: (s: string) => pc.bold(s),\n bold: (s: string) => pc.bold(s),\n dim: (s: string) => pc.dim(s),\n ok: (s: string) => pc.green(s),\n warn: (s: string) => pc.yellow(s),\n err: (s: string) => pc.red(s),\n label: (s: string) => pc.dim(s),\n rule: (w = 40) => pc.dim(\"─\".repeat(w)),\n};\n\nconst KIND_COLORS: Record<string, (s: string) => string> = {\n skill: pc.blue,\n agent: pc.magenta,\n prompt: pc.yellow,\n flow: pc.green,\n preset: pc.cyan,\n contract: pc.red,\n connector: pc.green,\n knowledge: pc.cyan,\n persona: pc.cyan,\n ruleset: pc.cyan,\n \"mcp-server\": pc.magenta,\n};\n\n/**\n * Fit a plain (ANSI-free) string into exactly `width` columns: truncate with a\n * trailing `…` when too long, pad with spaces when too short. Keeps fixed-width\n * columns from overflowing the row when a value (e.g. an asset name) is wider\n * than its budget.\n */\nexport function fitWidth(s: string, width: number): string {\n if (width <= 0) return \"\";\n if (s.length > width) return width === 1 ? \"…\" : `${s.slice(0, width - 1)}…`;\n return s.padEnd(width);\n}\n\n/** Color-code an asset kind string. */\nexport function kindColor(kind: string): string {\n const colorFn = KIND_COLORS[kind] ?? pc.dim;\n return colorFn(kind);\n}\n\n/**\n * Widest kind label (`mcp-server`); the default kind-column width fits it so\n * long kinds don't shove the rest of the row out of alignment.\n */\nexport const KIND_COL_WIDTH = 10;\n\n/**\n * Shared `--target` help suffix: with no flag, the manager deploys into the\n * harness the project is configured for (the harness `skaile config show`\n * resolves), and only then falls back to `claude-code`.\n */\nexport const TARGET_DEFAULT_HINT = \"default: the project's configured harness, else claude-code\";\n\n/**\n * Color-code an asset kind string fit to exactly `width` columns — pads short\n * kinds, truncates over-long ones (via {@link fitWidth}) so the column can never\n * overflow and break row alignment.\n */\nexport function kindColorPad(kind: string, width = KIND_COL_WIDTH): string {\n const colorFn = KIND_COLORS[kind] ?? pc.dim;\n return colorFn(fitWidth(kind, width));\n}\n\n/** Color-code a \"kind:name\" reference string. */\nexport function colorRef(ref: string): string {\n const colonIdx = ref.indexOf(\":\");\n if (colonIdx === -1) return ref;\n const kind = ref.slice(0, colonIdx);\n const rest = ref.slice(colonIdx);\n return `${kindColor(kind)}${rest}`;\n}\n\n/**\n * Print a success line prefixed with a green check mark.\n *\n * @param msg - Message to display.\n * @docLink cli/dev-guide#helpers\n */\nexport function logOk(msg: string) {\n console.log(` ${pc.green(\"✓\")} ${msg}`);\n}\n/**\n * Print an error line prefixed with a red cross to stderr.\n *\n * @param msg - Message to display.\n * @docLink cli/dev-guide#helpers\n */\nexport function logErr(msg: string) {\n console.error(` ${pc.red(\"✗\")} ${msg}`);\n}\n/**\n * Print a warning line prefixed with a yellow exclamation mark.\n *\n * @param msg - Message to display.\n * @docLink cli/dev-guide#helpers\n */\nexport function logWarn(msg: string) {\n console.log(` ${pc.yellow(\"!\")} ${msg}`);\n}\n/**\n * Like {@link logWarn}, on stderr: a warning about the run itself (an asset scan that stopped\n * early) that must not land in the output a script reads from stdout.\n *\n * @param msg - Message to display.\n */\nexport function logWarnErr(msg: string) {\n console.error(` ${pc.yellow(\"!\")} ${msg}`);\n}\n/**\n * One `!` line per deployed library asset whose body or description is still the untouched\n * `library create` scaffold: `validate` and the publish plan fail both, so `add`, `install` and\n * `update` name every placeholder they fail (p926).\n *\n * @param bodies - Canonical refs the asset manager reported as placeholder bodies.\n * @param descriptions - Canonical refs the asset manager reported as placeholder descriptions.\n */\nexport function warnPlaceholderBodies(\n bodies: readonly string[] | undefined,\n descriptions?: readonly string[],\n) {\n const refs = [...new Set([...(bodies ?? []), ...(descriptions ?? [])])];\n for (const ref of refs) {\n const parts = [\n ...(descriptions?.includes(ref) ? [\"description\"] : []),\n ...(bodies?.includes(ref) ? [\"body\"] : []),\n ];\n const both = parts.length > 1;\n logWarn(\n `${ref} ${parts.join(\" and \")} ${both ? \"are\" : \"is\"} still the scaffold placeholder; write ${both ? \"them\" : \"it\"} (\\`skaile validate\\` fails ${both ? \"them\" : \"it\"})`,\n );\n }\n}\n/**\n * Print an info line prefixed with a dim dot.\n *\n * @param msg - Message to display.\n * @docLink cli/dev-guide#helpers\n */\nexport function logInfo(msg: string) {\n console.log(` ${pc.dim(\"·\")} ${msg}`);\n}\n\n/** Full command path of the command being run (`harness set`), set before its action runs. */\nlet activeCommandPath: string | undefined;\n\n/**\n * Record the command that is about to run, as the path of subcommand names from the root\n * (`harness set`), so advice that repeats the command shows the whole path (p1656).\n */\nexport function setActiveCommand(cmd: { name(): string; parent: unknown }): void {\n const names: string[] = [];\n for (\n let c: { name(): string; parent: unknown } | null = cmd;\n c && c.parent;\n c = c.parent as { name(): string; parent: unknown } | null\n ) {\n names.unshift(c.name());\n }\n activeCommandPath = names.length > 0 ? names.join(\" \") : undefined;\n}\n\n/** The nearest parent directory of `dir` that holds a `skaile.yaml`, or `undefined`. */\nfunction nearestParentProject(dir: string): string | undefined {\n for (let up = path.dirname(dir); up !== dir; dir = up, up = path.dirname(dir)) {\n if (existsSync(path.join(up, SKAILE_YAML_DEFAULT))) return up;\n }\n return undefined;\n}\n\n/**\n * Print the `No skaile.yaml found` line for `projectDir`, plus a second line naming the nearest\n * parent directory that holds a `skaile.yaml`, when there is one: skaile does not search parent\n * directories. The line shows `--project-dir` after the full command path (`skaile harness set\n * --project-dir /x`), the only place the option is accepted (p1656).\n */\nexport function logNoProject(projectDir: string): void {\n const dir = path.resolve(projectDir);\n logErr(`No ${S.cmd(\"skaile.yaml\")} found. Run ${S.cmd(\"skaile init\")} to create one.`);\n const parent = nearestParentProject(dir);\n if (parent) {\n const command =\n activeCommandPath ?? process.argv.slice(2).find((a) => !a.startsWith(\"-\")) ?? \"<command>\";\n logErr(\n `${S.cmd(parent)} holds a ${S.cmd(\"skaile.yaml\")}: run from there or put the option after the command name: ${S.cmd(`skaile ${command} --project-dir ${parent}`)}.`,\n );\n }\n}\n\n/**\n * Stop a project command that has no usable project: print one `✗` line and exit 1, before\n * the command deploys, undeploys, locks or clones anything. Two causes: no `skaile.yaml` in\n * `projectDir` (`No skaile.yaml found`), or a `skaile.yaml` — project, app or user scope —\n * that does not parse (`<file> — parse error: …`, a duplicate key included). Without this a\n * broken file would read as \"nothing declared\" and `install` would undeploy every asset.\n *\n * Library-level commands (`library …`, `search`, `init`) have no project and do not call it.\n */\nexport function requireProjectConfig(\n projectDir: string,\n opts: { allowMissing?: boolean } = {},\n): void {\n const dir = path.resolve(projectDir);\n if (!existsSync(path.join(dir, SKAILE_YAML_DEFAULT))) {\n if (opts.allowMissing) return;\n logNoProject(dir);\n process.exit(1);\n }\n try {\n resolveSkWorkspaceConfig(dir);\n } catch (err) {\n logErr(err instanceof Error ? err.message : String(err));\n process.exit(1);\n }\n // A lock that is not valid YAML is not \"nothing locked\": `update` would overwrite it and\n // `outdated`/`why`/`check` would call every asset unlocked. One line, exit 1 (p1892).\n try {\n readLock(path.join(dir, \"skaile.lock.yaml\"));\n } catch (err) {\n if (err instanceof LockParseError) {\n logErr(err.message);\n process.exit(1);\n }\n // Another lock problem (an old schema) has its own message where the lock is used.\n }\n}\n\n/**\n * Hold warnings raised while a spinner animates and print them once it stops:\n * on a TTY a line written mid-spin is overwritten by the next frame. Pass\n * `push` as `AssetManager`'s `onLibraryCollision`, call `flush()` after\n * `spinner.stop(...)`. Warnings pushed after `flush()` print immediately.\n */\nexport function deferredWarnings(): { push: (msg: string) => void; flush: () => void } {\n const held: string[] = [];\n let live = false;\n return {\n push: (msg) => {\n if (live) logWarn(msg);\n else held.push(msg);\n },\n flush: () => {\n for (const msg of held.splice(0)) logWarn(msg);\n live = true;\n },\n };\n}\n\n/** Max stale copies of one harness named inline by {@link warnStaleHarnessCopies}. */\nconst STALE_COPY_LIST_MAX = 5;\n\n/**\n * Print one warning per harness whose project dir (`.claude/`, `.omp/`, `.codex/`) still holds\n * copies of tracked assets although the project deploys to another harness: after `skaile\n * harness set`, or when a project moved off the old default. Those copies are orphans: `remove`\n * / `clean` / `list` only look in the active harness dir. Every file a deploy created is named\n * (p1671). Nothing is deleted here; `skaile harness set <name> --clean` deletes them. Silent when\n * there are none.\n */\nexport function warnStaleHarnessCopies(am: {\n projectDir: string;\n harness: string;\n listStaleHarnessCopies(): Array<{ harness: HarnessName; path: string }>;\n}): void {\n let stale: Array<{ harness: HarnessName; path: string }>;\n try {\n stale = am.listStaleHarnessCopies();\n } catch {\n return; // advisory only — never fail the command\n }\n for (const harness of SUPPORTED_HARNESSES) {\n const rel = stale\n .filter((s) => s.harness === harness)\n .map((s) => path.relative(am.projectDir, s.path));\n if (rel.length === 0) continue;\n const dir = `${rel[0]?.split(path.sep)[0] ?? harness}/`;\n const shown = rel.slice(0, STALE_COPY_LIST_MAX).join(\", \");\n const more =\n rel.length > STALE_COPY_LIST_MAX ? `, +${rel.length - STALE_COPY_LIST_MAX} more` : \"\";\n logWarn(\n `Stale ${S.cmd(dir)} copies no longer managed (deploying to ${am.harness}): ${shown}${more}. ` +\n `Delete them with ${S.cmd(`skaile harness set ${am.harness} --clean`)}, or pass ${S.cmd(`--target ${harness}`)} to keep using ${dir}.`,\n );\n }\n}\n\n/**\n * Bare asset name of a canonical soft-dep target ref (`@pub/name@ver` → `name`),\n * for compact rendering in `info` / `tree` / `why`. Delegates to the asset-manager\n * parser (the soft-dep read surface) so the two never diverge.\n */\nexport function bareSoftDepName(ref: string): string {\n return softDepName(ref);\n}\n\n/**\n * The report-only soft-dep hint line shared by the `add` no-TTY branch and the\n * `install` surface, so the two user-facing wordings can't drift. Appends a\n * runnable `skaile add` suffix only when the target has a parseable ref.\n */\nexport function formatSoftDepHint(edge: { from: string; to: string; toRef?: string }): string {\n const suffix = edge.toRef ? ` — run \\`skaile add ${edge.toRef}\\` to include it.` : \"\";\n return `${bareSoftDepName(edge.from)} references ${bareSoftDepName(edge.to)} (soft dependency)${suffix}`;\n}\n\n/**\n * Build the \"Soft dependencies (inferred)\" section for `skaile info`. Returns one\n * header line plus one line per soft-dep target, each marked `(soft)` to read\n * differently from a typed `requires`. Empty array when there are no soft deps,\n * so the caller prints nothing.\n */\nexport function formatSoftDepSection(targets: string[]): string[] {\n if (targets.length === 0) return [];\n const out = [` ${S.label(\"Soft dependencies (inferred)\")}:`];\n for (const t of targets) out.push(` ${S.dim(\"·\")} ${t} ${S.dim(\"(soft)\")}`);\n return out;\n}\n\n/**\n * Footer line previewing the soft deps that *adding* the highlighted asset would\n * reference (manage TUI). \"references\" + \"not auto-added\" makes clear the pull is\n * report-only. Empty string when there are no targets, so the caller clears.\n */\nexport function formatSoftDepAddPreview(name: string, targets: string[]): string {\n if (targets.length === 0) return \"\";\n return S.dim(`${name} references ${targets.join(\", \")} (soft dep, not auto-added)`);\n}\n\n/**\n * Footer line previewing the soft deps that *removing* the highlighted asset\n * would orphan (manage TUI) — symmetric with {@link formatSoftDepAddPreview}.\n * Empty string when nothing would be orphaned, so the caller clears.\n */\nexport function formatSoftDepRemovePreview(name: string, targets: string[]): string {\n if (targets.length === 0) return \"\";\n return S.dim(`removing ${name} would orphan ${targets.join(\", \")} (soft dep)`);\n}\n\n/** Format a Date as a human-readable relative time string (e.g. \"5m ago\"). */\nexport function formatRelativeTime(date: Date): string {\n const diff = Date.now() - date.getTime();\n const seconds = Math.floor(diff / 1000);\n if (seconds < 60) return \"just now\";\n const minutes = Math.floor(seconds / 60);\n if (minutes < 60) return `${minutes}m ago`;\n const hours = Math.floor(minutes / 60);\n if (hours < 24) return `${hours}h ago`;\n const days = Math.floor(hours / 24);\n return `${days}d ago`;\n}\n\n/** Name the old `~/.omp/<dir>` copies a global deploy replaced (omp reads `~/.omp/agent/<dir>`). */\nexport function reportLegacyOmpCopies(removed: string[], kept: string[] = []): void {\n for (const p of removed) {\n logInfo(\n S.dim(`removed the old omp copy ${p.replace(homedir(), \"~\")} (omp reads ~/.omp/agent)`),\n );\n }\n for (const p of kept) {\n logWarn(\n `${p.replace(homedir(), \"~\")} is an old omp location and skaile did not write this copy, so it was kept: delete it if you do not need it`,\n );\n }\n}\n\n/**\n * Parse a `--harness a,b` value into validated {@link HarnessName}s, exiting on\n * an unknown id. Returns `undefined` when the flag is absent (the caller then\n * resolves the full global harness set).\n */\nexport function parseHarnessFilter(raw: string | undefined): HarnessName[] | undefined {\n if (!raw) return undefined;\n const ids = raw\n .split(\",\")\n .map((s) => s.trim())\n .filter(Boolean);\n const out: HarnessName[] = [];\n for (const id of ids) {\n if (!(SUPPORTED_HARNESSES as string[]).includes(id)) {\n logErr(unknownHarnessTargetMessage(id));\n process.exit(1);\n }\n out.push(id as HarnessName);\n }\n return out.length > 0 ? out : undefined;\n}\n\n/** The sentence the agent renderer puts into a delegate sub-agent's file (`asset-manager` fragments). */\nconst SUB_AGENT_MARKER = \"You are a sub-agent:\";\n\n/**\n * One line when a Codex project holds delegate sub-agents. Codex does not load\n * `.codex/agents/*.toml` as spawnable agents (its `spawn_agent` has no `agent_type`), so the\n * delegate exists only as a file there and the orchestrator cannot call it (p428). A delegate is\n * found by the sentence the renderer writes into its file. Silent for every other harness.\n */\nexport function warnFilesOnlyDelegates(projectDir: string, target: string): void {\n if (target !== \"codex\") return;\n const dir = path.join(projectDir, \".codex\", \"skaile-agents\");\n let names: string[];\n try {\n names = readdirSync(dir).filter((f) => f.endsWith(\".md\"));\n } catch {\n return;\n }\n const delegates = names\n .filter((f) => {\n try {\n return readFileSync(path.join(dir, f), \"utf8\").includes(SUB_AGENT_MARKER);\n } catch {\n return false;\n }\n })\n .map((f) => f.replace(/\\.md$/, \"\"))\n .sort();\n if (delegates.length === 0) return;\n logWarn(\n `codex: delegate agents are files only (${delegates.join(\", \")}): Codex does not load .codex/agents as sub-agents, so the orchestrator cannot call them`,\n );\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../core/src/models.ts"],"names":[],"mappings":";;;AAoCA,IAAM,aAAA,GAAgB,2DAAA;AAYf,SAAS,SAAS,CAAA,EAAuB;AAC9C,EAAA,MAAM,OAAA,GAAU,EAAE,IAAA,EAAK;AACvB,EAAA,MAAM,MAAA,GAAS,aAAA,CAAc,IAAA,CAAK,OAAO,CAAA;AACzC,EAAA,IAAI,MAAA,EAAQ;AACV,IAAA,IAAI,IAAA,GAAO,OAAO,CAAC,CAAA;AACnB,IAAA,IAAI,GAAA,GAAM,MAAA,CAAO,CAAC,CAAA,EAAG,MAAK,IAAK,MAAA;AAC/B,IAAA,MAAM,EAAA,GAAK,IAAA,CAAK,OAAA,CAAQ,GAAG,CAAA;AAC3B,IAAA,IAAI,KAAK,CAAA,EAAG;AACV,MAAA,GAAA,KAAQ,IAAA,CAAK,KAAA,CAAM,EAAA,GAAK,CAAC,CAAA,IAAK,MAAA;AAC9B,MAAA,IAAA,GAAO,IAAA,CAAK,KAAA,CAAM,CAAA,EAAG,EAAE,CAAA;AAAA,IACzB;AACA,IAAA,MAAM,GAAA,GAAkB,EAAE,IAAA,EAAM,MAAA,CAAO,CAAC,CAAA,IAAK,OAAA,EAAS,IAAA,EAAM,SAAA,EAAW,MAAA,CAAO,CAAC,CAAA,EAAE;AACjF,IAAA,IAAI,GAAA,MAAS,GAAA,GAAM,GAAA;AACnB,IAAA,OAAO,GAAA;AAAA,EACT;AACA,EAAA,MAAM,CAAA,GAAI,OAAA,CAAQ,OAAA,CAAQ,GAAG,CAAA;AAC7B,EAAA,IAAI,MAAM,EAAA,EAAI;AACZ,IAAA,MAAM,OAAO,OAAA,CAAQ,KAAA,CAAM,CAAA,EAAG,CAAC,EAAE,IAAA,EAAK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\n */\n\nimport semver from \"semver\";\n\n/**\n * Discriminator for catalog entries and asset references.\n * Used in asset ref strings (e.g. `'skill:my-skill'`, `'agent:my-agent'`).\n *\n * Any string: the provider registry (`@skaile/workspaces/discovery`\n * `AssetKindRegistry`) is the only authority on which kinds exist — a kind exists\n * iff a provider is registered for it.\n * @docLink packages/core/concepts#asset-kind\n */\nexport type AssetKind = string;\n\n// ── Dependency ────────────────────────────────────────────────────────────────\n\n/**\n * Declared dependency on another catalog asset.\n * @docLink packages/core/concepts#dependency\n */\nexport interface Dependency {\n /** Asset kind (e.g. \"skill\", \"agent\", \"contract\"). */\n kind: string;\n /** Asset name within that kind. */\n name: string;\n /** Canonical publisher namespace (when known). Absent: the declaring asset's own publisher. */\n publisher?: string;\n /** Version pin (`#<version>` or legacy `@<version>` suffix), when the declaration carried one. */\n pin?: string;\n}\n\n// `[kind:]@<publisher>/<name>[#<pin>]`, with the legacy npm-style `@<version>` suffix on the\n// name. Lenient on the name (the strict grammar runs later, at resolution).\nconst SCOPED_DEP_RE = /^(?:([a-z][a-z0-9-]*):)?@([^/\\s]+)\\/([^#\\s]+?)(?:#(.+))?$/;\n\n/**\n * Parse a dependency string: `\"kind:name\"`, a bare `\"name\"` (kind defaults to `\"skill\"`), or\n * a publisher-qualified `\"kind:@publisher/name[#pin]\"` / `\"@publisher/name[#pin]\"`. The\n * qualified forms fill `publisher` (and `pin`); the other forms leave it absent so the dep\n * resolves under the declaring asset's own publisher.\n *\n * @param s - Dependency string, e.g. `\"skill:use-exa\"`, `\"use-exa\"` or `\"skill:@acme/use-exa#^1.0.0\"`\n * @returns Parsed `{ kind, name, publisher?, pin? }` dependency object\n * @docLink packages/core/concepts#parse-dep\n */\nexport function parseDep(s: string): Dependency {\n const trimmed = s.trim();\n const scoped = SCOPED_DEP_RE.exec(trimmed);\n if (scoped) {\n let name = scoped[3];\n let pin = scoped[4]?.trim() || undefined;\n const at = name.indexOf(\"@\");\n if (at > 0) {\n pin ??= name.slice(at + 1) || undefined;\n name = name.slice(0, at);\n }\n const dep: Dependency = { kind: scoped[1] ?? \"skill\", name, publisher: scoped[2] };\n if (pin) dep.pin = pin;\n return dep;\n }\n const i = trimmed.indexOf(\":\");\n if (i !== -1) {\n const kind = trimmed.slice(0, i).trim();\n const name = trimmed.slice(i + 1).trim();\n return { kind, name };\n }\n return { kind: \"skill\", name: trimmed };\n}\n\n/**\n * Serialize a Dependency back to its string form: `\"kind:name\"`, or\n * `\"kind:@publisher/name[#pin]\"` when it names a publisher.\n *\n * @param d - Dependency to serialize\n * @returns String in `\"kind:name\"` / `\"kind:@publisher/name[#pin]\"` format\n * @docLink packages/core/concepts#dep-to-str\n */\nexport function depToStr(d: Dependency): string {\n const pin = d.pin ? `#${d.pin}` : \"\";\n return d.publisher ? `${d.kind}:@${d.publisher}/${d.name}${pin}` : `${d.kind}:${d.name}${pin}`;\n}\n\n// ── CatalogEntry ──────────────────────────────────────────────────────────────\n\n/**\n * A resolved catalog entry describing an installable asset.\n * Produced by manifest parsers and stored in the catalog YAML.\n * @docLink packages/core/concepts#catalog-entry\n */\nexport interface CatalogEntry {\n /** Unique asset name within its kind. */\n name: string;\n /** Asset kind discriminator. */\n kind: AssetKind;\n /** Short description of what this asset does. */\n description: string;\n /** Absolute path to manifest file */\n source: string;\n /** Canonical publisher namespace this asset belongs to (formerly `repository`). */\n publisher?: string;\n /**\n * Canonical ref (`kind:@publisher/name#version`) the CLI prints for this entry.\n * Set by the asset manager where `publisher` is not the real publisher (a\n * clone-sourced entry carries its clone key there); absent → derived from\n * `publisher` + `version`.\n */\n canonicalRef?: string;\n /**\n * `\"<org>/<repo>\"` coordinate the asset came from. Absent → the asset groups\n * directly under its publisher (local library with no git remote, or a\n * non-GitHub source).\n */\n repo?: string;\n /**\n * Claude plugin (from `.claude-plugin/marketplace.json` / `plugin.json`\n * membership) this asset belongs to, or absent when no plugin lists it.\n * Display-only — groups assets in the manage TUI; never part of identity or\n * the install layout.\n */\n plugin?: string;\n /** Semantic version string (may be empty if not declared in the manifest). */\n version: string;\n /** Skills, agents, or other assets this entry depends on. */\n requires: Dependency[];\n /** Asset refs this entry pulls in (presets: the asset items; flows: `requires`). */\n dependencies: string[];\n /** Presets only: instance items (`library://`, placeholder, connector/mcp) a dependency expansion skips; absent when none. */\n skippedItems?: number;\n /**\n * Kind-specific metadata extracted from the manifest frontmatter.\n * Used by MCP servers to carry default config (transport, command, args, env, url, headers)\n * so that `mcp:name` dependency refs resolve to a runnable declaration without\n * requiring verbose inline config in `skaile.yaml`.\n */\n metadata?: Record<string, unknown>;\n /** Curated facet, surfaced as a badge in the manage TUI (not a tree axis). */\n category?: string;\n /** Store-listing keywords (manifest `assets[].keywords`, else frontmatter). */\n keywords?: string[];\n /** Store-listing license (manifest `assets[].license`, else repo-level default). */\n license?: string;\n /** Store-listing homepage (manifest `assets[].homepage`, else repo-level default). */\n homepage?: string;\n}\n\n/**\n * Construct a CatalogEntry from a raw deserialized record (e.g. from catalog.yaml).\n *\n * @param d - Raw object with loosely typed fields\n * @returns Normalized CatalogEntry\n * @docLink packages/core/concepts#entry-from-raw\n */\nexport function entryFromRaw(d: Record<string, unknown>): CatalogEntry {\n const rawDeps = d.dependencies;\n const deps = Array.isArray(rawDeps) ? (rawDeps as string[]).filter(Boolean) : [];\n const entry: CatalogEntry = {\n name: String(d.name ?? \"\"),\n kind: String(d.kind ?? \"skill\") as AssetKind,\n description: String(d.description ?? \"\"),\n source: String(d.source ?? \"\"),\n publisher: d.publisher != null ? String(d.publisher) : undefined,\n repo: d.repo != null ? String(d.repo) : undefined,\n plugin: d.plugin != null ? String(d.plugin) : undefined,\n version: String(d.version ?? \"\"),\n requires: Array.isArray(d.requires)\n ? (d.requires as string[]).filter(Boolean).map(parseDep)\n : [],\n dependencies: deps,\n };\n if (d.metadata != null && typeof d.metadata === \"object\" && !Array.isArray(d.metadata)) {\n entry.metadata = d.metadata as Record<string, unknown>;\n }\n if (d.category != null) entry.category = String(d.category);\n if (Array.isArray(d.keywords)) {\n entry.keywords = (d.keywords as unknown[]).filter((k): k is string => typeof k === \"string\");\n }\n if (d.license != null) entry.license = String(d.license);\n if (d.homepage != null) entry.homepage = String(d.homepage);\n return entry;\n}\n\n/**\n * Serialize a CatalogEntry to a plain record suitable for YAML/JSON persistence.\n *\n * @param e - CatalogEntry to serialize\n * @returns Plain object with string-serialized requires and dependencies\n * @docLink packages/core/concepts#entry-to-raw\n */\nexport function entryToRaw(e: CatalogEntry): Record<string, unknown> {\n const raw: Record<string, unknown> = {\n name: e.name,\n kind: e.kind,\n description: e.description,\n source: e.source,\n publisher: e.publisher,\n repo: e.repo,\n version: e.version,\n ...(e.plugin != null ? { plugin: e.plugin } : {}),\n requires: e.requires.map(depToStr),\n dependencies: e.dependencies,\n };\n if (e.metadata) raw.metadata = e.metadata;\n if (e.category != null) raw.category = e.category;\n if (e.keywords && e.keywords.length > 0) raw.keywords = e.keywords;\n if (e.license != null) raw.license = e.license;\n if (e.homepage != null) raw.homepage = e.homepage;\n return raw;\n}\n\n// ── AssetRef ─────────────────────────────────────────────────────────────────\n\n/**\n * A parsed asset reference: `kind:@<publisher>/name[#pin]`.\n *\n * `publisher` is the canonical, GitHub-shaped publisher namespace (≤39 chars,\n * alphanumeric+hyphen). `pin` is a SemVer constraint, exact SHA, or absent.\n * Floating refs (`main`, `latest`, `HEAD`) are rejected at parse time.\n *\n * Produced by `parseAssetRef`; consumed by `resolveAsset` and `resolveAll`.\n * @docLink packages/core/concepts#asset-ref\n */\nexport interface AssetRef {\n kind: string;\n name: string;\n /** Canonical publisher namespace. Optional only for ambiguity-resolution\n * during migration; new manifests require it. */\n publisher?: string;\n /** SemVer constraint (^1.4.0, ~1.4, 1.x, exact 1.4.0), 40-char SHA, or undefined. */\n pin?: string;\n}\n\nconst SHA_RE = /^[0-9a-f]{40}$/i;\n\n// Scoped grammar: `kind:@publisher/name[#version]`. The publisher sub-pattern is\n// GitHub-shaped (1-39 chars, alphanumeric + single hyphens, no leading/trailing or\n// double hyphen); `@` is the scope sigil and `#` the version sigil. `name` is\n// intentionally permissive (`[^/#\\s]+` — only the structural separators are\n// forbidden); floating-ref rejection stays in `isValidPin`, so `#main`/`#latest`\n// match here and fail there with a clear message.\nconst SCOPED_REF_RE =\n /^(?:([a-z][a-z0-9-]*):)?@([A-Za-z0-9](?:[A-Za-z0-9]|-(?!-)){0,37}[A-Za-z0-9]|[A-Za-z0-9])\\/([^/#\\s]+)(?:#(.+))?$/;\n\n// Canonical asset-name grammar: lowercase kebab-case (npm-style, scope-free) —\n// `a-z` / `0-9` segments joined by single hyphens, 1-64 characters, no leading/trailing hyphen,\n// no uppercase, spaces, dots, or underscores. Names become directory names,\n// lock keys, and CLI args, so the constraint is intentionally narrow.\nconst ASSET_NAME_RE = /^(?=.{1,64}$)[a-z0-9]+(?:-[a-z0-9]+)*$/;\n\n// Diagnostic-only matcher: a ref carrying a `kind:@publisher/` scope prefix,\n// capturing whatever follows (sans `#pin`) as the candidate name. Used solely\n// to tell \"missing publisher\" apart from \"malformed name\" when the strict\n// grammar above fails (e.g. a space in the name).\nconst SCOPE_PREFIX_RE = /^(?:[a-z][a-z0-9-]*:)?@[^/\\s]+\\/([^#]+?)(?:#.*)?$/;\n\n/** Human-readable statement of the canonical asset-name rule. */\nexport const ASSET_NAME_HINT =\n 'names must be lowercase kebab-case (a-z, 0-9, single hyphens; at most 64 characters; e.g. \"cli-concept\")';\n\n/**\n * True when `name` is a canonical asset name: lowercase kebab-case, scope-free.\n *\n * This is the single source of truth for asset-name validity — `parseAssetRef`\n * enforces it, and `skaile validate` reports violations across a repo tree.\n * @docLink packages/core/concepts#is-valid-asset-name\n */\nexport function isValidAssetName(name: string): boolean {\n return ASSET_NAME_RE.test(name);\n}\n\n// The one publisher slug: 1-39 chars, lowercase letters and digits, single `-`\n// inside, no leading/trailing hyphen. The lowercase form of the publisher grammar of\n// `SCOPED_REF_RE`, so every publisher accepted here also parses in a\n// `kind:@<publisher>/name` ref.\nconst PUBLISHER_RE = /^[a-z0-9](?:[a-z0-9]|-(?!-)){0,37}[a-z0-9]$|^[a-z0-9]$/;\n\n/** Human-readable statement of the publisher rule, shared by every command that checks one. */\nexport const PUBLISHER_HINT =\n 'publishers must be a bare name of 1-39 characters: lowercase letters, digits and single hyphens inside (like \"acme\" or \"my-lib\"), with no @, /, #, dots, underscores or spaces and no leading or trailing hyphen';\n\n/**\n * True when `publisher` is a valid bare publisher slug (see {@link PUBLISHER_HINT}).\n * The one rule behind `library create --publisher`, `library set <lib> publisher=`,\n * `asset import --publisher`, `library index`, `validate` and the publish plan; the\n * caller strips a leading `@` first.\n */\nexport function isValidPublisher(publisher: string): boolean {\n return PUBLISHER_RE.test(publisher);\n}\n\n/**\n * Coerce an arbitrary string into a canonical asset name (lowercase kebab-case).\n *\n * For **third-party sources we don't control**, an upstream asset may carry a\n * human-styled identity (`\"Complex App\"`, `\"CLI_Concept\"`). The canonical grammar\n * (`isValidAssetName`) rejects those, so the ingestion boundary slugifies them to\n * a valid identity rather than crashing: Unicode is folded to ASCII, the result is\n * lowercased, every run of non-`[a-z0-9]` becomes a single hyphen, and\n * leading/trailing hyphens are trimmed. The transform is idempotent and a no-op on\n * already-canonical names.\n *\n * This is intentionally **lossy** — the pretty original is not part of identity.\n * Callers that want to preserve it for display must stash it themselves (e.g. on\n * `CatalogEntry.metadata.displayName`). Authoring-time validation (`skaile validate`)\n * still uses `isValidAssetName` on raw frontmatter, so first-party typos surface there.\n *\n * @throws When `raw` contains no `[a-z0-9]` character (nothing to slugify).\n * @docLink packages/core/concepts#slugify-asset-name\n */\nexport function slugifyAssetName(raw: string): string {\n const slug = raw\n .normalize(\"NFKD\")\n .replace(/[\\u0300-\\u036f]/g, \"\") // strip combining accents\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\")\n .slice(0, 64)\n .replace(/-+$/, \"\");\n if (!slug) {\n throw new Error(`cannot derive a canonical asset name from \"${raw}\" — ${ASSET_NAME_HINT}.`);\n }\n return slug;\n}\n\n/** True when `pin` is a SemVer constraint, exact SemVer, 40-char SHA or a commit pseudo-version. */\nfunction isValidPin(pin: string): boolean {\n if (SHA_RE.test(pin)) return true;\n // `search` lists a version-less source asset as `0.0.0-sha.<commit>`; a commit that starts\n // with `0` and has only digits (`0809848`) is not valid SemVer, yet it is the version printed.\n if (/^0\\.0\\.0-sha\\.[0-9a-f]{7,40}$/.test(pin)) return true;\n if (semver.valid(pin)) return true;\n if (semver.validRange(pin)) return true;\n return false;\n}\n\n/** Throw the canonical non-canonical-pin error for a ref `s` carrying `pin`. */\nfunction rejectFloatingPin(s: string, pin: string): never {\n throw new Error(\n `non-canonical pin \"${pin}\" in \"${s}\" — pin must be a SemVer ` +\n \"constraint (1.4.0, ^1.4, ~1.4, 1.x), a 40-char SHA, or absent. \" +\n \"Floating refs (main/latest/HEAD) are not allowed.\",\n );\n}\n\n/** Throw the canonical malformed-name error for a ref `s` carrying `name`. */\nfunction rejectInvalidName(s: string, name: string): never {\n throw new Error(\n `invalid asset name \"${name}\" in ref \"${s}\" — ${ASSET_NAME_HINT}. ` +\n \"Run the `migrate-skaile-manifest` skill on legacy manifests.\",\n );\n}\n\n/**\n * Parse a canonical asset reference string into an `AssetRef` object.\n *\n * Grammar: `kind:@<publisher>/name[#version]`\n * \"skill:@skaile-ai/audit\" → { kind: \"skill\", name: \"audit\", publisher: \"skaile-ai\" }\n * \"skill:@skaile-ai/audit#^1.4.0\" → { …, pin: \"^1.4.0\" }\n * \"skill:@skaile-ai/audit#<40-sha>\" → { …, pin: \"<40-sha>\" }\n *\n * `@` is the scope sigil and `#` the version sigil. `<publisher>` is GitHub-shaped\n * (≤39 chars, alphanumeric+hyphen, no leading/trailing or double hyphen). `pin`\n * accepts a SemVer constraint (`^`, `~`, `x`, exact), a 40-char SHA, or is absent.\n * Floating refs (`main`/`latest`/`HEAD`/anything non-canonical) are parse-time errors.\n *\n * The shorthand `mcp:` is normalized to `mcp-server:`. `kind` defaults to `\"skill\"`.\n *\n * @param s - Asset reference string\n * @returns Parsed `AssetRef`\n * @throws When the ref matches no grammar, the publisher is malformed, or the pin\n * is a floating ref.\n * @docLink packages/core/concepts#parse-asset-ref\n */\nexport function parseAssetRef(s: string): AssetRef {\n const trimmed = s.trim();\n const m = SCOPED_REF_RE.exec(trimmed);\n if (m) {\n const kindRaw = m[1] ?? \"skill\";\n const kind = kindRaw === \"mcp\" ? \"mcp-server\" : kindRaw;\n const publisher = m[2];\n const name = m[3];\n const pin = m[4]?.trim() || undefined;\n if (!isValidAssetName(name)) rejectInvalidName(s, name);\n if (pin !== undefined && !isValidPin(pin)) rejectFloatingPin(s, pin);\n return { kind, name, publisher, pin };\n }\n\n // The strict grammar failed. If the ref nonetheless carries a `@publisher/`\n // scope and the fault is the name (e.g. an embedded space), surface a\n // name-specific error rather than the misleading \"publisher required\" — the\n // publisher is plainly present. A *valid* captured name means the publisher\n // itself is malformed, so fall through to the publisher error below.\n const scoped = SCOPE_PREFIX_RE.exec(trimmed);\n if (scoped) {\n const candidate = scoped[1].trim();\n if (!isValidAssetName(candidate)) rejectInvalidName(s, candidate);\n // The name is fine, so the publisher is the fault: name the rule, not \"publisher required\".\n const publisher = /^(?:[a-z][a-z0-9-]*:)?@([^/\\s]+)\\//.exec(trimmed)?.[1];\n if (publisher !== undefined) {\n throw new Error(`invalid publisher \"${publisher}\" in asset ref \"${s}\" — ${PUBLISHER_HINT}`);\n }\n }\n\n throw new Error(\n `publisher required in asset ref \"${s}\" — use \\`kind:@<publisher>/name\\`. ` +\n \"Run the `migrate-skaile-manifest` skill on legacy manifests.\",\n );\n}\n\n/** Options of {@link assetRefProblem}. */\nexport interface AssetRefProblemOptions {\n /**\n * Accept an entry without a `@publisher/` scope (`name`, `kind:name`): the form a SKILL.md\n * `requires:` takes for an asset of the same publisher. A preset item or a manifest\n * dependency always names its publisher.\n */\n allowBare?: boolean;\n /** `true` for a registered asset kind (`mcp` is read as `mcp-server`); omitted: any kind passes. */\n isKnownKind?: (kind: string) => boolean;\n}\n\n/**\n * The one syntax check for an asset ref written in a manifest (`requires:`, `dependencies:`,\n * a preset `items[].ref`): the publisher follows the publisher slug rule, the name the asset\n * name rule, the pin the pin rule and the kind is a registered one. Returns the reason the ref\n * is wrong, `undefined` when it is well-formed. `add` refuses the same refs, so `validate`,\n * `library index` and the publish plan can no longer pass what `add` rejects (p135).\n */\nexport function assetRefProblem(\n ref: string,\n opts: AssetRefProblemOptions = {},\n): string | undefined {\n const t = ref.trim();\n if (t === \"\") return \"the ref is empty\";\n const m = /^(?:([^:@#\\s/]+):)?(.*)$/.exec(t);\n const kind = m?.[1];\n const rest = m?.[2] ?? t;\n if (kind !== undefined && opts.isKnownKind) {\n if (!opts.isKnownKind(kind === \"mcp\" ? \"mcp-server\" : kind)) return `unknown kind \"${kind}\"`;\n }\n if (rest.startsWith(\"@\")) {\n const slash = rest.indexOf(\"/\");\n const publisher = slash < 0 ? rest.slice(1) : rest.slice(1, slash);\n const name = slash < 0 ? \"\" : rest.slice(slash + 1).split(\"#\")[0]!;\n if (!isValidPublisher(publisher)) return `publisher \"${publisher}\" — ${PUBLISHER_HINT}`;\n if (name === \"\") return `no asset name after the publisher \"@${publisher}/\"`;\n try {\n parseAssetRef(t);\n } catch (err) {\n return err instanceof Error ? err.message : String(err);\n }\n return undefined;\n }\n if (!opts.allowBare) return \"publisher required — use `kind:@<publisher>/name`\";\n if (!isValidAssetName(rest)) return `invalid asset name \"${rest}\" — ${ASSET_NAME_HINT}`;\n return undefined;\n}\n\n/**\n * Parse a ref for identity matching, tolerating a non-canonical pin. A lock key\n * can pin a content-sha pseudo-version (`#0.0.0-sha.<hash>`) that\n * {@link parseAssetRef} rejects; matchers only need the version-agnostic\n * `kind/publisher/name`, so drop the pin and retry before giving up.\n *\n * @returns The parsed ref (its `pin` empty when the pin was dropped), or `null`.\n */\nexport function parseAssetRefLoose(ref: string): AssetRef | null {\n try {\n return parseAssetRef(ref);\n } catch {\n const hash = ref.indexOf(\"#\");\n if (hash < 0) return null;\n try {\n return parseAssetRef(ref.slice(0, hash));\n } catch {\n return null;\n }\n }\n}\n\n/**\n * Serialize an AssetRef back to its canonical string form.\n *\n * Emits the scope form `kind:@publisher/name[#pin]` when `publisher` is present,\n * and the bare `kind:name[#pin]` form for transitive refs that inherit it.\n *\n * @param ref - AssetRef to serialize\n * @returns String in `\"kind:@publisher/name[#pin]\"` (or bare `\"kind:name[#pin]\"`) format\n * @docLink packages/core/concepts#asset-ref-to-str\n */\nexport function assetRefToStr(ref: AssetRef): string {\n const scope = ref.publisher ? `@${ref.publisher}/${ref.name}` : ref.name;\n return `${ref.kind}:${scope}${ref.pin ? `#${ref.pin}` : \"\"}`;\n}\n\n/**\n * Convert an AssetRef to a simple Dependency, dropping the repository and pin qualifiers.\n *\n * @param ref - Full asset reference (may include repository and pin)\n * @returns Dependency with only kind and name\n * @docLink packages/core/concepts#asset-ref-to-dep\n */\nexport function assetRefToDep(ref: AssetRef): Dependency {\n // Grammar-agnostic — drops publisher/pin, so the scope-sigil change doesn't touch it.\n return { kind: ref.kind, name: ref.name };\n}\n\n// ── Lock File ────────────────────────────────────────────────────────────────\n\n/** A path/sha256 pair recorded for one file inside a locked asset. */\nexport interface LockFileEntry {\n path: string;\n sha256: string;\n}\n\n/**\n * Library-origin marker on a {@link LockEntry}: the asset was resolved from a\n * registered library (a local authoring place) rather than a git source/store.\n */\nexport interface LockLibraryOrigin {\n /** Name of the library the asset was resolved from. */\n name: string;\n /** Library version of the asset at lock time. */\n version: string;\n /** Content hash recorded in the library index at lock time; absent when the library was never indexed. */\n sha256?: string;\n /**\n * Remote URL of the library at lock time, recorded for a git-backed library only. The name is\n * machine-local; when it is not registered on another machine, `install --locked` and `check`\n * match a registered library by this URL instead. Optional: locks without it resolve by name\n * as before.\n */\n url?: string;\n /**\n * Set by `skaile asset install`: the files were copied or linked straight into\n * the project, not deployed from a `skaile.yaml` dependency. `skaile install`\n * leaves such an entry and its files alone instead of reconciling them away.\n */\n installed?: \"copy\" | \"link\";\n}\n\n/**\n * Per-asset entry in the lock file (v3 schema).\n * Keyed in `LockFile.assets` by canonical ref (`<kind>:@<publisher>/<name>#<version>`).\n * Source-origin entries carry `source` + `files`; library-origin entries carry\n * `library` instead (no `source`, empty `files`). Both fields are additive, so\n * lock files written before library origin existed still load unchanged.\n * @docLink packages/core/api-reference#lock-entry\n */\nexport interface LockEntry {\n /** Composite sha256 over sorted `<path>:<sha256>\\n` rows (library-origin: the library's hash, `\"\"` when unknown). */\n sha256: string;\n /** Resolved upstream source + commit. Absent for library-origin entries. */\n source?: { url: string; commit: string };\n /** Files that constitute the asset. Empty for library-origin entries. */\n files: LockFileEntry[];\n /** True when an `overrides[]` entry pinned this resolution. */\n override_applied: boolean;\n /** Set when the asset was resolved from a registered library. */\n library?: LockLibraryOrigin;\n /**\n * Agents only: the files the harness rendering of the asset occupies, project-relative\n * (`.claude/agents/captain.md`), with the sha256 of the bytes `install` wrote. An agent is\n * rendered, not copied, so it has no source file to compare with; `check`, `doctor` and\n * `outdated` compare the deployed file with these hashes and `install` restores it. Absent\n * for every other kind and for locks written before this field existed.\n */\n rendered?: LockFileEntry[];\n /**\n * Agents only: the files of the agent's `../` compose folders as the project cache holds them\n * (`.skaile/cache/agents/<name>/composes/<folder>/…`), project-relative, with sha256. The\n * folders are part of the lock: `install` keeps these bytes whatever the library holds now and\n * only `update` copies the library's. Absent when the agent composes nothing outside its own\n * folder and for locks written before this field existed.\n */\n composed?: LockFileEntry[];\n /**\n * Library-origin assets copied into a harness folder (not agents): the files the deploy wrote,\n * relative to the deployed folder, with the sha256 of those bytes. A library records one hash\n * for the whole asset, so this is what names a hand-edited file after the library moved on\n * (p1641). Absent for other origins and for locks written before this field existed.\n */\n copied?: LockFileEntry[];\n /**\n * Store-resolved assets only: the assets this one requires, as `kind:@publisher/name`, as\n * the store's catalog row lists them. The deployed copy of such an asset cannot say them (a\n * 0.1 `agent.yaml` names its skills by bare name), yet `why`, the `remove` guard and the\n * prune of orphans need them, as they use a library or source asset's own manifest.\n * Absent when the store listed none and for every other origin.\n */\n requires?: string[];\n /**\n * Store-resolved assets only: `\"store\"` when a store's catalog (not a `sources:` entry, not a\n * library) supplied the asset. `check`, `doctor`, `outdated`, `diff` and `install --locked`\n * then judge the entry from the lock, with the store unreachable and its cache cold. Absent\n * for every other origin and for locks written before this field existed; such a store entry\n * reads as before and gets the field on the next `install` or `update` that reaches the store.\n */\n origin?: \"store\";\n /** Store-resolved assets only: the catalog URL that supplied the asset (see {@link origin}). */\n store?: string;\n}\n\n/** Per-source-URL entry in `LockFile.sources`. */\nexport interface LockSourceEntry {\n url: string;\n commit: string;\n}\n\n/**\n * Full skaile.lock.yaml structure (v4 schema).\n * @docLink packages/core/api-reference#lock-file\n */\nexport interface LockFile {\n /**\n * Lock file schema version: always written as 4. A lock written as 3 (before the version\n * stopped depending on the origins in the lock) still loads.\n */\n schema_version: 3 | 4;\n /** ISO timestamp of when the lock was generated. */\n locked_at: string;\n /** Resolved assets keyed by canonical ref `<kind>:@<publisher>/<name>#<version>`. */\n assets: Record<string, LockEntry>;\n /** Every source URL that contributed at least one resolved asset. */\n sources: LockSourceEntry[];\n /**\n * Resolved plugin packages (from `skaile.yaml` `plugins:`), keyed by package\n * name. The plugin-store reconciler reads this slice into its reconcile-hash\n * so a lock change reinstalls even when the manifest list is unchanged.\n */\n plugins?: Record<string, LockPluginEntry>;\n /**\n * Canonical refs of the `preset:` dependencies that `install` / `add` expanded into the\n * assets above (`preset:@publisher/name#version`, nested presets included). A preset is\n * never locked as an asset, so this is the only offline trace that a declared preset\n * resolved: `check` reports a declared preset that is neither listed here nor held by a\n * local library or source. Absent when no preset was expanded.\n */\n presets?: string[];\n}\n\n/** One pinned plugin package in the lock file's `plugins` slice. */\nexport interface LockPluginEntry {\n /** Resolved exact version (e.g. \"0.1.3\"). */\n version: string;\n /** Package integrity hash (e.g. \"sha512-...\"); may be empty until populated from bun's output. */\n integrity: string;\n}\n\n// ── Repository ───────────────────────────────────────────────────────────────\n\ntype RepositoryKind = \"local\" | \"github\";\n\n/**\n * A registered asset repository (local path or cloned GitHub repo).\n * Stored in the catalog; consumed by `repo-manager` for cloning and scanning.\n * @docLink packages/core/concepts#repository\n */\nexport interface Repository {\n /** Logical repository name. */\n name: string;\n /** Storage kind: \"local\" for paths, \"github\" for remote URLs. */\n kind: RepositoryKind;\n /** Absolute path (local) or remote URL (github). */\n path: string;\n /** Active branch. */\n branch: string;\n /** Upstream fork URL (for fork-based workflows). */\n upstream?: string;\n}\n\n/**\n * Construct a `Repository` from a raw deserialized record.\n *\n * @param d - Raw object from YAML/JSON\n * @returns Normalized `Repository`\n * @docLink packages/core/concepts#repository-from-raw\n */\nexport function repositoryFromRaw(d: Record<string, unknown>): Repository {\n return {\n name: String(d.name ?? \"\"),\n kind: String(d.kind ?? \"local\") as RepositoryKind,\n path: String(d.path ?? \"\"),\n branch: String(d.branch ?? \"main\"),\n upstream: d.upstream != null ? String(d.upstream) : undefined,\n };\n}\n\n/**\n * Serialize a `Repository` to a plain record for YAML/JSON persistence.\n * Omits the `branch` field when it equals `\"main\"` to keep serialized output clean.\n *\n * @param r - Repository to serialize\n * @returns Plain object suitable for YAML/JSON\n * @docLink packages/core/concepts#repository-to-raw\n */\nexport function repositoryToRaw(r: Repository): Record<string, unknown> {\n const d: Record<string, unknown> = {\n name: r.name,\n kind: r.kind,\n path: r.path,\n };\n if (r.branch !== \"main\") d.branch = r.branch;\n if (r.upstream != null) d.upstream = r.upstream;\n return d;\n}\n"]}