@skaile/workspaces 6.15.0 → 6.16.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 (426) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/dist/agent-file-refresh-76NNFB4W.js +89 -0
  3. package/dist/agent-file-refresh-76NNFB4W.js.map +1 -0
  4. package/dist/ai-sdk.js +8 -7
  5. package/dist/ai-sdk.js.map +1 -1
  6. package/dist/{asset-feeds-PM7FKHJP.js → asset-feeds-ON7FYHHF.js} +25 -23
  7. package/dist/asset-feeds-ON7FYHHF.js.map +1 -0
  8. package/dist/asset-manager/catalog-deployer.js +8 -7
  9. package/dist/asset-manager/history.js +7 -6
  10. package/dist/asset-manager/index.js +17 -15
  11. package/dist/asset-manager/installer.js +16 -9
  12. package/dist/asset-manager/renderers.js +8 -8
  13. package/dist/asset-manager/src/add-remove/add.d.ts +134 -0
  14. package/dist/asset-manager/src/add-remove/add.d.ts.map +1 -0
  15. package/dist/asset-manager/src/add-remove/remove.d.ts +329 -0
  16. package/dist/asset-manager/src/add-remove/remove.d.ts.map +1 -0
  17. package/dist/asset-manager/src/agent-render.d.ts +116 -0
  18. package/dist/asset-manager/src/agent-render.d.ts.map +1 -0
  19. package/dist/asset-manager/src/composed-blocks.d.ts +40 -0
  20. package/dist/asset-manager/src/composed-blocks.d.ts.map +1 -0
  21. package/dist/asset-manager/src/config/core.d.ts +297 -0
  22. package/dist/asset-manager/src/config/core.d.ts.map +1 -0
  23. package/dist/asset-manager/src/config/edit.d.ts +161 -0
  24. package/dist/asset-manager/src/config/edit.d.ts.map +1 -0
  25. package/dist/asset-manager/src/index.d.ts +31 -2961
  26. package/dist/asset-manager/src/index.d.ts.map +1 -1
  27. package/dist/asset-manager/src/install/clone-commit-fetcher.d.ts +11 -0
  28. package/dist/asset-manager/src/install/clone-commit-fetcher.d.ts.map +1 -0
  29. package/dist/asset-manager/src/install/install.d.ts +151 -0
  30. package/dist/asset-manager/src/install/install.d.ts.map +1 -0
  31. package/dist/asset-manager/src/install/restore.d.ts +76 -0
  32. package/dist/asset-manager/src/install/restore.d.ts.map +1 -0
  33. package/dist/asset-manager/src/install-agent.d.ts +52 -4
  34. package/dist/asset-manager/src/install-agent.d.ts.map +1 -1
  35. package/dist/asset-manager/src/install-instances.d.ts +70 -2
  36. package/dist/asset-manager/src/install-instances.d.ts.map +1 -1
  37. package/dist/asset-manager/src/installer.d.ts +54 -4
  38. package/dist/asset-manager/src/installer.d.ts.map +1 -1
  39. package/dist/asset-manager/src/lock/copies.d.ts +156 -0
  40. package/dist/asset-manager/src/lock/copies.d.ts.map +1 -0
  41. package/dist/asset-manager/src/lock/library.d.ts +261 -0
  42. package/dist/asset-manager/src/lock/library.d.ts.map +1 -0
  43. package/dist/asset-manager/src/mcp-render.d.ts +86 -0
  44. package/dist/asset-manager/src/mcp-render.d.ts.map +1 -0
  45. package/dist/asset-manager/src/omp-sweep.d.ts +25 -0
  46. package/dist/asset-manager/src/omp-sweep.d.ts.map +1 -0
  47. package/dist/asset-manager/src/read/diff.d.ts +109 -0
  48. package/dist/asset-manager/src/read/diff.d.ts.map +1 -0
  49. package/dist/asset-manager/src/read/doctor.d.ts +116 -0
  50. package/dist/asset-manager/src/read/doctor.d.ts.map +1 -0
  51. package/dist/asset-manager/src/read/gaps.d.ts +120 -0
  52. package/dist/asset-manager/src/read/gaps.d.ts.map +1 -0
  53. package/dist/asset-manager/src/read/graph.d.ts +69 -0
  54. package/dist/asset-manager/src/read/graph.d.ts.map +1 -0
  55. package/dist/asset-manager/src/read/outdated.d.ts +152 -0
  56. package/dist/asset-manager/src/read/outdated.d.ts.map +1 -0
  57. package/dist/asset-manager/src/read/state.d.ts +265 -0
  58. package/dist/asset-manager/src/read/state.d.ts.map +1 -0
  59. package/dist/asset-manager/src/renderers.d.ts +11 -1
  60. package/dist/asset-manager/src/renderers.d.ts.map +1 -1
  61. package/dist/asset-manager/src/resolve/guards.d.ts +167 -0
  62. package/dist/asset-manager/src/resolve/guards.d.ts.map +1 -0
  63. package/dist/asset-manager/src/resolve/scan.d.ts +222 -0
  64. package/dist/asset-manager/src/resolve/scan.d.ts.map +1 -0
  65. package/dist/asset-manager/src/resolve/stores.d.ts +176 -0
  66. package/dist/asset-manager/src/resolve/stores.d.ts.map +1 -0
  67. package/dist/asset-manager/src/shared/files.d.ts +42 -0
  68. package/dist/asset-manager/src/shared/files.d.ts.map +1 -0
  69. package/dist/asset-manager/src/shared/library-hooks.d.ts +16 -0
  70. package/dist/asset-manager/src/shared/library-hooks.d.ts.map +1 -0
  71. package/dist/asset-manager/src/shared/library.d.ts +96 -0
  72. package/dist/asset-manager/src/shared/library.d.ts.map +1 -0
  73. package/dist/asset-manager/src/shared/refs.d.ts +101 -0
  74. package/dist/asset-manager/src/shared/refs.d.ts.map +1 -0
  75. package/dist/asset-manager/src/shared/types.d.ts +399 -0
  76. package/dist/asset-manager/src/shared/types.d.ts.map +1 -0
  77. package/dist/bridge/harnesses/claude-sdk.js +11 -17
  78. package/dist/bridge/harnesses/claude-sdk.js.map +1 -1
  79. package/dist/bridge/harnesses/codex.js +10 -10
  80. package/dist/bridge/harnesses/continue.js +12 -16
  81. package/dist/bridge/harnesses/continue.js.map +1 -1
  82. package/dist/bridge/harnesses/echo.js +3 -8
  83. package/dist/bridge/harnesses/echo.js.map +1 -1
  84. package/dist/bridge/harnesses/gemini.js +5 -5
  85. package/dist/bridge/harnesses/goose.js +13 -17
  86. package/dist/bridge/harnesses/goose.js.map +1 -1
  87. package/dist/bridge/harnesses/omp.js +5 -11
  88. package/dist/bridge/harnesses/omp.js.map +1 -1
  89. package/dist/bridge/harnesses/opencode.js +13 -17
  90. package/dist/bridge/harnesses/opencode.js.map +1 -1
  91. package/dist/bridge/harnesses/qwen.js +6 -11
  92. package/dist/bridge/harnesses/qwen.js.map +1 -1
  93. package/dist/bridge/index.js +16 -16
  94. package/dist/bridge/src/codex/managed-harness.d.ts.map +1 -1
  95. package/dist/bridge/src/driver-contract.d.ts +72 -0
  96. package/dist/bridge/src/driver-contract.d.ts.map +1 -0
  97. package/dist/bridge/src/harness-model-check.d.ts +1 -1
  98. package/dist/bridge/src/harness-model-check.d.ts.map +1 -1
  99. package/dist/bridge/src/harnesses/_subprocess-cli.d.ts +8 -0
  100. package/dist/bridge/src/harnesses/_subprocess-cli.d.ts.map +1 -1
  101. package/dist/bridge/src/harnesses/claude-sdk.d.ts.map +1 -1
  102. package/dist/bridge/src/harnesses/codex.d.ts +2 -0
  103. package/dist/bridge/src/harnesses/codex.d.ts.map +1 -1
  104. package/dist/bridge/src/harnesses/continue.d.ts.map +1 -1
  105. package/dist/bridge/src/harnesses/echo.d.ts.map +1 -1
  106. package/dist/bridge/src/harnesses/gemini.d.ts.map +1 -1
  107. package/dist/bridge/src/harnesses/goose.d.ts.map +1 -1
  108. package/dist/bridge/src/harnesses/omp.d.ts.map +1 -1
  109. package/dist/bridge/src/harnesses/opencode.d.ts.map +1 -1
  110. package/dist/bridge/src/harnesses/qwen.d.ts.map +1 -1
  111. package/dist/bridge/src/index.d.ts +2 -0
  112. package/dist/bridge/src/index.d.ts.map +1 -1
  113. package/dist/bridge/src/preflight.d.ts +114 -0
  114. package/dist/bridge/src/preflight.d.ts.map +1 -0
  115. package/dist/bridge/src/registry.d.ts +12 -0
  116. package/dist/bridge/src/registry.d.ts.map +1 -1
  117. package/dist/{chunk-MUQBP2BK.js → chunk-2JUCWMIS.js} +8808 -8337
  118. package/dist/chunk-2JUCWMIS.js.map +1 -0
  119. package/dist/{chunk-VS6XC5JE.js → chunk-2MTRRK37.js} +3 -3
  120. package/dist/{chunk-VS6XC5JE.js.map → chunk-2MTRRK37.js.map} +1 -1
  121. package/dist/chunk-2PJYJPDE.js +3 -0
  122. package/dist/chunk-2PJYJPDE.js.map +1 -0
  123. package/dist/{chunk-J7FEWDRQ.js → chunk-2SSG5B24.js} +4 -4
  124. package/dist/{chunk-J7FEWDRQ.js.map → chunk-2SSG5B24.js.map} +1 -1
  125. package/dist/{chunk-WDG5IVEA.js → chunk-2ZDZJ7XQ.js} +3 -3
  126. package/dist/{chunk-WDG5IVEA.js.map → chunk-2ZDZJ7XQ.js.map} +1 -1
  127. package/dist/{chunk-V2VDTQ7A.js → chunk-3A7JUOY2.js} +3 -3
  128. package/dist/{chunk-V2VDTQ7A.js.map → chunk-3A7JUOY2.js.map} +1 -1
  129. package/dist/chunk-3LAJJURV.js +26 -0
  130. package/dist/chunk-3LAJJURV.js.map +1 -0
  131. package/dist/{chunk-FJJEC6O2.js → chunk-3UYKT62L.js} +5 -5
  132. package/dist/{chunk-FJJEC6O2.js.map → chunk-3UYKT62L.js.map} +1 -1
  133. package/dist/{chunk-HCIXCCUH.js → chunk-4X5WXQV7.js} +4 -4
  134. package/dist/{chunk-HCIXCCUH.js.map → chunk-4X5WXQV7.js.map} +1 -1
  135. package/dist/chunk-4ZNKEDYH.js +887 -0
  136. package/dist/chunk-4ZNKEDYH.js.map +1 -0
  137. package/dist/{chunk-R7422XD4.js → chunk-65SOXO7I.js} +20 -14
  138. package/dist/chunk-65SOXO7I.js.map +1 -0
  139. package/dist/{chunk-YDMZWVZN.js → chunk-6KV34G6A.js} +8 -8
  140. package/dist/{chunk-YDMZWVZN.js.map → chunk-6KV34G6A.js.map} +1 -1
  141. package/dist/{chunk-OIWFXUZB.js → chunk-6M44OQKH.js} +40 -44
  142. package/dist/chunk-6M44OQKH.js.map +1 -0
  143. package/dist/{chunk-SXRN27TU.js → chunk-72DYHOO2.js} +24 -25
  144. package/dist/chunk-72DYHOO2.js.map +1 -0
  145. package/dist/{chunk-XPSZIBPU.js → chunk-7IW5E6LB.js} +43 -48
  146. package/dist/chunk-7IW5E6LB.js.map +1 -0
  147. package/dist/{chunk-BNLXZXZN.js → chunk-BRAOB37W.js} +97 -47
  148. package/dist/chunk-BRAOB37W.js.map +1 -0
  149. package/dist/{chunk-ZLDAPZIX.js → chunk-BTMSHGN3.js} +4 -4
  150. package/dist/{chunk-ZLDAPZIX.js.map → chunk-BTMSHGN3.js.map} +1 -1
  151. package/dist/{chunk-7K73MCI6.js → chunk-CU5WY6HN.js} +3 -3
  152. package/dist/{chunk-7K73MCI6.js.map → chunk-CU5WY6HN.js.map} +1 -1
  153. package/dist/{chunk-CG63XGVV.js → chunk-EGKCKWWE.js} +3 -3
  154. package/dist/{chunk-CG63XGVV.js.map → chunk-EGKCKWWE.js.map} +1 -1
  155. package/dist/{chunk-CJO3XKO7.js → chunk-ETGC2MEM.js} +4 -4
  156. package/dist/{chunk-CJO3XKO7.js.map → chunk-ETGC2MEM.js.map} +1 -1
  157. package/dist/{chunk-PFBPESW7.js → chunk-FPG36VC4.js} +8 -13
  158. package/dist/chunk-FPG36VC4.js.map +1 -0
  159. package/dist/{chunk-SBAUZ7XH.js → chunk-H3PY5DFL.js} +4 -4
  160. package/dist/{chunk-SBAUZ7XH.js.map → chunk-H3PY5DFL.js.map} +1 -1
  161. package/dist/{chunk-7HRZACI4.js → chunk-HW4BDJPC.js} +17 -6
  162. package/dist/chunk-HW4BDJPC.js.map +1 -0
  163. package/dist/{chunk-7VBD5XUM.js → chunk-IG4YQ7ER.js} +32 -90
  164. package/dist/chunk-IG4YQ7ER.js.map +1 -0
  165. package/dist/{chunk-6WIZC6GM.js → chunk-KDRA6FYE.js} +120 -211
  166. package/dist/chunk-KDRA6FYE.js.map +1 -0
  167. package/dist/{chunk-KOI7QFDH.js → chunk-M7XIYHWB.js} +3 -3
  168. package/dist/{chunk-KOI7QFDH.js.map → chunk-M7XIYHWB.js.map} +1 -1
  169. package/dist/{chunk-7LJUK5JK.js → chunk-MG6QD7GE.js} +201 -43
  170. package/dist/chunk-MG6QD7GE.js.map +1 -0
  171. package/dist/{chunk-CWUHUL6W.js → chunk-NAQXDTF3.js} +3 -3
  172. package/dist/{chunk-CWUHUL6W.js.map → chunk-NAQXDTF3.js.map} +1 -1
  173. package/dist/{chunk-JIZ35OOU.js → chunk-NJ6UCY2B.js} +3 -3
  174. package/dist/{chunk-JIZ35OOU.js.map → chunk-NJ6UCY2B.js.map} +1 -1
  175. package/dist/{chunk-A3G3FHGB.js → chunk-NNJQQYHY.js} +2 -2
  176. package/dist/{chunk-A3G3FHGB.js.map → chunk-NNJQQYHY.js.map} +1 -1
  177. package/dist/{chunk-TYRAEMWE.js → chunk-OD4N5O7V.js} +4 -4
  178. package/dist/{chunk-TYRAEMWE.js.map → chunk-OD4N5O7V.js.map} +1 -1
  179. package/dist/{chunk-LBJCOEXH.js → chunk-P6FJDT35.js} +27 -7
  180. package/dist/chunk-P6FJDT35.js.map +1 -0
  181. package/dist/{chunk-IOXFT5D7.js → chunk-PD42JZWI.js} +3 -3
  182. package/dist/{chunk-IOXFT5D7.js.map → chunk-PD42JZWI.js.map} +1 -1
  183. package/dist/{chunk-MS2IXLTC.js → chunk-PMXTBWFD.js} +27 -7
  184. package/dist/chunk-PMXTBWFD.js.map +1 -0
  185. package/dist/{chunk-O74SRQ3W.js → chunk-PPSSDUN6.js} +3 -3
  186. package/dist/{chunk-O74SRQ3W.js.map → chunk-PPSSDUN6.js.map} +1 -1
  187. package/dist/{chunk-IYXOSBQ4.js → chunk-PRB67LCK.js} +126 -17
  188. package/dist/chunk-PRB67LCK.js.map +1 -0
  189. package/dist/{chunk-6VQW2X2F.js → chunk-QUIK7L3Z.js} +9 -9
  190. package/dist/{chunk-6VQW2X2F.js.map → chunk-QUIK7L3Z.js.map} +1 -1
  191. package/dist/{chunk-DRUAQ7IY.js → chunk-QUPZKTF3.js} +9 -8
  192. package/dist/chunk-QUPZKTF3.js.map +1 -0
  193. package/dist/{chunk-7FXOOUOC.js → chunk-RPRMD7XV.js} +27 -11
  194. package/dist/chunk-RPRMD7XV.js.map +1 -0
  195. package/dist/{chunk-U7EJB6LY.js → chunk-S3UOZBGE.js} +20 -3
  196. package/dist/chunk-S3UOZBGE.js.map +1 -0
  197. package/dist/{chunk-LQWOU7S2.js → chunk-SFBLZOV5.js} +3 -3
  198. package/dist/{chunk-LQWOU7S2.js.map → chunk-SFBLZOV5.js.map} +1 -1
  199. package/dist/{chunk-EB2LKPI6.js → chunk-SMFZ5YGN.js} +4 -4
  200. package/dist/{chunk-EB2LKPI6.js.map → chunk-SMFZ5YGN.js.map} +1 -1
  201. package/dist/{chunk-IRIWNKQS.js → chunk-SX54OQQT.js} +4 -4
  202. package/dist/{chunk-IRIWNKQS.js.map → chunk-SX54OQQT.js.map} +1 -1
  203. package/dist/{chunk-2PVYDAFN.js → chunk-T65N4CIZ.js} +3 -3
  204. package/dist/{chunk-2PVYDAFN.js.map → chunk-T65N4CIZ.js.map} +1 -1
  205. package/dist/{chunk-C5ZCREBI.js → chunk-TVRL3IPZ.js} +3 -3
  206. package/dist/{chunk-C5ZCREBI.js.map → chunk-TVRL3IPZ.js.map} +1 -1
  207. package/dist/{chunk-RKTEHX2S.js → chunk-TW5AP6IF.js} +5 -5
  208. package/dist/{chunk-RKTEHX2S.js.map → chunk-TW5AP6IF.js.map} +1 -1
  209. package/dist/{chunk-EMIOFJQJ.js → chunk-TYK752MU.js} +3 -3
  210. package/dist/{chunk-EMIOFJQJ.js.map → chunk-TYK752MU.js.map} +1 -1
  211. package/dist/{chunk-HPQ2WDYC.js → chunk-U2WPJHRA.js} +5 -5
  212. package/dist/{chunk-HPQ2WDYC.js.map → chunk-U2WPJHRA.js.map} +1 -1
  213. package/dist/{chunk-MEU2HHGV.js → chunk-U7P22GEB.js} +386 -46
  214. package/dist/chunk-U7P22GEB.js.map +1 -0
  215. package/dist/{chunk-AEFDFCS2.js → chunk-VFEZUSB6.js} +4 -4
  216. package/dist/{chunk-AEFDFCS2.js.map → chunk-VFEZUSB6.js.map} +1 -1
  217. package/dist/{chunk-A4VKIVGB.js → chunk-WW22FS74.js} +75 -67
  218. package/dist/chunk-WW22FS74.js.map +1 -0
  219. package/dist/{chunk-72PPC4SC.js → chunk-Z23I2JA6.js} +6 -6
  220. package/dist/{chunk-72PPC4SC.js.map → chunk-Z23I2JA6.js.map} +1 -1
  221. package/dist/{chunk-KIFAU62K.js → chunk-Z7HLX4V2.js} +4 -4
  222. package/dist/{chunk-KIFAU62K.js.map → chunk-Z7HLX4V2.js.map} +1 -1
  223. package/dist/{chunk-YLKOCMU7.js → chunk-ZII54C3E.js} +266 -1032
  224. package/dist/chunk-ZII54C3E.js.map +1 -0
  225. package/dist/{chunk-CVUMZTNO.js → chunk-ZQPBYLCS.js} +4 -4
  226. package/dist/{chunk-CVUMZTNO.js.map → chunk-ZQPBYLCS.js.map} +1 -1
  227. package/dist/{claude-code-5QYXWC5H.js → claude-code-VL6UM7BZ.js} +4 -4
  228. package/dist/{claude-code-5QYXWC5H.js.map → claude-code-VL6UM7BZ.js.map} +1 -1
  229. package/dist/cli/index.js +491 -298
  230. package/dist/cli/index.js.map +1 -1
  231. package/dist/cli/src/agent-file-refresh.d.ts +25 -0
  232. package/dist/cli/src/agent-file-refresh.d.ts.map +1 -0
  233. package/dist/cli/src/commands/asset-cmd.d.ts.map +1 -1
  234. package/dist/cli/src/commands/catalog.d.ts +9 -2
  235. package/dist/cli/src/commands/catalog.d.ts.map +1 -1
  236. package/dist/cli/src/commands/config.d.ts.map +1 -1
  237. package/dist/cli/src/commands/harness.d.ts +1 -1
  238. package/dist/cli/src/commands/harness.d.ts.map +1 -1
  239. package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
  240. package/dist/cli/src/commands/library-index.d.ts +5 -7
  241. package/dist/cli/src/commands/library-index.d.ts.map +1 -1
  242. package/dist/cli/src/commands/library-publish.d.ts.map +1 -1
  243. package/dist/cli/src/commands/preset-export.d.ts.map +1 -1
  244. package/dist/cli/src/commands/project.d.ts.map +1 -1
  245. package/dist/cli/src/commands/run.d.ts.map +1 -1
  246. package/dist/cli/src/commands/serve-preflight.d.ts +27 -48
  247. package/dist/cli/src/commands/serve-preflight.d.ts.map +1 -1
  248. package/dist/cli/src/commands/serve.d.ts.map +1 -1
  249. package/dist/cli/src/commands/source.d.ts +6 -9
  250. package/dist/cli/src/commands/source.d.ts.map +1 -1
  251. package/dist/cli/src/commands/validate.d.ts +6 -0
  252. package/dist/cli/src/commands/validate.d.ts.map +1 -1
  253. package/dist/cli/src/config-checks.d.ts.map +1 -1
  254. package/dist/cli/src/harness-error.d.ts +11 -9
  255. package/dist/cli/src/harness-error.d.ts.map +1 -1
  256. package/dist/cli/src/skill-checks.d.ts +48 -74
  257. package/dist/cli/src/skill-checks.d.ts.map +1 -1
  258. package/dist/connectors/config.js +5 -5
  259. package/dist/connectors/index.js +19 -19
  260. package/dist/{connectors-DLXW27NQ.js → connectors-7EPJRVLJ.js} +22 -22
  261. package/dist/{connectors-DLXW27NQ.js.map → connectors-7EPJRVLJ.js.map} +1 -1
  262. package/dist/core/index.js +7 -6
  263. package/dist/core/manifest.js +2 -2
  264. package/dist/core/models.js +1 -1
  265. package/dist/core/publish-manifest.js +3 -3
  266. package/dist/core/ref.js +1 -1
  267. package/dist/core/runtime-assets.js +5 -5
  268. package/dist/core/src/agent-prompt-sections.d.ts +96 -4
  269. package/dist/core/src/agent-prompt-sections.d.ts.map +1 -1
  270. package/dist/core/src/check-asset.d.ts +115 -0
  271. package/dist/core/src/check-asset.d.ts.map +1 -0
  272. package/dist/core/src/harness-model.d.ts +20 -0
  273. package/dist/core/src/harness-model.d.ts.map +1 -0
  274. package/dist/core/src/index.d.ts +10 -6
  275. package/dist/core/src/index.d.ts.map +1 -1
  276. package/dist/core/src/lock.d.ts +12 -10
  277. package/dist/core/src/lock.d.ts.map +1 -1
  278. package/dist/core/src/models.d.ts +42 -11
  279. package/dist/core/src/models.d.ts.map +1 -1
  280. package/dist/core/src/publish-manifest.d.ts +17 -0
  281. package/dist/core/src/publish-manifest.d.ts.map +1 -1
  282. package/dist/core/src/repo-identity.d.ts +41 -0
  283. package/dist/core/src/repo-identity.d.ts.map +1 -0
  284. package/dist/core/src/repo-manager.d.ts +3 -9
  285. package/dist/core/src/repo-manager.d.ts.map +1 -1
  286. package/dist/core/src/walker.d.ts.map +1 -1
  287. package/dist/core/src/workspace-config.d.ts.map +1 -1
  288. package/dist/core/workspace-config.js +4 -4
  289. package/dist/deploy/index.js +7 -6
  290. package/dist/deploy/index.js.map +1 -1
  291. package/dist/discovery/index.js +5 -5
  292. package/dist/discovery/src/source-config.d.ts.map +1 -1
  293. package/dist/{ensure-sources-I7GCXPXK.js → ensure-sources-CI3JQJST.js} +30 -28
  294. package/dist/ensure-sources-CI3JQJST.js.map +1 -0
  295. package/dist/factory-assets/connectors/box.js +19 -19
  296. package/dist/factory-assets/connectors/deploy.js +19 -19
  297. package/dist/factory-assets/connectors/devserver.js +19 -19
  298. package/dist/factory-assets/connectors/flow/adapter.js +19 -19
  299. package/dist/factory-assets/connectors/flow/engine.js +8 -7
  300. package/dist/factory-assets/connectors/flow/run-flow.js +21 -21
  301. package/dist/factory-assets/connectors/flow.js +19 -19
  302. package/dist/factory-assets/connectors/git.js +19 -19
  303. package/dist/factory-assets/connectors/gmail.js +19 -19
  304. package/dist/factory-assets/connectors/googledrive.js +19 -19
  305. package/dist/factory-assets/connectors/local.js +19 -19
  306. package/dist/factory-assets/connectors/mattermost.js +19 -19
  307. package/dist/factory-assets/connectors/memory.js +19 -19
  308. package/dist/factory-assets/connectors/minio.js +19 -19
  309. package/dist/factory-assets/connectors/postgres.js +19 -19
  310. package/dist/factory-assets/connectors/s3.js +19 -19
  311. package/dist/factory-assets/connectors/sharepoint.js +19 -19
  312. package/dist/factory-assets/connectors/sqlite.js +19 -19
  313. package/dist/factory-assets/connectors/static-server.js +19 -19
  314. package/dist/factory-assets/connectors/tunnel.js +19 -19
  315. package/dist/factory-assets/connectors/webdav.js +19 -19
  316. package/dist/factory-assets/connectors/xstate-store.js +19 -19
  317. package/dist/factory-assets/connectors/xstate.js +19 -19
  318. package/dist/{flows-J64L5MGJ.js → flows-6XQAYQS4.js} +12 -11
  319. package/dist/{flows-J64L5MGJ.js.map → flows-6XQAYQS4.js.map} +1 -1
  320. package/dist/{helpers-U75UGGH5.js → helpers-26MR5QPO.js} +30 -28
  321. package/dist/{helpers-U75UGGH5.js.map → helpers-26MR5QPO.js.map} +1 -1
  322. package/dist/library/index.js +10 -10
  323. package/dist/library/install.js +4 -4
  324. package/dist/library/src/index.d.ts +1 -1
  325. package/dist/library/src/index.d.ts.map +1 -1
  326. package/dist/library/src/local/db.d.ts.map +1 -1
  327. package/dist/library/src/local/library-manager.d.ts.map +1 -1
  328. package/dist/library/src/local/library.d.ts.map +1 -1
  329. package/dist/library/src/local/schema.d.ts +19 -0
  330. package/dist/library/src/local/schema.d.ts.map +1 -1
  331. package/dist/library/src/user-library.d.ts +18 -0
  332. package/dist/library/src/user-library.d.ts.map +1 -1
  333. package/dist/{library-publish-57422ULT.js → library-publish-F3AKF66O.js} +71 -65
  334. package/dist/library-publish-F3AKF66O.js.map +1 -0
  335. package/dist/model-endpoint/index.js +10 -9
  336. package/dist/{open-library-EVUKLOV7.js → open-library-FVV6GG4I.js} +33 -31
  337. package/dist/{open-library-EVUKLOV7.js.map → open-library-FVV6GG4I.js.map} +1 -1
  338. package/dist/{open-registry-4HNCWOCN.js → open-registry-VX2BVMS5.js} +16 -16
  339. package/dist/{open-registry-4HNCWOCN.js.map → open-registry-VX2BVMS5.js.map} +1 -1
  340. package/dist/{paths-PXBWY532.js → paths-PIWSSUUG.js} +10 -9
  341. package/dist/{paths-PXBWY532.js.map → paths-PIWSSUUG.js.map} +1 -1
  342. package/dist/{plugin-store-ZC3EGZ3D.js → plugin-store-MVTW6G7J.js} +10 -9
  343. package/dist/{plugin-store-ZC3EGZ3D.js.map → plugin-store-MVTW6G7J.js.map} +1 -1
  344. package/dist/{project-HB7OYPEF.js → project-GFQP4TW6.js} +47 -45
  345. package/dist/{project-HB7OYPEF.js.map → project-GFQP4TW6.js.map} +1 -1
  346. package/dist/resolver/index.js +8 -7
  347. package/dist/runner/composition-content.d.ts +2 -0
  348. package/dist/runner/composition-content.js +29 -0
  349. package/dist/runner/composition-content.js.map +1 -0
  350. package/dist/runner/index.js +37 -36
  351. package/dist/runner/src/composition/content-entry.d.ts +15 -0
  352. package/dist/runner/src/composition/content-entry.d.ts.map +1 -0
  353. package/dist/runner/src/composition/content-source.d.ts +7 -0
  354. package/dist/runner/src/composition/content-source.d.ts.map +1 -1
  355. package/dist/runner/src/composition/dry-run.d.ts +5 -1
  356. package/dist/runner/src/composition/dry-run.d.ts.map +1 -1
  357. package/dist/runner/src/composition/index.d.ts +1 -1
  358. package/dist/runner/src/composition/index.d.ts.map +1 -1
  359. package/dist/runner/src/composition/prompt-sections.d.ts +47 -20
  360. package/dist/runner/src/composition/prompt-sections.d.ts.map +1 -1
  361. package/dist/runner/src/session-builder.d.ts +3 -8
  362. package/dist/runner/src/session-builder.d.ts.map +1 -1
  363. package/dist/sdk/asset-manager.js +17 -15
  364. package/dist/sdk/bridge.js +16 -16
  365. package/dist/sdk/core.js +7 -6
  366. package/dist/sdk/flow.js +8 -7
  367. package/dist/sdk/index.js +37 -36
  368. package/dist/sdk/index.js.map +1 -1
  369. package/dist/sdk/resolver.js +8 -7
  370. package/dist/sdk/runner.js +37 -36
  371. package/dist/sdk/transport/ws/server.js +8 -7
  372. package/dist/sdk/transport/ws.js +8 -7
  373. package/dist/sdk/transport.js +8 -7
  374. package/dist/serve-preflight-XJS5OZML.js +138 -0
  375. package/dist/serve-preflight-XJS5OZML.js.map +1 -0
  376. package/dist/{setup-2XV6T53V.js → setup-BFEBJLYF.js} +31 -29
  377. package/dist/setup-BFEBJLYF.js.map +1 -0
  378. package/dist/{skills-5D4KDVPJ.js → skills-OCG7B5CL.js} +13 -12
  379. package/dist/{skills-5D4KDVPJ.js.map → skills-OCG7B5CL.js.map} +1 -1
  380. package/dist/source-P6JPZYWP.js +93 -0
  381. package/dist/{source-VXE3RSSA.js.map → source-P6JPZYWP.js.map} +1 -1
  382. package/dist/{source-manifest-publish-IIVQLM67.js → source-manifest-publish-XBFHEURV.js} +51 -49
  383. package/dist/source-manifest-publish-XBFHEURV.js.map +1 -0
  384. package/dist/transport/index.js +8 -7
  385. package/dist/transport/ws/server.js +8 -7
  386. package/dist/transport/ws.js +8 -7
  387. package/dist/tui/index.js +37 -36
  388. package/dist/tui/index.js.map +1 -1
  389. package/dist/types/src/runtime.d.ts +6 -0
  390. package/dist/types/src/runtime.d.ts.map +1 -1
  391. package/dist/workspace-plugin/adapters/mcp.js +26 -26
  392. package/dist/workspace-plugin/adapters/omp.js +14 -14
  393. package/dist/workspace-plugin/index.js +1 -1
  394. package/package.json +7 -1
  395. package/dist/asset-feeds-PM7FKHJP.js.map +0 -1
  396. package/dist/chunk-2RVEYDQK.js +0 -110
  397. package/dist/chunk-2RVEYDQK.js.map +0 -1
  398. package/dist/chunk-6WIZC6GM.js.map +0 -1
  399. package/dist/chunk-7FXOOUOC.js.map +0 -1
  400. package/dist/chunk-7HRZACI4.js.map +0 -1
  401. package/dist/chunk-7LJUK5JK.js.map +0 -1
  402. package/dist/chunk-7VBD5XUM.js.map +0 -1
  403. package/dist/chunk-A4VKIVGB.js.map +0 -1
  404. package/dist/chunk-BNLXZXZN.js.map +0 -1
  405. package/dist/chunk-DRUAQ7IY.js.map +0 -1
  406. package/dist/chunk-IYXOSBQ4.js.map +0 -1
  407. package/dist/chunk-LBJCOEXH.js.map +0 -1
  408. package/dist/chunk-MEU2HHGV.js.map +0 -1
  409. package/dist/chunk-MS2IXLTC.js.map +0 -1
  410. package/dist/chunk-MUQBP2BK.js.map +0 -1
  411. package/dist/chunk-OIWFXUZB.js.map +0 -1
  412. package/dist/chunk-PFBPESW7.js.map +0 -1
  413. package/dist/chunk-R7422XD4.js.map +0 -1
  414. package/dist/chunk-SXRN27TU.js.map +0 -1
  415. package/dist/chunk-U7EJB6LY.js.map +0 -1
  416. package/dist/chunk-XPSZIBPU.js.map +0 -1
  417. package/dist/chunk-YLKOCMU7.js.map +0 -1
  418. package/dist/cli/src/commands/harness-preflight.d.ts +0 -40
  419. package/dist/cli/src/commands/harness-preflight.d.ts.map +0 -1
  420. package/dist/ensure-sources-I7GCXPXK.js.map +0 -1
  421. package/dist/library-publish-57422ULT.js.map +0 -1
  422. package/dist/serve-preflight-YY3YC6GH.js +0 -61
  423. package/dist/serve-preflight-YY3YC6GH.js.map +0 -1
  424. package/dist/setup-2XV6T53V.js.map +0 -1
  425. package/dist/source-VXE3RSSA.js +0 -91
  426. package/dist/source-manifest-publish-IIVQLM67.js.map +0 -1
