@skaile/workspaces 6.10.0 → 6.11.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 (201) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/app-sdk/index.js +1 -1
  3. package/dist/{asset-feeds-UG3PG423.js → asset-feeds-PO2WC75V.js} +13 -13
  4. package/dist/{asset-feeds-UG3PG423.js.map → asset-feeds-PO2WC75V.js.map} +1 -1
  5. package/dist/asset-manager/index.js +6 -6
  6. package/dist/asset-manager/installer.js +3 -3
  7. package/dist/asset-manager/renderers.js +2 -2
  8. package/dist/bridge/harnesses/claude-sdk.js +7 -7
  9. package/dist/bridge/harnesses/codex.js +5 -5
  10. package/dist/bridge/harnesses/continue.js +4 -4
  11. package/dist/bridge/harnesses/echo.js +4 -4
  12. package/dist/bridge/harnesses/gemini.js +7 -7
  13. package/dist/bridge/harnesses/goose.js +4 -4
  14. package/dist/bridge/harnesses/omp.js +41 -10
  15. package/dist/bridge/harnesses/omp.js.map +1 -1
  16. package/dist/bridge/harnesses/opencode.js +4 -4
  17. package/dist/bridge/harnesses/qwen.js +7 -7
  18. package/dist/bridge/index.js +11 -11
  19. package/dist/bridge/src/harnesses/omp.d.ts +13 -1
  20. package/dist/bridge/src/harnesses/omp.d.ts.map +1 -1
  21. package/dist/bridge/src/types.d.ts +7 -0
  22. package/dist/bridge/src/types.d.ts.map +1 -1
  23. package/dist/{chunk-7NN3P6VF.js → chunk-342UX2MG.js} +10 -5
  24. package/dist/chunk-342UX2MG.js.map +1 -0
  25. package/dist/{chunk-NTFP2XF4.js → chunk-45XL75RO.js} +9 -9
  26. package/dist/{chunk-NTFP2XF4.js.map → chunk-45XL75RO.js.map} +1 -1
  27. package/dist/{chunk-JDZUQFN7.js → chunk-4NJVF3DV.js} +4 -4
  28. package/dist/{chunk-JDZUQFN7.js.map → chunk-4NJVF3DV.js.map} +1 -1
  29. package/dist/{chunk-GA4GUDTL.js → chunk-5M3S6DLV.js} +3 -3
  30. package/dist/{chunk-GA4GUDTL.js.map → chunk-5M3S6DLV.js.map} +1 -1
  31. package/dist/{chunk-HE3TZYNG.js → chunk-5XYZNMMC.js} +4 -4
  32. package/dist/{chunk-HE3TZYNG.js.map → chunk-5XYZNMMC.js.map} +1 -1
  33. package/dist/{chunk-2U67XYZM.js → chunk-6NNXBXYI.js} +3 -3
  34. package/dist/{chunk-2U67XYZM.js.map → chunk-6NNXBXYI.js.map} +1 -1
  35. package/dist/{chunk-FXBKBOI5.js → chunk-7FXOOUOC.js} +4 -4
  36. package/dist/{chunk-FXBKBOI5.js.map → chunk-7FXOOUOC.js.map} +1 -1
  37. package/dist/{chunk-KRL53RZB.js → chunk-7LJUK5JK.js} +4 -4
  38. package/dist/{chunk-KRL53RZB.js.map → chunk-7LJUK5JK.js.map} +1 -1
  39. package/dist/{chunk-NCJSYU6A.js → chunk-7O6SCI7B.js} +5 -5
  40. package/dist/{chunk-NCJSYU6A.js.map → chunk-7O6SCI7B.js.map} +1 -1
  41. package/dist/{chunk-R3ZNAPBV.js → chunk-7VBD5XUM.js} +3 -3
  42. package/dist/{chunk-R3ZNAPBV.js.map → chunk-7VBD5XUM.js.map} +1 -1
  43. package/dist/{chunk-YEOG7CWQ.js → chunk-7ZL23M3X.js} +3 -3
  44. package/dist/{chunk-YEOG7CWQ.js.map → chunk-7ZL23M3X.js.map} +1 -1
  45. package/dist/{chunk-375HN3FD.js → chunk-CH6UVEM5.js} +9 -9
  46. package/dist/{chunk-375HN3FD.js.map → chunk-CH6UVEM5.js.map} +1 -1
  47. package/dist/{chunk-HQUF6O4B.js → chunk-CI4I34F4.js} +7 -7
  48. package/dist/{chunk-HQUF6O4B.js.map → chunk-CI4I34F4.js.map} +1 -1
  49. package/dist/{chunk-RTFH2QR2.js → chunk-CLMIZ4N6.js} +3 -3
  50. package/dist/{chunk-RTFH2QR2.js.map → chunk-CLMIZ4N6.js.map} +1 -1
  51. package/dist/{chunk-QBJQ426X.js → chunk-DKRD6CZL.js} +3 -3
  52. package/dist/{chunk-QBJQ426X.js.map → chunk-DKRD6CZL.js.map} +1 -1
  53. package/dist/{chunk-RZ5R6GDJ.js → chunk-DRUAQ7IY.js} +3 -3
  54. package/dist/{chunk-RZ5R6GDJ.js.map → chunk-DRUAQ7IY.js.map} +1 -1
  55. package/dist/{chunk-3AIEJSQR.js → chunk-ESUF2ZYT.js} +3 -3
  56. package/dist/{chunk-3AIEJSQR.js.map → chunk-ESUF2ZYT.js.map} +1 -1
  57. package/dist/{chunk-C5UKYTTD.js → chunk-FECB7RI7.js} +9 -9
  58. package/dist/{chunk-C5UKYTTD.js.map → chunk-FECB7RI7.js.map} +1 -1
  59. package/dist/{chunk-4Z4RULWQ.js → chunk-FO2GU5L7.js} +196 -35
  60. package/dist/chunk-FO2GU5L7.js.map +1 -0
  61. package/dist/{chunk-2D6HZAO5.js → chunk-FVOQPTK2.js} +3 -3
  62. package/dist/{chunk-2D6HZAO5.js.map → chunk-FVOQPTK2.js.map} +1 -1
  63. package/dist/{chunk-5JBMYZNA.js → chunk-GODUKPGD.js} +3 -3
  64. package/dist/{chunk-5JBMYZNA.js.map → chunk-GODUKPGD.js.map} +1 -1
  65. package/dist/{chunk-7DUOKE73.js → chunk-GQQIMKEP.js} +11 -11
  66. package/dist/{chunk-7DUOKE73.js.map → chunk-GQQIMKEP.js.map} +1 -1
  67. package/dist/{chunk-BRPEW3UL.js → chunk-GYRIO6RA.js} +3 -3
  68. package/dist/{chunk-BRPEW3UL.js.map → chunk-GYRIO6RA.js.map} +1 -1
  69. package/dist/{chunk-DOMRBOJZ.js → chunk-HPQ2WDYC.js} +4 -4
  70. package/dist/{chunk-DOMRBOJZ.js.map → chunk-HPQ2WDYC.js.map} +1 -1
  71. package/dist/{chunk-4I4SBOCS.js → chunk-IIELRGIZ.js} +7 -7
  72. package/dist/{chunk-4I4SBOCS.js.map → chunk-IIELRGIZ.js.map} +1 -1
  73. package/dist/{chunk-6PVRP3LW.js → chunk-IPCRQWNC.js} +17 -6
  74. package/dist/chunk-IPCRQWNC.js.map +1 -0
  75. package/dist/{chunk-5KQFR4D7.js → chunk-L74W5TVC.js} +4 -4
  76. package/dist/{chunk-5KQFR4D7.js.map → chunk-L74W5TVC.js.map} +1 -1
  77. package/dist/{chunk-WS3BOCAT.js → chunk-LCXQ4LVP.js} +16 -3
  78. package/dist/chunk-LCXQ4LVP.js.map +1 -0
  79. package/dist/{chunk-2MUUPRIG.js → chunk-LXD37LHF.js} +4 -4
  80. package/dist/{chunk-2MUUPRIG.js.map → chunk-LXD37LHF.js.map} +1 -1
  81. package/dist/{chunk-PSPFWTJI.js → chunk-MRTOKIEJ.js} +3 -3
  82. package/dist/{chunk-PSPFWTJI.js.map → chunk-MRTOKIEJ.js.map} +1 -1
  83. package/dist/{chunk-NFFBYG2W.js → chunk-PZS55HOX.js} +3 -3
  84. package/dist/{chunk-NFFBYG2W.js.map → chunk-PZS55HOX.js.map} +1 -1
  85. package/dist/{chunk-XDVR7QIT.js → chunk-QC4Q7PMQ.js} +6 -3
  86. package/dist/chunk-QC4Q7PMQ.js.map +1 -0
  87. package/dist/{chunk-5P7LTPBR.js → chunk-RRKJHADP.js} +3 -3
  88. package/dist/{chunk-5P7LTPBR.js.map → chunk-RRKJHADP.js.map} +1 -1
  89. package/dist/{chunk-6O7VDKX3.js → chunk-RZQCBFIU.js} +2 -2
  90. package/dist/{chunk-6O7VDKX3.js.map → chunk-RZQCBFIU.js.map} +1 -1
  91. package/dist/{chunk-KE5HDORU.js → chunk-S6NS3I3P.js} +2 -2
  92. package/dist/{chunk-KE5HDORU.js.map → chunk-S6NS3I3P.js.map} +1 -1
  93. package/dist/{chunk-XWCV2A2F.js → chunk-SZ3XCZHC.js} +3 -3
  94. package/dist/{chunk-XWCV2A2F.js.map → chunk-SZ3XCZHC.js.map} +1 -1
  95. package/dist/{chunk-SKG6G4HO.js → chunk-UHTCOYFJ.js} +7 -7
  96. package/dist/{chunk-SKG6G4HO.js.map → chunk-UHTCOYFJ.js.map} +1 -1
  97. package/dist/{chunk-HLFLET7S.js → chunk-WCHGUS7X.js} +5 -5
  98. package/dist/{chunk-HLFLET7S.js.map → chunk-WCHGUS7X.js.map} +1 -1
  99. package/dist/{chunk-IMO4EHND.js → chunk-WPTNYDDS.js} +4 -4
  100. package/dist/{chunk-IMO4EHND.js.map → chunk-WPTNYDDS.js.map} +1 -1
  101. package/dist/{chunk-BCID52M5.js → chunk-YPX7LQSW.js} +7 -7
  102. package/dist/{chunk-BCID52M5.js.map → chunk-YPX7LQSW.js.map} +1 -1
  103. package/dist/{chunk-PTXQMTCG.js → chunk-ZRKU7BRI.js} +3 -3
  104. package/dist/{chunk-PTXQMTCG.js.map → chunk-ZRKU7BRI.js.map} +1 -1
  105. package/dist/{claude-code-CMFGCDMX.js → claude-code-TDMSETH6.js} +4 -4
  106. package/dist/{claude-code-CMFGCDMX.js.map → claude-code-TDMSETH6.js.map} +1 -1
  107. package/dist/cli/index.js +63 -63
  108. package/dist/client/index.js +1 -1
  109. package/dist/client/src/client.d.ts +3 -0
  110. package/dist/client/src/client.d.ts.map +1 -1
  111. package/dist/connectors/index.js +13 -13
  112. package/dist/{connectors-P5M2D4MH.js → connectors-IUJRBTCW.js} +16 -16
  113. package/dist/{connectors-P5M2D4MH.js.map → connectors-IUJRBTCW.js.map} +1 -1
  114. package/dist/connectors-shared/index.js +2 -2
  115. package/dist/discovery/index.js +2 -2
  116. package/dist/{ensure-sources-MOGLBEUF.js → ensure-sources-Q2TTZVLX.js} +19 -19
  117. package/dist/{ensure-sources-MOGLBEUF.js.map → ensure-sources-Q2TTZVLX.js.map} +1 -1
  118. package/dist/factory-assets/connectors/box.js +13 -13
  119. package/dist/factory-assets/connectors/deploy.js +13 -13
  120. package/dist/factory-assets/connectors/devserver.js +13 -13
  121. package/dist/factory-assets/connectors/flow/adapter.js +13 -13
  122. package/dist/factory-assets/connectors/flow/run-flow.js +14 -14
  123. package/dist/factory-assets/connectors/flow.js +13 -13
  124. package/dist/factory-assets/connectors/git.js +13 -13
  125. package/dist/factory-assets/connectors/gmail.js +13 -13
  126. package/dist/factory-assets/connectors/googledrive.js +13 -13
  127. package/dist/factory-assets/connectors/local.js +13 -13
  128. package/dist/factory-assets/connectors/mattermost.js +13 -13
  129. package/dist/factory-assets/connectors/memory.js +13 -13
  130. package/dist/factory-assets/connectors/minio.js +13 -13
  131. package/dist/factory-assets/connectors/postgres.js +13 -13
  132. package/dist/factory-assets/connectors/s3.js +13 -13
  133. package/dist/factory-assets/connectors/sharepoint.js +13 -13
  134. package/dist/factory-assets/connectors/sqlite.js +13 -13
  135. package/dist/factory-assets/connectors/static-server.js +13 -13
  136. package/dist/factory-assets/connectors/tunnel.js +13 -13
  137. package/dist/factory-assets/connectors/webdav.js +13 -13
  138. package/dist/factory-assets/connectors/xstate-store.js +13 -13
  139. package/dist/factory-assets/connectors/xstate.js +13 -13
  140. package/dist/{helpers-JL5AEGDT.js → helpers-S6AQGXRH.js} +19 -19
  141. package/dist/{helpers-JL5AEGDT.js.map → helpers-S6AQGXRH.js.map} +1 -1
  142. package/dist/library/index.js +3 -3
  143. package/dist/{library-publish-DZNNZNMB.js → library-publish-7U4TJNQX.js} +33 -33
  144. package/dist/{library-publish-DZNNZNMB.js.map → library-publish-7U4TJNQX.js.map} +1 -1
  145. package/dist/model-endpoint/index.js +3 -3
  146. package/dist/{open-library-OJREQ22B.js → open-library-K6O6OVW5.js} +21 -21
  147. package/dist/{open-library-OJREQ22B.js.map → open-library-K6O6OVW5.js.map} +1 -1
  148. package/dist/{open-registry-OEU6QUK2.js → open-registry-4HNCWOCN.js} +6 -6
  149. package/dist/{open-registry-OEU6QUK2.js.map → open-registry-4HNCWOCN.js.map} +1 -1
  150. package/dist/{project-52UABBD5.js → project-ZWIZZIUT.js} +29 -29
  151. package/dist/{project-52UABBD5.js.map → project-ZWIZZIUT.js.map} +1 -1
  152. package/dist/runner/index.js +21 -21
  153. package/dist/runner/src/serve.d.ts.map +1 -1
  154. package/dist/runner/src/turn-ids.d.ts +70 -0
  155. package/dist/runner/src/turn-ids.d.ts.map +1 -0
  156. package/dist/runner/src/turn-scheduler.d.ts +7 -0
  157. package/dist/runner/src/turn-scheduler.d.ts.map +1 -1
  158. package/dist/sdk/asset-manager.js +6 -6
  159. package/dist/sdk/bridge.js +11 -11
  160. package/dist/sdk/client.js +1 -1
  161. package/dist/sdk/index.js +22 -22
  162. package/dist/sdk/runner.js +21 -21
  163. package/dist/sdk/session.js +2 -2
  164. package/dist/sdk/types.js +1 -1
  165. package/dist/{serve-preflight-HOQ7CGYR.js → serve-preflight-E3IEZTTF.js} +21 -21
  166. package/dist/{serve-preflight-HOQ7CGYR.js.map → serve-preflight-E3IEZTTF.js.map} +1 -1
  167. package/dist/session/index.js +2 -2
  168. package/dist/session/src/dispatcher.d.ts +4 -1
  169. package/dist/session/src/dispatcher.d.ts.map +1 -1
  170. package/dist/{setup-JIDZ372C.js → setup-V4EXOMVQ.js} +20 -20
  171. package/dist/{setup-JIDZ372C.js.map → setup-V4EXOMVQ.js.map} +1 -1
  172. package/dist/{source-P6ZFSSZZ.js → source-O7XXDX55.js} +31 -31
  173. package/dist/{source-P6ZFSSZZ.js.map → source-O7XXDX55.js.map} +1 -1
  174. package/dist/{source-manifest-publish-Y36FHVDS.js → source-manifest-publish-GUU4LX2S.js} +33 -33
  175. package/dist/{source-manifest-publish-Y36FHVDS.js.map → source-manifest-publish-GUU4LX2S.js.map} +1 -1
  176. package/dist/tui/index.js +21 -21
  177. package/dist/types/index.js +1 -1
  178. package/dist/types/manifests.js +1 -1
  179. package/dist/types/src/capabilities.d.ts +2 -1
  180. package/dist/types/src/capabilities.d.ts.map +1 -1
  181. package/dist/types/src/events.d.ts +2 -1
  182. package/dist/types/src/events.d.ts.map +1 -1
  183. package/dist/types/src/index.d.ts +2 -0
  184. package/dist/types/src/index.d.ts.map +1 -1
  185. package/dist/types/src/manifests/agent.d.ts +2 -0
  186. package/dist/types/src/manifests/agent.d.ts.map +1 -1
  187. package/dist/types/src/protocol.d.ts +2 -0
  188. package/dist/types/src/protocol.d.ts.map +1 -1
  189. package/dist/types/src/turn-ids.d.ts +62 -0
  190. package/dist/types/src/turn-ids.d.ts.map +1 -0
  191. package/dist/types/src/version.d.ts +12 -1
  192. package/dist/types/src/version.d.ts.map +1 -1
  193. package/dist/workspace-plugin/adapters/mcp.js +15 -15
  194. package/dist/workspace-plugin/adapters/omp.js +7 -7
  195. package/dist/workspace-plugin/index.js +1 -1
  196. package/package.json +1 -1
  197. package/dist/chunk-4Z4RULWQ.js.map +0 -1
  198. package/dist/chunk-6PVRP3LW.js.map +0 -1
  199. package/dist/chunk-7NN3P6VF.js.map +0 -1
  200. package/dist/chunk-WS3BOCAT.js.map +0 -1
  201. package/dist/chunk-XDVR7QIT.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.11.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1147](https://github.com/skaile-ai/workspaces/pull/1147) [`b3b23e4`](https://github.com/skaile-ai/workspaces/commit/b3b23e4acc5ca3a9cb6466331a18c9d1a0599ab1) Thanks [@mortegro](https://github.com/mortegro)! - Agent `tools.host_allowed`: an optional list of capability names (anchored match, `*` is the only wildcard) that limits which host tools the omp harness registers. It is separate from `tools.allowed`/`denied`, so an agent can run with omp's native tools off (`--no-tools`) and still expose only `mcp__app__*`. `undefined` changes nothing, `[]` registers no host tool. The filter runs before every `set_host_tools`, and a `host_tool_call` for a name outside the current registration now gets an error result without reaching the capability registry. `AgentToolsSchema` and `AgentConfig.tools` gain the field.
8
+
9
+ omp host tools whose capability name starts with `mcp__` are now advertised to omp as `host__…` (`mcp__app__query` → `host__app__query`). omp owns the `mcp__` prefix for its MCP manager, and a host tool carrying it could be missing from the model's tool list depending on whether `set_host_tools` reached omp before its startup MCP refresh. Capability names, `host_allowed` matching and dispatch are unchanged; only the name the model sees differs for such tools.
10
+
11
+ - [#1144](https://github.com/skaile-ai/workspaces/pull/1144) [`8578d47`](https://github.com/skaile-ai/workspaces/commit/8578d476c83a4f7a743cd6889f33e4923b32ae37) Thanks [@peteralbert](https://github.com/peteralbert)! - The runner echoes the host's turn ids (protocol 5.2.0), so a host can tell which of its turns a capability call or a turn end belongs to without pairing events by queue order. `prompt` and `reply` take an optional opaque `turnId`. `capability_invoked` carries `turnIds`: the turn holding the harness (plus any reply it took while paused), the turns that launched the tasks a self-started turn reads, and the launching turns of every background task still running, since a capability call carries no parent id. The `finished` that ends a host turn carries `turnId` when that turn alone holds the harness; a self-started turn's does not. The runner leaves either field out whenever it cannot name every turn involved (a flow turn, a compaction until it settles, a turn sent without an id, a task or wake of unknown origin), so a host keeps its old pairing for that event. `SessionDispatcher.sendCommand` sends a command's `turnId` to the runner and does not store it; `SessionDispatcher.deliverPrompt` and `AgentClient.prompt` take a `turnId` option. The runner lists `turnIds.v1` in `protocol_info.runtimeFeatures`. This lets the Skaile platform keep a turn's starter across a backend restart (skaile-ai/platform#8353).
12
+
3
13
  ## 6.10.0
4
14
 
5
15
  ### Minor Changes
@@ -1,4 +1,4 @@
1
- import { PROTOCOL_VERSION_STRING } from '../chunk-7NN3P6VF.js';
1
+ import { PROTOCOL_VERSION_STRING } from '../chunk-342UX2MG.js';
2
2
  import '../chunk-NSBPE2FW.js';
3
3
  import * as z from 'zod';
4
4
 
@@ -1,10 +1,10 @@
1
- import { storeNotInstallableReason } from './chunk-XWCV2A2F.js';
2
- import { getKnownKinds } from './chunk-DOMRBOJZ.js';
1
+ import { storeNotInstallableReason } from './chunk-SZ3XCZHC.js';
2
+ import { getKnownKinds } from './chunk-HPQ2WDYC.js';
3
3
  import './chunk-WDG5IVEA.js';
4
4
  import './chunk-7RGTAEG6.js';
5
- import './chunk-4I4SBOCS.js';
6
- import './chunk-FXBKBOI5.js';
7
- import './chunk-RZ5R6GDJ.js';
5
+ import './chunk-IIELRGIZ.js';
6
+ import './chunk-7FXOOUOC.js';
7
+ import './chunk-DRUAQ7IY.js';
8
8
  import './chunk-CVUMZTNO.js';
9
9
  import './chunk-F3D25RGM.js';
10
10
  import './chunk-3TXEJN4W.js';
@@ -12,12 +12,12 @@ import './chunk-ISHJITXJ.js';
12
12
  import './chunk-LNFKL23K.js';
13
13
  import './chunk-JRN5QF4C.js';
14
14
  import './chunk-NUELZWCF.js';
15
- import './chunk-KRL53RZB.js';
15
+ import './chunk-7LJUK5JK.js';
16
16
  import './chunk-PKE3PXOK.js';
17
17
  import './chunk-LKBRBVVS.js';
18
18
  import './chunk-UQ6LFBPZ.js';
19
- import './chunk-R3ZNAPBV.js';
20
- import './chunk-WS3BOCAT.js';
19
+ import './chunk-7VBD5XUM.js';
20
+ import './chunk-LCXQ4LVP.js';
21
21
  import './chunk-MEU2HHGV.js';
22
22
  import './chunk-4GY63JU6.js';
23
23
  import { factoryAssetRoots } from './chunk-CJO3XKO7.js';
@@ -60,8 +60,8 @@ function libraryEntryOf(asset) {
60
60
  async function libraryAssets() {
61
61
  const notes = [];
62
62
  try {
63
- const { openLibraryManager } = await import('./open-library-OJREQ22B.js');
64
- const { getKindRegistry } = await import('./open-registry-OEU6QUK2.js');
63
+ const { openLibraryManager } = await import('./open-library-K6O6OVW5.js');
64
+ const { getKindRegistry } = await import('./open-registry-4HNCWOCN.js');
65
65
  const { scanAuthoringLibraries } = await import('./library/index.js');
66
66
  const { library: index, close } = await openLibraryManager();
67
67
  try {
@@ -94,7 +94,7 @@ async function libraryAssets() {
94
94
  async function storeAssets(projectDir) {
95
95
  const notes = [];
96
96
  try {
97
- const { resolveCatalogSource } = await import('./open-library-OJREQ22B.js');
97
+ const { resolveCatalogSource } = await import('./open-library-K6O6OVW5.js');
98
98
  const { source, close } = await resolveCatalogSource({ projectDir });
99
99
  try {
100
100
  const assets = (await source.listAssets()).filter(
@@ -175,5 +175,5 @@ async function gatherAssetFeeds(am, projectDir) {
175
175
  }
176
176
 
177
177
  export { gatherAssetFeeds };
178
- //# sourceMappingURL=asset-feeds-UG3PG423.js.map
179
- //# sourceMappingURL=asset-feeds-UG3PG423.js.map
178
+ //# sourceMappingURL=asset-feeds-PO2WC75V.js.map
179
+ //# sourceMappingURL=asset-feeds-PO2WC75V.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../cli/src/asset-feeds.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwEA,SAAS,eAAe,KAAA,EAAsC;AAC5D,EAAA,MAAM,EAAE,UAAS,GAAI,KAAA;AACrB,EAAA,MAAM,MAAA,GAAU,SAAS,QAAA,EAAkD,QAAA;AAC3E,EAAA,MAAM,WAAA,GAAc,SAAS,QAAA,IAAY,MAAA;AACzC,EAAA,MAAM,cACJ,OAAO,WAAA,KAAgB,QAAA,GACnB,WAAA,GACA,MAAM,OAAA,CAAQ,WAAW,CAAA,GACvB,WAAA,CAAY,OAAO,CAAC,CAAA,KAAmB,OAAO,CAAA,KAAM,QAAQ,CAAA,GAC5D,MAAA;AACR,EAAA,MAAM,OAAO,QAAA,CAAS,YAAA;AACtB,EAAA,OAAO;AAAA,IACL,MAAM,KAAA,CAAM,IAAA;AAAA,IACZ,MAAM,KAAA,CAAM,IAAA;AAAA,IACZ,aAAa,OAAO,QAAA,CAAS,WAAA,KAAgB,QAAA,GAAW,SAAS,WAAA,GAAc,EAAA;AAAA,IAC/E,QAAQ,KAAA,CAAM,YAAA;AAAA,IACd,WAAW,KAAA,CAAM,SAAA;AAAA,IACjB,GAAI,MAAM,MAAA,GAAS,EAAE,QAAQ,KAAA,CAAM,MAAA,KAAW,EAAC;AAAA,IAC/C,SAAS,KAAA,CAAM,OAAA;AAAA,IACf,QAAA,EAAU,gBAAgB,MAAA,GAAY,KAAK,aAAA,CAAc,EAAE,QAAA,EAAU,WAAA,EAAa,CAAA;AAAA,IAClF,cACE,KAAA,CAAM,IAAA,KAAS,YAAY,KAAA,CAAM,OAAA,CAAQ,IAAI,CAAA,GACzC,IAAA,CAAK,OAAO,CAAC,CA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;AACnD;AASA,eAAsB,gBAAA,CACpB,IACA,UAAA,EAC0B;AAC1B,EAAA,MAAM,CAAC,IAAA,EAAM,KAAK,CAAA,GAAI,MAAM,OAAA,CAAQ,GAAA,CAAI,CAAC,aAAA,EAAc,EAAG,WAAA,CAAY,UAAU,CAAC,CAAC,CAAA;AAClF,EAAA,MAAM,OAAA,GAAU,MAAM,aAAA,EAAc;AACpC,EAAA,MAAM,GAAA,GAAM,MAAM,YAAA,CAAa,EAAE,CAAA;AACjC,EAAA,OAAO;AAAA,IACL,OAAA,EAAS;AAAA,MACP,GAAG,GAAA;AAAA,MACH,GAAG,IAAA,CAAK,OAAA;AAAA,MACR,GAAG,GAAA,CAAI,SAAA,EAAW,OAAA,CAAQ,OAAO,CAAA;AAAA,MACjC,GAAG,GAAA,CAAI,OAAA,EAAS,KAAA,CAAM,OAAO;AAAA,KAC/B;AAAA,IACA,KAAA,EAAO,CAAC,GAAG,IAAA,CAAK,KAAA,EAAO,GAAG,KAAA,CAAM,KAAA,EAAO,GAAG,OAAA,CAAQ,KAAK;AAAA,GACzD;AACF","file":"asset-feeds-UG3PG423.js","sourcesContent":["/**\n * asset-feeds.ts — gather installable assets from every feed the manage TUI\n * surfaces.\n *\n * Four feeds, normalized into `CatalogEntry`:\n * - **Project sources** — `skaile.yaml` `sources:` entries (scanned via\n * `AssetManager.search()`; the new `sources:` field is merged into the\n * legacy repositories map in `AssetManager.loadConfig`).\n * - **Local libraries** — user authoring places from `LocalIndex`, read through\n * `scanAuthoringLibraries` (`@skaile/workspaces/library`): the same scan\n * `library index` / `search --local` use, so publishers and refs match them\n * (per-asset `publisher_overrides` honoured), `dev_paths` assets are left out,\n * and a library that fails to scan becomes one note while the rest stay listed.\n * - **Factory assets** — the bundled first-party `factory-assets` tree\n * (`factoryAssetRoots()`), scanned from disk. Always present; no network.\n * - **Remote store** — the configured catalog source when `catalog.url` is\n * not `local`. Failures are non-fatal — they surface as notes.\n */\n\nimport * as path from \"node:path\";\nimport {\n type AssetKind,\n type CatalogEntry,\n factoryAssetRoots,\n parseRequires,\n scanRepo,\n} from \"@skaile/workspaces/core\";\nimport { getKnownKinds } from \"./open-registry.ts\";\nimport { storeNotInstallableReason } from \"./store-addable.ts\";\nimport type { DiscoveredAsset } from \"@skaile/workspaces/discovery\";\n\n/** One non-fatal note returned to the caller for surfacing in the UI. */\nexport interface FeedNote {\n feed: \"sources\" | \"libraries\" | \"store\" | \"factory\";\n message: string;\n}\n\n/**\n * Which feed an asset came from. This is the top-level grouping axis in the\n * manage TUI (\"where is this skill coming from?\") and is intentionally distinct\n * from `publisher` (asset-intrinsic identity): the same publisher can legitimately\n * appear under more than one origin (e.g. a github repo you added as a `source`\n * that is also listed in the remote `store`).\n */\nexport type AssetOrigin = \"source\" | \"library\" | \"factory\" | \"store\";\n\n/** A catalog entry tagged with the feed it was gathered from. */\nexport interface OriginEntry {\n origin: AssetOrigin;\n entry: CatalogEntry;\n /**\n * Second-level grouping label for the manage tree. Defaults (when unset) to the\n * entry's `publisher`; the source feed sets it to the source's short repo name\n * so the Sources band groups by source — \"which repo did this come from\" — not\n * by the asset-intrinsic publisher.\n */\n group?: string;\n}\n\nexport interface AssetFeedResult {\n entries: OriginEntry[];\n notes: FeedNote[];\n}\n\n/**\n * Map one discovered library asset to the `CatalogEntry` the manage rows read.\n * `publisher` is the bare per-asset publisher (what `search --local` prints),\n * `source` the manifest path. `repo` is left unset: it only feeds the Sources-tree\n * org grouping. `requires` / `dependencies` come from the manifest the way the\n * scanner fills them — string `requires:` refs parsed to `{kind, name}`, a bundle's\n * string `dependencies:` list verbatim.\n */\nfunction libraryEntryOf(asset: DiscoveredAsset): CatalogEntry {\n const { manifest } = asset;\n const nested = (manifest.metadata as Record<string, unknown> | undefined)?.requires;\n const rawRequires = manifest.requires ?? nested;\n const requireRefs =\n typeof rawRequires === \"string\"\n ? rawRequires\n : Array.isArray(rawRequires)\n ? rawRequires.filter((r): r is string => typeof r === \"string\")\n : undefined;\n const deps = manifest.dependencies;\n return {\n name: asset.name,\n kind: asset.kind as AssetKind,\n description: typeof manifest.description === \"string\" ? manifest.description : \"\",\n source: asset.manifestPath,\n publisher: asset.publisher,\n ...(asset.plugin ? { plugin: asset.plugin } : {}),\n version: asset.version,\n requires: requireRefs === undefined ? [] : parseRequires({ requires: requireRefs }),\n dependencies:\n asset.kind === \"bundle\" && Array.isArray(deps)\n ? deps.filter((d): d is string => typeof d === \"string\" && d.length > 0)\n : [],\n };\n}\n\n/**\n * Pull assets from local libraries (the authoring places under\n * `~/.skaile/libraries/<name>/`, not the `~/.skaile/cache/sources/` cache) through\n * `scanAuthoringLibraries`, grouped under the bare library name\n * (`group: <name>`) so the manage TUI shows a clean `<name>` band — no\n * `library:` prefix (mirrors the source feed). Plugin grouping (`entry.plugin`)\n * comes from `DiscoveredAsset.plugin`. A library whose scan fails becomes one\n * `FeedNote`; the outer `catch` covers only opening the index.\n */\nasync function libraryAssets(): Promise<{\n entries: OriginEntry[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n try {\n // Lazy: the library subpath pulls in SQLite, which the other feeds never need.\n const { openLibraryManager } = await import(\"./open-library.ts\");\n const { getKindRegistry } = await import(\"./open-registry.ts\");\n const { scanAuthoringLibraries } = await import(\"@skaile/workspaces/library\");\n const { library: index, close } = await openLibraryManager();\n try {\n const entries: OriginEntry[] = [];\n for (const scan of await scanAuthoringLibraries(index, getKindRegistry())) {\n if (scan.error !== undefined) {\n notes.push({ feed: \"libraries\", message: `${scan.library.name}: ${scan.error}` });\n continue;\n }\n for (const asset of scan.assets) {\n entries.push({\n origin: \"library\",\n entry: libraryEntryOf(asset),\n group: scan.library.name,\n });\n }\n }\n return { entries, notes };\n } finally {\n close();\n }\n } catch (err) {\n notes.push({\n feed: \"libraries\",\n message: err instanceof Error ? err.message : String(err),\n });\n return { entries: [], notes };\n }\n}\n\n/**\n * Pull a (best-effort) snapshot of the connected remote store catalog.\n *\n * - Returns no entries when the resolved catalog is local-only or the host\n * is unreachable (the failure becomes a note, not an exception).\n * - Maps `CatalogAsset` → `CatalogEntry`, carrying `publisher`, `repo`, and\n * `category` straight through and using `source = \"store://<id>\"`; per-file\n * `source` paths are not available for remote assets so the canonical ref is\n * a stable placeholder.\n */\nasync function storeAssets(projectDir: string): Promise<{\n entries: CatalogEntry[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n try {\n const { resolveCatalogSource } = await import(\"./open-library.ts\");\n const { source, close } = await resolveCatalogSource({ projectDir });\n try {\n // The store lists only what `skaile add` can install (see store-addable.ts).\n const assets = (await source.listAssets()).filter(\n (a) => storeNotInstallableReason(a) === undefined,\n );\n const entries: CatalogEntry[] = assets.map((a) => ({\n name: a.name,\n kind: (a.kind as AssetKind) ?? \"skill\",\n description: a.description ?? \"\",\n source: `store://${a.id}`,\n publisher: a.publisher,\n repo: a.repo,\n plugin: a.plugin,\n category: a.category,\n version: a.version,\n requires: [],\n dependencies: [],\n }));\n return { entries, notes };\n } finally {\n close();\n }\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n // Local-only catalog throws a recognizable message — silence it; absence\n // is the user's choice, not an error.\n if (!/local/i.test(msg)) {\n notes.push({ feed: \"store\", message: msg });\n }\n return { entries: [], notes };\n }\n}\n\n/** The slice of `AssetManager` the source feed needs (kept narrow for tests). */\ninterface AssetManagerLike {\n search: () => Promise<CatalogEntry[]>;\n searchRepoRoots: () => { repoName: string; root: string }[];\n}\n\n/**\n * Project-source feed: leans on `AssetManager.search()`, which merges\n * `skaile.yaml`'s `sources:` field into the repositories map. Plugin grouping\n * (`entry.plugin`) is stamped by the scanner, so entries pass through as-is.\n */\nasync function sourceAssets(am: AssetManagerLike): Promise<OriginEntry[]> {\n // The bundled factory tree is injected into the repositories map as an implicit\n // source, so `am.search()` returns it too. It has its own `factory` origin band,\n // so drop it here — otherwise the same first-party skills list twice under Sources.\n const factoryPrefixes = factoryAssetRoots().map((r) => (r.endsWith(path.sep) ? r : r + path.sep));\n const isFactoryPath = (p: string) =>\n factoryPrefixes.some((fp) => p === fp.slice(0, -1) || p.startsWith(fp));\n\n const all = (await am.search()).filter((e) => !isFactoryPath(e.source));\n const entries: OriginEntry[] = [];\n // Group each source's entries under the source node (its short repo name), not\n // the publisher: under Sources the navigational question is \"which repo did\n // this come from\". Each entry's `source` (absolute manifest path) lives under\n // exactly one declared root, so group by prefix. The cache slug is\n // URL-keyed `github.com/<org>/<repo>` — take the trailing segment.\n for (const { repoName, root } of am.searchRepoRoots()) {\n if (isFactoryPath(root)) continue;\n const prefix = root.endsWith(path.sep) ? root : root + path.sep;\n const owned = all.filter((e) => e.source === root || e.source.startsWith(prefix));\n if (owned.length === 0) continue;\n const sourceName = repoName.split(\"/\").pop() || repoName;\n for (const entry of owned) entries.push({ origin: \"source\", entry, group: sourceName });\n }\n return entries;\n}\n\n/**\n * Factory-asset feed: scan the bundled first-party `factory-assets` tree(s)\n * resolved by `factoryAssetRoots()` (the `SKAILE_FACTORY_ASSETS_DIR` override\n * layer ahead of the bundled tree). Local disk only, no network — the entries are\n * the built-in skills / connectors / bundles that ship with `@skaile/workspaces`.\n * `factoryAssetRoots()` already dedupes, so the env override pointing at the\n * bundled dir collapses to one root.\n */\nasync function factoryAssets(): Promise<{\n entries: CatalogEntry[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n try {\n const entries: CatalogEntry[] = [];\n for (const root of factoryAssetRoots()) {\n entries.push(...(await scanRepo(root, \"skaile-factory\", { knownKinds: getKnownKinds() })));\n }\n return { entries, notes };\n } catch (err) {\n notes.push({\n feed: \"factory\",\n message: err instanceof Error ? err.message : String(err),\n });\n return { entries: [], notes };\n }\n}\n\n/** Tag a flat entry list with a single origin. */\nfunction tag(origin: AssetOrigin, entries: CatalogEntry[]): OriginEntry[] {\n return entries.map((entry) => ({ origin, entry }));\n}\n\n/**\n * Run all feeds and return a single normalized result.\n *\n * Feeds run in parallel where possible — the store fetch is the slow one\n * (one HTTP call) and is fired alongside the local library walk. The factory\n * scan is local disk only, so it runs inline.\n */\nexport async function gatherAssetFeeds(\n am: AssetManagerLike,\n projectDir: string,\n): Promise<AssetFeedResult> {\n const [libs, store] = await Promise.all([libraryAssets(), storeAssets(projectDir)]);\n const factory = await factoryAssets();\n const src = await sourceAssets(am);\n return {\n entries: [\n ...src,\n ...libs.entries,\n ...tag(\"factory\", factory.entries),\n ...tag(\"store\", store.entries),\n ],\n notes: [...libs.notes, ...store.notes, ...factory.notes],\n };\n}\n"]}
1
+ {"version":3,"sources":["../cli/src/asset-feeds.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwEA,SAAS,eAAe,KAAA,EAAsC;AAC5D,EAAA,MAAM,EAAE,UAAS,GAAI,KAAA;AACrB,EAAA,MAAM,MAAA,GAAU,SAAS,QAAA,EAAkD,QAAA;AAC3E,EAAA,MAAM,WAAA,GAAc,SAAS,QAAA,IAAY,MAAA;AACzC,EAAA,MAAM,cACJ,OAAO,WAAA,KAAgB,QAAA,GACnB,WAAA,GACA,MAAM,OAAA,CAAQ,WAAW,CAAA,GACvB,WAAA,CAAY,OAAO,CAAC,CAAA,KAAmB,OAAO,CAAA,KAAM,QAAQ,CAAA,GAC5D,MAAA;AACR,EAAA,MAAM,OAAO,QAAA,CAAS,YAAA;AACtB,EAAA,OAAO;AAAA,IACL,MAAM,KAAA,CAAM,IAAA;AAAA,IACZ,MAAM,KAAA,CAAM,IAAA;AAAA,IACZ,aAAa,OAAO,QAAA,CAAS,WAAA,KAAgB,QAAA,GAAW,SAAS,WAAA,GAAc,EAAA;AAAA,IAC/E,QAAQ,KAAA,CAAM,YAAA;AAAA,IACd,WAAW,KAAA,CAAM,SAAA;AAAA,IACjB,GAAI,MAAM,MAAA,GAAS,EAAE,QAAQ,KAAA,CAAM,MAAA,KAAW,EAAC;AAAA,IAC/C,SAAS,KAAA,CAAM,OAAA;AAAA,IACf,QAAA,EAAU,gBAAgB,MAAA,GAAY,KAAK,aAAA,CAAc,EA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M;AAAA,EAC9B;AACF;AAGA,SAAS,GAAA,CAAI,QAAqB,OAAA,EAAwC;AACxE,EAAA,OAAO,QAAQ,GAAA,CAAI,CAAC,WAAW,EAAE,MAAA,EAAQ,OAAM,CAAE,CAAA;AACnD;AASA,eAAsB,gBAAA,CACpB,IACA,UAAA,EAC0B;AAC1B,EAAA,MAAM,CAAC,IAAA,EAAM,KAAK,CAAA,GAAI,MAAM,OAAA,CAAQ,GAAA,CAAI,CAAC,aAAA,EAAc,EAAG,WAAA,CAAY,UAAU,CAAC,CAAC,CAAA;AAClF,EAAA,MAAM,OAAA,GAAU,MAAM,aAAA,EAAc;AACpC,EAAA,MAAM,GAAA,GAAM,MAAM,YAAA,CAAa,EAAE,CAAA;AACjC,EAAA,OAAO;AAAA,IACL,OAAA,EAAS;AAAA,MACP,GAAG,GAAA;AAAA,MACH,GAAG,IAAA,CAAK,OAAA;AAAA,MACR,GAAG,GAAA,CAAI,SAAA,EAAW,OAAA,CAAQ,OAAO,CAAA;AAAA,MACjC,GAAG,GAAA,CAAI,OAAA,EAAS,KAAA,CAAM,OAAO;AAAA,KAC/B;AAAA,IACA,KAAA,EAAO,CAAC,GAAG,IAAA,CAAK,KAAA,EAAO,GAAG,KAAA,CAAM,KAAA,EAAO,GAAG,OAAA,CAAQ,KAAK;AAAA,GACzD;AACF","file":"asset-feeds-PO2WC75V.js","sourcesContent":["/**\n * asset-feeds.ts — gather installable assets from every feed the manage TUI\n * surfaces.\n *\n * Four feeds, normalized into `CatalogEntry`:\n * - **Project sources** — `skaile.yaml` `sources:` entries (scanned via\n * `AssetManager.search()`; the new `sources:` field is merged into the\n * legacy repositories map in `AssetManager.loadConfig`).\n * - **Local libraries** — user authoring places from `LocalIndex`, read through\n * `scanAuthoringLibraries` (`@skaile/workspaces/library`): the same scan\n * `library index` / `search --local` use, so publishers and refs match them\n * (per-asset `publisher_overrides` honoured), `dev_paths` assets are left out,\n * and a library that fails to scan becomes one note while the rest stay listed.\n * - **Factory assets** — the bundled first-party `factory-assets` tree\n * (`factoryAssetRoots()`), scanned from disk. Always present; no network.\n * - **Remote store** — the configured catalog source when `catalog.url` is\n * not `local`. Failures are non-fatal — they surface as notes.\n */\n\nimport * as path from \"node:path\";\nimport {\n type AssetKind,\n type CatalogEntry,\n factoryAssetRoots,\n parseRequires,\n scanRepo,\n} from \"@skaile/workspaces/core\";\nimport { getKnownKinds } from \"./open-registry.ts\";\nimport { storeNotInstallableReason } from \"./store-addable.ts\";\nimport type { DiscoveredAsset } from \"@skaile/workspaces/discovery\";\n\n/** One non-fatal note returned to the caller for surfacing in the UI. */\nexport interface FeedNote {\n feed: \"sources\" | \"libraries\" | \"store\" | \"factory\";\n message: string;\n}\n\n/**\n * Which feed an asset came from. This is the top-level grouping axis in the\n * manage TUI (\"where is this skill coming from?\") and is intentionally distinct\n * from `publisher` (asset-intrinsic identity): the same publisher can legitimately\n * appear under more than one origin (e.g. a github repo you added as a `source`\n * that is also listed in the remote `store`).\n */\nexport type AssetOrigin = \"source\" | \"library\" | \"factory\" | \"store\";\n\n/** A catalog entry tagged with the feed it was gathered from. */\nexport interface OriginEntry {\n origin: AssetOrigin;\n entry: CatalogEntry;\n /**\n * Second-level grouping label for the manage tree. Defaults (when unset) to the\n * entry's `publisher`; the source feed sets it to the source's short repo name\n * so the Sources band groups by source — \"which repo did this come from\" — not\n * by the asset-intrinsic publisher.\n */\n group?: string;\n}\n\nexport interface AssetFeedResult {\n entries: OriginEntry[];\n notes: FeedNote[];\n}\n\n/**\n * Map one discovered library asset to the `CatalogEntry` the manage rows read.\n * `publisher` is the bare per-asset publisher (what `search --local` prints),\n * `source` the manifest path. `repo` is left unset: it only feeds the Sources-tree\n * org grouping. `requires` / `dependencies` come from the manifest the way the\n * scanner fills them — string `requires:` refs parsed to `{kind, name}`, a bundle's\n * string `dependencies:` list verbatim.\n */\nfunction libraryEntryOf(asset: DiscoveredAsset): CatalogEntry {\n const { manifest } = asset;\n const nested = (manifest.metadata as Record<string, unknown> | undefined)?.requires;\n const rawRequires = manifest.requires ?? nested;\n const requireRefs =\n typeof rawRequires === \"string\"\n ? rawRequires\n : Array.isArray(rawRequires)\n ? rawRequires.filter((r): r is string => typeof r === \"string\")\n : undefined;\n const deps = manifest.dependencies;\n return {\n name: asset.name,\n kind: asset.kind as AssetKind,\n description: typeof manifest.description === \"string\" ? manifest.description : \"\",\n source: asset.manifestPath,\n publisher: asset.publisher,\n ...(asset.plugin ? { plugin: asset.plugin } : {}),\n version: asset.version,\n requires: requireRefs === undefined ? [] : parseRequires({ requires: requireRefs }),\n dependencies:\n asset.kind === \"bundle\" && Array.isArray(deps)\n ? deps.filter((d): d is string => typeof d === \"string\" && d.length > 0)\n : [],\n };\n}\n\n/**\n * Pull assets from local libraries (the authoring places under\n * `~/.skaile/libraries/<name>/`, not the `~/.skaile/cache/sources/` cache) through\n * `scanAuthoringLibraries`, grouped under the bare library name\n * (`group: <name>`) so the manage TUI shows a clean `<name>` band — no\n * `library:` prefix (mirrors the source feed). Plugin grouping (`entry.plugin`)\n * comes from `DiscoveredAsset.plugin`. A library whose scan fails becomes one\n * `FeedNote`; the outer `catch` covers only opening the index.\n */\nasync function libraryAssets(): Promise<{\n entries: OriginEntry[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n try {\n // Lazy: the library subpath pulls in SQLite, which the other feeds never need.\n const { openLibraryManager } = await import(\"./open-library.ts\");\n const { getKindRegistry } = await import(\"./open-registry.ts\");\n const { scanAuthoringLibraries } = await import(\"@skaile/workspaces/library\");\n const { library: index, close } = await openLibraryManager();\n try {\n const entries: OriginEntry[] = [];\n for (const scan of await scanAuthoringLibraries(index, getKindRegistry())) {\n if (scan.error !== undefined) {\n notes.push({ feed: \"libraries\", message: `${scan.library.name}: ${scan.error}` });\n continue;\n }\n for (const asset of scan.assets) {\n entries.push({\n origin: \"library\",\n entry: libraryEntryOf(asset),\n group: scan.library.name,\n });\n }\n }\n return { entries, notes };\n } finally {\n close();\n }\n } catch (err) {\n notes.push({\n feed: \"libraries\",\n message: err instanceof Error ? err.message : String(err),\n });\n return { entries: [], notes };\n }\n}\n\n/**\n * Pull a (best-effort) snapshot of the connected remote store catalog.\n *\n * - Returns no entries when the resolved catalog is local-only or the host\n * is unreachable (the failure becomes a note, not an exception).\n * - Maps `CatalogAsset` → `CatalogEntry`, carrying `publisher`, `repo`, and\n * `category` straight through and using `source = \"store://<id>\"`; per-file\n * `source` paths are not available for remote assets so the canonical ref is\n * a stable placeholder.\n */\nasync function storeAssets(projectDir: string): Promise<{\n entries: CatalogEntry[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n try {\n const { resolveCatalogSource } = await import(\"./open-library.ts\");\n const { source, close } = await resolveCatalogSource({ projectDir });\n try {\n // The store lists only what `skaile add` can install (see store-addable.ts).\n const assets = (await source.listAssets()).filter(\n (a) => storeNotInstallableReason(a) === undefined,\n );\n const entries: CatalogEntry[] = assets.map((a) => ({\n name: a.name,\n kind: (a.kind as AssetKind) ?? \"skill\",\n description: a.description ?? \"\",\n source: `store://${a.id}`,\n publisher: a.publisher,\n repo: a.repo,\n plugin: a.plugin,\n category: a.category,\n version: a.version,\n requires: [],\n dependencies: [],\n }));\n return { entries, notes };\n } finally {\n close();\n }\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n // Local-only catalog throws a recognizable message — silence it; absence\n // is the user's choice, not an error.\n if (!/local/i.test(msg)) {\n notes.push({ feed: \"store\", message: msg });\n }\n return { entries: [], notes };\n }\n}\n\n/** The slice of `AssetManager` the source feed needs (kept narrow for tests). */\ninterface AssetManagerLike {\n search: () => Promise<CatalogEntry[]>;\n searchRepoRoots: () => { repoName: string; root: string }[];\n}\n\n/**\n * Project-source feed: leans on `AssetManager.search()`, which merges\n * `skaile.yaml`'s `sources:` field into the repositories map. Plugin grouping\n * (`entry.plugin`) is stamped by the scanner, so entries pass through as-is.\n */\nasync function sourceAssets(am: AssetManagerLike): Promise<OriginEntry[]> {\n // The bundled factory tree is injected into the repositories map as an implicit\n // source, so `am.search()` returns it too. It has its own `factory` origin band,\n // so drop it here — otherwise the same first-party skills list twice under Sources.\n const factoryPrefixes = factoryAssetRoots().map((r) => (r.endsWith(path.sep) ? r : r + path.sep));\n const isFactoryPath = (p: string) =>\n factoryPrefixes.some((fp) => p === fp.slice(0, -1) || p.startsWith(fp));\n\n const all = (await am.search()).filter((e) => !isFactoryPath(e.source));\n const entries: OriginEntry[] = [];\n // Group each source's entries under the source node (its short repo name), not\n // the publisher: under Sources the navigational question is \"which repo did\n // this come from\". Each entry's `source` (absolute manifest path) lives under\n // exactly one declared root, so group by prefix. The cache slug is\n // URL-keyed `github.com/<org>/<repo>` — take the trailing segment.\n for (const { repoName, root } of am.searchRepoRoots()) {\n if (isFactoryPath(root)) continue;\n const prefix = root.endsWith(path.sep) ? root : root + path.sep;\n const owned = all.filter((e) => e.source === root || e.source.startsWith(prefix));\n if (owned.length === 0) continue;\n const sourceName = repoName.split(\"/\").pop() || repoName;\n for (const entry of owned) entries.push({ origin: \"source\", entry, group: sourceName });\n }\n return entries;\n}\n\n/**\n * Factory-asset feed: scan the bundled first-party `factory-assets` tree(s)\n * resolved by `factoryAssetRoots()` (the `SKAILE_FACTORY_ASSETS_DIR` override\n * layer ahead of the bundled tree). Local disk only, no network — the entries are\n * the built-in skills / connectors / bundles that ship with `@skaile/workspaces`.\n * `factoryAssetRoots()` already dedupes, so the env override pointing at the\n * bundled dir collapses to one root.\n */\nasync function factoryAssets(): Promise<{\n entries: CatalogEntry[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n try {\n const entries: CatalogEntry[] = [];\n for (const root of factoryAssetRoots()) {\n entries.push(...(await scanRepo(root, \"skaile-factory\", { knownKinds: getKnownKinds() })));\n }\n return { entries, notes };\n } catch (err) {\n notes.push({\n feed: \"factory\",\n message: err instanceof Error ? err.message : String(err),\n });\n return { entries: [], notes };\n }\n}\n\n/** Tag a flat entry list with a single origin. */\nfunction tag(origin: AssetOrigin, entries: CatalogEntry[]): OriginEntry[] {\n return entries.map((entry) => ({ origin, entry }));\n}\n\n/**\n * Run all feeds and return a single normalized result.\n *\n * Feeds run in parallel where possible — the store fetch is the slow one\n * (one HTTP call) and is fired alongside the local library walk. The factory\n * scan is local disk only, so it runs inline.\n */\nexport async function gatherAssetFeeds(\n am: AssetManagerLike,\n projectDir: string,\n): Promise<AssetFeedResult> {\n const [libs, store] = await Promise.all([libraryAssets(), storeAssets(projectDir)]);\n const factory = await factoryAssets();\n const src = await sourceAssets(am);\n return {\n entries: [\n ...src,\n ...libs.entries,\n ...tag(\"factory\", factory.entries),\n ...tag(\"store\", store.entries),\n ],\n notes: [...libs.notes, ...store.notes, ...factory.notes],\n };\n}\n"]}
@@ -1,6 +1,6 @@
1
- export { AssetManager, LibraryEntryError, MissingManifestError, harnessSwitchKeptKey, harnessSwitchStateFile, installAgentInstances, labelDiffHeaders, mcpNotRunnableReason, normalizeRepoUrl, parseCanonicalLockKey, parseRefTolerant, readHarnessSwitchState, renderMcpServerConfig, setLibraryAssetCheck, setRenamedEntryLookup, softDepName, writeHarnessSwitchState } from '../chunk-4I4SBOCS.js';
2
- import '../chunk-FXBKBOI5.js';
3
- import '../chunk-RZ5R6GDJ.js';
1
+ export { AssetManager, LibraryEntryError, MissingManifestError, harnessSwitchKeptKey, harnessSwitchStateFile, installAgentInstances, labelDiffHeaders, mcpNotRunnableReason, normalizeRepoUrl, parseCanonicalLockKey, parseRefTolerant, readHarnessSwitchState, renderMcpServerConfig, setLibraryAssetCheck, setRenamedEntryLookup, softDepName, writeHarnessSwitchState } from '../chunk-IIELRGIZ.js';
2
+ import '../chunk-7FXOOUOC.js';
3
+ import '../chunk-DRUAQ7IY.js';
4
4
  import '../chunk-CVUMZTNO.js';
5
5
  import '../chunk-F3D25RGM.js';
6
6
  import '../chunk-3TXEJN4W.js';
@@ -8,12 +8,12 @@ import '../chunk-ISHJITXJ.js';
8
8
  import '../chunk-LNFKL23K.js';
9
9
  import '../chunk-JRN5QF4C.js';
10
10
  import '../chunk-NUELZWCF.js';
11
- export { SCAFFOLD_KINDS, createScaffold, deployAll, installAgent, installTargetOf, removeAsset } from '../chunk-KRL53RZB.js';
11
+ export { SCAFFOLD_KINDS, createScaffold, deployAll, installAgent, installTargetOf, removeAsset } from '../chunk-7LJUK5JK.js';
12
12
  export { BUILT_IN_FRAGMENTS, loadPromptExtensions, resolveFragments } from '../chunk-PKE3PXOK.js';
13
13
  export { appendHistory, clearHistory, getRecentHistory, loadHistory } from '../chunk-LKBRBVVS.js';
14
14
  import '../chunk-UQ6LFBPZ.js';
15
- export { AGENT_RENDERERS, claudeCodeRenderer, codexRenderer, harnessTargetSupportsAgents, ompRenderer, renderAgentToFramework } from '../chunk-R3ZNAPBV.js';
16
- import '../chunk-WS3BOCAT.js';
15
+ export { AGENT_RENDERERS, claudeCodeRenderer, codexRenderer, harnessTargetSupportsAgents, ompRenderer, renderAgentToFramework } from '../chunk-7VBD5XUM.js';
16
+ import '../chunk-LCXQ4LVP.js';
17
17
  export { FACTORY_SOURCE_URL } from '../chunk-MEU2HHGV.js';
18
18
  import '../chunk-4GY63JU6.js';
19
19
  import '../chunk-CJO3XKO7.js';
@@ -1,7 +1,7 @@
1
- export { SCAFFOLD_KINDS, assertNoLibrarySymlinks, cachedComposedFiles, canonicalEntryRef, composedDriftRefs, createScaffold, deployAll, deployAsset, deployedAssetDrift, diffDeployedAgent, entriesNeedingDeploy, installTargetOf, readKeptLegacyCopies, removeAsset, sourceComposedFiles, writeKeptLegacyCopies } from '../chunk-KRL53RZB.js';
1
+ export { SCAFFOLD_KINDS, assertNoLibrarySymlinks, cachedComposedFiles, canonicalEntryRef, composedDriftRefs, createScaffold, deployAll, deployAsset, deployedAssetDrift, diffDeployedAgent, entriesNeedingDeploy, installTargetOf, readKeptLegacyCopies, removeAsset, sourceComposedFiles, writeKeptLegacyCopies } from '../chunk-7LJUK5JK.js';
2
2
  import '../chunk-PKE3PXOK.js';
3
- import '../chunk-R3ZNAPBV.js';
4
- import '../chunk-WS3BOCAT.js';
3
+ import '../chunk-7VBD5XUM.js';
4
+ import '../chunk-LCXQ4LVP.js';
5
5
  import '../chunk-MEU2HHGV.js';
6
6
  import '../chunk-4GY63JU6.js';
7
7
  import '../chunk-CJO3XKO7.js';
@@ -1,5 +1,5 @@
1
- export { AGENT_RENDERERS, CODEX_IDENTITY_DIR, agentRenderFiles, claudeCodeRenderer, codexRenderer, harnessTargetSupportsAgents, ompRenderer, renderAgentToFramework } from '../chunk-R3ZNAPBV.js';
2
- import '../chunk-WS3BOCAT.js';
1
+ export { AGENT_RENDERERS, CODEX_IDENTITY_DIR, agentRenderFiles, claudeCodeRenderer, codexRenderer, harnessTargetSupportsAgents, ompRenderer, renderAgentToFramework } from '../chunk-7VBD5XUM.js';
2
+ import '../chunk-LCXQ4LVP.js';
3
3
  import '../chunk-MEU2HHGV.js';
4
4
  import '../chunk-4GY63JU6.js';
5
5
  import '../chunk-CJO3XKO7.js';
@@ -1,17 +1,17 @@
1
1
  import { formatDroppedToolsNotice, filterInProcessMcpServerTools, checkToolPropertyKeys, TOOL_PROPERTY_KEY_PATTERN } from '../../chunk-3X7VTCPG.js';
2
2
  import { AskSlots } from '../../chunk-3TG2NV2F.js';
3
- import { scrubPoisonedTranscript, transcriptStoreForRuntime, resolveClaudeConfigDir, unsupportedSurfaceNotice, claudeEndpointMode, buildClaudeEndpointEnv, APPROVE_ONCE, DENY } from '../../chunk-PSPFWTJI.js';
3
+ import { scrubPoisonedTranscript, transcriptStoreForRuntime, resolveClaudeConfigDir, unsupportedSurfaceNotice, claudeEndpointMode, buildClaudeEndpointEnv, APPROVE_ONCE, DENY } from '../../chunk-MRTOKIEJ.js';
4
4
  import { freshBudget, isFirstAttempt, spend, isSpent, decide, isAvailable } from '../../chunk-7EKQDY2T.js';
5
- import { dispatchCapability } from '../../chunk-YEOG7CWQ.js';
6
- import { fetchProviderModels } from '../../chunk-3AIEJSQR.js';
5
+ import { dispatchCapability } from '../../chunk-7ZL23M3X.js';
6
+ import { fetchProviderModels } from '../../chunk-ESUF2ZYT.js';
7
7
  import { ReconfigureLedger, AuthError, stripRunnerPrivateEnv, classifyClaudeSdkError, reclassifyAuthAsAccountUnavailable, AccountUnavailableError, isLongContextEntitlementRejection, LONG_CONTEXT_CREDITS_API_ERROR } from '../../chunk-5DE3DGVR.js';
8
8
  import { agentExecRequested, wrapAgentCommand, resolveAgentExec } from '../../chunk-7DN6JKP2.js';
9
- import { AgentHarness, getBridgeLogger, registryHarnessConfig } from '../../chunk-NFFBYG2W.js';
10
- import { BUILTIN_HARNESS_CATALOG, entryCredentialValue } from '../../chunk-KE5HDORU.js';
9
+ import { AgentHarness, getBridgeLogger, registryHarnessConfig } from '../../chunk-PZS55HOX.js';
10
+ import { BUILTIN_HARNESS_CATALOG, entryCredentialValue } from '../../chunk-S6NS3I3P.js';
11
11
  import '../../chunk-G5SUWZEU.js';
12
12
  import '../../chunk-6UP2EDFN.js';
13
- import { withActivityLabelShape } from '../../chunk-7NN3P6VF.js';
14
- import '../../chunk-WS3BOCAT.js';
13
+ import { withActivityLabelShape } from '../../chunk-342UX2MG.js';
14
+ import '../../chunk-LCXQ4LVP.js';
15
15
  import { loadHarnessSdk } from '../../chunk-MEU2HHGV.js';
16
16
  import '../../chunk-4GY63JU6.js';
17
17
  import '../../chunk-CJO3XKO7.js';
@@ -1,14 +1,14 @@
1
- export { CodexHarness, checkCodexCredential, codexHarnessTarget, isManagedCodexConfig } from '../../chunk-HLFLET7S.js';
1
+ export { CodexHarness, checkCodexCredential, codexHarnessTarget, isManagedCodexConfig } from '../../chunk-WCHGUS7X.js';
2
2
  import '../../chunk-5KSGZP3E.js';
3
3
  import '../../chunk-7EKQDY2T.js';
4
- import '../../chunk-3AIEJSQR.js';
4
+ import '../../chunk-ESUF2ZYT.js';
5
5
  import '../../chunk-5DE3DGVR.js';
6
6
  import '../../chunk-7DN6JKP2.js';
7
- import '../../chunk-NFFBYG2W.js';
8
- import '../../chunk-KE5HDORU.js';
7
+ import '../../chunk-PZS55HOX.js';
8
+ import '../../chunk-S6NS3I3P.js';
9
9
  import '../../chunk-G5SUWZEU.js';
10
10
  import '../../chunk-6UP2EDFN.js';
11
- import '../../chunk-WS3BOCAT.js';
11
+ import '../../chunk-LCXQ4LVP.js';
12
12
  import '../../chunk-MEU2HHGV.js';
13
13
  import '../../chunk-4GY63JU6.js';
14
14
  import '../../chunk-CJO3XKO7.js';
@@ -1,11 +1,11 @@
1
1
  import { harnessSessionConfigHome, removeSessionConfigFile, writeSessionConfigFile } from '../../chunk-NBAGV6L2.js';
2
- import { SubprocessCliHarness, extractText, extractCost, extractTokens } from '../../chunk-5JBMYZNA.js';
2
+ import { SubprocessCliHarness, extractText, extractCost, extractTokens } from '../../chunk-GODUKPGD.js';
3
3
  import { HARNESS_BINARIES } from '../../chunk-WWSRIT3J.js';
4
- import { resolveEnvHarnessSession, continueRoleBinding, credentialsForEveryProvider, registryModelEntries, selectableEntries, entrySurface, harnessProviderName, entryBaseUrl, versionedAnthropicBaseUrl } from '../../chunk-RTFH2QR2.js';
4
+ import { resolveEnvHarnessSession, continueRoleBinding, credentialsForEveryProvider, registryModelEntries, selectableEntries, entrySurface, harnessProviderName, entryBaseUrl, versionedAnthropicBaseUrl } from '../../chunk-CLMIZ4N6.js';
5
5
  import '../../chunk-5DE3DGVR.js';
6
6
  import '../../chunk-7DN6JKP2.js';
7
- import { getBridgeLogger, registryHarnessConfig } from '../../chunk-NFFBYG2W.js';
8
- import { BUILTIN_HARNESS_CATALOG, entryCredentialValue, providerCredentialEnvName } from '../../chunk-KE5HDORU.js';
7
+ import { getBridgeLogger, registryHarnessConfig } from '../../chunk-PZS55HOX.js';
8
+ import { BUILTIN_HARNESS_CATALOG, entryCredentialValue, providerCredentialEnvName } from '../../chunk-S6NS3I3P.js';
9
9
  import '../../chunk-G5SUWZEU.js';
10
10
  import '../../chunk-6UP2EDFN.js';
11
11
  import '../../chunk-MEU2HHGV.js';
@@ -1,9 +1,9 @@
1
- import { dispatchCapability } from '../../chunk-YEOG7CWQ.js';
2
- import { AgentHarness, getBridgeLogger, registryHarnessConfig } from '../../chunk-NFFBYG2W.js';
3
- import { BUILTIN_HARNESS_CATALOG } from '../../chunk-KE5HDORU.js';
1
+ import { dispatchCapability } from '../../chunk-7ZL23M3X.js';
2
+ import { AgentHarness, getBridgeLogger, registryHarnessConfig } from '../../chunk-PZS55HOX.js';
3
+ import { BUILTIN_HARNESS_CATALOG } from '../../chunk-S6NS3I3P.js';
4
4
  import '../../chunk-G5SUWZEU.js';
5
5
  import '../../chunk-6UP2EDFN.js';
6
- import '../../chunk-7NN3P6VF.js';
6
+ import '../../chunk-342UX2MG.js';
7
7
  import '../../chunk-VSX2G7LA.js';
8
8
  import '../../chunk-RXGPFAMN.js';
9
9
  import '../../chunk-RZL4TOK3.js';
@@ -1,15 +1,15 @@
1
- export { GeminiFamilyHarness, GeminiHarness, geminiHarnessTarget } from '../../chunk-BCID52M5.js';
2
- import '../../chunk-5JBMYZNA.js';
3
- import '../../chunk-3AIEJSQR.js';
1
+ export { GeminiFamilyHarness, GeminiHarness, geminiHarnessTarget } from '../../chunk-YPX7LQSW.js';
2
+ import '../../chunk-GODUKPGD.js';
3
+ import '../../chunk-ESUF2ZYT.js';
4
4
  import '../../chunk-WWSRIT3J.js';
5
- import '../../chunk-RTFH2QR2.js';
5
+ import '../../chunk-CLMIZ4N6.js';
6
6
  import '../../chunk-5DE3DGVR.js';
7
7
  import '../../chunk-7DN6JKP2.js';
8
- import '../../chunk-NFFBYG2W.js';
9
- import '../../chunk-KE5HDORU.js';
8
+ import '../../chunk-PZS55HOX.js';
9
+ import '../../chunk-S6NS3I3P.js';
10
10
  import '../../chunk-G5SUWZEU.js';
11
11
  import '../../chunk-6UP2EDFN.js';
12
- import '../../chunk-WS3BOCAT.js';
12
+ import '../../chunk-LCXQ4LVP.js';
13
13
  import '../../chunk-VSX2G7LA.js';
14
14
  import '../../chunk-RXGPFAMN.js';
15
15
  import '../../chunk-RZL4TOK3.js';
@@ -1,11 +1,11 @@
1
1
  import { harnessSessionConfigHome, pruneSessionConfigDir, writeSessionConfigFile } from '../../chunk-NBAGV6L2.js';
2
- import { SubprocessCliHarness, extractText, extractCost, extractTokens } from '../../chunk-5JBMYZNA.js';
2
+ import { SubprocessCliHarness, extractText, extractCost, extractTokens } from '../../chunk-GODUKPGD.js';
3
3
  import { HARNESS_BINARIES } from '../../chunk-WWSRIT3J.js';
4
- import { resolveEnvHarnessSession, resolveRegistryBinding, credentialsForEveryProvider, registryModelEntries, selectableEntries, isStockCatalogEndpoint, entrySurface, entryBaseUrl, entryModelIds } from '../../chunk-RTFH2QR2.js';
4
+ import { resolveEnvHarnessSession, resolveRegistryBinding, credentialsForEveryProvider, registryModelEntries, selectableEntries, isStockCatalogEndpoint, entrySurface, entryBaseUrl, entryModelIds } from '../../chunk-CLMIZ4N6.js';
5
5
  import '../../chunk-5DE3DGVR.js';
6
6
  import '../../chunk-7DN6JKP2.js';
7
- import { getBridgeLogger, registryHarnessConfig } from '../../chunk-NFFBYG2W.js';
8
- import { BUILTIN_HARNESS_CATALOG, providerCredentialEnvName } from '../../chunk-KE5HDORU.js';
7
+ import { getBridgeLogger, registryHarnessConfig } from '../../chunk-PZS55HOX.js';
8
+ import { BUILTIN_HARNESS_CATALOG, providerCredentialEnvName } from '../../chunk-S6NS3I3P.js';
9
9
  import '../../chunk-G5SUWZEU.js';
10
10
  import '../../chunk-6UP2EDFN.js';
11
11
  import '../../chunk-MEU2HHGV.js';
@@ -1,15 +1,15 @@
1
1
  import { checkToolInputSchema } from '../../chunk-3X7VTCPG.js';
2
- import { materializeOmpProviders, isCredentialOmissionWarning, materializeOmpIdentityDir, registryModelEntries } from '../../chunk-JDZUQFN7.js';
3
- import { dispatchCapability } from '../../chunk-YEOG7CWQ.js';
2
+ import { materializeOmpProviders, isCredentialOmissionWarning, materializeOmpIdentityDir, registryModelEntries } from '../../chunk-4NJVF3DV.js';
3
+ import { dispatchCapability } from '../../chunk-7ZL23M3X.js';
4
4
  import { HARNESS_BINARIES } from '../../chunk-WWSRIT3J.js';
5
- import '../../chunk-RTFH2QR2.js';
5
+ import '../../chunk-CLMIZ4N6.js';
6
6
  import { RUNNER_AGENT_ENV_KEYS, ReconfigureLedger, stripRunnerPrivateEnv, classifyGenericErrorMessage } from '../../chunk-5DE3DGVR.js';
7
7
  import { wrapAgentCommand, resolveAgentExec } from '../../chunk-7DN6JKP2.js';
8
- import { AgentHarness, getBridgeLogger, TOOL_ALLOWLIST_UNSUPPORTED, registryHarnessConfig } from '../../chunk-NFFBYG2W.js';
9
- import { BUILTIN_HARNESS_CATALOG } from '../../chunk-KE5HDORU.js';
8
+ import { AgentHarness, getBridgeLogger, TOOL_ALLOWLIST_UNSUPPORTED, registryHarnessConfig } from '../../chunk-PZS55HOX.js';
9
+ import { BUILTIN_HARNESS_CATALOG } from '../../chunk-S6NS3I3P.js';
10
10
  import '../../chunk-G5SUWZEU.js';
11
11
  import '../../chunk-6UP2EDFN.js';
12
- import { withActivityLabelJsonSchema } from '../../chunk-7NN3P6VF.js';
12
+ import { withActivityLabelJsonSchema } from '../../chunk-342UX2MG.js';
13
13
  import '../../chunk-VSX2G7LA.js';
14
14
  import '../../chunk-RXGPFAMN.js';
15
15
  import '../../chunk-RZL4TOK3.js';
@@ -118,6 +118,15 @@ function buildOmpToolArgs(tools) {
118
118
  return ["--tools", effective.join(",")];
119
119
  }
120
120
  var OMP_HOST_TOOL_NAME_MAX = 64;
121
+ function hostAllowedPatternToRegExp(pattern) {
122
+ const body = pattern.split("*").map((part) => part.replace(/[.+?^${}()|[\]\\/-]/g, "\\$&")).join(".*");
123
+ return new RegExp(`^${body}$`, "s");
124
+ }
125
+ function filterHostTools(tools, hostAllowed) {
126
+ if (hostAllowed === void 0) return [...tools];
127
+ const patterns = hostAllowed.map(hostAllowedPatternToRegExp);
128
+ return tools.filter((tool) => patterns.some((re) => re.test(tool.name)));
129
+ }
121
130
  function buildOmpHostTools(tools) {
122
131
  const taken = new Set(OMP_BUILTIN_TOOLS);
123
132
  const out = { definitions: [], capabilityNames: /* @__PURE__ */ new Map(), dropped: [] };
@@ -128,7 +137,7 @@ function buildOmpHostTools(tools) {
128
137
  out.dropped.push({ tool: tool.name, reason });
129
138
  continue;
130
139
  }
131
- const base = tool.name.replace(/[^a-zA-Z0-9_-]/g, "_").slice(0, OMP_HOST_TOOL_NAME_MAX) || "capability";
140
+ const base = tool.name.replace(/[^a-zA-Z0-9_-]/g, "_").replace(/^mcp__/, "host__").slice(0, OMP_HOST_TOOL_NAME_MAX) || "capability";
132
141
  let name = base;
133
142
  for (let n = 2; taken.has(name); n++) {
134
143
  const suffix = `_${n}`;
@@ -715,7 +724,9 @@ var OmpHarness = class extends AgentHarness {
715
724
  async syncHostTools() {
716
725
  const hooks = this.config.capabilities;
717
726
  if (!hooks || !this.proc) return;
718
- const set = buildOmpHostTools(hooks.composeTools());
727
+ const set = buildOmpHostTools(
728
+ filterHostTools(hooks.composeTools(), this.config.tools?.host_allowed)
729
+ );
719
730
  for (const { tool, reason } of set.dropped) {
720
731
  const key = `${tool}\0${reason}`;
721
732
  if (this.warnedDroppedHostTools.has(key)) continue;
@@ -753,8 +764,28 @@ var OmpHarness = class extends AgentHarness {
753
764
  const id = event.id;
754
765
  if (typeof id !== "string") return;
755
766
  const hostName = typeof event.toolName === "string" ? event.toolName : "";
756
- const name = this.hostToolCapabilities.get(hostName) ?? hostName;
757
767
  const callId = typeof event.toolCallId === "string" ? event.toolCallId : id;
768
+ const name = this.hostToolCapabilities.get(hostName);
769
+ if (name === void 0) {
770
+ this.log.warn("host tool call rejected: not registered", { tool: hostName });
771
+ try {
772
+ this.send({
773
+ type: "host_tool_result",
774
+ id,
775
+ result: {
776
+ content: [{ type: "text", text: `Error: host tool "${hostName}" is not available` }]
777
+ },
778
+ isError: true
779
+ });
780
+ } catch (err) {
781
+ this.log.warn("host tool result undeliverable", {
782
+ tool: hostName,
783
+ callId,
784
+ error: String(err)
785
+ });
786
+ }
787
+ return;
788
+ }
758
789
  const input = event.arguments ?? {};
759
790
  const hooks = this.config.capabilities;
760
791
  const controller = new AbortController();
@@ -1622,6 +1653,6 @@ var ompHarnessTarget = {
1622
1653
  }).listModels()
1623
1654
  };
1624
1655
 
1625
- export { OMP_BUILTIN_TOOLS, OMP_DEFAULT_TOOLS, OMP_THINKING_LEVELS, OmpHarness, buildOmpChildEnv, buildOmpHostTools, buildOmpToolArgs, describeOmpEvent, ompCredentialMessage, ompHarnessTarget, ompStartFailureCause, ompThinkingLevel, splitOmpModel };
1656
+ export { OMP_BUILTIN_TOOLS, OMP_DEFAULT_TOOLS, OMP_THINKING_LEVELS, OmpHarness, buildOmpChildEnv, buildOmpHostTools, buildOmpToolArgs, describeOmpEvent, filterHostTools, ompCredentialMessage, ompHarnessTarget, ompStartFailureCause, ompThinkingLevel, splitOmpModel };
1626
1657
  //# sourceMappingURL=omp.js.map
1627
1658
  //# sourceMappingURL=omp.js.map