omnicell-router 0.3.1 → 0.7.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 (1002) hide show
  1. package/README.md +70 -10
  2. package/README.zh-CN.md +57 -8
  3. package/RELEASING.md +6 -0
  4. package/RELEASING.zh-CN.md +5 -0
  5. package/backend/dist/auth/api-keys.d.ts +14 -2
  6. package/backend/dist/auth/api-keys.js +26 -14
  7. package/backend/dist/auth/model-access.d.ts +27 -10
  8. package/backend/dist/auth/model-access.js +34 -17
  9. package/backend/dist/capture/migrate/engine.d.ts +38 -0
  10. package/backend/dist/capture/migrate/engine.js +307 -0
  11. package/backend/dist/capture/migrate/index.d.ts +18 -0
  12. package/backend/dist/capture/migrate/index.js +18 -0
  13. package/backend/dist/capture/migrate/migrator.d.ts +113 -0
  14. package/backend/dist/capture/migrate/migrator.js +16 -0
  15. package/backend/dist/capture/migrate/registry.d.ts +16 -0
  16. package/backend/dist/capture/migrate/registry.js +19 -0
  17. package/backend/dist/capture/migrate/steps/v1-to-v2.d.ts +86 -0
  18. package/backend/dist/capture/migrate/steps/v1-to-v2.js +396 -0
  19. package/backend/dist/capture/recorder.d.ts +422 -272
  20. package/backend/dist/capture/recorder.js +873 -417
  21. package/backend/dist/capture/turn-boundary.d.ts +17 -0
  22. package/backend/dist/capture/turn-boundary.js +31 -0
  23. package/backend/dist/cli/clients/base.d.ts +158 -23
  24. package/backend/dist/cli/clients/base.js +150 -4
  25. package/backend/dist/cli/clients/claude.d.ts +3 -2
  26. package/backend/dist/cli/clients/claude.js +4 -3
  27. package/backend/dist/cli/clients/codex.d.ts +3 -2
  28. package/backend/dist/cli/clients/codex.js +4 -3
  29. package/backend/dist/cli/clients/core-adapters.d.ts +25 -0
  30. package/backend/dist/cli/clients/core-adapters.js +44 -0
  31. package/backend/dist/cli/clients/dsh.d.ts +5 -3
  32. package/backend/dist/cli/clients/dsh.js +29 -18
  33. package/backend/dist/cli/clients/grok.d.ts +53 -0
  34. package/backend/dist/cli/clients/grok.js +249 -0
  35. package/backend/dist/cli/clients/index.d.ts +28 -19
  36. package/backend/dist/cli/clients/index.js +156 -60
  37. package/backend/dist/cli/clients/kimi.d.ts +75 -0
  38. package/backend/dist/cli/clients/kimi.js +316 -0
  39. package/backend/dist/cli/clients/launcher.d.ts +48 -0
  40. package/backend/dist/cli/clients/launcher.js +41 -0
  41. package/backend/dist/cli/clients/omp.d.ts +10 -20
  42. package/backend/dist/cli/clients/omp.js +28 -155
  43. package/backend/dist/cli/clients/openclaw.d.ts +55 -0
  44. package/backend/dist/cli/clients/openclaw.js +525 -0
  45. package/backend/dist/cli/clients/opencode.d.ts +7 -20
  46. package/backend/dist/cli/clients/opencode.js +32 -159
  47. package/backend/dist/cli/clients/pi.d.ts +7 -21
  48. package/backend/dist/cli/clients/pi.js +32 -221
  49. package/backend/dist/cli/clients/plugin-adapters.d.ts +20 -0
  50. package/backend/dist/cli/clients/plugin-adapters.js +88 -0
  51. package/backend/dist/cli/clients/reserved.d.ts +51 -0
  52. package/backend/dist/cli/clients/reserved.js +53 -0
  53. package/backend/dist/cli/clients/workbuddy.d.ts +31 -0
  54. package/backend/dist/cli/clients/workbuddy.js +259 -0
  55. package/backend/dist/cli/daemon.d.ts +105 -27
  56. package/backend/dist/cli/daemon.js +509 -151
  57. package/backend/dist/cli/index.d.ts +6 -1
  58. package/backend/dist/cli/index.js +238 -22
  59. package/backend/dist/cli/paths.d.ts +86 -0
  60. package/backend/dist/cli/paths.js +269 -0
  61. package/backend/dist/cli/shim.d.ts +47 -1
  62. package/backend/dist/cli/shim.js +180 -13
  63. package/backend/dist/cli/types.d.ts +102 -16
  64. package/backend/dist/cli/types.js +5 -4
  65. package/backend/dist/compression/caveman-prompts.d.ts +1 -1
  66. package/backend/dist/compression/caveman.d.ts +2 -16
  67. package/backend/dist/compression/caveman.js +25 -37
  68. package/backend/dist/compression/headroom.d.ts +4 -3
  69. package/backend/dist/compression/headroom.js +2 -2
  70. package/backend/dist/compression/index.d.ts +5 -26
  71. package/backend/dist/compression/index.js +79 -17
  72. package/backend/dist/compression/tool-output.d.ts +2 -20
  73. package/backend/dist/compression/tool-output.js +40 -47
  74. package/backend/dist/config/comments-en.d.ts +17 -0
  75. package/backend/dist/config/comments-en.js +232 -0
  76. package/backend/dist/config/comments-zh.d.ts +10 -0
  77. package/backend/dist/config/comments-zh.js +217 -0
  78. package/backend/dist/config/defaults.d.ts +190 -2
  79. package/backend/dist/config/defaults.js +191 -2
  80. package/backend/dist/config/env-archive.js +77 -38
  81. package/backend/dist/config/env.d.ts +4 -0
  82. package/backend/dist/config/env.js +16 -0
  83. package/backend/dist/config/index.d.ts +48 -12
  84. package/backend/dist/config/index.js +794 -368
  85. package/backend/dist/config/layout.d.ts +29 -0
  86. package/backend/dist/config/layout.js +86 -0
  87. package/backend/dist/config/migrations/v0-to-v1.d.ts +105 -0
  88. package/backend/dist/config/migrations/v0-to-v1.js +78 -0
  89. package/backend/dist/config/migrations/v1-to-v2.d.ts +14 -0
  90. package/backend/dist/config/migrations/v1-to-v2.js +41 -0
  91. package/backend/dist/config/migrations/v2-to-v3.d.ts +34 -0
  92. package/backend/dist/config/migrations/v2-to-v3.js +66 -0
  93. package/backend/dist/config/migrations/v3-to-v4.d.ts +34 -0
  94. package/backend/dist/config/migrations/v3-to-v4.js +61 -0
  95. package/backend/dist/config/runtime.d.ts +13 -0
  96. package/backend/dist/config/runtime.js +26 -0
  97. package/backend/dist/config/schema.d.ts +28 -0
  98. package/backend/dist/config/schema.js +98 -0
  99. package/backend/dist/config/types.d.ts +491 -84
  100. package/backend/dist/forward-proxy/access-log.d.ts +173 -0
  101. package/backend/dist/forward-proxy/access-log.js +657 -0
  102. package/backend/dist/forward-proxy/ca-trust.d.ts +42 -0
  103. package/backend/dist/forward-proxy/ca-trust.js +242 -0
  104. package/backend/dist/forward-proxy/ca.d.ts +66 -2
  105. package/backend/dist/forward-proxy/ca.js +146 -11
  106. package/backend/dist/forward-proxy/caller-context.d.ts +18 -0
  107. package/backend/dist/forward-proxy/caller-context.js +20 -0
  108. package/backend/dist/forward-proxy/egress.d.ts +104 -0
  109. package/backend/dist/forward-proxy/egress.js +280 -0
  110. package/backend/dist/forward-proxy/h2-forward.d.ts +66 -0
  111. package/backend/dist/forward-proxy/h2-forward.js +526 -0
  112. package/backend/dist/forward-proxy/index.d.ts +13 -1
  113. package/backend/dist/forward-proxy/index.js +148 -7
  114. package/backend/dist/forward-proxy/interceptor.d.ts +16 -13
  115. package/backend/dist/forward-proxy/interceptor.js +35 -57
  116. package/backend/dist/forward-proxy/relay.d.ts +21 -1
  117. package/backend/dist/forward-proxy/relay.js +48 -1
  118. package/backend/dist/forward-proxy/rules.d.ts +148 -0
  119. package/backend/dist/forward-proxy/rules.js +280 -0
  120. package/backend/dist/forward-proxy/server.d.ts +102 -9
  121. package/backend/dist/forward-proxy/server.js +1310 -305
  122. package/backend/dist/forward-proxy/sni.d.ts +29 -7
  123. package/backend/dist/forward-proxy/sni.js +109 -47
  124. package/backend/dist/forward-proxy/system-proxy.d.ts +72 -0
  125. package/backend/dist/forward-proxy/system-proxy.js +303 -0
  126. package/backend/dist/forward-proxy/upstream-tls.d.ts +46 -0
  127. package/backend/dist/forward-proxy/upstream-tls.js +105 -0
  128. package/backend/dist/forward-proxy/ws-frames.d.ts +45 -0
  129. package/backend/dist/forward-proxy/ws-frames.js +153 -0
  130. package/backend/dist/harness/common/catalog-registry.d.ts +63 -0
  131. package/backend/dist/harness/common/catalog-registry.js +77 -0
  132. package/backend/dist/harness/common/github.d.ts +6 -0
  133. package/backend/dist/harness/common/github.js +13 -0
  134. package/backend/dist/harness/common/market.d.ts +590 -0
  135. package/backend/dist/harness/common/market.js +1079 -0
  136. package/backend/dist/harness/common/marketplace-rescan-scheduler.d.ts +24 -0
  137. package/backend/dist/harness/common/marketplace-rescan-scheduler.js +62 -0
  138. package/backend/dist/harness/{catalog-npm.d.ts → common/npm-catalog.d.ts} +5 -5
  139. package/backend/dist/harness/{catalog-npm.js → common/npm-catalog.js} +7 -7
  140. package/backend/dist/harness/common/npm-source.d.ts +29 -0
  141. package/backend/dist/harness/common/npm-source.js +121 -0
  142. package/backend/dist/harness/common/pypi-source.d.ts +28 -0
  143. package/backend/dist/harness/common/pypi-source.js +71 -0
  144. package/backend/dist/harness/common/source-views.d.ts +22 -0
  145. package/backend/dist/harness/common/source-views.js +25 -0
  146. package/backend/dist/harness/{stars.d.ts → common/stars.d.ts} +1 -1
  147. package/backend/dist/harness/{stars.js → common/stars.js} +2 -2
  148. package/backend/dist/harness/common/text.d.ts +11 -0
  149. package/backend/dist/harness/common/text.js +18 -0
  150. package/backend/dist/harness/config-file.d.ts +14 -1
  151. package/backend/dist/harness/config-file.js +38 -0
  152. package/backend/dist/harness/db-probe.d.ts +29 -0
  153. package/backend/dist/harness/db-probe.js +270 -0
  154. package/backend/dist/harness/detail.d.ts +10 -1
  155. package/backend/dist/harness/detail.js +144 -7
  156. package/backend/dist/harness/host/adapters/amp.d.ts +19 -0
  157. package/backend/dist/harness/host/adapters/amp.js +21 -0
  158. package/backend/dist/harness/host/adapters/antigravity.d.ts +18 -0
  159. package/backend/dist/harness/host/adapters/antigravity.js +21 -0
  160. package/backend/dist/harness/host/adapters/base.d.ts +225 -0
  161. package/backend/dist/harness/host/adapters/base.js +521 -0
  162. package/backend/dist/harness/host/adapters/claude.d.ts +54 -0
  163. package/backend/dist/harness/host/adapters/claude.js +145 -0
  164. package/backend/dist/harness/host/adapters/cline.d.ts +18 -0
  165. package/backend/dist/harness/host/adapters/cline.js +20 -0
  166. package/backend/dist/harness/host/adapters/codex.d.ts +54 -0
  167. package/backend/dist/harness/host/adapters/codex.js +133 -0
  168. package/backend/dist/harness/host/adapters/cursor.d.ts +18 -0
  169. package/backend/dist/harness/host/adapters/cursor.js +24 -0
  170. package/backend/dist/harness/host/adapters/declarative.d.ts +22 -0
  171. package/backend/dist/harness/host/adapters/declarative.js +38 -0
  172. package/backend/dist/harness/host/adapters/dsh.d.ts +76 -0
  173. package/backend/dist/harness/host/adapters/dsh.js +253 -0
  174. package/backend/dist/harness/host/adapters/factory.d.ts +36 -0
  175. package/backend/dist/harness/host/adapters/factory.js +34 -0
  176. package/backend/dist/harness/host/adapters/gemini-cli.d.ts +17 -0
  177. package/backend/dist/harness/host/adapters/gemini-cli.js +19 -0
  178. package/backend/dist/harness/host/adapters/grok.d.ts +66 -0
  179. package/backend/dist/harness/host/adapters/grok.js +136 -0
  180. package/backend/dist/harness/{adapters → host/adapters}/index.d.ts +9 -4
  181. package/backend/dist/harness/{adapters → host/adapters}/index.js +31 -10
  182. package/backend/dist/harness/host/adapters/kimi.d.ts +30 -0
  183. package/backend/dist/harness/host/adapters/kimi.js +59 -0
  184. package/backend/dist/harness/host/adapters/omp.d.ts +55 -0
  185. package/backend/dist/harness/host/adapters/omp.js +90 -0
  186. package/backend/dist/harness/host/adapters/openclaw.d.ts +54 -0
  187. package/backend/dist/harness/host/adapters/openclaw.js +141 -0
  188. package/backend/dist/harness/host/adapters/opencode.d.ts +24 -0
  189. package/backend/dist/harness/host/adapters/opencode.js +48 -0
  190. package/backend/dist/harness/host/adapters/pi.d.ts +27 -0
  191. package/backend/dist/harness/host/adapters/pi.js +58 -0
  192. package/backend/dist/harness/host/adapters/types.d.ts +395 -0
  193. package/backend/dist/harness/host/adapters/types.js +17 -0
  194. package/backend/dist/harness/host/adapters/universal.d.ts +14 -0
  195. package/backend/dist/harness/host/adapters/universal.js +18 -0
  196. package/backend/dist/harness/host/adapters/windsurf.d.ts +20 -0
  197. package/backend/dist/harness/host/adapters/windsurf.js +22 -0
  198. package/backend/dist/harness/host/adapters/zed.d.ts +12 -0
  199. package/backend/dist/harness/host/adapters/zed.js +14 -0
  200. package/backend/dist/harness/host/claude-mcp-runtime.d.ts +6 -0
  201. package/backend/dist/harness/host/claude-mcp-runtime.js +56 -0
  202. package/backend/dist/harness/{discover.d.ts → host/discover.d.ts} +54 -18
  203. package/backend/dist/harness/{discover.js → host/discover.js} +314 -53
  204. package/backend/dist/harness/{drift.d.ts → host/drift.d.ts} +1 -1
  205. package/backend/dist/harness/{drift.js → host/drift.js} +1 -1
  206. package/backend/dist/harness/host/grok-mcp-runtime.d.ts +6 -0
  207. package/backend/dist/harness/host/grok-mcp-runtime.js +56 -0
  208. package/backend/dist/harness/{hosts.d.ts → host/hosts.d.ts} +3 -3
  209. package/backend/dist/harness/{hosts.js → host/hosts.js} +7 -3
  210. package/backend/dist/harness/host/index.d.ts +10 -0
  211. package/backend/dist/harness/host/index.js +12 -0
  212. package/backend/dist/harness/host/install-log.d.ts +22 -0
  213. package/backend/dist/harness/host/install-log.js +106 -0
  214. package/backend/dist/harness/{install.d.ts → host/install.d.ts} +32 -13
  215. package/backend/dist/harness/{install.js → host/install.js} +133 -50
  216. package/backend/dist/harness/host/inventory.d.ts +30 -0
  217. package/backend/dist/harness/{inventory.js → host/inventory.js} +107 -16
  218. package/backend/dist/harness/host/kimi-mcp-runtime.d.ts +6 -0
  219. package/backend/dist/harness/host/kimi-mcp-runtime.js +84 -0
  220. package/backend/dist/harness/{ledger.d.ts → host/ledger.d.ts} +1 -1
  221. package/backend/dist/harness/{ledger.js → host/ledger.js} +3 -3
  222. package/backend/dist/harness/{maintenance.d.ts → host/maintenance.d.ts} +23 -6
  223. package/backend/dist/harness/{maintenance.js → host/maintenance.js} +355 -63
  224. package/backend/dist/harness/{manifest.d.ts → host/manifest.d.ts} +11 -2
  225. package/backend/dist/harness/{manifest.js → host/manifest.js} +76 -15
  226. package/backend/dist/harness/host/marketplace-sync.d.ts +64 -0
  227. package/backend/dist/harness/host/marketplace-sync.js +231 -0
  228. package/backend/dist/harness/host/mcp-cli.d.ts +44 -0
  229. package/backend/dist/harness/host/mcp-cli.js +545 -0
  230. package/backend/dist/harness/host/mcp-edit.d.ts +89 -0
  231. package/backend/dist/harness/host/mcp-edit.js +342 -0
  232. package/backend/dist/harness/host/mcp-entry.d.ts +100 -0
  233. package/backend/dist/harness/host/mcp-entry.js +435 -0
  234. package/backend/dist/harness/host/mcp-inspector.d.ts +125 -0
  235. package/backend/dist/harness/host/mcp-inspector.js +634 -0
  236. package/backend/dist/harness/host/mcp-registry.d.ts +66 -0
  237. package/backend/dist/harness/host/mcp-registry.js +331 -0
  238. package/backend/dist/harness/host/mcp-runtime.d.ts +19 -0
  239. package/backend/dist/harness/host/mcp-runtime.js +22 -0
  240. package/backend/dist/harness/host/opencode-mcp-runtime.d.ts +7 -0
  241. package/backend/dist/harness/host/opencode-mcp-runtime.js +73 -0
  242. package/backend/dist/harness/{probe.d.ts → host/probe.d.ts} +4 -4
  243. package/backend/dist/harness/{probe.js → host/probe.js} +8 -8
  244. package/backend/dist/harness/{registry.d.ts → host/registry.d.ts} +1 -1
  245. package/backend/dist/harness/host/registry.js +28 -0
  246. package/backend/dist/harness/host/request.d.ts +56 -0
  247. package/backend/dist/harness/host/request.js +1 -0
  248. package/backend/dist/harness/{sources → host/resolvers}/clawhub.d.ts +1 -1
  249. package/backend/dist/harness/{sources → host/resolvers}/clawhub.js +1 -1
  250. package/backend/dist/harness/host/resolvers/git-marketplace.d.ts +16 -0
  251. package/backend/dist/harness/host/resolvers/git-marketplace.js +53 -0
  252. package/backend/dist/harness/{sources → host/resolvers}/github.d.ts +1 -1
  253. package/backend/dist/harness/{sources → host/resolvers}/github.js +2 -2
  254. package/backend/dist/harness/host/resolvers/npm.d.ts +2 -0
  255. package/backend/dist/harness/{sources → host/resolvers}/npm.js +16 -10
  256. package/backend/dist/harness/host/resolvers/pypi.d.ts +2 -0
  257. package/backend/dist/harness/host/resolvers/pypi.js +100 -0
  258. package/backend/dist/harness/host/scopes.d.ts +11 -0
  259. package/backend/dist/harness/host/scopes.js +12 -0
  260. package/backend/dist/harness/host/timeouts.d.ts +8 -0
  261. package/backend/dist/harness/host/timeouts.js +8 -0
  262. package/backend/dist/harness/host/writers/kimi-web.d.ts +70 -0
  263. package/backend/dist/harness/host/writers/kimi-web.js +222 -0
  264. package/backend/dist/harness/host/writers/mcp.d.ts +119 -0
  265. package/backend/dist/harness/host/writers/mcp.js +359 -0
  266. package/backend/dist/harness/host/writers/plugin.d.ts +176 -0
  267. package/backend/dist/harness/host/writers/plugin.js +528 -0
  268. package/backend/dist/harness/{writers → host/writers}/skill.d.ts +3 -3
  269. package/backend/dist/harness/{writers → host/writers}/skill.js +6 -3
  270. package/backend/dist/harness/lang.d.ts +14 -0
  271. package/backend/dist/harness/lang.js +33 -0
  272. package/backend/dist/harness/net.d.ts +33 -0
  273. package/backend/dist/harness/net.js +63 -0
  274. package/backend/dist/harness/plugin/adapters/antigravity.d.ts +11 -0
  275. package/backend/dist/harness/plugin/adapters/antigravity.js +14 -0
  276. package/backend/dist/harness/plugin/adapters/base.d.ts +107 -0
  277. package/backend/dist/harness/plugin/adapters/base.js +454 -0
  278. package/backend/dist/harness/plugin/adapters/claude.d.ts +28 -0
  279. package/backend/dist/harness/plugin/adapters/claude.js +63 -0
  280. package/backend/dist/harness/plugin/adapters/codex.d.ts +13 -0
  281. package/backend/dist/harness/plugin/adapters/codex.js +16 -0
  282. package/backend/dist/harness/plugin/adapters/cursor.d.ts +13 -0
  283. package/backend/dist/harness/plugin/adapters/cursor.js +16 -0
  284. package/backend/dist/harness/plugin/adapters/dsh-plugin-net.d.ts +20 -0
  285. package/backend/dist/harness/plugin/adapters/dsh-plugin-net.js +371 -0
  286. package/backend/dist/harness/plugin/adapters/dsh.d.ts +22 -0
  287. package/backend/dist/harness/plugin/adapters/dsh.js +50 -0
  288. package/backend/dist/harness/plugin/adapters/factory.d.ts +11 -0
  289. package/backend/dist/harness/plugin/adapters/factory.js +19 -0
  290. package/backend/dist/harness/plugin/adapters/gemini.d.ts +12 -0
  291. package/backend/dist/harness/plugin/adapters/gemini.js +22 -0
  292. package/backend/dist/harness/plugin/adapters/grok.d.ts +15 -0
  293. package/backend/dist/harness/plugin/adapters/grok.js +23 -0
  294. package/backend/dist/harness/plugin/adapters/index.d.ts +41 -0
  295. package/backend/dist/harness/plugin/adapters/index.js +143 -0
  296. package/backend/dist/harness/plugin/adapters/kimi.d.ts +6 -0
  297. package/backend/dist/harness/plugin/adapters/kimi.js +35 -0
  298. package/backend/dist/harness/plugin/adapters/omp.d.ts +19 -0
  299. package/backend/dist/harness/plugin/adapters/omp.js +26 -0
  300. package/backend/dist/harness/plugin/adapters/openclaw.d.ts +20 -0
  301. package/backend/dist/harness/plugin/adapters/openclaw.js +36 -0
  302. package/backend/dist/harness/plugin/adapters/pi-dev.d.ts +124 -0
  303. package/backend/dist/harness/plugin/adapters/pi-dev.js +420 -0
  304. package/backend/dist/harness/plugin/adapters/pi-github.d.ts +18 -0
  305. package/backend/dist/harness/plugin/adapters/pi-github.js +27 -0
  306. package/backend/dist/harness/plugin/adapters/universal.d.ts +11 -0
  307. package/backend/dist/harness/plugin/adapters/universal.js +18 -0
  308. package/backend/dist/harness/plugin/builtin.d.ts +13 -0
  309. package/backend/dist/harness/plugin/builtin.js +34 -0
  310. package/backend/dist/harness/plugin/catalog.d.ts +30 -0
  311. package/backend/dist/harness/plugin/catalog.js +200 -0
  312. package/backend/dist/harness/plugin/index.d.ts +9 -0
  313. package/backend/dist/harness/plugin/index.js +9 -0
  314. package/backend/dist/harness/plugin/types.d.ts +164 -0
  315. package/backend/dist/harness/plugin/types.js +1 -0
  316. package/backend/dist/harness/{clawhub.d.ts → skill/clawhub.d.ts} +28 -5
  317. package/backend/dist/harness/{clawhub.js → skill/clawhub.js} +170 -5
  318. package/backend/dist/harness/skill/skills-sh.d.ts +47 -0
  319. package/backend/dist/harness/skill/skills-sh.js +270 -0
  320. package/backend/dist/harness/skill/sources.d.ts +41 -0
  321. package/backend/dist/harness/skill/sources.js +131 -0
  322. package/backend/dist/harness/spi.d.ts +11 -7
  323. package/backend/dist/harness/tcp-reach.d.ts +30 -0
  324. package/backend/dist/harness/tcp-reach.js +61 -0
  325. package/backend/dist/harness/translation.d.ts +31 -13
  326. package/backend/dist/harness/translation.js +202 -60
  327. package/backend/dist/harness/types.d.ts +61 -16
  328. package/backend/dist/index.js +170 -16
  329. package/backend/dist/ir/adapters/anthropic-messages-stream.d.ts +18 -0
  330. package/backend/dist/ir/adapters/anthropic-messages-stream.js +266 -0
  331. package/backend/dist/ir/adapters/anthropic-messages.d.ts +30 -0
  332. package/backend/dist/ir/adapters/anthropic-messages.js +870 -0
  333. package/backend/dist/ir/adapters/google-gemini-stream.d.ts +22 -0
  334. package/backend/dist/ir/adapters/google-gemini-stream.js +246 -0
  335. package/backend/dist/ir/adapters/google-gemini.d.ts +9 -0
  336. package/backend/dist/ir/adapters/google-gemini.js +450 -0
  337. package/backend/dist/ir/adapters/openai-chat-stream.d.ts +41 -0
  338. package/backend/dist/ir/adapters/openai-chat-stream.js +369 -0
  339. package/backend/dist/ir/adapters/openai-chat.d.ts +17 -0
  340. package/backend/dist/ir/adapters/openai-chat.js +670 -0
  341. package/backend/dist/ir/adapters/openai-responses-output.d.ts +50 -0
  342. package/backend/dist/ir/adapters/openai-responses-output.js +353 -0
  343. package/backend/dist/ir/adapters/openai-responses-stream.d.ts +12 -0
  344. package/backend/dist/ir/adapters/openai-responses-stream.js +193 -0
  345. package/backend/dist/ir/adapters/openai-responses.d.ts +14 -0
  346. package/backend/dist/ir/adapters/openai-responses.js +670 -0
  347. package/backend/dist/ir/capabilities.d.ts +41 -0
  348. package/backend/dist/ir/capabilities.js +147 -0
  349. package/backend/dist/ir/errors.d.ts +23 -0
  350. package/backend/dist/ir/errors.js +31 -0
  351. package/backend/dist/ir/index.d.ts +5 -0
  352. package/backend/dist/ir/index.js +5 -0
  353. package/backend/dist/ir/media.d.ts +2 -0
  354. package/backend/dist/ir/media.js +2 -0
  355. package/backend/dist/ir/stream.d.ts +17 -0
  356. package/backend/dist/ir/stream.js +250 -0
  357. package/backend/dist/ir/types.d.ts +523 -0
  358. package/backend/dist/ir/types.js +19 -0
  359. package/backend/dist/ir/validate.d.ts +18 -0
  360. package/backend/dist/ir/validate.js +272 -0
  361. package/backend/dist/metrics/request-cost.d.ts +3 -11
  362. package/backend/dist/metrics/request-cost.js +9 -27
  363. package/backend/dist/observability/failure-events.d.ts +20 -4
  364. package/backend/dist/observability/failure-events.js +9 -1
  365. package/backend/dist/observability/http-exchange.d.ts +75 -27
  366. package/backend/dist/observability/http-exchange.js +136 -39
  367. package/backend/dist/observability/request-identity.d.ts +40 -0
  368. package/backend/dist/observability/request-identity.js +102 -0
  369. package/backend/dist/observability/traffic-live-hidden.d.ts +24 -0
  370. package/backend/dist/observability/traffic-live-hidden.js +82 -0
  371. package/backend/dist/observability/upstream-body-redaction.d.ts +23 -0
  372. package/backend/dist/observability/upstream-body-redaction.js +72 -0
  373. package/backend/dist/observability/upstream-events.d.ts +16 -10
  374. package/backend/dist/observability/upstream-events.js +17 -11
  375. package/backend/dist/opencode/agents.d.ts +3 -2
  376. package/backend/dist/opencode/catalog/auto-pull.d.ts +35 -1
  377. package/backend/dist/opencode/catalog/auto-pull.js +169 -33
  378. package/backend/dist/opencode/catalog/ocr-store.d.ts +6 -6
  379. package/backend/dist/opencode/catalog/ocr-store.js +2 -2
  380. package/backend/dist/opencode/catalog/overrides-store.d.ts +6 -5
  381. package/backend/dist/opencode/catalog/overrides-store.js +28 -3
  382. package/backend/dist/opencode/catalog/repository.d.ts +4 -0
  383. package/backend/dist/opencode/catalog/repository.js +19 -0
  384. package/backend/dist/opencode/catalog/sources/models-dev.d.ts +4 -0
  385. package/backend/dist/opencode/catalog/sources/models-dev.js +15 -4
  386. package/backend/dist/opencode/catalog/types.d.ts +10 -7
  387. package/backend/dist/opencode/connector.d.ts +2 -2
  388. package/backend/dist/opencode/connector.js +2 -2
  389. package/backend/dist/opencode/credentials/def-materialize.d.ts +0 -5
  390. package/backend/dist/opencode/credentials/def-materialize.js +149 -11
  391. package/backend/dist/opencode/credentials/ocr-store.d.ts +18 -0
  392. package/backend/dist/opencode/credentials/ocr-store.js +88 -7
  393. package/backend/dist/opencode/credentials/opencode-v2-store.d.ts +24 -13
  394. package/backend/dist/opencode/credentials/opencode-v2-store.js +70 -29
  395. package/backend/dist/opencode/credentials/paths.d.ts +8 -0
  396. package/backend/dist/opencode/credentials/paths.js +10 -0
  397. package/backend/dist/opencode/credentials/sync.d.ts +1 -1
  398. package/backend/dist/opencode/credentials/sync.js +4 -4
  399. package/backend/dist/opencode/credentials/types.d.ts +40 -4
  400. package/backend/dist/opencode/probe.d.ts +9 -5
  401. package/backend/dist/opencode/probe.js +68 -15
  402. package/backend/dist/opencode/provider-defs.js +59 -2
  403. package/backend/dist/opencode/provider-package.d.ts +31 -0
  404. package/backend/dist/opencode/provider-package.js +70 -0
  405. package/backend/dist/opencode/user-config.d.ts +11 -17
  406. package/backend/dist/opencode/user-config.js +42 -66
  407. package/backend/dist/pipeline/credential-selection.d.ts +13 -0
  408. package/backend/dist/pipeline/credential-selection.js +29 -1
  409. package/backend/dist/pipeline/directives.d.ts +14 -22
  410. package/backend/dist/pipeline/directives.js +122 -68
  411. package/backend/dist/pipeline/orchestrator.d.ts +42 -7
  412. package/backend/dist/pipeline/orchestrator.js +736 -266
  413. package/backend/dist/pipeline/prompt-optimizer.d.ts +6 -13
  414. package/backend/dist/pipeline/prompt-optimizer.js +9 -52
  415. package/backend/dist/pipeline/streaming-posture.d.ts +29 -0
  416. package/backend/dist/pipeline/streaming-posture.js +27 -0
  417. package/backend/dist/pipeline/tool-pairing.d.ts +10 -0
  418. package/backend/dist/pipeline/tool-pairing.js +90 -0
  419. package/backend/dist/plugins/builtin/model-gateway.d.ts +30 -0
  420. package/backend/dist/plugins/builtin/model-gateway.js +98 -0
  421. package/backend/dist/plugins/config.d.ts +41 -0
  422. package/backend/dist/plugins/config.js +113 -0
  423. package/backend/dist/plugins/gateways.d.ts +98 -0
  424. package/backend/dist/plugins/gateways.js +151 -0
  425. package/backend/dist/plugins/host.d.ts +203 -0
  426. package/backend/dist/plugins/host.js +1310 -0
  427. package/backend/dist/plugins/manifest.d.ts +43 -0
  428. package/backend/dist/plugins/manifest.js +462 -0
  429. package/backend/dist/plugins/pack.d.ts +32 -0
  430. package/backend/dist/plugins/pack.js +222 -0
  431. package/backend/dist/plugins/seed.d.ts +53 -0
  432. package/backend/dist/plugins/seed.js +136 -0
  433. package/backend/dist/plugins/types.d.ts +721 -0
  434. package/backend/dist/plugins/types.js +1 -0
  435. package/backend/dist/projects/store.d.ts +56 -0
  436. package/backend/dist/projects/store.js +194 -0
  437. package/backend/dist/projects/types.d.ts +12 -0
  438. package/backend/dist/projects/types.js +1 -0
  439. package/backend/dist/protocols/chat-compat.d.ts +2 -0
  440. package/backend/dist/protocols/chat-compat.js +137 -0
  441. package/backend/dist/protocols/systemone/convert.d.ts +5 -4
  442. package/backend/dist/protocols/systemone/convert.js +72 -26
  443. package/backend/dist/protocols/systemone/decide.js +128 -51
  444. package/backend/dist/protocols/systemone/native.d.ts +1 -1
  445. package/backend/dist/protocols/systemone/native.js +6 -6
  446. package/backend/dist/providers/anthropic.js +6 -6
  447. package/backend/dist/providers/base.d.ts +8 -47
  448. package/backend/dist/providers/boot-direct.d.ts +20 -2
  449. package/backend/dist/providers/boot-direct.js +72 -23
  450. package/backend/dist/providers/compat/tool-markup-leak.d.ts +41 -0
  451. package/backend/dist/providers/compat/tool-markup-leak.js +57 -0
  452. package/backend/dist/providers/compat/tool-markup-recovery.d.ts +27 -0
  453. package/backend/dist/providers/compat/tool-markup-recovery.js +831 -0
  454. package/backend/dist/providers/dispatch.d.ts +5 -8
  455. package/backend/dist/providers/dispatch.js +18 -12
  456. package/backend/dist/providers/executors/anthropic-messages.d.ts +12 -0
  457. package/backend/dist/providers/executors/anthropic-messages.js +56 -0
  458. package/backend/dist/providers/executors/dispatch.d.ts +14 -0
  459. package/backend/dist/providers/executors/dispatch.js +71 -0
  460. package/backend/dist/providers/executors/google-gemini.d.ts +12 -0
  461. package/backend/dist/providers/executors/google-gemini.js +53 -0
  462. package/backend/dist/providers/executors/http-json.d.ts +19 -0
  463. package/backend/dist/providers/executors/http-json.js +125 -0
  464. package/backend/dist/providers/executors/http-stream.d.ts +53 -0
  465. package/backend/dist/providers/executors/http-stream.js +472 -0
  466. package/backend/dist/providers/executors/openai-chat.d.ts +13 -0
  467. package/backend/dist/providers/executors/openai-chat.js +89 -0
  468. package/backend/dist/providers/executors/openai-responses.d.ts +12 -0
  469. package/backend/dist/providers/executors/openai-responses.js +71 -0
  470. package/backend/dist/providers/executors/plugin-adapter.d.ts +9 -0
  471. package/backend/dist/providers/executors/plugin-adapter.js +31 -0
  472. package/backend/dist/providers/google.js +6 -6
  473. package/backend/dist/providers/openai-compatible.js +13 -13
  474. package/backend/dist/providers/opencode-proxy.js +6 -6
  475. package/backend/dist/providers/plugin-wires.d.ts +34 -0
  476. package/backend/dist/providers/plugin-wires.js +82 -0
  477. package/backend/dist/providers/pool-refresh.d.ts +14 -0
  478. package/backend/dist/providers/pool-refresh.js +13 -0
  479. package/backend/dist/providers/protocol.d.ts +4 -0
  480. package/backend/dist/providers/protocol.js +61 -0
  481. package/backend/dist/providers/provider-takedown.d.ts +59 -0
  482. package/backend/dist/providers/provider-takedown.js +135 -0
  483. package/backend/dist/providers/registry.d.ts +37 -21
  484. package/backend/dist/providers/registry.js +204 -109
  485. package/backend/dist/providers/responses.d.ts +4 -2
  486. package/backend/dist/providers/responses.js +12 -9
  487. package/backend/dist/providers/vocabulary.d.ts +24 -6
  488. package/backend/dist/providers/vocabulary.js +75 -33
  489. package/backend/dist/providers/wire.d.ts +12 -17
  490. package/backend/dist/providers/wire.js +43 -91
  491. package/backend/dist/proxy/manual-node-spec.d.ts +92 -0
  492. package/backend/dist/proxy/manual-node-spec.js +408 -0
  493. package/backend/dist/proxy/mihomo-binary.d.ts +39 -0
  494. package/backend/dist/proxy/mihomo-binary.js +267 -0
  495. package/backend/dist/proxy/mihomo-client.d.ts +94 -0
  496. package/backend/dist/proxy/mihomo-client.js +294 -0
  497. package/backend/dist/proxy/mihomo-config.d.ts +40 -0
  498. package/backend/dist/proxy/mihomo-config.js +152 -0
  499. package/backend/dist/proxy/mihomo-pac.d.ts +26 -0
  500. package/backend/dist/proxy/mihomo-pac.js +60 -0
  501. package/backend/dist/proxy/mihomo-rules-import.d.ts +43 -0
  502. package/backend/dist/proxy/mihomo-rules-import.js +193 -0
  503. package/backend/dist/proxy/mihomo-sidecar.d.ts +65 -0
  504. package/backend/dist/proxy/mihomo-sidecar.js +515 -0
  505. package/backend/dist/quota/engine.d.ts +9 -2
  506. package/backend/dist/quota/engine.js +19 -1
  507. package/backend/dist/quota/prober.d.ts +8 -4
  508. package/backend/dist/quota/prober.js +9 -10
  509. package/backend/dist/ratelimit/rate-limiter.d.ts +119 -6
  510. package/backend/dist/ratelimit/rate-limiter.js +358 -20
  511. package/backend/dist/ratelimit/window-store.d.ts +34 -0
  512. package/backend/dist/ratelimit/window-store.js +70 -0
  513. package/backend/dist/resilience/breaker-state.js +8 -1
  514. package/backend/dist/resilience/circuit-breaker-manager.d.ts +229 -132
  515. package/backend/dist/resilience/circuit-breaker-manager.js +566 -297
  516. package/backend/dist/resilience/circuit-breaker.d.ts +11 -0
  517. package/backend/dist/resilience/circuit-breaker.js +39 -7
  518. package/backend/dist/resilience/error-classifier.d.ts +31 -3
  519. package/backend/dist/resilience/error-classifier.js +159 -31
  520. package/backend/dist/resilience/health-prober.d.ts +21 -4
  521. package/backend/dist/resilience/health-prober.js +100 -18
  522. package/backend/dist/resilience/types.d.ts +56 -9
  523. package/backend/dist/resilience/types.js +1 -1
  524. package/backend/dist/router/index.d.ts +6 -29
  525. package/backend/dist/router/index.js +15 -61
  526. package/backend/dist/router/layer2-decision.d.ts +2 -2
  527. package/backend/dist/router/layer2-decision.js +22 -19
  528. package/backend/dist/router/request-traits.d.ts +4 -11
  529. package/backend/dist/router/request-traits.js +5 -13
  530. package/backend/dist/routes/console.js +1948 -253
  531. package/backend/dist/routes/environments.d.ts +3 -2
  532. package/backend/dist/routes/environments.js +8 -4
  533. package/backend/dist/routes/harness.d.ts +3 -1
  534. package/backend/dist/routes/harness.js +1162 -356
  535. package/backend/dist/routes/mihomo.d.ts +5 -0
  536. package/backend/dist/routes/mihomo.js +882 -0
  537. package/backend/dist/routes/projects.d.ts +2 -0
  538. package/backend/dist/routes/projects.js +90 -0
  539. package/backend/dist/routes/responses.d.ts +20 -1
  540. package/backend/dist/routes/responses.js +65 -3
  541. package/backend/dist/routes/translation.d.ts +9 -0
  542. package/backend/dist/routes/translation.js +155 -0
  543. package/backend/dist/server.js +353 -67
  544. package/backend/dist/session/resp-store.d.ts +18 -49
  545. package/backend/dist/session/resp-store.js +114 -122
  546. package/backend/dist/session/session-manager.d.ts +222 -81
  547. package/backend/dist/session/session-manager.js +428 -180
  548. package/backend/dist/session/session-row.d.ts +81 -2
  549. package/backend/dist/session/session-row.js +69 -1
  550. package/backend/dist/surfaces/anthropic.d.ts +1 -15
  551. package/backend/dist/surfaces/anthropic.js +63 -44
  552. package/backend/dist/surfaces/chat-pipeline.d.ts +8 -4
  553. package/backend/dist/surfaces/chat-pipeline.js +102 -35
  554. package/backend/dist/surfaces/chat.d.ts +1 -9
  555. package/backend/dist/surfaces/chat.js +52 -29
  556. package/backend/dist/surfaces/decision-pipeline.js +26 -18
  557. package/backend/dist/surfaces/gateway-chat.d.ts +53 -0
  558. package/backend/dist/surfaces/gateway-chat.js +204 -0
  559. package/backend/dist/surfaces/ocr-headers.d.ts +25 -4
  560. package/backend/dist/surfaces/ocr-headers.js +52 -6
  561. package/backend/dist/surfaces/responses.d.ts +9 -1
  562. package/backend/dist/surfaces/responses.js +141 -141
  563. package/backend/dist/surfaces/systemone-probe.js +1 -1
  564. package/backend/dist/surfaces/systemone.d.ts +1 -1
  565. package/backend/dist/surfaces/systemone.js +1 -1
  566. package/backend/dist/surfaces/table.d.ts +15 -0
  567. package/backend/dist/surfaces/table.js +15 -0
  568. package/backend/dist/surfaces/transport-backpressure.d.ts +46 -0
  569. package/backend/dist/surfaces/transport-backpressure.js +122 -0
  570. package/backend/dist/surfaces/transport-fastify.js +92 -21
  571. package/backend/dist/surfaces/transport-node-http.js +92 -18
  572. package/backend/dist/surfaces/types.d.ts +74 -12
  573. package/backend/dist/trace/persist.d.ts +5 -0
  574. package/backend/dist/trace/persist.js +185 -24
  575. package/backend/dist/trace/tracker.d.ts +153 -16
  576. package/backend/dist/trace/tracker.js +77 -27
  577. package/backend/dist/translation/index.d.ts +151 -0
  578. package/backend/dist/translation/index.js +735 -0
  579. package/backend/dist/types/openai.d.ts +82 -1
  580. package/backend/dist/types/router.d.ts +71 -6
  581. package/backend/dist/types/router.js +33 -1
  582. package/backend/dist/update/check.d.ts +43 -0
  583. package/backend/dist/update/check.js +126 -0
  584. package/backend/dist/utils/chat-sse.d.ts +2 -22
  585. package/backend/dist/utils/chat-sse.js +1 -69
  586. package/backend/dist/utils/chat-stream.d.ts +2 -1
  587. package/backend/dist/utils/client-envelope.d.ts +108 -0
  588. package/backend/dist/utils/client-envelope.js +305 -0
  589. package/backend/dist/utils/event-ring.d.ts +8 -1
  590. package/backend/dist/utils/event-ring.js +13 -5
  591. package/backend/dist/utils/harness-profiles.d.ts +51 -0
  592. package/backend/dist/utils/harness-profiles.js +70 -0
  593. package/backend/dist/utils/percentile.d.ts +16 -0
  594. package/backend/dist/utils/percentile.js +29 -0
  595. package/backend/dist/utils/popularity.d.ts +4 -0
  596. package/backend/dist/utils/popularity.js +33 -0
  597. package/backend/dist/utils/probe-interval.d.ts +12 -0
  598. package/backend/dist/utils/probe-interval.js +16 -0
  599. package/backend/dist/utils/proxy-node.d.ts +13 -0
  600. package/backend/dist/utils/proxy-node.js +471 -0
  601. package/backend/dist/utils/proxy.d.ts +12 -0
  602. package/backend/dist/utils/proxy.js +44 -4
  603. package/backend/dist/utils/run-command.d.ts +42 -0
  604. package/backend/dist/utils/run-command.js +93 -0
  605. package/backend/dist/utils/self-url.d.ts +13 -0
  606. package/backend/dist/utils/self-url.js +90 -2
  607. package/backend/dist/utils/semver.d.ts +22 -0
  608. package/backend/dist/utils/semver.js +75 -0
  609. package/backend/dist/utils/stream-relay.d.ts +35 -0
  610. package/backend/dist/utils/stream-relay.js +1 -0
  611. package/backend/dist/utils/upstream-url-guard.d.ts +15 -0
  612. package/backend/dist/utils/upstream-url-guard.js +107 -0
  613. package/backend/dist/validator/parser.d.ts +2 -5
  614. package/backend/dist/validator/parser.js +12 -16
  615. package/backend/dist/validator/schema-assertion.d.ts +3 -2
  616. package/backend/dist/validator/schema-assertion.js +53 -8
  617. package/frontend/dist/assets/index-CLvxJjp_.js +1476 -0
  618. package/frontend/dist/assets/index-CQSLGFTV.css +1 -0
  619. package/frontend/dist/assets/qoder.color-tVX5GCcD.svg +5 -0
  620. package/frontend/dist/index.html +2 -2
  621. package/frontend/dist/provider-logos/302ai.svg +7 -0
  622. package/frontend/dist/provider-logos/NOTICE.txt +39 -0
  623. package/frontend/dist/provider-logos/abacus.svg +14 -0
  624. package/frontend/dist/provider-logos/abliteration-ai.svg +6 -0
  625. package/frontend/dist/provider-logos/above.svg +3 -0
  626. package/frontend/dist/provider-logos/agentrouter.svg +4 -0
  627. package/frontend/dist/provider-logos/agnes.svg +1 -0
  628. package/frontend/dist/provider-logos/ai-router.svg +5 -0
  629. package/frontend/dist/provider-logos/ai21.svg +3 -0
  630. package/frontend/dist/provider-logos/aiand.svg +4 -0
  631. package/frontend/dist/provider-logos/aihubmix.svg +3 -0
  632. package/frontend/dist/provider-logos/aimlapi.svg +3 -0
  633. package/frontend/dist/provider-logos/ainetcafe.svg +1 -0
  634. package/frontend/dist/provider-logos/aixy.svg +4 -0
  635. package/frontend/dist/provider-logos/aki-io.svg +8 -0
  636. package/frontend/dist/provider-logos/alibaba-cn.svg +3 -0
  637. package/frontend/dist/provider-logos/alibaba-coding-plan-cn.svg +3 -0
  638. package/frontend/dist/provider-logos/alibaba-coding-plan.svg +3 -0
  639. package/frontend/dist/provider-logos/alibaba-token-plan-cn.svg +1 -0
  640. package/frontend/dist/provider-logos/alibaba-token-plan.svg +1 -0
  641. package/frontend/dist/provider-logos/alibaba.svg +3 -0
  642. package/frontend/dist/provider-logos/amazon-bedrock.svg +3 -0
  643. package/frontend/dist/provider-logos/ambient.svg +3 -0
  644. package/frontend/dist/provider-logos/amd.svg +3 -0
  645. package/frontend/dist/provider-logos/anthropic.svg +3 -0
  646. package/frontend/dist/provider-logos/anyapi.svg +3 -0
  647. package/frontend/dist/provider-logos/arcee.svg +3 -0
  648. package/frontend/dist/provider-logos/atomic-chat.svg +1 -0
  649. package/frontend/dist/provider-logos/auriko.svg +6 -0
  650. package/frontend/dist/provider-logos/azure-cognitive-services.svg +3 -0
  651. package/frontend/dist/provider-logos/azure.svg +3 -0
  652. package/frontend/dist/provider-logos/bailing.svg +3 -0
  653. package/frontend/dist/provider-logos/baseten.svg +3 -0
  654. package/frontend/dist/provider-logos/bee.svg +1 -0
  655. package/frontend/dist/provider-logos/berget.svg +3 -0
  656. package/frontend/dist/provider-logos/blueclaw.svg +3 -0
  657. package/frontend/dist/provider-logos/bothub.svg +33 -0
  658. package/frontend/dist/provider-logos/boundless.svg +12 -0
  659. package/frontend/dist/provider-logos/cerebras.svg +4 -0
  660. package/frontend/dist/provider-logos/chutes.svg +24 -0
  661. package/frontend/dist/provider-logos/clarifai.svg +3 -0
  662. package/frontend/dist/provider-logos/claudinio.svg +19 -0
  663. package/frontend/dist/provider-logos/cline-pass.svg +24 -0
  664. package/frontend/dist/provider-logos/cloudferro-sherlock.svg +5 -0
  665. package/frontend/dist/provider-logos/cloudflare-ai-gateway.svg +4 -0
  666. package/frontend/dist/provider-logos/cloudflare-workers-ai.svg +4 -0
  667. package/frontend/dist/provider-logos/cohere.svg +5 -0
  668. package/frontend/dist/provider-logos/commandcode.svg +11 -0
  669. package/frontend/dist/provider-logos/coralbricks.svg +6 -0
  670. package/frontend/dist/provider-logos/cortecs.svg +24 -0
  671. package/frontend/dist/provider-logos/crossmodel.svg +5 -0
  672. package/frontend/dist/provider-logos/crusoe.svg +23 -0
  673. package/frontend/dist/provider-logos/daoxe.svg +3 -0
  674. package/frontend/dist/provider-logos/databricks.svg +3 -0
  675. package/frontend/dist/provider-logos/deepinfra.svg +4 -0
  676. package/frontend/dist/provider-logos/deepseek.svg +3 -0
  677. package/frontend/dist/provider-logos/digitalocean.svg +6 -0
  678. package/frontend/dist/provider-logos/dinference.svg +1 -0
  679. package/frontend/dist/provider-logos/drun.svg +8 -0
  680. package/frontend/dist/provider-logos/ebcloud.svg +8 -0
  681. package/frontend/dist/provider-logos/echo.svg +7 -0
  682. package/frontend/dist/provider-logos/edenai.svg +8 -0
  683. package/frontend/dist/provider-logos/empiriolabs.svg +1 -0
  684. package/frontend/dist/provider-logos/engy.svg +1 -0
  685. package/frontend/dist/provider-logos/evroc.svg +3 -0
  686. package/frontend/dist/provider-logos/fastrouter.svg +3 -0
  687. package/frontend/dist/provider-logos/fireworks-ai.svg +3 -0
  688. package/frontend/dist/provider-logos/freemodel.svg +3 -0
  689. package/frontend/dist/provider-logos/friendli.svg +3 -0
  690. package/frontend/dist/provider-logos/frogbot.svg +36 -0
  691. package/frontend/dist/provider-logos/github-copilot.svg +3 -0
  692. package/frontend/dist/provider-logos/gitlab.svg +3 -0
  693. package/frontend/dist/provider-logos/gmicloud.svg +24 -0
  694. package/frontend/dist/provider-logos/google-vertex-anthropic.svg +10 -0
  695. package/frontend/dist/provider-logos/google-vertex.svg +10 -0
  696. package/frontend/dist/provider-logos/google.svg +3 -0
  697. package/frontend/dist/provider-logos/greenpt.svg +6 -0
  698. package/frontend/dist/provider-logos/groq.svg +3 -0
  699. package/frontend/dist/provider-logos/helicone.svg +6 -0
  700. package/frontend/dist/provider-logos/hetzner.svg +3 -0
  701. package/frontend/dist/provider-logos/hopper.svg +4 -0
  702. package/frontend/dist/provider-logos/hpc-ai.svg +446 -0
  703. package/frontend/dist/provider-logos/huggingface.svg +3 -0
  704. package/frontend/dist/provider-logos/hyper.svg +20 -0
  705. package/frontend/dist/provider-logos/impossibl.svg +3 -0
  706. package/frontend/dist/provider-logos/inception.svg +14 -0
  707. package/frontend/dist/provider-logos/inceptron.svg +14 -0
  708. package/frontend/dist/provider-logos/inco.svg +3 -0
  709. package/frontend/dist/provider-logos/infer.svg +4 -0
  710. package/frontend/dist/provider-logos/inference.svg +3 -0
  711. package/frontend/dist/provider-logos/inferx.svg +5 -0
  712. package/frontend/dist/provider-logos/infomaniak.svg +3 -0
  713. package/frontend/dist/provider-logos/io-net.svg +5 -0
  714. package/frontend/dist/provider-logos/iteracompute.svg +7 -0
  715. package/frontend/dist/provider-logos/jalapeno.svg +8 -0
  716. package/frontend/dist/provider-logos/jiekou.svg +4 -0
  717. package/frontend/dist/provider-logos/kenari.svg +4 -0
  718. package/frontend/dist/provider-logos/kilo.svg +4 -0
  719. package/frontend/dist/provider-logos/kimi-code-plan-cn.svg +3 -0
  720. package/frontend/dist/provider-logos/kimi-code-plan-global.svg +3 -0
  721. package/frontend/dist/provider-logos/klokintegration.svg +11 -0
  722. package/frontend/dist/provider-logos/kosmik.svg +28 -0
  723. package/frontend/dist/provider-logos/kuae-cloud-coding-plan.svg +3 -0
  724. package/frontend/dist/provider-logos/lilac.svg +6 -0
  725. package/frontend/dist/provider-logos/liquid.svg +1 -0
  726. package/frontend/dist/provider-logos/llmgateway-providers.svg +6 -0
  727. package/frontend/dist/provider-logos/llmgateway.svg +6 -0
  728. package/frontend/dist/provider-logos/llmtech.svg +6 -0
  729. package/frontend/dist/provider-logos/llmtr.svg +12 -0
  730. package/frontend/dist/provider-logos/lmstudio.svg +3 -0
  731. package/frontend/dist/provider-logos/longcat.svg +6 -0
  732. package/frontend/dist/provider-logos/lowrouter.svg +8 -0
  733. package/frontend/dist/provider-logos/lucidquery.svg +3 -0
  734. package/frontend/dist/provider-logos/lynkr.svg +1 -0
  735. package/frontend/dist/provider-logos/meganova.svg +3 -0
  736. package/frontend/dist/provider-logos/melious.svg +3 -0
  737. package/frontend/dist/provider-logos/merge-gateway.svg +4 -0
  738. package/frontend/dist/provider-logos/meta.svg +3 -0
  739. package/frontend/dist/provider-logos/minimax-cn-coding-plan.svg +3 -0
  740. package/frontend/dist/provider-logos/minimax-cn.svg +3 -0
  741. package/frontend/dist/provider-logos/minimax-coding-plan.svg +3 -0
  742. package/frontend/dist/provider-logos/minimax.svg +3 -0
  743. package/frontend/dist/provider-logos/mistral.svg +3 -0
  744. package/frontend/dist/provider-logos/mixlayer.svg +9 -0
  745. package/frontend/dist/provider-logos/moark.svg +3 -0
  746. package/frontend/dist/provider-logos/modal.svg +3 -0
  747. package/frontend/dist/provider-logos/model-oracle-ai.svg +11 -0
  748. package/frontend/dist/provider-logos/modelis.svg +1 -0
  749. package/frontend/dist/provider-logos/modelscope.svg +5 -0
  750. package/frontend/dist/provider-logos/modular.svg +3 -0
  751. package/frontend/dist/provider-logos/moonshotai-cn.svg +3 -0
  752. package/frontend/dist/provider-logos/moonshotai.svg +3 -0
  753. package/frontend/dist/provider-logos/morph.svg +24 -0
  754. package/frontend/dist/provider-logos/munito-eu.svg +1 -0
  755. package/frontend/dist/provider-logos/munito.svg +1 -0
  756. package/frontend/dist/provider-logos/nan.svg +1 -0
  757. package/frontend/dist/provider-logos/nano-gpt.svg +3 -0
  758. package/frontend/dist/provider-logos/nearai.svg +1 -0
  759. package/frontend/dist/provider-logos/nebius.svg +4 -0
  760. package/frontend/dist/provider-logos/neon.svg +3 -0
  761. package/frontend/dist/provider-logos/neosmith.svg +6 -0
  762. package/frontend/dist/provider-logos/neuralwatt.svg +27 -0
  763. package/frontend/dist/provider-logos/nova.svg +3 -0
  764. package/frontend/dist/provider-logos/novita-ai.svg +10 -0
  765. package/frontend/dist/provider-logos/nvidia.svg +3 -0
  766. package/frontend/dist/provider-logos/oci.svg +3 -0
  767. package/frontend/dist/provider-logos/ofox.svg +5 -0
  768. package/frontend/dist/provider-logos/ollama-cloud.svg +7 -0
  769. package/frontend/dist/provider-logos/openai.svg +3 -0
  770. package/frontend/dist/provider-logos/opencode-go.svg +4 -0
  771. package/frontend/dist/provider-logos/opencode.svg +4 -0
  772. package/frontend/dist/provider-logos/openreason.svg +8 -0
  773. package/frontend/dist/provider-logos/openrouter.svg +5 -0
  774. package/frontend/dist/provider-logos/opper.svg +3 -0
  775. package/frontend/dist/provider-logos/orcarouter.svg +2 -0
  776. package/frontend/dist/provider-logos/ovhcloud.svg +3 -0
  777. package/frontend/dist/provider-logos/pareto.svg +5 -0
  778. package/frontend/dist/provider-logos/pendra.svg +10 -0
  779. package/frontend/dist/provider-logos/perplexity-agent.svg +3 -0
  780. package/frontend/dist/provider-logos/perplexity.svg +3 -0
  781. package/frontend/dist/provider-logos/pioneer.svg +3 -0
  782. package/frontend/dist/provider-logos/poe.svg +7 -0
  783. package/frontend/dist/provider-logos/poolside.svg +3 -0
  784. package/frontend/dist/provider-logos/prime.svg +7 -0
  785. package/frontend/dist/provider-logos/privatemode-ai.svg +5 -0
  786. package/frontend/dist/provider-logos/qihang-ai.svg +9 -0
  787. package/frontend/dist/provider-logos/qiniu-ai.svg +7 -0
  788. package/frontend/dist/provider-logos/qvac.svg +6 -0
  789. package/frontend/dist/provider-logos/reflection.svg +3 -0
  790. package/frontend/dist/provider-logos/regolo-ai.svg +46 -0
  791. package/frontend/dist/provider-logos/requesty.svg +24 -0
  792. package/frontend/dist/provider-logos/routing-run.svg +4 -0
  793. package/frontend/dist/provider-logos/runinfra.svg +10 -0
  794. package/frontend/dist/provider-logos/sakana.svg +24 -0
  795. package/frontend/dist/provider-logos/salad-cloud.svg +15 -0
  796. package/frontend/dist/provider-logos/sambanova.svg +26 -0
  797. package/frontend/dist/provider-logos/sap-ai-core.svg +24 -0
  798. package/frontend/dist/provider-logos/sarvam.svg +24 -0
  799. package/frontend/dist/provider-logos/scaleway.svg +5 -0
  800. package/frontend/dist/provider-logos/scnet-token-plan.svg +8 -0
  801. package/frontend/dist/provider-logos/scx-ai.svg +1 -0
  802. package/frontend/dist/provider-logos/sensenova.svg +18 -0
  803. package/frontend/dist/provider-logos/siliconflow-cn.svg +3 -0
  804. package/frontend/dist/provider-logos/siliconflow.svg +3 -0
  805. package/frontend/dist/provider-logos/snowflake-cortex.svg +3 -0
  806. package/frontend/dist/provider-logos/stackit.svg +4 -0
  807. package/frontend/dist/provider-logos/standardcompute.svg +5 -0
  808. package/frontend/dist/provider-logos/stepfun-ai-step-plan.svg +16 -0
  809. package/frontend/dist/provider-logos/stepfun-ai.svg +16 -0
  810. package/frontend/dist/provider-logos/stepfun-step-plan.svg +16 -0
  811. package/frontend/dist/provider-logos/stepfun.svg +16 -0
  812. package/frontend/dist/provider-logos/subconscious.svg +3 -0
  813. package/frontend/dist/provider-logos/submodel.svg +3 -0
  814. package/frontend/dist/provider-logos/synthetic.svg +24 -0
  815. package/frontend/dist/provider-logos/tempr.svg +4 -0
  816. package/frontend/dist/provider-logos/tencent-coding-plan.svg +5 -0
  817. package/frontend/dist/provider-logos/tencent-token-plan.svg +3 -0
  818. package/frontend/dist/provider-logos/tencent-tokenhub.svg +3 -0
  819. package/frontend/dist/provider-logos/tensorx.svg +6 -0
  820. package/frontend/dist/provider-logos/the-grid-ai.svg +14 -0
  821. package/frontend/dist/provider-logos/thinkingmachines.svg +3 -0
  822. package/frontend/dist/provider-logos/tinfoil.svg +3 -0
  823. package/frontend/dist/provider-logos/togetherai.svg +4 -0
  824. package/frontend/dist/provider-logos/tokengo.svg +3 -0
  825. package/frontend/dist/provider-logos/tokenrouter.svg +4 -0
  826. package/frontend/dist/provider-logos/trustedrouter.svg +4 -0
  827. package/frontend/dist/provider-logos/umans-ai-coding-plan.svg +29 -0
  828. package/frontend/dist/provider-logos/umans-ai.svg +29 -0
  829. package/frontend/dist/provider-logos/unorouter.svg +7 -0
  830. package/frontend/dist/provider-logos/upstage.svg +24 -0
  831. package/frontend/dist/provider-logos/vancine.svg +6 -0
  832. package/frontend/dist/provider-logos/venice.svg +4 -0
  833. package/frontend/dist/provider-logos/vercel.svg +3 -0
  834. package/frontend/dist/provider-logos/vispark.svg +3 -0
  835. package/frontend/dist/provider-logos/vivgrid.svg +4 -0
  836. package/frontend/dist/provider-logos/volcengine-coding-plan.svg +1 -0
  837. package/frontend/dist/provider-logos/volcengine.svg +1 -0
  838. package/frontend/dist/provider-logos/vultr.svg +6 -0
  839. package/frontend/dist/provider-logos/wafer.ai.svg +3 -0
  840. package/frontend/dist/provider-logos/wallaby.svg +4 -0
  841. package/frontend/dist/provider-logos/wally.svg +1 -0
  842. package/frontend/dist/provider-logos/wandb.svg +6 -0
  843. package/frontend/dist/provider-logos/watsonx.svg +5 -0
  844. package/frontend/dist/provider-logos/xai.svg +3 -0
  845. package/frontend/dist/provider-logos/xiaomi-token-plan-ams.svg +3 -0
  846. package/frontend/dist/provider-logos/xiaomi-token-plan-cn.svg +3 -0
  847. package/frontend/dist/provider-logos/xiaomi-token-plan-sgp.svg +3 -0
  848. package/frontend/dist/provider-logos/xiaomi.svg +3 -0
  849. package/frontend/dist/provider-logos/xpersona.svg +8 -0
  850. package/frontend/dist/provider-logos/zai-coding-plan.svg +3 -0
  851. package/frontend/dist/provider-logos/zai.svg +3 -0
  852. package/frontend/dist/provider-logos/zeldoc.svg +3 -0
  853. package/frontend/dist/provider-logos/zenifra.svg +4 -0
  854. package/frontend/dist/provider-logos/zenmux.svg +4 -0
  855. package/frontend/dist/provider-logos/zhipuai-coding-plan.svg +3 -0
  856. package/frontend/dist/provider-logos/zhipuai.svg +3 -0
  857. package/package.json +13 -5
  858. package/backend/dist/budget/budget-manager.d.ts +0 -25
  859. package/backend/dist/budget/budget-manager.js +0 -54
  860. package/backend/dist/cli/clients/opencode-proxy.d.ts +0 -16
  861. package/backend/dist/cli/clients/opencode-proxy.js +0 -372
  862. package/backend/dist/config/governance-limits.d.ts +0 -68
  863. package/backend/dist/config/governance-limits.js +0 -261
  864. package/backend/dist/flywheel/collector.d.ts +0 -74
  865. package/backend/dist/flywheel/collector.js +0 -235
  866. package/backend/dist/flywheel/dataset.d.ts +0 -130
  867. package/backend/dist/flywheel/dataset.js +0 -638
  868. package/backend/dist/flywheel/decision-capture.d.ts +0 -68
  869. package/backend/dist/flywheel/decision-capture.js +0 -85
  870. package/backend/dist/flywheel/prune.d.ts +0 -133
  871. package/backend/dist/flywheel/prune.js +0 -495
  872. package/backend/dist/flywheel/schema.d.ts +0 -108
  873. package/backend/dist/flywheel/schema.js +0 -117
  874. package/backend/dist/flywheel/trainer.d.ts +0 -84
  875. package/backend/dist/flywheel/trainer.js +0 -198
  876. package/backend/dist/forward-proxy/bypass.d.ts +0 -20
  877. package/backend/dist/forward-proxy/bypass.js +0 -28
  878. package/backend/dist/harness/adapters/amp.d.ts +0 -2
  879. package/backend/dist/harness/adapters/amp.js +0 -8
  880. package/backend/dist/harness/adapters/claude.d.ts +0 -2
  881. package/backend/dist/harness/adapters/claude.js +0 -8
  882. package/backend/dist/harness/adapters/cline.d.ts +0 -2
  883. package/backend/dist/harness/adapters/cline.js +0 -8
  884. package/backend/dist/harness/adapters/codex.d.ts +0 -2
  885. package/backend/dist/harness/adapters/codex.js +0 -8
  886. package/backend/dist/harness/adapters/cursor.d.ts +0 -5
  887. package/backend/dist/harness/adapters/cursor.js +0 -11
  888. package/backend/dist/harness/adapters/declarative.d.ts +0 -64
  889. package/backend/dist/harness/adapters/declarative.js +0 -216
  890. package/backend/dist/harness/adapters/dsh.d.ts +0 -5
  891. package/backend/dist/harness/adapters/dsh.js +0 -6
  892. package/backend/dist/harness/adapters/gemini-cli.d.ts +0 -2
  893. package/backend/dist/harness/adapters/gemini-cli.js +0 -8
  894. package/backend/dist/harness/adapters/github-copilot.d.ts +0 -5
  895. package/backend/dist/harness/adapters/github-copilot.js +0 -11
  896. package/backend/dist/harness/adapters/omp.d.ts +0 -11
  897. package/backend/dist/harness/adapters/omp.js +0 -22
  898. package/backend/dist/harness/adapters/opencode.d.ts +0 -2
  899. package/backend/dist/harness/adapters/opencode.js +0 -56
  900. package/backend/dist/harness/adapters/pi.d.ts +0 -1
  901. package/backend/dist/harness/adapters/pi.js +0 -23
  902. package/backend/dist/harness/adapters/types.d.ts +0 -189
  903. package/backend/dist/harness/adapters/types.js +0 -12
  904. package/backend/dist/harness/adapters/universal.d.ts +0 -6
  905. package/backend/dist/harness/adapters/universal.js +0 -10
  906. package/backend/dist/harness/adapters/windsurf.d.ts +0 -2
  907. package/backend/dist/harness/adapters/windsurf.js +0 -11
  908. package/backend/dist/harness/adapters/zed.d.ts +0 -2
  909. package/backend/dist/harness/adapters/zed.js +0 -8
  910. package/backend/dist/harness/awesome-opencode.d.ts +0 -40
  911. package/backend/dist/harness/awesome-opencode.js +0 -75
  912. package/backend/dist/harness/browse.d.ts +0 -202
  913. package/backend/dist/harness/browse.js +0 -1214
  914. package/backend/dist/harness/inventory.d.ts +0 -10
  915. package/backend/dist/harness/opencode-cafe.d.ts +0 -40
  916. package/backend/dist/harness/opencode-cafe.js +0 -85
  917. package/backend/dist/harness/opencode-ecosystem.d.ts +0 -34
  918. package/backend/dist/harness/opencode-ecosystem.js +0 -246
  919. package/backend/dist/harness/pi-dev.d.ts +0 -81
  920. package/backend/dist/harness/pi-dev.js +0 -187
  921. package/backend/dist/harness/registry.js +0 -26
  922. package/backend/dist/harness/scopes.d.ts +0 -21
  923. package/backend/dist/harness/scopes.js +0 -22
  924. package/backend/dist/harness/skills-sh.d.ts +0 -109
  925. package/backend/dist/harness/skills-sh.js +0 -178
  926. package/backend/dist/harness/smithery.d.ts +0 -64
  927. package/backend/dist/harness/smithery.js +0 -146
  928. package/backend/dist/harness/sources/awesome-opencode.d.ts +0 -11
  929. package/backend/dist/harness/sources/awesome-opencode.js +0 -39
  930. package/backend/dist/harness/sources/mcp-official.d.ts +0 -2
  931. package/backend/dist/harness/sources/mcp-official.js +0 -110
  932. package/backend/dist/harness/sources/npm.d.ts +0 -2
  933. package/backend/dist/harness/sources/opencode-cafe.d.ts +0 -11
  934. package/backend/dist/harness/sources/opencode-cafe.js +0 -41
  935. package/backend/dist/harness/sources/smithery.d.ts +0 -2
  936. package/backend/dist/harness/sources/smithery.js +0 -81
  937. package/backend/dist/harness/writers/extension.d.ts +0 -116
  938. package/backend/dist/harness/writers/extension.js +0 -219
  939. package/backend/dist/harness/writers/mcp.d.ts +0 -72
  940. package/backend/dist/harness/writers/mcp.js +0 -195
  941. package/backend/dist/observability/trace-id.d.ts +0 -40
  942. package/backend/dist/observability/trace-id.js +0 -134
  943. package/backend/dist/opencode/catalog/custom-store.d.ts +0 -50
  944. package/backend/dist/opencode/catalog/custom-store.js +0 -144
  945. package/backend/dist/opencode/credentials/push.d.ts +0 -38
  946. package/backend/dist/opencode/credentials/push.js +0 -116
  947. package/backend/dist/opencode/credentials/reconcile.d.ts +0 -49
  948. package/backend/dist/opencode/credentials/reconcile.js +0 -216
  949. package/backend/dist/opencode/sync.d.ts +0 -29
  950. package/backend/dist/opencode/sync.js +0 -186
  951. package/backend/dist/pipeline/account-selection.d.ts +0 -101
  952. package/backend/dist/pipeline/account-selection.js +0 -112
  953. package/backend/dist/providers/systemone.d.ts +0 -29
  954. package/backend/dist/providers/systemone.js +0 -170
  955. package/backend/dist/ratelimit/duration.d.ts +0 -24
  956. package/backend/dist/ratelimit/duration.js +0 -43
  957. package/backend/dist/ratelimit/governance-runtime.d.ts +0 -121
  958. package/backend/dist/ratelimit/governance-runtime.js +0 -183
  959. package/backend/dist/ratelimit/index.d.ts +0 -4
  960. package/backend/dist/ratelimit/index.js +0 -4
  961. package/backend/dist/ratelimit/limiter.d.ts +0 -157
  962. package/backend/dist/ratelimit/limiter.js +0 -244
  963. package/backend/dist/ratelimit/sliding-window-counter.d.ts +0 -63
  964. package/backend/dist/ratelimit/sliding-window-counter.js +0 -103
  965. package/backend/dist/ratelimit/subject.d.ts +0 -26
  966. package/backend/dist/ratelimit/subject.js +0 -28
  967. package/backend/dist/resilience/account-state.d.ts +0 -84
  968. package/backend/dist/resilience/account-state.js +0 -228
  969. package/backend/dist/router/layer1-classifier.d.ts +0 -111
  970. package/backend/dist/router/layer1-classifier.js +0 -467
  971. package/backend/dist/router/layer2-judge.d.ts +0 -111
  972. package/backend/dist/router/layer2-judge.js +0 -373
  973. package/backend/dist/router/retry-escalation.d.ts +0 -89
  974. package/backend/dist/router/retry-escalation.js +0 -99
  975. package/backend/dist/routes/flywheel.d.ts +0 -3
  976. package/backend/dist/routes/flywheel.js +0 -268
  977. package/backend/dist/routes/systemone.d.ts +0 -3
  978. package/backend/dist/routes/systemone.js +0 -90
  979. package/backend/dist/surfaces/governance-envelope.d.ts +0 -34
  980. package/backend/dist/surfaces/governance-envelope.js +0 -47
  981. package/backend/dist/utils/token-estimator.d.ts +0 -7
  982. package/backend/dist/utils/token-estimator.js +0 -20
  983. package/frontend/dist/assets/index-B7GKsUyU.js +0 -982
  984. package/frontend/dist/assets/index-DLKLOkQJ.css +0 -1
  985. package/frontend/dist/assets/inter-cyrillic-800-normal-C7MGvYyJ.woff2 +0 -0
  986. package/frontend/dist/assets/inter-cyrillic-800-normal-CCHyn08d.woff +0 -0
  987. package/frontend/dist/assets/inter-cyrillic-ext-800-normal-BZOjs1Xv.woff2 +0 -0
  988. package/frontend/dist/assets/inter-cyrillic-ext-800-normal-Ca-gJeZY.woff +0 -0
  989. package/frontend/dist/assets/inter-greek-800-normal-BU00tryP.woff +0 -0
  990. package/frontend/dist/assets/inter-greek-800-normal-CLIouy3y.woff2 +0 -0
  991. package/frontend/dist/assets/inter-greek-ext-800-normal-B--PVpEC.woff2 +0 -0
  992. package/frontend/dist/assets/inter-greek-ext-800-normal-DUe57HfS.woff +0 -0
  993. package/frontend/dist/assets/inter-latin-800-normal-BYj_oED-.woff2 +0 -0
  994. package/frontend/dist/assets/inter-latin-800-normal-D1mf63XC.woff +0 -0
  995. package/frontend/dist/assets/inter-latin-ext-800-normal-BOMpwxm3.woff +0 -0
  996. package/frontend/dist/assets/inter-latin-ext-800-normal-DZJjya6U.woff2 +0 -0
  997. package/frontend/dist/assets/inter-vietnamese-800-normal-Cm7tD1pz.woff2 +0 -0
  998. package/frontend/dist/assets/inter-vietnamese-800-normal-DDlpr_Ee.woff +0 -0
  999. /package/backend/dist/harness/{adapters → host/adapters}/skills-paths.d.ts +0 -0
  1000. /package/backend/dist/harness/{adapters → host/adapters}/skills-paths.js +0 -0
  1001. /package/backend/dist/harness/{skill-md.d.ts → skill/skill-md.d.ts} +0 -0
  1002. /package/backend/dist/harness/{skill-md.js → skill/skill-md.js} +0 -0