@@ -0,0 +1,134 @@
1
+ import { type AssetRef, type HarnessName, type PresetExpansion, type ProvenanceCandidate, type SourceDeclaration, type SourceEntry, type StoreEntry } from "@skaile/workspaces/core";
2
+ import { type DeployableEntry } from "../installer.js";
3
+ import type { LibraryMove } from "../shared/types.js";
4
+ import { AmRemove } from "./remove.js";
5
+ /**
6
+ * A first-party manifest entry of a library whose asset file now names another asset (`name:`, a
7
+ * flow's `id:`), before `library index` renamed the entry: `publisher` is the entry's own or the
8
+ * manifest's, `file` the asset file relative to the library and `now` the name it carries.
9
+ */
10
+ export interface RenamedLibraryEntry {
11
+ kind: string;
12
+ name: string;
13
+ publisher?: string;
14
+ file: string;
15
+ now: string;
16
+ /**
17
+ * The sentence that fixes the entry when `library index` cannot rename it (a flow whose `id:`
18
+ * no longer matches its file name: index drops the entry instead), `undefined` when index renames it.
19
+ */
20
+ fileFix?: string;
21
+ }
22
+ /** The {@link RenamedLibraryEntry}s of the library at `libraryPath`. Registered by the host, as {@link LibraryAssetCheck}. */
23
+ export type RenamedEntryLookup = (libraryPath: string) => RenamedLibraryEntry[];
24
+ /** Register (or with `undefined`, remove) the {@link RenamedEntryLookup} `add` asks when a ref resolves to nothing (p1603). */
25
+ export declare function setRenamedEntryLookup(lookup: RenamedEntryLookup | undefined): void;
26
+ /** One asset a `skaile add --dry-run` would deploy. */
27
+ export interface AddPlanItem {
28
+ /** `kind:@publisher/name`. */
29
+ ref: string;
30
+ version: string;
31
+ /** `library <name>`, `source <name>`, `factory` or `store`. */
32
+ origin: string;
33
+ /** True for the asset that was asked for; false for a dependency it pulls. */
34
+ requested: boolean;
35
+ /** Deploy folders per harness target (project-relative, or `~`-relative for a global add). Empty for an agent. */
36
+ folders: string[];
37
+ /** Files of the asset, relative to its folder, when the resolver knows them. Empty for an agent. */
38
+ files: string[];
39
+ /** The native agent files each harness target gets, for an agent: it is rendered, not copied (p1621). */
40
+ renders: string[];
41
+ }
42
+ /** Add() and ref planning. One layer of the `AssetManager` class chain (see `asset-manager/CLAUDE.md`). */
43
+ export declare abstract class AmAdd extends AmRemove {
44
+ /**
45
+ * The refs of the other kinds that a source or a library holds under the same publisher and
46
+ * name as `parsed` (`agent:@pub/captain` for a `@pub/captain` that is no skill), for the
47
+ * `Did you mean` of an `add` that missed.
48
+ */
49
+ protected otherKindRefs(parsed: AssetRef): Promise<string[]>;
50
+ /**
51
+ * The sentence that ends the not-found line of a ref that names no asset but whose name exists
52
+ * under another kind: refs of other kinds under the same name that a source, a library, the
53
+ * lock or `skaile.yaml` holds. For a ref written without a kind (`@pub/name`, which means
54
+ * `skill`) it is `Did you mean agent:@pub/name?`; for a kind-qualified ref of the wrong
55
+ * kind (`skill:@pub/captain`) it is `It is an agent: agent:@pub/captain.`. `undefined`
56
+ * when nothing of another kind answers to it. `add`, `diff`, `update`, `info`, `remove` and
57
+ * `why` end their not-found line with it.
58
+ */
59
+ otherKindHint(ref: string): Promise<string | undefined>;
60
+ /**
61
+ * What `add` would deploy for the resolved candidates and library entries, without touching
62
+ * the project: one item per asset with its origin, version, deploy folders and files.
63
+ */
64
+ protected planAddItems(resolved: readonly ProvenanceCandidate[], lib: {
65
+ entries: DeployableEntry[];
66
+ libraryOf: ReadonlyMap<DeployableEntry, string>;
67
+ }, stores: readonly StoreEntry[], parsed: AssetRef): AddPlanItem[];
68
+ /**
69
+ * Parse the ref `add` was given. A ref the grammar rejects fails with the parser's message
70
+ * minus its manifest-migration advice (it points at a skill that is not for `add`), and:
71
+ * - a publisher-less ref (`report-html`, `skill:report-html`) names the assets of that
72
+ * kind and name that `add` can resolve (a source, the bundled factory source or a
73
+ * library holds them), so `Did you mean` never names an asset that does not resolve;
74
+ * - a `@version` suffix (`skill:@acme/x@1.0.0`) says the pin is written `#<version>`.
75
+ */
76
+ protected parseAddRef(ref: string, repositories: Record<string, SourceDeclaration>, sources: SourceEntry[]): Promise<AssetRef>;
77
+ /**
78
+ * The publisher-qualified refs of the assets named like the publisher-less `ref` that
79
+ * `add` resolves: held by a source clone, the bundled factory source or a registered
80
+ * library. A ref without a kind means a skill, as the grammar says.
81
+ */
82
+ protected resolvableMatches(ref: string, repositories: Record<string, SourceDeclaration>, sources: SourceEntry[]): Promise<string[]>;
83
+ /**
84
+ * Add a single asset (and its transitive dependencies) to the workspace.
85
+ *
86
+ * Resolves `ref`, deploys the asset and all requirements, then records the ref
87
+ * in `skaile.yaml` `dependencies` so subsequent `skaile install` runs re-deploy it.
88
+ *
89
+ * @param ref - Asset ref in `kind:name` or `repo/kind:name` form (e.g. `skill:my-skill`).
90
+ * @param opts - Optional deploy options.
91
+ * @param opts.link - When `true`, symlink local-path assets instead of copying them
92
+ * (the author dev-loop). Machine-local / not for committing; a no-op for
93
+ * store/factory sources. Defaults to copy.
94
+ * @param opts.onLibraryOrigin - Called once per deployed library-origin asset with its
95
+ * canonical ref and the name of the library it was resolved from.
96
+ * @param opts.onLibraryMoved - Called once per asset whose lock entry named another library
97
+ * than the one this add resolved it from.
98
+ * @param opts.onPresets - Called once with the presets expanded into this add (the
99
+ * added preset and any it nests); a library-held preset names its library.
100
+ * @returns Array of asset refs that were deployed in this call.
101
+ * @throws When the asset cannot be found in any configured repository, or when a
102
+ * preset's items do not all resolve (nothing is deployed or recorded then).
103
+ */
104
+ add(ref: string, opts?: {
105
+ link?: boolean;
106
+ onLibraryOrigin?: (deployedRef: string, library: string) => void;
107
+ /** Called per deployed library asset whose body is still the untouched `library create` scaffold. */
108
+ onPlaceholderBody?: (deployedRef: string) => void;
109
+ /** Called per deployed library asset whose `description:` is still the `library create` placeholder. */
110
+ onPlaceholderDescription?: (deployedRef: string) => void;
111
+ /** Called per already-locked asset this add moved to another library than its lock entry named. */
112
+ onLibraryMoved?: (move: LibraryMove) => void;
113
+ /** Called with the instance id and ref when this add bound an agent as `agents.<id>` of `skaile.yaml`. */
114
+ onAgentBound?: (id: string, ref: string) => void;
115
+ /** Called when the id this add would bind is taken by another agent: `agents.<id>` keeps `keptRef`. */
116
+ onAgentBindingKept?: (id: string, keptRef: string) => void;
117
+ /** `update <name>`: an equal-version tie between libraries goes to the default library, then the locked one (see {@link install}'s `moveLibraries`). */
118
+ preferLockedLibrary?: boolean;
119
+ onPresets?: (presets: PresetExpansion[]) => void;
120
+ /** Deploy over a folder no lock entry owns (a hand-made skill of the same name) instead of refusing. */
121
+ force?: boolean;
122
+ /** Called per `.env` file in an asset's directory that a copy deploy leaves out. */
123
+ onSecretFile?: (ref: string, path: string) => void;
124
+ /** Resolve and check everything, write nothing, and hand the plan to `onPlan`. */
125
+ dryRun?: boolean;
126
+ /** Global `--harness`: replace the recorded harness set instead of adding to it (`--only`). */
127
+ only?: boolean;
128
+ /** With `only`: called per harness that drops out of the set but still holds a copy. */
129
+ onDroppedCopy?: (ref: string, harness: HarnessName, path: string) => void;
130
+ /** Called once with the plan of a `dryRun` add. */
131
+ onPlan?: (plan: AddPlanItem[]) => void;
132
+ }): Promise<string[]>;
133
+ }
134
+ //# sourceMappingURL=add.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../../asset-manager/src/add-remove/add.ts"],"names":[],"mappings":"AAGA,OAAO,EAeL,KAAK,QAAQ,EAEb,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,UAAU,EAChB,MAAM,yBAAyB,CAAC;AAKjC,OAAO,EAKL,KAAK,eAAe,EACrB,MAAM,iBAAiB,CAAC;AAgBzB,OAAO,KAAK,EAA0C,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC9F,OAAO,EAAE,QAAQ,EAAE,MAAM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AAO,EAAE,eAAe,EAAE,KAAK,IAAI,CAAC;QACjD,wGAAwG;QACxG,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,oFAAoF;QACpF,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;QACnD,kFAAkF;QAClF,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,+FAA+F;QAC/F,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,wFAAwF;QACxF,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;QAC1E,mDAAmD;QACnD,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;KACxC,GACA,OAAO,CAAC,MAAM,EAAE,CAAC;CAkbrB"}
@@ -0,0 +1,329 @@
1
+ import { type HarnessName } from "@skaile/workspaces/core";
2
+ import type { AssetDefinition } from "@skaile/workspaces/library";
3
+ import { AmReadDoctor } from "../read/doctor.js";
4
+ /**
5
+ * Bare asset name of a soft-dep target ref (`@pub/name@ver` → `name`); splits the
6
+ * version off the *last* `@` since the leading one is the scope sigil. The
7
+ * present-check matches on this bare name only (under-reports — the safe direction).
8
+ */
9
+ export declare function softDepName(ref: string): string;
10
+ /**
11
+ * A body-link soft-dependency edge: asset `from` references target `to` in its
12
+ * body (not its typed `requires`). `toRef` is the parseable `skaile add` ref when
13
+ * the target is in the index, omitted otherwise. Surfaced read-only — never
14
+ * auto-installed (see {@link AssetManager.softDepsOf} / {@link AssetManager.reportSoftDeps}).
15
+ */
16
+ export interface SoftDepEdge {
17
+ from: string;
18
+ to: string;
19
+ toRef?: string;
20
+ }
21
+ /**
22
+ * A soft-dependency target that would be left orphaned by removing some assets:
23
+ * it is still present in the project, came in as `from`'s soft dependency, and
24
+ * nothing else still needs it (neither a soft-dep nor a typed `requires`).
25
+ * Report-only — {@link AssetManager.orphanedSoftDepsAfterRemoving} never removes
26
+ * it; the caller prompts (default No). `targetRef` is the parseable `skaile
27
+ * remove` ref when the target is in the index.
28
+ */
29
+ export interface OrphanedSoftDep {
30
+ from: string;
31
+ target: string;
32
+ targetRef?: string;
33
+ }
34
+ /** Outcome of {@link AssetManager.removeWithDependencies}. */
35
+ export interface RemoveResult {
36
+ /** Whether anything changed (as {@link AssetManager.remove}). */
37
+ changed: boolean;
38
+ /** Canonical refs (`kind:@publisher/name`) of the orphaned dependencies dropped as well. */
39
+ pruned: string[];
40
+ /**
41
+ * Set when the removal was refused because other assets still require it; nothing was
42
+ * removed. `ref` is the asset (`kind:@publisher/name`), `requiredBy` the refs requiring it.
43
+ */
44
+ blocked?: {
45
+ ref: string;
46
+ requiredBy: string[];
47
+ };
48
+ /**
49
+ * Deployed folders or files of the asset that no lock entry holds (the user's own work):
50
+ * kept, not deleted. Empty when `force` was given.
51
+ */
52
+ kept?: string[];
53
+ /**
54
+ * Deployed folders or files of the asset that another publisher's lock entry holds: kept, not
55
+ * deleted (only that entry's own `remove` may delete them, or `force`). `refs` are the owning
56
+ * lock entries, `paths` the kept folders.
57
+ */
58
+ ownedBy?: {
59
+ refs: string[];
60
+ paths: string[];
61
+ }[];
62
+ /**
63
+ * `mcp_servers` entries of `skaile.yaml` that were dropped with a removed `mcp-server` because
64
+ * they only set values for it (an `env` override with no `command` or `url` of its own), as
65
+ * `mcp_servers entry "<id>"`. An entry that can run alone stays.
66
+ */
67
+ droppedSettings?: string[];
68
+ }
69
+ /** Identity {@link AssetManager.remove} acts on; `publisher` is absent for an unqualified short ref. */
70
+ interface RemoveTarget {
71
+ kind: string;
72
+ name: string;
73
+ publisher?: string;
74
+ }
75
+ /** Soft deps, remove(), pruneOrphans. One layer of the `AssetManager` class chain (see `asset-manager/CLAUDE.md`). */
76
+ export declare abstract class AmRemove extends AmReadDoctor {
77
+ /**
78
+ * Report the body-link **soft dependencies** of the given assets that are not
79
+ * already present in the project.
80
+ *
81
+ * Looks up each ref's persisted `softDeps` in the local index
82
+ * (`~/.skaile/index.db`, populated by `skaile source sync`) and returns the
83
+ * edges whose target is neither a declared dependency nor deployed on disk. It
84
+ * does **not** install anything and never touches the resolver / lock /
85
+ * reconcile path: callers surface the result as a hint, the user opts in with
86
+ * a follow-up `skaile add`. Inspects exactly the passed `refs` — soft deps of
87
+ * their transitively-deployed dependencies are not surfaced here.
88
+ *
89
+ * Opening the index runs its idempotent migrations, so this is not a pure
90
+ * read — but it is **best-effort**: any failure (legacy/corrupt index, a
91
+ * removed-backend guard) yields `[]`, so it can never fail a primary `add`
92
+ * that already succeeded.
93
+ *
94
+ * @param refs - Asset refs to inspect (canonical, `kind:@pub/name`, or `kind:name`).
95
+ * @returns One edge per absent soft-dep target (deduped by target). `toRef` is
96
+ * the parseable `skaile add` ref, omitted when the target isn't in the index.
97
+ */
98
+ reportSoftDeps(refs: string[]): Promise<Array<{
99
+ from: string;
100
+ to: string;
101
+ toRef?: string;
102
+ }>>;
103
+ /**
104
+ * Presets in the configured sources (and the bundled factory source) that list
105
+ * `ref` as an asset item, for the `skaile add` discoverability hint. Membership is
106
+ * not a dependency: nothing here installs the preset or its siblings.
107
+ *
108
+ * Matches on kind + name, and on publisher only when both sides carry one, so
109
+ * a bare `skill:x` item still matches `skill:@pub/x`. Presets already
110
+ * declared in `skaile.yaml` are left out. Best-effort: any failure yields `[]`,
111
+ * so it can never fail an `add` that succeeded.
112
+ *
113
+ * @param ref - The added asset ref (`kind:name`, `kind:@pub/name`, optionally pinned).
114
+ * @returns One `{ name, ref }` per containing preset, deduped by `ref`; `ref` is
115
+ * the `skaile add` form (`preset:@pub/name`, or `preset:name` without a publisher).
116
+ */
117
+ presetsContaining(ref: string): Promise<Array<{
118
+ name: string;
119
+ ref: string;
120
+ }>>;
121
+ /**
122
+ * All body-link soft dependencies of the given assets — present or not.
123
+ *
124
+ * Unlike {@link reportSoftDeps} (which filters to *absent* targets so it can
125
+ * nudge a follow-up `skaile add`), this returns the asset's full inferred
126
+ * soft-dep set for display surfaces (`skaile info` / `tree` / `why`). Read-only
127
+ * and best-effort: any index failure yields `[]`. Targets are deduped.
128
+ *
129
+ * @param refs - Asset refs to inspect (canonical, `kind:@pub/name`, or `kind:name`).
130
+ * @returns One {@link SoftDepEdge} per soft-dep target. `toRef` is the parseable
131
+ * ref, omitted when the target isn't in the index.
132
+ */
133
+ softDepsOf(refs: string[]): Promise<SoftDepEdge[]>;
134
+ /**
135
+ * Reverse lookup: refs (canonical ids) of cached assets whose persisted
136
+ * `softDeps` include `targetRef`. Scans the whole index, not just present
137
+ * assets. Read-only and best-effort (`[]` on any index failure).
138
+ *
139
+ * @param targetRef - Canonical soft-dep target ref (`<publisher>/<name>@<version>`).
140
+ * @returns Def ids that declare `targetRef` as a soft dependency.
141
+ */
142
+ softDepDependents(targetRef: string): Promise<string[]>;
143
+ /**
144
+ * Compute which soft-dependency targets would be left **orphaned** by removing
145
+ * `refs`: targets still present in the project that came in as one of `refs`'
146
+ * soft dependencies and that **nothing else still needs** — neither another
147
+ * present asset's soft-dep ({@link softDepDependents}) nor a typed `requires`.
148
+ *
149
+ * Pure read — never removes anything. The CLI / manage surfaces each result as
150
+ * a prompt (default No) so the user opts in to an extra `skaile remove`. Safe to
151
+ * call before or after the primary remove: assets being removed are excluded
152
+ * from the "needed by others" scan, so a soft target referenced only by the
153
+ * removed asset is still reported as an orphan.
154
+ *
155
+ * @param refs - Asset refs being removed (canonical, `kind:@pub/name`, or `kind:name`).
156
+ * @returns One {@link OrphanedSoftDep} per orphaned target (deduped).
157
+ */
158
+ orphanedSoftDepsAfterRemoving(refs: string[]): Promise<OrphanedSoftDep[]>;
159
+ /**
160
+ * Open the local index, run `fn` against its cached asset defs, and close it.
161
+ * Best-effort: no index (user never ran `source sync`), a missing file, or any
162
+ * open/guard failure yields `fallback` — so a read surface can never throw or
163
+ * create an empty `index.db` as a side effect.
164
+ */
165
+ protected withIndexDefs<T>(fn: (defs: AssetDefinition[]) => T, fallback: T): Promise<T>;
166
+ /**
167
+ * Build soft-dep edges for `refs` from cached defs. With `onlyAbsent`, targets
168
+ * already present in the project are skipped (the `reportSoftDeps` nudge); else
169
+ * the full inferred set is returned (the `softDepsOf` display). Deduped by target.
170
+ */
171
+ protected collectSoftDeps(allDefs: AssetDefinition[], refs: string[], onlyAbsent: boolean): SoftDepEdge[];
172
+ /**
173
+ * Names of assets already in the project — declared deps + deployed on disk.
174
+ * Bare name only (see {@link softDepName}): a same-named asset of a different
175
+ * publisher/kind counts as present, so the report under-reports rather than
176
+ * nags about something already installed.
177
+ */
178
+ protected presentRefNames(): Set<string>;
179
+ /**
180
+ * Present asset refs — declared `skaile.yaml` deps (canonical refs as written)
181
+ * plus deployed assets as `kind:name`. Used by the soft-dep present-check and
182
+ * the orphan "needed by others" scan.
183
+ */
184
+ protected presentRefs(): string[];
185
+ /**
186
+ * Remove a deployed asset and unregister it from `skaile.yaml` and the lock.
187
+ *
188
+ * A declared asset is always unregistered, even when nothing is deployed any
189
+ * more (e.g. its library file was deleted): the declaration and lock entry
190
+ * would otherwise be stuck behind a "not deployed" refusal.
191
+ *
192
+ * Removes only `ref` itself; use {@link removeWithDependencies} to also drop the
193
+ * dependencies it leaves orphaned.
194
+ *
195
+ * Deliberately does NOT re-render the harness target's MCP config: the render
196
+ * step is async (the declaration resolver is), and making this synchronous
197
+ * method async would break every external caller. {@link removeWithDependencies}
198
+ * (what `skaile remove` runs) does re-render it; a caller of this method gets the
199
+ * dropped entry at the next {@link AssetManager.install} — see
200
+ * {@link renderMcpServerConfig}.
201
+ *
202
+ * @param ref - Asset ref: `kind:@publisher/name`, or the short `kind:name` /
203
+ * `name` form when exactly one declared, locked or deployed asset matches it.
204
+ * @returns `true` if anything changed (files undeployed, declaration or lock
205
+ * entry removed), `false` if the asset was neither deployed nor declared.
206
+ * A `preset:` ref has no deployed files: only its declaration goes — its
207
+ * expanded items leave with the next `skaile install`.
208
+ * @throws When `ref` is malformed, or a short ref matches several assets (the
209
+ * message lists them).
210
+ */
211
+ remove(ref: string, opts?: {
212
+ force?: boolean;
213
+ }): boolean;
214
+ /**
215
+ * {@link remove} `ref`, then drop the dependencies that removal left orphaned:
216
+ * locked assets `ref` required (directly or through one another) that
217
+ * `skaile.yaml` no longer declares and no remaining locked asset requires. A
218
+ * preset's items count as its requirements. They are undeployed and unlocked;
219
+ * a dependency still declared or required elsewhere stays.
220
+ *
221
+ * An asset another locked asset (or a declared preset) requires is kept and reported in
222
+ * `blocked`, nothing changes, unless `opts.force` (see {@link requiredByOthers}).
223
+ *
224
+ * @returns `changed` as {@link remove}; `pruned` the canonical refs
225
+ * (`kind:@publisher/name`) of the dependencies dropped as well; `blocked` when the
226
+ * removal was refused.
227
+ */
228
+ removeWithDependencies(ref: string, opts?: {
229
+ force?: boolean;
230
+ }): Promise<RemoveResult>;
231
+ /**
232
+ * Resolve the identity {@link remove} acts on. A publisher-qualified ref is taken
233
+ * as written; a short ref (`kind:name`, or just `name`) is matched on kind + name
234
+ * against the declared dependencies, the lock and the deployed assets, like
235
+ * `why` / `diff` do.
236
+ *
237
+ * @returns the identity, or `null` when a name-only ref matches nothing.
238
+ * @throws On a malformed ref, or when a short ref matches more than one asset.
239
+ */
240
+ protected resolveRemoveTarget(ref: string): RemoveTarget | null;
241
+ /**
242
+ * The refs among `refs` (`skill:@publisher/name`, `skill:name`, with or without `#version`)
243
+ * that are not deployed for this manager's harnesses and scope, judged as `check` judges a
244
+ * requirement. A ref that does not parse or names a kind this build does not install is
245
+ * never reported. `run <flow> --dry-run` names the node skills a flow still lacks (p1757).
246
+ */
247
+ undeployedSkills(refs: readonly string[]): string[];
248
+ /**
249
+ * The reverse guard of {@link removeWithDependencies}: which other locked assets (and
250
+ * declared presets) require `target`. Their requirements are read the way {@link lockedGraph}
251
+ * reads them for pruning. Never touches the project.
252
+ *
253
+ * @returns `ref` and `requiredBy` (both `kind:@publisher/name`, version-agnostic), or `null`
254
+ * when `target` is not locked or nothing else requires it.
255
+ */
256
+ protected requiredByOthers(target: RemoveTarget): Promise<{
257
+ ref: string;
258
+ requiredBy: string[];
259
+ } | null>;
260
+ /**
261
+ * Publishers under which the lock or `skaile.yaml` track `kind:name`. A deployed dir carries
262
+ * no publisher, so this is what says whose copy it is. `undefined` stands for a
263
+ * publisher-less declaration.
264
+ */
265
+ protected trackedPublishers(kind: string, name: string): Set<string | undefined>;
266
+ /**
267
+ * The lock entries of `kind:name` under another publisher than `wantPub` whose recorded bytes
268
+ * are the deployed copy, while the entries of `wantPub` do not record them. Empty when no
269
+ * entry provably owns the folder (nothing recorded, or the copy was edited), so the remove
270
+ * keeps its old meaning there.
271
+ */
272
+ protected otherLockOwners(kind: string, name: string, wantPub: string): {
273
+ publisher?: string;
274
+ ref: string;
275
+ }[];
276
+ /**
277
+ * The lock entries that hold `kind:name`, each with its publisher (no leading `@`) and its
278
+ * canonical ref. A deployed folder carries no publisher; these are who it belongs to.
279
+ */
280
+ protected lockHolders(kind: string, name: string): {
281
+ publisher?: string;
282
+ ref: string;
283
+ }[];
284
+ /** The folders or files of `kind:name` on disk in `target`, shown relative to the project. */
285
+ protected heldDeployPaths(kind: string, name: string, target: HarnessName): string[];
286
+ /**
287
+ * Undeploy `parsed` from every target harness and drop its declaration and lock entry.
288
+ *
289
+ * A folder no lock entry holds is the user's own work (a hand-made skill of the same name):
290
+ * it is kept and named in `opts.kept` unless `opts.force`.
291
+ */
292
+ protected removeResolved(parsed: RemoveTarget, opts?: {
293
+ force?: boolean;
294
+ kept?: string[];
295
+ ownedBy?: {
296
+ refs: string[];
297
+ paths: string[];
298
+ }[];
299
+ }): boolean;
300
+ /**
301
+ * After `remove --global --harness X`: the harnesses outside `X` that still hold a copy of the
302
+ * asset, or `undefined` when none does (or this is not a harness-limited global remove).
303
+ */
304
+ protected harnessesStillHolding(target: RemoveTarget): HarnessName[] | undefined;
305
+ /** Limit the declared global entry of `target` to `harnesses` (`~/.skaile/skaile.yaml`). */
306
+ protected limitDeclaredEntry(target: RemoveTarget, harnesses: HarnessName[]): void;
307
+ /**
308
+ * Drop the locked assets among `requiredRefs` (and what they require in turn) that
309
+ * nothing needs any more: not declared in `skaile.yaml`, not required by a locked
310
+ * asset outside that set. Call after the requiring asset is gone.
311
+ *
312
+ * @returns the canonical refs of the assets dropped.
313
+ */
314
+ protected pruneOrphans(requiredRefs: string[]): Promise<string[]>;
315
+ /**
316
+ * Drop every lock entry matching a removed asset's identity, version-agnostic so
317
+ * a content-sha pseudo-version key is pruned too. Symmetric with {@link add}'s
318
+ * lock-merge — stops a stale entry reporting a phantom "removed" on next install.
319
+ *
320
+ * @returns `true` when at least one lock entry was dropped.
321
+ */
322
+ protected pruneLockEntry(parsed: {
323
+ kind: string;
324
+ name: string;
325
+ publisher?: string;
326
+ }): boolean;
327
+ }
328
+ export {};
329
+ //# sourceMappingURL=remove.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../../asset-manager/src/add-remove/remove.ts"],"names":[],"mappings":"AAEA,OAAO,EAaL,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAKlE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAUjD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAK/C;AAiED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,8DAA8D;AAC9D,MAAM,WAAW,YAAY;IAC3B,iEAAiE;IACjE,OAAO,EAAE,OAAO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AAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO;CAwC9F"}
@@ -0,0 +1,116 @@
1
+ import { type LockFileEntry } from "@skaile/workspaces/core";
2
+ import { type StaleAgentFile } from "./install-instances.js";
3
+ import type { DeployOptions } from "./installer.js";
4
+ import { AmReadState } from "./read/state.js";
5
+ import type { InstallResult } from "./shared/types.js";
6
+ /** A file named after an agent asset that an instance's file stands for now; see `leftoverAgentFiles`. */
7
+ interface LeftoverAgentFile {
8
+ agent: string;
9
+ /** Project-relative. */
10
+ path: string;
11
+ /** The instances that bind the agent (none for a `binding: run` role). */
12
+ ids: string[];
13
+ /** The lock records other bytes for it than the file holds. */
14
+ edited: boolean;
15
+ }
16
+ /** Agent instance render and leftover agent files. One layer of the `AssetManager` class chain (see `asset-manager/CLAUDE.md`). */
17
+ export declare abstract class AmAgentRender extends AmReadState {
18
+ protected abstract renderedAgentFiles(name: string): LockFileEntry[];
19
+ protected abstract unboundAgentAdvice(ref: string): Promise<{
20
+ lead: string;
21
+ advice: string;
22
+ }>;
23
+ /**
24
+ * Whether a project-relative path is a file an agent instance renders (the ledger's files). An
25
+ * instance claims files and folders (omp renders a folder): a file under a claimed folder is
26
+ * claimed too.
27
+ */
28
+ protected instanceClaims(): (rel: string) => boolean;
29
+ /**
30
+ * Whether the path `rel` that the lock lists under `rendered:` for the agent `name` is a file
31
+ * named after the asset that an instance's file (or the `binding: run` role) stands for now.
32
+ * Such a path is no part of the rendering the lock expects any more: a lock of 5.13.0 and older
33
+ * still lists it, `install` drops it at the next lock write, and until then it is neither a
34
+ * missing nor an edited copy. Always `false` in global mode.
35
+ */
36
+ protected supersededRendering(): (name: string, rel: string) => boolean;
37
+ /**
38
+ * The files named after an agent asset that an earlier CLI rendered and this one does not: the
39
+ * agent is bound by an instance (its rendering is the instance's file), or it only runs as a
40
+ * `binding: run` role. A file counts when no instance of the ledger claims it and either the
41
+ * lock lists it for the agent (`edited` when its bytes differ from the recorded ones), or the
42
+ * lock records no rendering for the agent at all (5.11.0 and older) and the file is the
43
+ * instance's render under the asset's name. A file of the second kind that differs from that
44
+ * render may be the user's own and is not listed. Project mode only.
45
+ */
46
+ protected leftoverAgentFiles(): LeftoverAgentFile[];
47
+ /**
48
+ * Remove the leftover files {@link leftoverAgentFiles} lists. A file edited since the lock
49
+ * stays (it is the user's now) and is named. The old lock entry is rewritten by the same
50
+ * install, so the lock never keeps a path that is gone; `install --locked` leaves the lock,
51
+ * which `check` does not read for a file that is gone.
52
+ *
53
+ * @returns The project-relative paths removed.
54
+ */
55
+ protected pruneAssetNamedAgentFiles(): string[];
56
+ /**
57
+ * The `check`, `doctor` and `outdated` lines for the files {@link leftoverAgentFiles} lists: an
58
+ * untouched one is removed by the next `install` (and by `install --locked`), an edited one
59
+ * stays. Empty in global mode and when nothing is left over.
60
+ */
61
+ leftoverAgentFileNotices(): string[];
62
+ /**
63
+ * Render every agent instance of `skaile.yaml` into the harness target's native
64
+ * agent files (`.claude/agents/<id>.md`, …) and prune the renderings of
65
+ * instances that left the config. Runs after the skills deploy, so composed
66
+ * skills resolve. Project scope only. An instance whose `ref` resolves to no agent is
67
+ * reported in `agentInstanceErrors`; any other render error is warned and swallowed. The line
68
+ * of an agent whose `extends` parent is not there is not printed here: `add` prints it once
69
+ * (`missingParentNotices`), `check` and `doctor` print it after.
70
+ *
71
+ * @param opts.prune - Also remove the files named after the agent assets that an earlier CLI
72
+ * rendered and an instance renders now ({@link pruneAssetNamedAgentFiles}). Set by the
73
+ * commands that deploy or re-lock; the lock is left as it is by `install --locked`.
74
+ */
75
+ protected renderAgentInstances(opts?: Pick<DeployOptions, "lockAssets"> & {
76
+ prune?: boolean;
77
+ }): Promise<Pick<InstallResult, "agentInstances" | "agentInstancesChanged" | "agentFilesRemoved" | "agentInstanceErrors" | "agentInstanceDetails">>;
78
+ /**
79
+ * The agent assets rendered under their own name (no instance binds them, no `binding: run`
80
+ * role) whose source the cache holds: the agents whose files `staleAgentFiles` looks at besides
81
+ * the instances'.
82
+ */
83
+ private assetNamedAgents;
84
+ /**
85
+ * One line per baked block of a native agent file whose inputs changed since `install` wrote it
86
+ * (`<file>: <block label> is out of date - run skaile install`): what `check` and `doctor` print
87
+ * as drift. It covers the files of the agent instances, the delegate sub-agents beside them and
88
+ * the files named after an agent asset. Project scope only; a harness without a native agent
89
+ * file has none.
90
+ */
91
+ staleAgentFileLines(): Promise<string[]>;
92
+ /**
93
+ * Render every stale native agent file again, through the renders `install` uses (so the bytes
94
+ * are an `install`'s), and record the new bytes in the lock entries that list the files, so
95
+ * `check` finds no edit. `skaile run`, `repl` and `serve` call it before the session starts:
96
+ * the files are rendered artefacts, and an edit of `DUTIES.md`, a local ruleset or a prompt
97
+ * extension applies to the next run, whichever agent of the project the session reaches
98
+ * (another instance through `agent.run`, a delegate sub-agent the harness spawns). A render
99
+ * whose files include one that is not the bytes the lock recorded was edited by hand: it is
100
+ * left as it is (`check` names it) and not returned.
101
+ *
102
+ * @returns The files that were stale and are rendered again; empty when nothing was.
103
+ * @throws When a file is still stale after the render.
104
+ */
105
+ rerenderStaleAgentFiles(): Promise<StaleAgentFile[]>;
106
+ /** Render the agent a stale file belongs to again; the workspace-relative files it wrote. */
107
+ private renderOwner;
108
+ /**
109
+ * Put the sha256 of the files just written into the lock entries that list them. The lock is
110
+ * read again here, not taken from before the render: another process may have written it in
111
+ * between (an `add`, an `update`), and only the `rendered` hashes of these files change.
112
+ */
113
+ private recordRenderedHashes;
114
+ }
115
+ export {};
116
+ //# sourceMappingURL=agent-render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-render.d.ts","sourceRoot":"","sources":["../../../asset-manager/src/agent-render.ts"],"names":[],"mappings":"AAEA,OAAO,EAOL,KAAK,aAAa,EAGnB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EASL,KAAK,cAAc,EAGpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,K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,GACvB,mBAAmB,GACnB,qBAAqB,GACrB,sBAAsB,CACzB,CACF;IAuCD;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAiBxB;;;;;;OAMG;IACG,mBAAmB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAY9C;;;;;;;;;;;;OAYG;IACG,uBAAuB,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;IAuC1D,6FAA6F;YAC/E,WAAW;IAuCzB;;;;OAIG;IACH,OAAO,CAAC,oBAAoB;CAkB7B"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * The prompt blocks an agent bakes into its native agent file besides the convention files: the
3
+ * inline items of `composes:` (rulesets, prompts, personas, contracts, knowledge) and the seeds of
4
+ * memory blocks that nothing stores (`memory.scope: none`).
5
+ *
6
+ * The bytes come from the runner's own content source (`createCompositionContentSource`, the one
7
+ * function `skaile run` resolves a `composes:` ref with: a local path, a lock pin, a registered
8
+ * library, the catalog), so the file holds what a run sends, in `composes:` order. A ref that
9
+ * source cannot resolve throws its `CompositionError`; install reports it and the agent is not
10
+ * rendered. A host-backed memory block is never baked: the host owns its content, only the
11
+ * runner has it.
12
+ */
13
+ import type { AgentInstanceConfig, AgentPromptMemoryBlock, AgentPromptPart, LockEntry } from "@skaile/workspaces/core";
14
+ import type { AgentManifest } from "@skaile/workspaces/types/manifests";
15
+ /** What {@link loadPromptBlocks} found. */
16
+ export interface PromptBlocks {
17
+ /** The inline `composes:` items, in `composes:` order. */
18
+ composed: AgentPromptPart[];
19
+ /** The memory blocks whose seed is baked (`memory.scope: none`). */
20
+ memory: AgentPromptMemoryBlock[];
21
+ }
22
+ /**
23
+ * Read the composed inline blocks and the baked memory seeds of an agent for its native file.
24
+ *
25
+ * @param manifest - The agent manifest (`composes`, `memory`).
26
+ * @param srcDir - The agent's source directory: base of local refs and of `memory.blocks[].source`.
27
+ * @param projectDir - The project root (`skaile.lock.yaml`, `.skaile/cache/store`).
28
+ * @param instance - The `skaile.yaml` instance being rendered; `memory.scope: none` bakes the seeds.
29
+ * @param lockAssets - The lock entries the command is about to write. A pin the same command moves
30
+ * (`skaile update`) resolves against them, not against the older lock on disk.
31
+ * @throws `CompositionError` (`@skaile/workspaces/runner/composition-content`) when the runner's
32
+ * content source cannot resolve an inline item; its message names the ref.
33
+ */
34
+ export declare function loadPromptBlocks(manifest: AgentManifest, srcDir: string, projectDir: string, instance?: AgentInstanceConfig, lockAssets?: Record<string, LockEntry>): Promise<PromptBlocks>;
35
+ /**
36
+ * The loaded prompt extensions as parts that carry their config path, the identity a native file
37
+ * and a run find them by. A missing or empty file is left out, as the runner leaves it out.
38
+ */
39
+ export declare function loadPromptExtensionParts(paths: readonly string[] | undefined, projectDir: string): AgentPromptPart[];
40
+ //# sourceMappingURL=composed-blocks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composed-blocks.d.ts","sourceRoot":"","sources":["../../../asset-manager/src/composed-blocks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EACV,mBAAmB,EACnB,sBAAsB,EACtB,eAAe,EACf,SAAS,EACV,MAAM,yBAAyB,CAAC;AAQjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAgCxE,2CAA2C;AAC3C,MAAM,WAAW,YAAY;IAC3B,0DAA0D;IAC1D,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,oEAAoE;IACpE,MAAM,EAAE,sBAAsB,EAAE,CAAC;CAClC;AAKD;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,QAAQ,CAAC,EAAE,mBAAmB,EAC9B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GACrC,OAAO,CAAC,YAAY,CAAC,CAgDvB;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EACpC,UAAU,EAAE,MAAM,GACjB,eAAe,EAAE,CAOnB"}