nexus-agents 8.113.0 → 8.114.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 (779) hide show
  1. package/dist/{ast-rule-runner-KTQIW2FG.js → ast-rule-runner-ROCJS5V5.js} +3 -3
  2. package/dist/{child-mcp-config-J7HNH7OD.js → child-mcp-config-CLT4G6JV.js} +2 -2
  3. package/dist/{chunk-E6R7WAEO.js → chunk-2PTEHHTT.js} +3 -3
  4. package/dist/{chunk-QP2T4IAT.js → chunk-2RXTHEUD.js} +6 -43
  5. package/dist/chunk-2RXTHEUD.js.map +1 -0
  6. package/dist/{chunk-LXBGTBH6.js → chunk-5TRZCY36.js} +2 -2
  7. package/dist/{chunk-PXLLBDNC.js → chunk-67GC5TY5.js} +5 -5
  8. package/dist/{chunk-4VSMZEBT.js → chunk-6RN764V2.js} +64 -33
  9. package/dist/chunk-6RN764V2.js.map +1 -0
  10. package/dist/{chunk-ACT5JK5R.js → chunk-7LBOZF2X.js} +5 -5
  11. package/dist/{chunk-6IGSOP2F.js → chunk-7S7DKO4D.js} +1563 -141
  12. package/dist/chunk-7S7DKO4D.js.map +1 -0
  13. package/dist/{chunk-QXWFJE6X.js → chunk-ATDFYA5W.js} +2 -2
  14. package/dist/{chunk-MRE25UI7.js → chunk-AVTM3R4Z.js} +28 -14
  15. package/dist/chunk-AVTM3R4Z.js.map +1 -0
  16. package/dist/{chunk-7443T7NN.js → chunk-CKPFNZZM.js} +2 -2
  17. package/dist/{chunk-6S2VMUGZ.js → chunk-DP7JQSU7.js} +4 -4
  18. package/dist/{chunk-DNUIP3GV.js → chunk-DUITQUQG.js} +4 -4
  19. package/dist/{chunk-G2CZGBAU.js → chunk-F2MBHW5Y.js} +2 -2
  20. package/dist/{chunk-ASJXBA2E.js → chunk-IS2PAAEU.js} +2 -2
  21. package/dist/{chunk-K3PPJZIW.js → chunk-JA2S2P2L.js} +2 -2
  22. package/dist/{chunk-UI2YX2A5.js → chunk-LHVKCINJ.js} +5 -5
  23. package/dist/{chunk-JZM4NB3Z.js → chunk-MW7YAOG7.js} +2 -2
  24. package/dist/{chunk-ALAZKFEN.js → chunk-N2KD7MXE.js} +4 -4
  25. package/dist/{chunk-EROJXOR5.js → chunk-NMJV4JR4.js} +2 -2
  26. package/dist/{chunk-NNVVDL7M.js → chunk-NPUKKXZV.js} +3 -3
  27. package/dist/{chunk-NJ4UEWKT.js → chunk-OKQJMAFY.js} +593 -1486
  28. package/dist/chunk-OKQJMAFY.js.map +1 -0
  29. package/dist/{chunk-TFSDYBCS.js → chunk-PFJZIJ6A.js} +3 -3
  30. package/dist/{chunk-WSB5RH4X.js → chunk-PWWOIE47.js} +2 -2
  31. package/dist/{chunk-CNG5R5WH.js → chunk-RLKQFOSZ.js} +1203 -1015
  32. package/dist/chunk-RLKQFOSZ.js.map +1 -0
  33. package/dist/{chunk-YFZWZVYU.js → chunk-RWKINNVG.js} +2 -2
  34. package/dist/{chunk-Y6DGFZL3.js → chunk-T3QVO4Z6.js} +2 -2
  35. package/dist/{chunk-FWC6B7B3.js → chunk-UBEZZIYC.js} +3 -3
  36. package/dist/{chunk-RXISPIPW.js → chunk-UBZNEZAG.js} +2 -2
  37. package/dist/{chunk-MD4RTJOC.js → chunk-VWXR7HKU.js} +104 -28
  38. package/dist/chunk-VWXR7HKU.js.map +1 -0
  39. package/dist/{chunk-JEWZI3LK.js → chunk-X3S62T3S.js} +2 -2
  40. package/dist/{chunk-2QYJTGAC.js → chunk-XIQB6CXL.js} +2 -2
  41. package/dist/{chunk-RRDXXZBI.js → chunk-Y37VBZ62.js} +2 -2
  42. package/dist/{chunk-WQSBXFHC.js → chunk-YHPMSOFB.js} +2 -2
  43. package/dist/{chunk-IS6RNGO4.js → chunk-YQTRQRH7.js} +5 -5
  44. package/dist/{chunk-7OGETM4L.js → chunk-ZEZQ7GV4.js} +2 -2
  45. package/dist/{chunk-4VQBNR5X.js → chunk-ZQ6ZYMZY.js} +2 -2
  46. package/dist/{cli-circuit-breaker-XPZOXMTZ.js → cli-circuit-breaker-NY4BI2M4.js} +3 -3
  47. package/dist/cli.d.ts +2 -83
  48. package/dist/cli.js +50 -49
  49. package/dist/cli.js.map +1 -1
  50. package/dist/{composite-router-J7V4G4AV.js → composite-router-FCW4AZCS.js} +2 -2
  51. package/dist/{consensus-vote-2SBGK5OX.js → consensus-vote-XQ3EAK2G.js} +18 -18
  52. package/dist/{consensus-vote-types-rAhTNGvq.d.ts → consensus-vote-types-CYc7VWVO.d.ts} +767 -11
  53. package/dist/{context-retriever-5RXSSV6H.js → context-retriever-HCN7NCXO.js} +8 -8
  54. package/dist/{doctor-deep-7LPN36JD.js → doctor-deep-JUR5KWJV.js} +3 -3
  55. package/dist/doctor-gateway-report-6SVJILTL.js +17 -0
  56. package/dist/{doctor-live-SHMQOWLA.js → doctor-live-62GNMKMA.js} +11 -11
  57. package/dist/{expert-bridge-VOW7QBQO.js → expert-bridge-WDISX7RG.js} +5 -5
  58. package/dist/{factory-37NFTAM4.js → factory-NCCP3VNN.js} +10 -10
  59. package/dist/{factory-DVVU3EMA.js → factory-OMJSMBSL.js} +5 -5
  60. package/dist/{improvement-review-ODFOU2G4.js → improvement-review-YFQLWYLJ.js} +6 -6
  61. package/dist/index.d.ts +145 -649
  62. package/dist/index.js +33 -33
  63. package/dist/index.js.map +1 -1
  64. package/dist/{init-opencode-2BIZ2RQL.js → init-opencode-SYTACFM2.js} +6 -6
  65. package/dist/{issue-triage-UPZ7ITJD.js → issue-triage-VSXJ7AY3.js} +6 -6
  66. package/dist/model-registry.generated.json +3725 -2194
  67. package/dist/{openai-compat-adapter-JEME4MB5.js → openai-compat-adapter-YZRFOEEI.js} +6 -6
  68. package/dist/{pr-reviewer-helpers-FDMW5NQT.js → pr-reviewer-helpers-RAF7DGIB.js} +4 -4
  69. package/dist/{registry-command-FB6D2LSD.js → registry-command-WG5TUJC4.js} +2 -2
  70. package/dist/{repo-security-plan-JTDMTZ2P.js → repo-security-plan-5FLHCCTG.js} +3 -3
  71. package/dist/{research-helpers-synthesize-HB7QBCYP.js → research-helpers-synthesize-EYCKTVZU.js} +4 -4
  72. package/dist/{routing-memory-VEHZK2WD.js → routing-memory-Z2HE7IH3.js} +2 -2
  73. package/dist/{session-memory-WV6DQGFB.js → session-memory-5QIPC7O6.js} +3 -3
  74. package/dist/{setup-config-VISHCDVU.js → setup-config-HNHBQG52.js} +3 -3
  75. package/dist/{setup-custom-api-CA4GQP4X.js → setup-custom-api-2KYNK6WT.js} +4 -4
  76. package/dist/setup-data-dir-B56LLZNT.js +34 -0
  77. package/dist/{tool-memory-Y7YMEYA5.js → tool-memory-LWPWVKWR.js} +5 -5
  78. package/dist/{unified-registry-PAV3YH3U.js → unified-registry-A72U42LZ.js} +12 -12
  79. package/dist/{weather-report-HHI5HS22.js → weather-report-HVUNR7SZ.js} +2 -2
  80. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth-extensions.d.ts +43 -2
  81. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth-extensions.d.ts.map +1 -1
  82. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth-extensions.js +26 -5
  83. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth-extensions.js.map +1 -1
  84. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth.d.ts +26 -4
  85. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth.d.ts.map +1 -1
  86. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth.js +118 -17
  87. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth.js.map +1 -1
  88. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleClientCredentials.d.ts +1 -0
  89. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleClientCredentials.d.ts.map +1 -1
  90. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleClientCredentials.js +11 -2
  91. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleClientCredentials.js.map +1 -1
  92. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/demoInMemoryOAuthProvider.d.ts +2 -0
  93. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/demoInMemoryOAuthProvider.d.ts.map +1 -1
  94. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/providers/proxyProvider.d.ts.map +1 -1
  95. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/providers/proxyProvider.js +6 -3
  96. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/providers/proxyProvider.js.map +1 -1
  97. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.d.ts.map +1 -1
  98. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.js +3 -1
  99. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.js.map +1 -1
  100. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/requestBody.d.ts +25 -0
  101. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/requestBody.d.ts.map +1 -0
  102. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/requestBody.js +64 -0
  103. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/requestBody.js.map +1 -0
  104. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.d.ts +10 -1
  105. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.d.ts.map +1 -1
  106. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.js +13 -1
  107. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.js.map +1 -1
  108. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth.d.ts +3 -0
  109. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth.d.ts.map +1 -1
  110. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth.js +12 -2
  111. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth.js.map +1 -1
  112. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth-extensions.d.ts +43 -2
  113. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth-extensions.d.ts.map +1 -1
  114. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth-extensions.js +26 -5
  115. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth-extensions.js.map +1 -1
  116. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.d.ts +26 -4
  117. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.d.ts.map +1 -1
  118. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js +118 -17
  119. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js.map +1 -1
  120. package/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleClientCredentials.d.ts +1 -0
  121. package/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleClientCredentials.d.ts.map +1 -1
  122. package/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleClientCredentials.js +11 -2
  123. package/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleClientCredentials.js.map +1 -1
  124. package/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/demoInMemoryOAuthProvider.d.ts +2 -0
  125. package/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/demoInMemoryOAuthProvider.d.ts.map +1 -1
  126. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/providers/proxyProvider.d.ts.map +1 -1
  127. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/providers/proxyProvider.js +6 -3
  128. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/providers/proxyProvider.js.map +1 -1
  129. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/express.d.ts.map +1 -1
  130. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/express.js +3 -1
  131. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/express.js.map +1 -1
  132. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/requestBody.d.ts +25 -0
  133. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/requestBody.d.ts.map +1 -0
  134. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/requestBody.js +58 -0
  135. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/requestBody.js.map +1 -0
  136. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.d.ts +10 -1
  137. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.d.ts.map +1 -1
  138. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.js +13 -1
  139. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.js.map +1 -1
  140. package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.d.ts +3 -0
  141. package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.d.ts.map +1 -1
  142. package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js +12 -2
  143. package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js.map +1 -1
  144. package/node_modules/@modelcontextprotocol/sdk/package.json +1 -1
  145. package/node_modules/hono/dist/_virtual/_rolldown/runtime.js +13 -0
  146. package/node_modules/hono/dist/adapter/aws-lambda/conninfo.js +42 -23
  147. package/node_modules/hono/dist/adapter/aws-lambda/handler.js +318 -341
  148. package/node_modules/hono/dist/adapter/aws-lambda/index.js +2 -8
  149. package/node_modules/hono/dist/adapter/aws-lambda/types.js +1 -0
  150. package/node_modules/hono/dist/adapter/bun/conninfo.js +20 -25
  151. package/node_modules/hono/dist/adapter/bun/index.js +3 -13
  152. package/node_modules/hono/dist/adapter/bun/serve-static.js +27 -27
  153. package/node_modules/hono/dist/adapter/bun/server.js +11 -5
  154. package/node_modules/hono/dist/adapter/bun/ssg.js +25 -15
  155. package/node_modules/hono/dist/adapter/bun/websocket.js +61 -68
  156. package/node_modules/hono/dist/adapter/cloudflare-pages/conninfo.js +24 -9
  157. package/node_modules/hono/dist/adapter/cloudflare-pages/handler.js +59 -62
  158. package/node_modules/hono/dist/adapter/cloudflare-pages/index.js +2 -8
  159. package/node_modules/hono/dist/adapter/cloudflare-workers/conninfo.js +7 -9
  160. package/node_modules/hono/dist/adapter/cloudflare-workers/index.js +3 -8
  161. package/node_modules/hono/dist/adapter/cloudflare-workers/serve-static-module.js +5 -6
  162. package/node_modules/hono/dist/adapter/cloudflare-workers/serve-static.js +26 -20
  163. package/node_modules/hono/dist/adapter/cloudflare-workers/utils.js +21 -34
  164. package/node_modules/hono/dist/adapter/cloudflare-workers/websocket.js +31 -39
  165. package/node_modules/hono/dist/adapter/deno/conninfo.js +16 -13
  166. package/node_modules/hono/dist/adapter/deno/deno.d.js +1 -0
  167. package/node_modules/hono/dist/adapter/deno/index.js +3 -10
  168. package/node_modules/hono/dist/adapter/deno/serve-static.js +33 -38
  169. package/node_modules/hono/dist/adapter/deno/ssg.js +27 -16
  170. package/node_modules/hono/dist/adapter/deno/websocket.js +30 -30
  171. package/node_modules/hono/dist/adapter/lambda-edge/conninfo.js +7 -9
  172. package/node_modules/hono/dist/adapter/lambda-edge/handler.js +102 -87
  173. package/node_modules/hono/dist/adapter/lambda-edge/index.js +2 -6
  174. package/node_modules/hono/dist/adapter/netlify/conninfo.js +24 -9
  175. package/node_modules/hono/dist/adapter/netlify/handler.js +10 -8
  176. package/node_modules/hono/dist/adapter/netlify/index.js +3 -2
  177. package/node_modules/hono/dist/adapter/netlify/mod.js +2 -6
  178. package/node_modules/hono/dist/adapter/service-worker/handler.js +15 -19
  179. package/node_modules/hono/dist/adapter/service-worker/index.js +23 -7
  180. package/node_modules/hono/dist/adapter/service-worker/types.js +1 -0
  181. package/node_modules/hono/dist/adapter/vercel/conninfo.js +7 -10
  182. package/node_modules/hono/dist/adapter/vercel/handler.js +8 -6
  183. package/node_modules/hono/dist/adapter/vercel/index.js +2 -6
  184. package/node_modules/hono/dist/cjs/_virtual/_rolldown/runtime.js +33 -0
  185. package/node_modules/hono/dist/cjs/adapter/aws-lambda/conninfo.js +42 -44
  186. package/node_modules/hono/dist/cjs/adapter/aws-lambda/handler.js +326 -370
  187. package/node_modules/hono/dist/cjs/adapter/aws-lambda/index.js +7 -34
  188. package/node_modules/hono/dist/cjs/adapter/aws-lambda/types.js +0 -15
  189. package/node_modules/hono/dist/cjs/adapter/bun/conninfo.js +21 -47
  190. package/node_modules/hono/dist/cjs/adapter/bun/index.js +14 -45
  191. package/node_modules/hono/dist/cjs/adapter/bun/serve-static.js +29 -50
  192. package/node_modules/hono/dist/cjs/adapter/bun/server.js +11 -26
  193. package/node_modules/hono/dist/cjs/adapter/bun/ssg.js +24 -35
  194. package/node_modules/hono/dist/cjs/adapter/bun/websocket.js +63 -91
  195. package/node_modules/hono/dist/cjs/adapter/cloudflare-pages/conninfo.js +25 -31
  196. package/node_modules/hono/dist/cjs/adapter/cloudflare-pages/handler.js +61 -85
  197. package/node_modules/hono/dist/cjs/adapter/cloudflare-pages/index.js +7 -34
  198. package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/conninfo.js +8 -31
  199. package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/index.js +7 -33
  200. package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/serve-static-module.js +7 -29
  201. package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/serve-static.js +27 -42
  202. package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/utils.js +21 -55
  203. package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/websocket.js +33 -62
  204. package/node_modules/hono/dist/cjs/adapter/deno/conninfo.js +16 -34
  205. package/node_modules/hono/dist/cjs/adapter/deno/index.js +10 -38
  206. package/node_modules/hono/dist/cjs/adapter/deno/serve-static.js +33 -59
  207. package/node_modules/hono/dist/cjs/adapter/deno/ssg.js +27 -37
  208. package/node_modules/hono/dist/cjs/adapter/deno/websocket.js +32 -53
  209. package/node_modules/hono/dist/cjs/adapter/lambda-edge/conninfo.js +8 -31
  210. package/node_modules/hono/dist/cjs/adapter/lambda-edge/handler.js +105 -119
  211. package/node_modules/hono/dist/cjs/adapter/lambda-edge/index.js +5 -30
  212. package/node_modules/hono/dist/cjs/adapter/netlify/conninfo.js +25 -31
  213. package/node_modules/hono/dist/cjs/adapter/netlify/handler.js +10 -29
  214. package/node_modules/hono/dist/cjs/adapter/netlify/index.js +5 -21
  215. package/node_modules/hono/dist/cjs/adapter/netlify/mod.js +5 -30
  216. package/node_modules/hono/dist/cjs/adapter/service-worker/handler.js +16 -41
  217. package/node_modules/hono/dist/cjs/adapter/service-worker/index.js +25 -30
  218. package/node_modules/hono/dist/cjs/adapter/service-worker/types.js +0 -15
  219. package/node_modules/hono/dist/cjs/adapter/vercel/conninfo.js +8 -32
  220. package/node_modules/hono/dist/cjs/adapter/vercel/handler.js +8 -27
  221. package/node_modules/hono/dist/cjs/adapter/vercel/index.js +5 -30
  222. package/node_modules/hono/dist/cjs/client/client.js +139 -212
  223. package/node_modules/hono/dist/cjs/client/fetch-result-please.js +62 -80
  224. package/node_modules/hono/dist/cjs/client/index.js +7 -32
  225. package/node_modules/hono/dist/cjs/client/types.js +0 -15
  226. package/node_modules/hono/dist/cjs/client/utils.js +54 -92
  227. package/node_modules/hono/dist/cjs/compose.js +49 -66
  228. package/node_modules/hono/dist/cjs/context.js +379 -450
  229. package/node_modules/hono/dist/cjs/helper/accepts/accepts.js +47 -70
  230. package/node_modules/hono/dist/cjs/helper/accepts/index.js +3 -27
  231. package/node_modules/hono/dist/cjs/helper/adapter/index.js +33 -73
  232. package/node_modules/hono/dist/cjs/helper/conninfo/index.js +0 -15
  233. package/node_modules/hono/dist/cjs/helper/conninfo/types.js +0 -15
  234. package/node_modules/hono/dist/cjs/helper/cookie/index.js +75 -116
  235. package/node_modules/hono/dist/cjs/helper/css/common.js +165 -244
  236. package/node_modules/hono/dist/cjs/helper/css/index.js +136 -151
  237. package/node_modules/hono/dist/cjs/helper/dev/index.js +45 -71
  238. package/node_modules/hono/dist/cjs/helper/factory/index.js +30 -51
  239. package/node_modules/hono/dist/cjs/helper/html/index.js +32 -62
  240. package/node_modules/hono/dist/cjs/helper/proxy/index.js +113 -106
  241. package/node_modules/hono/dist/cjs/helper/route/index.js +123 -66
  242. package/node_modules/hono/dist/cjs/helper/ssg/index.js +19 -43
  243. package/node_modules/hono/dist/cjs/helper/ssg/middleware.js +56 -64
  244. package/node_modules/hono/dist/cjs/helper/ssg/plugins.js +55 -57
  245. package/node_modules/hono/dist/cjs/helper/ssg/ssg.js +196 -296
  246. package/node_modules/hono/dist/cjs/helper/ssg/utils.js +47 -90
  247. package/node_modules/hono/dist/cjs/helper/streaming/index.js +8 -35
  248. package/node_modules/hono/dist/cjs/helper/streaming/sse.js +53 -85
  249. package/node_modules/hono/dist/cjs/helper/streaming/stream.js +23 -53
  250. package/node_modules/hono/dist/cjs/helper/streaming/text.js +10 -32
  251. package/node_modules/hono/dist/cjs/helper/streaming/utils.js +13 -32
  252. package/node_modules/hono/dist/cjs/helper/testing/index.js +16 -31
  253. package/node_modules/hono/dist/cjs/helper/websocket/index.js +51 -76
  254. package/node_modules/hono/dist/cjs/hono-base.js +345 -403
  255. package/node_modules/hono/dist/cjs/hono.js +28 -42
  256. package/node_modules/hono/dist/cjs/http-exception.js +55 -56
  257. package/node_modules/hono/dist/cjs/index.js +22 -30
  258. package/node_modules/hono/dist/cjs/jsx/base.js +237 -366
  259. package/node_modules/hono/dist/cjs/jsx/children.js +16 -41
  260. package/node_modules/hono/dist/cjs/jsx/components.js +119 -192
  261. package/node_modules/hono/dist/cjs/jsx/constants.js +15 -42
  262. package/node_modules/hono/dist/cjs/jsx/context.js +144 -162
  263. package/node_modules/hono/dist/cjs/jsx/dom/client.js +49 -69
  264. package/node_modules/hono/dist/cjs/jsx/dom/components.js +23 -52
  265. package/node_modules/hono/dist/cjs/jsx/dom/context.js +39 -67
  266. package/node_modules/hono/dist/cjs/jsx/dom/css.js +143 -158
  267. package/node_modules/hono/dist/cjs/jsx/dom/hooks/index.js +55 -64
  268. package/node_modules/hono/dist/cjs/jsx/dom/index.js +114 -173
  269. package/node_modules/hono/dist/cjs/jsx/dom/intrinsic-element/components.js +282 -375
  270. package/node_modules/hono/dist/cjs/jsx/dom/jsx-dev-runtime.js +14 -49
  271. package/node_modules/hono/dist/cjs/jsx/dom/jsx-runtime.js +5 -32
  272. package/node_modules/hono/dist/cjs/jsx/dom/render.js +469 -623
  273. package/node_modules/hono/dist/cjs/jsx/dom/server.js +37 -64
  274. package/node_modules/hono/dist/cjs/jsx/dom/utils.js +7 -30
  275. package/node_modules/hono/dist/cjs/jsx/hooks/index.js +225 -318
  276. package/node_modules/hono/dist/cjs/jsx/index.js +86 -135
  277. package/node_modules/hono/dist/cjs/jsx/intrinsic-element/common.js +20 -43
  278. package/node_modules/hono/dist/cjs/jsx/intrinsic-element/components.js +117 -168
  279. package/node_modules/hono/dist/cjs/jsx/intrinsic-elements.js +0 -15
  280. package/node_modules/hono/dist/cjs/jsx/jsx-dev-runtime.js +14 -39
  281. package/node_modules/hono/dist/cjs/jsx/jsx-runtime.js +34 -68
  282. package/node_modules/hono/dist/cjs/jsx/streaming.js +123 -166
  283. package/node_modules/hono/dist/cjs/jsx/types.js +0 -15
  284. package/node_modules/hono/dist/cjs/jsx/utils.js +91 -175
  285. package/node_modules/hono/dist/cjs/middleware/basic-auth/index.js +98 -86
  286. package/node_modules/hono/dist/cjs/middleware/bearer-auth/index.js +92 -109
  287. package/node_modules/hono/dist/cjs/middleware/body-limit/index.js +66 -72
  288. package/node_modules/hono/dist/cjs/middleware/cache/index.js +153 -199
  289. package/node_modules/hono/dist/cjs/middleware/combine/index.js +133 -95
  290. package/node_modules/hono/dist/cjs/middleware/compress/index.js +73 -88
  291. package/node_modules/hono/dist/cjs/middleware/context-storage/index.js +49 -41
  292. package/node_modules/hono/dist/cjs/middleware/cors/index.js +107 -107
  293. package/node_modules/hono/dist/cjs/middleware/csrf/index.js +101 -72
  294. package/node_modules/hono/dist/cjs/middleware/etag/digest.js +58 -97
  295. package/node_modules/hono/dist/cjs/middleware/etag/index.js +71 -91
  296. package/node_modules/hono/dist/cjs/middleware/ip-restriction/index.js +161 -169
  297. package/node_modules/hono/dist/cjs/middleware/jsx-renderer/index.js +99 -77
  298. package/node_modules/hono/dist/cjs/middleware/jwk/index.js +3 -27
  299. package/node_modules/hono/dist/cjs/middleware/jwk/jwk.js +118 -135
  300. package/node_modules/hono/dist/cjs/middleware/jwt/index.js +9 -38
  301. package/node_modules/hono/dist/cjs/middleware/jwt/jwt.js +120 -141
  302. package/node_modules/hono/dist/cjs/middleware/language/index.js +7 -35
  303. package/node_modules/hono/dist/cjs/middleware/language/language.js +184 -182
  304. package/node_modules/hono/dist/cjs/middleware/logger/index.js +41 -62
  305. package/node_modules/hono/dist/cjs/middleware/method-not-allowed/index.js +82 -88
  306. package/node_modules/hono/dist/cjs/middleware/method-override/index.js +101 -102
  307. package/node_modules/hono/dist/cjs/middleware/powered-by/index.js +23 -30
  308. package/node_modules/hono/dist/cjs/middleware/pretty-json/index.js +38 -36
  309. package/node_modules/hono/dist/cjs/middleware/request-id/index.js +3 -27
  310. package/node_modules/hono/dist/cjs/middleware/request-id/request-id.js +34 -42
  311. package/node_modules/hono/dist/cjs/middleware/secure-headers/index.js +4 -29
  312. package/node_modules/hono/dist/cjs/middleware/secure-headers/permissions-policy.js +0 -15
  313. package/node_modules/hono/dist/cjs/middleware/secure-headers/secure-headers.js +142 -174
  314. package/node_modules/hono/dist/cjs/middleware/serve-static/index.js +55 -93
  315. package/node_modules/hono/dist/cjs/middleware/serve-static/path.js +15 -38
  316. package/node_modules/hono/dist/cjs/middleware/timeout/index.js +40 -45
  317. package/node_modules/hono/dist/cjs/middleware/timing/index.js +7 -35
  318. package/node_modules/hono/dist/cjs/middleware/timing/timing.js +177 -118
  319. package/node_modules/hono/dist/cjs/middleware/trailing-slash/index.js +85 -58
  320. package/node_modules/hono/dist/cjs/preset/quick.js +18 -37
  321. package/node_modules/hono/dist/cjs/preset/tiny.js +15 -33
  322. package/node_modules/hono/dist/cjs/request/constants.js +5 -27
  323. package/node_modules/hono/dist/cjs/request.js +334 -346
  324. package/node_modules/hono/dist/cjs/router/linear-router/index.js +3 -27
  325. package/node_modules/hono/dist/cjs/router/linear-router/router.js +95 -143
  326. package/node_modules/hono/dist/cjs/router/pattern-router/index.js +3 -27
  327. package/node_modules/hono/dist/cjs/router/pattern-router/router.js +41 -63
  328. package/node_modules/hono/dist/cjs/router/reg-exp-router/index.js +7 -34
  329. package/node_modules/hono/dist/cjs/router/reg-exp-router/matcher.js +18 -45
  330. package/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +91 -135
  331. package/node_modules/hono/dist/cjs/router/reg-exp-router/prepared-router.js +92 -161
  332. package/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +98 -147
  333. package/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +73 -89
  334. package/node_modules/hono/dist/cjs/router/smart-router/index.js +3 -27
  335. package/node_modules/hono/dist/cjs/router/smart-router/router.js +49 -79
  336. package/node_modules/hono/dist/cjs/router/trie-router/index.js +3 -27
  337. package/node_modules/hono/dist/cjs/router/trie-router/node.js +134 -186
  338. package/node_modules/hono/dist/cjs/router/trie-router/router.js +15 -39
  339. package/node_modules/hono/dist/cjs/router/utils.js +5 -27
  340. package/node_modules/hono/dist/cjs/router.js +37 -37
  341. package/node_modules/hono/dist/cjs/types.js +5 -28
  342. package/node_modules/hono/dist/cjs/utils/accept.js +177 -225
  343. package/node_modules/hono/dist/cjs/utils/basic-auth.js +16 -40
  344. package/node_modules/hono/dist/cjs/utils/body.js +84 -110
  345. package/node_modules/hono/dist/cjs/utils/buffer.js +43 -91
  346. package/node_modules/hono/dist/cjs/utils/color.js +35 -44
  347. package/node_modules/hono/dist/cjs/utils/compress.js +11 -26
  348. package/node_modules/hono/dist/cjs/utils/concurrent.js +29 -59
  349. package/node_modules/hono/dist/cjs/utils/constants.js +7 -26
  350. package/node_modules/hono/dist/cjs/utils/cookie.js +107 -177
  351. package/node_modules/hono/dist/cjs/utils/crypto.js +30 -61
  352. package/node_modules/hono/dist/cjs/utils/encode.js +31 -48
  353. package/node_modules/hono/dist/cjs/utils/filepath.js +23 -54
  354. package/node_modules/hono/dist/cjs/utils/handler.js +11 -33
  355. package/node_modules/hono/dist/cjs/utils/headers.js +0 -15
  356. package/node_modules/hono/dist/cjs/utils/html.js +96 -137
  357. package/node_modules/hono/dist/cjs/utils/http-status.js +0 -15
  358. package/node_modules/hono/dist/cjs/utils/ipaddr.js +213 -286
  359. package/node_modules/hono/dist/cjs/utils/jwt/index.js +14 -27
  360. package/node_modules/hono/dist/cjs/utils/jwt/jwa.js +25 -42
  361. package/node_modules/hono/dist/cjs/utils/jwt/jws.js +119 -199
  362. package/node_modules/hono/dist/cjs/utils/jwt/jwt.js +122 -205
  363. package/node_modules/hono/dist/cjs/utils/jwt/types.js +122 -159
  364. package/node_modules/hono/dist/cjs/utils/jwt/utf8.js +9 -28
  365. package/node_modules/hono/dist/cjs/utils/mime.js +75 -101
  366. package/node_modules/hono/dist/cjs/utils/stream.js +88 -111
  367. package/node_modules/hono/dist/cjs/utils/types.js +0 -15
  368. package/node_modules/hono/dist/cjs/utils/url.js +185 -234
  369. package/node_modules/hono/dist/cjs/validator/index.js +3 -27
  370. package/node_modules/hono/dist/cjs/validator/utils.js +0 -15
  371. package/node_modules/hono/dist/cjs/validator/validator.js +60 -103
  372. package/node_modules/hono/dist/client/client.js +138 -197
  373. package/node_modules/hono/dist/client/fetch-result-please.js +59 -56
  374. package/node_modules/hono/dist/client/index.js +3 -7
  375. package/node_modules/hono/dist/client/types.js +1 -0
  376. package/node_modules/hono/dist/client/utils.js +51 -68
  377. package/node_modules/hono/dist/compose.js +49 -45
  378. package/node_modules/hono/dist/context.js +376 -426
  379. package/node_modules/hono/dist/helper/accepts/accepts.js +47 -49
  380. package/node_modules/hono/dist/helper/accepts/index.js +1 -4
  381. package/node_modules/hono/dist/helper/adapter/index.js +33 -52
  382. package/node_modules/hono/dist/helper/conninfo/index.js +1 -0
  383. package/node_modules/hono/dist/helper/conninfo/types.js +1 -0
  384. package/node_modules/hono/dist/helper/cookie/index.js +74 -94
  385. package/node_modules/hono/dist/helper/css/common.js +167 -225
  386. package/node_modules/hono/dist/helper/css/index.js +132 -137
  387. package/node_modules/hono/dist/helper/dev/index.js +44 -49
  388. package/node_modules/hono/dist/helper/factory/index.js +27 -27
  389. package/node_modules/hono/dist/helper/html/index.js +30 -39
  390. package/node_modules/hono/dist/helper/proxy/index.js +116 -88
  391. package/node_modules/hono/dist/helper/route/index.js +121 -43
  392. package/node_modules/hono/dist/helper/ssg/index.js +3 -18
  393. package/node_modules/hono/dist/helper/ssg/middleware.js +53 -40
  394. package/node_modules/hono/dist/helper/ssg/plugins.js +55 -36
  395. package/node_modules/hono/dist/helper/ssg/ssg.js +198 -283
  396. package/node_modules/hono/dist/helper/ssg/utils.js +53 -75
  397. package/node_modules/hono/dist/helper/streaming/index.js +2 -8
  398. package/node_modules/hono/dist/helper/streaming/sse.js +50 -61
  399. package/node_modules/hono/dist/helper/streaming/stream.js +22 -31
  400. package/node_modules/hono/dist/helper/streaming/text.js +9 -10
  401. package/node_modules/hono/dist/helper/streaming/utils.js +9 -12
  402. package/node_modules/hono/dist/helper/testing/index.js +16 -10
  403. package/node_modules/hono/dist/helper/websocket/index.js +49 -53
  404. package/node_modules/hono/dist/hono-base.js +342 -379
  405. package/node_modules/hono/dist/hono.js +27 -20
  406. package/node_modules/hono/dist/http-exception.js +53 -33
  407. package/node_modules/hono/dist/index.js +19 -6
  408. package/node_modules/hono/dist/jsx/base.js +231 -340
  409. package/node_modules/hono/dist/jsx/children.js +16 -20
  410. package/node_modules/hono/dist/jsx/components.js +118 -170
  411. package/node_modules/hono/dist/jsx/constants.js +9 -15
  412. package/node_modules/hono/dist/jsx/context.js +153 -150
  413. package/node_modules/hono/dist/jsx/dom/client.js +45 -48
  414. package/node_modules/hono/dist/jsx/dom/components.js +21 -29
  415. package/node_modules/hono/dist/jsx/dom/context.js +37 -44
  416. package/node_modules/hono/dist/jsx/dom/css.js +142 -147
  417. package/node_modules/hono/dist/jsx/dom/hooks/index.js +52 -40
  418. package/node_modules/hono/dist/jsx/dom/index.js +71 -134
  419. package/node_modules/hono/dist/jsx/dom/intrinsic-element/components.js +275 -359
  420. package/node_modules/hono/dist/jsx/dom/jsx-dev-runtime.js +14 -18
  421. package/node_modules/hono/dist/jsx/dom/jsx-runtime.js +2 -8
  422. package/node_modules/hono/dist/jsx/dom/render.js +492 -631
  423. package/node_modules/hono/dist/jsx/dom/server.js +32 -32
  424. package/node_modules/hono/dist/jsx/dom/utils.js +6 -8
  425. package/node_modules/hono/dist/jsx/hooks/index.js +236 -308
  426. package/node_modules/hono/dist/jsx/index.js +45 -98
  427. package/node_modules/hono/dist/jsx/intrinsic-element/common.js +20 -22
  428. package/node_modules/hono/dist/jsx/intrinsic-element/components.js +113 -154
  429. package/node_modules/hono/dist/jsx/intrinsic-elements.js +1 -0
  430. package/node_modules/hono/dist/jsx/jsx-dev-runtime.js +12 -16
  431. package/node_modules/hono/dist/jsx/jsx-runtime.js +29 -42
  432. package/node_modules/hono/dist/jsx/streaming.js +120 -142
  433. package/node_modules/hono/dist/jsx/types.js +1 -0
  434. package/node_modules/hono/dist/jsx/utils.js +105 -168
  435. package/node_modules/hono/dist/middleware/basic-auth/index.js +96 -63
  436. package/node_modules/hono/dist/middleware/bearer-auth/index.js +93 -89
  437. package/node_modules/hono/dist/middleware/body-limit/index.js +66 -51
  438. package/node_modules/hono/dist/middleware/cache/index.js +165 -190
  439. package/node_modules/hono/dist/middleware/combine/index.js +132 -73
  440. package/node_modules/hono/dist/middleware/compress/index.js +75 -69
  441. package/node_modules/hono/dist/middleware/context-storage/index.js +49 -19
  442. package/node_modules/hono/dist/middleware/cors/index.js +107 -86
  443. package/node_modules/hono/dist/middleware/csrf/index.js +103 -53
  444. package/node_modules/hono/dist/middleware/etag/digest.js +59 -77
  445. package/node_modules/hono/dist/middleware/etag/index.js +71 -70
  446. package/node_modules/hono/dist/middleware/ip-restriction/index.js +163 -158
  447. package/node_modules/hono/dist/middleware/jsx-renderer/index.js +97 -54
  448. package/node_modules/hono/dist/middleware/jwk/index.js +1 -4
  449. package/node_modules/hono/dist/middleware/jwk/jwk.js +116 -112
  450. package/node_modules/hono/dist/middleware/jwt/index.js +2 -10
  451. package/node_modules/hono/dist/middleware/jwt/jwt.js +114 -114
  452. package/node_modules/hono/dist/middleware/language/index.js +2 -15
  453. package/node_modules/hono/dist/middleware/language/language.js +180 -157
  454. package/node_modules/hono/dist/middleware/logger/index.js +43 -37
  455. package/node_modules/hono/dist/middleware/method-not-allowed/index.js +81 -66
  456. package/node_modules/hono/dist/middleware/method-override/index.js +101 -81
  457. package/node_modules/hono/dist/middleware/powered-by/index.js +23 -9
  458. package/node_modules/hono/dist/middleware/pretty-json/index.js +39 -16
  459. package/node_modules/hono/dist/middleware/request-id/index.js +1 -4
  460. package/node_modules/hono/dist/middleware/request-id/request-id.js +33 -20
  461. package/node_modules/hono/dist/middleware/secure-headers/index.js +1 -5
  462. package/node_modules/hono/dist/middleware/secure-headers/permissions-policy.js +1 -0
  463. package/node_modules/hono/dist/middleware/secure-headers/secure-headers.js +144 -155
  464. package/node_modules/hono/dist/middleware/serve-static/index.js +55 -72
  465. package/node_modules/hono/dist/middleware/serve-static/path.js +15 -17
  466. package/node_modules/hono/dist/middleware/timeout/index.js +40 -23
  467. package/node_modules/hono/dist/middleware/timing/index.js +2 -9
  468. package/node_modules/hono/dist/middleware/timing/timing.js +177 -97
  469. package/node_modules/hono/dist/middleware/trailing-slash/index.js +85 -37
  470. package/node_modules/hono/dist/preset/quick.js +17 -15
  471. package/node_modules/hono/dist/preset/tiny.js +14 -11
  472. package/node_modules/hono/dist/request/constants.js +4 -5
  473. package/node_modules/hono/dist/request.js +328 -319
  474. package/node_modules/hono/dist/router/linear-router/index.js +1 -4
  475. package/node_modules/hono/dist/router/linear-router/router.js +93 -120
  476. package/node_modules/hono/dist/router/pattern-router/index.js +1 -4
  477. package/node_modules/hono/dist/router/pattern-router/router.js +39 -40
  478. package/node_modules/hono/dist/router/reg-exp-router/index.js +1 -7
  479. package/node_modules/hono/dist/router/reg-exp-router/matcher.js +17 -23
  480. package/node_modules/hono/dist/router/reg-exp-router/node.js +87 -110
  481. package/node_modules/hono/dist/router/reg-exp-router/prepared-router.js +89 -137
  482. package/node_modules/hono/dist/router/reg-exp-router/router.js +92 -129
  483. package/node_modules/hono/dist/router/reg-exp-router/trie.js +69 -64
  484. package/node_modules/hono/dist/router/smart-router/index.js +1 -4
  485. package/node_modules/hono/dist/router/smart-router/router.js +46 -55
  486. package/node_modules/hono/dist/router/trie-router/index.js +1 -4
  487. package/node_modules/hono/dist/router/trie-router/node.js +131 -162
  488. package/node_modules/hono/dist/router/trie-router/router.js +11 -14
  489. package/node_modules/hono/dist/router/utils.js +4 -5
  490. package/node_modules/hono/dist/router.js +35 -14
  491. package/node_modules/hono/dist/types/adapter/aws-lambda/conninfo.d.ts +4 -1
  492. package/node_modules/hono/dist/types/adapter/aws-lambda/handler.d.ts +150 -105
  493. package/node_modules/hono/dist/types/adapter/aws-lambda/index.d.ts +4 -8
  494. package/node_modules/hono/dist/types/adapter/aws-lambda/types.d.ts +152 -123
  495. package/node_modules/hono/dist/types/adapter/bun/conninfo.d.ts +4 -1
  496. package/node_modules/hono/dist/types/adapter/bun/index.d.ts +6 -10
  497. package/node_modules/hono/dist/types/adapter/bun/serve-static.d.ts +7 -2
  498. package/node_modules/hono/dist/types/adapter/bun/server.d.ts +4 -5
  499. package/node_modules/hono/dist/types/adapter/bun/ssg.d.ts +5 -1
  500. package/node_modules/hono/dist/types/adapter/bun/websocket.d.ts +31 -17
  501. package/node_modules/hono/dist/types/adapter/cloudflare-pages/conninfo.d.ts +4 -1
  502. package/node_modules/hono/dist/types/adapter/cloudflare-pages/handler.d.ts +29 -18
  503. package/node_modules/hono/dist/types/adapter/cloudflare-pages/index.d.ts +3 -7
  504. package/node_modules/hono/dist/types/adapter/cloudflare-workers/conninfo.d.ts +6 -1
  505. package/node_modules/hono/dist/types/adapter/cloudflare-workers/index.d.ts +4 -7
  506. package/node_modules/hono/dist/types/adapter/cloudflare-workers/serve-static-module.d.ts +5 -3
  507. package/node_modules/hono/dist/types/adapter/cloudflare-workers/serve-static.d.ts +10 -5
  508. package/node_modules/hono/dist/types/adapter/cloudflare-workers/utils.d.ts +10 -2
  509. package/node_modules/hono/dist/types/adapter/cloudflare-workers/websocket.d.ts +6 -1
  510. package/node_modules/hono/dist/types/adapter/deno/conninfo.d.ts +4 -1
  511. package/node_modules/hono/dist/types/adapter/deno/deno.d.ts +1 -0
  512. package/node_modules/hono/dist/types/adapter/deno/index.d.ts +5 -8
  513. package/node_modules/hono/dist/types/adapter/deno/serve-static.d.ts +7 -2
  514. package/node_modules/hono/dist/types/adapter/deno/ssg.d.ts +5 -1
  515. package/node_modules/hono/dist/types/adapter/deno/websocket.d.ts +6 -1
  516. package/node_modules/hono/dist/types/adapter/lambda-edge/conninfo.d.ts +6 -1
  517. package/node_modules/hono/dist/types/adapter/lambda-edge/handler.d.ts +83 -58
  518. package/node_modules/hono/dist/types/adapter/lambda-edge/index.d.ts +3 -7
  519. package/node_modules/hono/dist/types/adapter/netlify/conninfo.d.ts +4 -1
  520. package/node_modules/hono/dist/types/adapter/netlify/handler.d.ts +6 -1
  521. package/node_modules/hono/dist/types/adapter/netlify/index.d.ts +3 -5
  522. package/node_modules/hono/dist/types/adapter/netlify/mod.d.ts +3 -2
  523. package/node_modules/hono/dist/types/adapter/service-worker/handler.d.ts +9 -8
  524. package/node_modules/hono/dist/types/adapter/service-worker/index.d.ts +6 -9
  525. package/node_modules/hono/dist/types/adapter/service-worker/types.d.ts +12 -8
  526. package/node_modules/hono/dist/types/adapter/vercel/conninfo.d.ts +6 -1
  527. package/node_modules/hono/dist/types/adapter/vercel/handler.d.ts +6 -1
  528. package/node_modules/hono/dist/types/adapter/vercel/index.d.ts +3 -6
  529. package/node_modules/hono/dist/types/client/client.d.ts +5 -3
  530. package/node_modules/hono/dist/types/client/fetch-result-please.d.ts +21 -19
  531. package/node_modules/hono/dist/types/client/index.d.ts +5 -7
  532. package/node_modules/hono/dist/types/client/types.d.ts +134 -160
  533. package/node_modules/hono/dist/types/client/utils.d.ts +6 -4
  534. package/node_modules/hono/dist/types/compose.d.ts +4 -2
  535. package/node_modules/hono/dist/types/context.d.ts +335 -336
  536. package/node_modules/hono/dist/types/helper/accepts/accepts.d.ts +11 -9
  537. package/node_modules/hono/dist/types/helper/accepts/index.d.ts +2 -5
  538. package/node_modules/hono/dist/types/helper/adapter/index.d.ts +4 -6
  539. package/node_modules/hono/dist/types/helper/conninfo/index.d.ts +2 -5
  540. package/node_modules/hono/dist/types/helper/conninfo/types.d.ts +25 -23
  541. package/node_modules/hono/dist/types/helper/cookie/index.d.ts +10 -13
  542. package/node_modules/hono/dist/types/helper/css/common.d.ts +11 -10
  543. package/node_modules/hono/dist/types/helper/css/index.d.ts +25 -28
  544. package/node_modules/hono/dist/types/helper/dev/index.d.ts +10 -13
  545. package/node_modules/hono/dist/types/helper/factory/index.d.ts +26 -74
  546. package/node_modules/hono/dist/types/helper/html/index.d.ts +4 -7
  547. package/node_modules/hono/dist/types/helper/proxy/index.d.ts +19 -22
  548. package/node_modules/hono/dist/types/helper/route/index.d.ts +4 -2
  549. package/node_modules/hono/dist/types/helper/ssg/index.d.ts +4 -7
  550. package/node_modules/hono/dist/types/helper/ssg/middleware.d.ts +8 -7
  551. package/node_modules/hono/dist/types/helper/ssg/plugins.d.ts +3 -1
  552. package/node_modules/hono/dist/types/helper/ssg/ssg.d.ts +38 -36
  553. package/node_modules/hono/dist/types/helper/ssg/utils.d.ts +5 -4
  554. package/node_modules/hono/dist/types/helper/streaming/index.d.ts +4 -8
  555. package/node_modules/hono/dist/types/helper/streaming/sse.d.ts +10 -8
  556. package/node_modules/hono/dist/types/helper/streaming/stream.d.ts +4 -2
  557. package/node_modules/hono/dist/types/helper/streaming/text.d.ts +4 -2
  558. package/node_modules/hono/dist/types/helper/streaming/utils.d.ts +2 -0
  559. package/node_modules/hono/dist/types/helper/testing/index.d.ts +7 -10
  560. package/node_modules/hono/dist/types/helper/websocket/index.d.ts +30 -33
  561. package/node_modules/hono/dist/types/hono-base.d.ts +208 -211
  562. package/node_modules/hono/dist/types/hono.d.ts +11 -10
  563. package/node_modules/hono/dist/types/http-exception.d.ts +20 -23
  564. package/node_modules/hono/dist/types/index.d.ts +6 -37
  565. package/node_modules/hono/dist/types/jsx/base.d.ts +36 -35
  566. package/node_modules/hono/dist/types/jsx/children.d.ts +8 -6
  567. package/node_modules/hono/dist/types/jsx/components.d.ts +8 -5
  568. package/node_modules/hono/dist/types/jsx/constants.d.ts +2 -0
  569. package/node_modules/hono/dist/types/jsx/context.d.ts +9 -7
  570. package/node_modules/hono/dist/types/jsx/dom/client.d.ts +8 -10
  571. package/node_modules/hono/dist/types/jsx/dom/components.d.ts +9 -6
  572. package/node_modules/hono/dist/types/jsx/dom/context.d.ts +3 -1
  573. package/node_modules/hono/dist/types/jsx/dom/css.d.ts +26 -30
  574. package/node_modules/hono/dist/types/jsx/dom/hooks/index.d.ts +11 -13
  575. package/node_modules/hono/dist/types/jsx/dom/index.d.ts +78 -83
  576. package/node_modules/hono/dist/types/jsx/dom/intrinsic-element/components.d.ts +9 -5
  577. package/node_modules/hono/dist/types/jsx/dom/jsx-dev-runtime.d.ts +4 -6
  578. package/node_modules/hono/dist/types/jsx/dom/jsx-runtime.d.ts +3 -7
  579. package/node_modules/hono/dist/types/jsx/dom/render.d.ts +32 -51
  580. package/node_modules/hono/dist/types/jsx/dom/server.d.ts +86 -85
  581. package/node_modules/hono/dist/types/jsx/dom/utils.d.ts +2 -0
  582. package/node_modules/hono/dist/types/jsx/hooks/index.d.ts +16 -17
  583. package/node_modules/hono/dist/types/jsx/index.d.ts +70 -73
  584. package/node_modules/hono/dist/types/jsx/intrinsic-element/common.d.ts +3 -1
  585. package/node_modules/hono/dist/types/jsx/intrinsic-element/components.d.ts +7 -4
  586. package/node_modules/hono/dist/types/jsx/intrinsic-elements.d.ts +708 -708
  587. package/node_modules/hono/dist/types/jsx/jsx-dev-runtime.d.ts +4 -7
  588. package/node_modules/hono/dist/types/jsx/jsx-runtime.d.ts +7 -10
  589. package/node_modules/hono/dist/types/jsx/streaming.d.ts +9 -10
  590. package/node_modules/hono/dist/types/jsx/types.d.ts +11 -13
  591. package/node_modules/hono/dist/types/jsx/utils.d.ts +2 -0
  592. package/node_modules/hono/dist/types/middleware/basic-auth/index.d.ts +17 -20
  593. package/node_modules/hono/dist/types/middleware/bearer-auth/index.d.ts +46 -49
  594. package/node_modules/hono/dist/types/middleware/body-limit/index.d.ts +6 -9
  595. package/node_modules/hono/dist/types/middleware/cache/index.d.ts +13 -15
  596. package/node_modules/hono/dist/types/middleware/combine/index.d.ts +4 -7
  597. package/node_modules/hono/dist/types/middleware/compress/index.d.ts +8 -10
  598. package/node_modules/hono/dist/types/middleware/context-storage/index.d.ts +4 -6
  599. package/node_modules/hono/dist/types/middleware/cors/index.d.ts +10 -13
  600. package/node_modules/hono/dist/types/middleware/csrf/index.d.ts +6 -9
  601. package/node_modules/hono/dist/types/middleware/etag/digest.d.ts +2 -0
  602. package/node_modules/hono/dist/types/middleware/etag/index.d.ts +6 -9
  603. package/node_modules/hono/dist/types/middleware/ip-restriction/index.d.ts +11 -13
  604. package/node_modules/hono/dist/types/middleware/jsx-renderer/index.d.ts +11 -12
  605. package/node_modules/hono/dist/types/middleware/jwk/index.d.ts +2 -1
  606. package/node_modules/hono/dist/types/middleware/jwk/jwk.d.ts +20 -23
  607. package/node_modules/hono/dist/types/middleware/jwt/index.d.ts +6 -6
  608. package/node_modules/hono/dist/types/middleware/jwt/jwt.d.ts +28 -30
  609. package/node_modules/hono/dist/types/middleware/language/index.d.ts +5 -5
  610. package/node_modules/hono/dist/types/middleware/language/language.d.ts +42 -44
  611. package/node_modules/hono/dist/types/middleware/logger/index.d.ts +3 -6
  612. package/node_modules/hono/dist/types/middleware/method-not-allowed/index.d.ts +7 -10
  613. package/node_modules/hono/dist/types/middleware/method-override/index.d.ts +14 -17
  614. package/node_modules/hono/dist/types/middleware/powered-by/index.d.ts +8 -11
  615. package/node_modules/hono/dist/types/middleware/pretty-json/index.d.ts +18 -21
  616. package/node_modules/hono/dist/types/middleware/request-id/index.d.ts +5 -5
  617. package/node_modules/hono/dist/types/middleware/request-id/request-id.d.ts +9 -11
  618. package/node_modules/hono/dist/types/middleware/secure-headers/index.d.ts +5 -6
  619. package/node_modules/hono/dist/types/middleware/secure-headers/permissions-policy.d.ts +2 -1
  620. package/node_modules/hono/dist/types/middleware/secure-headers/secure-headers.d.ts +55 -58
  621. package/node_modules/hono/dist/types/middleware/serve-static/index.d.ts +22 -24
  622. package/node_modules/hono/dist/types/middleware/serve-static/path.d.ts +2 -0
  623. package/node_modules/hono/dist/types/middleware/timeout/index.d.ts +5 -7
  624. package/node_modules/hono/dist/types/middleware/timing/index.d.ts +5 -5
  625. package/node_modules/hono/dist/types/middleware/timing/timing.d.ts +17 -21
  626. package/node_modules/hono/dist/types/middleware/trailing-slash/index.d.ts +35 -38
  627. package/node_modules/hono/dist/types/preset/quick.d.ts +6 -9
  628. package/node_modules/hono/dist/types/preset/tiny.d.ts +6 -9
  629. package/node_modules/hono/dist/types/request/constants.d.ts +2 -0
  630. package/node_modules/hono/dist/types/request.d.ts +288 -287
  631. package/node_modules/hono/dist/types/router/linear-router/index.d.ts +2 -5
  632. package/node_modules/hono/dist/types/router/linear-router/router.d.ts +7 -5
  633. package/node_modules/hono/dist/types/router/pattern-router/index.d.ts +2 -5
  634. package/node_modules/hono/dist/types/router/pattern-router/router.d.ts +7 -5
  635. package/node_modules/hono/dist/types/router/reg-exp-router/index.d.ts +3 -6
  636. package/node_modules/hono/dist/types/router/reg-exp-router/matcher.d.ts +3 -1
  637. package/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +6 -4
  638. package/node_modules/hono/dist/types/router/reg-exp-router/prepared-router.d.ts +11 -11
  639. package/node_modules/hono/dist/types/router/reg-exp-router/router.d.ts +10 -9
  640. package/node_modules/hono/dist/types/router/reg-exp-router/trie.d.ts +7 -5
  641. package/node_modules/hono/dist/types/router/smart-router/index.d.ts +2 -5
  642. package/node_modules/hono/dist/types/router/smart-router/router.d.ts +11 -9
  643. package/node_modules/hono/dist/types/router/trie-router/index.d.ts +2 -5
  644. package/node_modules/hono/dist/types/router/trie-router/node.d.ts +6 -4
  645. package/node_modules/hono/dist/types/router/trie-router/router.d.ts +7 -5
  646. package/node_modules/hono/dist/types/router/utils.d.ts +2 -0
  647. package/node_modules/hono/dist/types/router.d.ts +23 -22
  648. package/node_modules/hono/dist/types/types.d.ts +146 -506
  649. package/node_modules/hono/dist/types/utils/accept.d.ts +5 -3
  650. package/node_modules/hono/dist/types/utils/basic-auth.d.ts +4 -2
  651. package/node_modules/hono/dist/types/utils/body.d.ts +46 -51
  652. package/node_modules/hono/dist/types/utils/buffer.d.ts +7 -6
  653. package/node_modules/hono/dist/types/utils/color.d.ts +2 -0
  654. package/node_modules/hono/dist/types/utils/compress.d.ts +2 -0
  655. package/node_modules/hono/dist/types/utils/concurrent.d.ts +6 -4
  656. package/node_modules/hono/dist/types/utils/constants.d.ts +2 -0
  657. package/node_modules/hono/dist/types/utils/cookie.d.ts +20 -19
  658. package/node_modules/hono/dist/types/utils/crypto.d.ts +5 -8
  659. package/node_modules/hono/dist/types/utils/encode.d.ts +2 -0
  660. package/node_modules/hono/dist/types/utils/filepath.d.ts +5 -4
  661. package/node_modules/hono/dist/types/utils/handler.d.ts +2 -0
  662. package/node_modules/hono/dist/types/utils/headers.d.ts +2 -0
  663. package/node_modules/hono/dist/types/utils/html.d.ts +11 -10
  664. package/node_modules/hono/dist/types/utils/http-status.d.ts +2 -0
  665. package/node_modules/hono/dist/types/utils/ipaddr.d.ts +4 -6
  666. package/node_modules/hono/dist/types/utils/jwt/index.d.ts +18 -12
  667. package/node_modules/hono/dist/types/utils/jwt/jwa.d.ts +15 -13
  668. package/node_modules/hono/dist/types/utils/jwt/jws.d.ts +4 -7
  669. package/node_modules/hono/dist/types/utils/jwt/jwt.d.ts +26 -29
  670. package/node_modules/hono/dist/types/utils/jwt/types.d.ts +48 -45
  671. package/node_modules/hono/dist/types/utils/jwt/utf8.d.ts +2 -0
  672. package/node_modules/hono/dist/types/utils/mime.d.ts +59 -57
  673. package/node_modules/hono/dist/types/utils/stream.d.ts +27 -25
  674. package/node_modules/hono/dist/types/utils/types.d.ts +14 -27
  675. package/node_modules/hono/dist/types/utils/url.d.ts +2 -1
  676. package/node_modules/hono/dist/types/validator/index.d.ts +3 -7
  677. package/node_modules/hono/dist/types/validator/utils.d.ts +6 -9
  678. package/node_modules/hono/dist/types/validator/validator.d.ts +11 -10
  679. package/node_modules/hono/dist/types.js +4 -6
  680. package/node_modules/hono/dist/utils/accept.js +185 -212
  681. package/node_modules/hono/dist/utils/basic-auth.js +18 -21
  682. package/node_modules/hono/dist/utils/body.js +87 -92
  683. package/node_modules/hono/dist/utils/buffer.js +44 -71
  684. package/node_modules/hono/dist/utils/color.js +33 -21
  685. package/node_modules/hono/dist/utils/compress.js +11 -5
  686. package/node_modules/hono/dist/utils/concurrent.js +29 -38
  687. package/node_modules/hono/dist/utils/constants.js +7 -5
  688. package/node_modules/hono/dist/utils/cookie.js +114 -163
  689. package/node_modules/hono/dist/utils/crypto.js +30 -40
  690. package/node_modules/hono/dist/utils/encode.js +30 -26
  691. package/node_modules/hono/dist/utils/filepath.js +23 -33
  692. package/node_modules/hono/dist/utils/handler.js +10 -11
  693. package/node_modules/hono/dist/utils/headers.js +1 -0
  694. package/node_modules/hono/dist/utils/html.js +97 -117
  695. package/node_modules/hono/dist/utils/http-status.js +1 -0
  696. package/node_modules/hono/dist/utils/ipaddr.js +227 -279
  697. package/node_modules/hono/dist/utils/jwt/index.js +12 -4
  698. package/node_modules/hono/dist/utils/jwt/jwa.js +24 -20
  699. package/node_modules/hono/dist/utils/jwt/jws.js +115 -174
  700. package/node_modules/hono/dist/utils/jwt/jwt.js +120 -197
  701. package/node_modules/hono/dist/utils/jwt/types.js +79 -95
  702. package/node_modules/hono/dist/utils/jwt/utf8.js +9 -7
  703. package/node_modules/hono/dist/utils/mime.js +74 -79
  704. package/node_modules/hono/dist/utils/stream.js +86 -88
  705. package/node_modules/hono/dist/utils/types.js +1 -0
  706. package/node_modules/hono/dist/utils/url.js +187 -215
  707. package/node_modules/hono/dist/validator/index.js +1 -4
  708. package/node_modules/hono/dist/validator/utils.js +1 -0
  709. package/node_modules/hono/dist/validator/validator.js +61 -83
  710. package/node_modules/hono/package.json +27 -27
  711. package/node_modules/ws/lib/websocket.js +17 -3
  712. package/node_modules/ws/package.json +1 -1
  713. package/package.json +1 -1
  714. package/dist/chunk-4VSMZEBT.js.map +0 -1
  715. package/dist/chunk-6IGSOP2F.js.map +0 -1
  716. package/dist/chunk-CNG5R5WH.js.map +0 -1
  717. package/dist/chunk-MD4RTJOC.js.map +0 -1
  718. package/dist/chunk-MRE25UI7.js.map +0 -1
  719. package/dist/chunk-NJ4UEWKT.js.map +0 -1
  720. package/dist/chunk-QP2T4IAT.js.map +0 -1
  721. package/dist/doctor-gateway-report-JTTNSSRN.js +0 -17
  722. package/dist/setup-data-dir-BRURV4GF.js +0 -34
  723. /package/dist/{ast-rule-runner-KTQIW2FG.js.map → ast-rule-runner-ROCJS5V5.js.map} +0 -0
  724. /package/dist/{child-mcp-config-J7HNH7OD.js.map → child-mcp-config-CLT4G6JV.js.map} +0 -0
  725. /package/dist/{chunk-E6R7WAEO.js.map → chunk-2PTEHHTT.js.map} +0 -0
  726. /package/dist/{chunk-LXBGTBH6.js.map → chunk-5TRZCY36.js.map} +0 -0
  727. /package/dist/{chunk-PXLLBDNC.js.map → chunk-67GC5TY5.js.map} +0 -0
  728. /package/dist/{chunk-ACT5JK5R.js.map → chunk-7LBOZF2X.js.map} +0 -0
  729. /package/dist/{chunk-QXWFJE6X.js.map → chunk-ATDFYA5W.js.map} +0 -0
  730. /package/dist/{chunk-7443T7NN.js.map → chunk-CKPFNZZM.js.map} +0 -0
  731. /package/dist/{chunk-6S2VMUGZ.js.map → chunk-DP7JQSU7.js.map} +0 -0
  732. /package/dist/{chunk-DNUIP3GV.js.map → chunk-DUITQUQG.js.map} +0 -0
  733. /package/dist/{chunk-G2CZGBAU.js.map → chunk-F2MBHW5Y.js.map} +0 -0
  734. /package/dist/{chunk-ASJXBA2E.js.map → chunk-IS2PAAEU.js.map} +0 -0
  735. /package/dist/{chunk-K3PPJZIW.js.map → chunk-JA2S2P2L.js.map} +0 -0
  736. /package/dist/{chunk-UI2YX2A5.js.map → chunk-LHVKCINJ.js.map} +0 -0
  737. /package/dist/{chunk-JZM4NB3Z.js.map → chunk-MW7YAOG7.js.map} +0 -0
  738. /package/dist/{chunk-ALAZKFEN.js.map → chunk-N2KD7MXE.js.map} +0 -0
  739. /package/dist/{chunk-EROJXOR5.js.map → chunk-NMJV4JR4.js.map} +0 -0
  740. /package/dist/{chunk-NNVVDL7M.js.map → chunk-NPUKKXZV.js.map} +0 -0
  741. /package/dist/{chunk-TFSDYBCS.js.map → chunk-PFJZIJ6A.js.map} +0 -0
  742. /package/dist/{chunk-WSB5RH4X.js.map → chunk-PWWOIE47.js.map} +0 -0
  743. /package/dist/{chunk-YFZWZVYU.js.map → chunk-RWKINNVG.js.map} +0 -0
  744. /package/dist/{chunk-Y6DGFZL3.js.map → chunk-T3QVO4Z6.js.map} +0 -0
  745. /package/dist/{chunk-FWC6B7B3.js.map → chunk-UBEZZIYC.js.map} +0 -0
  746. /package/dist/{chunk-RXISPIPW.js.map → chunk-UBZNEZAG.js.map} +0 -0
  747. /package/dist/{chunk-JEWZI3LK.js.map → chunk-X3S62T3S.js.map} +0 -0
  748. /package/dist/{chunk-2QYJTGAC.js.map → chunk-XIQB6CXL.js.map} +0 -0
  749. /package/dist/{chunk-RRDXXZBI.js.map → chunk-Y37VBZ62.js.map} +0 -0
  750. /package/dist/{chunk-WQSBXFHC.js.map → chunk-YHPMSOFB.js.map} +0 -0
  751. /package/dist/{chunk-IS6RNGO4.js.map → chunk-YQTRQRH7.js.map} +0 -0
  752. /package/dist/{chunk-7OGETM4L.js.map → chunk-ZEZQ7GV4.js.map} +0 -0
  753. /package/dist/{chunk-4VQBNR5X.js.map → chunk-ZQ6ZYMZY.js.map} +0 -0
  754. /package/dist/{cli-circuit-breaker-XPZOXMTZ.js.map → cli-circuit-breaker-NY4BI2M4.js.map} +0 -0
  755. /package/dist/{composite-router-J7V4G4AV.js.map → composite-router-FCW4AZCS.js.map} +0 -0
  756. /package/dist/{consensus-vote-2SBGK5OX.js.map → consensus-vote-XQ3EAK2G.js.map} +0 -0
  757. /package/dist/{context-retriever-5RXSSV6H.js.map → context-retriever-HCN7NCXO.js.map} +0 -0
  758. /package/dist/{doctor-deep-7LPN36JD.js.map → doctor-deep-JUR5KWJV.js.map} +0 -0
  759. /package/dist/{doctor-gateway-report-JTTNSSRN.js.map → doctor-gateway-report-6SVJILTL.js.map} +0 -0
  760. /package/dist/{doctor-live-SHMQOWLA.js.map → doctor-live-62GNMKMA.js.map} +0 -0
  761. /package/dist/{expert-bridge-VOW7QBQO.js.map → expert-bridge-WDISX7RG.js.map} +0 -0
  762. /package/dist/{factory-37NFTAM4.js.map → factory-NCCP3VNN.js.map} +0 -0
  763. /package/dist/{factory-DVVU3EMA.js.map → factory-OMJSMBSL.js.map} +0 -0
  764. /package/dist/{improvement-review-ODFOU2G4.js.map → improvement-review-YFQLWYLJ.js.map} +0 -0
  765. /package/dist/{init-opencode-2BIZ2RQL.js.map → init-opencode-SYTACFM2.js.map} +0 -0
  766. /package/dist/{issue-triage-UPZ7ITJD.js.map → issue-triage-VSXJ7AY3.js.map} +0 -0
  767. /package/dist/{openai-compat-adapter-JEME4MB5.js.map → openai-compat-adapter-YZRFOEEI.js.map} +0 -0
  768. /package/dist/{pr-reviewer-helpers-FDMW5NQT.js.map → pr-reviewer-helpers-RAF7DGIB.js.map} +0 -0
  769. /package/dist/{registry-command-FB6D2LSD.js.map → registry-command-WG5TUJC4.js.map} +0 -0
  770. /package/dist/{repo-security-plan-JTDMTZ2P.js.map → repo-security-plan-5FLHCCTG.js.map} +0 -0
  771. /package/dist/{research-helpers-synthesize-HB7QBCYP.js.map → research-helpers-synthesize-EYCKTVZU.js.map} +0 -0
  772. /package/dist/{routing-memory-VEHZK2WD.js.map → routing-memory-Z2HE7IH3.js.map} +0 -0
  773. /package/dist/{session-memory-WV6DQGFB.js.map → session-memory-5QIPC7O6.js.map} +0 -0
  774. /package/dist/{setup-config-VISHCDVU.js.map → setup-config-HNHBQG52.js.map} +0 -0
  775. /package/dist/{setup-custom-api-CA4GQP4X.js.map → setup-custom-api-2KYNK6WT.js.map} +0 -0
  776. /package/dist/{setup-data-dir-BRURV4GF.js.map → setup-data-dir-B56LLZNT.js.map} +0 -0
  777. /package/dist/{tool-memory-Y7YMEYA5.js.map → tool-memory-LWPWVKWR.js.map} +0 -0
  778. /package/dist/{unified-registry-PAV3YH3U.js.map → unified-registry-A72U42LZ.js.map} +0 -0
  779. /package/dist/{weather-report-HHI5HS22.js.map → weather-report-HVUNR7SZ.js.map} +0 -0
