@tonyclaw/agent-inspector 3.0.45 → 3.0.47

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 (343) hide show
  1. package/.output/{nitro.json → backend/nitro.json} +3 -3
  2. package/.output/backend-public/assets/index-D4LX-sw-.js +11 -0
  3. package/.output/cli.js +8018 -5451
  4. package/.output/server/_libs/extend.mjs +4 -8
  5. package/.output/server/_libs/jszip.mjs +9 -35
  6. package/.output/server/_libs/react-dom.mjs +2 -3
  7. package/.output/server/_libs/react.mjs +1 -27
  8. package/.output/server/_libs/tanstack__react-router.mjs +1 -329
  9. package/.output/server/_libs/tanstack__router-core.mjs +42 -100
  10. package/.output/server/_libs/use-sync-external-store.mjs +1 -64
  11. package/.output/server/_libs/ws.mjs +1 -1
  12. package/.output/server/_ssr/index.mjs +4 -4
  13. package/.output/server/_ssr/{publicBasePathContext-5264L3rX.mjs → publicBasePathContext-IH2ilOfu.mjs} +52 -24
  14. package/.output/server/_ssr/{router-BJ_ltLim.mjs → router-BwZEsYfS.mjs} +19794 -19444
  15. package/.output/server/_ssr/{start-C6MjPjxp.mjs → start-COQu_AgD.mjs} +1 -1
  16. package/.output/server/_tanstack-start-manifest_v-DnbdNeun.mjs +4 -0
  17. package/.output/server/index.mjs +5 -145
  18. package/.output/{public/assets/CompareDrawer-B3_TLTJh.js → ui/assets/CompareDrawer-V-8lPASC.js} +1 -1
  19. package/.output/{public/assets/InspectorPet-Cpn6hv4P.js → ui/assets/InspectorPet-D4CVnfdf.js} +1 -1
  20. package/.output/ui/assets/ProxyViewerContainer-CO3ZVHLX.js +59 -0
  21. package/.output/{public/assets/ReplayDialog-B3EKVdJk.js → ui/assets/ReplayDialog-CpGyTLtt.js} +1 -1
  22. package/.output/{public/assets/RequestAnatomy-COOQjyUC.js → ui/assets/RequestAnatomy-BLuJL9dZ.js} +1 -1
  23. package/.output/ui/assets/ResponseView-BuSC-CH7.js +2 -0
  24. package/.output/ui/assets/StreamingChunkSequence-DeA-JJKa.js +1 -0
  25. package/.output/{public/assets/_sessionId-zbgYl7ZJ.js → ui/assets/_sessionId-8HuHFhjo.js} +1 -1
  26. package/.output/{public/assets/_sessionId-BJlM3nmt.js → ui/assets/_sessionId-Chp67th6.js} +1 -1
  27. package/.output/ui/assets/favicon-DYEkHSNl.svg +21 -0
  28. package/.output/ui/assets/index-BvXp42al.css +1 -0
  29. package/.output/{public/assets/index-xF_NY8Yb.js → ui/assets/index-DPmKK_5d.js} +5 -5
  30. package/.output/{public/assets/index-BIK4bPTv.js → ui/assets/index-atoQrlb8.js} +1 -1
  31. package/.output/ui/assets/index-nY3E1vxV.js +73 -0
  32. package/.output/{public/assets/index-D2Qw6Ri2.js → ui/assets/index-nl9-dpZn.js} +1 -1
  33. package/.output/ui/assets/json-viewer-B9kIzqeX.js +1 -0
  34. package/.output/{public/assets/jszip.min-B_rfAUCe.js → ui/assets/jszip.min-B7tfyE-I.js} +1 -1
  35. package/.output/ui/index.html +229 -0
  36. package/.output/ui/runtime-config.js +2 -0
  37. package/.output/workers/logFinalizer.worker.js +979 -414
  38. package/.output/workers/sessionWorkerEntry.js +979 -414
  39. package/README.md +182 -43
  40. package/docs/instance-control.openapi.yaml +59 -4
  41. package/package.json +40 -6
  42. package/scripts/generate-theme-scales.mjs +3 -3
  43. package/src/{router.tsx → backend/router.tsx} +3 -15
  44. package/src/backend/routes/$.ts +26 -0
  45. package/src/backend/routes/__root.ts +4 -0
  46. package/src/backend/routes/api/-instances.ts +7 -0
  47. package/src/{routes → backend/routes}/api/alerts.summary.ts +3 -3
  48. package/src/{routes → backend/routes}/api/alerts.ts +4 -4
  49. package/src/{routes → backend/routes}/api/config.paths.ts +1 -1
  50. package/src/{routes → backend/routes}/api/config.ts +11 -2
  51. package/src/{routes → backend/routes}/api/ecosystem.packages.$packageId.help.ts +1 -1
  52. package/src/{routes → backend/routes}/api/ecosystem.packages.$packageId.install.ts +1 -1
  53. package/src/{routes → backend/routes}/api/ecosystem.packages.$packageId.runner-presets.ts +1 -1
  54. package/src/{routes → backend/routes}/api/ecosystem.packages.$packageId.upgrade.ts +1 -1
  55. package/src/{routes → backend/routes}/api/ecosystem.packages.ts +5 -1
  56. package/src/{routes → backend/routes}/api/ecosystem.recipes.$recipeId.run.ts +1 -1
  57. package/src/{routes → backend/routes}/api/ecosystem.tasks.$taskId.ts +1 -1
  58. package/src/{routes → backend/routes}/api/ecosystem.tasks.ts +1 -1
  59. package/src/{routes → backend/routes}/api/groups.$groupId.evidence.ts +2 -2
  60. package/src/{routes → backend/routes}/api/groups.$groupId.sessions.ts +2 -2
  61. package/src/{routes → backend/routes}/api/groups.$groupId.ts +2 -2
  62. package/src/{routes → backend/routes}/api/groups.ts +2 -2
  63. package/src/{routes → backend/routes}/api/health.ts +3 -3
  64. package/src/{routes → backend/routes}/api/instances.$name.connection.ts +1 -1
  65. package/src/{routes → backend/routes}/api/instances.$name.restart.ts +2 -2
  66. package/src/{routes → backend/routes}/api/instances.$name.start.ts +2 -2
  67. package/src/{routes → backend/routes}/api/instances.$name.stop.ts +2 -2
  68. package/src/{routes → backend/routes}/api/instances.$name.ts +1 -1
  69. package/src/{routes → backend/routes}/api/instances.ts +1 -1
  70. package/src/{routes → backend/routes}/api/knowledge.candidates.$candidateId.promote.ts +2 -2
  71. package/src/{routes → backend/routes}/api/knowledge.candidates.$candidateId.ts +2 -2
  72. package/src/{routes → backend/routes}/api/knowledge.candidates.ts +1 -1
  73. package/src/{routes → backend/routes}/api/knowledge.project-context.ts +2 -2
  74. package/src/{routes → backend/routes}/api/knowledge.search.ts +2 -2
  75. package/src/{routes → backend/routes}/api/knowledge.sessions.$sessionId.candidates.ts +3 -3
  76. package/src/{routes → backend/routes}/api/logs.$id.body.ts +6 -6
  77. package/src/{routes → backend/routes}/api/logs.$id.chunks.ts +5 -4
  78. package/src/{routes → backend/routes}/api/logs.$id.replay.ts +12 -11
  79. package/src/{routes → backend/routes}/api/logs.$id.ts +4 -3
  80. package/src/{routes → backend/routes}/api/logs.import.ts +3 -3
  81. package/src/{routes → backend/routes}/api/logs.stream.ts +11 -7
  82. package/src/{routes → backend/routes}/api/logs.ts +17 -9
  83. package/src/{routes → backend/routes}/api/mcp.ts +1 -1
  84. package/src/{routes → backend/routes}/api/models.ts +1 -1
  85. package/src/{routes → backend/routes}/api/pi-agent.ts +2 -2
  86. package/src/{routes → backend/routes}/api/providers.$providerId.model-metadata.ts +5 -5
  87. package/src/{routes → backend/routes}/api/providers.$providerId.test.log.ts +7 -7
  88. package/src/{routes → backend/routes}/api/providers.$providerId.ts +4 -4
  89. package/src/{routes → backend/routes}/api/providers.export.ts +1 -1
  90. package/src/{routes → backend/routes}/api/providers.import.ts +3 -3
  91. package/src/{routes → backend/routes}/api/providers.scan.ts +2 -2
  92. package/src/{routes → backend/routes}/api/providers.ts +9 -4
  93. package/src/{routes → backend/routes}/api/runs.$runId.evidence.ts +2 -2
  94. package/src/{routes → backend/routes}/api/runs.$runId.ts +2 -2
  95. package/src/{routes → backend/routes}/api/runs.ts +4 -4
  96. package/src/backend/routes/api/runtime.ts +46 -0
  97. package/src/{routes → backend/routes}/api/sessions.ts +3 -3
  98. package/src/{routes → backend/routes}/proxy/$.ts +1 -1
  99. package/src/{routes → backend/routes}/readyz.ts +1 -1
  100. package/src/{start.ts → backend/start.ts} +1 -1
  101. package/src/cli/alias.ts +2 -11
  102. package/src/cli/doctor.ts +32 -9
  103. package/src/cli/instance.ts +36 -13
  104. package/src/cli/instanceApi.ts +213 -0
  105. package/src/cli/instanceArgs.ts +46 -11
  106. package/src/cli/instanceControl.ts +10 -2
  107. package/src/cli/instanceModel.ts +18 -17
  108. package/src/cli/instanceRegistry.ts +0 -9
  109. package/src/cli/networkHints.ts +27 -14
  110. package/src/cli/onboard.ts +69 -2
  111. package/src/cli/onboardTarget.ts +89 -40
  112. package/src/cli/rustBackendPackage.ts +450 -0
  113. package/src/cli/templates/codex-skill-onboard.ts +44 -14
  114. package/src/cli/templates/skill-onboard.ts +64 -28
  115. package/src/cli.ts +341 -75
  116. package/src/components/ProxyViewer.tsx +11 -9
  117. package/src/components/ProxyViewerContainer.tsx +12 -11
  118. package/src/components/pi-agent/PiAgentPanel.tsx +2 -2
  119. package/src/components/providers/ProviderCard.tsx +1 -1
  120. package/src/components/providers/ProviderTestResultsView.tsx +1 -1
  121. package/src/components/providers/SettingsDialog.tsx +159 -144
  122. package/src/components/proxy-viewer/ApplicationBar.tsx +2 -1
  123. package/src/components/proxy-viewer/LogEntry.tsx +1 -1
  124. package/src/components/proxy-viewer/log-formats/index.ts +1 -1
  125. package/src/contracts/index.ts +5 -0
  126. package/src/contracts/log.ts +33 -3
  127. package/src/knowledge/types.ts +3 -2
  128. package/src/lib/alertContract.ts +2 -2
  129. package/src/lib/apiClient.ts +30 -7
  130. package/src/lib/apiFormat.ts +29 -0
  131. package/src/lib/backendImplementation.ts +16 -0
  132. package/src/lib/basePath.ts +29 -11
  133. package/src/lib/browserRuntimeContract.ts +124 -0
  134. package/src/lib/browserRuntimeResolver.ts +244 -0
  135. package/src/{proxy → lib}/claudeCodeStrip.ts +6 -7
  136. package/src/lib/codingAgentEndpoints.ts +38 -0
  137. package/src/lib/instanceContract.ts +30 -11
  138. package/src/lib/managedInstance.ts +9 -1
  139. package/src/lib/piAgentContract.ts +3 -2
  140. package/src/lib/publicBasePathContext.ts +40 -10
  141. package/src/lib/resourceLimits.ts +2 -0
  142. package/src/lib/runContract.ts +3 -3
  143. package/src/lib/sessionInfoContract.ts +3 -2
  144. package/src/mcp/instanceHandlers.ts +2 -0
  145. package/src/mcp/server.ts +19 -24
  146. package/src/proxy/config.ts +25 -30
  147. package/src/proxy/dataDir.ts +43 -7
  148. package/src/proxy/ecosystemTasks.ts +161 -70
  149. package/src/proxy/formats/registry.ts +6 -21
  150. package/src/proxy/handler.ts +129 -29
  151. package/src/proxy/identityProxy.ts +567 -39
  152. package/src/proxy/jsonlRecovery.ts +554 -0
  153. package/src/proxy/logFinalizer.ts +25 -10
  154. package/src/proxy/logImporter.ts +2 -1
  155. package/src/proxy/logIndex.ts +191 -95
  156. package/src/proxy/logger.ts +77 -14
  157. package/src/proxy/platformCommands.ts +41 -0
  158. package/src/proxy/privateDataPath.ts +310 -88
  159. package/src/proxy/rawStreamCapture.ts +194 -13
  160. package/src/proxy/runtimeAdmission.ts +5 -2
  161. package/src/proxy/runtimeHealth.ts +14 -1
  162. package/src/proxy/runtimeShutdown.ts +11 -1
  163. package/src/proxy/schemas.ts +7 -1
  164. package/src/proxy/sessionArchive.ts +70 -14
  165. package/src/proxy/sqliteLogIndex.ts +65 -42
  166. package/src/proxy/store.ts +141 -34
  167. package/src/proxy/uiAssetServer.ts +106 -0
  168. package/src/proxy/upstream.ts +29 -2
  169. package/src/ui/bootstrap.ts +167 -0
  170. package/src/ui/index.html +38 -0
  171. package/src/ui/logsStreamClient.ts +20 -0
  172. package/src/ui/main.tsx +13 -0
  173. package/src/ui/public/runtime-config.js +2 -0
  174. package/src/ui/router.tsx +13 -0
  175. package/src/ui/routes/__root.tsx +69 -0
  176. package/src/{routes → ui/routes}/index.tsx +2 -3
  177. package/src/{routes → ui/routes}/session/$sessionId.tsx +5 -11
  178. package/src/ui/runtimeDiscovery.ts +50 -0
  179. package/styles/globals.css +1 -0
  180. package/.output/public/assets/ProxyViewerContainer-BEAhuGOJ.js +0 -126
  181. package/.output/public/assets/ResponseView-DBCjkwye.js +0 -2
  182. package/.output/public/assets/StreamingChunkSequence-CuXhDgMo.js +0 -1
  183. package/.output/public/assets/index-BZo_8koU.js +0 -70
  184. package/.output/public/assets/index-ZWschkCh.css +0 -1
  185. package/.output/public/assets/json-viewer-B-Ao6pwW.js +0 -1
  186. package/.output/server/_libs/@radix-ui/react-accessible-icon+[...].mjs +0 -1
  187. package/.output/server/_libs/@radix-ui/react-dismissable-layer+[...].mjs +0 -344
  188. package/.output/server/_libs/@radix-ui/react-navigation-menu+[...].mjs +0 -2
  189. package/.output/server/_libs/@radix-ui/react-one-time-password-field+[...].mjs +0 -2
  190. package/.output/server/_libs/@radix-ui/react-password-toggle-field+[...].mjs +0 -2
  191. package/.output/server/_libs/@radix-ui/react-use-callback-ref+[...].mjs +0 -11
  192. package/.output/server/_libs/@radix-ui/react-use-controllable-state+[...].mjs +0 -69
  193. package/.output/server/_libs/@radix-ui/react-use-effect-event+[...].mjs +0 -1
  194. package/.output/server/_libs/@radix-ui/react-use-is-hydrated+[...].mjs +0 -28
  195. package/.output/server/_libs/@radix-ui/react-use-layout-effect+[...].mjs +0 -6
  196. package/.output/server/_libs/@radix-ui/react-visually-hidden+[...].mjs +0 -34
  197. package/.output/server/_libs/aria-hidden.mjs +0 -122
  198. package/.output/server/_libs/bail.mjs +0 -8
  199. package/.output/server/_libs/character-entities.mjs +0 -2130
  200. package/.output/server/_libs/class-variance-authority.mjs +0 -44
  201. package/.output/server/_libs/clsx.mjs +0 -16
  202. package/.output/server/_libs/comma-separated-tokens.mjs +0 -10
  203. package/.output/server/_libs/decode-named-character-reference+[...].mjs +0 -8
  204. package/.output/server/_libs/dequal.mjs +0 -27
  205. package/.output/server/_libs/detect-node-es.mjs +0 -1
  206. package/.output/server/_libs/devlop.mjs +0 -8
  207. package/.output/server/_libs/diff.mjs +0 -320
  208. package/.output/server/_libs/estree-util-is-identifier-name.mjs +0 -11
  209. package/.output/server/_libs/floating-ui__core.mjs +0 -725
  210. package/.output/server/_libs/floating-ui__dom.mjs +0 -622
  211. package/.output/server/_libs/floating-ui__react-dom.mjs +0 -292
  212. package/.output/server/_libs/floating-ui__utils.mjs +0 -320
  213. package/.output/server/_libs/get-nonce.mjs +0 -9
  214. package/.output/server/_libs/hast-util-to-jsx-runtime.mjs +0 -388
  215. package/.output/server/_libs/hast-util-whitespace.mjs +0 -10
  216. package/.output/server/_libs/html-url-attributes.mjs +0 -26
  217. package/.output/server/_libs/inline-style-parser.mjs +0 -142
  218. package/.output/server/_libs/is-plain-obj.mjs +0 -10
  219. package/.output/server/_libs/lucide-react.mjs +0 -1027
  220. package/.output/server/_libs/mdast-util-from-markdown.mjs +0 -717
  221. package/.output/server/_libs/mdast-util-to-hast.mjs +0 -710
  222. package/.output/server/_libs/mdast-util-to-string.mjs +0 -38
  223. package/.output/server/_libs/micromark-core-commonmark.mjs +0 -2259
  224. package/.output/server/_libs/micromark-factory-destination.mjs +0 -94
  225. package/.output/server/_libs/micromark-factory-label.mjs +0 -63
  226. package/.output/server/_libs/micromark-factory-space.mjs +0 -24
  227. package/.output/server/_libs/micromark-factory-title.mjs +0 -65
  228. package/.output/server/_libs/micromark-factory-whitespace.mjs +0 -22
  229. package/.output/server/_libs/micromark-util-character.mjs +0 -44
  230. package/.output/server/_libs/micromark-util-chunked.mjs +0 -36
  231. package/.output/server/_libs/micromark-util-classify-character+[...].mjs +0 -12
  232. package/.output/server/_libs/micromark-util-combine-extensions+[...].mjs +0 -41
  233. package/.output/server/_libs/micromark-util-decode-numeric-character-reference+[...].mjs +0 -19
  234. package/.output/server/_libs/micromark-util-decode-string.mjs +0 -21
  235. package/.output/server/_libs/micromark-util-encode.mjs +0 -1
  236. package/.output/server/_libs/micromark-util-html-tag-name.mjs +0 -69
  237. package/.output/server/_libs/micromark-util-normalize-identifier+[...].mjs +0 -6
  238. package/.output/server/_libs/micromark-util-resolve-all.mjs +0 -15
  239. package/.output/server/_libs/micromark-util-sanitize-uri.mjs +0 -41
  240. package/.output/server/_libs/micromark-util-subtokenize.mjs +0 -346
  241. package/.output/server/_libs/micromark.mjs +0 -906
  242. package/.output/server/_libs/property-information.mjs +0 -1209
  243. package/.output/server/_libs/radix-ui.mjs +0 -1
  244. package/.output/server/_libs/radix-ui__number.mjs +0 -6
  245. package/.output/server/_libs/radix-ui__primitive.mjs +0 -11
  246. package/.output/server/_libs/radix-ui__react-accordion.mjs +0 -1
  247. package/.output/server/_libs/radix-ui__react-alert-dialog.mjs +0 -1
  248. package/.output/server/_libs/radix-ui__react-arrow.mjs +0 -23
  249. package/.output/server/_libs/radix-ui__react-aspect-ratio.mjs +0 -1
  250. package/.output/server/_libs/radix-ui__react-avatar.mjs +0 -1
  251. package/.output/server/_libs/radix-ui__react-checkbox.mjs +0 -1
  252. package/.output/server/_libs/radix-ui__react-collapsible.mjs +0 -144
  253. package/.output/server/_libs/radix-ui__react-collection.mjs +0 -69
  254. package/.output/server/_libs/radix-ui__react-compose-refs.mjs +0 -38
  255. package/.output/server/_libs/radix-ui__react-context-menu.mjs +0 -1
  256. package/.output/server/_libs/radix-ui__react-context.mjs +0 -64
  257. package/.output/server/_libs/radix-ui__react-dialog.mjs +0 -280
  258. package/.output/server/_libs/radix-ui__react-direction.mjs +0 -9
  259. package/.output/server/_libs/radix-ui__react-dropdown-menu.mjs +0 -1
  260. package/.output/server/_libs/radix-ui__react-focus-guards.mjs +0 -39
  261. package/.output/server/_libs/radix-ui__react-focus-scope.mjs +0 -210
  262. package/.output/server/_libs/radix-ui__react-form.mjs +0 -1
  263. package/.output/server/_libs/radix-ui__react-hover-card.mjs +0 -1
  264. package/.output/server/_libs/radix-ui__react-id.mjs +0 -14
  265. package/.output/server/_libs/radix-ui__react-label.mjs +0 -1
  266. package/.output/server/_libs/radix-ui__react-menu.mjs +0 -1
  267. package/.output/server/_libs/radix-ui__react-menubar.mjs +0 -1
  268. package/.output/server/_libs/radix-ui__react-popover.mjs +0 -1
  269. package/.output/server/_libs/radix-ui__react-popper.mjs +0 -340
  270. package/.output/server/_libs/radix-ui__react-portal.mjs +0 -16
  271. package/.output/server/_libs/radix-ui__react-presence.mjs +0 -173
  272. package/.output/server/_libs/radix-ui__react-primitive.mjs +0 -42
  273. package/.output/server/_libs/radix-ui__react-progress.mjs +0 -1
  274. package/.output/server/_libs/radix-ui__react-radio-group.mjs +0 -1
  275. package/.output/server/_libs/radix-ui__react-roving-focus.mjs +0 -235
  276. package/.output/server/_libs/radix-ui__react-scroll-area.mjs +0 -731
  277. package/.output/server/_libs/radix-ui__react-select.mjs +0 -1207
  278. package/.output/server/_libs/radix-ui__react-separator.mjs +0 -28
  279. package/.output/server/_libs/radix-ui__react-slider.mjs +0 -1
  280. package/.output/server/_libs/radix-ui__react-slot.mjs +0 -132
  281. package/.output/server/_libs/radix-ui__react-switch.mjs +0 -1
  282. package/.output/server/_libs/radix-ui__react-tabs.mjs +0 -194
  283. package/.output/server/_libs/radix-ui__react-toast.mjs +0 -2
  284. package/.output/server/_libs/radix-ui__react-toggle-group.mjs +0 -1
  285. package/.output/server/_libs/radix-ui__react-toggle.mjs +0 -1
  286. package/.output/server/_libs/radix-ui__react-toolbar.mjs +0 -1
  287. package/.output/server/_libs/radix-ui__react-tooltip.mjs +0 -498
  288. package/.output/server/_libs/radix-ui__react-use-previous.mjs +0 -14
  289. package/.output/server/_libs/radix-ui__react-use-size.mjs +0 -39
  290. package/.output/server/_libs/react-markdown.mjs +0 -235
  291. package/.output/server/_libs/react-remove-scroll-bar.mjs +0 -82
  292. package/.output/server/_libs/react-remove-scroll.mjs +0 -328
  293. package/.output/server/_libs/react-style-singleton.mjs +0 -69
  294. package/.output/server/_libs/remark-parse.mjs +0 -19
  295. package/.output/server/_libs/remark-rehype.mjs +0 -21
  296. package/.output/server/_libs/space-separated-tokens.mjs +0 -6
  297. package/.output/server/_libs/style-to-js.mjs +0 -72
  298. package/.output/server/_libs/style-to-object.mjs +0 -38
  299. package/.output/server/_libs/swr.mjs +0 -947
  300. package/.output/server/_libs/tailwind-merge.mjs +0 -3255
  301. package/.output/server/_libs/tanstack__react-virtual.mjs +0 -130
  302. package/.output/server/_libs/tanstack__virtual-core.mjs +0 -1319
  303. package/.output/server/_libs/three.mjs +0 -26016
  304. package/.output/server/_libs/trim-lines.mjs +0 -41
  305. package/.output/server/_libs/trough.mjs +0 -85
  306. package/.output/server/_libs/tslib.mjs +0 -1
  307. package/.output/server/_libs/ungap__structured-clone.mjs +0 -212
  308. package/.output/server/_libs/unified.mjs +0 -661
  309. package/.output/server/_libs/unist-util-is.mjs +0 -100
  310. package/.output/server/_libs/unist-util-position.mjs +0 -27
  311. package/.output/server/_libs/unist-util-stringify-position.mjs +0 -27
  312. package/.output/server/_libs/unist-util-visit-parents.mjs +0 -82
  313. package/.output/server/_libs/unist-util-visit.mjs +0 -24
  314. package/.output/server/_libs/use-callback-ref.mjs +0 -66
  315. package/.output/server/_libs/use-sidecar.mjs +0 -106
  316. package/.output/server/_libs/vfile-message.mjs +0 -138
  317. package/.output/server/_libs/vfile.mjs +0 -467
  318. package/.output/server/_sessionId-CJ99gZFV.mjs +0 -84
  319. package/.output/server/_sessionId-DEjScBpK.mjs +0 -146
  320. package/.output/server/_ssr/CompareDrawer-DtOIMeQB.mjs +0 -1060
  321. package/.output/server/_ssr/InspectorPet-CXc4oCBQ.mjs +0 -938
  322. package/.output/server/_ssr/ProxyViewerContainer-DVPlwfkt.mjs +0 -17632
  323. package/.output/server/_ssr/ReplayDialog-BQEA95qC.mjs +0 -725
  324. package/.output/server/_ssr/RequestAnatomy-BMyd8B7Q.mjs +0 -837
  325. package/.output/server/_ssr/ResponseView-qrTaEIM8.mjs +0 -757
  326. package/.output/server/_ssr/StreamingChunkSequence-BFTL8mIy.mjs +0 -274
  327. package/.output/server/_ssr/index-Bcj1Hcy4.mjs +0 -135
  328. package/.output/server/_ssr/index-DW-M7XUG.mjs +0 -84
  329. package/.output/server/_ssr/json-viewer-DiI0Yjsn.mjs +0 -483
  330. package/.output/server/_tanstack-start-manifest_v-C6pXXX9R.mjs +0 -4
  331. package/.output/server/node_modules/tslib/modules/index.js +0 -70
  332. package/.output/server/node_modules/tslib/modules/package.json +0 -3
  333. package/.output/server/node_modules/tslib/package.json +0 -47
  334. package/.output/server/node_modules/tslib/tslib.js +0 -484
  335. package/.output/server/package.json +0 -9
  336. package/src/routes/__root.tsx +0 -170
  337. package/src/routes/api/-instances.ts +0 -109
  338. /package/.output/{public → ui}/assets/agent-inspector-58K1_MsC.ico +0 -0
  339. /package/.output/{public → ui}/assets/alibaba-TTwafVwX.svg +0 -0
  340. /package/.output/{public → ui}/assets/minimax-BPMzvuL-.jpeg +0 -0
  341. /package/.output/{public → ui}/assets/qwen-mMn3f5ul.webp +0 -0
  342. /package/.output/{public → ui}/assets/zhipuai-BPNAnxo-.svg +0 -0
  343. /package/src/{routes → backend/routes}/livez.ts +0 -0
