@skaile/workspaces 6.0.0 → 6.1.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 (320) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/dist/{asset-feeds-PXUWCXVI.js → asset-feeds-HJFV7UPW.js} +26 -18
  3. package/dist/asset-feeds-HJFV7UPW.js.map +1 -0
  4. package/dist/asset-manager/catalog-deployer.js +7 -7
  5. package/dist/asset-manager/index.js +13 -13
  6. package/dist/asset-manager/installer.js +8 -8
  7. package/dist/asset-manager/renderers.js +7 -7
  8. package/dist/asset-manager/src/index.d.ts +192 -5
  9. package/dist/asset-manager/src/index.d.ts.map +1 -1
  10. package/dist/asset-manager/src/installer.d.ts +31 -0
  11. package/dist/asset-manager/src/installer.d.ts.map +1 -1
  12. package/dist/asset-manager/src/mcp-config.d.ts +21 -0
  13. package/dist/asset-manager/src/mcp-config.d.ts.map +1 -1
  14. package/dist/bridge/harnesses/claude-sdk.js +13 -17
  15. package/dist/bridge/harnesses/claude-sdk.js.map +1 -1
  16. package/dist/bridge/harnesses/codex.js +10 -10
  17. package/dist/bridge/harnesses/continue.js +10 -10
  18. package/dist/bridge/harnesses/echo.js +2 -2
  19. package/dist/bridge/harnesses/gemini.js +6 -6
  20. package/dist/bridge/harnesses/goose.js +10 -10
  21. package/dist/bridge/harnesses/omp.js +4 -4
  22. package/dist/bridge/harnesses/opencode.js +10 -10
  23. package/dist/bridge/harnesses/qwen.js +6 -6
  24. package/dist/bridge/index.js +14 -14
  25. package/dist/bridge/src/claude-sdk-surface.d.ts +17 -0
  26. package/dist/bridge/src/claude-sdk-surface.d.ts.map +1 -0
  27. package/dist/bridge/src/harness-model-check.d.ts +15 -0
  28. package/dist/bridge/src/harness-model-check.d.ts.map +1 -1
  29. package/dist/bridge/src/harnesses/claude-sdk.d.ts.map +1 -1
  30. package/dist/bridge/src/index.d.ts +2 -1
  31. package/dist/bridge/src/index.d.ts.map +1 -1
  32. package/dist/bridge/src/normalizer.d.ts +3 -1
  33. package/dist/bridge/src/normalizer.d.ts.map +1 -1
  34. package/dist/{chunk-VJRTDKXS.js → chunk-2LAPHLDH.js} +144 -94
  35. package/dist/chunk-2LAPHLDH.js.map +1 -0
  36. package/dist/{chunk-VXEYX73S.js → chunk-3GMOPFWH.js} +4 -4
  37. package/dist/{chunk-VXEYX73S.js.map → chunk-3GMOPFWH.js.map} +1 -1
  38. package/dist/{chunk-MCUJTNY5.js → chunk-4FVIT5DI.js} +3 -3
  39. package/dist/{chunk-MCUJTNY5.js.map → chunk-4FVIT5DI.js.map} +1 -1
  40. package/dist/{chunk-SZXGRHQQ.js → chunk-4MUDQCBP.js} +4 -4
  41. package/dist/{chunk-SZXGRHQQ.js.map → chunk-4MUDQCBP.js.map} +1 -1
  42. package/dist/{chunk-7CV3HFWJ.js → chunk-5J4NPGFM.js} +3 -3
  43. package/dist/{chunk-7CV3HFWJ.js.map → chunk-5J4NPGFM.js.map} +1 -1
  44. package/dist/{chunk-4XWLB7JB.js → chunk-5Y2KGB4H.js} +69 -34
  45. package/dist/chunk-5Y2KGB4H.js.map +1 -0
  46. package/dist/{chunk-OULSJRXV.js → chunk-6YR4ALVX.js} +6 -6
  47. package/dist/{chunk-OULSJRXV.js.map → chunk-6YR4ALVX.js.map} +1 -1
  48. package/dist/chunk-7HX6FNKL.js +317 -0
  49. package/dist/chunk-7HX6FNKL.js.map +1 -0
  50. package/dist/{chunk-WDAIWDLK.js → chunk-7LP7RCZI.js} +4 -4
  51. package/dist/{chunk-WDAIWDLK.js.map → chunk-7LP7RCZI.js.map} +1 -1
  52. package/dist/{chunk-2UUKCROR.js → chunk-AATHJRKL.js} +4 -4
  53. package/dist/{chunk-2UUKCROR.js.map → chunk-AATHJRKL.js.map} +1 -1
  54. package/dist/{chunk-DUMTLYSO.js → chunk-ABFPSVIS.js} +3 -3
  55. package/dist/{chunk-DUMTLYSO.js.map → chunk-ABFPSVIS.js.map} +1 -1
  56. package/dist/{chunk-TKHJXPSB.js → chunk-AITJ7ELM.js} +140 -26
  57. package/dist/chunk-AITJ7ELM.js.map +1 -0
  58. package/dist/{chunk-Y2TO2U7W.js → chunk-ASWTQQ7E.js} +3 -3
  59. package/dist/{chunk-Y2TO2U7W.js.map → chunk-ASWTQQ7E.js.map} +1 -1
  60. package/dist/{chunk-WYHQUCHR.js → chunk-AZ2H6R5I.js} +51 -25
  61. package/dist/chunk-AZ2H6R5I.js.map +1 -0
  62. package/dist/{chunk-LN6QB7XI.js → chunk-BBBCJSSU.js} +4 -4
  63. package/dist/{chunk-LN6QB7XI.js.map → chunk-BBBCJSSU.js.map} +1 -1
  64. package/dist/{chunk-WEH33JSG.js → chunk-CEKW3KXP.js} +87 -26
  65. package/dist/chunk-CEKW3KXP.js.map +1 -0
  66. package/dist/{chunk-ARWKK325.js → chunk-COYF6IG2.js} +5 -5
  67. package/dist/{chunk-ARWKK325.js.map → chunk-COYF6IG2.js.map} +1 -1
  68. package/dist/{chunk-SNEE6UGY.js → chunk-DGTI65OC.js} +11 -11
  69. package/dist/{chunk-SNEE6UGY.js.map → chunk-DGTI65OC.js.map} +1 -1
  70. package/dist/{chunk-HK7HMEPT.js → chunk-DIGFA7Z5.js} +3 -3
  71. package/dist/{chunk-HK7HMEPT.js.map → chunk-DIGFA7Z5.js.map} +1 -1
  72. package/dist/{chunk-AF432MS3.js → chunk-EJPMNDTP.js} +3 -3
  73. package/dist/{chunk-AF432MS3.js.map → chunk-EJPMNDTP.js.map} +1 -1
  74. package/dist/chunk-EX3GLAL6.js +31 -0
  75. package/dist/chunk-EX3GLAL6.js.map +1 -0
  76. package/dist/{chunk-UVVVR4XO.js → chunk-FKQNBCDW.js} +3 -3
  77. package/dist/{chunk-UVVVR4XO.js.map → chunk-FKQNBCDW.js.map} +1 -1
  78. package/dist/{chunk-GEQSUC6U.js → chunk-GNZBFSRB.js} +3 -3
  79. package/dist/{chunk-GEQSUC6U.js.map → chunk-GNZBFSRB.js.map} +1 -1
  80. package/dist/{chunk-U56GGCC2.js → chunk-HMISULVD.js} +4 -4
  81. package/dist/{chunk-U56GGCC2.js.map → chunk-HMISULVD.js.map} +1 -1
  82. package/dist/{chunk-GN4VVSAA.js → chunk-HPMQRAIF.js} +7 -7
  83. package/dist/{chunk-GN4VVSAA.js.map → chunk-HPMQRAIF.js.map} +1 -1
  84. package/dist/{chunk-OAHVKSQJ.js → chunk-HWNK3F3X.js} +913 -80
  85. package/dist/chunk-HWNK3F3X.js.map +1 -0
  86. package/dist/{chunk-NMI2TWMH.js → chunk-IHFGPHCT.js} +131 -341
  87. package/dist/chunk-IHFGPHCT.js.map +1 -0
  88. package/dist/{chunk-F2GOZMRA.js → chunk-ILLTBKDJ.js} +47 -47
  89. package/dist/chunk-ILLTBKDJ.js.map +1 -0
  90. package/dist/{chunk-FKU57Q5Q.js → chunk-IRYKRKVQ.js} +3 -3
  91. package/dist/{chunk-FKU57Q5Q.js.map → chunk-IRYKRKVQ.js.map} +1 -1
  92. package/dist/{chunk-T2BDID2J.js → chunk-J72MO2WA.js} +8 -8
  93. package/dist/{chunk-T2BDID2J.js.map → chunk-J72MO2WA.js.map} +1 -1
  94. package/dist/{chunk-X3RMRJNR.js → chunk-JRN5QF4C.js} +8 -3
  95. package/dist/chunk-JRN5QF4C.js.map +1 -0
  96. package/dist/{chunk-E3GPGTW3.js → chunk-KUQAJVYT.js} +5 -5
  97. package/dist/{chunk-E3GPGTW3.js.map → chunk-KUQAJVYT.js.map} +1 -1
  98. package/dist/{chunk-WDXZA7QW.js → chunk-LSSYC5IC.js} +2 -2
  99. package/dist/{chunk-WDXZA7QW.js.map → chunk-LSSYC5IC.js.map} +1 -1
  100. package/dist/{chunk-3IXIEHUB.js → chunk-NB7SYQYP.js} +5 -5
  101. package/dist/{chunk-3IXIEHUB.js.map → chunk-NB7SYQYP.js.map} +1 -1
  102. package/dist/{chunk-3JKGY2YC.js → chunk-NUA33BYO.js} +149 -27
  103. package/dist/chunk-NUA33BYO.js.map +1 -0
  104. package/dist/{chunk-VBI7HGHB.js → chunk-QAKUD6QN.js} +2 -2
  105. package/dist/{chunk-VBI7HGHB.js.map → chunk-QAKUD6QN.js.map} +1 -1
  106. package/dist/{chunk-KX2PT5Q4.js → chunk-QEULL4Q3.js} +4 -4
  107. package/dist/{chunk-KX2PT5Q4.js.map → chunk-QEULL4Q3.js.map} +1 -1
  108. package/dist/{chunk-YGRZNFRO.js → chunk-QSYQOTWN.js} +3 -3
  109. package/dist/{chunk-YGRZNFRO.js.map → chunk-QSYQOTWN.js.map} +1 -1
  110. package/dist/{chunk-DHYSUJ3H.js → chunk-RDTLPOPD.js} +4 -4
  111. package/dist/{chunk-DHYSUJ3H.js.map → chunk-RDTLPOPD.js.map} +1 -1
  112. package/dist/{chunk-GOCWM7FN.js → chunk-RHN5MRQO.js} +21 -4
  113. package/dist/chunk-RHN5MRQO.js.map +1 -0
  114. package/dist/{chunk-UL22SDGR.js → chunk-S2XHGWQC.js} +161 -123
  115. package/dist/chunk-S2XHGWQC.js.map +1 -0
  116. package/dist/{chunk-4DWBSTYA.js → chunk-SVTMNSPI.js} +22 -5
  117. package/dist/chunk-SVTMNSPI.js.map +1 -0
  118. package/dist/{chunk-QOM5Z62G.js → chunk-UI745XC3.js} +9 -22
  119. package/dist/chunk-UI745XC3.js.map +1 -0
  120. package/dist/{chunk-L4YKW5AY.js → chunk-VMVDAZLA.js} +20 -8
  121. package/dist/chunk-VMVDAZLA.js.map +1 -0
  122. package/dist/{chunk-H6UVIKQ2.js → chunk-VYVTEMAW.js} +3 -3
  123. package/dist/{chunk-H6UVIKQ2.js.map → chunk-VYVTEMAW.js.map} +1 -1
  124. package/dist/{chunk-SRODW6M2.js → chunk-X3YGUKCG.js} +3 -3
  125. package/dist/{chunk-SRODW6M2.js.map → chunk-X3YGUKCG.js.map} +1 -1
  126. package/dist/{chunk-JDR6ILCW.js → chunk-XGULGQA3.js} +3 -3
  127. package/dist/{chunk-JDR6ILCW.js.map → chunk-XGULGQA3.js.map} +1 -1
  128. package/dist/{chunk-7XSAW5OC.js → chunk-YLLVSR2U.js} +4 -4
  129. package/dist/{chunk-7XSAW5OC.js.map → chunk-YLLVSR2U.js.map} +1 -1
  130. package/dist/{chunk-6Z5KTFJT.js → chunk-Z3VKUWAX.js} +3 -3
  131. package/dist/{chunk-6Z5KTFJT.js.map → chunk-Z3VKUWAX.js.map} +1 -1
  132. package/dist/{chunk-7TPYPVAH.js → chunk-ZAELRYKS.js} +3 -3
  133. package/dist/{chunk-7TPYPVAH.js.map → chunk-ZAELRYKS.js.map} +1 -1
  134. package/dist/{chunk-UQ33Y4DM.js → chunk-ZBHZLWV3.js} +4 -4
  135. package/dist/{chunk-UQ33Y4DM.js.map → chunk-ZBHZLWV3.js.map} +1 -1
  136. package/dist/{chunk-OTIB4D2K.js → chunk-ZDLUQLI6.js} +4 -4
  137. package/dist/{chunk-OTIB4D2K.js.map → chunk-ZDLUQLI6.js.map} +1 -1
  138. package/dist/{chunk-OHNKYHRR.js → chunk-ZHGKAZJ7.js} +214 -16
  139. package/dist/chunk-ZHGKAZJ7.js.map +1 -0
  140. package/dist/{claude-code-VJGYBXQR.js → claude-code-RE46FJXI.js} +4 -4
  141. package/dist/{claude-code-VJGYBXQR.js.map → claude-code-RE46FJXI.js.map} +1 -1
  142. package/dist/cli/index.js +704 -448
  143. package/dist/cli/index.js.map +1 -1
  144. package/dist/cli/src/agent-pins.d.ts +11 -0
  145. package/dist/cli/src/agent-pins.d.ts.map +1 -1
  146. package/dist/cli/src/commands/catalog.d.ts +1 -1
  147. package/dist/cli/src/commands/catalog.d.ts.map +1 -1
  148. package/dist/cli/src/commands/config.d.ts.map +1 -1
  149. package/dist/cli/src/commands/diff.d.ts.map +1 -1
  150. package/dist/cli/src/commands/harness.d.ts +24 -0
  151. package/dist/cli/src/commands/harness.d.ts.map +1 -0
  152. package/dist/cli/src/commands/integration.d.ts.map +1 -1
  153. package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
  154. package/dist/cli/src/commands/library-index.d.ts +20 -2
  155. package/dist/cli/src/commands/library-index.d.ts.map +1 -1
  156. package/dist/cli/src/commands/library-publish.d.ts.map +1 -1
  157. package/dist/cli/src/commands/migrate-assets.d.ts.map +1 -1
  158. package/dist/cli/src/commands/project.d.ts +19 -1
  159. package/dist/cli/src/commands/project.d.ts.map +1 -1
  160. package/dist/cli/src/commands/run.d.ts.map +1 -1
  161. package/dist/cli/src/commands/serve-preflight.d.ts.map +1 -1
  162. package/dist/cli/src/commands/session-logs/local-query.d.ts +2 -0
  163. package/dist/cli/src/commands/session-logs/local-query.d.ts.map +1 -1
  164. package/dist/cli/src/commands/source.d.ts +9 -2
  165. package/dist/cli/src/commands/source.d.ts.map +1 -1
  166. package/dist/cli/src/commands/store.d.ts.map +1 -1
  167. package/dist/cli/src/commands/update.d.ts.map +1 -1
  168. package/dist/cli/src/commands/validate.d.ts.map +1 -1
  169. package/dist/cli/src/config-checks.d.ts +37 -0
  170. package/dist/cli/src/config-checks.d.ts.map +1 -0
  171. package/dist/cli/src/skill-checks.d.ts +27 -0
  172. package/dist/cli/src/skill-checks.d.ts.map +1 -1
  173. package/dist/cli/src/store-addable.d.ts +11 -0
  174. package/dist/cli/src/store-addable.d.ts.map +1 -1
  175. package/dist/connectors/config.js +5 -5
  176. package/dist/connectors/index.js +18 -18
  177. package/dist/{connectors-CXZLXAFZ.js → connectors-7THEF7YA.js} +21 -21
  178. package/dist/{connectors-CXZLXAFZ.js.map → connectors-7THEF7YA.js.map} +1 -1
  179. package/dist/core/index.js +6 -6
  180. package/dist/core/manifest.js +2 -2
  181. package/dist/core/models.js +1 -1
  182. package/dist/core/publish-manifest.js +3 -3
  183. package/dist/core/ref.js +1 -1
  184. package/dist/core/runtime-assets.js +5 -5
  185. package/dist/core/src/agent-instances.d.ts.map +1 -1
  186. package/dist/core/src/config-key-diagnostics.d.ts +9 -0
  187. package/dist/core/src/config-key-diagnostics.d.ts.map +1 -0
  188. package/dist/core/src/index.d.ts +1 -1
  189. package/dist/core/src/index.d.ts.map +1 -1
  190. package/dist/core/src/manifest.d.ts +10 -0
  191. package/dist/core/src/manifest.d.ts.map +1 -1
  192. package/dist/core/src/models.d.ts +8 -0
  193. package/dist/core/src/models.d.ts.map +1 -1
  194. package/dist/core/src/workspace-config.d.ts +8 -0
  195. package/dist/core/src/workspace-config.d.ts.map +1 -1
  196. package/dist/core/src/workspace-yaml-editor.d.ts +9 -2
  197. package/dist/core/src/workspace-yaml-editor.d.ts.map +1 -1
  198. package/dist/core/workspace-config.js +4 -4
  199. package/dist/deploy/index.js +6 -6
  200. package/dist/discovery/index.js +4 -4
  201. package/dist/discovery/src/builtin-providers.d.ts.map +1 -1
  202. package/dist/discovery/src/parse-manifest.d.ts.map +1 -1
  203. package/dist/{ensure-sources-UPTHZKGF.js → ensure-sources-IH7CHSJF.js} +16 -16
  204. package/dist/{ensure-sources-UPTHZKGF.js.map → ensure-sources-IH7CHSJF.js.map} +1 -1
  205. package/dist/factory-assets/connectors/box.js +18 -18
  206. package/dist/factory-assets/connectors/deploy.js +18 -18
  207. package/dist/factory-assets/connectors/devserver.js +18 -18
  208. package/dist/factory-assets/connectors/flow/adapter.js +18 -18
  209. package/dist/factory-assets/connectors/flow/contract/normalize.d.ts.map +1 -1
  210. package/dist/factory-assets/connectors/flow/contract.js +1 -1
  211. package/dist/factory-assets/connectors/flow/engine.js +8 -8
  212. package/dist/factory-assets/connectors/flow/run-flow.js +20 -20
  213. package/dist/factory-assets/connectors/flow.js +18 -18
  214. package/dist/factory-assets/connectors/git.js +18 -18
  215. package/dist/factory-assets/connectors/gmail.js +18 -18
  216. package/dist/factory-assets/connectors/googledrive.js +18 -18
  217. package/dist/factory-assets/connectors/local.js +18 -18
  218. package/dist/factory-assets/connectors/mattermost.js +18 -18
  219. package/dist/factory-assets/connectors/memory.js +18 -18
  220. package/dist/factory-assets/connectors/minio.js +18 -18
  221. package/dist/factory-assets/connectors/postgres.js +18 -18
  222. package/dist/factory-assets/connectors/s3.js +18 -18
  223. package/dist/factory-assets/connectors/sharepoint.js +18 -18
  224. package/dist/factory-assets/connectors/sqlite.js +18 -18
  225. package/dist/factory-assets/connectors/static-server.js +18 -18
  226. package/dist/factory-assets/connectors/tunnel.js +18 -18
  227. package/dist/factory-assets/connectors/webdav.js +18 -18
  228. package/dist/factory-assets/connectors/xstate-store.js +18 -18
  229. package/dist/factory-assets/connectors/xstate.js +18 -18
  230. package/dist/factory-assets/skills/authoring-skaile-assets/SKILL.md +1 -1
  231. package/dist/factory-assets/skills/authoring-skaile-manifests/SKILL.md +2 -2
  232. package/dist/factory-assets/skills/authoring-skaile-manifests/references/dependency-standard.md +3 -3
  233. package/dist/{flows-TJQIMGUX.js → flows-4JZQ3XFK.js} +11 -11
  234. package/dist/{flows-TJQIMGUX.js.map → flows-4JZQ3XFK.js.map} +1 -1
  235. package/dist/{helpers-DE53KG3E.js → helpers-JNMK3FC2.js} +16 -16
  236. package/dist/{helpers-DE53KG3E.js.map → helpers-JNMK3FC2.js.map} +1 -1
  237. package/dist/library/index.js +9 -9
  238. package/dist/library/install.js +4 -4
  239. package/dist/library/src/index.d.ts +1 -1
  240. package/dist/library/src/index.d.ts.map +1 -1
  241. package/dist/library/src/local/library-dir.d.ts +22 -5
  242. package/dist/library/src/local/library-dir.d.ts.map +1 -1
  243. package/dist/library/src/local/local-catalog-source.d.ts.map +1 -1
  244. package/dist/library/src/remote/remote-catalog-source.d.ts +6 -0
  245. package/dist/library/src/remote/remote-catalog-source.d.ts.map +1 -1
  246. package/dist/{library-publish-KKQ2ULLX.js → library-publish-I3UWXAHI.js} +52 -50
  247. package/dist/library-publish-I3UWXAHI.js.map +1 -0
  248. package/dist/model-endpoint/index.js +9 -9
  249. package/dist/{open-library-RJGJIW5H.js → open-library-NKKUJLWA.js} +19 -19
  250. package/dist/{open-library-RJGJIW5H.js.map → open-library-NKKUJLWA.js.map} +1 -1
  251. package/dist/{open-registry-3QS3J7KO.js → open-registry-BYAXSHUI.js} +14 -14
  252. package/dist/{open-registry-3QS3J7KO.js.map → open-registry-BYAXSHUI.js.map} +1 -1
  253. package/dist/{paths-QAV4C3KX.js → paths-UKWE35XS.js} +9 -9
  254. package/dist/{paths-QAV4C3KX.js.map → paths-UKWE35XS.js.map} +1 -1
  255. package/dist/{plugin-store-MSH6GK6T.js → plugin-store-ABE35NRX.js} +9 -9
  256. package/dist/{plugin-store-MSH6GK6T.js.map → plugin-store-ABE35NRX.js.map} +1 -1
  257. package/dist/project-BIPK47JK.js +86 -0
  258. package/dist/{project-HZW2MZPA.js.map → project-BIPK47JK.js.map} +1 -1
  259. package/dist/resolver/index.js +7 -7
  260. package/dist/runner/index.js +33 -33
  261. package/dist/runner/src/composition/content-source.d.ts.map +1 -1
  262. package/dist/runner/src/composition/errors.d.ts +16 -1
  263. package/dist/runner/src/composition/errors.d.ts.map +1 -1
  264. package/dist/runner/src/credential-notice.d.ts +3 -3
  265. package/dist/runner/src/credential-notice.d.ts.map +1 -1
  266. package/dist/runner/src/serve.d.ts +14 -2
  267. package/dist/runner/src/serve.d.ts.map +1 -1
  268. package/dist/sdk/asset-manager.js +13 -13
  269. package/dist/sdk/bridge.js +14 -14
  270. package/dist/sdk/core.js +6 -6
  271. package/dist/sdk/flow.js +8 -8
  272. package/dist/sdk/index.js +33 -33
  273. package/dist/sdk/resolver.js +7 -7
  274. package/dist/sdk/runner.js +33 -33
  275. package/dist/sdk/transport/ws/server.js +7 -7
  276. package/dist/sdk/transport/ws.js +7 -7
  277. package/dist/sdk/transport.js +7 -7
  278. package/dist/{serve-preflight-L4POEHNQ.js → serve-preflight-FLTIBTEX.js} +28 -29
  279. package/dist/serve-preflight-FLTIBTEX.js.map +1 -0
  280. package/dist/{setup-AGYB4PKR.js → setup-AG6NFHSN.js} +25 -25
  281. package/dist/{setup-AGYB4PKR.js.map → setup-AG6NFHSN.js.map} +1 -1
  282. package/dist/{skills-2LMQ2IAD.js → skills-UQYUHVKO.js} +12 -12
  283. package/dist/{skills-2LMQ2IAD.js.map → skills-UQYUHVKO.js.map} +1 -1
  284. package/dist/source-ASEHI2XS.js +85 -0
  285. package/dist/{source-GBMYD3RO.js.map → source-ASEHI2XS.js.map} +1 -1
  286. package/dist/{source-manifest-publish-FK22TVQT.js → source-manifest-publish-IEVV3W6J.js} +45 -45
  287. package/dist/{source-manifest-publish-FK22TVQT.js.map → source-manifest-publish-IEVV3W6J.js.map} +1 -1
  288. package/dist/transport/index.js +7 -7
  289. package/dist/transport/ws/server.js +7 -7
  290. package/dist/transport/ws.js +7 -7
  291. package/dist/tui/index.js +33 -33
  292. package/dist/types/src/install-manifest.d.ts +1 -1
  293. package/dist/types/src/install-manifest.d.ts.map +1 -1
  294. package/dist/workspace-plugin/adapters/mcp.js +25 -25
  295. package/dist/workspace-plugin/adapters/omp.js +14 -14
  296. package/dist/workspace-plugin/index.js +1 -1
  297. package/package.json +1 -1
  298. package/dist/asset-feeds-PXUWCXVI.js.map +0 -1
  299. package/dist/chunk-3JKGY2YC.js.map +0 -1
  300. package/dist/chunk-4DWBSTYA.js.map +0 -1
  301. package/dist/chunk-4XWLB7JB.js.map +0 -1
  302. package/dist/chunk-F2GOZMRA.js.map +0 -1
  303. package/dist/chunk-GOCWM7FN.js.map +0 -1
  304. package/dist/chunk-L4YKW5AY.js.map +0 -1
  305. package/dist/chunk-NMI2TWMH.js.map +0 -1
  306. package/dist/chunk-OAHVKSQJ.js.map +0 -1
  307. package/dist/chunk-OHNKYHRR.js.map +0 -1
  308. package/dist/chunk-PUK7TQT4.js +0 -13
  309. package/dist/chunk-PUK7TQT4.js.map +0 -1
  310. package/dist/chunk-QOM5Z62G.js.map +0 -1
  311. package/dist/chunk-TKHJXPSB.js.map +0 -1
  312. package/dist/chunk-UL22SDGR.js.map +0 -1
  313. package/dist/chunk-VJRTDKXS.js.map +0 -1
  314. package/dist/chunk-WEH33JSG.js.map +0 -1
  315. package/dist/chunk-WYHQUCHR.js.map +0 -1
  316. package/dist/chunk-X3RMRJNR.js.map +0 -1
  317. package/dist/library-publish-KKQ2ULLX.js.map +0 -1
  318. package/dist/project-HZW2MZPA.js +0 -84
  319. package/dist/serve-preflight-L4POEHNQ.js.map +0 -1
  320. package/dist/source-GBMYD3RO.js +0 -85