@@ -9,9 +9,9 @@ import {
9
9
  getBuiltInAstRulesPath,
10
10
  loadRules,
11
11
  runAstQaRules
12
- } from "./chunk-JZM4NB3Z.js";
12
+ } from "./chunk-MW7YAOG7.js";
13
13
  import "./chunk-XEPZSDN5.js";
14
- import "./chunk-6IGSOP2F.js";
14
+ import "./chunk-7S7DKO4D.js";
15
15
  import "./chunk-UE7A2XHM.js";
16
16
  import "./chunk-LWOX65CP.js";
17
17
  import "./chunk-PX6F3LHL.js";
@@ -27,4 +27,4 @@ export {
27
27
  loadRules,
28
28
  runAstQaRules
29
29
  };
30
- //# sourceMappingURL=ast-rule-runner-KTQIW2FG.js.map
30
+ //# sourceMappingURL=ast-rule-runner-ROCJS5V5.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-OITVVSWO.js";
4
4
  import {
5
5
  createLogger
6
- } from "./chunk-6IGSOP2F.js";
6
+ } from "./chunk-7S7DKO4D.js";
7
7
  import "./chunk-UE7A2XHM.js";
8
8
  import "./chunk-LWOX65CP.js";
9
9
  import "./chunk-PX6F3LHL.js";