package/README.md CHANGED
@@ -55,10 +55,11 @@ and defaults to a 64 MiB hard limit and a 120 second body deadline; override the
55
55
  integer byte/millisecond values in `AGENT_INSPECTOR_MAX_REQUEST_BYTES` and
56
56
  `AGENT_INSPECTOR_REQUEST_TIMEOUT_MS` when a trusted workload requires different bounds.
57
57
 
58
- `@tonyclaw/agent-inspector` runs the local UI, proxy, REST API, storage, and built-in
59
- `/api/mcp` endpoint. `@tonyclaw/agent-inspector-mcp` is the enhancement package for
60
- stdio-first MCP clients and setup automation; it bridges to the local Inspector endpoint without
61
- moving your captured evidence out of the machine.
58
+ `@tonyclaw/agent-inspector` runs the proxy, REST/SSE API, storage, and built-in `/api/mcp`
59
+ endpoint. Its default composed mode also serves the independently built UI; `--backend-only`
60
+ leaves every Coding Agent endpoint running without UI files. `@tonyclaw/agent-inspector-mcp` is the
61
+ enhancement package for stdio-first MCP clients and setup automation; it bridges to the local
62
+ Inspector endpoint without moving your captured evidence out of the machine.
62
63
 
63
64
  On Windows, the npm install step creates a local `agent-inspector.exe` runtime