@@ -1 +1 @@
1
- {"version":3,"sources":["../bridge/src/harnesses/omp-models-yml.ts"],"names":[],"mappings":";;;;;;;;;;AA6EO,IAAM,cAAA,GAAoC,CAAC,GAAG,oBAAA,EAAsB,mBAAmB,CAAA;AAO9F,IAAM,mBAAA,GAAyC;AAAA,EAC7C,QAAA;AAAA,EACA,WAAA;AAAA,EACA,WAAA;AAAA,EACA,oBAAA;AAAA,EACA,OAAA;AAAA,EACA;AACF,CAAA;AAyBO,IAAM,mBAAA,GAAsB,YAAA;AAG5B,IAAM,mBAAA,GAAsB,YAAA;AAOnC,IAAM,qBAAA,GAA8C;AAAA,EAClD,YAAA,EAAc,IAAA;AAAA,EACd,aAAA,EAAe,IAAA;AAAA,EACf,aAAA,EAAe,IAAA;AAAA,EACf,YAAA,EAAc,IAAA;AAAA,EACd,aAAA,EAAe,IAAA;AAAA,EACf,iBAAA,EAAmB,IAAA;AAAA,EACnB,kBAAA,EAAoB,IAAA;AAAA,EACpB,eAAA,EAAiB;AACnB,CAAA;AAOA,IAAM,mBAAA,GAA4C;AAAA,EAChD,UAAA,EAAY,IAAA;AAAA,EACZ,cAAA,EAAgB,IAAA;AAAA,EAChB,cAAA,EAAgB,IAAA;AAAA,EAChB,WAAA,EAAa,IAAA;AAAA,EACb,eAAA,EAAiB,IAAA;AAAA,EACjB,eAAA,EAAiB,IAAA;AAAA,EACjB,uBAAA,EAAyB,IAAA;AAAA,EACzB,2BAAA,EAA6B,IAAA;AAAA,EAC7B,2BAAA,EAA6B,IAAA;AAAA,EAC7B,sBAAA,EAAwB,IAAA;AAAA,EACxB,QAAA,EAAU,IAAA;AAAA,EACV,QAAA,EAAU;AACZ,CAAA;AAQA,IAAM,eAAA,GAAkB,CAAC,UAAA,EAAY,cAAA,EAAgB,cAA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AAK,UAAU,EAAE,SAAA,EAAW,MAAM,CAAA;AACjD,IAAA,MAAM,MAAA,GAAS,IAAA,CAAK,QAAA,GAAW,MAAM,cAAA,CAAe,KAAK,QAAA,EAAU,IAAA,CAAK,QAAQ,CAAA,GAAI,EAAC;AACrF,IAAA,IAAI,KAAK,QAAA,EAAU;AACjB,MAAA,KAAA,MAAW,IAAA,IAAQ,MAAA,CAAO,IAAA,CAAK,qBAAqB,CAAA,EAAG;AACrD,QAAA,MAAM,IAAA,GAAO,IAAA,CAAK,IAAA,CAAK,IAAA,CAAK,UAAU,IAAI,CAAA;AAC1C,QAAA,IAAI;AACF,UAAA,IAAI,EAAE,MAAM,EAAA,CAAG,KAAK,IAAI,CAAA,EAAG,QAAO,EAAG;AAAA,QACvC,CAAA,CAAA,MAAQ;AACN,UAAA;AAAA,QACF;AACA,QAAA,MAAM,EAAA,GAAK,IAAA,CAAK,IAAA,CAAK,IAAA,CAAK,UAAU,IAAI,CAAA;AACxC,QAAA,MAAM,YAAY,EAAE,CAAA;AACpB,QAAA,MAAM,EAAA,CAAG,QAAA,CAAS,IAAA,EAAM,EAAE,CAAA;AAAA,MAC5B;AAAA,IACF;AACA,IAAA,MAAM,QAAA,GAAW,MAAM,QAAA,CAAS,IAAA,CAAK,UAAU,WAAA,EAAa;AAAA,MAC1D,GAAG,qBAAA;AAAA,MACH,GAAG;AAAA,KACJ,CAAA;AACD,IAAA,OAAO,EAAE,UAAU,IAAA,CAAK,QAAA,EAAU,WAAW,IAAA,CAAK,SAAA,EAAW,QAAQ,QAAA,EAAS;AAAA,EAChF,CAAC,CAAA;AACH","file":"chunk-WDAIWDLK.js","sourcesContent":["/**\n * The omp adapter: an AI provider registry serialized into omp's own\n * configuration files, inside a session-private agent directory.\n *\n * omp already implements the target schema — `~/.omp/agent/models.yml` is a\n * `providers:` map with `baseUrl`, `api`, `apiKey`, `headers`, `authHeader`,\n * `auth`, `discovery` and `models[]` (`omp://models.md`) — so this module is a\n * *serializer*, not a translator. Our `surface` enum is omp's `api` enum\n * verbatim (§1.2); {@link OMP_API_VALUES} encodes that assertion so a future\n * surface that omp does not know is reported instead of silently written into\n * a file omp will then reject wholesale.\n *\n * Two files are produced:\n *\n * - `models.yml` — one entry per enabled `llm`/`embed` registry entry. `apiKey`\n * holds the **name** of the per-entry environment variable\n * (`SKAILE_AIP_<ID>_KEY`, {@link providerCredentialEnvName}), never a value:\n * omp resolves a `models.yml` `apiKey` as an env-var name first and only\n * falls back to treating it as a literal token. The values travel in the\n * child environment.\n * - `config.yml` — omp's settings file, carrying `modelRoles` rendered from the\n * `skaile.yaml` `roles` table. `models.yml`'s root accepts only `providers:`;\n * unknown root keys fail its schema, so roles cannot live there.\n *\n * `PI_CODING_AGENT_DIR` relocates omp's whole agent base — `config.yml`,\n * `models.yml` **and** the auth store `agent.db` (`omp://settings.md`). Pointing\n * it at a session-private directory is what makes N providers per session\n * possible without ever writing the user's `~/.omp/agent`. The cost is that a\n * standalone developer session would also lose the OAuth logins stored in that\n * auth store, so {@link materializeOmpAgentDir} seeds the session directory\n * with symlinks to everything in the user's agent directory *except* the two\n * files this module owns. Verified against omp 18.2.6: a ChatGPT/Codex OAuth\n * account stored in `~/.omp/agent/agent.db` still resolves (`omp token\n * openai-codex`) from a relocated directory that only symlinks `agent.db*`.\n * Under the platform the user directory does not exist, the seed is a no-op,\n * and the session starts empty — which is the correct behaviour there.\n *\n * @see PROVIDER-CONFIG-PLAN.md §2.3 (omp row), §5, §9\n * @see omp://models.md, omp://settings.md\n */\n\nimport { createHash } from \"node:crypto\";\nimport type { Stats } from \"node:fs\";\nimport fs from \"node:fs/promises\";\nimport os from \"node:os\";\nimport net from \"node:net\";\nimport path from \"node:path\";\nimport {\n type AIProviderLlmEntry,\n type AIProviderRegistry,\n AI_PROVIDER_SURFACES,\n isEntryEnabled,\n type MergedAIProviderRegistry,\n normalizeEntryBaseUrl,\n parseModelRef,\n registryEntries,\n resolveEntryBaseUrl,\n} from \"@skaile/workspaces/core/provider-registry\";\nimport { parse, stringify } from \"yaml\";\nimport type { ModelEntry } from \"../models.js\";\nimport {\n entryCredentialValue,\n providerCredentialEnvName,\n type RegistryCredentialEnvOptions,\n unresolvedProviderCredentials,\n} from \"../provider-materialize/credential-env.js\";\nimport { entrySurface } from \"../provider-materialize/env-harnesses.js\";\nimport type { AgentConfig, OmpHarnessOptions } from \"../types.js\";\n\n/**\n * omp's allowed provider/model `api` values (`omp://models.md`, \"Allowed\n * provider/model `api` values\").\n *\n * Every {@link AI_PROVIDER_SURFACES} member is in this list — that equality is\n * the premise the whole adapter rests on (§1.2). `google-gemini-cli` is omp's\n * one extra value, which the registry has no surface for.\n */\nexport const OMP_API_VALUES: readonly string[] = [...AI_PROVIDER_SURFACES, \"google-gemini-cli\"];\n\n/**\n * `discovery.type` values omp accepts. The registry's own enum is wider on one\n * side (`anthropic-models-list`, `google-models-list`, `none`) and narrower on\n * the other, so a discovery block is emitted only when omp can act on it.\n */\nconst OMP_DISCOVERY_TYPES: readonly string[] = [\n \"ollama\",\n \"llama.cpp\",\n \"lm-studio\",\n \"openai-models-list\",\n \"proxy\",\n \"litellm\",\n];\n\n/** One `providers.<id>` block of `models.yml`. */\ninterface OmpProviderBlock {\n baseUrl?: string;\n api?: string;\n /** The *name* of the env var holding the credential — never a value. */\n apiKey?: string;\n auth?: \"apiKey\" | \"none\" | \"oauth\";\n authHeader?: boolean;\n headers?: Record<string, string>;\n discovery?: { type: string };\n models?: OmpModelBlock[];\n}\n\n/** One entry of a provider's `models[]`. */\ninterface OmpModelBlock {\n id: string;\n name?: string;\n input?: string[];\n contextWindow?: number;\n supportsTools?: boolean;\n}\n\n/** The two files this module owns inside the agent directory. */\nexport const OMP_MODELS_FILENAME = \"models.yml\";\n\n/** omp's settings file; `modelRoles` lives here, not in `models.yml`. */\nexport const OMP_CONFIG_FILENAME = \"config.yml\";\n\n/**\n * Names {@link materializeOmpAgentDir} never links in from the user's agent\n * directory: the two files it writes itself, their alternate spellings, and\n * the legacy `settings.json` omp would migrate into `config.yml`.\n */\nconst OWNED_AGENT_DIR_FILES: Record<string, true> = {\n \"models.yml\": true,\n \"models.yaml\": true,\n \"models.json\": true,\n \"config.yml\": true,\n \"config.yaml\": true,\n \"config.yml.lock\": true,\n \"config.yaml.lock\": true,\n \"settings.json\": true,\n};\n\n/**\n * omp's own runtime state inside its home. An agent directory that an older release used as\n * omp's home still holds these; they are never agent files, so the identity link skips them\n * and the user's own login (`agent.db`) linked in from their agent directory stays in place.\n */\nconst OMP_RUNTIME_ENTRIES: Record<string, true> = {\n \"agent.db\": true,\n \"agent.db-shm\": true,\n \"agent.db-wal\": true,\n \"models.db\": true,\n \"models.db-shm\": true,\n \"models.db-wal\": true,\n \"skill-descriptions.db\": true,\n \"skill-descriptions.db-shm\": true,\n \"skill-descriptions.db-wal\": true,\n \"custom-session-files\": true,\n intercom: true,\n sessions: true,\n};\n\n/**\n * The only entries of the user's own omp agent directory a session's private home links in:\n * omp's credential store, so the login the developer already has keeps working. Sessions,\n * history, `mcp.json`, extensions and blobs stay out: a run must not write into the user's\n * session store or load their MCP servers and extensions. `config.yml` is copied, not linked.\n */\nconst OMP_LOGIN_FILES = [\"agent.db\", \"agent.db-shm\", \"agent.db-wal\"] as const;\n\n/** Options for {@link renderOmpRegistry}. */\nexport interface RenderOmpRegistryOptions extends RegistryCredentialEnvOptions {\n /** `skaile.yaml` `roles`: role name → model selector. Rendered as `modelRoles`. */\n roles?: Record<string, string>;\n /**\n * The session's own selector. When `roles` names no `default`, the resolved\n * model becomes `modelRoles.default` so `@default` (and omp's `*` alias)\n * resolve to the entry the session actually runs on.\n */\n modelRef?: string;\n /**\n * Settings to render underneath `modelRoles` — the user's own `config.yml`\n * when a standalone session seeds one. `modelRoles` is replaced wholesale,\n * not deep-merged: a seeded role pointing at a provider this session does\n * not define would otherwise survive as a dangling selector.\n */\n baseSettings?: Record<string, unknown>;\n}\n\n/** What {@link renderOmpRegistry} produced. */\nexport interface OmpRegistryRender {\n /** `models.yml` contents. */\n modelsYml: string;\n /** `config.yml` contents. */\n configYml: string;\n /**\n * `SKAILE_AIP_<ID>_KEY` → secret, for the child environment. The only place\n * a credential value appears; both rendered files hold names alone.\n */\n credentialEnv: Record<string, string>;\n /** Entry ids written to `models.yml`, in registry order. */\n providerIds: string[];\n /** `modelRoles` as written, role name → `<providerId>/<providerModelId>`. */\n modelRoles: Record<string, string>;\n /** Entries and roles that could not be rendered, and why. */\n warnings: string[];\n}\n\n/** The provider-side model ids an entry declares, keyed by logical id. */\nfunction entryModelIds(entry: AIProviderLlmEntry): Array<[string, string]> {\n const logical = new Set<string>([\n ...Object.keys(entry.model_map ?? {}),\n ...Object.keys(entry.capabilities ?? {}),\n ]);\n const seen = new Set<string>();\n const out: Array<[string, string]> = [];\n for (const id of logical) {\n const providerSide = entry.model_map?.[id] ?? id;\n if (seen.has(providerSide)) continue;\n seen.add(providerSide);\n out.push([id, providerSide]);\n }\n return out;\n}\n\n/**\n * Serialize one entry into an omp provider block, or report why it cannot be.\n *\n * omp requires `baseUrl` on any provider that declares `models[]`, and\n * provider-level `api` whenever `discovery` is set (except `discovery.type:\n * proxy`, where the wire is auto-detected per model). A file that violates its\n * schema is rejected *wholesale* — the registry keeps operating on built-in\n * models and the error only surfaces through `ModelRegistry.getError()` — so an\n * entry that cannot satisfy those rules is dropped here, loudly, rather than\n * taking every other provider down with it.\n */\nfunction renderProvider(\n id: string,\n entry: AIProviderLlmEntry,\n warnings: string[],\n): OmpProviderBlock | undefined {\n // The Anthropic SDK inside omp appends `/v1/messages`: a stored `…/v1` must\n // not reach the file as written. Not `entryBaseUrl`: omp gets no preset\n // literal, so an entry without an endpoint of its own is reported below.\n const baseUrl = normalizeEntryBaseUrl(resolveEntryBaseUrl(entry), entrySurface(entry));\n if (!baseUrl) {\n warnings.push(\n `provider '${id}' has no resolvable base_url (missing transport params?) — omitted from models.yml`,\n );\n return undefined;\n }\n\n // Only the entry's own surface becomes `api`; an inherited one stays omp's\n // to infer, as before. The preset's surface above only picks the URL rule.\n const surface = entry.surface;\n if (surface && !OMP_API_VALUES.includes(surface)) {\n warnings.push(\n `provider '${id}' has surface '${surface}', which omp's api enum does not accept`,\n );\n return undefined;\n }\n\n const block: OmpProviderBlock = { baseUrl };\n if (surface) block.api = surface;\n\n const kind = entry.credential?.kind ?? \"none\";\n if (kind === \"none\") {\n block.auth = \"none\";\n } else if (kind === \"sigv4\" || kind === \"google_adc\" || kind === \"azure_entra\") {\n // Ambient signing chains: the AWS/Google/Azure SDK inside omp signs the\n // request from its own environment. There is no token to hand over, and\n // omp must not treat the provider as unavailable for the lack of one.\n block.auth = \"none\";\n } else {\n block.apiKey = providerCredentialEnvName(id);\n // `bearer` is the only kind that needs the header injected; the Anthropic\n // and Azure surfaces place an `api_key_header` credential themselves.\n if (kind === \"bearer\" || kind === \"oauth\") block.authHeader = true;\n }\n\n const headers = { ...entry.headers };\n if (entry.query_params && Object.keys(entry.query_params).length > 0) {\n if (surface === \"bedrock-converse-stream\") {\n // omp keeps a query string on a Bedrock `baseUrl` and appends it to the\n // final URL (and to SigV4's canonical request) — the documented carrier\n // for gateways that authenticate by query parameter.\n const search = new URLSearchParams(entry.query_params).toString();\n block.baseUrl = `${baseUrl}${baseUrl.includes(\"?\") ? \"&\" : \"?\"}${search}`;\n } else {\n warnings.push(\n `provider '${id}' declares query_params, which omp's models.yml has no slot for on surface ` +\n `'${surface ?? \"unset\"}' — they were dropped`,\n );\n }\n }\n if (Object.keys(headers).length > 0) block.headers = headers;\n\n const discoveryType = entry.discovery?.type;\n if (discoveryType) {\n if (!OMP_DISCOVERY_TYPES.includes(discoveryType)) {\n warnings.push(\n `provider '${id}' declares discovery '${discoveryType}', which omp does not implement — ` +\n `models come from model_map only`,\n );\n } else if (!surface && discoveryType !== \"proxy\") {\n warnings.push(\n `provider '${id}' declares discovery '${discoveryType}' but no surface — omp requires ` +\n `provider-level api for every discovery type but 'proxy'`,\n );\n } else {\n block.discovery = { type: discoveryType };\n }\n }\n\n const models: OmpModelBlock[] = [];\n for (const [logical, providerSide] of entryModelIds(entry)) {\n const model: OmpModelBlock = { id: providerSide };\n if (logical !== providerSide) model.name = logical;\n const caps = entry.capabilities?.[logical];\n if (caps?.context_window !== undefined) model.contextWindow = caps.context_window;\n if (caps?.images !== undefined) model.input = caps.images ? [\"text\", \"image\"] : [\"text\"];\n if (caps?.tools !== undefined) model.supportsTools = caps.tools;\n models.push(model);\n }\n if (models.length > 0) {\n if (!surface) {\n warnings.push(\n `provider '${id}' declares models but no surface — omp requires api at provider or model level`,\n );\n return undefined;\n }\n block.models = models;\n } else if (!block.discovery) {\n warnings.push(\n `provider '${id}' declares neither model_map/capabilities nor a discovery omp implements — ` +\n `it will only override an omp built-in provider of the same id`,\n );\n }\n\n return block;\n}\n\n/**\n * Resolve the `roles` table into omp `modelRoles` selectors.\n *\n * Roles do not chain, so each value is resolved as a plain selector rather than\n * through `@role` expansion. A trailing omp thinking suffix (`:high`) survives\n * untouched: it is not part of any `model_map` key, so it falls through\n * `parseModelRef`'s literal path and is re-emitted on the provider-side id.\n */\nfunction renderModelRoles(\n registry: AIProviderRegistry | MergedAIProviderRegistry,\n roles: Record<string, string> | undefined,\n modelRef: string | undefined,\n warnings: string[],\n): Record<string, string> {\n const out: Record<string, string> = {};\n for (const [role, selector] of Object.entries(roles ?? {})) {\n const trimmed = selector.trim();\n if (!trimmed) continue;\n const ref = parseModelRef(trimmed, registry);\n if (!ref?.providerModelId) {\n warnings.push(\n `role '${role}' ('${selector}') resolves to no model in this registry — dropped`,\n );\n continue;\n }\n out[role] = `${ref.providerId}/${ref.providerModelId}`;\n }\n if (out.default === undefined && modelRef) {\n const ref = parseModelRef(modelRef, registry, roles);\n if (ref?.providerModelId) out.default = `${ref.providerId}/${ref.providerModelId}`;\n }\n return out;\n}\n\n/**\n * The warning for an entry left out of `models.yml` because its credential does not resolve.\n * `skaile run` and `skaile repl` print the same fact as one `! provider ... is not used` line\n * (runner `credential-notice.ts`), so the harness keeps this warning off the console.\n */\nfunction credentialOmissionWarning(id: string, reason: string): string {\n return `provider '${id}' omitted from models.yml: ${reason}`;\n}\n\n/** True for a warning built by {@link credentialOmissionWarning}. */\nexport function isCredentialOmissionWarning(warning: string): boolean {\n return /^provider '[^']+' omitted from models\\.yml: /.test(warning);\n}\n\n/**\n * Serialize a registry into the two omp files plus the credential environment\n * that carries their secrets.\n *\n * Only enabled `llm`/`embed` entries are rendered: `stt`/`tts` entries have no\n * wire surface and omp has no slot for them. The credential environment is\n * scoped to the same set — the omp child has no use for a Deepgram key, and a\n * secret that reaches a process which cannot spend it is pure exposure.\n *\n * An entry whose credential does not resolve here still gets its\n * `SKAILE_AIP_<ID>_KEY` name written into `models.yml`: a `platform:` ref is\n * resolved by the session boundary, which materializes the value into\n * `AgentConfig.env` under that same programme-standard name.\n */\nexport function renderOmpRegistry(\n registry: AIProviderRegistry | MergedAIProviderRegistry,\n options: RenderOmpRegistryOptions = {},\n): OmpRegistryRender {\n const warnings: string[] = [];\n const providers: Record<string, OmpProviderBlock> = {};\n const providerIds: string[] = [];\n const credentialEnv: Record<string, string> = {};\n\n // An entry whose credential cannot be resolved here is not handed to omp: it\n // would send an empty key (`invalid x-api-key`) and shadow omp's own login for\n // the same provider.\n const unresolved = new Map(\n unresolvedProviderCredentials(registry, options).map((u) => [u.providerId, u.reason]),\n );\n for (const [id, entry] of registryEntries(registry)) {\n if (entry.kind !== \"llm\" && entry.kind !== \"embed\") continue;\n if (!isEntryEnabled(entry)) continue;\n const reason = unresolved.get(id);\n if (reason) {\n warnings.push(credentialOmissionWarning(id, reason));\n continue;\n }\n const block = renderProvider(id, entry as AIProviderLlmEntry, warnings);\n if (!block) continue;\n providers[id] = block;\n providerIds.push(id);\n // Only the canonical name, never a vendor-conventional alias: every\n // endpoint omp may address is named in models.yml with its own variable,\n // and a stray `ANTHROPIC_API_KEY` would silently make omp's *built-in*\n // Anthropic provider look authenticated with some gateway entry's key.\n const secret = entryCredentialValue(id, entry, options);\n if (secret) credentialEnv[providerCredentialEnvName(id)] = secret;\n }\n\n const modelRoles = renderModelRoles(registry, options.roles, options.modelRef, warnings);\n\n const settings: Record<string, unknown> = { ...options.baseSettings };\n if (Object.keys(modelRoles).length > 0) settings.modelRoles = modelRoles;\n\n return {\n modelsYml: stringify({ providers }),\n configYml: stringify(settings),\n credentialEnv,\n providerIds,\n modelRoles,\n warnings,\n };\n}\n\n/**\n * The models a registry makes selectable, as the harness-neutral catalog entry.\n *\n * ids are `<providerId>/<providerModelId>` — the exact selector omp's `--model`\n * and `modelRoles` take, and unambiguous when two entries serve the same model\n * id, which is the normal case once a session carries N providers.\n */\nexport function registryModelEntries(\n registry: AIProviderRegistry | MergedAIProviderRegistry | undefined,\n): ModelEntry[] {\n if (!registry) return [];\n const out: ModelEntry[] = [];\n for (const [id, entry] of registryEntries(registry)) {\n if (entry.kind !== \"llm\" && entry.kind !== \"embed\") continue;\n if (!isEntryEnabled(entry)) continue;\n const label = entry.label ?? id;\n for (const [logical, providerSide] of entryModelIds(entry as AIProviderLlmEntry)) {\n out.push({ id: `${id}/${providerSide}`, name: `${label} ${logical}` });\n }\n }\n return out;\n}\n\n/**\n * Why omp cannot serve `<providerId>/<model>` from this registry, or `undefined` when it can (or\n * when this check cannot tell). omp knows only the models a registry entry declares\n * (`model_map`, `capabilities`) or its `discovery` lists: for a provider id omp has no login for\n * and an entry that declares neither, `omp --model fake/fake-1` exits with `Model \"fake/fake-1\"\n * not found` on the first prompt (p1334). `nativeProviders` are the ids omp ships a login for;\n * their entry only overrides the built-in provider, so the model may still be omp's own.\n */\nexport function ompRegistryModelRefusal(\n registry: AIProviderRegistry | MergedAIProviderRegistry | undefined,\n selector: string,\n nativeProviders: ReadonlySet<string>,\n): string | undefined {\n if (!registry) return undefined;\n const slash = selector.indexOf(\"/\");\n if (slash <= 0) return undefined;\n const head = selector.slice(0, slash);\n // A trailing omp thinking suffix (`:high`) is not part of the model id.\n const model = selector.slice(slash + 1).replace(/:(off|minimal|low|medium|high|xhigh)$/i, \"\");\n if (!model || nativeProviders.has(head)) return undefined;\n const found = registryEntries(registry).find(([id]) => id === head);\n if (!found) return undefined;\n const [, entry] = found;\n if ((entry.kind !== \"llm\" && entry.kind !== \"embed\") || !isEntryEnabled(entry)) return undefined;\n const llm = entry as AIProviderLlmEntry;\n if (llm.discovery?.type && OMP_DISCOVERY_TYPES.includes(llm.discovery.type)) return undefined;\n const known = entryModelIds(llm).flatMap(([logical, providerSide]) => [logical, providerSide]);\n if (known.includes(model)) return undefined;\n return known.length === 0\n ? `omp cannot serve model '${selector}': registry entry '${head}' declares no models (add model_map or capabilities to it in providers.yml), and omp has no login for '${head}'. Pick a model omp lists.`\n : `omp cannot serve model '${selector}': registry entry '${head}' declares ${known.join(\", \")}, not '${model}'. Pick one of those, or add '${model}' to the entry's model_map.`;\n}\n\n/** Options for {@link materializeOmpAgentDir}. */\nexport interface MaterializeOmpAgentDirOptions extends RenderOmpRegistryOptions {\n /**\n * The user's own omp agent directory to seed from — its auth store\n * (`agent.db`) is linked in so a standalone session keeps the login the\n * developer already has, and its `config.yml` is read as base settings.\n * Sessions, history, `mcp.json` and extensions are not linked. Absent (the\n * platform case) seeds nothing. A missing directory is not an error: it is the platform case.\n */\n seedFrom?: string;\n /**\n * GitAgent identity directory (`AgentConfig.agentDir`) whose contents omp\n * reads out of the same base: `agent.yaml`, `SOUL.md`, `RULES.md`,\n * `knowledge/`. Linked in after the seed, so identity wins a name clash.\n */\n identityDir?: string;\n}\n\n/** What {@link materializeOmpAgentDir} wrote. */\nexport interface OmpAgentDirMaterialization extends OmpRegistryRender {\n /** The directory `PI_CODING_AGENT_DIR` must point at. */\n agentDir: string;\n /** The directory is the harness's temporary home: remove it when the run ends. */\n ephemeral?: boolean;\n /** Names linked in from {@link MaterializeOmpAgentDirOptions.seedFrom}. */\n seeded: string[];\n /** Names linked in from {@link MaterializeOmpAgentDirOptions.identityDir}. */\n identity: string[];\n}\n\n/** Inputs {@link planOmpAgentDir} derives the session directory layout from. */\nexport interface OmpAgentDirPlanInput {\n /** Session working directory. Distinguishes two default-named sessions. */\n cwd: string;\n /** Session id — the directory key, so concurrent sessions never collide. */\n sessionId?: string;\n /** `AgentConfig.harnessOptions.omp`. */\n options?: OmpHarnessOptions;\n /** Home the default seed source resolves against. Defaults to `os.homedir()`. */\n homeDir?: string;\n /** Root the private directory is created under. Defaults to `os.tmpdir()`. */\n tmpDir?: string;\n}\n\n/** Where a session's omp agent directory lives, and what it inherits. */\nexport interface OmpAgentDirPlan {\n /** Session-private directory `PI_CODING_AGENT_DIR` points at. */\n agentDir: string;\n /** User agent directory whose login is linked in, when there is one to inherit. */\n seedFrom?: string;\n /**\n * The directory is the harness's own temporary home, to be removed when the run ends. False\n * when the session named its own `harnessOptions.omp.agentHome`, which belongs to the user.\n */\n ephemeral: boolean;\n}\n\n/**\n * Decide the session-private agent directory and whether it inherits the\n * developer's omp state.\n *\n * The directory is deliberately **outside `cwd`**. It holds omp's credential\n * store — a symlink to the developer's `agent.db` on a standalone machine —\n * and `cwd` is the one tree the agent has write access to by design; managed\n * codex draws the same line and rejects a private directory nested in the\n * workspace (`codex/instance-state.ts`). Sessions are keyed by id, falling\n * back to a digest of the workspace path. The temporary directory is `<key>-<random>`, created per\n * call, so no two runs share one (and one run's cleanup never removes another's).\n *\n * Seeding keys on the user directory *existing*, which is exactly the\n * platform/standalone distinction the plan draws: a platform container has no\n * `~/.omp/agent`, so the session correctly starts empty; a developer machine\n * has one, so the session keeps the logins already stored there.\n * `harnessOptions.omp.seedUserAgentDir: false` forces the empty case anyway.\n */\nexport async function planOmpAgentDir(input: OmpAgentDirPlanInput): Promise<OmpAgentDirPlan> {\n const options = input.options;\n const key =\n input.sessionId?.trim() ||\n createHash(\"sha256\").update(path.resolve(input.cwd)).digest(\"hex\").slice(0, 16);\n const ephemeral = options?.agentHome === undefined;\n // The temporary home is unique per spawn: callers key sessions loosely (`skaile chat` passes\n // none, `serve` without --session-id uses one shared id, sub-prompt harnesses share a hash), and\n // the harness deletes its home when its run ends, which must never reach a sibling's home.\n let agentDir = options?.agentHome ?? \"\";\n if (ephemeral) {\n const root = path.join(input.tmpDir ?? os.tmpdir(), \"skaile-omp-agent\");\n await fs.mkdir(root, { recursive: true });\n await sweepStaleOmpHomes(root);\n agentDir = await fs.mkdtemp(path.join(root, `${key.replace(/[^A-Za-z0-9._-]/g, \"_\")}-`));\n await fs.writeFile(path.join(agentDir, OWNER_FILE), String(process.pid));\n }\n if (options?.seedUserAgentDir === false) return { agentDir, ephemeral };\n\n const seedFrom =\n options?.userAgentDir ?? path.join(input.homeDir ?? os.homedir(), \".omp\", \"agent\");\n if (path.resolve(seedFrom) === path.resolve(agentDir)) return { agentDir, ephemeral };\n try {\n if (!(await fs.stat(seedFrom)).isDirectory()) return { agentDir, ephemeral };\n } catch {\n return { agentDir, ephemeral };\n }\n return { agentDir, seedFrom, ephemeral };\n}\n\n/** Names the process that created a temporary home; the sweep keeps a home whose owner lives. */\nconst OWNER_FILE = \".skaile-owner-pid\";\n/** A temporary home older than this whose owner is gone is removed at the next start. */\nconst STALE_HOME_MS = 24 * 60 * 60 * 1000;\n\n/**\n * The names skaile gave a temporary home: `<key>-<six random characters>` (`mkdtemp`), and\n * `<key>-<12 hex>` from releases before 5.16 (p1151).\n */\nconst SKAILE_HOME_NAME = /^[A-Za-z0-9._-]+-(?:[A-Za-z0-9]{6}|[0-9a-f]{12})$/;\n\nfunction processAlive(pid: number): boolean {\n try {\n process.kill(pid, 0);\n return true;\n } catch (err) {\n return (err as NodeJS.ErrnoException).code === \"EPERM\";\n }\n}\n\n/**\n * Whether nothing listens on the unix socket `file`: a connect is refused (the process that\n * bound it is gone) or finds no socket. A socket somebody still serves, or one that does not\n * answer within a second, counts as in use.\n */\nfunction socketIsDead(file: string): Promise<boolean> {\n return new Promise<boolean>((resolve) => {\n const conn = net.connect(file);\n const done = (dead: boolean) => {\n conn.destroy();\n resolve(dead);\n };\n conn.setTimeout(1000, () => done(false));\n conn.once(\"connect\", () => done(false));\n conn.once(\"error\", (err: NodeJS.ErrnoException) =>\n done(err.code === \"ECONNREFUSED\" || err.code === \"ENOENT\"),\n );\n });\n}\n\n/**\n * Remove temporary homes older than a day whose creating process is gone: a run that was killed\n * never reached the harness's own cleanup, and every one leaves symlinks and databases behind\n * (p811). A home of a live process is kept whatever its age. A unix socket of that age that\n * nobody listens on is removed too (omp binds one beside the homes and a killed run leaves it,\n * p1316). Best effort: a failure is ignored.\n */\nasync function sweepStaleOmpHomes(root: string, now = Date.now()): Promise<void> {\n let names: string[];\n try {\n names = await fs.readdir(root);\n } catch {\n return;\n }\n await Promise.all(\n names.map(async (name) => {\n const home = path.join(root, name);\n try {\n const stat = await fs.lstat(home);\n if (now - stat.mtimeMs < STALE_HOME_MS) return;\n if (stat.isSocket()) {\n if (await socketIsDead(home)) await fs.rm(home, { force: true });\n return;\n }\n if (!stat.isDirectory()) return;\n const owner = Number.parseInt(\n await fs.readFile(path.join(home, OWNER_FILE), \"utf8\").catch(() => \"\"),\n 10,\n );\n if (Number.isInteger(owner) && processAlive(owner)) return;\n // A home with no owner file is one an older version made: remove it only when its\n // name has the `<key>-<six random characters>` shape `mkdtemp` gives (never a folder\n // somebody else put in this directory).\n if (!Number.isInteger(owner) && !SKAILE_HOME_NAME.test(name)) return;\n await fs.rm(home, { recursive: true, force: true });\n } catch {\n /* another process may be sweeping the same home */\n }\n }),\n );\n}\n\n/**\n * Run the steps that fill a planned home; when one throws, remove a temporary home before\n * rethrowing. The harness only learns the home (and deletes it at cleanup) once these steps\n * return, so a failure here would otherwise leave a new directory per spawn behind.\n */\nasync function removeHomeOnThrow<T>(plan: OmpAgentDirPlan, fill: () => Promise<T>): Promise<T> {\n try {\n return await fill();\n } catch (err) {\n if (plan.ephemeral) await fs.rm(plan.agentDir, { recursive: true, force: true });\n throw err;\n }\n}\n\n/** Remove a path whatever it is, without following a symlink into its target. */\nasync function removeEntry(target: string): Promise<void> {\n let stat: Stats;\n try {\n stat = await fs.lstat(target);\n } catch {\n return;\n }\n if (stat.isSymbolicLink() || stat.isFile()) {\n await fs.unlink(target);\n return;\n }\n await fs.rm(target, { recursive: true, force: true });\n}\n\n/** Symlink every entry of `sourceDir` into `dir`, skipping the owned names. */\nasync function linkInto(\n dir: string,\n sourceDir: string,\n skip: Record<string, true>,\n): Promise<string[]> {\n let names: string[];\n try {\n names = await fs.readdir(sourceDir);\n } catch {\n return [];\n }\n const linked: string[] = [];\n for (const name of names) {\n if (skip[name]) continue;\n const target = path.join(dir, name);\n await removeEntry(target);\n await fs.symlink(path.join(sourceDir, name), target);\n linked.push(name);\n }\n return linked;\n}\n\n/**\n * Remove the symlinks into the user's agent directory that an older release (or a home the\n * session named itself) left in `dir`: only the login files may point there (p811).\n */\nasync function dropStaleSeedLinks(dir: string, sourceDir: string): Promise<void> {\n let names: string[];\n try {\n names = await fs.readdir(dir);\n } catch {\n return;\n }\n const root = path.resolve(sourceDir);\n for (const name of names) {\n if ((OMP_LOGIN_FILES as readonly string[]).includes(name)) continue;\n const entry = path.join(dir, name);\n try {\n if (!(await fs.lstat(entry)).isSymbolicLink()) continue;\n const to = path.resolve(dir, await fs.readlink(entry));\n if (to === root || to.startsWith(root + path.sep)) await fs.unlink(entry);\n } catch {\n // Gone or unreadable: nothing to drop.\n }\n }\n}\n\n/** Symlink the login files (see {@link OMP_LOGIN_FILES}) of the user's agent directory into `dir`. */\nasync function linkLoginFiles(dir: string, sourceDir: string): Promise<string[]> {\n await dropStaleSeedLinks(dir, sourceDir);\n const linked: string[] = [];\n for (const name of OMP_LOGIN_FILES) {\n const from = path.join(sourceDir, name);\n try {\n if (!(await fs.stat(from)).isFile()) continue;\n } catch {\n continue;\n }\n const target = path.join(dir, name);\n await removeEntry(target);\n await fs.symlink(from, target);\n linked.push(name);\n }\n return linked;\n}\n\n/** Read a seeded `config.yml` as the base settings, or `{}` when unusable. */\nasync function readSeededSettings(seedFrom: string): Promise<Record<string, unknown>> {\n for (const name of [\"config.yml\", \"config.yaml\"]) {\n let raw: string;\n try {\n raw = await fs.readFile(path.join(seedFrom, name), \"utf-8\");\n } catch {\n continue;\n }\n const parsed = parse(raw) as unknown;\n if (parsed && typeof parsed === \"object\" && !Array.isArray(parsed)) {\n return parsed as Record<string, unknown>;\n }\n }\n return {};\n}\n\n/**\n * The model selector of the user's own omp default (`modelRoles.default` in their `config.yml`)\n * when it can only be served by their own `models.yml`, else `undefined` (p1172).\n *\n * The session-private home never copies the user's `models.yml`: it holds their credentials.\n * A default such as `anthropic/claude-opus-5-5` that their `models.yml` defines (a gateway, a\n * local server) then names a provider the private home does not have, and omp quietly picks\n * another model. A default on a built-in omp provider keeps working there (its login is linked\n * in), and a provider the registry renders is there too, so neither is reported.\n */\nasync function ownDefaultNeedingOwnModels(\n seedFrom: string,\n rendered: readonly string[],\n): Promise<string | undefined> {\n const selector = (await readSeededSettings(seedFrom)).modelRoles;\n const own =\n selector && typeof selector === \"object\" && !Array.isArray(selector)\n ? (selector as Record<string, unknown>).default\n : undefined;\n if (typeof own !== \"string\" || !own.includes(\"/\")) return undefined;\n const providerId = own.slice(0, own.indexOf(\"/\"));\n if (rendered.includes(providerId)) return undefined;\n let raw: string;\n try {\n raw = await fs.readFile(path.join(seedFrom, OMP_MODELS_FILENAME), \"utf-8\");\n } catch {\n return undefined;\n }\n const providers = (parse(raw) as { providers?: unknown } | null)?.providers;\n if (!providers || typeof providers !== \"object\" || Array.isArray(providers)) return undefined;\n return providerId in providers ? own : undefined;\n}\n\n/**\n * Build the session-private agent directory and write omp's two files into it.\n *\n * The user's `~/.omp/agent/models.yml` and `config.yml` are never opened for\n * writing: `config.yml` is *copied* into the session (so a token refresh or a\n * settings write inside the session cannot reach back through a symlink),\n * `models.yml` is not seeded at all, and everything else — `agent.db*` above\n * all — is symlinked so the session shares the developer's logins and caches.\n */\nexport async function materializeOmpAgentDir(\n agentDir: string,\n registry: AIProviderRegistry | MergedAIProviderRegistry,\n options: MaterializeOmpAgentDirOptions = {},\n): Promise<OmpAgentDirMaterialization> {\n await fs.mkdir(agentDir, { recursive: true });\n\n const seeded = options.seedFrom ? await linkLoginFiles(agentDir, options.seedFrom) : [];\n const identity = options.identityDir\n ? await linkInto(agentDir, options.identityDir, OWNED_AGENT_DIR_FILES)\n : [];\n\n const baseSettings =\n options.baseSettings ??\n (options.seedFrom ? await readSeededSettings(options.seedFrom) : undefined);\n\n const render = renderOmpRegistry(registry, { ...options, baseSettings });\n\n await fs.writeFile(path.join(agentDir, OMP_MODELS_FILENAME), render.modelsYml, \"utf-8\");\n await fs.writeFile(path.join(agentDir, OMP_CONFIG_FILENAME), render.configYml, \"utf-8\");\n\n return { ...render, agentDir, seeded, identity };\n}\n\n/** What the omp harness gets back from {@link materializeOmpProviders}. */\nexport interface OmpProviderMaterialization extends OmpAgentDirMaterialization {\n /**\n * The `--model` argument for this session: `<providerId>/<providerModelId>`,\n * the one selector form omp treats as unambiguous when several providers\n * carry the same model id. Absent when the session named no model.\n */\n modelArg?: string;\n}\n\n/**\n * The whole omp adapter for one session: decide the private agent directory,\n * inherit the developer's omp state where there is any, write `models.yml` and\n * `config.yml`, and report the credential environment and `--model` selector\n * the child needs.\n *\n * Returns `undefined` when the session carries no registry with a selectable\n * entry — the harness then behaves exactly as it did before the registry\n * existed, which is what keeps this an expand-and-contract change.\n *\n * Also returns `undefined` when the session names no model (no `--model`, no\n * `default` role) and the user's own omp default is served by the user's own\n * `models.yml`, which a private home does not carry (p1172): the registry would\n * only swap that default for whatever model omp finds first.\n *\n * Also returns `undefined` when no entry can be handed to omp (every\n * credential unresolved) or when the entry the session's model selects was\n * left out: a session-private agent directory would then start omp without the\n * user's own settings, and a model that only the user's own omp login can\n * serve would fail with `No API key found` although native omp answers. The\n * harness then starts omp on the user's agent directory, so \"omp falls back to\n * its own login\" is true.\n *\n * `env:` references resolve against the runner's environment *overlaid with*\n * `config.env`, so a credential the session boundary already resolved (a\n * `platform:` secret it turned into an env var, for instance) is found here\n * under the name the registry entry points at.\n */\nexport async function materializeOmpProviders(\n config: AgentConfig,\n): Promise<OmpProviderMaterialization | undefined> {\n const registry = config.registry;\n if (!registry) return undefined;\n const selectable = registryEntries(registry).some(\n ([, entry]) => (entry.kind === \"llm\" || entry.kind === \"embed\") && isEntryEnabled(entry),\n );\n if (!selectable) return undefined;\n\n const env = { ...process.env, ...config.env };\n const selected = config.modelRef\n ? parseModelRef(config.modelRef, registry, config.roles)\n : undefined;\n const usable = renderOmpRegistry(registry, {\n env,\n ...(config.roles ? { roles: config.roles } : {}),\n ...(config.modelRef ? { modelRef: config.modelRef } : {}),\n }).providerIds;\n if (usable.length === 0) return undefined;\n if (selected && !usable.includes(selected.providerId)) return undefined;\n\n const plan = await planOmpAgentDir({\n cwd: config.cwd,\n ...(config.sessionId ? { sessionId: config.sessionId } : {}),\n ...(config.harnessOptions?.omp ? { options: config.harnessOptions.omp } : {}),\n });\n\n if (!selected && !config.model && plan.seedFrom) {\n const named = renderOmpRegistry(registry, {\n env,\n ...(config.roles ? { roles: config.roles } : {}),\n }).modelRoles;\n if (named.default === undefined && (await ownDefaultNeedingOwnModels(plan.seedFrom, usable))) {\n if (plan.ephemeral) await fs.rm(plan.agentDir, { recursive: true, force: true });\n return undefined;\n }\n }\n\n const rendered = await removeHomeOnThrow(plan, () =>\n materializeOmpAgentDir(plan.agentDir, registry, {\n env,\n ...(plan.seedFrom ? { seedFrom: plan.seedFrom } : {}),\n ...(config.agentDir ? { identityDir: config.agentDir } : {}),\n ...(config.roles ? { roles: config.roles } : {}),\n ...(config.modelRef ? { modelRef: config.modelRef } : {}),\n }),\n );\n\n return {\n ...rendered,\n ephemeral: plan.ephemeral,\n ...(selected?.providerModelId\n ? { modelArg: `${selected.providerId}/${selected.providerModelId}` }\n : {}),\n };\n}\n\n/** What {@link materializeOmpIdentityDir} wrote. */\nexport interface OmpIdentityDirMaterialization {\n /** The directory `PI_CODING_AGENT_DIR` must point at. */\n agentDir: string;\n /** The directory is the harness's temporary home: remove it when the run ends. */\n ephemeral: boolean;\n /** Names linked in from the user's own omp agent directory. */\n seeded: string[];\n /** Names linked in from `AgentConfig.agentDir`. */\n identity: string[];\n}\n\n/**\n * The omp home of a session that has an agent directory but no provider registry.\n *\n * omp keeps its runtime state (`agent.db`, `models.db`, `skill-descriptions.db`, session\n * scratch, `intercom/`) in `PI_CODING_AGENT_DIR`. Pointing that at the agent directory itself\n * put those files beside `SOUL.md` in a pinned, shared source (`.skaile/cache/agents/<name>/`)\n * and made omp name a path inside the cache when it lacks a credential. So the home is a\n * private directory outside `cwd` (see {@link planOmpAgentDir}): the developer's own omp state\n * is linked in (their login keeps working), their `config.yml` / `models.yml` are copied (a\n * settings write cannot reach back), and the agent directory's entries are linked in last,\n * so the agent files stay where they are and omp can still read them.\n *\n * Returns `undefined` when the session has no `agentDir`.\n */\nexport async function materializeOmpIdentityDir(\n config: AgentConfig,\n): Promise<OmpIdentityDirMaterialization | undefined> {\n const identityDir = config.agentDir;\n if (!identityDir) return undefined;\n // Keyed by the agent and the workspace too: two role children of one session, each with\n // its own agent directory, must not link their entries into one home.\n const agentKey = createHash(\"sha256\")\n .update(`${path.resolve(identityDir)}\\0${path.resolve(config.cwd)}`)\n .digest(\"hex\")\n .slice(0, 12);\n const plan = await planOmpAgentDir({\n cwd: config.cwd,\n sessionId: `${config.sessionId?.trim() || \"agent\"}-${agentKey}`,\n ...(config.harnessOptions?.omp ? { options: config.harnessOptions.omp } : {}),\n });\n return removeHomeOnThrow(plan, async () => {\n await fs.mkdir(plan.agentDir, { recursive: true });\n const seeded = plan.seedFrom ? await linkLoginFiles(plan.agentDir, plan.seedFrom) : [];\n if (plan.seedFrom) {\n for (const name of Object.keys(OWNED_AGENT_DIR_FILES)) {\n const from = path.join(plan.seedFrom, name);\n try {\n if (!(await fs.stat(from)).isFile()) continue;\n } catch {\n continue;\n }\n const to = path.join(plan.agentDir, name);\n await removeEntry(to);\n await fs.copyFile(from, to);\n }\n }\n const identity = await linkInto(plan.agentDir, identityDir, {\n ...OWNED_AGENT_DIR_FILES,\n ...OMP_RUNTIME_ENTRIES,\n });\n return { agentDir: plan.agentDir, ephemeral: plan.ephemeral, seeded, identity };\n });\n}\n"]}
1
+ {"version":3,"sources":["../bridge/src/harnesses/omp-models-yml.ts"],"names":[],"mappings":";;;;;;;;;;AA6EO,IAAM,cAAA,GAAoC,CAAC,GAAG,oBAAA,EAAsB,mBAAmB,CAAA;AAO9F,IAAM,mBAAA,GAAyC;AAAA,EAC7C,QAAA;AAAA,EACA,WAAA;AAAA,EACA,WAAA;AAAA,EACA,oBAAA;AAAA,EACA,OAAA;AAAA,EACA;AACF,CAAA;AAyBO,IAAM,mBAAA,GAAsB,YAAA;AAG5B,IAAM,mBAAA,GAAsB,YAAA;AAOnC,IAAM,qBAAA,GAA8C;AAAA,EAClD,YAAA,EAAc,IAAA;AAAA,EACd,aAAA,EAAe,IAAA;AAAA,EACf,aAAA,EAAe,IAAA;AAAA,EACf,YAAA,EAAc,IAAA;AAAA,EACd,aAAA,EAAe,IAAA;AAAA,EACf,iBAAA,EAAmB,IAAA;AAAA,EACnB,kBAAA,EAAoB,IAAA;AAAA,EACpB,eAAA,EAAiB;AACnB,CAAA;AAOA,IAAM,mBAAA,GAA4C;AAAA,EAChD,UAAA,EAAY,IAAA;AAAA,EACZ,cAAA,EAAgB,IAAA;AAAA,EAChB,cAAA,EAAgB,IAAA;AAAA,EAChB,WAAA,EAAa,IAAA;AAAA,EACb,eAAA,EAAiB,IAAA;AAAA,EACjB,eAAA,EAAiB,IAAA;AAAA,EACjB,uBAAA,EAAyB,IAAA;AAAA,EACzB,2BAAA,EAA6B,IAAA;AAAA,EAC7B,2BAAA,EAA6B,IAAA;AAAA,EAC7B,sBAAA,EAAwB,IAAA;AAAA,EACxB,QAAA,EAAU,IAAA;AAAA,EACV,QAAA,EAAU;AACZ,CAAA;AAQA,IAAM,eAAA,GAAkB,CAAC,UAAA,EAAY,cAAA,EAAgB,cAAc,CAAA;AAyCnE,SAAS,cAAc,KAAA,EAAoD;AACzE,EAAA,MAAM,OAAA,uBA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,IAAA,CAAK,QAAA,GAAW,MAAM,cAAA,CAAe,KAAK,QAAA,EAAU,IAAA,CAAK,QAAQ,CAAA,GAAI,EAAC;AACrF,IAAA,IAAI,KAAK,QAAA,EAAU;AACjB,MAAA,KAAA,MAAW,IAAA,IAAQ,MAAA,CAAO,IAAA,CAAK,qBAAqB,CAAA,EAAG;AACrD,QAAA,MAAM,IAAA,GAAO,IAAA,CAAK,IAAA,CAAK,IAAA,CAAK,UAAU,IAAI,CAAA;AAC1C,QAAA,IAAI;AACF,UAAA,IAAI,EAAE,MAAM,EAAA,CAAG,KAAK,IAAI,CAAA,EAAG,QAAO,EAAG;AAAA,QACvC,CAAA,CAAA,MAAQ;AACN,UAAA;AAAA,QACF;AACA,QAAA,MAAM,EAAA,GAAK,IAAA,CAAK,IAAA,CAAK,IAAA,CAAK,UAAU,IAAI,CAAA;AACxC,QAAA,MAAM,YAAY,EAAE,CAAA;AACpB,QAAA,MAAM,EAAA,CAAG,QAAA,CAAS,IAAA,EAAM,EAAE,CAAA;AAAA,MAC5B;AAAA,IACF;AACA,IAAA,MAAM,QAAA,GAAW,MAAM,QAAA,CAAS,IAAA,CAAK,UAAU,WAAA,EAAa;AAAA,MAC1D,GAAG,qBAAA;AAAA,MACH,GAAG;AAAA,KACJ,CAAA;AACD,IAAA,OAAO,EAAE,UAAU,IAAA,CAAK,QAAA,EAAU,WAAW,IAAA,CAAK,SAAA,EAAW,QAAQ,QAAA,EAAS;AAAA,EAChF,CAAC,CAAA;AACH","file":"chunk-7LP7RCZI.js","sourcesContent":["/**\n * The omp adapter: an AI provider registry serialized into omp's own\n * configuration files, inside a session-private agent directory.\n *\n * omp already implements the target schema — `~/.omp/agent/models.yml` is a\n * `providers:` map with `baseUrl`, `api`, `apiKey`, `headers`, `authHeader`,\n * `auth`, `discovery` and `models[]` (`omp://models.md`) — so this module is a\n * *serializer*, not a translator. Our `surface` enum is omp's `api` enum\n * verbatim (§1.2); {@link OMP_API_VALUES} encodes that assertion so a future\n * surface that omp does not know is reported instead of silently written into\n * a file omp will then reject wholesale.\n *\n * Two files are produced:\n *\n * - `models.yml` — one entry per enabled `llm`/`embed` registry entry. `apiKey`\n * holds the **name** of the per-entry environment variable\n * (`SKAILE_AIP_<ID>_KEY`, {@link providerCredentialEnvName}), never a value:\n * omp resolves a `models.yml` `apiKey` as an env-var name first and only\n * falls back to treating it as a literal token. The values travel in the\n * child environment.\n * - `config.yml` — omp's settings file, carrying `modelRoles` rendered from the\n * `skaile.yaml` `roles` table. `models.yml`'s root accepts only `providers:`;\n * unknown root keys fail its schema, so roles cannot live there.\n *\n * `PI_CODING_AGENT_DIR` relocates omp's whole agent base — `config.yml`,\n * `models.yml` **and** the auth store `agent.db` (`omp://settings.md`). Pointing\n * it at a session-private directory is what makes N providers per session\n * possible without ever writing the user's `~/.omp/agent`. The cost is that a\n * standalone developer session would also lose the OAuth logins stored in that\n * auth store, so {@link materializeOmpAgentDir} seeds the session directory\n * with symlinks to everything in the user's agent directory *except* the two\n * files this module owns. Verified against omp 18.2.6: a ChatGPT/Codex OAuth\n * account stored in `~/.omp/agent/agent.db` still resolves (`omp token\n * openai-codex`) from a relocated directory that only symlinks `agent.db*`.\n * Under the platform the user directory does not exist, the seed is a no-op,\n * and the session starts empty — which is the correct behaviour there.\n *\n * @see PROVIDER-CONFIG-PLAN.md §2.3 (omp row), §5, §9\n * @see omp://models.md, omp://settings.md\n */\n\nimport { createHash } from \"node:crypto\";\nimport type { Stats } from \"node:fs\";\nimport fs from \"node:fs/promises\";\nimport os from \"node:os\";\nimport net from \"node:net\";\nimport path from \"node:path\";\nimport {\n type AIProviderLlmEntry,\n type AIProviderRegistry,\n AI_PROVIDER_SURFACES,\n isEntryEnabled,\n type MergedAIProviderRegistry,\n normalizeEntryBaseUrl,\n parseModelRef,\n registryEntries,\n resolveEntryBaseUrl,\n} from \"@skaile/workspaces/core/provider-registry\";\nimport { parse, stringify } from \"yaml\";\nimport type { ModelEntry } from \"../models.js\";\nimport {\n entryCredentialValue,\n providerCredentialEnvName,\n type RegistryCredentialEnvOptions,\n unresolvedProviderCredentials,\n} from \"../provider-materialize/credential-env.js\";\nimport { entrySurface } from \"../provider-materialize/env-harnesses.js\";\nimport type { AgentConfig, OmpHarnessOptions } from \"../types.js\";\n\n/**\n * omp's allowed provider/model `api` values (`omp://models.md`, \"Allowed\n * provider/model `api` values\").\n *\n * Every {@link AI_PROVIDER_SURFACES} member is in this list — that equality is\n * the premise the whole adapter rests on (§1.2). `google-gemini-cli` is omp's\n * one extra value, which the registry has no surface for.\n */\nexport const OMP_API_VALUES: readonly string[] = [...AI_PROVIDER_SURFACES, \"google-gemini-cli\"];\n\n/**\n * `discovery.type` values omp accepts. The registry's own enum is wider on one\n * side (`anthropic-models-list`, `google-models-list`, `none`) and narrower on\n * the other, so a discovery block is emitted only when omp can act on it.\n */\nconst OMP_DISCOVERY_TYPES: readonly string[] = [\n \"ollama\",\n \"llama.cpp\",\n \"lm-studio\",\n \"openai-models-list\",\n \"proxy\",\n \"litellm\",\n];\n\n/** One `providers.<id>` block of `models.yml`. */\ninterface OmpProviderBlock {\n baseUrl?: string;\n api?: string;\n /** The *name* of the env var holding the credential — never a value. */\n apiKey?: string;\n auth?: \"apiKey\" | \"none\" | \"oauth\";\n authHeader?: boolean;\n headers?: Record<string, string>;\n discovery?: { type: string };\n models?: OmpModelBlock[];\n}\n\n/** One entry of a provider's `models[]`. */\ninterface OmpModelBlock {\n id: string;\n name?: string;\n input?: string[];\n contextWindow?: number;\n supportsTools?: boolean;\n}\n\n/** The two files this module owns inside the agent directory. */\nexport const OMP_MODELS_FILENAME = \"models.yml\";\n\n/** omp's settings file; `modelRoles` lives here, not in `models.yml`. */\nexport const OMP_CONFIG_FILENAME = \"config.yml\";\n\n/**\n * Names {@link materializeOmpAgentDir} never links in from the user's agent\n * directory: the two files it writes itself, their alternate spellings, and\n * the legacy `settings.json` omp would migrate into `config.yml`.\n */\nconst OWNED_AGENT_DIR_FILES: Record<string, true> = {\n \"models.yml\": true,\n \"models.yaml\": true,\n \"models.json\": true,\n \"config.yml\": true,\n \"config.yaml\": true,\n \"config.yml.lock\": true,\n \"config.yaml.lock\": true,\n \"settings.json\": true,\n};\n\n/**\n * omp's own runtime state inside its home. An agent directory that an older release used as\n * omp's home still holds these; they are never agent files, so the identity link skips them\n * and the user's own login (`agent.db`) linked in from their agent directory stays in place.\n */\nconst OMP_RUNTIME_ENTRIES: Record<string, true> = {\n \"agent.db\": true,\n \"agent.db-shm\": true,\n \"agent.db-wal\": true,\n \"models.db\": true,\n \"models.db-shm\": true,\n \"models.db-wal\": true,\n \"skill-descriptions.db\": true,\n \"skill-descriptions.db-shm\": true,\n \"skill-descriptions.db-wal\": true,\n \"custom-session-files\": true,\n intercom: true,\n sessions: true,\n};\n\n/**\n * The only entries of the user's own omp agent directory a session's private home links in:\n * omp's credential store, so the login the developer already has keeps working. Sessions,\n * history, `mcp.json`, extensions and blobs stay out: a run must not write into the user's\n * session store or load their MCP servers and extensions. `config.yml` is copied, not linked.\n */\nconst OMP_LOGIN_FILES = [\"agent.db\", \"agent.db-shm\", \"agent.db-wal\"] as const;\n\n/** Options for {@link renderOmpRegistry}. */\nexport interface RenderOmpRegistryOptions extends RegistryCredentialEnvOptions {\n /** `skaile.yaml` `roles`: role name → model selector. Rendered as `modelRoles`. */\n roles?: Record<string, string>;\n /**\n * The session's own selector. When `roles` names no `default`, the resolved\n * model becomes `modelRoles.default` so `@default` (and omp's `*` alias)\n * resolve to the entry the session actually runs on.\n */\n modelRef?: string;\n /**\n * Settings to render underneath `modelRoles` — the user's own `config.yml`\n * when a standalone session seeds one. `modelRoles` is replaced wholesale,\n * not deep-merged: a seeded role pointing at a provider this session does\n * not define would otherwise survive as a dangling selector.\n */\n baseSettings?: Record<string, unknown>;\n}\n\n/** What {@link renderOmpRegistry} produced. */\nexport interface OmpRegistryRender {\n /** `models.yml` contents. */\n modelsYml: string;\n /** `config.yml` contents. */\n configYml: string;\n /**\n * `SKAILE_AIP_<ID>_KEY` → secret, for the child environment. The only place\n * a credential value appears; both rendered files hold names alone.\n */\n credentialEnv: Record<string, string>;\n /** Entry ids written to `models.yml`, in registry order. */\n providerIds: string[];\n /** `modelRoles` as written, role name → `<providerId>/<providerModelId>`. */\n modelRoles: Record<string, string>;\n /** Entries and roles that could not be rendered, and why. */\n warnings: string[];\n}\n\n/** The provider-side model ids an entry declares, keyed by logical id. */\nfunction entryModelIds(entry: AIProviderLlmEntry): Array<[string, string]> {\n const logical = new Set<string>([\n ...Object.keys(entry.model_map ?? {}),\n ...Object.keys(entry.capabilities ?? {}),\n ]);\n const seen = new Set<string>();\n const out: Array<[string, string]> = [];\n for (const id of logical) {\n const providerSide = entry.model_map?.[id] ?? id;\n if (seen.has(providerSide)) continue;\n seen.add(providerSide);\n out.push([id, providerSide]);\n }\n return out;\n}\n\n/**\n * Serialize one entry into an omp provider block, or report why it cannot be.\n *\n * omp requires `baseUrl` on any provider that declares `models[]`, and\n * provider-level `api` whenever `discovery` is set (except `discovery.type:\n * proxy`, where the wire is auto-detected per model). A file that violates its\n * schema is rejected *wholesale* — the registry keeps operating on built-in\n * models and the error only surfaces through `ModelRegistry.getError()` — so an\n * entry that cannot satisfy those rules is dropped here, loudly, rather than\n * taking every other provider down with it.\n */\nfunction renderProvider(\n id: string,\n entry: AIProviderLlmEntry,\n warnings: string[],\n): OmpProviderBlock | undefined {\n // The Anthropic SDK inside omp appends `/v1/messages`: a stored `…/v1` must\n // not reach the file as written. Not `entryBaseUrl`: omp gets no preset\n // literal, so an entry without an endpoint of its own is reported below.\n const baseUrl = normalizeEntryBaseUrl(resolveEntryBaseUrl(entry), entrySurface(entry));\n if (!baseUrl) {\n warnings.push(\n `provider '${id}' has no resolvable base_url (missing transport params?) — omitted from models.yml`,\n );\n return undefined;\n }\n\n // Only the entry's own surface becomes `api`; an inherited one stays omp's\n // to infer, as before. The preset's surface above only picks the URL rule.\n const surface = entry.surface;\n if (surface && !OMP_API_VALUES.includes(surface)) {\n warnings.push(\n `provider '${id}' has surface '${surface}', which omp's api enum does not accept`,\n );\n return undefined;\n }\n\n const block: OmpProviderBlock = { baseUrl };\n if (surface) block.api = surface;\n\n const kind = entry.credential?.kind ?? \"none\";\n if (kind === \"none\") {\n block.auth = \"none\";\n } else if (kind === \"sigv4\" || kind === \"google_adc\" || kind === \"azure_entra\") {\n // Ambient signing chains: the AWS/Google/Azure SDK inside omp signs the\n // request from its own environment. There is no token to hand over, and\n // omp must not treat the provider as unavailable for the lack of one.\n block.auth = \"none\";\n } else {\n block.apiKey = providerCredentialEnvName(id);\n // `bearer` is the only kind that needs the header injected; the Anthropic\n // and Azure surfaces place an `api_key_header` credential themselves.\n if (kind === \"bearer\" || kind === \"oauth\") block.authHeader = true;\n }\n\n const headers = { ...entry.headers };\n if (entry.query_params && Object.keys(entry.query_params).length > 0) {\n if (surface === \"bedrock-converse-stream\") {\n // omp keeps a query string on a Bedrock `baseUrl` and appends it to the\n // final URL (and to SigV4's canonical request) — the documented carrier\n // for gateways that authenticate by query parameter.\n const search = new URLSearchParams(entry.query_params).toString();\n block.baseUrl = `${baseUrl}${baseUrl.includes(\"?\") ? \"&\" : \"?\"}${search}`;\n } else {\n warnings.push(\n `provider '${id}' declares query_params, which omp's models.yml has no slot for on surface ` +\n `'${surface ?? \"unset\"}' — they were dropped`,\n );\n }\n }\n if (Object.keys(headers).length > 0) block.headers = headers;\n\n const discoveryType = entry.discovery?.type;\n if (discoveryType) {\n if (!OMP_DISCOVERY_TYPES.includes(discoveryType)) {\n warnings.push(\n `provider '${id}' declares discovery '${discoveryType}', which omp does not implement — ` +\n `models come from model_map only`,\n );\n } else if (!surface && discoveryType !== \"proxy\") {\n warnings.push(\n `provider '${id}' declares discovery '${discoveryType}' but no surface — omp requires ` +\n `provider-level api for every discovery type but 'proxy'`,\n );\n } else {\n block.discovery = { type: discoveryType };\n }\n }\n\n const models: OmpModelBlock[] = [];\n for (const [logical, providerSide] of entryModelIds(entry)) {\n const model: OmpModelBlock = { id: providerSide };\n if (logical !== providerSide) model.name = logical;\n const caps = entry.capabilities?.[logical];\n if (caps?.context_window !== undefined) model.contextWindow = caps.context_window;\n if (caps?.images !== undefined) model.input = caps.images ? [\"text\", \"image\"] : [\"text\"];\n if (caps?.tools !== undefined) model.supportsTools = caps.tools;\n models.push(model);\n }\n if (models.length > 0) {\n if (!surface) {\n warnings.push(\n `provider '${id}' declares models but no surface — omp requires api at provider or model level`,\n );\n return undefined;\n }\n block.models = models;\n } else if (!block.discovery) {\n warnings.push(\n `provider '${id}' declares neither model_map/capabilities nor a discovery omp implements — ` +\n `it will only override an omp built-in provider of the same id`,\n );\n }\n\n return block;\n}\n\n/**\n * Resolve the `roles` table into omp `modelRoles` selectors.\n *\n * Roles do not chain, so each value is resolved as a plain selector rather than\n * through `@role` expansion. A trailing omp thinking suffix (`:high`) survives\n * untouched: it is not part of any `model_map` key, so it falls through\n * `parseModelRef`'s literal path and is re-emitted on the provider-side id.\n */\nfunction renderModelRoles(\n registry: AIProviderRegistry | MergedAIProviderRegistry,\n roles: Record<string, string> | undefined,\n modelRef: string | undefined,\n warnings: string[],\n): Record<string, string> {\n const out: Record<string, string> = {};\n for (const [role, selector] of Object.entries(roles ?? {})) {\n const trimmed = selector.trim();\n if (!trimmed) continue;\n const ref = parseModelRef(trimmed, registry);\n if (!ref?.providerModelId) {\n warnings.push(\n `role '${role}' ('${selector}') resolves to no model in this registry — dropped`,\n );\n continue;\n }\n out[role] = `${ref.providerId}/${ref.providerModelId}`;\n }\n if (out.default === undefined && modelRef) {\n const ref = parseModelRef(modelRef, registry, roles);\n if (ref?.providerModelId) out.default = `${ref.providerId}/${ref.providerModelId}`;\n }\n return out;\n}\n\n/**\n * The warning for an entry left out of `models.yml` because its credential does not resolve.\n * `skaile run` and `skaile repl` print the same fact as one `! provider ... is not used` line\n * (runner `credential-notice.ts`), so the harness keeps this warning off the console.\n */\nfunction credentialOmissionWarning(id: string, reason: string): string {\n return `provider '${id}' omitted from models.yml: ${reason}`;\n}\n\n/** True for a warning built by {@link credentialOmissionWarning}. */\nexport function isCredentialOmissionWarning(warning: string): boolean {\n return /^provider '[^']+' omitted from models\\.yml: /.test(warning);\n}\n\n/**\n * Serialize a registry into the two omp files plus the credential environment\n * that carries their secrets.\n *\n * Only enabled `llm`/`embed` entries are rendered: `stt`/`tts` entries have no\n * wire surface and omp has no slot for them. The credential environment is\n * scoped to the same set — the omp child has no use for a Deepgram key, and a\n * secret that reaches a process which cannot spend it is pure exposure.\n *\n * An entry whose credential does not resolve here still gets its\n * `SKAILE_AIP_<ID>_KEY` name written into `models.yml`: a `platform:` ref is\n * resolved by the session boundary, which materializes the value into\n * `AgentConfig.env` under that same programme-standard name.\n */\nexport function renderOmpRegistry(\n registry: AIProviderRegistry | MergedAIProviderRegistry,\n options: RenderOmpRegistryOptions = {},\n): OmpRegistryRender {\n const warnings: string[] = [];\n const providers: Record<string, OmpProviderBlock> = {};\n const providerIds: string[] = [];\n const credentialEnv: Record<string, string> = {};\n\n // An entry whose credential cannot be resolved here is not handed to omp: it\n // would send an empty key (`invalid x-api-key`) and shadow omp's own login for\n // the same provider.\n const unresolved = new Map(\n unresolvedProviderCredentials(registry, options).map((u) => [u.providerId, u.reason]),\n );\n for (const [id, entry] of registryEntries(registry)) {\n if (entry.kind !== \"llm\" && entry.kind !== \"embed\") continue;\n if (!isEntryEnabled(entry)) continue;\n const reason = unresolved.get(id);\n if (reason) {\n warnings.push(credentialOmissionWarning(id, reason));\n continue;\n }\n const block = renderProvider(id, entry as AIProviderLlmEntry, warnings);\n if (!block) continue;\n providers[id] = block;\n providerIds.push(id);\n // Only the canonical name, never a vendor-conventional alias: every\n // endpoint omp may address is named in models.yml with its own variable,\n // and a stray `ANTHROPIC_API_KEY` would silently make omp's *built-in*\n // Anthropic provider look authenticated with some gateway entry's key.\n const secret = entryCredentialValue(id, entry, options);\n if (secret) credentialEnv[providerCredentialEnvName(id)] = secret;\n }\n\n const modelRoles = renderModelRoles(registry, options.roles, options.modelRef, warnings);\n\n const settings: Record<string, unknown> = { ...options.baseSettings };\n if (Object.keys(modelRoles).length > 0) settings.modelRoles = modelRoles;\n\n return {\n modelsYml: stringify({ providers }),\n configYml: stringify(settings),\n credentialEnv,\n providerIds,\n modelRoles,\n warnings,\n };\n}\n\n/**\n * The models a registry makes selectable, as the harness-neutral catalog entry.\n *\n * ids are `<providerId>/<providerModelId>` — the exact selector omp's `--model`\n * and `modelRoles` take, and unambiguous when two entries serve the same model\n * id, which is the normal case once a session carries N providers.\n */\nexport function registryModelEntries(\n registry: AIProviderRegistry | MergedAIProviderRegistry | undefined,\n): ModelEntry[] {\n if (!registry) return [];\n const out: ModelEntry[] = [];\n for (const [id, entry] of registryEntries(registry)) {\n if (entry.kind !== \"llm\" && entry.kind !== \"embed\") continue;\n if (!isEntryEnabled(entry)) continue;\n const label = entry.label ?? id;\n for (const [logical, providerSide] of entryModelIds(entry as AIProviderLlmEntry)) {\n out.push({ id: `${id}/${providerSide}`, name: `${label} ${logical}` });\n }\n }\n return out;\n}\n\n/**\n * Why omp cannot serve `<providerId>/<model>` from this registry, or `undefined` when it can (or\n * when this check cannot tell). omp knows only the models a registry entry declares\n * (`model_map`, `capabilities`) or its `discovery` lists: for a provider id omp has no login for\n * and an entry that declares neither, `omp --model fake/fake-1` exits with `Model \"fake/fake-1\"\n * not found` on the first prompt (p1334). `nativeProviders` are the ids omp ships a login for;\n * their entry only overrides the built-in provider, so the model may still be omp's own.\n */\nexport function ompRegistryModelRefusal(\n registry: AIProviderRegistry | MergedAIProviderRegistry | undefined,\n selector: string,\n nativeProviders: ReadonlySet<string>,\n): string | undefined {\n if (!registry) return undefined;\n const slash = selector.indexOf(\"/\");\n if (slash <= 0) return undefined;\n const head = selector.slice(0, slash);\n // A trailing omp thinking suffix (`:high`) is not part of the model id.\n const model = selector.slice(slash + 1).replace(/:(off|minimal|low|medium|high|xhigh)$/i, \"\");\n if (!model || nativeProviders.has(head)) return undefined;\n const found = registryEntries(registry).find(([id]) => id === head);\n if (!found) return undefined;\n const [, entry] = found;\n if ((entry.kind !== \"llm\" && entry.kind !== \"embed\") || !isEntryEnabled(entry)) return undefined;\n const llm = entry as AIProviderLlmEntry;\n if (llm.discovery?.type && OMP_DISCOVERY_TYPES.includes(llm.discovery.type)) return undefined;\n const known = entryModelIds(llm).flatMap(([logical, providerSide]) => [logical, providerSide]);\n if (known.includes(model)) return undefined;\n return known.length === 0\n ? `omp cannot serve model '${selector}': registry entry '${head}' declares no models (add model_map or capabilities to it in providers.yml), and omp has no login for '${head}'. Pick a model omp lists.`\n : `omp cannot serve model '${selector}': registry entry '${head}' declares ${known.join(\", \")}, not '${model}'. Pick one of those, or add '${model}' to the entry's model_map.`;\n}\n\n/** Options for {@link materializeOmpAgentDir}. */\nexport interface MaterializeOmpAgentDirOptions extends RenderOmpRegistryOptions {\n /**\n * The user's own omp agent directory to seed from — its auth store\n * (`agent.db`) is linked in so a standalone session keeps the login the\n * developer already has, and its `config.yml` is read as base settings.\n * Sessions, history, `mcp.json` and extensions are not linked. Absent (the\n * platform case) seeds nothing. A missing directory is not an error: it is the platform case.\n */\n seedFrom?: string;\n /**\n * GitAgent identity directory (`AgentConfig.agentDir`) whose contents omp\n * reads out of the same base: `agent.yaml`, `SOUL.md`, `RULES.md`,\n * `knowledge/`. Linked in after the seed, so identity wins a name clash.\n */\n identityDir?: string;\n}\n\n/** What {@link materializeOmpAgentDir} wrote. */\nexport interface OmpAgentDirMaterialization extends OmpRegistryRender {\n /** The directory `PI_CODING_AGENT_DIR` must point at. */\n agentDir: string;\n /** The directory is the harness's temporary home: remove it when the run ends. */\n ephemeral?: boolean;\n /** Names linked in from {@link MaterializeOmpAgentDirOptions.seedFrom}. */\n seeded: string[];\n /** Names linked in from {@link MaterializeOmpAgentDirOptions.identityDir}. */\n identity: string[];\n}\n\n/** Inputs {@link planOmpAgentDir} derives the session directory layout from. */\nexport interface OmpAgentDirPlanInput {\n /** Session working directory. Distinguishes two default-named sessions. */\n cwd: string;\n /** Session id — the directory key, so concurrent sessions never collide. */\n sessionId?: string;\n /** `AgentConfig.harnessOptions.omp`. */\n options?: OmpHarnessOptions;\n /** Home the default seed source resolves against. Defaults to `os.homedir()`. */\n homeDir?: string;\n /** Root the private directory is created under. Defaults to `os.tmpdir()`. */\n tmpDir?: string;\n}\n\n/** Where a session's omp agent directory lives, and what it inherits. */\nexport interface OmpAgentDirPlan {\n /** Session-private directory `PI_CODING_AGENT_DIR` points at. */\n agentDir: string;\n /** User agent directory whose login is linked in, when there is one to inherit. */\n seedFrom?: string;\n /**\n * The directory is the harness's own temporary home, to be removed when the run ends. False\n * when the session named its own `harnessOptions.omp.agentHome`, which belongs to the user.\n */\n ephemeral: boolean;\n}\n\n/**\n * Decide the session-private agent directory and whether it inherits the\n * developer's omp state.\n *\n * The directory is deliberately **outside `cwd`**. It holds omp's credential\n * store — a symlink to the developer's `agent.db` on a standalone machine —\n * and `cwd` is the one tree the agent has write access to by design; managed\n * codex draws the same line and rejects a private directory nested in the\n * workspace (`codex/instance-state.ts`). Sessions are keyed by id, falling\n * back to a digest of the workspace path. The temporary directory is `<key>-<random>`, created per\n * call, so no two runs share one (and one run's cleanup never removes another's).\n *\n * Seeding keys on the user directory *existing*, which is exactly the\n * platform/standalone distinction the plan draws: a platform container has no\n * `~/.omp/agent`, so the session correctly starts empty; a developer machine\n * has one, so the session keeps the logins already stored there.\n * `harnessOptions.omp.seedUserAgentDir: false` forces the empty case anyway.\n */\nexport async function planOmpAgentDir(input: OmpAgentDirPlanInput): Promise<OmpAgentDirPlan> {\n const options = input.options;\n const key =\n input.sessionId?.trim() ||\n createHash(\"sha256\").update(path.resolve(input.cwd)).digest(\"hex\").slice(0, 16);\n const ephemeral = options?.agentHome === undefined;\n // The temporary home is unique per spawn: callers key sessions loosely (`skaile chat` passes\n // none, `serve` without --session-id uses one shared id, sub-prompt harnesses share a hash), and\n // the harness deletes its home when its run ends, which must never reach a sibling's home.\n let agentDir = options?.agentHome ?? \"\";\n if (ephemeral) {\n const root = path.join(input.tmpDir ?? os.tmpdir(), \"skaile-omp-agent\");\n await fs.mkdir(root, { recursive: true });\n await sweepStaleOmpHomes(root);\n agentDir = await fs.mkdtemp(path.join(root, `${key.replace(/[^A-Za-z0-9._-]/g, \"_\")}-`));\n await fs.writeFile(path.join(agentDir, OWNER_FILE), String(process.pid));\n }\n if (options?.seedUserAgentDir === false) return { agentDir, ephemeral };\n\n const seedFrom =\n options?.userAgentDir ?? path.join(input.homeDir ?? os.homedir(), \".omp\", \"agent\");\n if (path.resolve(seedFrom) === path.resolve(agentDir)) return { agentDir, ephemeral };\n try {\n if (!(await fs.stat(seedFrom)).isDirectory()) return { agentDir, ephemeral };\n } catch {\n return { agentDir, ephemeral };\n }\n return { agentDir, seedFrom, ephemeral };\n}\n\n/** Names the process that created a temporary home; the sweep keeps a home whose owner lives. */\nconst OWNER_FILE = \".skaile-owner-pid\";\n/** A temporary home older than this whose owner is gone is removed at the next start. */\nconst STALE_HOME_MS = 24 * 60 * 60 * 1000;\n\n/**\n * The names skaile gave a temporary home: `<key>-<six random characters>` (`mkdtemp`), and\n * `<key>-<12 hex>` from releases before 5.16 (p1151).\n */\nconst SKAILE_HOME_NAME = /^[A-Za-z0-9._-]+-(?:[A-Za-z0-9]{6}|[0-9a-f]{12})$/;\n\nfunction processAlive(pid: number): boolean {\n try {\n process.kill(pid, 0);\n return true;\n } catch (err) {\n return (err as NodeJS.ErrnoException).code === \"EPERM\";\n }\n}\n\n/**\n * Whether nothing listens on the unix socket `file`: a connect is refused (the process that\n * bound it is gone) or finds no socket. A socket somebody still serves, or one that does not\n * answer within a second, counts as in use.\n */\nfunction socketIsDead(file: string): Promise<boolean> {\n return new Promise<boolean>((resolve) => {\n const conn = net.connect(file);\n const done = (dead: boolean) => {\n conn.destroy();\n resolve(dead);\n };\n conn.setTimeout(1000, () => done(false));\n conn.once(\"connect\", () => done(false));\n conn.once(\"error\", (err: NodeJS.ErrnoException) =>\n done(err.code === \"ECONNREFUSED\" || err.code === \"ENOENT\"),\n );\n });\n}\n\n/**\n * Remove temporary homes older than a day whose creating process is gone: a run that was killed\n * never reached the harness's own cleanup, and every one leaves symlinks and databases behind\n * (p811). A home of a live process is kept whatever its age. A unix socket of that age that\n * nobody listens on is removed too (omp binds one beside the homes and a killed run leaves it,\n * p1316). Best effort: a failure is ignored.\n */\nasync function sweepStaleOmpHomes(root: string, now = Date.now()): Promise<void> {\n let names: string[];\n try {\n names = await fs.readdir(root);\n } catch {\n return;\n }\n await Promise.all(\n names.map(async (name) => {\n const home = path.join(root, name);\n try {\n const stat = await fs.lstat(home);\n if (now - stat.mtimeMs < STALE_HOME_MS) return;\n if (stat.isSocket()) {\n if (await socketIsDead(home)) await fs.rm(home, { force: true });\n return;\n }\n if (!stat.isDirectory()) return;\n const owner = Number.parseInt(\n await fs.readFile(path.join(home, OWNER_FILE), \"utf8\").catch(() => \"\"),\n 10,\n );\n if (Number.isInteger(owner) && processAlive(owner)) return;\n // A home with no owner file is one an older version made: remove it only when its\n // name has the `<key>-<six random characters>` shape `mkdtemp` gives (never a folder\n // somebody else put in this directory).\n if (!Number.isInteger(owner) && !SKAILE_HOME_NAME.test(name)) return;\n await fs.rm(home, { recursive: true, force: true });\n } catch {\n /* another process may be sweeping the same home */\n }\n }),\n );\n}\n\n/**\n * Run the steps that fill a planned home; when one throws, remove a temporary home before\n * rethrowing. The harness only learns the home (and deletes it at cleanup) once these steps\n * return, so a failure here would otherwise leave a new directory per spawn behind.\n */\nasync function removeHomeOnThrow<T>(plan: OmpAgentDirPlan, fill: () => Promise<T>): Promise<T> {\n try {\n return await fill();\n } catch (err) {\n if (plan.ephemeral) await fs.rm(plan.agentDir, { recursive: true, force: true });\n throw err;\n }\n}\n\n/** Remove a path whatever it is, without following a symlink into its target. */\nasync function removeEntry(target: string): Promise<void> {\n let stat: Stats;\n try {\n stat = await fs.lstat(target);\n } catch {\n return;\n }\n if (stat.isSymbolicLink() || stat.isFile()) {\n await fs.unlink(target);\n return;\n }\n await fs.rm(target, { recursive: true, force: true });\n}\n\n/** Symlink every entry of `sourceDir` into `dir`, skipping the owned names. */\nasync function linkInto(\n dir: string,\n sourceDir: string,\n skip: Record<string, true>,\n): Promise<string[]> {\n let names: string[];\n try {\n names = await fs.readdir(sourceDir);\n } catch {\n return [];\n }\n const linked: string[] = [];\n for (const name of names) {\n if (skip[name]) continue;\n const target = path.join(dir, name);\n await removeEntry(target);\n await fs.symlink(path.join(sourceDir, name), target);\n linked.push(name);\n }\n return linked;\n}\n\n/**\n * Remove the symlinks into the user's agent directory that an older release (or a home the\n * session named itself) left in `dir`: only the login files may point there (p811).\n */\nasync function dropStaleSeedLinks(dir: string, sourceDir: string): Promise<void> {\n let names: string[];\n try {\n names = await fs.readdir(dir);\n } catch {\n return;\n }\n const root = path.resolve(sourceDir);\n for (const name of names) {\n if ((OMP_LOGIN_FILES as readonly string[]).includes(name)) continue;\n const entry = path.join(dir, name);\n try {\n if (!(await fs.lstat(entry)).isSymbolicLink()) continue;\n const to = path.resolve(dir, await fs.readlink(entry));\n if (to === root || to.startsWith(root + path.sep)) await fs.unlink(entry);\n } catch {\n // Gone or unreadable: nothing to drop.\n }\n }\n}\n\n/** Symlink the login files (see {@link OMP_LOGIN_FILES}) of the user's agent directory into `dir`. */\nasync function linkLoginFiles(dir: string, sourceDir: string): Promise<string[]> {\n await dropStaleSeedLinks(dir, sourceDir);\n const linked: string[] = [];\n for (const name of OMP_LOGIN_FILES) {\n const from = path.join(sourceDir, name);\n try {\n if (!(await fs.stat(from)).isFile()) continue;\n } catch {\n continue;\n }\n const target = path.join(dir, name);\n await removeEntry(target);\n await fs.symlink(from, target);\n linked.push(name);\n }\n return linked;\n}\n\n/** Read a seeded `config.yml` as the base settings, or `{}` when unusable. */\nasync function readSeededSettings(seedFrom: string): Promise<Record<string, unknown>> {\n for (const name of [\"config.yml\", \"config.yaml\"]) {\n let raw: string;\n try {\n raw = await fs.readFile(path.join(seedFrom, name), \"utf-8\");\n } catch {\n continue;\n }\n const parsed = parse(raw) as unknown;\n if (parsed && typeof parsed === \"object\" && !Array.isArray(parsed)) {\n return parsed as Record<string, unknown>;\n }\n }\n return {};\n}\n\n/**\n * The model selector of the user's own omp default (`modelRoles.default` in their `config.yml`)\n * when it can only be served by their own `models.yml`, else `undefined` (p1172).\n *\n * The session-private home never copies the user's `models.yml`: it holds their credentials.\n * A default such as `anthropic/claude-opus-5-5` that their `models.yml` defines (a gateway, a\n * local server) then names a provider the private home does not have, and omp quietly picks\n * another model. A default on a built-in omp provider keeps working there (its login is linked\n * in), and a provider the registry renders is there too, so neither is reported.\n */\nasync function ownDefaultNeedingOwnModels(\n seedFrom: string,\n rendered: readonly string[],\n): Promise<string | undefined> {\n const selector = (await readSeededSettings(seedFrom)).modelRoles;\n const own =\n selector && typeof selector === \"object\" && !Array.isArray(selector)\n ? (selector as Record<string, unknown>).default\n : undefined;\n if (typeof own !== \"string\" || !own.includes(\"/\")) return undefined;\n const providerId = own.slice(0, own.indexOf(\"/\"));\n if (rendered.includes(providerId)) return undefined;\n let raw: string;\n try {\n raw = await fs.readFile(path.join(seedFrom, OMP_MODELS_FILENAME), \"utf-8\");\n } catch {\n return undefined;\n }\n const providers = (parse(raw) as { providers?: unknown } | null)?.providers;\n if (!providers || typeof providers !== \"object\" || Array.isArray(providers)) return undefined;\n return providerId in providers ? own : undefined;\n}\n\n/**\n * Build the session-private agent directory and write omp's two files into it.\n *\n * The user's `~/.omp/agent/models.yml` and `config.yml` are never opened for\n * writing: `config.yml` is *copied* into the session (so a token refresh or a\n * settings write inside the session cannot reach back through a symlink),\n * `models.yml` is not seeded at all, and everything else — `agent.db*` above\n * all — is symlinked so the session shares the developer's logins and caches.\n */\nexport async function materializeOmpAgentDir(\n agentDir: string,\n registry: AIProviderRegistry | MergedAIProviderRegistry,\n options: MaterializeOmpAgentDirOptions = {},\n): Promise<OmpAgentDirMaterialization> {\n await fs.mkdir(agentDir, { recursive: true });\n\n const seeded = options.seedFrom ? await linkLoginFiles(agentDir, options.seedFrom) : [];\n const identity = options.identityDir\n ? await linkInto(agentDir, options.identityDir, OWNED_AGENT_DIR_FILES)\n : [];\n\n const baseSettings =\n options.baseSettings ??\n (options.seedFrom ? await readSeededSettings(options.seedFrom) : undefined);\n\n const render = renderOmpRegistry(registry, { ...options, baseSettings });\n\n await fs.writeFile(path.join(agentDir, OMP_MODELS_FILENAME), render.modelsYml, \"utf-8\");\n await fs.writeFile(path.join(agentDir, OMP_CONFIG_FILENAME), render.configYml, \"utf-8\");\n\n return { ...render, agentDir, seeded, identity };\n}\n\n/** What the omp harness gets back from {@link materializeOmpProviders}. */\nexport interface OmpProviderMaterialization extends OmpAgentDirMaterialization {\n /**\n * The `--model` argument for this session: `<providerId>/<providerModelId>`,\n * the one selector form omp treats as unambiguous when several providers\n * carry the same model id. Absent when the session named no model.\n */\n modelArg?: string;\n}\n\n/**\n * The whole omp adapter for one session: decide the private agent directory,\n * inherit the developer's omp state where there is any, write `models.yml` and\n * `config.yml`, and report the credential environment and `--model` selector\n * the child needs.\n *\n * Returns `undefined` when the session carries no registry with a selectable\n * entry — the harness then behaves exactly as it did before the registry\n * existed, which is what keeps this an expand-and-contract change.\n *\n * Also returns `undefined` when the session names no model (no `--model`, no\n * `default` role) and the user's own omp default is served by the user's own\n * `models.yml`, which a private home does not carry (p1172): the registry would\n * only swap that default for whatever model omp finds first.\n *\n * Also returns `undefined` when no entry can be handed to omp (every\n * credential unresolved) or when the entry the session's model selects was\n * left out: a session-private agent directory would then start omp without the\n * user's own settings, and a model that only the user's own omp login can\n * serve would fail with `No API key found` although native omp answers. The\n * harness then starts omp on the user's agent directory, so \"omp falls back to\n * its own login\" is true.\n *\n * `env:` references resolve against the runner's environment *overlaid with*\n * `config.env`, so a credential the session boundary already resolved (a\n * `platform:` secret it turned into an env var, for instance) is found here\n * under the name the registry entry points at.\n */\nexport async function materializeOmpProviders(\n config: AgentConfig,\n): Promise<OmpProviderMaterialization | undefined> {\n const registry = config.registry;\n if (!registry) return undefined;\n const selectable = registryEntries(registry).some(\n ([, entry]) => (entry.kind === \"llm\" || entry.kind === \"embed\") && isEntryEnabled(entry),\n );\n if (!selectable) return undefined;\n\n const env = { ...process.env, ...config.env };\n const selected = config.modelRef\n ? parseModelRef(config.modelRef, registry, config.roles)\n : undefined;\n const usable = renderOmpRegistry(registry, {\n env,\n ...(config.roles ? { roles: config.roles } : {}),\n ...(config.modelRef ? { modelRef: config.modelRef } : {}),\n }).providerIds;\n if (usable.length === 0) return undefined;\n if (selected && !usable.includes(selected.providerId)) return undefined;\n\n const plan = await planOmpAgentDir({\n cwd: config.cwd,\n ...(config.sessionId ? { sessionId: config.sessionId } : {}),\n ...(config.harnessOptions?.omp ? { options: config.harnessOptions.omp } : {}),\n });\n\n if (!selected && !config.model && plan.seedFrom) {\n const named = renderOmpRegistry(registry, {\n env,\n ...(config.roles ? { roles: config.roles } : {}),\n }).modelRoles;\n if (named.default === undefined && (await ownDefaultNeedingOwnModels(plan.seedFrom, usable))) {\n if (plan.ephemeral) await fs.rm(plan.agentDir, { recursive: true, force: true });\n return undefined;\n }\n }\n\n const rendered = await removeHomeOnThrow(plan, () =>\n materializeOmpAgentDir(plan.agentDir, registry, {\n env,\n ...(plan.seedFrom ? { seedFrom: plan.seedFrom } : {}),\n ...(config.agentDir ? { identityDir: config.agentDir } : {}),\n ...(config.roles ? { roles: config.roles } : {}),\n ...(config.modelRef ? { modelRef: config.modelRef } : {}),\n }),\n );\n\n return {\n ...rendered,\n ephemeral: plan.ephemeral,\n ...(selected?.providerModelId\n ? { modelArg: `${selected.providerId}/${selected.providerModelId}` }\n : {}),\n };\n}\n\n/** What {@link materializeOmpIdentityDir} wrote. */\nexport interface OmpIdentityDirMaterialization {\n /** The directory `PI_CODING_AGENT_DIR` must point at. */\n agentDir: string;\n /** The directory is the harness's temporary home: remove it when the run ends. */\n ephemeral: boolean;\n /** Names linked in from the user's own omp agent directory. */\n seeded: string[];\n /** Names linked in from `AgentConfig.agentDir`. */\n identity: string[];\n}\n\n/**\n * The omp home of a session that has an agent directory but no provider registry.\n *\n * omp keeps its runtime state (`agent.db`, `models.db`, `skill-descriptions.db`, session\n * scratch, `intercom/`) in `PI_CODING_AGENT_DIR`. Pointing that at the agent directory itself\n * put those files beside `SOUL.md` in a pinned, shared source (`.skaile/cache/agents/<name>/`)\n * and made omp name a path inside the cache when it lacks a credential. So the home is a\n * private directory outside `cwd` (see {@link planOmpAgentDir}): the developer's own omp state\n * is linked in (their login keeps working), their `config.yml` / `models.yml` are copied (a\n * settings write cannot reach back), and the agent directory's entries are linked in last,\n * so the agent files stay where they are and omp can still read them.\n *\n * Returns `undefined` when the session has no `agentDir`.\n */\nexport async function materializeOmpIdentityDir(\n config: AgentConfig,\n): Promise<OmpIdentityDirMaterialization | undefined> {\n const identityDir = config.agentDir;\n if (!identityDir) return undefined;\n // Keyed by the agent and the workspace too: two role children of one session, each with\n // its own agent directory, must not link their entries into one home.\n const agentKey = createHash(\"sha256\")\n .update(`${path.resolve(identityDir)}\\0${path.resolve(config.cwd)}`)\n .digest(\"hex\")\n .slice(0, 12);\n const plan = await planOmpAgentDir({\n cwd: config.cwd,\n sessionId: `${config.sessionId?.trim() || \"agent\"}-${agentKey}`,\n ...(config.harnessOptions?.omp ? { options: config.harnessOptions.omp } : {}),\n });\n return removeHomeOnThrow(plan, async () => {\n await fs.mkdir(plan.agentDir, { recursive: true });\n const seeded = plan.seedFrom ? await linkLoginFiles(plan.agentDir, plan.seedFrom) : [];\n if (plan.seedFrom) {\n for (const name of Object.keys(OWNED_AGENT_DIR_FILES)) {\n const from = path.join(plan.seedFrom, name);\n try {\n if (!(await fs.stat(from)).isFile()) continue;\n } catch {\n continue;\n }\n const to = path.join(plan.agentDir, name);\n await removeEntry(to);\n await fs.copyFile(from, to);\n }\n }\n const identity = await linkInto(plan.agentDir, identityDir, {\n ...OWNED_AGENT_DIR_FILES,\n ...OMP_RUNTIME_ENTRIES,\n });\n return { agentDir: plan.agentDir, ephemeral: plan.ephemeral, seeded, identity };\n });\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { defaultLibraryDir } from './chunk-L4YKW5AY.js';
2
- import { factoryAssetRoots } from './chunk-OTIB4D2K.js';
1
+ import { defaultLibraryDir } from './chunk-VMVDAZLA.js';
2
+ import { factoryAssetRoots } from './chunk-ZDLUQLI6.js';
3
3
  import fs from 'fs';
4
4
  import path from 'path';
5
5
  import { fileURLToPath } from 'url';
@@ -19,5 +19,5 @@ var MONOREPO_ROOT = findMonorepoRoot(__ownDir);
19
19
  var AI_RESOURCES = factoryAssetRoots()[0] ?? defaultLibraryDir();
20
20
 
21
21
  export { AI_RESOURCES, MONOREPO_ROOT };
22
- //# sourceMappingURL=chunk-2UUKCROR.js.map
23
- //# sourceMappingURL=chunk-2UUKCROR.js.map
22
+ //# sourceMappingURL=chunk-AATHJRKL.js.map
23
+ //# sourceMappingURL=chunk-AATHJRKL.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../cli/src/paths.ts"],"names":[],"mappings":";;;;;;AAeA,IAAM,WAAW,IAAA,CAAK,OAAA,CAAQ,aAAA,CAAc,MAAA,CAAA,IAAA,CAAY,GAAG,CAAC,CAAA;AAW5D,SAAS,iBAAiB,IAAA,EAA6B;AACrD,EAAA,IAAI,GAAA,GAAM,IAAA;AACV,EAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,CAAA,EAAG,CAAA,EAAA,EAAK;AAC1B,IAAA,IAAI,EAAA,CAAG,WAAW,IAAA,CAAK,IAAA,CAAK,KAAK,YAAY,CAAC,GAAG,OAAO,GAAA;AACxD,IAAA,MAAM,MAAA,GAAS,IAAA,CAAK,OAAA,CAAQ,GAAG,CAAA;AAC/B,IAAA,IAAI,WAAW,GAAA,EAAK;AACpB,IAAA,GAAA,GAAM,MAAA;AAAA,EACR;AACA,EAAA,OAAO,IAAA;AACT;AAYO,IAAM,aAAA,GAA+B,iBAAiB,QAAQ;AAc9D,IAAM,YAAA,GAAuB,iBAAA,EAAkB,CAAE,CAAC,KAAK,iBAAA","file":"chunk-2UUKCROR.js","sourcesContent":["import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { defaultLibraryDir, factoryAssetRoots } from \"@skaile/workspaces/core\";\n\n/**\n * The content-root policy lives in `@skaile/workspaces/core` so the flow\n * connector's resolution surfaces can reach it too — `factory-assets → cli`\n * would be a module cycle. Re-exported here because this module is the CLI's\n * documented path surface and every CLI caller imports it from here.\n *\n * @docLink cli/dev-guide#paths\n */\nexport { aiResourceRoots } from \"@skaile/workspaces/core\";\n\nconst __ownDir = path.dirname(fileURLToPath(import.meta.url));\n\n/**\n * Walk up from `from` looking for the monorepo marker (`biome.json`, the\n * repo-root shared tooling config). Returns the matching directory or `null`\n * when none is found within eight levels — the latter is the typical case when\n * `@skaile/workspaces` has been installed via `npm i` without a skaile-dev\n * workspace context. Used only to gate dev-only commands (e.g.\n * `serve --compile-test`); first-party content is located via\n * {@link aiResourceRoots}, not this.\n */\nfunction findMonorepoRoot(from: string): string | null {\n let dir = from;\n for (let i = 0; i < 8; i++) {\n if (fs.existsSync(path.join(dir, \"biome.json\"))) return dir;\n const parent = path.dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n return null;\n}\n\n/**\n * Absolute path to the monorepo root, or `null` when the CLI is running\n * outside the skaile-dev workspace (typical for `npm i -g` installs).\n *\n * Consumers that only make sense inside the workspace (e.g.\n * `skaile serve --compile-test`) MUST check for `null` and report a\n * \"monorepo-only feature\" error before proceeding.\n *\n * @docLink cli/dev-guide#paths\n */\nexport const MONOREPO_ROOT: string | null = findMonorepoRoot(__ownDir);\n\n/**\n * Default content root used by path display and the `validate` command.\n *\n * The primary first-party `factory-assets/` root resolved through the shared\n * `factoryAssetRoots()` helper — the `SKAILE_FACTORY_ASSETS_DIR` override when\n * set, else the in-repo source during dev / bundled `dist/factory-assets/` after\n * `npm i`. Falls back to `$SKAILE_HOME/libraries/` (`~/.skaile/libraries/`) — the user-library directory\n * managed by `skaile library add` — when the package cannot be located.\n * Consumers `fs.existsSync` first and degrade to \"no skills / flows discovered\".\n *\n * @docLink cli/dev-guide#paths\n */\nexport const AI_RESOURCES: string = factoryAssetRoots()[0] ?? defaultLibraryDir();\n"]}
1
+ {"version":3,"sources":["../cli/src/paths.ts"],"names":[],"mappings":";;;;;;AAeA,IAAM,WAAW,IAAA,CAAK,OAAA,CAAQ,aAAA,CAAc,MAAA,CAAA,IAAA,CAAY,GAAG,CAAC,CAAA;AAW5D,SAAS,iBAAiB,IAAA,EAA6B;AACrD,EAAA,IAAI,GAAA,GAAM,IAAA;AACV,EAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,CAAA,EAAG,CAAA,EAAA,EAAK;AAC1B,IAAA,IAAI,EAAA,CAAG,WAAW,IAAA,CAAK,IAAA,CAAK,KAAK,YAAY,CAAC,GAAG,OAAO,GAAA;AACxD,IAAA,MAAM,MAAA,GAAS,IAAA,CAAK,OAAA,CAAQ,GAAG,CAAA;AAC/B,IAAA,IAAI,WAAW,GAAA,EAAK;AACpB,IAAA,GAAA,GAAM,MAAA;AAAA,EACR;AACA,EAAA,OAAO,IAAA;AACT;AAYO,IAAM,aAAA,GAA+B,iBAAiB,QAAQ;AAc9D,IAAM,YAAA,GAAuB,iBAAA,EAAkB,CAAE,CAAC,KAAK,iBAAA","file":"chunk-AATHJRKL.js","sourcesContent":["import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { defaultLibraryDir, factoryAssetRoots } from \"@skaile/workspaces/core\";\n\n/**\n * The content-root policy lives in `@skaile/workspaces/core` so the flow\n * connector's resolution surfaces can reach it too — `factory-assets → cli`\n * would be a module cycle. Re-exported here because this module is the CLI's\n * documented path surface and every CLI caller imports it from here.\n *\n * @docLink cli/dev-guide#paths\n */\nexport { aiResourceRoots } from \"@skaile/workspaces/core\";\n\nconst __ownDir = path.dirname(fileURLToPath(import.meta.url));\n\n/**\n * Walk up from `from` looking for the monorepo marker (`biome.json`, the\n * repo-root shared tooling config). Returns the matching directory or `null`\n * when none is found within eight levels — the latter is the typical case when\n * `@skaile/workspaces` has been installed via `npm i` without a skaile-dev\n * workspace context. Used only to gate dev-only commands (e.g.\n * `serve --compile-test`); first-party content is located via\n * {@link aiResourceRoots}, not this.\n */\nfunction findMonorepoRoot(from: string): string | null {\n let dir = from;\n for (let i = 0; i < 8; i++) {\n if (fs.existsSync(path.join(dir, \"biome.json\"))) return dir;\n const parent = path.dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n return null;\n}\n\n/**\n * Absolute path to the monorepo root, or `null` when the CLI is running\n * outside the skaile-dev workspace (typical for `npm i -g` installs).\n *\n * Consumers that only make sense inside the workspace (e.g.\n * `skaile serve --compile-test`) MUST check for `null` and report a\n * \"monorepo-only feature\" error before proceeding.\n *\n * @docLink cli/dev-guide#paths\n */\nexport const MONOREPO_ROOT: string | null = findMonorepoRoot(__ownDir);\n\n/**\n * Default content root used by path display and the `validate` command.\n *\n * The primary first-party `factory-assets/` root resolved through the shared\n * `factoryAssetRoots()` helper — the `SKAILE_FACTORY_ASSETS_DIR` override when\n * set, else the in-repo source during dev / bundled `dist/factory-assets/` after\n * `npm i`. Falls back to `$SKAILE_HOME/libraries/` (`~/.skaile/libraries/`) — the user-library directory\n * managed by `skaile library add` — when the package cannot be located.\n * Consumers `fs.existsSync` first and degrade to \"no skills / flows discovered\".\n *\n * @docLink cli/dev-guide#paths\n */\nexport const AI_RESOURCES: string = factoryAssetRoots()[0] ?? defaultLibraryDir();\n"]}
@@ -1,5 +1,5 @@
1
1
  import { normalizeAnthropicModel, ANTHROPIC_MODEL_ALIASES } from './chunk-E572OHGY.js';
2
- import { buildAgentPromptSections } from './chunk-L4YKW5AY.js';
2
+ import { buildAgentPromptSections } from './chunk-VMVDAZLA.js';
3
3
  import { existsSync, readFileSync, mkdirSync, writeFileSync, lstatSync, unlinkSync, readdirSync } from 'fs';
4
4
  import { join, dirname, relative, resolve, normalize, basename } from 'path';
5
5
  import { stringify } from 'yaml';
@@ -316,5 +316,5 @@ function harnessTargetSupportsAgents(harnessTarget) {
316
316
  }
317
317
 
318
318
  export { AGENT_RENDERERS, CODEX_IDENTITY_DIR, claudeCodeRenderer, codexRenderer, harnessTargetSupportsAgents, ompRenderer, renderAgentToFramework };
319
- //# sourceMappingURL=chunk-DUMTLYSO.js.map
320
- //# sourceMappingURL=chunk-DUMTLYSO.js.map
319
+ //# sourceMappingURL=chunk-ABFPSVIS.js.map
320
+ //# sourceMappingURL=chunk-ABFPSVIS.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../asset-manager/src/renderers.ts"],"names":["stringifyYaml"],"mappings":";;;;;;AA4GA,SAAS,YAAY,IAAA,EAAoB;AACvC,EAAA,IAAI;AACF,IAAA,IAAI,UAAU,IAAI,CAAA,CAAE,cAAA,EAAe,aAAc,IAAI,CAAA;AAAA,EACvD,CAAA,CAAA,MAAQ;AAAA,EAER;AACF;AAQA,SAAS,UAAA,CACP,QAAA,EACA,OAAA,EACA,aAAA,EACA,SACA,OAAA,EACM;AACN,EAAA,MAAM,GAAA,GAAM,QAAA,CAAS,aAAA,EAAe,QAAQ,CAAA;AAC5C,EAAA,OAAA,CAAQ,KAAK,GAAG,CAAA;AAChB,EAAA,WAAA,CAAY,QAAQ,CAAA;AACpB,EAAA,IAAI,UAAA,CAAW,QAAQ,CAAA,EAAG;AACxB,IAAA,IAAI;AACF,MAAA,IAAI,YAAA,CAAa,QAAA,EAAU,OAAO,CAAA,KAAM,OAAA,EAAS;AAAA,IACnD,CAAA,CAAA,MAAQ;AAAA,IAER;AAAA,EACF;AACA,EAAA,SAAA,CAAU,QAAQ,QAAQ,CAAA,EAAG,EAAE,SAAA,EAAW,MAAM,CAAA;AAChD,EAAA,aAAA,CAAc,QAAA,EAAU,SAAS,OAAO,CAAA;AACxC,EAAA,OAAA,CAAQ,KAAK,GAAG,CAAA;AAClB;AAeA,SAAS,kBACP,IAAA,EACA,KAAA,EACA,Q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EAAQA,SAAA,CAAc,WAAW,CAAA,CAAE,IAAA,EAAM;AAAA;;AAAA,EAAY,YAAY,CAAA,CAAA;AAAA,IACjE,aAAA;AAAA,IACA,OAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,OAAA,CAAQ,IAAA,CAAK,QAAA,CAAS,aAAA,EAAe,OAAO,CAAC,CAAA;AAC7C,EAAA,OAAO,EAAE,OAAA,EAAS,OAAA,EAAS,QAAA,EAAS;AACtC;AAKA,IAAM,OAAY,MAAM;AAAC,CAAA;AAalB,SAAS,sBAAA,CACd,KAAA,EACA,aAAA,EACA,GAAA,GAAW,IAAA,EACQ;AACnB,EAAA,MAAM,QAAA,GAAW,gBAAgB,aAAa,CAAA;AAC9C,EAAA,IAAI,CAAC,QAAA,EAAU;AACb,IAAA,OAAO;AAAA,MACL,SAAS,EAAC;AAAA,MACV,SAAS,EAAC;AAAA,MACV,QAAA,EAAU,CAAC,CAAA,2BAAA,EAA8B,aAAa,CAAA,CAAA,CAAG;AAAA,KAC3D;AAAA,EACF;AACA,EAAA,MAAM,MAAA,GAAS,SAAS,KAAK,CAAA;AAC7B,EAAA,KAAA,MAAW,KAAK,MAAA,CAAO,OAAA,EAAS,GAAA,CAAI,CAAA,kBAAA,EAAqB,CAAC,CAAA,CAAE,CAAA;AAC5D,EAAA,KAAA,MAAW,KAAK,MAAA,CAAO,QAAA,EAAU,GAAA,CAAI,CAAA,QAAA,EAAW,CAAC,CAAA,CAAE,CAAA;AACnD,EAAA,OAAO,MAAA;AACT;AAUO,IAAM,eAAA,GAAiD;AAAA,EAC5D,aAAA,EAAe,kBAAA;AAAA,EACf,GAAA,EAAK,WAAA;AAAA,EACL,KAAA,EAAO;AACT;AASO,SAAS,4BAA4B,aAAA,EAAgC;AAC1E,EAAA,OAAO,aAAA,IAAiB,eAAA;AAC1B","file":"chunk-DUMTLYSO.js","sourcesContent":["/**\n * Framework-specific renderers for GitAgent packages.\n *\n * Each renderer transforms a parsed GitAgent package (agent.yaml + SOUL.md + RULES.md)\n * into the native file format that the target agent framework natively reads.\n *\n * Only harnesses with a full bridge harness (runtime execution) are included:\n * claude-code → .claude/agents/<name>.md (YAML frontmatter + markdown body)\n * omp → .omp/agents/<name>/ (directory with agent.yaml + SOUL.md)\n * codex → .codex/agents/<name>.toml (TOML)\n *\n * Removed (no bridge harness): cursor, roo, github-copilot, gemini, amp.\n * Add them back when a bridge harness is implemented.\n */\n\nimport {\n existsSync,\n lstatSync,\n mkdirSync,\n readdirSync,\n readFileSync,\n unlinkSync,\n writeFileSync,\n} from \"node:fs\";\nimport { basename, dirname, join, normalize, relative, resolve } from \"node:path\";\nimport { buildAgentPromptSections } from \"@skaile/workspaces/core\";\nimport {\n ANTHROPIC_MODEL_ALIASES,\n type AgentLifecycle,\n type AgentManifest,\n normalizeAnthropicModel,\n} from \"@skaile/workspaces/types/manifests\";\nimport { stringify as stringifyYaml } from \"yaml\";\nimport type { AbilityRef, ContractRef } from \"./fragments.js\";\n\n// ── Types ─────────────────────────────────��───────────────────────────────────\n\nexport type { AgentManifest };\n\n/**\n * All data an {@link AgentRenderer} needs to produce a native agent definition file.\n *\n * @docLink packages/asset-manager/api-reference#renderers\n */\nexport interface AgentRenderInput {\n /** Parsed `agent.yaml` manifest for the GitAgent being rendered. */\n manifest: AgentManifest;\n /** Raw content of `SOUL.md`, or `null` if absent. */\n soul: string | null;\n /** Raw content of `RULES.md`, or `null` if absent. */\n rules: string | null;\n /** Raw content of `DUTIES.md`, or `null` if absent. */\n duties: string | null;\n /** Agent name used as the output filename and frontmatter `name` field. */\n agentName: string;\n /** Resolved absolute path to the framework's agent deploy directory (e.g. `.claude/agents/`). */\n agentDeployDir: string;\n /** Absolute path to the workspace root. */\n workspaceRoot: string;\n /** Resolved ability refs — installed skills referenced in the `## Installed Abilities` section. */\n abilityRefs: AbilityRef[];\n /** Resolved contract refs — installed in the skills dir, listed in the `## Contracts` section. */\n contractRefs: ContractRef[];\n /** Resolved framework fragment markdown blocks (agent-mode, handoff, skill-discovery, etc.). */\n frameworkFragments: string[];\n /** Per-project prompt extension markdown blocks loaded from `skaile.yaml` `agent.prompt-extensions`. */\n promptExtensions: string[];\n /** `standing` (long-running identity) or `role` (short-lived, callable). */\n lifecycle: AgentLifecycle;\n /** Names of the skills the agent composes (`composes[{kind: skill}]`), as installed. */\n skills: string[];\n /** Names of the MCP servers the agent's `mcp-server` slots are bound to. */\n mcpServers: string[];\n /**\n * Absolute path of the agent's source directory (where `agent.yaml` lives). The omp renderer\n * copies the local `composes` directories out of it.\n */\n srcDir?: string;\n}\n\n/**\n * Result returned by every {@link AgentRenderer}.\n *\n * @docLink packages/asset-manager/api-reference#renderers\n */\nexport interface AgentRenderResult {\n /** Paths to files/dirs rendered, relative to `workspaceRoot`. */\n created: string[];\n /** The subset of `created` whose bytes differ from what was on disk before (new or edited); an identical rewrite is skipped. */\n changed: string[];\n /** Non-fatal warnings (e.g. experimental feature notices). */\n warnings: string[];\n}\n\n/**\n * A function that transforms an {@link AgentRenderInput} into framework-native agent definition files.\n *\n * @docLink packages/asset-manager/api-reference#renderers\n */\nexport type AgentRenderer = (input: AgentRenderInput) => AgentRenderResult;\n\n// ── Helpers ───────────────────────────────────────────────────────────────────\n\n/**\n * Unlink a symlink (dangling or not) at a path skaile is about to write. `writeFileSync` follows\n * a link, so the write would land in the file the link points at: the user's own file, outside\n * the project (p1060). The link is replaced by the rendered file instead.\n */\nfunction dropSymlink(path: string): void {\n try {\n if (lstatSync(path).isSymbolicLink()) unlinkSync(path);\n } catch {\n // nothing at the path: the write creates it\n }\n}\n\n/**\n * Write an agent definition file. Agents are compiled artifacts — they must\n * reflect the current canonical source — but a file that already holds exactly\n * these bytes is left untouched (mtime included), so a repeat install is a no-op.\n * `created` lists every rendered path; `changed` only those that were (re)written.\n */\nfunction writeAgent(\n filePath: string,\n content: string,\n workspaceRoot: string,\n created: string[],\n changed: string[],\n): void {\n const rel = relative(workspaceRoot, filePath);\n created.push(rel);\n dropSymlink(filePath);\n if (existsSync(filePath)) {\n try {\n if (readFileSync(filePath, \"utf-8\") === content) return;\n } catch {\n // unreadable (e.g. a directory in the way): fall through to the write\n }\n }\n mkdirSync(dirname(filePath), { recursive: true });\n writeFileSync(filePath, content, \"utf-8\");\n changed.push(rel);\n}\n\n/**\n * Build the full agent system prompt body baked into the framework-native agent file.\n *\n * This is the sole source of the agent's system prompt body. Agent identity is rendered at install time; the harness reads it natively at runtime.\n * The rendered output ends up in .claude/agents/<name>.md, .omp/agents/<name>/SOUL.md,\n * .codex/agents/<name>.toml and is read natively by the framework on every agent invocation.\n *\n * Section order is owned by the shared builder (`buildAgentPromptSections` in\n * core, the same one the runner assembles its system prompt with):\n * soul → `<MEMORY>` → framework fragments → `## Constraints` (RULES) →\n * `## Duties` → `## Installed Abilities` → `## Contracts` → composed inline\n * blocks → prompt extensions.\n */\nfunction buildMarkdownBody(\n soul: string | null,\n rules: string | null,\n duties: string | null,\n abilityRefs: AbilityRef[],\n contractRefs: ContractRef[],\n frameworkFragments: string[],\n promptExtensions: string[],\n): string {\n const sections = buildAgentPromptSections({\n soul,\n constraints: rules,\n duties,\n abilities: abilityRefs,\n contracts: contractRefs,\n frameworkFragments,\n promptExtensions,\n });\n return `${sections.map((s) => s.text).join(\"\\n\\n\")}\\n`;\n}\n\n/** Escape a string for use as a TOML multi-line basic string (triple-quote). */\nfunction toTomlMultilineString(s: string): string {\n // Replace \"\"\" with \\\\\"\"\" to avoid breaking the TOML literal\n return s.replace(/\"\"\"/g, '\\\\\"\\\\\"\\\\\"');\n}\n\n/**\n * The manifest's `model` as a harness other than Claude Code can take it: the Claude Code\n * aliases (`inherit`, `opus`, `sonnet`, `haiku`) name no model of another harness' provider, so a\n * `preferred` that is one of them is dropped (the harness starts the agent on its own default) and\n * so is a `fallback` entry that is. Any other selector (`provider/model`, a full id, `@role`) is\n * the author's choice and is passed through. `undefined` when nothing is left.\n */\nfunction harnessModel(model: AgentManifest[\"model\"]): AgentManifest[\"model\"] | undefined {\n if (!model) return undefined;\n const claudeOnly = (m: string): boolean =>\n (ANTHROPIC_MODEL_ALIASES as readonly string[]).includes(m);\n const { preferred, fallback, ...rest } = model;\n const kept: NonNullable<AgentManifest[\"model\"]> = { ...rest };\n if (preferred && !claudeOnly(preferred)) kept.preferred = preferred;\n const fallbacks = (fallback ?? []).filter((m) => !claudeOnly(m));\n if (fallbacks.length > 0) kept.fallback = fallbacks;\n return Object.keys(kept).length > 0 ? kept : undefined;\n}\n\n/** Directory entries that are never part of an asset (build and OS leftovers). */\nconst COPY_SKIP = new Set([\".git\", \".DS_Store\", \"node_modules\", \"__pycache__\"]);\n\n/** Copy a file or directory tree byte for byte; a file that already holds these bytes is left alone. */\nfunction copyTree(from: string, to: string, workspaceRoot: string, changed: string[]): void {\n const stat = lstatSync(from);\n if (stat.isSymbolicLink()) return;\n if (stat.isDirectory()) {\n for (const name of readdirSync(from)) {\n if (COPY_SKIP.has(name) || name.endsWith(\".pyc\")) continue;\n copyTree(join(from, name), join(to, name), workspaceRoot, changed);\n }\n return;\n }\n if (!stat.isFile()) return;\n const bytes = readFileSync(from);\n dropSymlink(to);\n if (existsSync(to)) {\n try {\n if (bytes.equals(readFileSync(to))) return;\n } catch {\n // unreadable (e.g. a directory in the way): fall through to the write\n }\n }\n mkdirSync(dirname(to), { recursive: true });\n writeFileSync(to, bytes);\n changed.push(relative(workspaceRoot, to));\n}\n\n/**\n * Make the `composes` of an omp `agent.yaml` resolvable from where it is written: every local ref\n * (`./rules-local/house-rules`) is copied next to the `agent.yaml`, at the path the ref names, and a\n * local ref that climbs out of the agent directory (`../shared/rules`) is copied to\n * `composes/<name>` and rewritten to that path. Catalog refs (`skill:@pub/name`) are kept as written.\n */\nfunction bundleLocalComposes(\n composes: NonNullable<AgentManifest[\"composes\"]>,\n srcDir: string | undefined,\n destDir: string,\n workspaceRoot: string,\n changed: string[],\n warnings: string[],\n): NonNullable<AgentManifest[\"composes\"]> {\n if (!srcDir) return composes;\n return composes.map((item) => {\n if (!item.ref.startsWith(\"./\") && !item.ref.startsWith(\"../\")) return item;\n const from = resolve(srcDir, item.ref);\n if (!existsSync(from)) {\n warnings.push(`compose ref ${item.ref} not found at ${from}: not copied into ${destDir}`);\n return item;\n }\n const rel = normalize(item.ref);\n const inside = !rel.startsWith(\"..\");\n const target = inside ? rel : join(\"composes\", basename(from));\n copyTree(from, join(destDir, target), workspaceRoot, changed);\n return inside ? item : { ...item, ref: `./${target}` };\n });\n}\n\n// ── Claude Code ────────────��──────────────────────────────────────────────────\n// Format: .claude/agents/<name>.md\n// Sub-agent support: automatic (description-based) + @-mention\n// Required frontmatter: name, description\n//\n// Installation → runtime handoff:\n// skaile install (claudeCodeRenderer) creates the .md file from GitAgent source\n// ClaudeSdkHarness.startQuery() passes options.agent = agentName to the SDK query\n// The SDK reads .claude/agents/<agentName>.md to get model, tools, and system prompt\n// This is equivalent to running: claude --agent <agentName>\n\n/**\n * Render a GitAgent to Claude Code's `.claude/agents/<name>.md` format.\n *\n * Writes YAML frontmatter (name, description, model, tools, skills, mcpServers,\n * maxTurns, background) followed by the enriched system prompt body. `skills`\n * lists the composed skills, `mcpServers` the MCP servers the agent's\n * `mcp-server` slots are bound to, and `background: true` marks a `role`\n * instance whose `runtime.background` is set. Always overwrites to reflect\n * current source.\n *\n * @docLink packages/asset-manager/api-reference#renderers\n */\nexport const claudeCodeRenderer: AgentRenderer = ({\n manifest,\n soul,\n rules,\n duties,\n agentName,\n agentDeployDir,\n workspaceRoot,\n abilityRefs,\n contractRefs,\n frameworkFragments,\n promptExtensions,\n lifecycle,\n skills,\n mcpServers,\n}) => {\n const created: string[] = [];\n const changed: string[] = [];\n const warnings: string[] = [];\n\n const frontmatter: Record<string, unknown> = {\n name: agentName,\n description: manifest.description ?? `${agentName} agent`,\n };\n\n // Model: map to Claude Code's model field. Accepts aliases (sonnet/opus/haiku/inherit)\n // or a full Anthropic ID. Unrecognized values (e.g. legacy `claude-opus-4`) are\n // coerced to the matching family alias so the agent still loads.\n if (manifest.model?.preferred) {\n const raw = manifest.model.preferred;\n const normalized = normalizeAnthropicModel(raw);\n if (normalized !== raw) {\n warnings.push(\n `agent ${agentName}: model \"${raw}\" is not a valid Claude model ID; normalized to alias \"${normalized}\". Update agent.yaml.`,\n );\n }\n frontmatter.model = normalized;\n }\n\n // Tool restrictions\n if (manifest.tools?.allowed?.length) {\n frontmatter.tools = manifest.tools.allowed.join(\", \");\n }\n if (manifest.tools?.denied?.length) {\n frontmatter.disallowedTools = manifest.tools.denied.join(\", \");\n }\n\n if (skills.length > 0) frontmatter.skills = skills;\n if (mcpServers.length > 0) frontmatter.mcpServers = mcpServers;\n\n // Runtime\n if (manifest.runtime?.max_turns) {\n frontmatter.maxTurns = manifest.runtime.max_turns;\n }\n if (lifecycle === \"role\" && manifest.runtime?.background === true) {\n frontmatter.background = true;\n }\n\n // Metadata pass-through for Claude Code-specific fields\n if (manifest.metadata?.color) frontmatter.color = manifest.metadata.color;\n if (manifest.metadata?.effort) frontmatter.effort = manifest.metadata.effort;\n if (manifest.metadata?.isolation) frontmatter.isolation = manifest.metadata.isolation;\n\n const body = buildMarkdownBody(\n soul,\n rules,\n duties,\n abilityRefs,\n contractRefs,\n frameworkFragments,\n promptExtensions,\n );\n const content = `---\\n${stringifyYaml(frontmatter).trim()}\\n---\\n\\n${body}`;\n const filePath = join(agentDeployDir, `${agentName}.md`);\n writeAgent(filePath, content, workspaceRoot, created, changed);\n\n return { created, changed, warnings };\n};\n\n// ── OpenAI Codex ──────────────────────────────────────────────────────────────\n// Format: .codex/agents/<name>.toml\n// Sub-agent support: explicit user request only (not automatic)\n// Required fields: name, description, developer_instructions\n\n/**\n * Tools that change the workspace or run commands. Codex has no per-agent tool\n * allowlist; the closest per-agent control is `sandbox_mode`, so an agent whose\n * declared tool surface contains none of these is rendered `read-only`.\n */\nconst MUTATING_TOOLS = [\"Write\", \"Edit\", \"MultiEdit\", \"NotebookEdit\", \"Bash\"] as const;\n\n/** `read-only` when the manifest's tool surface cannot mutate anything, else `undefined` (inherit). */\nfunction codexSandboxMode(tools: AgentManifest[\"tools\"]): \"read-only\" | undefined {\n const allowed = tools?.allowed ?? [];\n const denied = new Set(tools?.denied ?? []);\n if (allowed.length > 0) {\n return allowed.some((t) => !denied.has(t) && (MUTATING_TOOLS as readonly string[]).includes(t))\n ? undefined\n : \"read-only\";\n }\n // No allowlist: everything not denied is available.\n return MUTATING_TOOLS.every((t) => denied.has(t)) ? \"read-only\" : undefined;\n}\n\n/** Directory (next to `agents/`) holding each Codex agent's markdown identity, one file per agent. */\nexport const CODEX_IDENTITY_DIR = \"skaile-agents\";\n\n/**\n * Render a GitAgent to OpenAI Codex's `.codex/agents/<name>.toml` format.\n *\n * Produces a TOML file with `name`, `description`, `model`, `sandbox_mode` and\n * `developer_instructions`. `sandbox_mode = \"read-only\"` is the per-agent tool\n * restriction: it is emitted when the manifest's `tools` leave the agent no way\n * to write or run commands (Codex has no per-tool allowlist). Triple-quoted\n * TOML multi-line strings are escaped to avoid syntax errors.\n *\n * Also writes the agent's identity as `.codex/skaile-agents/<name>.md`, which\n * the Codex harness combines with the session's runtime prompt (one file per\n * agent, so several instances never overwrite each other).\n *\n * @docLink packages/asset-manager/api-reference#renderers\n */\nexport const codexRenderer: AgentRenderer = ({\n manifest,\n soul,\n rules,\n duties,\n agentName,\n agentDeployDir,\n workspaceRoot,\n abilityRefs,\n contractRefs,\n frameworkFragments,\n promptExtensions,\n}) => {\n const created: string[] = [];\n const changed: string[] = [];\n const warnings: string[] = [];\n\n const instructions = buildMarkdownBody(\n soul,\n rules,\n duties,\n abilityRefs,\n contractRefs,\n frameworkFragments,\n promptExtensions,\n );\n const escaped = toTomlMultilineString(instructions);\n\n const lines: string[] = [\n `name = ${JSON.stringify(agentName)}`,\n `description = ${JSON.stringify(manifest.description ?? `${agentName} agent`)}`,\n ];\n // A Claude Code alias (`sonnet`) names no Codex model: leave `model` out and Codex uses its own.\n const model = harnessModel(manifest.model)?.preferred;\n if (model) lines.push(`model = ${JSON.stringify(model)}`);\n const sandboxMode = codexSandboxMode(manifest.tools);\n if (sandboxMode) lines.push(`sandbox_mode = ${JSON.stringify(sandboxMode)}`);\n lines.push(`developer_instructions = \"\"\"`, escaped.trim(), `\"\"\"`);\n\n const content = `${lines.join(\"\\n\")}\\n`;\n const filePath = join(agentDeployDir, `${agentName}.toml`);\n writeAgent(filePath, content, workspaceRoot, created, changed);\n\n // Write the full agent identity as markdown for the Codex harness to read at runtime.\n // The harness combines this with the session's dynamic content (resources, context)\n // and passes the result via model_instructions_file.\n const agentMdPath = join(dirname(agentDeployDir), CODEX_IDENTITY_DIR, `${agentName}.md`);\n writeAgent(agentMdPath, instructions, workspaceRoot, created, changed);\n\n return { created, changed, warnings };\n};\n\n// ── oh-my-pi ─��────────────��────────────────────────────────��─────────────────\n// Format: .omp/agents/<name>/ (directory with agent.yaml + SOUL.md + RULES.md)\n// oh-my-pi reads GitAgent directories natively via PI_CODING_AGENT_DIR.\n// The renderer copies/enriches the source directory rather than flattening to .md.\n//\n// Installation → runtime handoff:\n// skaile install (ompRenderer) creates .omp/agents/<name>/ from GitAgent source\n// OmpHarness._start() sets env.PI_CODING_AGENT_DIR = agentDir in the child process\n// omp reads SOUL.md/RULES.md/knowledge/ from that directory natively on startup\n//\n// Note: REPL mode can bypass the install step — agentDir can point directly to the\n// GitAgent source directory, and omp will read it natively via PI_CODING_AGENT_DIR.\n// The rendered .omp/agents/ copy is only needed when the source is not accessible\n// from the project cwd (e.g. different repo, remote workspace).\n\n/**\n * Render a GitAgent to oh-my-pi's `.omp/agents/<name>/` directory format.\n *\n * Writes `agent.yaml` (resolved model/tools/delegation plus the 0.2\n * declaration — `composes` verbatim, `lifecycle`, `io`, `memory`, `triggers`,\n * `capabilities`) and an enriched `SOUL.md` that includes fragments and\n * extensions. omp reads this directory natively via the `PI_CODING_AGENT_DIR`\n * environment variable.\n *\n * @docLink packages/asset-manager/api-reference#renderers\n */\nexport const ompRenderer: AgentRenderer = ({\n manifest,\n soul,\n rules,\n duties,\n agentName,\n agentDeployDir,\n workspaceRoot,\n abilityRefs,\n contractRefs,\n frameworkFragments,\n promptExtensions,\n lifecycle,\n srcDir,\n}) => {\n const created: string[] = [];\n const changed: string[] = [];\n const warnings: string[] = [];\n\n const destDir = join(agentDeployDir, agentName);\n\n // Write agent.yaml with tools resolved\n const agentYaml: Record<string, unknown> = {\n spec_version: manifest.spec_version ?? \"0.2\",\n name: agentName,\n version: manifest.version ?? \"1.0.0\",\n description: manifest.description ?? `${agentName} agent`,\n lifecycle,\n };\n // The model: omp takes provider-prefixed full IDs and `@role` selectors, and resolves the\n // family aliases it knows (verified live 2026-09-20 against omp v18.1.10 through\n // teamclaude.postxl.com: `--model anthropic/opus` produced\n // `model_change {\"model\":\"anthropic/claude-opus-5\",\"resolvedModelIsFallback\":false}`).\n // The Claude Code aliases the manifest writes (`sonnet`, `haiku`, `opus`, `inherit`) name no\n // model of an omp deployment on another provider, so they are left out and omp starts the agent\n // on its own default. Any other selector is passed through verbatim: it is not checked here, and\n // not coerced by `normalizeAnthropicModel`, which would substitute a different model on any\n // provider but Anthropic (see `resolveManifestModel` in `@skaile/workspaces/bridge`).\n const model = harnessModel(manifest.model);\n if (model) agentYaml.model = model;\n if (manifest.tools) agentYaml.tools = manifest.tools;\n if (manifest.delegation) agentYaml.delegation = manifest.delegation;\n if (manifest.runtime) agentYaml.runtime = manifest.runtime;\n if (manifest.io) agentYaml.io = manifest.io;\n if (manifest.memory) agentYaml.memory = manifest.memory;\n if (manifest.triggers?.length) agentYaml.triggers = manifest.triggers;\n if (manifest.capabilities?.length) agentYaml.capabilities = manifest.capabilities;\n if (manifest.composes?.length) {\n agentYaml.composes = bundleLocalComposes(\n manifest.composes,\n srcDir,\n destDir,\n workspaceRoot,\n changed,\n warnings,\n );\n }\n if (manifest.tags?.length) agentYaml.tags = manifest.tags;\n if (manifest.metadata) agentYaml.metadata = manifest.metadata;\n\n writeAgent(join(destDir, \"agent.yaml\"), stringifyYaml(agentYaml), workspaceRoot, [], changed);\n\n // Write SOUL.md (enriched with fragments and extensions, like other renderers)\n const enrichedSoul = buildMarkdownBody(\n soul,\n rules,\n duties,\n abilityRefs,\n contractRefs,\n frameworkFragments,\n promptExtensions,\n );\n writeAgent(join(destDir, \"SOUL.md\"), enrichedSoul, workspaceRoot, [], changed);\n\n // omp lists the agents it can spawn from flat `.omp/agents/<name>.md` files only (verified live\n // against omp 18.12.5: a `<name>/agent.yaml` directory is not listed, a flat file is), so the\n // directory above carries the full GitAgent package and this file is what omp loads.\n const frontmatter: Record<string, unknown> = {\n name: agentName,\n description: manifest.description ?? `${agentName} agent`,\n };\n if (manifest.tools?.allowed?.length) frontmatter.tools = manifest.tools.allowed.join(\", \");\n const selector = model?.preferred;\n if (selector) frontmatter.model = selector;\n writeAgent(\n join(agentDeployDir, `${agentName}.md`),\n `---\\n${stringifyYaml(frontmatter).trim()}\\n---\\n\\n${enrichedSoul}`,\n workspaceRoot,\n created,\n changed,\n );\n\n created.push(relative(workspaceRoot, destDir));\n return { created, changed, warnings };\n};\n\n// ── Renderer registry ──────────────────────────────���──────────────────────────\n\nexport type Log = (msg: string) => void;\nconst noop: Log = () => {};\n\n/**\n * Render an agent to framework-native format via the renderer registry.\n *\n * Shared by both the simple deploy path (`deployAsset`) and the enriched scaffold path (agents layer).\n *\n * @param input - Full render input including manifest, SOUL/RULES text, and resolved refs.\n * @param harnessTarget - Agent framework ID to look up in {@link AGENT_RENDERERS}.\n * @param log - Optional logger callback for progress messages.\n * @returns Object with `created` file paths and `warnings` list.\n * @docLink packages/asset-manager/api-reference#renderers\n */\nexport function renderAgentToFramework(\n input: AgentRenderInput,\n harnessTarget: string,\n log: Log = noop,\n): AgentRenderResult {\n const renderer = AGENT_RENDERERS[harnessTarget];\n if (!renderer) {\n return {\n created: [],\n changed: [],\n warnings: [`No renderer for framework \"${harnessTarget}\"`],\n };\n }\n const result = renderer(input);\n for (const c of result.created) log(` rendered agent: ${c}`);\n for (const w of result.warnings) log(` warn: ${w}`);\n return result;\n}\n\n/**\n * Registry mapping framework IDs to their {@link AgentRenderer} functions.\n *\n * Only harnesses with a full bridge harness are registered. Add new entries\n * when a bridge harness is implemented in `workspaces/bridge/src/harnesses/`.\n *\n * @docLink packages/asset-manager/api-reference#renderers\n */\nexport const AGENT_RENDERERS: Record<string, AgentRenderer> = {\n \"claude-code\": claudeCodeRenderer,\n omp: ompRenderer,\n codex: codexRenderer,\n};\n\n/**\n * Returns `true` if the given harness target supports file-based sub-agent installation.\n *\n * @param harnessTarget - Agent framework ID to check.\n * @returns `true` when `harnessTarget` has a registered entry in {@link AGENT_RENDERERS}.\n * @docLink packages/asset-manager/api-reference#renderers\n */\nexport function harnessTargetSupportsAgents(harnessTarget: string): boolean {\n return harnessTarget in AGENT_RENDERERS;\n}\n"]}
1
+ {"version":3,"sources":["../asset-manager/src/renderers.ts"],"names":["stringifyYaml"],"mappings":";;;;;;AA4GA,SAAS,YAAY,IAAA,EAAoB;AACvC,EAAA,IAAI;AACF,IAAA,IAAI,UAAU,IAAI,CAAA,CAAE,cAAA,EAAe,aAAc,IAAI,CAAA;AAAA,EACvD,CAAA,CAAA,MAAQ;AAAA,EAER;AACF;AAQA,SAAS,UAAA,CACP,QAAA,EACA,OAAA,EACA,aAAA,EACA,SACA,OAAA,EACM;AACN,EAAA,MAAM,GAAA,GAAM,QAAA,CAAS,aAAA,EAAe,QAAQ,CAAA;AAC5C,EAAA,OAAA,CAAQ,KAAK,GAAG,CAAA;AAChB,EAAA,WAAA,CAAY,QAAQ,CAAA;AACpB,EAAA,IAAI,UAAA,CAAW,QAAQ,CAAA,EAAG;AACxB,IAAA,IAAI;AACF,MAAA,IAAI,YAAA,CAAa,QAAA,EAAU,OAAO,CAAA,KAAM,OAAA,EAAS;AAAA,IACnD,CAAA,CAAA,MAAQ;AAAA,IAER;AAAA,EACF;AACA,EAAA,SAAA,CAAU,QAAQ,QAAQ,CAAA,EAAG,EAAE,SAAA,EAAW,MAAM,CAAA;AAChD,EAAA,aAAA,CAAc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A,IAAiB,eAAA;AAC1B","file":"chunk-ABFPSVIS.js","sourcesContent":["/**\n * Framework-specific renderers for GitAgent packages.\n *\n * Each renderer transforms a parsed GitAgent package (agent.yaml + SOUL.md + RULES.md)\n * into the native file format that the target agent framework natively reads.\n *\n * Only harnesses with a full bridge harness (runtime execution) are included:\n * claude-code → .claude/agents/<name>.md (YAML frontmatter + markdown body)\n * omp → .omp/agents/<name>/ (directory with agent.yaml + SOUL.md)\n * codex → .codex/agents/<name>.toml (TOML)\n *\n * Removed (no bridge harness): cursor, roo, github-copilot, gemini, amp.\n * Add them back when a bridge harness is implemented.\n */\n\nimport {\n existsSync,\n lstatSync,\n mkdirSync,\n readdirSync,\n readFileSync,\n unlinkSync,\n writeFileSync,\n} from \"node:fs\";\nimport { basename, dirname, join, normalize, relative, resolve } from \"node:path\";\nimport { buildAgentPromptSections } from \"@skaile/workspaces/core\";\nimport {\n ANTHROPIC_MODEL_ALIASES,\n type AgentLifecycle,\n type AgentManifest,\n normalizeAnthropicModel,\n} from \"@skaile/workspaces/types/manifests\";\nimport { stringify as stringifyYaml } from \"yaml\";\nimport type { AbilityRef, ContractRef } from \"./fragments.js\";\n\n// ── Types ─────────────────────────────────��───────────────────────────────────\n\nexport type { AgentManifest };\n\n/**\n * All data an {@link AgentRenderer} needs to produce a native agent definition file.\n *\n * @docLink packages/asset-manager/api-reference#renderers\n */\nexport interface AgentRenderInput {\n /** Parsed `agent.yaml` manifest for the GitAgent being rendered. */\n manifest: AgentManifest;\n /** Raw content of `SOUL.md`, or `null` if absent. */\n soul: string | null;\n /** Raw content of `RULES.md`, or `null` if absent. */\n rules: string | null;\n /** Raw content of `DUTIES.md`, or `null` if absent. */\n duties: string | null;\n /** Agent name used as the output filename and frontmatter `name` field. */\n agentName: string;\n /** Resolved absolute path to the framework's agent deploy directory (e.g. `.claude/agents/`). */\n agentDeployDir: string;\n /** Absolute path to the workspace root. */\n workspaceRoot: string;\n /** Resolved ability refs — installed skills referenced in the `## Installed Abilities` section. */\n abilityRefs: AbilityRef[];\n /** Resolved contract refs — installed in the skills dir, listed in the `## Contracts` section. */\n contractRefs: ContractRef[];\n /** Resolved framework fragment markdown blocks (agent-mode, handoff, skill-discovery, etc.). */\n frameworkFragments: string[];\n /** Per-project prompt extension markdown blocks loaded from `skaile.yaml` `agent.prompt-extensions`. */\n promptExtensions: string[];\n /** `standing` (long-running identity) or `role` (short-lived, callable). */\n lifecycle: AgentLifecycle;\n /** Names of the skills the agent composes (`composes[{kind: skill}]`), as installed. */\n skills: string[];\n /** Names of the MCP servers the agent's `mcp-server` slots are bound to. */\n mcpServers: string[];\n /**\n * Absolute path of the agent's source directory (where `agent.yaml` lives). The omp renderer\n * copies the local `composes` directories out of it.\n */\n srcDir?: string;\n}\n\n/**\n * Result returned by every {@link AgentRenderer}.\n *\n * @docLink packages/asset-manager/api-reference#renderers\n */\nexport interface AgentRenderResult {\n /** Paths to files/dirs rendered, relative to `workspaceRoot`. */\n created: string[];\n /** The subset of `created` whose bytes differ from what was on disk before (new or edited); an identical rewrite is skipped. */\n changed: string[];\n /** Non-fatal warnings (e.g. experimental feature notices). */\n warnings: string[];\n}\n\n/**\n * A function that transforms an {@link AgentRenderInput} into framework-native agent definition files.\n *\n * @docLink packages/asset-manager/api-reference#renderers\n */\nexport type AgentRenderer = (input: AgentRenderInput) => AgentRenderResult;\n\n// ── Helpers ───────────────────────────────────────────────────────────────────\n\n/**\n * Unlink a symlink (dangling or not) at a path skaile is about to write. `writeFileSync` follows\n * a link, so the write would land in the file the link points at: the user's own file, outside\n * the project (p1060). The link is replaced by the rendered file instead.\n */\nfunction dropSymlink(path: string): void {\n try {\n if (lstatSync(path).isSymbolicLink()) unlinkSync(path);\n } catch {\n // nothing at the path: the write creates it\n }\n}\n\n/**\n * Write an agent definition file. Agents are compiled artifacts — they must\n * reflect the current canonical source — but a file that already holds exactly\n * these bytes is left untouched (mtime included), so a repeat install is a no-op.\n * `created` lists every rendered path; `changed` only those that were (re)written.\n */\nfunction writeAgent(\n filePath: string,\n content: string,\n workspaceRoot: string,\n created: string[],\n changed: string[],\n): void {\n const rel = relative(workspaceRoot, filePath);\n created.push(rel);\n dropSymlink(filePath);\n if (existsSync(filePath)) {\n try {\n if (readFileSync(filePath, \"utf-8\") === content) return;\n } catch {\n // unreadable (e.g. a directory in the way): fall through to the write\n }\n }\n mkdirSync(dirname(filePath), { recursive: true });\n writeFileSync(filePath, content, \"utf-8\");\n changed.push(rel);\n}\n\n/**\n * Build the full agent system prompt body baked into the framework-native agent file.\n *\n * This is the sole source of the agent's system prompt body. Agent identity is rendered at install time; the harness reads it natively at runtime.\n * The rendered output ends up in .claude/agents/<name>.md, .omp/agents/<name>/SOUL.md,\n * .codex/agents/<name>.toml and is read natively by the framework on every agent invocation.\n *\n * Section order is owned by the shared builder (`buildAgentPromptSections` in\n * core, the same one the runner assembles its system prompt with):\n * soul → `<MEMORY>` → framework fragments → `## Constraints` (RULES) →\n * `## Duties` → `## Installed Abilities` → `## Contracts` → composed inline\n * blocks → prompt extensions.\n */\nfunction buildMarkdownBody(\n soul: string | null,\n rules: string | null,\n duties: string | null,\n abilityRefs: AbilityRef[],\n contractRefs: ContractRef[],\n frameworkFragments: string[],\n promptExtensions: string[],\n): string {\n const sections = buildAgentPromptSections({\n soul,\n constraints: rules,\n duties,\n abilities: abilityRefs,\n contracts: contractRefs,\n frameworkFragments,\n promptExtensions,\n });\n return `${sections.map((s) => s.text).join(\"\\n\\n\")}\\n`;\n}\n\n/** Escape a string for use as a TOML multi-line basic string (triple-quote). */\nfunction toTomlMultilineString(s: string): string {\n // Replace \"\"\" with \\\\\"\"\" to avoid breaking the TOML literal\n return s.replace(/\"\"\"/g, '\\\\\"\\\\\"\\\\\"');\n}\n\n/**\n * The manifest's `model` as a harness other than Claude Code can take it: the Claude Code\n * aliases (`inherit`, `opus`, `sonnet`, `haiku`) name no model of another harness' provider, so a\n * `preferred` that is one of them is dropped (the harness starts the agent on its own default) and\n * so is a `fallback` entry that is. Any other selector (`provider/model`, a full id, `@role`) is\n * the author's choice and is passed through. `undefined` when nothing is left.\n */\nfunction harnessModel(model: AgentManifest[\"model\"]): AgentManifest[\"model\"] | undefined {\n if (!model) return undefined;\n const claudeOnly = (m: string): boolean =>\n (ANTHROPIC_MODEL_ALIASES as readonly string[]).includes(m);\n const { preferred, fallback, ...rest } = model;\n const kept: NonNullable<AgentManifest[\"model\"]> = { ...rest };\n if (preferred && !claudeOnly(preferred)) kept.preferred = preferred;\n const fallbacks = (fallback ?? []).filter((m) => !claudeOnly(m));\n if (fallbacks.length > 0) kept.fallback = fallbacks;\n return Object.keys(kept).length > 0 ? kept : undefined;\n}\n\n/** Directory entries that are never part of an asset (build and OS leftovers). */\nconst COPY_SKIP = new Set([\".git\", \".DS_Store\", \"node_modules\", \"__pycache__\"]);\n\n/** Copy a file or directory tree byte for byte; a file that already holds these bytes is left alone. */\nfunction copyTree(from: string, to: string, workspaceRoot: string, changed: string[]): void {\n const stat = lstatSync(from);\n if (stat.isSymbolicLink()) return;\n if (stat.isDirectory()) {\n for (const name of readdirSync(from)) {\n if (COPY_SKIP.has(name) || name.endsWith(\".pyc\")) continue;\n copyTree(join(from, name), join(to, name), workspaceRoot, changed);\n }\n return;\n }\n if (!stat.isFile()) return;\n const bytes = readFileSync(from);\n dropSymlink(to);\n if (existsSync(to)) {\n try {\n if (bytes.equals(readFileSync(to))) return;\n } catch {\n // unreadable (e.g. a directory in the way): fall through to the write\n }\n }\n mkdirSync(dirname(to), { recursive: true });\n writeFileSync(to, bytes);\n changed.push(relative(workspaceRoot, to));\n}\n\n/**\n * Make the `composes` of an omp `agent.yaml` resolvable from where it is written: every local ref\n * (`./rules-local/house-rules`) is copied next to the `agent.yaml`, at the path the ref names, and a\n * local ref that climbs out of the agent directory (`../shared/rules`) is copied to\n * `composes/<name>` and rewritten to that path. Catalog refs (`skill:@pub/name`) are kept as written.\n */\nfunction bundleLocalComposes(\n composes: NonNullable<AgentManifest[\"composes\"]>,\n srcDir: string | undefined,\n destDir: string,\n workspaceRoot: string,\n changed: string[],\n warnings: string[],\n): NonNullable<AgentManifest[\"composes\"]> {\n if (!srcDir) return composes;\n return composes.map((item) => {\n if (!item.ref.startsWith(\"./\") && !item.ref.startsWith(\"../\")) return item;\n const from = resolve(srcDir, item.ref);\n if (!existsSync(from)) {\n warnings.push(`compose ref ${item.ref} not found at ${from}: not copied into ${destDir}`);\n return item;\n }\n const rel = normalize(item.ref);\n const inside = !rel.startsWith(\"..\");\n const target = inside ? rel : join(\"composes\", basename(from));\n copyTree(from, join(destDir, target), workspaceRoot, changed);\n return inside ? item : { ...item, ref: `./${target}` };\n });\n}\n\n// ── Claude Code ────────────��──────────────────────────────────────────────────\n// Format: .claude/agents/<name>.md\n// Sub-agent support: automatic (description-based) + @-mention\n// Required frontmatter: name, description\n//\n// Installation → runtime handoff:\n// skaile install (claudeCodeRenderer) creates the .md file from GitAgent source\n// ClaudeSdkHarness.startQuery() passes options.agent = agentName to the SDK query\n// The SDK reads .claude/agents/<agentName>.md to get model, tools, and system prompt\n// This is equivalent to running: claude --agent <agentName>\n\n/**\n * Render a GitAgent to Claude Code's `.claude/agents/<name>.md` format.\n *\n * Writes YAML frontmatter (name, description, model, tools, skills, mcpServers,\n * maxTurns, background) followed by the enriched system prompt body. `skills`\n * lists the composed skills, `mcpServers` the MCP servers the agent's\n * `mcp-server` slots are bound to, and `background: true` marks a `role`\n * instance whose `runtime.background` is set. Always overwrites to reflect\n * current source.\n *\n * @docLink packages/asset-manager/api-reference#renderers\n */\nexport const claudeCodeRenderer: AgentRenderer = ({\n manifest,\n soul,\n rules,\n duties,\n agentName,\n agentDeployDir,\n workspaceRoot,\n abilityRefs,\n contractRefs,\n frameworkFragments,\n promptExtensions,\n lifecycle,\n skills,\n mcpServers,\n}) => {\n const created: string[] = [];\n const changed: string[] = [];\n const warnings: string[] = [];\n\n const frontmatter: Record<string, unknown> = {\n name: agentName,\n description: manifest.description ?? `${agentName} agent`,\n };\n\n // Model: map to Claude Code's model field. Accepts aliases (sonnet/opus/haiku/inherit)\n // or a full Anthropic ID. Unrecognized values (e.g. legacy `claude-opus-4`) are\n // coerced to the matching family alias so the agent still loads.\n if (manifest.model?.preferred) {\n const raw = manifest.model.preferred;\n const normalized = normalizeAnthropicModel(raw);\n if (normalized !== raw) {\n warnings.push(\n `agent ${agentName}: model \"${raw}\" is not a valid Claude model ID; normalized to alias \"${normalized}\". Update agent.yaml.`,\n );\n }\n frontmatter.model = normalized;\n }\n\n // Tool restrictions\n if (manifest.tools?.allowed?.length) {\n frontmatter.tools = manifest.tools.allowed.join(\", \");\n }\n if (manifest.tools?.denied?.length) {\n frontmatter.disallowedTools = manifest.tools.denied.join(\", \");\n }\n\n if (skills.length > 0) frontmatter.skills = skills;\n if (mcpServers.length > 0) frontmatter.mcpServers = mcpServers;\n\n // Runtime\n if (manifest.runtime?.max_turns) {\n frontmatter.maxTurns = manifest.runtime.max_turns;\n }\n if (lifecycle === \"role\" && manifest.runtime?.background === true) {\n frontmatter.background = true;\n }\n\n // Metadata pass-through for Claude Code-specific fields\n if (manifest.metadata?.color) frontmatter.color = manifest.metadata.color;\n if (manifest.metadata?.effort) frontmatter.effort = manifest.metadata.effort;\n if (manifest.metadata?.isolation) frontmatter.isolation = manifest.metadata.isolation;\n\n const body = buildMarkdownBody(\n soul,\n rules,\n duties,\n abilityRefs,\n contractRefs,\n frameworkFragments,\n promptExtensions,\n );\n const content = `---\\n${stringifyYaml(frontmatter).trim()}\\n---\\n\\n${body}`;\n const filePath = join(agentDeployDir, `${agentName}.md`);\n writeAgent(filePath, content, workspaceRoot, created, changed);\n\n return { created, changed, warnings };\n};\n\n// ── OpenAI Codex ──────────────────────────────────────────────────────────────\n// Format: .codex/agents/<name>.toml\n// Sub-agent support: explicit user request only (not automatic)\n// Required fields: name, description, developer_instructions\n\n/**\n * Tools that change the workspace or run commands. Codex has no per-agent tool\n * allowlist; the closest per-agent control is `sandbox_mode`, so an agent whose\n * declared tool surface contains none of these is rendered `read-only`.\n */\nconst MUTATING_TOOLS = [\"Write\", \"Edit\", \"MultiEdit\", \"NotebookEdit\", \"Bash\"] as const;\n\n/** `read-only` when the manifest's tool surface cannot mutate anything, else `undefined` (inherit). */\nfunction codexSandboxMode(tools: AgentManifest[\"tools\"]): \"read-only\" | undefined {\n const allowed = tools?.allowed ?? [];\n const denied = new Set(tools?.denied ?? []);\n if (allowed.length > 0) {\n return allowed.some((t) => !denied.has(t) && (MUTATING_TOOLS as readonly string[]).includes(t))\n ? undefined\n : \"read-only\";\n }\n // No allowlist: everything not denied is available.\n return MUTATING_TOOLS.every((t) => denied.has(t)) ? \"read-only\" : undefined;\n}\n\n/** Directory (next to `agents/`) holding each Codex agent's markdown identity, one file per agent. */\nexport const CODEX_IDENTITY_DIR = \"skaile-agents\";\n\n/**\n * Render a GitAgent to OpenAI Codex's `.codex/agents/<name>.toml` format.\n *\n * Produces a TOML file with `name`, `description`, `model`, `sandbox_mode` and\n * `developer_instructions`. `sandbox_mode = \"read-only\"` is the per-agent tool\n * restriction: it is emitted when the manifest's `tools` leave the agent no way\n * to write or run commands (Codex has no per-tool allowlist). Triple-quoted\n * TOML multi-line strings are escaped to avoid syntax errors.\n *\n * Also writes the agent's identity as `.codex/skaile-agents/<name>.md`, which\n * the Codex harness combines with the session's runtime prompt (one file per\n * agent, so several instances never overwrite each other).\n *\n * @docLink packages/asset-manager/api-reference#renderers\n */\nexport const codexRenderer: AgentRenderer = ({\n manifest,\n soul,\n rules,\n duties,\n agentName,\n agentDeployDir,\n workspaceRoot,\n abilityRefs,\n contractRefs,\n frameworkFragments,\n promptExtensions,\n}) => {\n const created: string[] = [];\n const changed: string[] = [];\n const warnings: string[] = [];\n\n const instructions = buildMarkdownBody(\n soul,\n rules,\n duties,\n abilityRefs,\n contractRefs,\n frameworkFragments,\n promptExtensions,\n );\n const escaped = toTomlMultilineString(instructions);\n\n const lines: string[] = [\n `name = ${JSON.stringify(agentName)}`,\n `description = ${JSON.stringify(manifest.description ?? `${agentName} agent`)}`,\n ];\n // A Claude Code alias (`sonnet`) names no Codex model: leave `model` out and Codex uses its own.\n const model = harnessModel(manifest.model)?.preferred;\n if (model) lines.push(`model = ${JSON.stringify(model)}`);\n const sandboxMode = codexSandboxMode(manifest.tools);\n if (sandboxMode) lines.push(`sandbox_mode = ${JSON.stringify(sandboxMode)}`);\n lines.push(`developer_instructions = \"\"\"`, escaped.trim(), `\"\"\"`);\n\n const content = `${lines.join(\"\\n\")}\\n`;\n const filePath = join(agentDeployDir, `${agentName}.toml`);\n writeAgent(filePath, content, workspaceRoot, created, changed);\n\n // Write the full agent identity as markdown for the Codex harness to read at runtime.\n // The harness combines this with the session's dynamic content (resources, context)\n // and passes the result via model_instructions_file.\n const agentMdPath = join(dirname(agentDeployDir), CODEX_IDENTITY_DIR, `${agentName}.md`);\n writeAgent(agentMdPath, instructions, workspaceRoot, created, changed);\n\n return { created, changed, warnings };\n};\n\n// ── oh-my-pi ─��────────────��────────────────────────────────��─────────────────\n// Format: .omp/agents/<name>/ (directory with agent.yaml + SOUL.md + RULES.md)\n// oh-my-pi reads GitAgent directories natively via PI_CODING_AGENT_DIR.\n// The renderer copies/enriches the source directory rather than flattening to .md.\n//\n// Installation → runtime handoff:\n// skaile install (ompRenderer) creates .omp/agents/<name>/ from GitAgent source\n// OmpHarness._start() sets env.PI_CODING_AGENT_DIR = agentDir in the child process\n// omp reads SOUL.md/RULES.md/knowledge/ from that directory natively on startup\n//\n// Note: REPL mode can bypass the install step — agentDir can point directly to the\n// GitAgent source directory, and omp will read it natively via PI_CODING_AGENT_DIR.\n// The rendered .omp/agents/ copy is only needed when the source is not accessible\n// from the project cwd (e.g. different repo, remote workspace).\n\n/**\n * Render a GitAgent to oh-my-pi's `.omp/agents/<name>/` directory format.\n *\n * Writes `agent.yaml` (resolved model/tools/delegation plus the 0.2\n * declaration — `composes` verbatim, `lifecycle`, `io`, `memory`, `triggers`,\n * `capabilities`) and an enriched `SOUL.md` that includes fragments and\n * extensions. omp reads this directory natively via the `PI_CODING_AGENT_DIR`\n * environment variable.\n *\n * @docLink packages/asset-manager/api-reference#renderers\n */\nexport const ompRenderer: AgentRenderer = ({\n manifest,\n soul,\n rules,\n duties,\n agentName,\n agentDeployDir,\n workspaceRoot,\n abilityRefs,\n contractRefs,\n frameworkFragments,\n promptExtensions,\n lifecycle,\n srcDir,\n}) => {\n const created: string[] = [];\n const changed: string[] = [];\n const warnings: string[] = [];\n\n const destDir = join(agentDeployDir, agentName);\n\n // Write agent.yaml with tools resolved\n const agentYaml: Record<string, unknown> = {\n spec_version: manifest.spec_version ?? \"0.2\",\n name: agentName,\n version: manifest.version ?? \"1.0.0\",\n description: manifest.description ?? `${agentName} agent`,\n lifecycle,\n };\n // The model: omp takes provider-prefixed full IDs and `@role` selectors, and resolves the\n // family aliases it knows (verified live 2026-09-20 against omp v18.1.10 through\n // teamclaude.postxl.com: `--model anthropic/opus` produced\n // `model_change {\"model\":\"anthropic/claude-opus-5\",\"resolvedModelIsFallback\":false}`).\n // The Claude Code aliases the manifest writes (`sonnet`, `haiku`, `opus`, `inherit`) name no\n // model of an omp deployment on another provider, so they are left out and omp starts the agent\n // on its own default. Any other selector is passed through verbatim: it is not checked here, and\n // not coerced by `normalizeAnthropicModel`, which would substitute a different model on any\n // provider but Anthropic (see `resolveManifestModel` in `@skaile/workspaces/bridge`).\n const model = harnessModel(manifest.model);\n if (model) agentYaml.model = model;\n if (manifest.tools) agentYaml.tools = manifest.tools;\n if (manifest.delegation) agentYaml.delegation = manifest.delegation;\n if (manifest.runtime) agentYaml.runtime = manifest.runtime;\n if (manifest.io) agentYaml.io = manifest.io;\n if (manifest.memory) agentYaml.memory = manifest.memory;\n if (manifest.triggers?.length) agentYaml.triggers = manifest.triggers;\n if (manifest.capabilities?.length) agentYaml.capabilities = manifest.capabilities;\n if (manifest.composes?.length) {\n agentYaml.composes = bundleLocalComposes(\n manifest.composes,\n srcDir,\n destDir,\n workspaceRoot,\n changed,\n warnings,\n );\n }\n if (manifest.tags?.length) agentYaml.tags = manifest.tags;\n if (manifest.metadata) agentYaml.metadata = manifest.metadata;\n\n writeAgent(join(destDir, \"agent.yaml\"), stringifyYaml(agentYaml), workspaceRoot, [], changed);\n\n // Write SOUL.md (enriched with fragments and extensions, like other renderers)\n const enrichedSoul = buildMarkdownBody(\n soul,\n rules,\n duties,\n abilityRefs,\n contractRefs,\n frameworkFragments,\n promptExtensions,\n );\n writeAgent(join(destDir, \"SOUL.md\"), enrichedSoul, workspaceRoot, [], changed);\n\n // omp lists the agents it can spawn from flat `.omp/agents/<name>.md` files only (verified live\n // against omp 18.12.5: a `<name>/agent.yaml` directory is not listed, a flat file is), so the\n // directory above carries the full GitAgent package and this file is what omp loads.\n const frontmatter: Record<string, unknown> = {\n name: agentName,\n description: manifest.description ?? `${agentName} agent`,\n };\n if (manifest.tools?.allowed?.length) frontmatter.tools = manifest.tools.allowed.join(\", \");\n const selector = model?.preferred;\n if (selector) frontmatter.model = selector;\n writeAgent(\n join(agentDeployDir, `${agentName}.md`),\n `---\\n${stringifyYaml(frontmatter).trim()}\\n---\\n\\n${enrichedSoul}`,\n workspaceRoot,\n created,\n changed,\n );\n\n created.push(relative(workspaceRoot, destDir));\n return { created, changed, warnings };\n};\n\n// ── Renderer registry ──────────────────────────────���──────────────────────────\n\nexport type Log = (msg: string) => void;\nconst noop: Log = () => {};\n\n/**\n * Render an agent to framework-native format via the renderer registry.\n *\n * Shared by both the simple deploy path (`deployAsset`) and the enriched scaffold path (agents layer).\n *\n * @param input - Full render input including manifest, SOUL/RULES text, and resolved refs.\n * @param harnessTarget - Agent framework ID to look up in {@link AGENT_RENDERERS}.\n * @param log - Optional logger callback for progress messages.\n * @returns Object with `created` file paths and `warnings` list.\n * @docLink packages/asset-manager/api-reference#renderers\n */\nexport function renderAgentToFramework(\n input: AgentRenderInput,\n harnessTarget: string,\n log: Log = noop,\n): AgentRenderResult {\n const renderer = AGENT_RENDERERS[harnessTarget];\n if (!renderer) {\n return {\n created: [],\n changed: [],\n warnings: [`No renderer for framework \"${harnessTarget}\"`],\n };\n }\n const result = renderer(input);\n for (const c of result.created) log(` rendered agent: ${c}`);\n for (const w of result.warnings) log(` warn: ${w}`);\n return result;\n}\n\n/**\n * Registry mapping framework IDs to their {@link AgentRenderer} functions.\n *\n * Only harnesses with a full bridge harness are registered. Add new entries\n * when a bridge harness is implemented in `workspaces/bridge/src/harnesses/`.\n *\n * @docLink packages/asset-manager/api-reference#renderers\n */\nexport const AGENT_RENDERERS: Record<string, AgentRenderer> = {\n \"claude-code\": claudeCodeRenderer,\n omp: ompRenderer,\n codex: codexRenderer,\n};\n\n/**\n * Returns `true` if the given harness target supports file-based sub-agent installation.\n *\n * @param harnessTarget - Agent framework ID to check.\n * @returns `true` when `harnessTarget` has a registered entry in {@link AGENT_RENDERERS}.\n * @docLink packages/asset-manager/api-reference#renderers\n */\nexport function harnessTargetSupportsAgents(harnessTarget: string): boolean {\n return harnessTarget in AGENT_RENDERERS;\n}\n"]}