@@ -49,4 +49,4 @@ async function generateMcpConfig(options) {
49
49
  export {
50
50
  generateMcpConfig
51
51
  };
52
- //# sourceMappingURL=child-mcp-config-J7HNH7OD.js.map
52
+ //# sourceMappingURL=child-mcp-config-CLT4G6JV.js.map
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  assessReputation,
6
6
  sanitizeInput
7
- } from "./chunk-G2CZGBAU.js";
7
+ } from "./chunk-F2MBHW5Y.js";
8
8
  import {
9
9
  allOf
10
10
  } from "./chunk-EZNIYU5T.js";
@@ -13,7 +13,7 @@ import {
13
13
  err,
14
14
  getTimeProvider,
15
15
  ok
16
- } from "./chunk-6IGSOP2F.js";
16
+ } from "./chunk-7S7DKO4D.js";
17
17
 
18
18
  // src/dogfooding/pr-reviewer-helpers.ts
19
19
  import { randomUUID } from "node:crypto";
@@ -477,4 +477,4 @@ export {
477
477
  createFailedReview,
478
478
  reviewPostingBlock
479
479
  };
480
- //# sourceMappingURL=chunk-E6R7WAEO.js.map
480
+ //# sourceMappingURL=chunk-2PTEHHTT.js.map
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  ensureGatewayDiscovered,
3
3
  gatewayDiscoveryGeneration