64
65
  from the user's installed Node.js runtime. The long-running server process
@@ -84,20 +85,20 @@ agent-inspector onboard
84
85
 
85
86
  The onboarding command installs guided setup skills for local agents:
86
87
 
87
- The generated instructions and automatically merged MCP entries derive the Inspector Base URL from
88
- the default CLI origin (`http://localhost:9527`) and `AGENT_INSPECTOR_BASE_PATH`. The default is
89
- `http://localhost:9527/inspector`. This Inspector Base URL is separate from each Provider's upstream
90
- Base URL.
88
+ The generated instructions and automatically merged MCP entries derive the backend Base URL from
89
+ `AGENT_INSPECTOR_PUBLIC_ORIGIN` (or the default local CLI origin) plus
90
+ `AGENT_INSPECTOR_BASE_PATH`. The default is `http://localhost:9527/inspector`. This control/agent
91
+ Base URL is separate from both the optional UI URL and each Provider's upstream Base URL.
91
92
 
92
93
  - Claude Code: `~/.claude/skills/agent-inspector-onboard/SKILL.md` plus a slash command.
93
94
  - Codex: `~/.codex/skills/agent-inspector-onboard/SKILL.md`, focused on connecting
94
- `<inspector-base-url>/api/mcp` through Codex `mcp_servers.agent-inspector`.
95
+ `<agent-base-url>/api/mcp` through Codex `mcp_servers.agent-inspector`.
95
96
  - OpenCode: run `agent-inspector onboard --opencode-only` to merge