@@ -1,50 +1,6 @@
1
1
  import { RequestCaptureConfig } from '../config/types.js';
2
- /**
3
- * One captured turn — a single JSONL line in the per-session archive file.
4
- * `request` is the PRE-compression snapshot (what the client actually sent);
5
- * `response` is the full upstream payload. Either becomes a plain string with
6
- * `truncated: true` when it exceeds the per-body byte budget (a truncated
7
- * JSON document is no longer valid JSON, so it is stored as a string).
8
- * Request headers are captured in SANITIZED form only: every header name is
9
- * kept, credential-shaped values are replaced with `[REDACTED]` (deny-list:
10
- * `DENY_HEADER_SUBSTRINGS` in `observability/http-exchange.ts`).
11
- *
12
- * `upstreamRequest` is the REAL outbound wire body the provider actually
13
- * sent — translated through the wire (OpenAI / Anthropic / Google / Responses
14
- * / OpenCode-proxy), with `model.upstreamModel` substituted and routing-only
15
- * fields (`router_options`, `stream_options`) stripped. Shape varies by
16
- * wire (see provider adapter payload builders).
17
- *
18
- * `upstreamHttp` is the HTTP-level observation of the SUCCESSFUL outbound
19
- * call (last-write-wins across in-place retries and failover hops): the
20
- * resolved URL, HTTP status, a SAFE subset of response headers
21
- * (retry-after / request-id / content-type / ratelimit trio), TTFB, total
22
- * duration, and the wire kind. Header capture excludes all credential-
23
- * bearing fields.
24
- */
25
- interface UpstreamHttpRecord {
26
- url: string;
27
- method: string;
28
- status: number;
29
- /**
30
- * All response headers from the upstream call — full header names are kept
31
- * so the captured record is a faithful snapshot of the wire. VALUES whose
32
- * name matches the credential deny-list (api-key / authorization / cookie /
33
- * token / secret / password / bearer / signature / credential / x-auth /
34
- * proxy-auth / x-goog-api-key) are replaced with the literal string
35
- * `[REDACTED]` so API keys never reach the disk. The deny-list is case-
36
- * insensitive substring match — see `sanitizeHeadersForCapture` in
37
- * `observability/http-exchange.ts`.
38
- */
39
- responseHeaders?: Record<string, string>;
40
- /** First-byte latency (ms). null when no body byte arrived (pre-body error). */
41
- ttfbMs: number | null;
42
- /** Total round-trip latency (ms) from request fire to fetch resolve. */
43
- durationMs: number;
44
- /** 1-based index of the successful attempt inside the candidate chain. */
45
- attemptIndex: number;
46
- wireKind: 'openai' | 'anthropic' | 'google' | 'responses' | 'opencode-proxy';
47
- }
2
+ import { type HarnessProfile } from '../utils/harness-profiles.js';
3
+ import { type TurnDecision, type TurnIdentity } from './turn-boundary.js';
48
4
  /**
49
5
  * Raw HTTP wire capture: the byte-faithful snapshot of one HTTP exchange.
50
6
  * The shape mirrors a standard HTTP wire dump (RFC 7230 §3): request line,
@@ -73,83 +29,29 @@ export interface RawWireCapture {
73
29
  responseHeaders: Record<string, string>;
74
30
  responseBody: WireBody;
75
31
  }
76
- /**
77
- * @deprecated Use `HttpExchangeEvent` instead. The turn-centric schema
78
- * pre-dates the HTTP exchange event stream; new capture JSONL files
79
- * only write `HttpExchangeEvent`. The fields below remain readable for
80
- * back-compat with already-written archives but the orchestrator no
81
- * longer writes them — every field is best-effort, last-write-wins
82
- * semantics that no longer match how capture actually works.
83
- */
84
- interface CaptureRecord {
85
- id: string;
86
- ts: number;
87
- sessionId: string;
88
- status: 'ok' | 'error';
89
- model: string;
90
- request?: unknown;
91
- /** @deprecated read-only back-compat — see HttpExchangeEvent.wire.requestBody. */
92
- upstreamRequest?: unknown;
93
- /**
94
- * @deprecated read-only back-compat — see HttpExchangeEvent.wire.responseBody
95
- * (one outbound-response event per HTTP exchange).
96
- */
97
- upstreamResponse?: unknown;
98
- /**
99
- * @deprecated read-only back-compat — replaced by the HTTP exchange event
100
- * stream (one outbound-response event with status / headers / body).
101
- */
102
- upstreamHttp?: UpstreamHttpRecord;
103
- /** @deprecated see HttpExchangeEvent.wire. */
104
- upstreamWire?: RawWireCapture;
105
- /** @deprecated see HttpExchangeEvent.wire. */
106
- inboundWire?: RawWireCapture;
107
- /** @deprecated see outbound-failure events with status + body. */
108
- upstreamError?: unknown;
109
- response?: unknown;
110
- error?: string;
111
- routing?: {
112
- tierUsed?: string;
113
- layerUsed?: string;
114
- modelUsed?: string;
115
- provider?: string;
116
- fallbackOccurred?: boolean;
117
- failoverPath?: string[];
118
- };
119
- usage?: unknown;
120
- latencyMs?: number;
121
- truncated?: boolean;
32
+ /** Envelope resolution inputs for one captured request body. */
33
+ interface CapturePromptHints {
34
+ /** Harness vocabulary scoped to the client that sent the bytes. */
35
+ readonly profile?: HarnessProfile;
36
+ /** Self-declared human prompt; authoritative when present. */
37
+ readonly declaredPrompt?: string;
122
38
  }
123
39
  /**
124
- * One HTTP-exchange event in the capture event stream. Replaces the
125
- * turn-centric `CaptureRecord` model: every HTTP exchange now emits TWO
126
- * independent events (request + response) instead of one combined record.
127
- *
128
- * Benefits over the turn model:
129
- * - **Request events persist even when no response arrives** (timeout,
130
- * client cancel, provider unreachable) — the request side is captured
131
- * synchronously before the wire call returns, so failure is recorded.
132
- * - **Request / response timing** becomes a first-class pair. Two events
133
- * with the same `spanId` describe one exchange; their `ts`
134
- * delta IS the request→response latency, computed at read time.
135
- * - **Symmetry across client and upstream legs**: each direction emits
136
- * its own request + response event, all four sharing one
137
- * `traceId` so the full picture joins back together.
40
+ * One capture EVENT — a single JSONL line = one phase (`request` or
41
+ * `response`) of one HTTP exchange. ADR-0024 five-layer ladder:
42
+ * `session ⊃ turn ⊃ request ⊃ exchange ⊃ event`.
138
43
  *
139
- * A single inference turn produces 2-4 events sharing the same
140
- * `traceId`: client-request, gateway-response, upstream-request,
141
- * upstream-response. File layout keeps the per-turn grouping (same
142
- * `sessionId`) so the existing turn-based session browser keeps working
143
- * while the events are now individually retrievable.
44
+ * Every line is self-describing: it names its `requestId` (the request
45
+ * layer), `exchangeId` (the exchange layer), `turnIndex` (the turn layer)
46
+ * and `sessionId` (the session layer). No reader reconstructs a boundary
47
+ * from bodies, prompt text or message counts — all of those are written here.
144
48
  *
145
- * Direction naming follows the gateway's POV:
146
- * - `client` = client ↔ gateway (the request that arrived, the response
147
- * that was sent back to the client)
148
- * - `upstream` = gateway ↔ upstream provider (the request the gateway
149
- * sent upstream, the response that came back)
150
- * This matches OpenTelemetry conventions for proxy/gateway roles.
49
+ * `direction` names the LEG, not a vector: `client` = client ↔ gateway,
50
+ * `upstream` = gateway ↔ provider. A response event carries the same
51
+ * `direction` as its request. There is no `gateway` leg.
151
52
  */
152
- export interface HttpExchangeEvent {
53
+ export declare const CAPTURE_SCHEMA = 2;
54
+ export interface CaptureEvent {
153
55
  id: string;
154
56
  ts: number;
155
57
  /** Always 'http-exchange' for this event type. */
@@ -158,21 +60,60 @@ export interface HttpExchangeEvent {
158
60
  direction: 'client' | 'upstream';
159
61
  /** 'request' = the wire side that's being sent; 'response' = the side that's being received. */
160
62
  phase: 'request' | 'response';
63
+ /** Archive schema version. Every line in a capture archive carries 2. */
64
+ schema: 2;
65
+ /**
66
+ * Provenance of a line that was upgraded by the archive migration chain:
67
+ * the schema it was ORIGINALLY written at (`1` for the unmarked baseline).
68
+ * Absent on lines the writer produced directly — which is exactly what
69
+ * distinguishes a gate-stamped turn identity from one reconstructed during
70
+ * migration. Stamped by the engine, never by a step.
71
+ */
72
+ migratedFrom?: number;
73
+ /**
74
+ * 1-based, monotonic turn ordinal WITHIN this `sessionId`, allocated once
75
+ * at the inbound admission gate and copied onto every event of the request.
76
+ * `null` is a first-class value: a request with no user prompt (standalone
77
+ * decision surface, probe, replay) belongs to no turn. Never derived at
78
+ * read time.
79
+ */
80
+ turnIndex: number | null;
81
+ /** True only on the request that OPENED the turn. */
82
+ isPromptStart: boolean;
83
+ /** Structural provenance for the boundary decision (see turn-boundary.ts). */
84
+ turnDecision: TurnDecision;
85
+ /**
86
+ * 1-based attempt ordinal WITHIN (requestId, leg). One client exchange is
87
+ * always 1; every upstream failover hop / in-place retry increments it.
88
+ * Written at emit time, never inferred at read time.
89
+ */
90
+ attempt: number;
91
+ /**
92
+ * Gateway-minted id of THIS HTTP exchange, shared by the request event AND
93
+ * its matching response event (same direction): one client exchange = one
94
+ * `exchangeId` with two events. Not a W3C span id — the gateway never
95
+ * adopts a caller-supplied exchange identity.
96
+ */
97
+ exchangeId: string;
98
+ /**
99
+ * The CALLER's correlation value (W3C `traceparent` trace-id,
100
+ * `x-request-id`, …), when it sent one. Correlation only: a trace spans
101
+ * many requests, so this value may repeat across events and turns. Absent
102
+ * when the caller sent none — the gateway does not invent one.
103
+ */
104
+ clientRequestId?: string;
161
105
  /**
162
- * Stable per-exchange id (OpenTelemetry spanId) shared by the request
163
- * event AND its matching response event (same direction). E.g. one
164
- * client exchange = one `spanId` with two events (req + resp).
106
+ * Gateway-owned id of the REQUEST these events belong to (ADR-0021) —
107
+ * the request-join key. Every event of one client request carries it;
108
+ * `clientRequestId` above may be shared by several requests.
165
109
  */
166
- spanId: string;
110
+ requestId: string;
167
111
  /**
168
- * Stable trace id (OpenTelemetry traceId) shared across all four
169
- * events of one inference turn (the client-request, client-response,
170
- * upstream-request, upstream-response all share one `traceId`).
171
- * Sourced from the inbound request's `traceparent` / `x-request-id`
172
- * when present, otherwise minted as 32-hex (see resolveTraceId).
112
+ * The upstream provider's OWN id for the call, when its response exposes
113
+ * one (`id` / `x-request-id`). Present only on upstream events.
173
114
  */
174
- traceId: string;
175
- /** Session id from session-manager (or synthetic `ocr-turn-<id>` when no session exists yet). */
115
+ upstreamRequestId?: string;
116
+ /** Gateway session id (session-manager entry, or a synthetic turn id). */
176
117
  sessionId: string;
177
118
  /**
178
119
  * Deterministic conversation key — `sha256(apiKey identity + FULL first
@@ -208,21 +149,29 @@ export interface HttpExchangeEvent {
208
149
  * `name` are persisted — the token value is never stored, consistent with
209
150
  * the credential deny-list in `observability/http-exchange.ts` (the raw
210
151
  * Authorization / x-api-key header values stay `[REDACTED]`).
211
- * Absent (`undefined`) when the leg has no key identity: master-key
212
- * (`adminApiKey`) access, MITM forward-proxy tunnels (CONNECT-authenticated),
213
- * or requests archived before this field existed.
152
+ * Absent (`undefined`) when the leg has no key identity: keyless /v1 calls
153
+ * or MITM forward-proxy tunnels (CONNECT-authenticated), plus requests
154
+ * archived before this field existed.
214
155
  */
215
156
  apiKey?: CaptureKeyIdentity;
216
157
  /**
217
- * Flattened LAST user message of the request (the current turn's prompt),
218
- * capped — stamped on client-request events at write time so metadata-only
219
- * reads (`bodies=none`) can still render the turn prompt in the console
220
- * timeline. Absent on other phases/directions and for bodies without user
221
- * text (tool-result continuations etc.).
158
+ * Display-only flattened last user message of the client-request body,
159
+ * capped. Stamped on client-request events at write time so metadata-only
160
+ * reads (`bodies=none`) can render a prompt. PRESENTATION ONLY: it never
161
+ * decides a turn boundary — `isPromptStart` / `turnDecision` do.
222
162
  */
223
163
  promptSummary?: string;
224
164
  /** Error message if THIS phase errored (e.g. upstream request never got a response). */
225
165
  error?: string;
166
+ /**
167
+ * SSE tag for THIS leg (ADR-0008 §1). On a REQUEST event: the body asked
168
+ * for a streamed answer (client leg: the caller's `stream` flag; upstream
169
+ * leg: the `stream:true` the gateway actually sent). On a CLIENT RESPONSE
170
+ * event: the gateway wrote an SSE body (`beginSse` was used). Absent when
171
+ * the protocol carries no such signal (binary/hex bodies, pre-tag archives)
172
+ * — never guessed from a content-type string.
173
+ */
174
+ stream?: boolean;
226
175
  /**
227
176
  * Redacted proxy origin (`scheme://host:port`) when this upstream call was
228
177
  * routed through a proxy; absent for direct connections. Only meaningful
@@ -233,7 +182,7 @@ export interface HttpExchangeEvent {
233
182
  * Why this exchange happened when it is NOT the turn's ordinary client or
234
183
  * candidate-execution traffic. `l2-decision` marks the HTTP leg the Layer 2
235
184
  * decision layer fires inside a routed turn (upstream direction, attached to the
236
- * outer request's trace/session). Absent = ordinary traffic.
185
+ * outer request's requestId/sessionId). Absent = ordinary traffic.
237
186
  */
238
187
  purpose?: ExchangePurpose;
239
188
  /**
@@ -247,10 +196,14 @@ export interface HttpExchangeEvent {
247
196
  /**
248
197
  * Epoch ms of the FIRST streamed body chunk of this response — stamped at
249
198
  * the wire reader (upstream SSE loop / gateway SSE write) when the first
250
- * chunk crosses. Paired with the event `ts` (response received / finalized)
251
- * it yields the TTFT and the decode window (see CaptureTurnSummary).
252
- * Undefined for buffered single-shot responses and for events recorded
253
- * before the stamp existed.
199
+ * chunk crosses. Undefined for buffered single-shot responses.
200
+ *
201
+ * TIMING CONTRACT (single definition, no second "end" field): `ts` is the
202
+ * moment THIS event was recorded — request events fire before the wire
203
+ * call, response events fire when the response side is fully known
204
+ * (finalized). Therefore `response.ts - request.ts` is the whole exchange
205
+ * duration, `firstByteTs - request.ts` is TTFT and
206
+ * `response.ts - firstByteTs` is the decode window.
254
207
  */
255
208
  firstByteTs?: number;
256
209
  }
@@ -265,50 +218,90 @@ export interface CaptureKeyIdentity {
265
218
  id: string;
266
219
  name: string;
267
220
  }
221
+ /** A leg of one request. There is no `gateway` leg — ADR-0024 §5. */
222
+ export type CaptureExchangeLeg = 'client' | 'upstream' | 'decision';
223
+ /**
224
+ * ONE HTTP exchange = one request event + its response event, paired by
225
+ * `exchangeId`. A request owns 2-N of these (client, upstream, every failover
226
+ * attempt, the Layer-2 decision pair). `attempt` is 1-based within
227
+ * `(requestId, leg)`; no hop is ever overwritten.
228
+ */
229
+ export interface CaptureExchange {
230
+ leg: CaptureExchangeLeg;
231
+ attempt: number;
232
+ exchangeId: string;
233
+ purpose?: ExchangePurpose;
234
+ request?: CaptureEvent;
235
+ response?: CaptureEvent;
236
+ /** response.ts - request.ts (whole exchange duration). */
237
+ latencyMs?: number;
238
+ /** firstByteTs - request.ts; undefined for buffered replies. */
239
+ ttftMs?: number;
240
+ /** response.ts - firstByteTs (decode window). */
241
+ genMs?: number;
242
+ /**
243
+ * SSE tag of the REQUEST side of this exchange: the client's ask (client
244
+ * leg) or the transport the gateway actually sent (upstream leg). Absent on
245
+ * archives written before the tag existed, and on bodies with no flag.
246
+ */
247
+ requestStream?: boolean;
248
+ /**
249
+ * SSE tag of the RESPONSE side (client legs): true iff the gateway wrote an
250
+ * SSE body. Undefined for upstream legs (their transport is the request tag)
251
+ * and for pre-tag archives.
252
+ */
253
+ responseStream?: boolean;
254
+ }
255
+ /** The last exchange of a leg — the one that served the client. */
256
+ export declare function primaryExchange(summary: CaptureRequestSummary, leg: CaptureExchangeLeg): CaptureExchange | undefined;
257
+ /** Convenience projection: one side of the primary exchange of a leg. */
258
+ export declare function exchangeEvent(summary: CaptureRequestSummary, leg: CaptureExchangeLeg, phase: 'request' | 'response'): CaptureEvent | undefined;
268
259
  /**
269
- * One logical inference turn: the four http-exchange events joined by
270
- * `traceId` / `spanId` (see `groupEventsIntoTurns`).
260
+ * One REQUEST: all HTTP exchanges sharing one `requestId`, plus the
261
+ * write-time turn identity copied from its events. Read-plane projection
262
+ * over `exchanges[]` — no turn boundary, prompt or ordinal is derived here.
271
263
  */
272
- export interface CaptureTurnSummary {
273
- traceId: string;
264
+ export interface CaptureRequestSummary {
265
+ /** Gateway request id (ADR-0021) — the join key. */
266
+ requestId: string;
267
+ /** Caller correlation value, carried over from the client-request event. */
268
+ clientRequestId?: string;
274
269
  sessionId: string;
275
270
  model: string;
276
- /** Lifted from the client-request event — see HttpExchangeEvent.promptSummary. */
271
+ /** Write-time turn identity. `null` = this request belongs to no turn. */
272
+ turnIndex: number | null;
273
+ isPromptStart: boolean;
274
+ turnDecision: TurnDecision;
275
+ /** Display-only prompt text, stamped on the sole prompt-start request. */
277
276
  promptSummary?: string;
278
- clientRequest?: HttpExchangeEvent;
279
- gatewayResponse?: HttpExchangeEvent;
280
- upstreamRequest?: HttpExchangeEvent;
281
- upstreamResponse?: HttpExchangeEvent;
282
- /**
283
- * The Layer 2 decision layer's HTTP leg when one fired inside this turn
284
- * (`purpose: 'l2-decision'` upstream events). Kept in SEPARATE slots — never
285
- * merged into the serving upstream pair — so the console can show both
286
- * calls and tell them apart (the decision layer call precedes candidate execution
287
- * and would otherwise be overwritten by the last-write-wins serving leg).
288
- */
289
- decisionRequest?: HttpExchangeEvent;
290
- decisionResponse?: HttpExchangeEvent;
291
- /** Any of the four events with an error field set; "first error wins". */
277
+ /** 1-based REQUEST ordinal inside the read window. The pager's unit. */
278
+ requestNumber?: number;
279
+ /** Every exchange of this request, in wire order. Never last-write-wins. */
280
+ exchanges: CaptureExchange[];
281
+ /** First error across all events ("first error wins"). */
292
282
  error?: string;
293
- /** Decision-leg cycle latency (decision-resp.ts - decision-req.ts). */
294
- decisionLatencyMs?: number;
295
- /** Gateway cycle latency (client-resp.ts - client-req.ts). */
296
- gatewayLatencyMs?: number;
297
- /** Upstream cycle latency (upstream-resp.ts - upstream-req.ts). */
298
- upstreamLatencyMs?: number;
299
- /** TTFT / decode window for the L2 decision leg (same derivation as upstream). */
300
- decisionTtftMs?: number;
301
- decisionGenMs?: number;
302
- /**
303
- * TTFT / decode window, derived from the response event's firstByteTs and
304
- * the matching request event's ts — the industry TTFT/TPS split, measured
305
- * at the wire on EACH leg. Undefined when the leg was not streamed
306
- * (buffered exchange) or the event predates the stamp.
307
- */
308
- gatewayTtftMs?: number;
309
- gatewayGenMs?: number;
310
- upstreamTtftMs?: number;
311
- upstreamGenMs?: number;
283
+ }
284
+ /**
285
+ * One TURN over the WHOLE archive, indexed by the WRITE-TIME `turnIndex`.
286
+ * `firstRequest` / `lastRequest` are 1-based chronological request numbers.
287
+ */
288
+ export interface CaptureTurnIndexEntry {
289
+ /** The immutable write-time turn ordinal inside its session. */
290
+ turnIndex: number;
291
+ /** New user message that opened the turn. */
292
+ prompt?: string;
293
+ /** Request send time (epoch ms) of the turn's first request. */
294
+ startTs?: number;
295
+ /** Requests in this turn (prompt request + tool-loop hops). */
296
+ requests: number;
297
+ firstRequest: number;
298
+ lastRequest: number;
299
+ }
300
+ /** Exact whole-archive totals + the write-time turn index (metadata only). */
301
+ export interface CaptureArchiveSummary {
302
+ requests: number;
303
+ fragments: number;
304
+ turns: CaptureTurnIndexEntry[];
312
305
  }
313
306
  interface CaptureDateRow {
314
307
  date: string;
@@ -321,13 +314,13 @@ interface CaptureDateRow {
321
314
  * as the quiet neutral default) — legacy archives without request lines
322
315
  * (or unrecognized paths) stay undefined = unbadged.
323
316
  */
324
- export type CaptureSessionProtocol = 'chat' | 'anthropic' | 'responses' | 'systemone';
317
+ export type CaptureSessionProtocol = 'openai-chat' | 'anthropic-messages' | 'openai-responses' | 'systemone';
325
318
  interface CaptureSessionRow {
326
319
  file: string;
327
320
  sessionId: string;
328
321
  bytes: number;
329
322
  mtimeMs: number;
330
- turns: number;
323
+ requests: number;
331
324
  failed: number;
332
325
  lastStatus?: 'ok' | 'error';
333
326
  /** First user-message text of the session (single line, capped) so the console list is human-identifiable. */
@@ -351,7 +344,7 @@ interface CaptureSessionRow {
351
344
  /**
352
345
  * Inbound protocol discriminator, derived at list time from the FIRST
353
346
  * client-request event's request line (`POST /v1/messages HTTP/1.1` →
354
- * 'anthropic'). Every recognized surface is labeled explicitly — chat
347
+ * 'anthropic-messages'). Every recognized surface is labeled explicitly — chat
355
348
  * included. Undefined = a legacy archive without request lines or an
356
349
  * unrecognized path — the console renders absence as unbadged.
357
350
  */
@@ -360,7 +353,7 @@ interface CaptureSessionRow {
360
353
  /**
361
354
  * One archive-file hit for a session id, located by NAME across all date
362
355
  * directories. Coordinates only (enough to read/delete the archive) — row
363
- * metadata (turns/preview/apiKey) comes from listSessions, never from a
356
+ * metadata (requests/preview/apiKey) comes from listSessions, never from a
364
357
  * name-only find.
365
358
  */
366
359
  interface CaptureSessionMatch {
@@ -375,6 +368,7 @@ interface CaptureStatus {
375
368
  maxBodyBytes: number;
376
369
  maxSessionMB: number;
377
370
  storeMedia: boolean;
371
+ redactSecrets: boolean;
378
372
  totalBytes: number;
379
373
  dateCount: number;
380
374
  }
@@ -397,8 +391,11 @@ export declare class CaptureRecorder {
397
391
  private maxBodyBytes;
398
392
  private maxSessionBytes;
399
393
  private storeMedia;
394
+ private redactSecrets;
400
395
  private fileBytesCache;
401
396
  private sealedFiles;
397
+ /** Whole-archive request/round summaries keyed by file stat signature. */
398
+ private summaryCache;
402
399
  private rootDir;
403
400
  private sweepTimer?;
404
401
  constructor(config?: RequestCaptureConfig);
@@ -417,26 +414,16 @@ export declare class CaptureRecorder {
417
414
  private startSweepTimer;
418
415
  private stopSweepTimer;
419
416
  /**
420
- * @deprecated Use `recordEvent()` instead. The turn-centric `CaptureRecord`
421
- * model has been superseded by `HttpExchangeEvent` (one event per HTTP
422
- * side, request and response are independent). `record()` is kept only
423
- * for back-compat with already-written archive files; the orchestrator
424
- * no longer calls it. New code MUST use `recordEvent()`.
425
- */
426
- record(entry: Omit<CaptureRecord, 'id' | 'ts'>): Promise<void>;
427
- /**
428
- * Append one HTTP-exchange event to the event stream. Each HTTP exchange
429
- * emits TWO events (one request, one response) sharing the same
430
- * `spanId`. One inference turn typically produces 2-4 events
431
- * sharing the same `traceId`. Synchronous callers (handler scope,
432
- * provider scope) can fire this the moment the wire side is known —
433
- * there is no longer a "wait for the response" barrier before the
434
- * request side is recorded.
435
- *
436
- * Same fail-open contract as `record()`: a capture failure must never
437
- * break the inference hot path.
417
+ * `schema`, `turnIndex`, `isPromptStart`, `turnDecision` and `attempt` are
418
+ * stamped HERE — the single write point — so every archive line is fully
419
+ * self-describing. Production emitters pass an explicit `TurnIdentity`
420
+ * allocated at the admission gate; emitters that have none (standalone
421
+ * surfaces, tests) get `NO_TURN`, the first-class "no prompt" value.
422
+ * Readers never fill these in.
438
423
  */
439
- recordEvent(event: Omit<HttpExchangeEvent, 'id' | 'ts'>): Promise<void>;
424
+ recordEvent(event: Omit<CaptureEvent, 'id' | 'ts' | 'schema' | 'attempt' | keyof TurnIdentity> & Partial<TurnIdentity> & {
425
+ attempt?: number;
426
+ }): Promise<void>;
440
427
  /**
441
428
  * Effective tail-read window: 3× the per-body cap (worst case a few turns
442
429
  * per window line set), floored at the historical 8 MB and ceilinged at
@@ -466,50 +453,83 @@ export declare class CaptureRecorder {
466
453
  * name substring — the console's per-application retrieval. */
467
454
  listSessions(date: string, apiKeyFilter?: string): CaptureSessionRow[];
468
455
  /**
469
- * Read records from one archive file, newest `limit` records in
470
- * chronological order. Reads at most the last readWindowBytes() of the file.
456
+ * Read the raw JSONL objects from the tail of one archive, newest `limit`
457
+ * lines in file order. No schema interpretation: archive-overflow seal
458
+ * markers are metadata and are filtered out, everything else is returned
459
+ * verbatim. Used by the generic console record view and the raw exporter.
471
460
  */
472
461
  readRecords(date: string, file: string, limit?: number): {
473
- records: CaptureRecord[];
462
+ records: Record<string, unknown>[];
474
463
  totalLines: number;
475
464
  fileTruncated: boolean;
476
465
  };
477
466
  /**
478
- * Read the last `readWindowBytes()` of one archive and parse its
479
- * http-exchange events. Async and yield-paced: the window can be tens of
480
- * MB and per-line JSON.parse is CPU-bound — parsing in batches with
481
- * event-loop yields keeps the gateway responsive while an archive read is
482
- * in flight. Never fails: corrupt lines are skipped.
467
+ * Read the last `bytes` of one archive and parse its http-exchange events.
468
+ * Async and yield-paced: the window can be tens of MB and per-line
469
+ * JSON.parse is CPU-bound — parsing in batches with event-loop yields keeps
470
+ * the gateway responsive while an archive read is in flight. Never fails:
471
+ * corrupt lines are skipped.
472
+ *
473
+ * `minBytes` lets a caller ask for a window LARGER than the default one —
474
+ * the console's backward pager grows the window until the page it wants is
475
+ * covered (see readEvents), so a session whose bodies blow past the default
476
+ * window is still fully browsable instead of silently ending at its tail.
483
477
  */
484
478
  private readWindowEvents;
485
479
  /**
486
- * Read HTTP exchange events from one archive file, newest `limit` events
487
- * in chronological order. Returns events + a `turns` summary that
488
- * groups the events by `traceId` (spanId-aware) so the console can
489
- * render them as logical turns. The underlying file is also bounded at
490
- * readWindowBytes() (pathologically large archives are tailed; the tail is
491
- * what matters). `bodies='none'` strips wire bodies for metadata-first
492
- * console reads — the tok/s chips keep working via the derived
493
- * `completionTokens` field, and full bodies come back on demand
494
- * (readTurn / bodies='full').
495
- */
496
- readEvents(date: string, file: string, limit?: number, bodies?: 'full' | 'none'): Promise<{
497
- events: HttpExchangeEvent[];
498
- turns: CaptureTurnSummary[];
480
+ * Archive-line boundary validation — schema-2 only. A line is accepted
481
+ * only when it is a COMPLETE schema-2 http-exchange event: every scope
482
+ * field written by the admission gate must be present, including the
483
+ * first-class `turnIndex: null` for prompt-less requests. There is no
484
+ * legacy vocabulary, no field mapping and no derived fallback: a line is
485
+ * read in the shape the writer produced or not at all. A schema-1 archive
486
+ * is never read here — the migrator chain (`capture/migrate/`) rewrites it
487
+ * in place at boot, and it does so for EVERY line it can parse.
488
+ */
489
+ private static parseArchivedEvent;
490
+ /**
491
+ * Read the schema-2 events in one archive's tail window and project them
492
+ * into REQUESTS. Paging is in requests (the pager's unit): page 1 is the
493
+ * newest `limit` requests, and every exchange of a request always travels
494
+ * with it. `bodies='none'` strips wire bodies for metadata-first reads;
495
+ * `bodies='chat'` keeps only a prompt-start request's body plus responses.
496
+ *
497
+ * The read window GROWS to cover the requested page: a large body per
498
+ * request means a few requests can fill the default window. Growth doubles
499
+ * until the page fits, the whole file is read, or the growth ceiling is
500
+ * reached — past that the response clamps `page`/`totalPages`.
501
+ *
502
+ * `totalTurns` counts DISTINCT write-time `turnIndex` values in the window;
503
+ * it is not an ordinal and not a request count. Nothing here derives a turn
504
+ * boundary: the archive already carries `turnIndex`/`isPromptStart`.
505
+ */
506
+ readEvents(date: string, file: string, limit?: number, bodies?: 'full' | 'none' | 'chat', page?: number): Promise<{
507
+ events: CaptureEvent[];
508
+ requests: CaptureRequestSummary[];
499
509
  totalLines: number;
500
- /** Logical turn count over ALL events in the read window (totalLines is
501
- * raw event lines — 2-4 per turn — so it must never be shown as turns). */
510
+ /** Requests in the read window (the pager's exact denominator). */
511
+ totalRequests: number;
512
+ /** Distinct write-time turn ordinals in the read window. */
502
513
  totalTurns: number;
514
+ /** The window is the WHOLE file (false = only its tail was read). */
515
+ windowComplete: boolean;
503
516
  fileTruncated: boolean;
517
+ /** The page actually served (clamped into [1, totalPages]). */
518
+ page: number;
519
+ /** Pages available in the read window (request pages). */
520
+ totalPages: number;
521
+ hasOlder: boolean;
522
+ hasNewer: boolean;
504
523
  }>;
505
524
  /**
506
- * Read one turn's FULL wire bodies by the id of any of its events (the
507
- * console passes the client-request event id). The metadata-first console
508
- * flow fetches the heavy bodies here when a turn is opened. Returns null
509
- * when the id is unknown or falls outside the read window.
525
+ * Read one REQUEST's full wire bodies. The key is its `requestId` (what the
526
+ * console row and every React key carries); any of its event ids is accepted
527
+ * too for deep links. Returns null when the key is unknown or fell outside
528
+ * the read window. No re-derivation: the returned summary is the archive's
529
+ * own write-time identity over its `exchanges[]`.
510
530
  */
511
- readTurn(date: string, file: string, eventId: string): Promise<{
512
- turn: CaptureTurnSummary;
531
+ readRequest(date: string, file: string, requestOrEventId: string): Promise<{
532
+ request: CaptureRequestSummary;
513
533
  } | null>;
514
534
  private convKeyCache;
515
535
  private static CONVKEY_HEAD_BYTES;
@@ -535,37 +555,88 @@ export declare class CaptureRecorder {
535
555
  * its request and response events landed in different date files.
536
556
  * Fragment turn counts are per-file (the archive's physical layout), while
537
557
  * `turns`/`totalTurns` cover the WHOLE conversation.
538
- */
539
- readEventsStitched(date: string, file: string, limit?: number, bodies?: 'full' | 'none'): Promise<{
540
- events: HttpExchangeEvent[];
541
- turns: CaptureTurnSummary[];
558
+ *
559
+ * `page` pages backwards exactly like the non-stitched read, over the
560
+ * MERGED conversation timeline (a page can therefore mix shards). Paging
561
+ * stays window-bounded: each fragment is read through its own tail window,
562
+ * so history older than every window is export-only.
563
+ */
564
+ readEventsStitched(date: string, file: string, limit?: number, bodies?: 'full' | 'none' | 'chat', page?: number): Promise<{
565
+ events: CaptureEvent[];
566
+ requests: CaptureRequestSummary[];
542
567
  totalLines: number;
568
+ totalRequests: number;
543
569
  totalTurns: number;
570
+ windowComplete: boolean;
544
571
  fileTruncated: boolean;
545
572
  fragments: {
546
573
  date: string;
547
574
  file: string;
548
- turns: number;
575
+ requests: number;
549
576
  }[];
577
+ page: number;
578
+ totalPages: number;
579
+ hasOlder: boolean;
580
+ hasNewer: boolean;
550
581
  }>;
551
582
  /**
552
- * readTurn across ALL fragments of the session: the anchor fragment's
553
- * window is tried first, then every other fragment — a turn archived in a
554
- * previous day's shard must still open its full wire bodies.
583
+ * Resolve one request's full wire bodies across ALL fragments of the
584
+ * session: a request archived in a previous day's shard must still open.
555
585
  */
556
- readTurnStitched(date: string, file: string, eventId: string): Promise<{
557
- turn: CaptureTurnSummary;
586
+ readRequestStitched(date: string, file: string, requestOrEventId: string): Promise<{
587
+ request: CaptureRequestSummary;
558
588
  } | null>;
559
589
  /**
560
- * Group a flat list of HTTP exchange events into logical turns via
561
- * `traceId`. Each turn joins its four events: client-direction events
562
- * pair by `spanId`, upstream events attach to the trace's active turn
563
- * (last-write-wins across failover hops). SpanId-aware because a client
564
- * that sends a CONSTANT `x-request-id` on every request would otherwise
565
- * collapse the whole session into one turn.
590
+ * EXACT whole-archive summary, not the read window: the request count and
591
+ * the WRITE-TIME TURN INDEX (turnIndex + contiguous request range).
592
+ *
593
+ * Every request starts with exactly one client-request event, so counting
594
+ * those lines counts requests without grouping. A client request carrying
595
+ * `turnIndex: null` belongs to no turn and is counted as a request only.
596
+ * The terminal `archive-overflow` seal line is metadata and is skipped.
597
+ *
598
+ * Streamed in chunks so a seal-maximum session (512 MB) never becomes one
599
+ * string on the heap. Targeted regexes pull only the metadata — never
600
+ * JSON.parse on the whole line, whose request body can be many MB. Turn
601
+ * membership is read from the archive, never inferred from prompts,
602
+ * message counts or resend heuristics.
603
+ *
604
+ * The result is DISPLAY ONLY: pagination still reads a bounded window.
605
+ */
606
+ captureSummary(date: string, file: string): Promise<CaptureArchiveSummary>;
607
+ /**
608
+ * Whole STITCHED conversation: fragments in chronological order. One
609
+ * client-request line lives in exactly one shard, so a request is counted
610
+ * once; `byKey` carries the same (sessionId, turnIndex) across shards.
611
+ */
612
+ captureSummaryStitched(date: string, file: string): Promise<CaptureArchiveSummary>;
613
+ /** mtime+size signature — any append invalidates; a read-only archive hits. */
614
+ private archiveSignature;
615
+ /** Bounded LRU-ish cache: drop the oldest entry past 8 summaries. */
616
+ private rememberSummary;
617
+ /**
618
+ * One streamed metadata pass; appends to `state` so shards chain.
619
+ * Byte-level: several event lines can share a multi-MB request body, so
620
+ * the stream stays a Buffer and only a matching client-request line is
621
+ * decoded. Only schema-2 lines are considered.
622
+ */
623
+ private scanRequestIndex;
624
+ /**
625
+ * Group a flat list of capture events into REQUESTS by the gateway-owned
626
+ * `requestId`. Each request owns an `exchanges[]` list bucketed by
627
+ * `(leg, attempt)`, so EVERY failover hop and the Layer-2 decision pair
628
+ * survive — nothing is last-write-wins.
629
+ *
630
+ * No turn boundary, prompt, message count or ordinal is derived here:
631
+ * `turnIndex` / `isPromptStart` / `turnDecision` are copied from the
632
+ * write-time fields on the events, and `attempt` was stamped at emit time.
566
633
  * Pure function — exported for unit tests.
567
634
  */
568
- static groupEventsIntoTurns(events: HttpExchangeEvent[]): CaptureTurnSummary[];
635
+ static groupEventsIntoRequests(events: CaptureEvent[]): CaptureRequestSummary[];
636
+ /** Number requests 1..N inside the read window (the pager's unit). */
637
+ private static numberRequests;
638
+ /** Events belonging to a request (used for body stripping + page slicing). */
639
+ private static requestEvents;
569
640
  /**
570
641
  * Read the raw JSONL archive verbatim (for export/download). Unlike
571
642
  * readRecords this is NOT capped at the read window — exports should be
@@ -575,16 +646,10 @@ export declare class CaptureRecorder {
575
646
  * route. Accepted for an operator-initiated export; upgrade path is a
576
647
  * streaming download (createReadStream piped to the reply).
577
648
  *
578
- * When `exclude` is non-empty, body fields are stripped and the rest is
579
- * re-serialized — metadata (ts/status/model/routing/ids) always survives.
580
- * Handles both line formats:
581
- * - legacy cap_ turn records: `request` / `upstreamRequest` / `response`
582
- * / `upstreamError` fields are deleted directly.
583
- * - evt_ http-exchange events: the same exclude names map onto the
584
- * matching wire side (`request` → client request body,
585
- * `upstreamRequest`/`upstreamHttp` → upstream request body,
586
- * `response`/`upstreamError` → response bodies + the error field).
587
- * Corrupt lines are kept verbatim, same fail-open policy as every read.
649
+ * When `exclude` is non-empty, the matching wire-side bodies of a schema-2
650
+ * http-exchange event are blanked and the rest of the line is re-serialized;
651
+ * metadata (ids / ts / status / model / routing / turn identity) always
652
+ * survives. Seal markers and unparseable lines pass through verbatim.
588
653
  */
589
654
  readRawArchive(date: string, file: string, exclude?: string[]): string | null;
590
655
  /**
@@ -619,6 +684,32 @@ export declare class CaptureRecorder {
619
684
  * traversal) and existence, so this cannot escape the date dir.
620
685
  */
621
686
  deleteSession(date: string, file: string): boolean;
687
+ /**
688
+ * Archive schema-transition pass (ADR-0008 section 5).
689
+ *
690
+ * COLD files are walked hop by hop through the steps registered in
691
+ * `migrate/registry.ts`, resolved by `(from, to)`. That is how an upgrading
692
+ * installation keeps its history: schema-1 lines become schema-2 lines IN
693
+ * PLACE, and every line the pass can read comes out readable — a legacy
694
+ * span sequence that does not close cleanly is repaired into the nearest
695
+ * truth-bearing shape by the step itself, never set aside.
696
+ *
697
+ * Whole-file discipline: a file is rewritten atomically or left exactly as
698
+ * it was. A line that is not parseable JSON is carried over byte-for-byte
699
+ * (and counted in `unreadable`) instead of costing the file its other
700
+ * thousand good rows.
701
+ *
702
+ * Runs at boot, on hot-apply enable and on the hourly sweep; fail-open per
703
+ * file. Rewritten files invalidate the size/seal/summary caches.
704
+ *
705
+ * `hotMs` is the quiet window a file must sit in before it is touched.
706
+ * Boot and hot-enable pass 0 (`BOOT_MIGRATION_HOT_MS`) so an upgraded
707
+ * installation shows its history at once — safety there comes from the
708
+ * re-check before each swap, not from waiting. The hourly sweep passes
709
+ * `undefined` and keeps the default window, because by then this process is
710
+ * appending and a shard written minutes ago is simply retried next hour.
711
+ */
712
+ migrateArchives(hotMs?: number): Promise<void>;
622
713
  /**
623
714
  * Sweep retention: delete date directories older than the retention window,
624
715
  * then — if the archive still exceeds maxTotalBytes — delete oldest dates
@@ -626,7 +717,6 @@ export declare class CaptureRecorder {
626
717
  * O(records).
627
718
  */
628
719
  sweep(): void;
629
- private truncateField;
630
720
  /**
631
721
  * Replace base64 media payloads in a JSON request body with `[MEDIA …]`
632
722
  * placeholders and offload the bytes to content-addressed files under
@@ -689,16 +779,45 @@ export declare class CaptureRecorder {
689
779
  * text-part array), Responses API (`input`), and the truncated-string
690
780
  * form stored when a body exceeded maxBodyBytes. Fails open to undefined.
691
781
  */
692
- static extractSessionPreview(request: unknown, cap?: number): string | undefined;
782
+ static extractSessionPreview(request: unknown, cap?: number, hints?: CapturePromptHints): string | undefined;
693
783
  /**
694
- * The LAST user message of a request body, flattened and capped — the
695
- * current turn's prompt (history replay carries the full conversation;
696
- * the tail is the fresh turn). Stamped onto client-request events at
697
- * write time so metadata-only reads (`bodies=none`) can still render the
698
- * turn prompt in the timeline. Same disclosure class as the session
699
- * preview. Undefined when the body carries no user text.
784
+ * Envelope resolution inputs for a captured request, resolved from the
785
+ * ARCHIVED headers — the read plane has no live request, so a replayed
786
+ * session must resolve exactly the vocabulary (and the self-declared prompt)
787
+ * its live turn saw. Cased lookup because archives preserve the client's own
788
+ * header spelling.
700
789
  */
701
- static extractTurnPrompt(request: unknown, cap?: number): string | undefined;
790
+ private static hintsOfHeaders;
791
+ /** Cap a one-line display text with an ellipsis. */
792
+ private static clipDisplay;
793
+ /**
794
+ * The LAST user message of a request body, flattened and capped. Same
795
+ * disclosure class as the session preview. Undefined when the body carries
796
+ * no user text.
797
+ *
798
+ * NOT stamped verbatim: a body's last user message is only THIS turn's
799
+ * question when the client appended it — agent loops resend the whole
800
+ * history, so a tool-result continuation still ends its user list with the
801
+ * previous turn's prompt. `turnPromptStamp` adds the positions the read
802
+ * plane needs to tell those apart.
803
+ */
804
+ static extractTurnPrompt(request: unknown, cap?: number, hints?: CapturePromptHints): string | undefined;
805
+ /**
806
+ * Display-only last user message of a client-request body. Written ONLY on
807
+ * the request that opened the turn (`isPromptStart`); the turn boundary is
808
+ * decided structurally at the admission gate, never from this text.
809
+ *
810
+ * `hints` scopes the harness vocabulary to the client that sent the bytes
811
+ * (the writer reads it off the live wire's UA); omitted, only the global
812
+ * vocabulary plus the structural rules apply.
813
+ */
814
+ static turnPromptStamp(request: unknown, cap?: number, hints?: CapturePromptHints): string | undefined;
815
+ /** Display form of a prompt: newlines flattened, empty bundle text dropped
816
+ * (a metadata-only turn keeps NO prompt — the timeline renders the
817
+ * empty-prompt glyph instead of quoting the client's context bundle as
818
+ * this turn's question), capped with an ellipsis. A declared prompt
819
+ * (envelope layer 0) is adopted verbatim. */
820
+ private static summarizePromptText;
702
821
  /**
703
822
  * System One decision requests evaluate `state` — plain text or a
704
823
  * structured object/array (no `messages`/`input`, which is why the chat
@@ -716,8 +835,24 @@ export declare class CaptureRecorder {
716
835
  * req-less lines (empty requestLine) return undefined.
717
836
  */
718
837
  static protocolFromRequestLine(requestLine: unknown): CaptureSessionProtocol | undefined;
719
- private static lastUserText;
720
- private static firstUserText;
838
+ /**
839
+ * The flattened text of a request body's LAST user slot. Display only:
840
+ * `promptSummary` never decides a turn boundary. Bodies that are not a
841
+ * message array still answers text where a surface has an obvious text
842
+ * channel (plain-string `input`, System One `state`); unparseable bodies
843
+ * answer none and render the empty-prompt glyph.
844
+ */
845
+ private static lastUserSlot;
846
+ /**
847
+ * The FIRST user message that carries HUMAN text — the client-envelope
848
+ * normalizer's rules, not the first user-role message. Cursor's agent opens
849
+ * with a standalone `<user_info>`/`<rules>`/`<mcp_server_catalog>` bundle and
850
+ * puts the real prompt in the NEXT `<user_query>` message, so taking the
851
+ * first user role verbatim titled capture sessions with an OS banner. Same
852
+ * strict-then-permissive rule as the console session title
853
+ * (`firstDisplayText`), so every surface names a conversation identically.
854
+ */
855
+ private static firstHumanUserText;
721
856
  /**
722
857
  * Best-effort recovery of the largest well-formed prefix of a truncated
723
858
  * JSON document: walk once tracking string state and the brace stack,
@@ -729,8 +864,23 @@ export declare class CaptureRecorder {
729
864
  * be salvaged.
730
865
  */
731
866
  private static repairTruncatedJson;
732
- /** First role === 'user' entry; content as string or text-part array. */
733
- private static userTextFromMessages;
867
+ /**
868
+ * Text of one message's content (string, or joined text parts). Undefined
869
+ * for non-text content — the callers treat that differently on purpose.
870
+ */
871
+ private static messageText;
872
+ /**
873
+ * The last user message of a message array, flattened to display text.
874
+ * Pure presentation: turn boundaries are decided structurally by
875
+ * `classifyTurnBoundary`, never by this text or its position.
876
+ */
877
+ private static lastUserSlotInMessages;
878
+ /**
879
+ * The FIRST user message that carries HUMAN text (client envelopes stripped)
880
+ * — the capture session preview's opening prompt. Walks forward and skips
881
+ * metadata-only / image-only messages, exactly like the console title.
882
+ */
883
+ private static firstHumanText;
734
884
  /** Local-timezone YYYY-MM-DD — retention is by calendar day as users see it. */
735
885
  static localDateDir(d: Date): string;
736
886
  }