4
- } from "./chunk-JEWZI3LK.js";
4
+ } from "./chunk-X3S62T3S.js";
5
5
  import {
6
6
  createAutoAdapter
7
- } from "./chunk-MD4RTJOC.js";
7
+ } from "./chunk-VWXR7HKU.js";
8
8
  import {
9
9
  getDefaultCliCircuitBreakerRegistry,
10
10
  mapModelErrorToCategory
11
- } from "./chunk-EROJXOR5.js";
11
+ } from "./chunk-NMJV4JR4.js";
12
12
  import {
13
13
  CircularBuffer,
14
14
  ConfigError,
15
15
  ModelError,
16
16
  TASK_SPECIALIZATION_MATRIX,
17
- canonicalVersionKey,
17
+ UNRESOLVED_MODEL_ID,
18
18
  createLogger,
19
19
  detectTaskCategory,
20
20
  err,
@@ -31,42 +31,9 @@ import {
31
31
  isRateLimitLikeError,
32
32
  ok,
33
33
  recordRateLimitEvent,
34
- resolveModelIdentitySync,
35
34
  toRateLimitError,
36
35
  warnIfGatewayCostUndeclared
37
- } from "./chunk-6IGSOP2F.js";
38
-
39
- // src/config/model-equivalence.ts
40
- var VARIANT_QUIRKS = /* @__PURE__ */ new Set(["small", "image"]);
41
- function canonicalModelKey(modelId) {
42
- if (modelId === "") return null;
43
- const identity = resolveModelIdentitySync(modelId);
44
- if (identity.vendor === "unknown" || identity.family === "unknown") return null;
45
- const version = identity.version === void 0 ? "" : canonicalVersionKey(identity.version);
46
- const variant = identity.quirks.filter((q) => VARIANT_QUIRKS.has(q)).sort().join("-");
47
- return variant === "" ? `${identity.vendor}|${identity.family}|${version}` : `${identity.vendor}|${identity.family}|${version}|${variant}`;
48
- }
49
- function countDistinctModels(modelIds) {
50
- const distinct = /* @__PURE__ */ new Set();
51
- for (const id of modelIds) {
52
- const key = canonicalModelKey(id);
53
- distinct.add(key ?? `raw:${id}`);
54
- }
55
- return distinct.size;
56
- }
57
- var UNRESOLVED_MODEL_ID = "pending-detection";
58
- function assessPanelIndependence(modelIds) {
59
- const resolved = modelIds.filter(
60
- (id) => typeof id === "string" && id !== "" && id !== UNRESOLVED_MODEL_ID
61
- );
62
- const unresolved = modelIds.length - resolved.length;
63
- if (unresolved > 0 || modelIds.length === 0) {
64
- return { kind: "unmeasured", unresolved, total: modelIds.length };
65
- }
66
- const distinct = countDistinctModels(resolved);
67
- if (distinct === 1) return { kind: "collapsed", model: resolved[0] ?? "" };
68
- return { kind: "diverse", distinct };
69
- }
36
+ } from "./chunk-7S7DKO4D.js";
70
37
 
71
38
  // src/agents/collaboration/event-bus-helpers.ts
72
39
  import { randomUUID } from "node:crypto";
@@ -1062,10 +1029,6 @@ function resetGlobalRegistry() {
1062
1029
  }
1063
1030
 