96
97
  `mcp.agent-inspector` into `~/.config/opencode/opencode.json` or `opencode.jsonc`, then verify
97
98
  with `opencode mcp list`.
98
99
  - MiMo Code: run `agent-inspector onboard --mimo-only` to merge `mcp.agent-inspector` into
99
100
  `~/.config/mimocode/mimocode.jsonc` or `mimocode.json`, then route MiMo through the proxy with
100
- `OPENAI_BASE_URL=<inspector-base-url>/proxy/v1`.
101
+ `OPENAI_BASE_URL=<agent-base-url>/proxy/v1`.
101
102
 
102
103
  During npm global install, Agent Inspector also makes a best-effort onboarding skill install for
103
104
  detected local agents. If `~/.claude` exists, it installs the Claude Code skill and slash command.
@@ -128,13 +129,20 @@ registered Windows instance or an explicit wrapper URL:
128
129
  agent-inspector onboard --instance review --force
129
130
  agent-inspector onboard --instance review --mcp-name agent-inspector-review --opencode-only --force
130
131
  agent-inspector onboard --base-url https://tools.example.test/inspector --mcp-name team-inspector --force
132
+ agent-inspector onboard --control-base-url https://control.example.test/inspector `
133
+ --agent-base-url https://agent.example.test/inspector `
134
+ --ui-url https://ui.example.test/observe --mcp-name team-inspector --force
135
+ agent-inspector onboard --control-base-url https://control.example.test/inspector `
136
+ --agent-base-url https://agent.example.test/inspector --no-ui --force
131
137
  ```
132
138
 
133
139
  `--instance` resolves the saved instance URL and defaults the MCP config key to
134
- `agent-inspector-<instance>`. `--base-url` accepts a credential-free HTTP(S) Inspector Base URL and
135
- is mutually exclusive with `--instance`. `--mcp-name` selects the exact MCP config key, allowing the
136
- generated config to preserve other Inspector entries. Explicit per-client MCP URL options still
137
- take precedence over the resolved target.
140
+ `agent-inspector-<instance>`. `--base-url` accepts a credential-free HTTP(S) backend control/agent
141
+ Base URL as a compatibility shortcut; it does not imply that a browser UI exists. Separated
142
+ deployments can set `--control-base-url`, `--agent-base-url`, and either `--ui-url` or `--no-ui`.
143
+ `--instance` is mutually exclusive with every explicit URL option. `--mcp-name` selects the exact MCP
144
+ config key, allowing the generated config to preserve other Inspector entries. Explicit per-client
145
+ MCP URL options still take precedence over the resolved target.
138
146
 
139
147
  Before uninstalling the npm package, run `agent-inspector onboard --uninstall` to remove matching
140
148
  generated onboarding files. The uninstall command only removes Agent Inspector generated files whose
@@ -149,6 +157,111 @@ bun install
149
157
  bun run dev
150
158
  ```
151
159
 
160
+ ### Deployment modes and runtime Base URLs
161
+
162
+ Agent Inspector ships one compatible UI/backend release but can run it in three topologies:
163
+
164
+ | Mode | Start | UI | Coding Agent surfaces |
165
+ | --- | --- | --- | --- |
166
+ | Composed (default) | `agent-inspector` | Served by the protected public ingress | REST, SSE, proxy, health, and MCP use the same public backend Base URL. |
167
+ | Backend-only | `agent-inspector --backend-only --no-open` | Not served; document requests return a bounded headless response | REST, SSE, proxy, health, MCP, capture, and named-instance control remain available. |
168
+ | Standalone UI | Build/host `.output/ui` with SPA fallback | Served by a separate static host | The UI reads operator runtime configuration and calls an explicitly configured backend. |
169
+
170
+ Do not use "Inspector Base URL" to mean every surface implicitly. The browser-safe runtime
171
+ contract keeps three locations explicit:
172
+
173
+ - UI Base Path: router/asset mount for the static UI.
174
+ - Control Base URL: REST, uploads/downloads, mutations, and log SSE.
175
+ - Agent Base URL: model proxy, OpenAI-compatible `/proxy/v1`, and MCP guidance.
176
+
177
+ Composed and backend-only deployments currently publish the same backend Base URL for control and
178
+ agent traffic, but clients must still use the corresponding runtime field. A separately hosted UI
179
+ has its own origin and mount path. `GET <control-base-url>/api/runtime` returns a versioned,
180
+ token-free, `no-store` discovery document with deployment mode and capabilities.
181
+
182
+ The static UI loads `runtime-config.js` before the application bundle. For a separately hosted UI,
183
+ replace `.output/ui/runtime-config.js` with an operator-owned value such as:
184
+
185
+ ```js
186
+ window.__AGENT_INSPECTOR_RUNTIME_CONFIG__ = {
187
+ schemaVersion: 1,
188
+ deploymentMode: "separated",
189
+ ui: { basePath: "/" },
190
+ control: { baseUrl: "http://127.0.0.1:19527/inspector" },
191
+ agent: { baseUrl: "http://127.0.0.1:19527/inspector" },
192
+ capabilities: { rest: true, sse: true, proxy: true, mcp: true },
193
+ };
194
+ ```
195
+
196
+ Replace the example URLs with the exact backend URLs printed by the CLI or returned by
197
+ `agent-inspector instance connect <name> --json`. Base URLs must be credential-free HTTP(S) URLs
198
+ without query or fragment. Never put Provider keys, control tokens, or proxy tokens in
199
+ `runtime-config.js`, bootstrap HTML, query strings, or browser storage.
200
+
201
+ The standalone static host must send a CSP whose `connect-src` contains only `'self'` and the exact
202
+ configured control origin; never use `*`. Composed mode generates a same-origin CSP at the protected
203
+ ingress. If the control Base URL changes, update `runtime-config.js` and CSP together.
204
+
205
+ For a local UI that directly calls another local origin, set a comma-separated exact loopback
206
+ allowlist on the protected backend, for example:
207
+
208
+ ```bash
209
+ AGENT_INSPECTOR_UI_ORIGINS=http://127.0.0.1:4173,http://localhost:4173 agent-inspector --backend-only
210
+ ```
211
+
212
+ `AGENT_INSPECTOR_UI_ORIGINS` accepts only exact `http`/`https` loopback origins: no wildcard,
213
+ credentials, path, query, fragment, or non-loopback hostname. It enables the control API/SSE CORS
214
+ path only; browser CORS access to `/proxy` and `/api/mcp` stays forbidden. A non-loopback remote UI
215
+ must use an authenticated same-origin gateway that protects the public edge and forwards to the
216
+ loopback Inspector backend. Do not use the loopback CORS allowlist as remote authentication.
217
+
218
+ When a reverse proxy changes the browser-visible scheme/host/port, set the exact external origin
219
+ separately from the Base Path:
220
+
221
+ ```bash
222
+ AGENT_INSPECTOR_PUBLIC_ORIGIN=https://tools.example.test \
223
+ AGENT_INSPECTOR_BASE_PATH=/inspector \
224
+ agent-inspector
225
+ ```
226
+
227
+ `AGENT_INSPECTOR_PUBLIC_ORIGIN` is an origin only; it allows no credentials, path, query, or
228
+ fragment. It drives request-local runtime discovery, copied endpoint guidance, and MCP outward URLs;
229
+ the proxy must also be included in `AGENT_INSPECTOR_TRUSTED_HOSTS` when its hostname is not otherwise
230
+ trusted.
231
+
232
+ Independent source workflows:
233
+
234
+ ```bash
235
+ bun run dev # Windows-safe supervisor: backend dev server + UI dev server
236
+ bun run dev:backend # backend route tree only (development listener)
237
+ bun run dev:ui # static UI dev server; same-Base-Path proxy by default
238
+
239
+ bun run build:backend # .output/server
240
+ bun run build:ui # .output/ui
241
+ bun run build # both artifacts plus CLI/workers/MCP and boundary checks
242
+
243
+ bun run start:backend # protected production CLI in backend-only mode
244
+ bun run preview:ui # preview the independently built static UI
245
+ ```
246
+
247
+ For a true separate-origin development UI, inject its runtime surfaces instead of relying on the
248
+ same-Base-Path dev proxy:
249
+
250
+ ```bash
251
+ AGENT_INSPECTOR_UI_BASE_PATH=/observe \
252
+ AGENT_INSPECTOR_UI_CONTROL_BASE_URL=http://127.0.0.1:19527/inspector \
253
+ AGENT_INSPECTOR_UI_AGENT_BASE_URL=http://127.0.0.1:19527/inspector \
254
+ AGENT_INSPECTOR_UI_PORT=4173 bun run dev:ui
255
+ ```
256
+
257
+ The backend must allow that exact local UI origin with `AGENT_INSPECTOR_UI_ORIGINS`. The explicit
258
+ control/agent variables are used only by UI dev/preview; production static hosting continues to use
259
+ the operator-owned `runtime-config.js` so one `.output/ui` artifact remains relocatable.
260
+
261
+ The direct backend development listener is loopback-oriented and is not a replacement for the
262
+ protected production ingress. An arbitrary static host must provide SPA fallback for supported deep
263
+ links such as `/session/<id>`.
264
+
152
265
  Run a local health check when you need to verify the proxy and installed
153
266
  configuration:
154
267
 
@@ -164,19 +277,20 @@ only checked when you ask for them explicitly:
164
277
  agent-inspector doctor --chrome-extension
165
278
  ```
166
279
 
167
- Then point an AI coding tool at the proxy:
280
+ Then point an AI coding tool at the agent Base URL reported by the CLI or connection descriptor:
168
281
 
169
282
  ```bash
170
283
  ANTHROPIC_BASE_URL=http://localhost:9527/inspector/proxy <tool>
171
284
  ```
172
285
 
173
- The web UI runs at http://localhost:9527/inspector by default. The public proxy endpoint is
174
- `http://localhost:9527/inspector/proxy`; internally Agent Inspector may run the app on a private
175
- helper port, but AI tools should use the public URL printed by the CLI.
286
+ In default composed mode, the web UI runs at `http://localhost:9527/inspector`. The public proxy
287
+ endpoint is `http://localhost:9527/inspector/proxy`; internally Agent Inspector may run the app on a
288
+ private helper port, but AI tools should use the public URL printed by the CLI.
176
289
 
177
290
  When the dashboard has no captured requests, its copyable Claude, OpenCode, OpenAI, OpenAI `/v1`,
178
- and MCP examples are derived from the browser origin plus the configured runtime base path. They
179
- therefore continue to work when the public origin or base path differs from the default.
291
+ and MCP examples are derived from the resolved browser runtime contract. They therefore use the
292
+ configured agent surface even when the UI origin, backend origin, or Base Path differs from the
293
+ default.
180
294
 
181
295
  ### Base path
182
296
 
@@ -186,13 +300,19 @@ Agent Inspector defaults to the `/inspector` public base path:
186
300
  agent-inspector
187
301
  ```
188
302
 
189
- This generates prefixed public URLs for the UI, assets, REST API, MCP, sessions, and model proxy:
303
+ In composed mode this additionally generates these browser document/asset URLs:
190
304
 
191
305
  - Web UI: `http://localhost:9527/inspector`
192
306
  - Assets: `http://localhost:9527/inspector/assets/...`
307
+ - Sessions: `http://localhost:9527/inspector/session/...`
308
+
309
+ Both composed and backend-only modes keep these backend endpoints at the derived control/agent
310
+ Base URL:
311
+
193
312
  - REST API: `http://localhost:9527/inspector/api/...`
313
+ - Runtime discovery: `http://localhost:9527/inspector/api/runtime`
314
+ - Health: `http://localhost:9527/inspector/api/health`
194
315
  - MCP: `http://localhost:9527/inspector/api/mcp`
195
- - Sessions: `http://localhost:9527/inspector/session/...`
196
316
  - Proxy: `http://localhost:9527/inspector/proxy`
197
317
 
198
318
  AI tools should use the prefixed proxy URL:
@@ -240,19 +360,20 @@ Windows; the command waits for readiness before returning. The existing `agent-i
240
360
  create an instance record.
241
361
 
242
362
  ```powershell