1064
1031
  export {
1065
- canonicalModelKey,
1066
- countDistinctModels,
1067
- UNRESOLVED_MODEL_ID,
1068
- assessPanelIndependence,
1069
1032
  getGlobalEventBus,
1070
1033
  createEvent,
1071
1034
  EventTopics,
@@ -1076,4 +1039,4 @@ export {
1076
1039
  getGlobalRegistry,
1077
1040
  resetGlobalRegistry
1078
1041
  };
1079
- //# sourceMappingURL=chunk-QP2T4IAT.js.map
1042
+ //# sourceMappingURL=chunk-2RXTHEUD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/agents/collaboration/event-bus-helpers.ts","../src/agents/collaboration/event-bus.ts","../src/agents/collaboration/event-bus-topics.ts","../src/adapters/resilient-adapter.ts","../src/adapters/model-bound-adapter.ts","../src/adapters/unified-registry.ts"],"sourcesContent":["/**\n * Event Bus Helper Functions\n *\n * Pure utility functions for event bus operations.\n * Extracted from event-bus.ts to maintain file size limits.\n *\n * @module agents/collaboration/event-bus-helpers\n * (Source: Issue #182, ARCHITECTURE.md Hybrid Architecture)\n */\n\nimport { randomUUID } from 'node:crypto';\nimport { getTimeProvider } from '../../core/index.js';\nimport type { SubscriptionId, TopicPattern, DomainEvent, EventFilter } from './event-bus-types.js';\n\n/** Default maximum history size */\nexport const DEFAULT_MAX_HISTORY_SIZE = 1000;\n\n/** Maximum number of subscriptions per bus */\nexport const MAX_SUBSCRIPTIONS = 500;\n\n/**\n * Internal subscription record.\n */\nexport interface SubscriptionRecord {\n readonly id: SubscriptionId;\n readonly pattern: TopicPattern;\n readonly regex: RegExp;\n readonly listener: (event: DomainEvent) => void | Promise<void>;\n}\n\n/** Maximum allowed topic pattern length */\nconst MAX_TOPIC_PATTERN_LENGTH = 200;\n\n/**\n * Convert a topic pattern to a regex for matching.\n * Supports wildcard patterns:\n * - 'session.created' -> exact match\n * - 'session.*' -> matches session.anything\n * - '*' -> matches everything\n *\n * Security Note (Issue #341): This function is safe from ReDoS because:\n * 1. The input is fully escaped before regex construction\n * 2. Only `*` wildcards are converted to `[^.]+` (bounded, non-greedy)\n * 3. Pattern length is bounded to prevent memory issues\n *\n * @throws Error if pattern exceeds MAX_TOPIC_PATTERN_LENGTH\n */\nexport function patternToRegex(pattern: TopicPattern): RegExp {\n // Validate length to prevent memory issues (Issue #341)\n if (pattern.length > MAX_TOPIC_PATTERN_LENGTH) {\n throw new Error(`Topic pattern exceeds maximum length of ${String(MAX_TOPIC_PATTERN_LENGTH)}`);\n }\n\n if (pattern === '*') {\n return /^.+$/;\n }\n // Use placeholder for * before escaping, then restore as regex wildcard\n // WILDCARD_PLACEHOLDER is a static constant, safe for RegExp (Issue #341)\n const WILDCARD_PLACEHOLDER = '\\x00WILDCARD\\x00';\n const withPlaceholder = pattern.replace(/\\*/g, WILDCARD_PLACEHOLDER);\n // Escape all regex special characters - this makes the pattern safe\n const escaped = withPlaceholder.replace(/[.+?^${}()|[\\]\\\\]/g, '\\\\$&');\n // Replace placeholder with bounded wildcard - safe since input was escaped\n const withWildcards = escaped.replace(new RegExp(WILDCARD_PLACEHOLDER, 'g'), '[^.]+');\n return new RegExp(`^${withWildcards}$`);\n}\n\n/**\n * Check if a topic matches a pattern.\n */\nexport function topicMatchesPattern(topic: string, regex: RegExp): boolean {\n return regex.test(topic);\n}\n\n/**\n * Generate a unique event ID.\n */\nexport function generateEventId(): string {\n return `evt-${String(getTimeProvider().now())}-${randomUUID().slice(0, 8)}`;\n}\n\n/**\n * Generate a unique subscription ID.\n */\nexport function generateSubscriptionId(): SubscriptionId {\n return `sub-${String(getTimeProvider().now())}-${randomUUID().slice(0, 8)}`;\n}\n\n/**\n * Generate a unique correlation ID for request tracing.\n * (Source: Issue #224, Sprint #228)\n *\n * @example\n * ```typescript\n * const correlationId = generateCorrelationId();\n * // -> 'cor_a1b2c3d4'\n * ```\n */\nexport function generateCorrelationId(): string {\n return `cor_${randomUUID().slice(0, 8)}`;\n}\n\n/**\n * Create a child correlation ID that chains to a parent.\n * Enables hierarchical tracing of subtasks.\n * (Source: Issue #224, Sprint #228)\n *\n * @param parentCorrelationId - The parent correlation ID to chain from\n * @returns A new correlation ID in format 'parentId.child_xxxxxxxx'\n *\n * @example\n * ```typescript\n * const parentId = generateCorrelationId();\n * // -> 'cor_a1b2c3d4'\n *\n * const childId = createChildCorrelationId(parentId);\n * // -> 'cor_a1b2c3d4.child_e5f6g7h8'\n * ```\n */\nexport function createChildCorrelationId(parentCorrelationId: string): string {\n return `${parentCorrelationId}.child_${randomUUID().slice(0, 8)}`;\n}\n\n/**\n * Apply topic, session, correlation, and timestamp filters to events.\n */\nexport function applyHistoryFilters(history: DomainEvent[], filter: EventFilter): DomainEvent[] {\n let result: DomainEvent[] = history;\n\n if (filter.topic !== undefined && filter.topic !== '') {\n const regex = patternToRegex(filter.topic);\n result = result.filter((e) => topicMatchesPattern(e.topic, regex));\n }\n\n if (filter.sessionId !== undefined && filter.sessionId !== '') {\n result = result.filter((e) => e.sessionId === filter.sessionId);\n }\n\n if (filter.correlationId !== undefined && filter.correlationId !== '') {\n result = result.filter((e) => e.correlationId === filter.correlationId);\n }\n\n return applyTimestampFilters(result, filter);\n}\n\n/**\n * Apply timestamp-based filters to events.\n */\nexport function applyTimestampFilters(result: DomainEvent[], filter: EventFilter): DomainEvent[] {\n let filtered = result;\n\n if (filter.after !== undefined && filter.after !== '') {\n const afterTimestamp = filter.after;\n filtered = filtered.filter((e) => e.timestamp > afterTimestamp);\n }\n\n if (filter.before !== undefined && filter.before !== '') {\n const beforeTimestamp = filter.before;\n filtered = filtered.filter((e) => e.timestamp < beforeTimestamp);\n }\n\n return filtered;\n}\n\n/**\n * Apply limit to history results.\n */\nexport function applyHistoryLimit(result: DomainEvent[], filter: EventFilter): DomainEvent[] {\n if (filter.limit !== undefined && filter.limit > 0) {\n return result.slice(-filter.limit);\n }\n return result;\n}\n\n/**\n * Enrich event with generated fields if missing.\n */\nexport function enrichEvent(event: DomainEvent): DomainEvent {\n return {\n ...event,\n eventId: event.eventId || generateEventId(),\n timestamp: event.timestamp || getTimeProvider().nowIso(),\n };\n}\n\n/**\n * Count subscribers matching a topic from a subscription map.\n */\nexport function countMatchingSubscribers(\n topic: string,\n subscriptions: Map<SubscriptionId, SubscriptionRecord>\n): number {\n let count = 0;\n for (const record of subscriptions.values()) {\n if (topicMatchesPattern(topic, record.regex)) {\n count++;\n }\n }\n return count;\n}\n","/**\n * Event Bus Implementation\n *\n * Async message passing for agent-to-agent communication.\n * Supports topic-based routing, wildcard patterns, and event history.\n *\n * @module agents/collaboration/event-bus\n * (Source: Issue #182, ARCHITECTURE.md Hybrid Architecture)\n */\n\nimport { getTimeProvider } from '../../core/index.js';\nimport type {\n ICollaborationEventBus,\n DomainEvent,\n EventListener,\n Subscription,\n SubscriptionId,\n TopicPattern,\n EventFilter,\n EventBusOptions,\n EventBusStats,\n} from './event-bus-types.js';\n\nimport {\n DEFAULT_MAX_HISTORY_SIZE,\n MAX_SUBSCRIPTIONS,\n type SubscriptionRecord,\n patternToRegex,\n topicMatchesPattern,\n generateEventId,\n generateSubscriptionId,\n applyHistoryFilters,\n applyHistoryLimit,\n enrichEvent,\n countMatchingSubscribers,\n} from './event-bus-helpers.js';\n\nimport { CircularBuffer } from '../../core/circular-buffer.js';\n\n// Re-export correlation ID helpers for public API\nexport { generateCorrelationId, createChildCorrelationId } from './event-bus-helpers.js';\n\n/**\n * Event Bus for agent-to-agent communication.\n *\n * Features:\n * - Topic-based pub/sub with wildcard support\n * - Async and sync event emission\n * - Event history with filtering\n * - Error isolation (one listener failure doesn't block others)\n *\n * @example\n * ```typescript\n * const bus = new CollaborationEventBus();\n *\n * // Subscribe to all session events\n * const sub = bus.subscribe('session.*', (event) => {\n * console.log('Session event:', event.topic);\n * });\n *\n * // Emit an event\n * bus.emit(createSessionCreatedEvent({ sessionId: '123', ... }));\n *\n * // Cleanup\n * sub.unsubscribe();\n * ```\n */\nexport class CollaborationEventBus implements ICollaborationEventBus {\n private readonly subscriptions: Map<SubscriptionId, SubscriptionRecord> = new Map();\n private readonly history: CircularBuffer<DomainEvent>;\n private readonly asyncHandling: boolean;\n private readonly logger?: EventBusOptions['logger'];\n\n private stats: EventBusStats = {\n eventsEmitted: 0,\n subscriptionsCreated: 0,\n activeSubscriptions: 0,\n historySize: 0,\n errorCount: 0,\n };\n\n constructor(options: EventBusOptions = {}) {\n const maxHistorySize = options.maxHistorySize ?? DEFAULT_MAX_HISTORY_SIZE;\n this.history = new CircularBuffer<DomainEvent>(maxHistorySize);\n this.asyncHandling = options.asyncHandling ?? false;\n this.logger = options.logger;\n }\n\n /**\n * Emit an event synchronously to all matching subscribers.\n */\n emit(event: DomainEvent): void {\n const enrichedEvent = enrichEvent(event);\n this.addToHistory(enrichedEvent);\n this.stats.eventsEmitted++;\n\n this.logger?.debug('Event emitted', {\n topic: enrichedEvent.topic,\n eventId: enrichedEvent.eventId,\n subscriberCount: countMatchingSubscribers(enrichedEvent.topic, this.subscriptions),\n });\n\n for (const record of this.subscriptions.values()) {\n if (topicMatchesPattern(enrichedEvent.topic, record.regex)) {\n this.invokeListener(record, enrichedEvent);\n }\n }\n }\n\n /**\n * Emit an event and wait for all async handlers to complete.\n */\n async emitAsync(event: DomainEvent): Promise<void> {\n const enrichedEvent = enrichEvent(event);\n this.addToHistory(enrichedEvent);\n this.stats.eventsEmitted++;\n\n this.logger?.debug('Async event emitted', {\n topic: enrichedEvent.topic,\n eventId: enrichedEvent.eventId,\n });\n\n const promises: Promise<void>[] = [];\n\n for (const record of this.subscriptions.values()) {\n if (topicMatchesPattern(enrichedEvent.topic, record.regex)) {\n promises.push(this.invokeListenerAsync(record, enrichedEvent));\n }\n }\n\n await Promise.all(promises);\n }\n\n /**\n * Subscribe to events matching a topic pattern.\n */\n subscribe<T extends DomainEvent = DomainEvent>(\n pattern: TopicPattern,\n listener: EventListener<T>\n ): Subscription {\n if (this.subscriptions.size >= MAX_SUBSCRIPTIONS) {\n throw new Error(\n `Maximum subscription limit reached (${String(MAX_SUBSCRIPTIONS)}). ` +\n 'Unsubscribe from unused patterns before adding new ones.'\n );\n }\n\n const id = generateSubscriptionId();\n const regex = patternToRegex(pattern);\n\n const record: SubscriptionRecord = {\n id,\n pattern,\n regex,\n listener: listener as EventListener,\n };\n\n this.subscriptions.set(id, record);\n this.stats.subscriptionsCreated++;\n this.stats.activeSubscriptions = this.subscriptions.size;\n\n this.logger?.debug('Subscription created', { id, pattern });\n\n return {\n id,\n pattern,\n unsubscribe: () => {\n this.unsubscribe(id);\n },\n };\n }\n\n /**\n * Unsubscribe from events.\n */\n unsubscribe(subscriptionId: SubscriptionId): void {\n const existed = this.subscriptions.delete(subscriptionId);\n if (existed) {\n this.stats.activeSubscriptions = this.subscriptions.size;\n this.logger?.debug('Subscription removed', { subscriptionId });\n }\n }\n\n /**\n * Get event history matching filter criteria.\n */\n getHistory(filter?: EventFilter): readonly DomainEvent[] {\n const historyArray = this.history.toArray();\n if (filter === undefined) {\n return historyArray;\n }\n\n const filtered = applyHistoryFilters(historyArray, filter);\n return applyHistoryLimit(filtered, filter);\n }\n\n /**\n * Clear event history.\n */\n clearHistory(): void {\n this.history.clear();\n this.stats.historySize = 0;\n this.logger?.debug('History cleared');\n }\n\n /**\n * Get event bus statistics.\n */\n getStats(): EventBusStats {\n return { ...this.stats };\n }\n\n /**\n * Check if a topic pattern has any subscribers.\n */\n hasSubscribers(pattern: TopicPattern): boolean {\n const regex = patternToRegex(pattern);\n for (const record of this.subscriptions.values()) {\n // Check if the patterns could overlap\n if (\n topicMatchesPattern(pattern, record.regex) ||\n topicMatchesPattern(record.pattern, regex)\n ) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Add event to history, maintaining size limit via O(1) circular buffer.\n * @see Issue #407 - Performance optimization\n */\n private addToHistory(event: DomainEvent): void {\n this.history.push(event);\n this.stats.historySize = this.history.size;\n }\n\n /**\n * Invoke a listener synchronously with error isolation.\n */\n private invokeListener(record: SubscriptionRecord, event: DomainEvent): void {\n try {\n const result = record.listener(event);\n // If async handling is enabled and listener returns a promise, don't wait\n if (this.asyncHandling && result instanceof Promise) {\n result.catch((error: unknown) => {\n this.handleListenerError(record, event, error);\n });\n }\n } catch (error) {\n this.handleListenerError(record, event, error);\n }\n }\n\n /**\n * Invoke a listener asynchronously.\n */\n private async invokeListenerAsync(record: SubscriptionRecord, event: DomainEvent): Promise<void> {\n try {\n await record.listener(event);\n } catch (error) {\n this.handleListenerError(record, event, error);\n }\n }\n\n /**\n * Handle listener errors without disrupting other listeners.\n */\n private handleListenerError(\n record: SubscriptionRecord,\n event: DomainEvent,\n error: unknown\n ): void {\n this.stats.errorCount++;\n const errorObj = error instanceof Error ? error : new Error(String(error));\n this.logger?.error('Event listener error', errorObj, {\n subscriptionId: record.id,\n pattern: record.pattern,\n eventTopic: event.topic,\n eventId: event.eventId,\n });\n }\n}\n\n/**\n * Create a singleton event bus instance for global coordination.\n * Use with caution - prefer dependency injection for testability.\n */\nlet globalBus: CollaborationEventBus | null = null;\n\nexport function getGlobalEventBus(options?: EventBusOptions): CollaborationEventBus {\n globalBus ??= new CollaborationEventBus(options);\n return globalBus;\n}\n\n/**\n * Reset the global event bus (for testing).\n */\nexport function resetGlobalEventBus(): void {\n globalBus = null;\n}\n\n/**\n * Factory functions for creating typed events.\n */\nexport function createEvent<T extends DomainEvent>(\n topic: T['topic'],\n payload: T['payload'],\n options?: {\n sessionId?: string;\n correlationId?: string;\n }\n): T {\n return {\n eventId: generateEventId(),\n timestamp: getTimeProvider().nowIso(),\n topic,\n payload,\n sessionId: options?.sessionId,\n correlationId: options?.correlationId,\n } as T;\n}\n","/**\n * Event Bus Topic Constants\n *\n * Type-safe topic constants for event subscription.\n *\n * @module agents/collaboration/event-bus-topics\n * (Source: Issue #182, ARCHITECTURE.md Hybrid Architecture)\n */\n\n/**\n * Topic constants for type-safe subscription.\n */\nexport const EventTopics = {\n // Session events\n SESSION_CREATED: 'session.created',\n SESSION_STATUS_CHANGED: 'session.status_changed',\n SESSION_PARTICIPANT_JOINED: 'session.participant_joined',\n SESSION_RESULT_SUBMITTED: 'session.result_submitted',\n SESSION_FINALIZED: 'session.finalized',\n SESSION_ALL: 'session.*',\n\n // Message events\n MESSAGE_SENT: 'message.sent',\n MESSAGE_RECEIVED: 'message.received',\n MESSAGE_ALL: 'message.*',\n\n // Agent events\n AGENT_TASK_DELEGATED: 'agent.task_delegated',\n AGENT_RESULT_BROADCAST: 'agent.result_broadcast',\n AGENT_ALL: 'agent.*',\n\n // Consensus events\n CONSENSUS_VOTE_REQUESTED: 'consensus.vote_requested',\n CONSENSUS_VOTE_CAST: 'consensus.vote_cast',\n CONSENSUS_REACHED: 'consensus.reached',\n CONSENSUS_ALL: 'consensus.*',\n\n // Protocol events\n PROTOCOL_STARTED: 'protocol.started',\n PROTOCOL_ITERATION: 'protocol.iteration',\n PROTOCOL_COMPLETED: 'protocol.completed',\n PROTOCOL_ALL: 'protocol.*',\n\n // Aegean phase events (Issue #216)\n AEGEAN_ROUND_STARTED: 'protocol.aegean.round_started',\n AEGEAN_VOTE_COLLECTED: 'protocol.aegean.vote_collected',\n AEGEAN_QUORUM_DETECTED: 'protocol.aegean.quorum_detected',\n AEGEAN_ALL: 'protocol.aegean.*',\n\n // Reflexion phase events (Issue #216)\n REFLEXION_CRITIQUE_STARTED: 'protocol.reflexion.critique_started',\n REFLEXION_CRITIQUE_COMPLETED: 'protocol.reflexion.critique_completed',\n REFLEXION_SYNTHESIS: 'protocol.reflexion.synthesis',\n REFLEXION_ALL: 'protocol.reflexion.*',\n\n // Trinity phase events (Issue #216)\n TRINITY_PHASE_STARTED: 'protocol.trinity.phase_started',\n TRINITY_PHASE_COMPLETED: 'protocol.trinity.phase_completed',\n TRINITY_ALL: 'protocol.trinity.*',\n\n // Byzantine detection events (Issue #218)\n BYZANTINE_WEIGHT_UPDATED: 'byzantine.weight_updated',\n BYZANTINE_PATTERN_DETECTED: 'byzantine.pattern_detected',\n BYZANTINE_AGENT_FLAGGED: 'byzantine.agent_flagged',\n BYZANTINE_COLLUSION_SUSPECTED: 'byzantine.collusion_suspected',\n BYZANTINE_ALL: 'byzantine.*',\n\n // Wildcard\n ALL: '*',\n} as const;\n","/**\n * Resilient Model Adapter\n *\n * Transparent proxy implementing IModelAdapter with lazy detection,\n * automatic failover on circuit breaker events, and observable health.\n *\n * Key design: ResilientAdapter IS an IModelAdapter. Every existing consumer\n * works unchanged. The health/failover API lives on IResilientAdapter for\n * dashboard and monitoring consumers only.\n *\n * @module adapters/resilient-adapter\n * (Source: Issue #811 - Resilient model adapter architecture)\n */\n\nimport type {\n IModelAdapter,\n CompletionRequest,\n CompletionResponse,\n StreamChunk,\n ModelCapability,\n} from '../core/types/model.js';\nimport type { Result } from '../core/result.js';\nimport { ok, err } from '../core/result.js';\nimport { ModelError, ConfigError } from '../core/errors.js';\nimport type { ILogger } from '../core/index.js';\nimport { getTimeProvider, getRandomProvider } from '../core/index.js';\nimport { getErrorMessage, createLogger } from '../core/index.js';\nimport { UNRESOLVED_MODEL_ID } from '../config/model-equivalence.js';\n\nimport { createAutoAdapter, type AdapterSelection } from './auto-adapter.js';\nimport { isCallerCancelled } from './abort-utils.js';\nimport { ensureGatewayDiscovered, gatewayDiscoveryGeneration } from './gateway-rediscovery.js';\nimport {\n isRateLimitLikeError,\n isDurableCapacityError,\n toRateLimitError,\n recordRateLimitEvent,\n} from './rate-limit-detector.js';\nimport type { CliName, EndpointArmId } from '../cli-adapters/types.js';\nimport { isEndpointArmId } from '../cli-adapters/types.js';\nimport type {\n IResilientAdapter,\n AdapterHealthInfo,\n ResilientAdapterConfig,\n} from './resilient-adapter-types.js';\nimport type { CircuitStateChangeEvent } from '../cli-adapters/circuit-breaker-types.js';\nimport type { CircuitBreakerRegistry } from '../cli-adapters/circuit-breaker.js';\nimport { mapModelErrorToCategory } from '../cli-adapters/circuit-breaker.js';\nimport { getGlobalEventBus } from '../core/event-bus.js';\n\n// ============================================================================\n// Factory\n// ============================================================================\n\n/**\n * Creates a resilient adapter with lazy detection and automatic failover.\n *\n * @example\n * ```typescript\n * const adapter = createResilientAdapter({ logger });\n * // No detection at creation time — detection happens on first use\n * const result = await adapter.complete(request); // triggers detection\n * ```\n */\nexport function createResilientAdapter(config?: ResilientAdapterConfig): IResilientAdapter {\n return new ResilientAdapter(config);\n}\n\n// ============================================================================\n// Implementation\n// ============================================================================\n\n/**\n * Resilient adapter proxy. Implements IModelAdapter transparently.\n */\nexport class ResilientAdapter implements IResilientAdapter {\n private readonly logger: ILogger;\n private currentAdapter: IModelAdapter | undefined;\n private currentSelection: AdapterSelection | undefined;\n private hasEverDetected = false;\n private health: AdapterHealthInfo | undefined;\n private preferredCli: CliName | undefined;\n private readonly failoverCallbacks = new Set<(info: AdapterHealthInfo) => void>();\n private circuitBreakerRegistry: CircuitBreakerRegistry | undefined;\n private circuitListener: ((event: CircuitStateChangeEvent) => void) | undefined;\n private disposed = false;\n private readonly defaultCliTimeoutMs: number | undefined;\n /** Inflight detection promise for coalescing concurrent calls (Issue #1423). */\n private detectionPromise: Promise<IModelAdapter | undefined> | undefined;\n /** The {@link gatewayDiscoveryGeneration} the current selection was made under (#6659). */\n private detectedAtGeneration = 0;\n\n constructor(config?: ResilientAdapterConfig) {\n this.logger = config?.logger ?? createLogger({ component: 'resilient-adapter' });\n this.preferredCli = config?.preferredCli;\n this.defaultCliTimeoutMs = config?.defaultCliTimeoutMs;\n\n // #4659: arm at construction. The previous `attach`-only API was not on\n // IResilientAdapter, so neither production construction site could reach\n // it and the breaker never fired.\n if (config?.circuitBreakerRegistry !== undefined) {\n this.attachCircuitBreakerRegistry(config.circuitBreakerRegistry);\n }\n }\n\n // --- IModelAdapter properties (forwarded) ---\n\n /**\n * Before detection a CLI-pinned proxy identifies as the CLI it was asked\n * for (`cli-<name>`, the id its detected `CliToModelAdapter` will carry);\n * an unpinned proxy stays `resilient-proxy`.\n *\n * #6119: the voter fallover (#3587) keys seats by this id and skips a seat\n * whose key equals the fallback's. When codex never detected, the pinned\n * seat and the unpinned default were BOTH `resilient-proxy`, so the seat was\n * read as \"already on the fallback\" and errored instead of falling over.\n */\n get providerId(): string {\n if (this.currentAdapter !== undefined) return this.currentAdapter.providerId;\n return this.preferredCli === undefined ? 'resilient-proxy' : `cli-${this.preferredCli}`;\n }\n\n get modelId(): string {\n return this.currentAdapter?.modelId ?? UNRESOLVED_MODEL_ID;\n }\n\n get capabilities(): readonly ModelCapability[] {\n return this.currentAdapter?.capabilities ?? [];\n }\n\n /**\n * The gateway arm of the adapter currently serving this proxy, when a\n * gateway model serves it (#6604 family slots); otherwise undefined. A\n * telemetry writer handed this proxy reads it (`isGatewayModelAdapter`) to\n * price the call by the gateway's `NEXUS_GATEWAY_COST` declaration instead\n * of a list price.\n */\n get gatewayArm(): EndpointArmId | undefined {\n const arm: unknown = (this.currentAdapter as { gatewayArm?: unknown } | undefined)?.gatewayArm;\n return typeof arm === 'string' && isEndpointArmId(arm) ? arm : undefined;\n }\n\n // --- IModelAdapter methods ---\n\n async complete(request: CompletionRequest): Promise<Result<CompletionResponse, ModelError>> {\n const adapter = await this.ensureAdapter();\n if (adapter === undefined) {\n return err(new ModelError('No model adapter available'));\n }\n const result = await adapter.complete(request);\n if (!result.ok) {\n if (isRateLimitLikeError(result.error)) {\n const rlError = toRateLimitError(result.error, adapter.providerId);\n recordRateLimitEvent({\n provider: adapter.providerId,\n timestamp: getTimeProvider().now(),\n retryAfterMs: rlError.retryAfterMs,\n });\n this.logger.warn('Rate limit detected', {\n provider: adapter.providerId,\n retryAfterMs: rlError.retryAfterMs,\n });\n }\n this.recordBreakerFailure(adapter, result.error);\n }\n return result;\n }\n\n async *stream(request: CompletionRequest): AsyncIterable<StreamChunk> {\n const adapter = await this.ensureAdapter();\n if (adapter === undefined) {\n // #3105: error like complete() rather than yielding an empty stream — a\n // silent-empty stream masks \"no adapter available\" as a clean empty\n // completion, so streamWithFallback can't tell failure from a\n // legitimately-empty result.\n throw new ModelError('No model adapter available');\n }\n yield* adapter.stream(request);\n }\n\n async countTokens(text: string): Promise<number> {\n const adapter = await this.ensureAdapter();\n if (adapter === undefined) {\n return 0;\n }\n return adapter.countTokens(text);\n }\n\n validateConfig(): Result<void, ConfigError> {\n if (this.currentAdapter !== undefined) {\n return this.currentAdapter.validateConfig();\n }\n // Before first use, config is trivially valid\n return ok(undefined);\n }\n\n // --- IResilientAdapter methods ---\n\n getHealth(): AdapterHealthInfo | undefined {\n return this.health;\n }\n\n async refresh(): Promise<void> {\n this.currentAdapter = undefined;\n this.currentSelection = undefined;\n this.detectionPromise = undefined;\n await this.ensureAdapter();\n }\n\n setPreferredCli(cli: CliName | undefined): void {\n this.preferredCli = cli;\n this.currentAdapter = undefined;\n this.currentSelection = undefined;\n }\n\n onFailover(cb: (info: AdapterHealthInfo) => void): () => void {\n this.failoverCallbacks.add(cb);\n return () => {\n this.failoverCallbacks.delete(cb);\n };\n }\n\n /**\n * Attach a circuit breaker registry for automatic failover.\n * When the current adapter's circuit opens, the cached adapter\n * is cleared so the next call triggers re-detection.\n */\n /** The registry arming failover, or undefined if this adapter is unarmed (#4659). */\n getCircuitBreakerRegistry(): CircuitBreakerRegistry | undefined {\n return this.circuitBreakerRegistry;\n }\n\n attachCircuitBreakerRegistry(registry: CircuitBreakerRegistry): void {\n this.detachCircuitBreakerRegistry();\n this.circuitBreakerRegistry = registry;\n this.circuitListener = (event: CircuitStateChangeEvent) => {\n this.handleCircuitStateChange(event);\n };\n registry.addGlobalStateChangeListener(this.circuitListener);\n }\n\n dispose(): void {\n if (this.disposed) return;\n this.disposed = true;\n this.detachCircuitBreakerRegistry();\n this.failoverCallbacks.clear();\n }\n\n // --- Private methods ---\n\n private async ensureAdapter(): Promise<IModelAdapter | undefined> {\n // #6659: the shared acquisition seam re-discovers a gateway that was down\n // at boot (backoff-bounded, one shared attempt; a no-op unless armed).\n // Once one is found, an adapter detected before it re-detects ONCE, so the\n // default and the family slots move onto the gateway. Not a failover: the\n // adapter left behind did not fail.\n // An adapter that already serves calls never waits on discovery: it fires\n // the attempt and keeps serving, and the generation check below switches\n // it on a LATER call. Only an adapter with nothing to serve yet waits,\n // since the discovery may be what gives it something (#6671 review).\n if (this.currentAdapter === undefined) {\n await ensureGatewayDiscovered();\n } else {\n void ensureGatewayDiscovered();\n }\n if (\n this.currentAdapter !== undefined &&\n this.detectedAtGeneration !== gatewayDiscoveryGeneration()\n ) {\n this.currentAdapter = undefined;\n this.currentSelection = undefined;\n this.hasEverDetected = false;\n }\n if (this.currentAdapter !== undefined) {\n return this.currentAdapter;\n }\n // Coalesce concurrent detection calls into a single probe (Issue #1423)\n this.detectionPromise ??= this.detectAdapter().finally(() => {\n this.detectionPromise = undefined;\n });\n return this.detectionPromise;\n }\n\n private async detectAdapter(): Promise<IModelAdapter | undefined> {\n // Read BEFORE detecting: a discovery that lands mid-detection leaves this\n // selection tagged stale, so the next call re-detects instead of keeping it.\n const generation = gatewayDiscoveryGeneration();\n try {\n this.logger.info('Detecting model adapter (lazy)');\n const config = {\n logger: this.logger,\n ...(this.preferredCli !== undefined && { preferredCli: this.preferredCli }),\n ...(this.defaultCliTimeoutMs !== undefined && {\n defaultCliTimeoutMs: this.defaultCliTimeoutMs,\n }),\n };\n const selection = await createAutoAdapter(config);\n this.applySelection(selection);\n this.detectedAtGeneration = generation;\n return this.currentAdapter;\n } catch (error) {\n const message = getErrorMessage(error);\n this.logger.warn('No model adapter available', { error: message });\n this.health = {\n source: 'api',\n state: 'unavailable',\n selectedAt: new Date(),\n failoverCount: this.health?.failoverCount ?? 0,\n lastError: message,\n };\n return undefined;\n }\n }\n\n private applySelection(selection: AdapterSelection): void {\n const isFailover = this.hasEverDetected;\n // #4670: capture the OUTGOING health before it is overwritten below. The\n // failover signal is about the adapter we are leaving — `unhealthyCliFrom`\n // reads `payload.source` as \"which CLI is unhealthy\" — and that state was\n // being destroyed one statement before `emitFailover` read it.\n const outgoingHealth = this.health;\n this.currentAdapter = selection.adapter;\n this.currentSelection = selection;\n this.hasEverDetected = true;\n\n const source = mapSelectionSource(selection);\n const failoverCount = (this.health?.failoverCount ?? 0) + (isFailover ? 1 : 0);\n\n this.health = {\n source,\n state: 'healthy',\n selectedAt: new Date(),\n failoverCount,\n };\n\n this.logger.info('Adapter selected', {\n source: selection.source,\n name: selection.name,\n model: selection.adapter.modelId,\n provider: selection.adapter.providerId,\n failover: isFailover,\n });\n\n if (isFailover) {\n // The state/source describe the adapter we LEFT; `failoverCount` is a\n // run-level counter, so it carries the post-increment value.\n this.emitFailover(\n outgoingHealth === undefined ? undefined : { ...outgoingHealth, failoverCount }\n );\n }\n }\n\n /**\n * Record a direct-API failure to the circuit breaker so API adapters get the\n * same degradation/failover learning that CLI subprocess failures get (#3423).\n *\n * The breaker key is `currentSelection.name` — distinct from the `api:<vendor>`\n * arm key used by the ModelToCliAdapter path (#3422).\n *\n * A CLI selection is NOT recorded here (#6712). Its CLI adapter's retry loop\n * (`executeCliRetryLoop`) has already recorded the failure in the same\n * registry under the same key, the CLI name, with the category taken from\n * the CliError code. Recording it again counted every CLI failure twice (the\n * second time usually as `unknown`), so the breaker opened at about half its\n * configured threshold. Only a direct-API selection, which has no inner\n * recorder, is recorded by this layer.\n *\n * Rate-limit failures are deliberately skipped here: they are already recorded\n * by the `recordRateLimitEvent` telemetry branch in `complete()`, and the\n * breaker counts rate limits as failures by default\n * (`countRateLimitsAsFailures`), so recording them again would double-count.\n *\n * Security (#3422 constraint): the logged payload carries only `provider` and\n * `category` — never `error.message`, the request, or the ModelError object,\n * any of which could embed credentials.\n */\n private recordBreakerFailure(adapter: IModelAdapter, error: ModelError): void {\n if (this.circuitBreakerRegistry === undefined || this.currentSelection === undefined) {\n return;\n }\n // #6712: the CLI adapter's retry loop owns recording for a CLI selection.\n if (this.currentSelection.source === 'cli') return;\n\n // #6691: a call its caller cancelled (cancel_job) is not a health signal.\n if (isCallerCancelled(error)) return;\n\n const category = mapModelErrorToCategory(error);\n // Skip rate limits: already accounted for by the rate-limit telemetry branch\n // (and the breaker counts them by default). Check BOTH the mapped category\n // AND the telemetry predicate — their rate-limit pattern lists differ\n // (`isRateLimitLikeError` matches \"quota exceeded\"/\"throttl\"/… that\n // `categorizeError` does not), so a code-less MODEL_ERROR could otherwise\n // fire the telemetry branch yet fall through to a counted failure here,\n // double-counting against the threshold (#3423 review).\n // #5359: a DURABLE capacity cap is excluded from this exemption. The\n // exemption is right for a transient throttle — an ordinary panel trips a\n // per-minute limit while plenty of quota remains, and opening a breaker on\n // that would empty the candidate pool for a condition clearing within the\n // minute. It is wrong for an exhausted credential, which does not clear:\n // never counting it means the breaker never opens, so every subsequent call\n // pays the same futile retries against the same dead key.\n if (isDurableCapacityError(error)) {\n this.circuitBreakerRegistry\n .getBreaker(this.currentSelection.name as CliName)\n .recordFailure(category);\n this.logger.warn('Durable capacity cap recorded to circuit breaker', {\n provider: adapter.providerId,\n category,\n });\n return;\n }\n\n if (category === 'rate_limit' || isRateLimitLikeError(error)) {\n return;\n }\n\n this.circuitBreakerRegistry\n .getBreaker(this.currentSelection.name as CliName)\n .recordFailure(category);\n\n this.logger.warn('API failure recorded to circuit breaker', {\n provider: adapter.providerId,\n category,\n });\n }\n\n private handleCircuitStateChange(event: CircuitStateChangeEvent): void {\n if (event.newState !== 'open') return;\n\n const currentSource = this.currentSelection?.name;\n if (currentSource === undefined || currentSource !== event.cliName) {\n return; // Not our current adapter\n }\n\n this.logger.warn('Current adapter circuit opened, clearing cache for re-detection', {\n cli: event.cliName,\n reason: event.reason,\n });\n\n this.currentAdapter = undefined;\n this.currentSelection = undefined;\n\n if (this.health !== undefined) {\n this.health = {\n ...this.health,\n state: 'degraded',\n lastError: event.reason,\n };\n }\n }\n\n /**\n * Emit the failover signal describing the adapter we failed AWAY FROM (#4670).\n *\n * This used to read `this.health`, which `applySelection` had just replaced\n * with the incoming adapter's `state: 'healthy'`. So every `adapter.failover`\n * payload said healthy, `unhealthyCliFrom` (`observability/failover-signals.ts`)\n * returned undefined for all of them, and `signal.swarm_unhealthy` was never\n * produced by this — the more reliable of its two producers.\n *\n * An undefined outgoing health emits NOTHING rather than falling back to the\n * current one. Falling back would silently restore the old behaviour, and a\n * failover whose prior state we cannot describe is not evidence that the\n * prior adapter was healthy.\n */\n private emitFailover(outgoingHealth: AdapterHealthInfo | undefined): void {\n const info = outgoingHealth;\n if (info === undefined) return;\n\n for (const cb of this.failoverCallbacks) {\n try {\n cb(info);\n } catch (error: unknown) {\n this.logger.debug('Failover callback error', { error: getErrorMessage(error) });\n }\n }\n\n try {\n const eventBus = getGlobalEventBus();\n eventBus.emit({\n eventId: `failover-${getTimeProvider().now().toString(36)}-${getRandomProvider().random().toString(36).slice(2, 8)}`,\n timestamp: new Date().toISOString(),\n topic: 'adapter.failover',\n payload: info,\n });\n } catch (error: unknown) {\n this.logger.debug('CollaborationEventBus emit failed during failover', {\n error: getErrorMessage(error),\n });\n }\n }\n\n private detachCircuitBreakerRegistry(): void {\n if (this.circuitBreakerRegistry !== undefined && this.circuitListener !== undefined) {\n this.circuitBreakerRegistry.removeGlobalStateChangeListener(this.circuitListener);\n }\n this.circuitBreakerRegistry = undefined;\n this.circuitListener = undefined;\n }\n}\n\n// ============================================================================\n// Helpers\n// ============================================================================\n\nfunction mapSelectionSource(selection: AdapterSelection): CliName | 'api' {\n if (selection.source === 'cli') {\n return selection.name as CliName;\n }\n return 'api';\n}\n","/**\n * A CLI slot adapter bound to one requested model (#6599).\n *\n * `UnifiedAdapterRegistry.getAdapterForModel` resolves a model preference to\n * its CLI slot, and the slot adapter is shared and CLI-scoped: it has no\n * model of its own beyond the CLI default. Returning it bare dropped the\n * model, so `execute_expert` ran the CLI's default whatever was asked for.\n * This view stamps the model onto every request that does not name its own,\n * and delegates everything else to the shared slot adapter, which the\n * registry still owns.\n *\n * @module adapters/model-bound-adapter\n */\n\nimport type {\n CompletionRequest,\n CompletionResponse,\n ConfigError,\n ModelCapability,\n ModelError,\n Result,\n} from '../core/index.js';\nimport type { StreamChunk } from '../core/types/model.js';\nimport type { CliName } from '../cli-adapters/types.js';\nimport type { CircuitBreakerRegistry } from '../cli-adapters/circuit-breaker.js';\nimport type { AdapterHealthInfo, IResilientAdapter } from './resilient-adapter-types.js';\n\nexport class ModelBoundAdapter implements IResilientAdapter {\n constructor(\n private readonly slot: IResilientAdapter,\n /** Canonical registry id every unmodelled request is sent with. */\n readonly boundModel: string\n ) {}\n\n get providerId(): string {\n return this.slot.providerId;\n }\n\n get modelId(): string {\n return this.slot.modelId;\n }\n\n get capabilities(): readonly ModelCapability[] {\n return this.slot.capabilities;\n }\n\n private bind(request: CompletionRequest): CompletionRequest {\n return request.model !== undefined ? request : { ...request, model: this.boundModel };\n }\n\n complete(request: CompletionRequest): Promise<Result<CompletionResponse, ModelError>> {\n return this.slot.complete(this.bind(request));\n }\n\n stream(request: CompletionRequest): AsyncIterable<StreamChunk> {\n return this.slot.stream(this.bind(request));\n }\n\n countTokens(text: string): Promise<number> {\n return this.slot.countTokens(text);\n }\n\n validateConfig(): Result<void, ConfigError> {\n return this.slot.validateConfig();\n }\n\n getHealth(): AdapterHealthInfo | undefined {\n return this.slot.getHealth();\n }\n\n refresh(): Promise<void> {\n return this.slot.refresh();\n }\n\n setPreferredCli(cli: CliName | undefined): void {\n this.slot.setPreferredCli(cli);\n }\n\n onFailover(cb: (info: AdapterHealthInfo) => void): () => void {\n return this.slot.onFailover(cb);\n }\n\n getCircuitBreakerRegistry(): CircuitBreakerRegistry | undefined {\n return this.slot.getCircuitBreakerRegistry?.();\n }\n\n /** No-op: the shared slot adapter belongs to the registry, which disposes it. */\n dispose(): void {\n // Intentionally empty — disposing the view must not dispose the slot.\n }\n}\n","/**\n * Unified Adapter Registry — single entry point for all model adapter access.\n *\n * Pre-computes task-to-CLI routing from the canonical model registry and\n * task specialization matrix at creation time. All consumers get adapters\n * through this registry instead of calling createAutoAdapter/createResilientAdapter\n * directly.\n *\n * Design:\n * - One IResilientAdapter per CLI (claude/gemini/codex), created lazily on first access\n * - One \"default\" adapter for unscoped requests (uses createAutoAdapter priority)\n * - Task routing is deterministic: category → primary CLI → cached adapter\n * - Session-scoped: create once at MCP startup, reuse for the session lifetime\n *\n * @module adapters/unified-registry\n * (Source: Issue #1149 — Unified Adapter Registry)\n * (Source: Issue #1151 — Single adapter entry point)\n */\n\nimport type { ILogger } from '../core/index.js';\nimport { ConfigError } from '../core/errors.js';\nimport { getDefaultCliCircuitBreakerRegistry } from '../cli-adapters/cli-circuit-breaker.js';\nimport { createLogger } from '../core/index.js';\nimport { createResilientAdapter } from './resilient-adapter.js';\nimport { ModelBoundAdapter } from './model-bound-adapter.js';\nimport { isGatewayArmId, warnIfGatewayCostUndeclared } from './sdk/gateway-cost.js';\nimport type { IResilientAdapter } from './resilient-adapter-types.js';\nimport type { CliName, EndpointArmId, ObservedArmId } from '../cli-adapters/types.js';\nimport { isCliName, isEndpointArmId } from '../cli-adapters/types.js';\nimport { TASK_SPECIALIZATION_MATRIX, detectTaskCategory } from '../config/task-specialization.js';\nimport type { TaskCategory } from '../config/task-specialization-types.js';\nimport {\n getDefaultModelForCli,\n getInTreeCapabilitiesMatrix,\n} from '../config/model-config-helpers.js';\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/** Configuration for the unified registry. */\nexport interface UnifiedRegistryConfig {\n /** Logger instance */\n readonly logger?: ILogger;\n /** Default CLI timeout for subprocess calls (ms) */\n readonly defaultCliTimeoutMs?: number;\n}\n\n/** Summary of the pre-computed task routing table. */\nexport interface TaskRoutingEntry {\n readonly category: TaskCategory;\n readonly primaryCli: CliName;\n readonly secondaryCli: CliName;\n readonly primaryModel: string;\n}\n\n/** Snapshot of registry state for observability. */\nexport interface RegistrySnapshot {\n readonly taskRouting: readonly TaskRoutingEntry[];\n /**\n * CLI-slot view of {@link cachedArms}: the lazily created CLI slots only.\n * A registered `api:*` arm is never listed here (#6290 panel: this field\n * keeps its `CliName[]` type; it is retired in 9.0, #6291).\n */\n readonly cachedAdapters: readonly CliName[];\n /** Every cached arm: lazily created CLI slots and registered `api:*` endpoint arms (#4392). */\n readonly cachedArms: readonly ObservedArmId[];\n readonly availableModels: number;\n}\n\n// ============================================================================\n// Registry\n// ============================================================================\n\n/**\n * Unified adapter registry. Centralizes all adapter creation and task routing.\n *\n * Usage:\n * ```typescript\n * const registry = createUnifiedRegistry({ logger });\n * const adapter = registry.getAdapter('code_generation'); // → codex adapter\n * const adapter2 = registry.getAdapterForCli('claude'); // → claude adapter\n * const adapter3 = registry.getDefault(); // → best available\n * ```\n */\n\nexport class UnifiedAdapterRegistry {\n private readonly logger: ILogger;\n private readonly defaultCliTimeoutMs: number | undefined;\n\n /**\n * Per-arm adapter cache. CLI slots are created lazily by\n * {@link getAdapterForCli}; `api:*` arms enter only through\n * {@link registerApiArm} and are never synthesised (#4392).\n */\n private readonly cliAdapters = new Map<ObservedArmId, IResilientAdapter>();\n\n /** Default adapter for unscoped requests. */\n private defaultAdapter: IResilientAdapter | undefined;\n\n constructor(config?: UnifiedRegistryConfig) {\n this.logger = config?.logger ?? createLogger({ component: 'unified-registry' });\n this.defaultCliTimeoutMs = config?.defaultCliTimeoutMs;\n this.logger.info('UnifiedAdapterRegistry initialized', {\n categories: TASK_SPECIALIZATION_MATRIX.length,\n models: getInTreeCapabilitiesMatrix().models.length,\n });\n }\n\n // --------------------------------------------------------------------------\n // Public API\n // --------------------------------------------------------------------------\n\n /** Logger used by this registry. Exposed so singleton helpers can warn. */\n getLogger(): ILogger {\n return this.logger;\n }\n\n /**\n * Get adapter for a task category. Routing is re-resolved on every read\n * (#3185) so a post-startup overlay/registry update propagates without a\n * restart. Falls back to default adapter if category unknown.\n */\n getAdapter(category: TaskCategory): IResilientAdapter {\n const routing = this.getRouting(category);\n if (routing === undefined) {\n this.logger.warn('Unknown task category, using default', { category });\n return this.getDefault();\n }\n return this.getAdapterForCli(routing.primaryCli);\n }\n\n /**\n * Get adapter for a free-text task description.\n * Detects category from keywords, falls back to default.\n */\n getAdapterForTask(taskDescription: string): IResilientAdapter {\n const match = detectTaskCategory(taskDescription);\n if (match !== null) {\n this.logger.debug('Task category detected', {\n category: match.category,\n cli: match.primaryCli,\n });\n return this.getAdapterForCli(match.primaryCli);\n }\n return this.getDefault();\n }\n\n /**\n * Get adapter pinned to a specific CLI.\n * Creates and caches one IResilientAdapter per CLI.\n */\n getAdapterForCli(cli: CliName): IResilientAdapter {\n const cached = this.cliAdapters.get(cli);\n if (cached !== undefined) return cached;\n\n const raw = createResilientAdapter({\n logger: this.logger,\n preferredCli: cli,\n // #4659: the SHARED registry — the same one that already gates\n // voter-panel availability (#4330). Per-adapter registries would let one\n // adapter keep routing to a CLI another has already seen fail.\n circuitBreakerRegistry: getDefaultCliCircuitBreakerRegistry(),\n ...(this.defaultCliTimeoutMs !== undefined && {\n defaultCliTimeoutMs: this.defaultCliTimeoutMs,\n }),\n });\n const adapter = raw;\n this.cliAdapters.set(cli, adapter);\n this.logger.info('Created CLI-specific adapter', {\n cli,\n });\n return adapter;\n }\n\n /**\n * Get the adapter for a routing arm (#4392). A CLI slot resolves exactly as\n * {@link getAdapterForCli} (created lazily, cached, armed with the shared\n * breaker registry). An `api:*` arm resolves to what {@link registerApiArm}\n * supplied, or `undefined` — never to a CLI slot, and never by creating one.\n */\n getAdapterForArm(arm: ObservedArmId): IResilientAdapter | undefined {\n // Split on CLI-slot membership, not on the validator: an `api:` string\n // that fails validation must read as \"not registered\", never be handed\n // to getAdapterForCli to mint a slot adapter under a garbage name.\n if (isCliName(arm)) {\n return this.getAdapterForCli(arm);\n }\n return this.cliAdapters.get(arm);\n }\n\n /**\n * Register an `api:*` arm's adapter under its endpoint identity (#4392).\n * Refuses built-in vendor arms (`api:anthropic`, `api:openai`, `api:google`, `api:gemini`)\n * to prevent hijacking or redirecting vendor traffic without authorization.\n * Accepts a dynamic `EndpointArmId`; the id is re-validated at runtime\n * because the `EndpointArmId` type admits any `api:` string, so a cast from an\n * unvalidated name is exactly what this refuses.\n * Registering an id twice replaces (and disposes) the earlier adapter.\n * CLI-slot behaviour is untouched. A registered endpoint arm is observable\n * here and in the breaker registry but is NOT a `RoutingArmId`: it cannot\n * enter outcome records until #6291. A gateway arm registered without a\n * `NEXUS_GATEWAY_COST` declaration is warned about here, once, at the\n * moment it becomes routable (#4392 increment 2).\n */\n registerApiArm(arm: EndpointArmId, adapter: IResilientAdapter): void {\n if (!isEndpointArmId(arm)) {\n throw new Error(`Invalid api arm id: ${JSON.stringify(arm)} (expected api:<endpoint>)`);\n }\n if (!isGatewayArmId(arm) || arm === 'api:gemini') {\n throw new Error(`Cannot overwrite built-in vendor arm: ${arm}`);\n }\n this.cliAdapters.get(arm)?.dispose();\n this.cliAdapters.set(arm, adapter);\n this.logger.info('Registered api arm adapter', { arm });\n warnIfGatewayCostUndeclared(arm, this.logger);\n }\n\n /**\n * Get adapter for a model preference string (e.g., \"claude-opus-4-6\").\n * Resolves the model to its CLI via the canonical registry.\n * Falls back to default adapter if model not recognized.\n *\n * An exact match returns the CLI slot adapter bound to the matched registry\n * id, so the model reaches the CLI instead of its default (#6599). A prefix\n * match routes to the CLI only, as before: the name was not an entry.\n */\n getAdapterForModel(modelPreference: string): IResilientAdapter {\n // Prefer exact matches (id / cliAlias / cliModelName) over prefix matches.\n // For prefix fallback, longest-prefix-wins so a future registry containing\n // both 'gemini-pro' and 'gemini-pro-experimental' resolves correctly even\n // though the registry's natural array order isn't sorted by id length.\n // Defense-in-depth — no current registry has prefix overlaps. (#2192)\n const allModels = getInTreeCapabilitiesMatrix().models;\n const exact = allModels.find(\n (m) =>\n m.id === modelPreference ||\n m.cliAlias === modelPreference ||\n m.cliModelName === modelPreference\n );\n const prefix =\n exact ??\n [...allModels]\n .filter((m) => modelPreference.startsWith(m.id))\n .sort((a, b) => b.id.length - a.id.length)[0];\n const model = prefix;\n if (model !== undefined) {\n this.logger.debug('Model resolved to CLI', {\n model: modelPreference,\n cli: model.cliName,\n });\n const slot = this.getAdapterForCli(model.cliName as CliName);\n return exact !== undefined ? new ModelBoundAdapter(slot, exact.id) : slot;\n }\n this.logger.debug('Model not in registry, using default', {\n model: modelPreference,\n });\n return this.getDefault();\n }\n\n /**\n * Get adapter for an expert role (e.g., \"code_expert\").\n * Uses ROLE_TO_TASK_CATEGORY mapping → task specialization → CLI.\n */\n getAdapterForRole(role: string): IResilientAdapter {\n const category = ROLE_TO_CATEGORY[role];\n if (category !== undefined) return this.getAdapter(category);\n return this.getDefault();\n }\n\n /**\n * Get the default adapter (no CLI preference — auto-detection priority).\n */\n getDefault(): IResilientAdapter {\n if (this.defaultAdapter !== undefined) return this.defaultAdapter;\n const raw = createResilientAdapter({\n logger: this.logger,\n circuitBreakerRegistry: getDefaultCliCircuitBreakerRegistry(),\n ...(this.defaultCliTimeoutMs !== undefined && {\n defaultCliTimeoutMs: this.defaultCliTimeoutMs,\n }),\n });\n this.defaultAdapter = raw;\n return this.defaultAdapter;\n }\n\n /**\n * Get snapshot of registry state for observability/debugging. Routing is\n * re-resolved on read (#3185) so the snapshot reflects the live registry.\n */\n getSnapshot(): RegistrySnapshot {\n return {\n taskRouting: TASK_SPECIALIZATION_MATRIX.map((spec) => this.resolveRouting(spec)),\n cachedAdapters: [...this.cliAdapters.keys()].filter(isCliName),\n cachedArms: [...this.cliAdapters.keys()],\n availableModels: getInTreeCapabilitiesMatrix().models.length,\n };\n }\n\n /**\n * Resolve the routing for a specific category.\n *\n * Computed on every read (#3185) rather than cached at construction, so a\n * post-startup model-registry / overlay update (e.g. a default-model change\n * surfaced via `getDefaultModelForCli`) propagates to routing decisions\n * without a process restart. The matrix is ~10 categories — the per-read\n * resolution cost is negligible.\n */\n getRouting(category: TaskCategory): TaskRoutingEntry | undefined {\n const spec = TASK_SPECIALIZATION_MATRIX.find((s) => s.category === category);\n if (spec === undefined) return undefined;\n return this.resolveRouting(spec);\n }\n\n /**\n * Dispose all cached adapters.\n */\n dispose(): void {\n for (const adapter of this.cliAdapters.values()) {\n adapter.dispose();\n }\n this.cliAdapters.clear();\n this.defaultAdapter?.dispose();\n this.defaultAdapter = undefined;\n this.logger.info('UnifiedAdapterRegistry disposed');\n }\n\n // --------------------------------------------------------------------------\n // Private\n // --------------------------------------------------------------------------\n\n /**\n * Resolve one specialization-matrix row into a routing entry, re-reading the\n * primary model from the (overlay-aware) model registry each call (#3185).\n */\n private resolveRouting(spec: (typeof TASK_SPECIALIZATION_MATRIX)[number]): TaskRoutingEntry {\n return {\n category: spec.category,\n primaryCli: spec.primaryCli,\n secondaryCli: spec.secondaryCli,\n primaryModel: resolveDefaultModel(spec.primaryCli),\n };\n }\n}\n\n// ============================================================================\n// Role → Category Mapping (consolidated from create-expert-routing.ts)\n// ============================================================================\n\n/** Maps expert roles to task categories for CLI specialization. */\nconst ROLE_TO_CATEGORY: Record<string, TaskCategory> = {\n code_expert: 'code_generation',\n architecture_expert: 'architecture',\n security_expert: 'security_review',\n documentation_expert: 'documentation',\n testing_expert: 'testing',\n devops_expert: 'devops',\n research_expert: 'research',\n pm_expert: 'planning',\n ux_expert: 'planning',\n infrastructure_expert: 'devops',\n};\n\n// ============================================================================\n// Helpers\n// ============================================================================\n\n/** Resolve the default model name for a CLI from the canonical registry. */\nfunction resolveDefaultModel(cli: string): string {\n if (isCliName(cli)) {\n return getDefaultModelForCli(cli);\n }\n return cli;\n}\n\n// ============================================================================\n// Factory & Singleton\n// ============================================================================\n\nlet globalRegistry: UnifiedAdapterRegistry | undefined;\n\n/**\n * Create a new UnifiedAdapterRegistry instance.\n * For most uses, prefer `getGlobalRegistry()` instead.\n */\nexport function createUnifiedRegistry(config?: UnifiedRegistryConfig): UnifiedAdapterRegistry {\n return new UnifiedAdapterRegistry(config);\n}\n\n/**\n * Claim the global registry for a process entry point, choosing its logger\n * (#6012). Idempotent and SILENT when the registry already exists — unlike\n * {@link getGlobalRegistry} with a config, which warns.\n *\n * That difference is the point. There is not exactly one composition root: the\n * bundled CLI enters through `cli.ts main()`, and an embedder can start the MCP\n * server directly without it. Both should be able to claim, first-one-wins,\n * without the second producing a warning an operator cannot act on — which is\n * what a config-passing `getGlobalRegistry` call does, and is the noise this\n * whole change removes.\n *\n * This does NOT provide per-caller log attribution: the singleton has one\n * logger. It makes that one logger a deliberate choice rather than a\n * consequence of which module happened to run first.\n */\nexport function claimGlobalRegistry(logger: ILogger): UnifiedAdapterRegistry {\n globalRegistry ??= new UnifiedAdapterRegistry({ logger });\n return globalRegistry;\n}\n\n/**\n * Thrown by {@link getGlobalRegistry} when a non-empty config arrives after\n * the singleton exists (#5211). The registry has no way to apply it — the\n * logger and `defaultCliTimeoutMs` are fixed at construction — so until this\n * error existed the config was logged at `warn` and dropped, and the caller\n * went on with a registry built from someone else's settings. A config that is\n * accepted and ignored is an instrument that misreports what it was given.\n *\n * The check is on presence, not on equality with the live config: the registry\n * does not keep the config it was built from, and a caller re-supplying the\n * same values is still a caller that believes it configured something.\n */\nexport class RegistryAlreadyInitializedError extends ConfigError {\n constructor(providedKeys: readonly string[]) {\n super(\n 'UnifiedAdapterRegistry singleton is already initialized, so getGlobalRegistry() cannot ' +\n `apply the supplied config (keys: ${providedKeys.join(', ')}). Call resetGlobalRegistry() ` +\n 'first if reconfiguration is intentional, or getGlobalRegistry() with no config to use the ' +\n 'existing instance; claimGlobalRegistry(logger) is the idempotent way to name the logger.',\n { context: { providedKeys: [...providedKeys] } }\n );\n this.name = 'RegistryAlreadyInitializedError';\n }\n}\n\n/**\n * Get the global singleton registry.\n * Creates it on first access with default config.\n *\n * If the singleton already exists and a non-empty config is supplied, this\n * throws {@link RegistryAlreadyInitializedError} — the config cannot be\n * applied, and returning the existing instance would silently hand the caller\n * a registry configured by whoever ran first (#5211). Omitting the config, or\n * passing an empty object, returns the existing instance as before.\n */\nexport function getGlobalRegistry(config?: UnifiedRegistryConfig): UnifiedAdapterRegistry {\n if (globalRegistry === undefined) {\n globalRegistry = new UnifiedAdapterRegistry(config);\n return globalRegistry;\n }\n if (config !== undefined && Object.keys(config).length > 0) {\n throw new RegistryAlreadyInitializedError(Object.keys(config));\n }\n return globalRegistry;\n}\n\n/** Reset the global registry (for testing). */\nexport function resetGlobalRegistry(): void {\n globalRegistry?.dispose();\n globalRegistry = undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,SAAS,kBAAkB;AAKpB,IAAM,2BAA2B;AAGjC,IAAM,oBAAoB;AAajC,IAAM,2BAA2B;AAgB1B,SAAS,eAAe,SAA+B;AAE5D,MAAI,QAAQ,SAAS,0BAA0B;AAC7C,UAAM,IAAI,MAAM,2CAA2C,OAAO,wBAAwB,CAAC,EAAE;AAAA,EAC/F;AAEA,MAAI,YAAY,KAAK;AACnB,WAAO;AAAA,EACT;AAGA,QAAM,uBAAuB;AAC7B,QAAM,kBAAkB,QAAQ,QAAQ,OAAO,oBAAoB;AAEnE,QAAM,UAAU,gBAAgB,QAAQ,sBAAsB,MAAM;AAEpE,QAAM,gBAAgB,QAAQ,QAAQ,IAAI,OAAO,sBAAsB,GAAG,GAAG,OAAO;AACpF,SAAO,IAAI,OAAO,IAAI,aAAa,GAAG;AACxC;AAKO,SAAS,oBAAoB,OAAe,OAAwB;AACzE,SAAO,MAAM,KAAK,KAAK;AACzB;AAKO,SAAS,kBAA0B;AACxC,SAAO,OAAO,OAAO,gBAAgB,EAAE,IAAI,CAAC,CAAC,IAAI,WAAW,EAAE,MAAM,GAAG,CAAC,CAAC;AAC3E;AAKO,SAAS,yBAAyC;AACvD,SAAO,OAAO,OAAO,gBAAgB,EAAE,IAAI,CAAC,CAAC,IAAI,WAAW,EAAE,MAAM,GAAG,CAAC,CAAC;AAC3E;AAwCO,SAAS,oBAAoB,SAAwB,QAAoC;AAC9F,MAAI,SAAwB;AAE5B,MAAI,OAAO,UAAU,UAAa,OAAO,UAAU,IAAI;AACrD,UAAM,QAAQ,eAAe,OAAO,KAAK;AACzC,aAAS,OAAO,OAAO,CAAC,MAAM,oBAAoB,EAAE,OAAO,KAAK,CAAC;AAAA,EACnE;AAEA,MAAI,OAAO,cAAc,UAAa,OAAO,cAAc,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ACF;AACF;AAOA,IAAM,mBAAiD;AAAA,EACrD,aAAa;AAAA,EACb,qBAAqB;AAAA,EACrB,iBAAiB;AAAA,EACjB,sBAAsB;AAAA,EACtB,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,WAAW;AAAA,EACX,WAAW;AAAA,EACX,uBAAuB;AACzB;AAOA,SAAS,oBAAoB,KAAqB;AAChD,MAAI,UAAU,GAAG,GAAG;AAClB,WAAO,sBAAsB,GAAG;AAAA,EAClC;AACA,SAAO;AACT;AAMA,IAAI;AAMG,SAAS,sBAAsB,QAAwD;AAC5F,SAAO,IAAI,uBAAuB,MAAM;AAC1C;AAkBO,SAAS,oBAAoB,QAAyC;AAC3E,qBAAmB,IAAI,uBAAuB,EAAE,OAAO,CAAC;AACxD,SAAO;AACT;AAcO,IAAM,kCAAN,cAA8C,YAAY;AAAA,EAC/D,YAAY,cAAiC;AAC3C;AAAA,MACE,2HACsC,aAAa,KAAK,IAAI,CAAC;AAAA,MAG7D,EAAE,SAAS,EAAE,cAAc,CAAC,GAAG,YAAY,EAAE,EAAE;AAAA,IACjD;AACA,SAAK,OAAO;AAAA,EACd;AACF;AAYO,SAAS,kBAAkB,QAAwD;AACxF,MAAI,mBAAmB,QAAW;AAChC,qBAAiB,IAAI,uBAAuB,MAAM;AAClD,WAAO;AAAA,EACT;AACA,MAAI,WAAW,UAAa,OAAO,KAAK,MAAM,EAAE,SAAS,GAAG;AAC1D,UAAM,IAAI,gCAAgC,OAAO,KAAK,MAAM,CAAC;AAAA,EAC/D;AACA,SAAO;AACT;AAGO,SAAS,sBAA4B;AAC1C,kBAAgB,QAAQ;AACxB,mBAAiB;AACnB;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveClassGuardMs
3
- } from "./chunk-6IGSOP2F.js";
3
+ } from "./chunk-7S7DKO4D.js";
4
4
 