243
- agent-inspector instance start <name> [--port <port>] [--base-path <path>] [--host <host>] [--mode simple|full] [--data-dir <absolute-path>] [--open] [--json]
363
+ agent-inspector instance start <name> [--port <port>] [--base-path <path>] [--host <host>] [--mode simple|full] [--data-dir <absolute-path>] [--backend-only|--with-ui] [--open] [--json]
244
364
  agent-inspector instance list [--json]
245
365
  agent-inspector instance status <name> [--json]
246
366
  agent-inspector instance connect <name> [--json]
247
367
  agent-inspector instance stop <name> [--json]
248
- agent-inspector instance restart <name> [--port <port>] [--base-path <path>] [--host <host>] [--mode simple|full] [--data-dir <absolute-path>] [--open] [--json]
368
+ agent-inspector instance restart <name> [--port <port>] [--base-path <path>] [--host <host>] [--mode simple|full] [--data-dir <absolute-path>] [--backend-only|--with-ui] [--open] [--json]
249
369
  ```
250
370
 
251
371
  Names use lowercase letters, digits, dots, hyphens, and underscores; `default` is reserved for the
252
372
  existing unmanaged runtime. A first start without `--port` allocates an available public/private
253
373
  port pair. The pair and the other launch options are saved, so later `start` calls reuse the same
254
- configuration. Use `restart` with overrides to change a saved value. `--open` opens the UI after the
255
- background instance is ready, while `--json` produces token-free output suitable for PowerShell:
374
+ configuration. Use `restart` with overrides to change a saved value. `--backend-only` persists a
375
+ headless instance; `--with-ui` restores composed UI serving. `--open` is valid only when UI serving
376
+ is enabled. `--json` produces token-free output suitable for PowerShell:
256
377
 
257
378
  ```powershell
258
379
  agent-inspector instance start review --base-path /inspector --json
@@ -262,9 +383,13 @@ $env:OPENAI_BASE_URL = $connection.environment.OPENAI_BASE_URL
262
383
  $review
263
384
  ```
264
385
 
265
- `connect` (also accepted as `connection`) returns the token-free connection descriptor: UI/API,
266
- health, Anthropic proxy, OpenAI `/v1` proxy, MCP URL, environment variables, an MCP server name, and
267
- a Codex Responses provider. In `--json` mode, success writes exactly one JSON document to stdout;
386
+ `connect` (also accepted as `connection`) returns a token-free connection descriptor with explicit
387
+ `surfaces.ui`, `surfaces.control`, and `surfaces.agent` locations. Use
388
+ `surfaces.control.baseUrl` for REST/SSE and `surfaces.agent.baseUrl` for proxy/MCP setup;
389
+ `surfaces.ui.baseUrl` is `null` when `surfaces.ui.enabled` is false. The descriptor also includes
390
+ protocol-ready environment variables, MCP settings, and a Codex Responses provider. The top-level
391
+ `uiEnabled`, `baseUrl`, and `endpoints` fields remain for compatibility, but new integrations should
392
+ use `surfaces`. In `--json` mode, success writes exactly one JSON document to stdout;
268
393
  errors write exactly one `{ "schemaVersion": 1, "error": ... }` document to stderr with empty
269
394
  stdout. Exit code `0` means success, `1` means an operational/lifecycle failure or a reported
270
395
  conflict, and `2` means invalid command syntax or arguments. A `status`/`connect` conflict remains a
@@ -323,13 +448,14 @@ remote model-proxy traffic.
323
448
  Reverse proxies should preserve the configured prefix when forwarding public requests to Agent
324
449
  Inspector (`/inspector` by default).
325
450
 
326
- Treat the exact public Web UI URL printed by the CLI as `<inspector-base-url>`. Client endpoints are
327
- always derived from it:
451
+ Treat the exact public backend URL printed by the CLI or connection descriptor as
452
+ `<agent-base-url>` for Coding Agent endpoints. In composed mode it is also the UI URL; in
453
+ backend-only or standalone-UI mode it is not. Client endpoints are derived from the agent surface:
328
454
 
329
- - Proxy: `<inspector-base-url>/proxy`
330
- - OpenAI-compatible `/v1` proxy: `<inspector-base-url>/proxy/v1`
331
- - MCP: `<inspector-base-url>/api/mcp`
332
- - Health: `<inspector-base-url>/api/health`
455
+ - Proxy: `<agent-base-url>/proxy`
456
+ - OpenAI-compatible `/v1` proxy: `<agent-base-url>/proxy/v1`
457
+ - MCP: `<agent-base-url>/api/mcp`
458
+ - Health: `<control-base-url>/api/health`
333
459
 
334
460
  For example, keep startup and onboarding aligned when using a custom prefix:
335
461
 
@@ -440,7 +566,8 @@ upstream URL failed.
440
566
 
441
567
  ## Named Instance Control For Coding Agents
442
568
 
443
- Every Inspector Base URL exposes a versioned, token-free Windows named-instance control contract.
569
+ Every backend control Base URL exposes a versioned, token-free Windows named-instance control
570
+ contract.
444
571
  The six endpoints are:
445
572
 
446
573
  | Method | Endpoint | Purpose |
@@ -453,12 +580,17 @@ The six endpoints are:
453
580
  | `POST` | `/api/instances/{name}/restart` | Restart with saved or validated replacement settings. |
454
581
 
455
582
  `start` and `restart` accept a strict optional JSON object containing `port`, `basePath`, `host`,
456
- `captureMode`, and `dataDir`; `stop` accepts only `{}`. Responses use `schemaVersion: 1`, never
457
- include lifecycle or Provider credentials, and send `Cache-Control: no-store`. Errors use the stable
458
- shape `{ "schemaVersion": 1, "error": { "code", "message", "retryable" } }` with `400`, `404`,
459
- `409`, `423`, or `503` according to the failure class. See the checked-in
583
+ `captureMode`, `uiEnabled`, and `dataDir`; `stop` accepts only `{}`. Responses use `schemaVersion: 1`,
584
+ never include lifecycle or Provider credentials, and send `Cache-Control: no-store`. Errors use the
585
+ stable shape `{ "schemaVersion": 1, "error": { "code", "message", "retryable" } }` with `400`,
586
+ `404`, `409`, `423`, or `503` according to the failure class. See the checked-in
460
587
  [OpenAPI 3.1 contract](docs/instance-control.openapi.yaml) for the complete schemas.
461
588
 
589
+ Connection responses separate the optional browser surface from backend traffic:
590
+ `surfaces.ui` has `{ enabled, baseUrl }`, while `surfaces.control.baseUrl` and
591
+ `surfaces.agent.baseUrl` remain available for backend-only instances. Legacy top-level `baseUrl` and
592
+ `endpoints` are retained for existing clients.
593
+
462
594
  Browser mutations require same-origin proof plus `x-agent-inspector-csrf: 1`. Direct non-loopback
463
595
  control calls require `Authorization: Bearer <AGENT_INSPECTOR_CONTROL_TOKEN>`. A managed instance
464
596
  cannot stop or restart itself through the REST/MCP transport it is currently serving; use the
@@ -468,8 +600,8 @@ launch was restored (`restart_failed_rolled_back`) or the instance remained degr
468
600
 
469
601
  ## MCP Evidence Workflows
470
602
 
471
- Agent Inspector exposes MCP at `<inspector-base-url>/api/mcp`. With the default public Inspector
472
- Base URL, that is:
603
+ Agent Inspector exposes MCP from the backend agent Base URL at `<agent-base-url>/api/mcp`, whether
604
+ or not a Web UI is served. With the default public backend Base URL, that is:
473
605
 
474
606
  ```text
475
607
  http://localhost:9527/inspector/api/mcp
@@ -490,7 +622,7 @@ The MCP HTTP surface is also documented as OpenAPI YAML in
490
622
  [`docs/mcp-openapi.yaml`](docs/mcp-openapi.yaml).
491
623
 
492
624
  Use only one transport for the same Inspector instance. If the MCP client supports Streamable HTTP,
493
- configure `<inspector-base-url>/api/mcp` directly. If it only supports stdio, configure
625
+ configure `<agent-base-url>/api/mcp` directly. If it only supports stdio, configure
494
626
  `agent-inspector-mcp stdio`; that command is only a bridge to `/api/mcp`, not a second Inspector
495
627
  server.
496
628
 
@@ -637,6 +769,13 @@ copy-ready so users can fill project and work directories explicitly before runn
637
769
 
638
770
  Team CI, GitCode WebHook setup, Cloudflare Tunnel notes, local push fallback, and the verified PR workflow live in [Jenkins + GitCode WebHook](docs/JENKINS_GITCODE_WEBHOOK_TUNNEL.md). Keep real Jenkins notify tokens, GitCode access tokens, and tunnel URLs out of the repository.
639
771
 
772
+ Jenkins is verification-only for Rust-enabled releases because one host cannot prove all native
773
+ executables. The GitHub Actions matrix builds, installs, verifies default startup and production
774
+ health, performs graceful native shutdown, attests, and aggregates Windows x64, Linux x64, and macOS
775
+ arm64 backend packages. The root package release helper refuses to publish
776
+ until that exact-version, exact-source contract is present. See [Local Release
777
+ Helper](docs/LOCAL_RELEASE.md) and [Jenkins Verification Pipeline](docs/JENKINS_RELEASE.md).
778
+
640
779
  ## Project Direction
641
780
 
642
781
  Agent Inspector should stay close to the proven inspector codebase while growing into an agent knowledge layer. The memory flow has four layers:
@@ -4,7 +4,7 @@ info:
4
4
  version: 1.0.0
5
5
  description: |
6
6
  Local control-plane API for discovering and managing Windows named Agent Inspector instances.
7
- Paths are relative to the selected Inspector Base URL. Loopback clients are trusted by the
7
+ Paths are relative to the selected backend control Base URL. Loopback clients are trusted by the
8
8
  native ingress; direct non-loopback clients must send the configured control Bearer token.
9
9
  Browser mutations also require same-origin CSRF proof. A reverse proxy whose upstream appears
10
10
  as loopback must authenticate its own remote clients.
@@ -191,6 +191,7 @@ components:
191
191
  - upstreamPort
192
192
  - basePath
193
193
  - captureMode
194
+ - uiEnabled
194
195
  - dataDir
195
196
  - supervisorPid
196
197
  - urls
@@ -218,6 +219,9 @@ components:
218
219
  upstreamPort: { type: integer, minimum: 1, maximum: 65535, example: 9532 }
219
220
  basePath: { type: string, example: /inspector }
220
221
  captureMode: { type: string, enum: [simple, full] }
222
+ uiEnabled:
223
+ type: boolean
224
+ description: Whether this instance serves the composed Web UI. Backend endpoints remain available when false.
221
225
  dataDir: { type: string, example: "C:\\Users\\me\\AppData\\Local\\agent-inspector\\instances\\review\\data" }
222
226
  supervisorPid:
223
227
  oneOf:
@@ -243,6 +247,9 @@ components:
243
247
  basePath: { type: string, example: /inspector }
244
248
  host: { type: string, example: "127.0.0.1" }
245
249
  captureMode: { type: string, enum: [simple, full] }
250
+ uiEnabled:
251
+ type: boolean
252
+ description: Persist composed UI serving when true or backend-only mode when false.
246
253
  dataDir: { type: string }
247
254
  InstanceOperation:
248
255
  type: object
@@ -256,15 +263,63 @@ components:
256
263
  enum: [created, started, already_running, stopped, already_stopped, restarted]
257
264
  instance:
258
265
  $ref: "#/components/schemas/InstanceView"
266
+ InstanceConnectionSurfaces:
267
+ type: object
268
+ additionalProperties: false
269
+ required: [ui, control, agent]
270
+ properties:
271
+ ui:
272
+ type: object
273
+ additionalProperties: false
274
+ required: [enabled, baseUrl]
275
+ properties:
276
+ enabled:
277
+ type: boolean
278
+ description: Whether this instance serves its composed Web UI.
279
+ baseUrl:
280
+ description: Composed UI Base URL, or null for a backend-only instance.
281
+ oneOf:
282
+ - { type: string, format: uri }
283
+ - { type: "null" }
284
+ control:
285
+ type: object
286
+ additionalProperties: false
287
+ required: [baseUrl]
288
+ properties:
289
+ baseUrl:
290
+ type: string
291
+ format: uri
292
+ description: Base URL for REST, mutation, upload/download, and SSE traffic.
293
+ agent:
294
+ type: object
295
+ additionalProperties: false
296
+ required: [baseUrl]
297
+ properties:
298
+ baseUrl:
299
+ type: string
300
+ format: uri
301
+ description: Base URL from which proxy and MCP client endpoints are derived.
259
302
  InstanceConnection:
260
303
  type: object
261
304
  additionalProperties: false
262
- required: [schemaVersion, instance, baseUrl, endpoints, environment, mcp, codex]
305
+ required: [schemaVersion, uiEnabled, instance, surfaces, baseUrl, endpoints, environment, mcp, codex]
263
306
  properties:
264
307
  schemaVersion: { const: 1 }
308
+ uiEnabled:
309
+ type: boolean
310
+ description: Whether the instance currently serves its composed Web UI; proxy, REST, health, and MCP remain valid when false.
265
311
  instance: { $ref: "#/components/schemas/InstanceView" }
266
- baseUrl: { type: string, format: uri }
267
- endpoints: { $ref: "#/components/schemas/InstanceUrls" }
312
+ surfaces: { $ref: "#/components/schemas/InstanceConnectionSurfaces" }
313
+ baseUrl:
314
+ type: string
315
+ format: uri
316
+ deprecated: true
317
+ description: Legacy backend Base URL; use surfaces.control.baseUrl or surfaces.agent.baseUrl.
318
+ endpoints:
319
+ allOf:
320
+ - { $ref: "#/components/schemas/InstanceUrls" }
321
+ deprecated: true
322
+ description: Legacy derived endpoint set retained for compatibility; use surfaces for Base URLs.
268
323
  environment:
269
324
  type: object
270
325
  additionalProperties: false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tonyclaw/agent-inspector",
3
- "version": "3.0.45",
3
+ "version": "3.0.47",
4
4
  "type": "module",
5
5
  "description": "Agent observability and knowledge capture layer for AI coding tools.",
6
6
  "license": "MIT",
@@ -44,7 +44,8 @@
44
44
  "!src/**/*.test.ts",
45
45
  "!src/**/*.stories.tsx",
46
46
  "!src/**/__fixtures__",
47
- "!src/routeTree.gen.ts",
47
+ "!src/ui/routeTree.gen.ts",
48
+ "!src/backend/routeTree.gen.ts",
48
49
  "scripts/setup-windows-runtime.mjs",
49
50
  "scripts/setup-agent-skills.mjs",
50
51
  "scripts/generate-theme-scales.mjs",
@@ -54,26 +55,53 @@
54
55
  "!.output/*.exe"
55
56
  ],