5
5
  // src/cli/cli-readiness.ts
6
6
  var READINESS_LEVELS = ["installed", "authenticated", "serves"];
@@ -107,4 +107,4 @@ export {
107
107
  SERVES_PROBE_PROMPT,
108
108
  probeServes
109
109
  };
110
- //# sourceMappingURL=chunk-LXBGTBH6.js.map
110
+ //# sourceMappingURL=chunk-5TRZCY36.js.map
@@ -3,14 +3,14 @@ import {
3
3
  } from "./chunk-W654ME6B.js";
4
4
  import {
5
5
  resolveToken
6
- } from "./chunk-WSB5RH4X.js";
6
+ } from "./chunk-PWWOIE47.js";
7
7
  import {
8
8
  REGISTRY_PATH,
9
9
  getProjectRoot,
10
10
  loadPapersRegistry,
11
11
  loadTechniquesRegistry,
12
12
  savePapersRegistry
13
- } from "./chunk-ASJXBA2E.js";
13
+ } from "./chunk-IS2PAAEU.js";
14
14
  import {
15
15
  resolveInsideRoot
16
16
  } from "./chunk-XEPZSDN5.js";
@@ -21,7 +21,7 @@ import {
21
21
  rankedItemTrustTier,
22
22
  trustTierLabel,
23
23
  withoutUntrustedMemory
24
- } from "./chunk-6S2VMUGZ.js";
24
+ } from "./chunk-DP7JQSU7.js";
25
25
  import {
26
26
  capitalizeWords,
27
27
  tokenizeFiltered,
@@ -50,7 +50,7 @@ import {
50
50
  ok,
51
51
  registerPersistentDistillerFactory,
52
52
  sigmoidConfidence
53
- } from "./chunk-6IGSOP2F.js";
53
+ } from "./chunk-7S7DKO4D.js";
54
54
  import {
55
55
  ensureLearningDir,
56
56
  getRulesFile
@@ -4287,4 +4287,4 @@ export {
4287
4287
  DEFAULT_CONTEXT_BUDGET_TOKENS,
4288
4288
  getContextPromptPrefix
4289
4289
  };
4290
- //# sourceMappingURL=chunk-PXLLBDNC.js.map
4290
+ //# sourceMappingURL=chunk-67GC5TY5.js.map
@@ -1,21 +1,58 @@
1
1
  import {
2
2
  ensureGatewayDiscovered,
3
3
  gatewayDiscoveryGeneration
4
- } from "./chunk-JEWZI3LK.js";
4
+ } from "./chunk-X3S62T3S.js";
5
5
  import {
6
6
  resolveCliSlot
7
- } from "./chunk-YFZWZVYU.js";
7
+ } from "./chunk-RWKINNVG.js";
8
8
  import {
9
9
  createLogger,
10
10
  getTimeProvider,
11
11
  isRateLimitText
12
- } from "./chunk-6IGSOP2F.js";
12
+ } from "./chunk-7S7DKO4D.js";
13
+
14
+ // src/pipeline/expert-access-mode.ts
15
+ var logger = createLogger({ component: "expert-bridge" });
16
+ function servedAccessOf(value) {
17
+ return {
18
+ ...value.accessMode !== void 0 && { accessMode: value.accessMode },
19
+ ...value.textOnly === true && { textOnly: true },
20
+ ...value.permissionDenials !== void 0 && { permissionDenials: value.permissionDenials }
21
+ };
22
+ }
23
+ var EXECUTION_ACCESS_MODES = {
24
+ default: true,
25
+ "read-only-analysis": true,
26
+ "workspace-edit": true
27
+ };
28
+ function assertAccessMode(accessMode) {
29
+ if (accessMode === void 0) return;
30
+ if (typeof accessMode === "string" && Object.hasOwn(EXECUTION_ACCESS_MODES, accessMode)) return;
31
+ throw new TypeError(
32
+ `executeExpert: unknown accessMode ${JSON.stringify(accessMode)}; expected one of ${Object.keys(
33
+ EXECUTION_ACCESS_MODES
34
+ ).join(", ")}`
35
+ );
36
+ }
37
+ function withRequestedAccessMode(result, requestedAccessMode, expertType) {
38
+ logger.debug("Expert call access mode", {
39
+ expertType,
40
+ requestedAccessMode,
41
+ accessMode: result.accessMode,
42
+ servedBy: result.routedArm ?? result.cli,
43
+ textOnly: result.textOnly === true
44
+ });
45
+ return { ...result, requestedAccessMode };
46
+ }
47
+ function requestedAccessModeOf(options) {
48
+ return options?.accessMode ?? "default";
49
+ }
13
50
 