56
57
  "scripts": {
57
- "dev": "vite dev",
58
+ "dev": "node scripts/dev-decoupled.mjs",
59
+ "dev:ui": "vite dev --config vite.ui.config.ts",
60
+ "dev:backend": "node scripts/dev-backend.mjs",
58
61
  "test:smoke": "bun scripts/run-test-suite.mjs smoke",
59
62
  "test:fast": "bun scripts/run-test-suite.mjs smoke",
60
63
  "test:unit": "bun scripts/run-test-suite.mjs unit",
61
64
  "test:integration": "bun scripts/run-test-suite.mjs integration",
62
65
  "test:changed": "bun scripts/run-test-suite.mjs changed",
63
66
  "test:all": "bun scripts/run-test-suite.mjs all",
67
+ "test:compatibility-tooling": "node --test scripts/compatibility/*.test.mjs",
64
68
  "start": "node .output/cli.js",
65
- "build": "vite build && bun build:workers && bun build:cli && bun build:mcp && bun check:bundle",
69
+ "start:backend": "node .output/cli.js --backend-only --no-open",
70
+ "preview:ui": "vite preview --config vite.ui.config.ts",
71
+ "clean:output": "node scripts/clean-output.mjs",
72
+ "build": "bun clean:output && bun build:backend && bun build:ui && bun smoke:ui-preview && bun build:workers && bun build:cli && bun build:mcp && bun check:bundle && bun check:boundaries",
73
+ "build:backend": "vite build --config vite.backend.config.ts",
74
+ "build:ui": "vite build --config vite.ui.config.ts",
66
75
  "build:workers": "npx esbuild src/proxy/logFinalizer.worker.ts src/proxy/sessionWorkerEntry.ts --bundle --platform=node --target=node22 --format=esm --outdir=.output/workers --external:better-sqlite3",
67
76
  "smoke:workers": "node scripts/smoke-production-workers.mjs",
68
77
  "smoke:packed-workers": "node scripts/smoke-packed-workers.mjs",
69
78
  "smoke:instances": "node scripts/smoke-windows-instances.mjs",
70
79
  "smoke:coding-agent-instances": "node scripts/smoke-coding-agent-instances.mjs",
80
+ "smoke:ui-preview": "node scripts/smoke-decoupled-ui-preview.mjs",
71
81
  "check:bundle": "node scripts/check-client-bundle.mjs",
82
+ "check:boundaries": "node scripts/check-runtime-boundaries.mjs",
83
+ "compatibility:bdd": "node scripts/lint-bdd-catalog.mjs",
84
+ "compatibility:compare": "node scripts/compatibility/cli.mjs compare",
85
+ "compatibility:drift": "node scripts/check-backend-compatibility.mjs",
86
+ "compatibility:fixtures": "bun scripts/validate-compatibility-fixtures.ts",
87
+ "compatibility:freeze": "node scripts/freeze-backend-baseline.mjs",
88
+ "compatibility:run": "node scripts/compatibility/cli.mjs run",
89
+ "compatibility:performance": "node scripts/compatibility/performance-cli.mjs",
90
+ "compatibility:performance:verify": "node scripts/compatibility/performance-cli.mjs verify",
72
91
  "build:cli": "npx esbuild src/cli.ts --bundle --platform=node --target=node22 --format=esm --outfile=.output/cli.js",
73
92
  "build:mcp": "npx esbuild packages/agent-inspector-mcp/src/cli.ts --bundle --platform=node --target=node22 --format=esm --outfile=packages/agent-inspector-mcp/dist/cli.js",
93
+ "rust:build-package": "node scripts/rust/build-platform.mjs",
94
+ "rust:stage-package": "node scripts/rust/stage-platform.mjs",
95
+ "rust:verify-package": "node scripts/rust/verify-platform.mjs",
96
+ "rust:pack-package": "node scripts/rust/pack-platform.mjs",
97
+ "rust:native-artifact": "node scripts/rust/create-native-artifact.mjs",
98
+ "rust:native:aggregate": "node scripts/rust/aggregate-native-artifacts.mjs",
99
+ "test:rust-packaging": "bun test scripts/rust/npmPackaging.test.ts scripts/rust/nativeReleaseContract.test.ts scripts/rust/nativeStartupSmoke.test.ts scripts/releaseCore.test.ts",
100
+ "rust:packages:check": "node scripts/rust/sync-package-versions.mjs",
101
+ "rust:packages:sync": "node scripts/rust/sync-package-versions.mjs --write",
74
102
  "themes:generate": "node scripts/generate-theme-scales.mjs",
75
103
  "postinstall": "node scripts/setup-windows-runtime.mjs && node scripts/setup-agent-skills.mjs",
76
- "prepublishOnly": "npm run build",
104
+ "prepublishOnly": "node scripts/rust/require-release-orchestrator.mjs",
77
105
  "typecheck": "tsc --noEmit --incremental --tsBuildInfoFile .cache/tsconfig.tsbuildinfo",
78
106
  "lint": "eslint . --cache --cache-location .cache/eslintcache",
79
107
  "format": "biome format --write .",
@@ -83,7 +111,7 @@
83
111
  "extension:release": "node scripts/release-chrome-extension.mjs",
84
112
  "release": "node scripts/release.mjs",
85
113
  "knip": "knip",
86
- "check": "bun scripts/run-static-checks.mjs --format",
114
+ "check": "bun scripts/run-static-checks.mjs --format && bun check:boundaries && bun compatibility:bdd && bun rust:packages:check",
87
115
  "prepare": "husky",
88
116
  "ladle": "ladle serve",
89
117
  "ladle:build": "ladle build"
@@ -113,6 +141,9 @@
113
141
  "zod": "^4.4.3"
114
142
  },
115
143
  "optionalDependencies": {
144
+ "@tonyclaw/agent-inspector-backend-darwin-arm64": "3.0.47",
145
+ "@tonyclaw/agent-inspector-backend-linux-x64-gnu": "3.0.47",
146
+ "@tonyclaw/agent-inspector-backend-win32-x64-msvc": "3.0.47",
116
147
  "better-sqlite3": "^12.11.1",
117
148
  "rcedit": "4.0.1"
118
149
  },
@@ -122,6 +153,7 @@
122
153
  "@ladle/react": "^5.1.1",
123
154
  "@radix-ui/colors": "^3.0.0",
124
155
  "@tailwindcss/vite": "^4.3.2",
156
+ "@tanstack/router-plugin": "^1.168.20",
125
157
  "@types/bun": "^1.3.14",
126
158
  "@types/react": "^19.2.17",
127
159
  "@types/react-dom": "^19.2.3",
@@ -129,6 +161,8 @@
129
161
  "@typescript-eslint/eslint-plugin": "^8.64.0",
130
162
  "@typescript-eslint/parser": "^8.64.0",
131
163
  "@vitejs/plugin-react": "^5.2.0",
164
+ "ajv": "8.20.0",
165
+ "ajv-formats": "3.0.1",
132
166
  "colorjs.io": "^0.7.0",
133
167
  "esbuild": "^0.28.1",
134
168
  "eslint": "^9.39.5",
@@ -3,9 +3,9 @@ import { URL } from "node:url";
3
3
  import { olive, sand, slateDark } from "@radix-ui/colors";
4
4
 
5
5
  const themes = [
6
- { selector: ":root,\n:root[data-theme=\"light\"]", scale: sand, source: "sand" },
7
- { selector: ":root[data-theme=\"dark\"]", scale: slateDark, source: "slateDark" },
8
- { selector: ":root[data-theme=\"eye-care\"]", scale: olive, source: "olive" },
6
+ { selector: ':root,\n:root[data-theme="light"]', scale: sand, source: "sand" },
7
+ { selector: ':root[data-theme="dark"]', scale: slateDark, source: "slateDark" },
8
+ { selector: ':root[data-theme="eye-care"]', scale: olive, source: "olive" },
9
9
  ];
10
10
 
11
11
  function renderTheme({ selector, scale, source }) {
@@ -1,5 +1,5 @@
1
1
  import { createRouter } from "@tanstack/react-router";
2
- import { getRouterBasePath } from "./lib/basePath";
2
+ import { getRouterBasePath } from "../lib/basePath";
3
3
  import { routeTree } from "./routeTree.gen";
4
4
 
5
5
  function defaultRouterBasePath(): string {
@@ -19,14 +19,8 @@ export function getRouter(basepath = defaultRouterBasePath()) {
19
19
  function attachServerSsrStoreCompatibility(
20
20
  router: Readonly<{ state: Readonly<{ matches: unknown }> }>,
21
21
  ): void {
22
- // TanStack >= 1.168 refactored `state` from an own data property into a
23
- // prototype getter backed by lazily-created `stores` (`this.stores.__store`).
24
- // Installing a `stores` value here would shadow that lazy init
25
- // (`if (!this.stores && this.latestLocation) { this.stores = … }`) and break
26
- // `router.state`. When `state` is already a prototype accessor the new store
27
- // architecture handles SSR natively and this shim is obsolete.
28
- const stateDesc = Object.getOwnPropertyDescriptor(router, "state");
29
- if (stateDesc === undefined) return;
22
+ const stateDescriptor = Object.getOwnPropertyDescriptor(router, "state");
23
+ if (stateDescriptor === undefined) return;
30
24
 
31
25
  const existingStores = Object.getOwnPropertyDescriptor(router, "stores");
32
26
  if (existingStores !== undefined) return;
@@ -40,9 +34,3 @@ function attachServerSsrStoreCompatibility(
40
34
  },
41
35
  });
42
36
  }
43
-
44
- declare module "@tanstack/react-router" {
45
- interface Register {
46
- router: ReturnType<typeof getRouter>;
47
- }
48
- }
@@ -0,0 +1,26 @@
1
+ import { createFileRoute } from "@tanstack/react-router";
2
+
3
+ const BACKEND_NOT_FOUND_BODY = {
4
+ error: "not_found",
5
+ message: "Agent Inspector backend does not serve the web UI.",
6
+ };
7
+
8
+ export function backendNotFoundResponse(): Response {
9
+ return Response.json(BACKEND_NOT_FOUND_BODY, {
10
+ status: 404,
11
+ headers: { "cache-control": "no-store" },
12
+ });
13
+ }
14
+
15
+ export const Route = createFileRoute("/$")({
16
+ server: {
17
+ handlers: {
18
+ GET: backendNotFoundResponse,
19
+ POST: backendNotFoundResponse,
20
+ PUT: backendNotFoundResponse,
21
+ PATCH: backendNotFoundResponse,
22
+ DELETE: backendNotFoundResponse,
23
+ OPTIONS: backendNotFoundResponse,
24
+ },
25
+ },
26
+ });