14
51
  // src/pipeline/expert-bridge.ts
15
52
  function resolveCliFromModelString(model) {
16
53
  return resolveCliSlot(model);
17
54
  }
18
- var logger = createLogger({ component: "expert-bridge" });
55
+ var logger2 = createLogger({ component: "expert-bridge" });
19
56
  var RATE_LIMIT_BASE_DELAY_MS = 3e3;
20
57
  function routedAttribution(routed, model) {
21
58
  const cli = routed.routedCli ?? resolveCliFromModelString(model);
@@ -34,7 +71,7 @@ async function getMcpConfigPath() {
34
71
  if (cachedMcpConfigPath !== null) return cachedMcpConfigPath;
35
72
  mcpConfigInitPromise ??= (async () => {
36
73
  try {
37
- const { generateMcpConfig } = await import("./child-mcp-config-J7HNH7OD.js");
74
+ const { generateMcpConfig } = await import("./child-mcp-config-CLT4G6JV.js");
38
75
  const config = await generateMcpConfig();
39
76
  cachedMcpConfigPath = config.configPath;
40
77
  cachedMcpConfigCleanup = config.cleanup;
@@ -56,7 +93,7 @@ async function shutdownExpertBridge() {
56
93
  await cleanup();
57
94
  } catch (error) {
58
95
  const msg = error instanceof Error ? error.message : String(error);
59
- logger.debug("Expert-bridge MCP-config cleanup failed", { error: msg });
96
+ logger2.debug("Expert-bridge MCP-config cleanup failed", { error: msg });
60
97
  }
61
98
  }
62
99
  var cachedCircuitBreaker = null;
@@ -100,7 +137,9 @@ function adaptCompositeRouter(compositeRouter) {
100
137
  ...split !== void 0 && { tokensIn: split.tokensIn, tokensOut: split.tokensOut },
101
138
  // #6624: which gateway served the model, so its cost is priced by
102
139
  // the gateway's declaration.
103
- ...result.value.gatewayArm !== void 0 && { gatewayArm: result.value.gatewayArm }
140
+ ...result.value.gatewayArm !== void 0 && { gatewayArm: result.value.gatewayArm },
141
+ // #6792: what the served arm reported about its host access.
142
+ ...servedAccessOf(result.value)
104
143
  },
105
144
  error: { message: "" }
106
145
  };
@@ -126,8 +165,8 @@ async function getRouter() {
126
165
  }
127
166
  if (cachedRouter !== null) return cachedRouter;
128
167
  routerInitPromise ??= (async () => {
129
- const { createAllAdapters } = await import("./factory-37NFTAM4.js");
130
- const { createCompositeRouter } = await import("./composite-router-J7V4G4AV.js");
168
+ const { createAllAdapters } = await import("./factory-NCCP3VNN.js");
169
+ const { createCompositeRouter } = await import("./composite-router-FCW4AZCS.js");
131
170
  const adapters = createAllAdapters();
132
171
  const superseded = generation !== routerGeneration;
133
172
  if (adapters.size === 0) {
@@ -138,11 +177,11 @@ async function getRouter() {
138
177
  if (superseded) return router;
139
178
  cachedRouter = router;
140
179
  try {
141
- const { createCliCircuitBreakerIntegration } = await import("./cli-circuit-breaker-XPZOXMTZ.js");
180
+ const { createCliCircuitBreakerIntegration } = await import("./cli-circuit-breaker-NY4BI2M4.js");
142
181
  cachedCircuitBreaker = createCliCircuitBreakerIntegration([...adapters.values()]);
143
182
  } catch (error) {
144
183
  const msg = error instanceof Error ? error.message : String(error);
145
- logger.debug("Circuit breaker init failed; continuing without it", { error: msg });
184
+ logger2.debug("Circuit breaker init failed; continuing without it", { error: msg });
146
185
  }
147
186
  return router;
148
187
  })();
@@ -178,7 +217,8 @@ function toSuccessResult(value, expertType, durationMs) {
178
217
  ...value.model !== void 0 && { model: value.model },
179
218
  ...value.tokensIn !== void 0 && { tokensIn: value.tokensIn },
180
219
  ...value.tokensOut !== void 0 && { tokensOut: value.tokensOut },
181
- ...value.gatewayArm !== void 0 && { gatewayArm: value.gatewayArm }
220
+ ...value.gatewayArm !== void 0 && { gatewayArm: value.gatewayArm },
221
+ ...servedAccessOf(value)
182
222
  };
183
223
  }
184
224
  async function dispatchWithRateLimitRetry(router, task, expertType, start, signal) {
@@ -187,7 +227,7 @@ async function dispatchWithRateLimitRetry(router, task, expertType, start, signa
187
227
  const result = signal === void 0 ? await router.executeTask(task) : await router.executeTask(task, { signal });
188
228
  const durationMs = getTimeProvider().now() - start;
189
229
  if (result.ok) {
190
- logger.info("Expert executed successfully", {
230
+ logger2.info("Expert executed successfully", {
191
231
  expertType,
192
232
  durationMs,
193
233
  cli: result.value.cli
@@ -197,11 +237,11 @@ async function dispatchWithRateLimitRetry(router, task, expertType, start, signa
197
237
  const isRateLimit = isRateLimitText(result.error.message);
198
238
  if (isRateLimit && attempt < maxAttempts - 1 && signal?.aborted !== true) {
199
239
  const backoffMs = RATE_LIMIT_BASE_DELAY_MS * (attempt + 1);
200
- logger.warn("Expert rate limited, retrying", { expertType, attempt: attempt + 1, backoffMs });
240
+ logger2.warn("Expert rate limited, retrying", { expertType, attempt: attempt + 1, backoffMs });
201
241
  await new Promise((resolve) => setTimeout(resolve, backoffMs));
202
242
  continue;
203
243
  }
204
- logger.warn("Expert execution failed", { expertType, error: result.error.message });
244
+ logger2.warn("Expert execution failed", { expertType, error: result.error.message });
205
245
  return {
206
246
  success: false,
207
247
  text: "",
@@ -219,23 +259,10 @@ async function dispatchWithRateLimitRetry(router, task, expertType, start, signa
219
259
  error: "Max retry attempts exceeded"
220
260
  };
221
261
  }
222
- var EXECUTION_ACCESS_MODES = {
223
- default: true,
224
- "read-only-analysis": true
225
- };
226
- function assertAccessMode(accessMode) {
227
- if (accessMode === void 0) return;
228
- if (typeof accessMode === "string" && Object.hasOwn(EXECUTION_ACCESS_MODES, accessMode)) return;
229
- throw new TypeError(
230
- `executeExpert: unknown accessMode ${JSON.stringify(accessMode)}; expected one of ${Object.keys(
231
- EXECUTION_ACCESS_MODES
232
- ).join(", ")}`
233
- );
234
- }
235
262
  async function buildBridgeTask(content, options) {
236
263
  const task = { content };
237
- const readOnly = options?.accessMode === "read-only-analysis";
238
- const mcpConfigPath = readOnly ? null : await getMcpConfigPath();
264
+ const restricted = requestedAccessModeOf(options) !== "default";
265
+ const mcpConfigPath = restricted ? null : await getMcpConfigPath();
239
266
  if (mcpConfigPath !== null) task.options = { mcpConfigPath };
240
267
  if (options?.workDir !== void 0) {
241
268
  task.options = { ...task.options, workDir: options.workDir };
@@ -245,6 +272,10 @@ async function buildBridgeTask(content, options) {
245
272
  }
246
273
  async function executeExpert(expertType, prompt, options) {
247
274
  assertAccessMode(options?.accessMode);
275
+ const result = await runExpertCall(expertType, prompt, options);
276
+ return withRequestedAccessMode(result, requestedAccessModeOf(options), expertType);
277
+ }
278
+ async function runExpertCall(expertType, prompt, options) {
248
279
  const start = getTimeProvider().now();
249
280
  try {
250
281
  const { BUILT_IN_EXPERTS } = await import("./expert-config-JSQTCTSE.js");
@@ -264,7 +295,7 @@ ${prompt}`;
264
295
  }
265
296
  const health = checkCircuitHealth();
266
297
  if (!health.healthy) {
267
- logger.warn("Circuit breaker: all CLIs unavailable", { expertType, reason: health.message });
298
+ logger2.warn("Circuit breaker: all CLIs unavailable", { expertType, reason: health.message });
268
299
  return {
269
300
  success: false,
270
301
  text: "",
@@ -283,7 +314,7 @@ ${prompt}`;
283
314
  } catch (error) {
284
315
  const durationMs = getTimeProvider().now() - start;
285
316
  const msg = error instanceof Error ? error.message : String(error);
286
- logger.warn("Expert bridge error", { expertType, error: msg });
317
+ logger2.warn("Expert bridge error", { expertType, error: msg });
287
318
  return { success: false, text: "", expertType, durationMs, error: msg };
288
319
  }
289
320
  }
@@ -294,4 +325,4 @@ export {
294
325
  tokenSplitFromUsage,
295
326
  executeExpert
296
327
  };
297
- //# sourceMappingURL=chunk-4VSMZEBT.js.map
328
+ //# sourceMappingURL=chunk-6RN764V2.js.map