@tonyclaw/agent-inspector 3.0.44 → 3.0.46

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 (347) 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 +22707 -17099
  4. package/.output/server/_libs/extend.mjs +4 -8
  5. package/.output/server/_libs/jszip.mjs +9 -35
  6. package/.output/server/_libs/modelcontextprotocol__core.mjs +25 -25
  7. package/.output/server/_libs/modelcontextprotocol__server.mjs +2 -2
  8. package/.output/server/_libs/react-dom.mjs +2 -3
  9. package/.output/server/_libs/react.mjs +1 -27
  10. package/.output/server/_libs/tanstack__react-router.mjs +1 -329
  11. package/.output/server/_libs/tanstack__router-core.mjs +42 -100
  12. package/.output/server/_libs/use-sync-external-store.mjs +1 -64
  13. package/.output/server/_libs/ws.mjs +1 -1
  14. package/.output/server/_libs/zod.mjs +6 -6
  15. package/.output/server/_ssr/index.mjs +5 -4
  16. package/.output/server/_ssr/publicBasePathContext-IH2ilOfu.mjs +176 -0
  17. package/.output/server/_ssr/{router-DWcUFPR3.mjs → router-D18yUq36.mjs} +7877 -5597
  18. package/.output/server/_ssr/start-COQu_AgD.mjs +57 -0
  19. package/.output/server/_tanstack-start-manifest_v-DnbdNeun.mjs +4 -0
  20. package/.output/server/index.mjs +5 -145
  21. package/.output/{public/assets/CompareDrawer-DQHjxFO6.js → ui/assets/CompareDrawer-DAUuIJ6G.js} +1 -1
  22. package/.output/{public/assets/InspectorPet-D1A4505B.js → ui/assets/InspectorPet-BRBVjOWI.js} +1 -1
  23. package/.output/ui/assets/ProxyViewerContainer-D7Sq0ctc.js +59 -0
  24. package/.output/{public/assets/ReplayDialog-C5vmbecv.js → ui/assets/ReplayDialog-nDLsjOhs.js} +1 -1
  25. package/.output/{public/assets/RequestAnatomy-CPGNB8lk.js → ui/assets/RequestAnatomy-zd4BDgL0.js} +1 -1
  26. package/.output/ui/assets/ResponseView-AdIXGcSn.js +2 -0
  27. package/.output/ui/assets/StreamingChunkSequence-CesTz8He.js +1 -0
  28. package/.output/{public/assets/_sessionId-CDhRgzf6.js → ui/assets/_sessionId-BAfzrhSU.js} +1 -1
  29. package/.output/{public/assets/_sessionId-mw3aA8Bp.js → ui/assets/_sessionId-QnBomgPD.js} +1 -1
  30. package/.output/ui/assets/favicon-DYEkHSNl.svg +21 -0
  31. package/.output/{public/assets/index-B2eoeT-Z.js → ui/assets/index-BcsdxBAd.js} +1 -1
  32. package/.output/ui/assets/index-BvXp42al.css +1 -0
  33. package/.output/{public/assets/index-CX7_rf7o.js → ui/assets/index-D0rtCN9V.js} +1 -1
  34. package/.output/ui/assets/index-DHpwr08Z.js +73 -0
  35. package/.output/{public/assets/index-BfRhTvOd.js → ui/assets/index-dNuk2dsU.js} +1 -1
  36. package/.output/ui/assets/json-viewer-BvFHglMb.js +1 -0
  37. package/.output/{public/assets/jszip.min-C9rCFoU3.js → ui/assets/jszip.min-B5Z7gNZB.js} +1 -1
  38. package/.output/ui/index.html +229 -0
  39. package/.output/ui/runtime-config.js +2 -0
  40. package/.output/workers/logFinalizer.worker.js +983 -414
  41. package/.output/workers/sessionWorkerEntry.js +983 -414
  42. package/README.md +363 -35
  43. package/docs/instance-control.openapi.yaml +361 -0
  44. package/package.json +28 -5
  45. package/scripts/generate-theme-scales.mjs +3 -3
  46. package/src/{router.tsx → backend/router.tsx} +3 -15
  47. package/src/backend/routes/$.ts +26 -0
  48. package/src/backend/routes/__root.ts +4 -0
  49. package/src/backend/routes/api/-instances.ts +109 -0
  50. package/src/{routes → backend/routes}/api/alerts.summary.ts +3 -3
  51. package/src/{routes → backend/routes}/api/alerts.ts +4 -4
  52. package/src/{routes → backend/routes}/api/config.paths.ts +1 -1
  53. package/src/{routes → backend/routes}/api/config.ts +11 -2
  54. package/src/{routes → backend/routes}/api/ecosystem.packages.$packageId.help.ts +1 -1
  55. package/src/{routes → backend/routes}/api/ecosystem.packages.$packageId.install.ts +1 -1
  56. package/src/{routes → backend/routes}/api/ecosystem.packages.$packageId.runner-presets.ts +1 -1
  57. package/src/{routes → backend/routes}/api/ecosystem.packages.$packageId.upgrade.ts +1 -1
  58. package/src/{routes → backend/routes}/api/ecosystem.packages.ts +5 -1
  59. package/src/{routes → backend/routes}/api/ecosystem.recipes.$recipeId.run.ts +1 -1
  60. package/src/{routes → backend/routes}/api/ecosystem.tasks.$taskId.ts +1 -1
  61. package/src/{routes → backend/routes}/api/ecosystem.tasks.ts +1 -1
  62. package/src/{routes → backend/routes}/api/groups.$groupId.evidence.ts +2 -2
  63. package/src/{routes → backend/routes}/api/groups.$groupId.sessions.ts +2 -2
  64. package/src/{routes → backend/routes}/api/groups.$groupId.ts +2 -2
  65. package/src/{routes → backend/routes}/api/groups.ts +2 -2
  66. package/src/{routes → backend/routes}/api/health.ts +3 -3
  67. package/src/backend/routes/api/instances.$name.connection.ts +12 -0
  68. package/src/backend/routes/api/instances.$name.restart.ts +23 -0
  69. package/src/backend/routes/api/instances.$name.start.ts +18 -0
  70. package/src/backend/routes/api/instances.$name.stop.ts +23 -0
  71. package/src/backend/routes/api/instances.$name.ts +12 -0
  72. package/src/backend/routes/api/instances.ts +16 -0
  73. package/src/{routes → backend/routes}/api/knowledge.candidates.$candidateId.promote.ts +2 -2
  74. package/src/{routes → backend/routes}/api/knowledge.candidates.$candidateId.ts +2 -2
  75. package/src/{routes → backend/routes}/api/knowledge.candidates.ts +1 -1
  76. package/src/{routes → backend/routes}/api/knowledge.project-context.ts +2 -2
  77. package/src/{routes → backend/routes}/api/knowledge.search.ts +2 -2
  78. package/src/{routes → backend/routes}/api/knowledge.sessions.$sessionId.candidates.ts +3 -3
  79. package/src/{routes → backend/routes}/api/logs.$id.body.ts +6 -6
  80. package/src/{routes → backend/routes}/api/logs.$id.chunks.ts +5 -4
  81. package/src/{routes → backend/routes}/api/logs.$id.replay.ts +12 -11
  82. package/src/{routes → backend/routes}/api/logs.$id.ts +4 -3
  83. package/src/{routes → backend/routes}/api/logs.import.ts +3 -3
  84. package/src/{routes → backend/routes}/api/logs.stream.ts +11 -7
  85. package/src/{routes → backend/routes}/api/logs.ts +17 -9
  86. package/src/{routes → backend/routes}/api/mcp.ts +1 -1
  87. package/src/{routes → backend/routes}/api/models.ts +1 -1
  88. package/src/{routes → backend/routes}/api/pi-agent.ts +2 -2
  89. package/src/{routes → backend/routes}/api/providers.$providerId.model-metadata.ts +5 -5
  90. package/src/{routes → backend/routes}/api/providers.$providerId.test.log.ts +7 -7
  91. package/src/{routes → backend/routes}/api/providers.$providerId.ts +4 -4
  92. package/src/{routes → backend/routes}/api/providers.export.ts +1 -1
  93. package/src/{routes → backend/routes}/api/providers.import.ts +3 -3
  94. package/src/{routes → backend/routes}/api/providers.scan.ts +2 -2
  95. package/src/{routes → backend/routes}/api/providers.ts +9 -4
  96. package/src/{routes → backend/routes}/api/runs.$runId.evidence.ts +2 -2
  97. package/src/{routes → backend/routes}/api/runs.$runId.ts +2 -2
  98. package/src/{routes → backend/routes}/api/runs.ts +4 -4
  99. package/src/backend/routes/api/runtime.ts +46 -0
  100. package/src/{routes → backend/routes}/api/sessions.ts +3 -3
  101. package/src/{routes → backend/routes}/proxy/$.ts +1 -1
  102. package/src/{routes → backend/routes}/readyz.ts +1 -1
  103. package/src/backend/start.ts +10 -0
  104. package/src/cli/alias.ts +431 -0
  105. package/src/cli/doctor.ts +32 -9
  106. package/src/cli/instance.ts +1050 -0
  107. package/src/cli/instanceArgs.ts +285 -0
  108. package/src/cli/instanceControl.ts +181 -0
  109. package/src/cli/instanceModel.ts +267 -0
  110. package/src/cli/instanceRegistry.ts +731 -0
  111. package/src/cli/networkHints.ts +27 -14
  112. package/src/cli/onboard.ts +190 -35
  113. package/src/cli/onboardTarget.ts +228 -0
  114. package/src/cli/templates/codex-skill-onboard.ts +109 -31
  115. package/src/cli/templates/skill-onboard.ts +140 -70
  116. package/src/cli.ts +338 -77
  117. package/src/components/ProxyViewer.tsx +20 -10
  118. package/src/components/ProxyViewerContainer.tsx +12 -11
  119. package/src/components/pi-agent/PiAgentPanel.tsx +2 -2
  120. package/src/components/providers/ProviderCard.tsx +1 -1
  121. package/src/components/providers/ProviderTestResultsView.tsx +1 -1
  122. package/src/components/providers/SettingsDialog.tsx +160 -140
  123. package/src/components/proxy-viewer/ApplicationBar.tsx +2 -1
  124. package/src/components/proxy-viewer/LogEntry.tsx +1 -1
  125. package/src/components/proxy-viewer/log-formats/index.ts +1 -1
  126. package/src/contracts/index.ts +5 -0
  127. package/src/contracts/log.ts +33 -3
  128. package/src/knowledge/types.ts +3 -2
  129. package/src/lib/alertContract.ts +2 -2
  130. package/src/lib/apiClient.ts +30 -7
  131. package/src/lib/apiFormat.ts +29 -0
  132. package/src/lib/basePath.ts +31 -7
  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 +54 -0
  137. package/src/lib/instanceContract.ts +236 -0
  138. package/src/lib/managedInstance.ts +104 -0
  139. package/src/lib/piAgentContract.ts +3 -2
  140. package/src/lib/publicBasePathContext.ts +137 -0
  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 +150 -0
  145. package/src/mcp/loopback.ts +16 -5
  146. package/src/mcp/mode.ts +25 -0
  147. package/src/mcp/server.ts +274 -39
  148. package/src/mcp/toolHandlers.ts +2 -2
  149. package/src/proxy/config.ts +25 -30
  150. package/src/proxy/dataDir.ts +43 -7
  151. package/src/proxy/ecosystemTasks.ts +161 -70
  152. package/src/proxy/formats/registry.ts +6 -21
  153. package/src/proxy/handler.ts +129 -29
  154. package/src/proxy/identityProxy.ts +1049 -50
  155. package/src/proxy/jsonlRecovery.ts +554 -0
  156. package/src/proxy/logFinalizer.ts +25 -10
  157. package/src/proxy/logImporter.ts +2 -1
  158. package/src/proxy/logIndex.ts +191 -95
  159. package/src/proxy/logger.ts +77 -14
  160. package/src/proxy/platformCommands.ts +41 -0
  161. package/src/proxy/privateDataPath.ts +310 -88
  162. package/src/proxy/rawStreamCapture.ts +194 -13
  163. package/src/proxy/runtimeAdmission.ts +5 -2
  164. package/src/proxy/runtimeHealth.ts +14 -1
  165. package/src/proxy/runtimeShutdown.ts +84 -2
  166. package/src/proxy/schemas.ts +7 -1
  167. package/src/proxy/sessionArchive.ts +78 -14
  168. package/src/proxy/sessionInfo.ts +5 -4
  169. package/src/proxy/sqliteLogIndex.ts +65 -2
  170. package/src/proxy/store.ts +141 -34
  171. package/src/proxy/uiAssetServer.ts +106 -0
  172. package/src/proxy/upstream.ts +29 -2
  173. package/src/ui/bootstrap.ts +167 -0
  174. package/src/ui/index.html +38 -0
  175. package/src/ui/logsStreamClient.ts +20 -0
  176. package/src/ui/main.tsx +13 -0
  177. package/src/ui/public/runtime-config.js +2 -0
  178. package/src/ui/router.tsx +13 -0
  179. package/src/ui/routes/__root.tsx +69 -0
  180. package/src/{routes → ui/routes}/index.tsx +2 -3
  181. package/src/{routes → ui/routes}/session/$sessionId.tsx +5 -11
  182. package/src/ui/runtimeDiscovery.ts +50 -0
  183. package/styles/globals.css +1 -0
  184. package/.output/public/assets/ProxyViewerContainer-BhpIgfBi.js +0 -126
  185. package/.output/public/assets/ResponseView-DUfrajCm.js +0 -2
  186. package/.output/public/assets/StreamingChunkSequence-nbeCQqOz.js +0 -1
  187. package/.output/public/assets/index-BWjeqxbk.css +0 -1
  188. package/.output/public/assets/index-C6qZwYlR.js +0 -70
  189. package/.output/public/assets/json-viewer-BLmF1sOZ.js +0 -1
  190. package/.output/server/_libs/@radix-ui/react-accessible-icon+[...].mjs +0 -1
  191. package/.output/server/_libs/@radix-ui/react-dismissable-layer+[...].mjs +0 -344
  192. package/.output/server/_libs/@radix-ui/react-navigation-menu+[...].mjs +0 -2
  193. package/.output/server/_libs/@radix-ui/react-one-time-password-field+[...].mjs +0 -2
  194. package/.output/server/_libs/@radix-ui/react-password-toggle-field+[...].mjs +0 -2
  195. package/.output/server/_libs/@radix-ui/react-use-callback-ref+[...].mjs +0 -11
  196. package/.output/server/_libs/@radix-ui/react-use-controllable-state+[...].mjs +0 -69
  197. package/.output/server/_libs/@radix-ui/react-use-effect-event+[...].mjs +0 -1
  198. package/.output/server/_libs/@radix-ui/react-use-is-hydrated+[...].mjs +0 -28
  199. package/.output/server/_libs/@radix-ui/react-use-layout-effect+[...].mjs +0 -6
  200. package/.output/server/_libs/@radix-ui/react-visually-hidden+[...].mjs +0 -34
  201. package/.output/server/_libs/aria-hidden.mjs +0 -122
  202. package/.output/server/_libs/bail.mjs +0 -8
  203. package/.output/server/_libs/character-entities.mjs +0 -2130
  204. package/.output/server/_libs/class-variance-authority.mjs +0 -44
  205. package/.output/server/_libs/clsx.mjs +0 -16
  206. package/.output/server/_libs/comma-separated-tokens.mjs +0 -10
  207. package/.output/server/_libs/decode-named-character-reference+[...].mjs +0 -8
  208. package/.output/server/_libs/dequal.mjs +0 -27
  209. package/.output/server/_libs/detect-node-es.mjs +0 -1
  210. package/.output/server/_libs/devlop.mjs +0 -8
  211. package/.output/server/_libs/diff.mjs +0 -320
  212. package/.output/server/_libs/estree-util-is-identifier-name.mjs +0 -11
  213. package/.output/server/_libs/floating-ui__core.mjs +0 -725
  214. package/.output/server/_libs/floating-ui__dom.mjs +0 -622
  215. package/.output/server/_libs/floating-ui__react-dom.mjs +0 -292
  216. package/.output/server/_libs/floating-ui__utils.mjs +0 -320
  217. package/.output/server/_libs/get-nonce.mjs +0 -9
  218. package/.output/server/_libs/hast-util-to-jsx-runtime.mjs +0 -388
  219. package/.output/server/_libs/hast-util-whitespace.mjs +0 -10
  220. package/.output/server/_libs/html-url-attributes.mjs +0 -26
  221. package/.output/server/_libs/inline-style-parser.mjs +0 -142
  222. package/.output/server/_libs/is-plain-obj.mjs +0 -10
  223. package/.output/server/_libs/lucide-react.mjs +0 -1027
  224. package/.output/server/_libs/mdast-util-from-markdown.mjs +0 -717
  225. package/.output/server/_libs/mdast-util-to-hast.mjs +0 -710
  226. package/.output/server/_libs/mdast-util-to-string.mjs +0 -38
  227. package/.output/server/_libs/micromark-core-commonmark.mjs +0 -2259
  228. package/.output/server/_libs/micromark-factory-destination.mjs +0 -94
  229. package/.output/server/_libs/micromark-factory-label.mjs +0 -63
  230. package/.output/server/_libs/micromark-factory-space.mjs +0 -24
  231. package/.output/server/_libs/micromark-factory-title.mjs +0 -65
  232. package/.output/server/_libs/micromark-factory-whitespace.mjs +0 -22
  233. package/.output/server/_libs/micromark-util-character.mjs +0 -44
  234. package/.output/server/_libs/micromark-util-chunked.mjs +0 -36
  235. package/.output/server/_libs/micromark-util-classify-character+[...].mjs +0 -12
  236. package/.output/server/_libs/micromark-util-combine-extensions+[...].mjs +0 -41
  237. package/.output/server/_libs/micromark-util-decode-numeric-character-reference+[...].mjs +0 -19
  238. package/.output/server/_libs/micromark-util-decode-string.mjs +0 -21
  239. package/.output/server/_libs/micromark-util-encode.mjs +0 -1
  240. package/.output/server/_libs/micromark-util-html-tag-name.mjs +0 -69
  241. package/.output/server/_libs/micromark-util-normalize-identifier+[...].mjs +0 -6
  242. package/.output/server/_libs/micromark-util-resolve-all.mjs +0 -15
  243. package/.output/server/_libs/micromark-util-sanitize-uri.mjs +0 -41
  244. package/.output/server/_libs/micromark-util-subtokenize.mjs +0 -346
  245. package/.output/server/_libs/micromark.mjs +0 -906
  246. package/.output/server/_libs/property-information.mjs +0 -1209
  247. package/.output/server/_libs/radix-ui.mjs +0 -1
  248. package/.output/server/_libs/radix-ui__number.mjs +0 -6
  249. package/.output/server/_libs/radix-ui__primitive.mjs +0 -11
  250. package/.output/server/_libs/radix-ui__react-accordion.mjs +0 -1
  251. package/.output/server/_libs/radix-ui__react-alert-dialog.mjs +0 -1
  252. package/.output/server/_libs/radix-ui__react-arrow.mjs +0 -23
  253. package/.output/server/_libs/radix-ui__react-aspect-ratio.mjs +0 -1
  254. package/.output/server/_libs/radix-ui__react-avatar.mjs +0 -1
  255. package/.output/server/_libs/radix-ui__react-checkbox.mjs +0 -1
  256. package/.output/server/_libs/radix-ui__react-collapsible.mjs +0 -144
  257. package/.output/server/_libs/radix-ui__react-collection.mjs +0 -69
  258. package/.output/server/_libs/radix-ui__react-compose-refs.mjs +0 -38
  259. package/.output/server/_libs/radix-ui__react-context-menu.mjs +0 -1
  260. package/.output/server/_libs/radix-ui__react-context.mjs +0 -64
  261. package/.output/server/_libs/radix-ui__react-dialog.mjs +0 -280
  262. package/.output/server/_libs/radix-ui__react-direction.mjs +0 -9
  263. package/.output/server/_libs/radix-ui__react-dropdown-menu.mjs +0 -1
  264. package/.output/server/_libs/radix-ui__react-focus-guards.mjs +0 -39
  265. package/.output/server/_libs/radix-ui__react-focus-scope.mjs +0 -210
  266. package/.output/server/_libs/radix-ui__react-form.mjs +0 -1
  267. package/.output/server/_libs/radix-ui__react-hover-card.mjs +0 -1
  268. package/.output/server/_libs/radix-ui__react-id.mjs +0 -14
  269. package/.output/server/_libs/radix-ui__react-label.mjs +0 -1
  270. package/.output/server/_libs/radix-ui__react-menu.mjs +0 -1
  271. package/.output/server/_libs/radix-ui__react-menubar.mjs +0 -1
  272. package/.output/server/_libs/radix-ui__react-popover.mjs +0 -1
  273. package/.output/server/_libs/radix-ui__react-popper.mjs +0 -340
  274. package/.output/server/_libs/radix-ui__react-portal.mjs +0 -16
  275. package/.output/server/_libs/radix-ui__react-presence.mjs +0 -173
  276. package/.output/server/_libs/radix-ui__react-primitive.mjs +0 -42
  277. package/.output/server/_libs/radix-ui__react-progress.mjs +0 -1
  278. package/.output/server/_libs/radix-ui__react-radio-group.mjs +0 -1
  279. package/.output/server/_libs/radix-ui__react-roving-focus.mjs +0 -235
  280. package/.output/server/_libs/radix-ui__react-scroll-area.mjs +0 -731
  281. package/.output/server/_libs/radix-ui__react-select.mjs +0 -1207
  282. package/.output/server/_libs/radix-ui__react-separator.mjs +0 -28
  283. package/.output/server/_libs/radix-ui__react-slider.mjs +0 -1
  284. package/.output/server/_libs/radix-ui__react-slot.mjs +0 -132
  285. package/.output/server/_libs/radix-ui__react-switch.mjs +0 -1
  286. package/.output/server/_libs/radix-ui__react-tabs.mjs +0 -194
  287. package/.output/server/_libs/radix-ui__react-toast.mjs +0 -2
  288. package/.output/server/_libs/radix-ui__react-toggle-group.mjs +0 -1
  289. package/.output/server/_libs/radix-ui__react-toggle.mjs +0 -1
  290. package/.output/server/_libs/radix-ui__react-toolbar.mjs +0 -1
  291. package/.output/server/_libs/radix-ui__react-tooltip.mjs +0 -498
  292. package/.output/server/_libs/radix-ui__react-use-previous.mjs +0 -14
  293. package/.output/server/_libs/radix-ui__react-use-size.mjs +0 -39
  294. package/.output/server/_libs/react-markdown.mjs +0 -235
  295. package/.output/server/_libs/react-remove-scroll-bar.mjs +0 -82
  296. package/.output/server/_libs/react-remove-scroll.mjs +0 -328
  297. package/.output/server/_libs/react-style-singleton.mjs +0 -69
  298. package/.output/server/_libs/remark-parse.mjs +0 -19
  299. package/.output/server/_libs/remark-rehype.mjs +0 -21
  300. package/.output/server/_libs/space-separated-tokens.mjs +0 -6
  301. package/.output/server/_libs/style-to-js.mjs +0 -72
  302. package/.output/server/_libs/style-to-object.mjs +0 -38
  303. package/.output/server/_libs/swr.mjs +0 -947
  304. package/.output/server/_libs/tailwind-merge.mjs +0 -3255
  305. package/.output/server/_libs/tanstack__react-virtual.mjs +0 -130
  306. package/.output/server/_libs/tanstack__virtual-core.mjs +0 -1319
  307. package/.output/server/_libs/three.mjs +0 -26016
  308. package/.output/server/_libs/trim-lines.mjs +0 -41
  309. package/.output/server/_libs/trough.mjs +0 -85
  310. package/.output/server/_libs/tslib.mjs +0 -1
  311. package/.output/server/_libs/ungap__structured-clone.mjs +0 -212
  312. package/.output/server/_libs/unified.mjs +0 -661
  313. package/.output/server/_libs/unist-util-is.mjs +0 -100
  314. package/.output/server/_libs/unist-util-position.mjs +0 -27
  315. package/.output/server/_libs/unist-util-stringify-position.mjs +0 -27
  316. package/.output/server/_libs/unist-util-visit-parents.mjs +0 -82
  317. package/.output/server/_libs/unist-util-visit.mjs +0 -24
  318. package/.output/server/_libs/use-callback-ref.mjs +0 -66
  319. package/.output/server/_libs/use-sidecar.mjs +0 -106
  320. package/.output/server/_libs/vfile-message.mjs +0 -138
  321. package/.output/server/_libs/vfile.mjs +0 -467
  322. package/.output/server/_sessionId-E_Dmopc-.mjs +0 -144
  323. package/.output/server/_sessionId-U54BAqdp.mjs +0 -82
  324. package/.output/server/_ssr/CompareDrawer-CksatPed.mjs +0 -1058
  325. package/.output/server/_ssr/InspectorPet-DNc4GQ7z.mjs +0 -936
  326. package/.output/server/_ssr/ProxyViewerContainer-B02Ey0p_.mjs +0 -17607
  327. package/.output/server/_ssr/ReplayDialog-DdMvHJF1.mjs +0 -723
  328. package/.output/server/_ssr/RequestAnatomy--vh2Z8__.mjs +0 -835
  329. package/.output/server/_ssr/ResponseView-Dhxc-cKC.mjs +0 -755
  330. package/.output/server/_ssr/StreamingChunkSequence-BG0EQmaD.mjs +0 -272
  331. package/.output/server/_ssr/index-D0At9nfd.mjs +0 -82
  332. package/.output/server/_ssr/index-lcfulIXa.mjs +0 -133
  333. package/.output/server/_ssr/json-viewer-My1J1_5R.mjs +0 -481
  334. package/.output/server/_ssr/start-HYkvq4Ni.mjs +0 -4
  335. package/.output/server/_tanstack-start-manifest_v-B2chR8ef.mjs +0 -4
  336. package/.output/server/node_modules/tslib/modules/index.js +0 -70
  337. package/.output/server/node_modules/tslib/modules/package.json +0 -3
  338. package/.output/server/node_modules/tslib/package.json +0 -47
  339. package/.output/server/node_modules/tslib/tslib.js +0 -484
  340. package/.output/server/package.json +0 -9
  341. package/src/routes/__root.tsx +0 -170
  342. /package/.output/{public → ui}/assets/agent-inspector-58K1_MsC.ico +0 -0
  343. /package/.output/{public → ui}/assets/alibaba-TTwafVwX.svg +0 -0
  344. /package/.output/{public → ui}/assets/minimax-BPMzvuL-.jpeg +0 -0
  345. /package/.output/{public → ui}/assets/qwen-mMn3f5ul.webp +0 -0
  346. /package/.output/{public → ui}/assets/zhipuai-BPNAnxo-.svg +0 -0
  347. /package/src/{routes → backend/routes}/livez.ts +0 -0
@@ -24,6 +24,22 @@ export type SkillOnboardContext = {
24
24
  readonly version: string;
25
25
  /** The default proxy port (mirrors `DEFAULT_PORT` in `src/cli.ts`). */
26
26
  readonly port: number;
27
+ /** Public backend control/agent Base URL, including the configured Base Path. */
28
+ readonly baseUrl: string;
29
+ /** Optional composed or standalone UI URL. Undefined preserves the legacy composed default. */
30
+ readonly uiUrl?: string | null;
31
+ /** REST/SSE Base URL. Falls back to baseUrl for compatibility. */
32
+ readonly controlBaseUrl?: string;
33
+ /** Proxy/MCP Base URL. Falls back to baseUrl for compatibility. */
34
+ readonly agentBaseUrl?: string;
35
+ /** MCP config key selected by onboarding. */
36
+ readonly mcpName?: string;
37
+ /** Selected onboarding target type. */
38
+ readonly targetKind?: "default" | "instance" | "base-url";
39
+ /** Normalized registry name for a named target. */
40
+ readonly instanceName?: string | null;
41
+ /** CLI arguments that reproduce the selected target. */
42
+ readonly onboardTargetArguments?: string;
27
43
  /**
28
44
  * One-line "detected tools" summary written into the Preflight phase so the
29
45
  * skill's instructions match the user's actual environment. Empty string
@@ -47,9 +63,70 @@ export const REQUIRED_PHASE_HEADINGS = [
47
63
 
48
64
  export function renderSkillOnboard(ctx: SkillOnboardContext): string {
49
65
  const { version, port, detectedSummary } = ctx;
66
+ const controlBaseUrl = ctx.controlBaseUrl ?? ctx.baseUrl;
67
+ const agentBaseUrl = ctx.agentBaseUrl ?? ctx.baseUrl;
68
+ const uiUrl = ctx.uiUrl === undefined ? ctx.baseUrl : ctx.uiUrl;
69
+ const mcpName = ctx.mcpName ?? "agent-inspector";
70
+ const targetKind = ctx.targetKind ?? "default";
71
+ const targetArguments = ctx.onboardTargetArguments ?? "";
72
+ const instanceName = ctx.instanceName ?? null;
73
+ const healthUrl = `${controlBaseUrl}/api/health`;
74
+ const runtimeUrl = `${controlBaseUrl}/api/runtime`;
75
+ const configUrl = `${controlBaseUrl}/api/config`;
76
+ const anthropicProxyUrl = `${agentBaseUrl}/proxy`;
77
+ const openAiProxyUrl = `${agentBaseUrl}/proxy/v1`;
78
+ const mcpUrl = `${agentBaseUrl}/api/mcp`;
79
+ const logsUrl = `${controlBaseUrl}/api/logs`;
80
+ const providersUrl = `${controlBaseUrl}/api/providers`;
81
+ const statusCommand = `agent-inspector onboard --status${targetArguments}`;
82
+ const refreshCommand = `agent-inspector onboard --force${targetArguments}`;
83
+ const startCommand =
84
+ targetKind === "instance" && instanceName !== null
85
+ ? `agent-inspector instance start ${instanceName}`
86
+ : targetKind === "base-url"
87
+ ? `# Explicit control target ${controlBaseUrl}: do not start a replacement local runtime.`
88
+ : "agent-inspector --mode simple --background --no-open";
89
+ const fullModeCommand =
90
+ targetKind === "instance" && instanceName !== null
91
+ ? `agent-inspector instance restart ${instanceName} --mode full`
92
+ : targetKind === "base-url"
93
+ ? "ask the target operator to enable Full capture mode"
94
+ : "agent-inspector --mode full --force-restart";
95
+ const bashStartSnippet =
96
+ targetKind === "base-url" ? startCommand : `${startCommand} > /tmp/agent-inspector.log 2>&1`;
97
+ const windowsStartArguments =
98
+ targetKind === "instance" && instanceName !== null
99
+ ? `instance start ${instanceName}`
100
+ : "--mode simple --background --no-open";
101
+ const powershellStartSnippet =
102
+ targetKind === "base-url"
103
+ ? startCommand
104
+ : `$found = Get-Command agent-inspector -ErrorAction SilentlyContinue
105
+ if (-not $found) { throw 'agent-inspector is not on PATH' }
106
+ & $found.Source ${windowsStartArguments}`;
107
+ const startExplanation =
108
+ targetKind === "base-url"
109
+ ? `The selected Inspector target uses control Base URL \`${controlBaseUrl}\` and agent Base URL \`${agentBaseUrl}\`. Do not launch a default local runtime as a substitute; verify the selected target and ask its operator for help if it is unavailable.`
110
+ : `Start or reuse the selected Inspector backend. Its public control and agent endpoints preserve the selected Base Path; a Web UI may be composed at the same URL, hosted separately, or intentionally absent in backend-only mode. Use \`${fullModeCommand}\` only when the user needs raw headers, raw response, or SSE chunks.`;
111
+ const stopSnippet =
112
+ targetKind === "instance" && instanceName !== null
113
+ ? `agent-inspector instance stop ${instanceName}`
114
+ : targetKind === "base-url"
115
+ ? `# Ask the operator of ${controlBaseUrl} to stop the selected runtime.`
116
+ : `# Unix / macOS\n lsof -ti:${String(port)} | xargs -r kill -9\n\n # Windows PowerShell\n Get-NetTCPConnection -LocalPort ${String(port)} | ForEach-Object { Stop-Process -Id $_.OwningProcess -Force }`;
117
+ const providerScopeGuidance =
118
+ targetKind === "default"
119
+ ? "The unmanaged default target owns the local Agent Inspector data directory used by the file checks below."
120
+ : `The selected target is not the unmanaged default data directory. Do not inspect or edit local ~/.agent-inspector Provider files as a substitute. Query \`${providersUrl}\`, use the selected target's MCP Provider tools with explicit approval, or ask its operator to configure Providers. Skip local-file commands below.`;
121
+ const selectedUi =
122
+ uiUrl === null ? "not supplied (do not infer one from a backend URL)" : `\`${uiUrl}\``;
123
+ const uiTour =
124
+ uiUrl === null
125
+ ? "not supplied; continue with MCP/REST, and ask the operator for a standalone UI URL only if the user needs one"
126
+ : `\`${uiUrl}\` — use this explicit composed or standalone browser URL; do not replace it with the control or agent Base URL`;
50
127
  return `---
51
128
  name: agent-inspector-onboard
52
- description: Guided setup for Agent Inspector v${version}: start the proxy, wire your AI coding tool, capture your first request, and learn the Web UI.
129
+ description: Guided setup for Agent Inspector v${version}: start or select the backend, wire your AI coding tool, and capture your first request with or without a Web UI.
53
130
  metadata:
54
131
  author: agent-inspector
55
132
  version: ${version}
@@ -57,12 +134,16 @@ metadata:
57
134
 
58
135
  # Agent Inspector onboard
59
136
 
60
- Guide the user from "I just installed Agent Inspector" to "I can see my AI tool's traffic in the Web UI". This is a teaching experience: you'll do real work in their environment while explaining each step.
137
+ Guide the user from "I just installed Agent Inspector" to "my coding agent can use the proxy, REST API, and MCP surface". The backend works in composed and headless deployments; treat the Web UI as an optional presentation surface.
61
138
 
62
139
  Environment detected by the installer:
63
140
  ${detectedSummary || " (no known AI tool detected — the user can still use the generic curl example in Phase 4)"}
64
141
 
65
- Default proxy port: \`${port}\` (override with \`PORT=<n> agent-inspector\` or \`--port <n>\`).
142
+ Selected Inspector surfaces:
143
+ - UI URL: ${selectedUi}
144
+ - Control Base URL: \`${controlBaseUrl}\`
145
+ - Agent Base URL: \`${agentBaseUrl}\`
146
+ - MCP key: \`${mcpName}\`
66
147
 
67
148
  > **PAUSE protocol.** Every \`**PAUSE**\` marker in this skill is a real stop.
68
149
  > Use the \`AskUserQuestion\` tool to actually wait for the user before
@@ -77,22 +158,24 @@ Default proxy port: \`${port}\` (override with \`PORT=<n> agent-inspector\` or \
77
158
  **EXPLAIN:** "Before we do anything, let me see what's already set up. If some of the steps are already done, we can skip them."
78
159
 
79
160
  **DO:** First check whether the generated onboarding files match the installed npm package. If any
80
- entry is \`outdated\` or \`missing\`, tell the user to run \`agent-inspector onboard --force\` before
161
+ entry is \`outdated\` or \`missing\`, tell the user to run \`${refreshCommand}\` before
81
162
  continuing so they are not guided by stale instructions.
82
163
 
83
164
  \`\`\`bash
84
- agent-inspector onboard --status
165
+ ${statusCommand}
85
166
  \`\`\`
86
167
 
87
168
  \`\`\`powershell
88
- agent-inspector onboard --status
169
+ ${statusCommand}
89
170
  \`\`\`
90
171
 
91
172
  **DO:** Then probe the three pieces of state this skill touches. Use targeted checks — do **not** read large JSON files into the conversation.
92
173
 
174
+ **DO:** ${providerScopeGuidance}
175
+
93
176
  \`\`\`bash
94
- # 1. Is the proxy already up?
95
- curl -fsS "http://localhost:${port}/api/health" 2>/dev/null && echo "PROXY: up" || echo "PROXY: down"
177
+ # 1. Is the backend already up?
178
+ curl -fsS "${healthUrl}" 2>/dev/null && echo "BACKEND: up" || echo "BACKEND: down"
96
179
 
97
180
  # 2. Does the provider config have a real provider key?
98
181
  agent_inspector_data_dir() {
@@ -123,9 +206,9 @@ fi
123
206
  # 3. Is the MCP server already wired? (project .mcp.json wins)
124
207
  PROJ_MCP=".mcp.json"
125
208
  HOME_MCP="$HOME/.claude.json"
126
- if [ -f "$PROJ_MCP" ] && grep -q '"agent-inspector"' "$PROJ_MCP"; then
209
+ if [ -f "$PROJ_MCP" ] && grep -q '"${mcpName}"' "$PROJ_MCP"; then
127
210
  echo "MCP: wired in $PROJ_MCP"
128
- elif [ -f "$HOME_MCP" ] && grep -q '"agent-inspector"' "$HOME_MCP"; then
211
+ elif [ -f "$HOME_MCP" ] && grep -q '"${mcpName}"' "$HOME_MCP"; then
129
212
  echo "MCP: wired in $HOME_MCP"
130
213
  else
131
214
  echo "MCP: not wired"
@@ -153,12 +236,12 @@ $dataDir = Resolve-AgentInspectorDataDir
153
236
  $providers = Join-Path $dataDir 'providers.json'
154
237
  $legacyConfig = Join-Path $dataDir 'config.json'
155
238
 
156
- # 1. Is the proxy already up?
239
+ # 1. Is the backend already up?
157
240
  try {
158
- $null = Invoke-RestMethod -Uri "http://localhost:$port/api/health" -TimeoutSec 2 -ErrorAction Stop
159
- Write-Host 'PROXY: up'
241
+ $null = Invoke-RestMethod -Uri "${healthUrl}" -TimeoutSec 2 -ErrorAction Stop
242
+ Write-Host 'BACKEND: up'
160
243
  } catch {
161
- Write-Host 'PROXY: down'
244
+ Write-Host 'BACKEND: down'
162
245
  }
163
246
 
164
247
  # 2. Does the config have a real provider key?
@@ -180,9 +263,9 @@ if ((Test-Path $providers) -or (Test-Path $legacyConfig)) {
180
263
  # 3. Is the MCP server already wired? (project .mcp.json wins)
181
264
  $projMcp = Join-Path (Get-Location) '.mcp.json'
182
265
  $homeMcp = Join-Path $env:USERPROFILE '.claude.json'
183
- if ((Test-Path $projMcp) -and (Select-String -Path $projMcp -Pattern 'agent-inspector' -Quiet)) {
266
+ if ((Test-Path $projMcp) -and (Select-String -Path $projMcp -SimpleMatch '${mcpName}' -Quiet)) {
184
267
  Write-Host "MCP: wired in $projMcp"
185
- } elseif ((Test-Path $homeMcp) -and (Select-String -Path $homeMcp -Pattern 'agent-inspector' -Quiet)) {
268
+ } elseif ((Test-Path $homeMcp) -and (Select-String -Path $homeMcp -SimpleMatch '${mcpName}' -Quiet)) {
186
269
  Write-Host "MCP: wired in $homeMcp"
187
270
  } else {
188
271
  Write-Host 'MCP: not wired'
@@ -228,7 +311,7 @@ node -e "const fs=require('node:fs'),p=require('node:path');const names=process.
228
311
  \`\`\`
229
312
  ## Welcome to Agent Inspector!
230
313
 
231
- Agent Inspector is an agent observability and knowledge-capture platform for AI coding tools. The \`agent-inspector\` CLI runs a transparent local proxy + Web UI, so you can see model requests and responses, system prompts, tool definitions, message history, timing, and token counts captured live in a browser tab.
314
+ Agent Inspector is an agent observability and knowledge-capture platform for AI coding tools. Its backend owns the transparent model proxy, REST/SSE APIs, capture storage, and MCP server. The default CLI composes a Web UI at the same public Base URL, while \`--backend-only\` keeps every Coding Agent surface available without serving UI files.
232
315
 
233
316
  Agent Inspector starts in **Simple mode** by default. Simple mode is the right habit for everyday use: it keeps requests, responses, tools, timing, and token usage while avoiding heavier raw headers, raw response, and detailed SSE chunk artifacts. Use **Full mode** only when the user is debugging provider headers, raw response payloads, or SSE stream details.
234
317
 
@@ -248,6 +331,8 @@ Ready? Let's start with the provider.
248
331
 
249
332
  ## Phase 2: Provider setup
250
333
 
334
+ **DO:** ${providerScopeGuidance}
335
+
251
336
  **EXPLAIN:** "A 'provider' is an upstream LLM endpoint — Anthropic, OpenAI, MiniMax, etc. agent-inspector routes each request to the right upstream based on the model name. You need at least one provider configured for the proxy to forward traffic."
252
337
 
253
338
  **DO:** First, re-check whether \`<dataDir>/providers.json\` already has a real key (Phase 0 may have raced with a manual edit). Use the same data-dir resolution and \`grep -qE '"apiKey":"sk-'\` (bash) or \`Select-String\` (PowerShell) check from Phase 0. If a real key is present, skip the rest of this phase.
@@ -341,58 +426,46 @@ $json | Set-Content -Path $file -Encoding UTF8
341
426
 
342
427
  ## Phase 3: Start proxy
343
428
 
344
- **EXPLAIN:** "Time to start the proxy. It binds to port ${port} by default, starts in Simple mode for lower overhead, reuses an already-running healthy agent-inspector, and prints the URL. Use \`--force-restart\` only when you intentionally want to replace the existing process. If the user is diagnosing raw headers, raw response, or SSE chunks, restart with \`agent-inspector --mode full\`."
429
+ **EXPLAIN:** "${startExplanation}"
345
430
 
346
- **DO:** Skip this phase entirely if the Phase 0 health check already reported \`PROXY: up\` and the user opted to skip done phases.
431
+ **DO:** Skip this phase entirely if the Phase 0 health check already reported \`BACKEND: up\` and the user opted to skip done phases.
347
432
 
348
- **DO:** Otherwise, start the proxy with the explicit \`--background --no-open\` flags. On Windows, resolve the npm shim first and launch it through \`Start-Process -WindowStyle Hidden\` so setup does not flash a command window.
433
+ **DO:** Otherwise, use the selected target command below. An explicit wrapper Base URL is connection-only and must not cause a replacement local runtime to start.
349
434
 
350
435
  \`\`\`bash
351
- # Unix / macOS / WSL
352
- agent-inspector --mode simple --background --no-open > /tmp/agent-inspector.log 2>&1
436
+ ${bashStartSnippet}
353
437
  \`\`\`
354
438
 
355
439
  \`\`\`powershell
356
- # Windows PowerShell — single-quoted so $env: expands correctly.
357
- # Locate the binary on PATH first (works for npm, pnpm, yarn, volta, fnm).
358
- # If not on PATH, fall back to the common npm global shim at $env:APPDATA.
359
- # As a last resort, let cmd /c resolve it through PATHEXT.
360
- $log = Join-Path $env:TEMP 'agent-inspector.log'
361
- $err = Join-Path $env:TEMP 'agent-inspector.err.log'
362
- $found = Get-Command agent-inspector -ErrorAction SilentlyContinue
363
- if ($found) {
364
- $shim = $found.Source
365
- $args = '--mode','simple','--background','--no-open'
366
- } elseif (Test-Path (Join-Path $env:APPDATA 'npm/agent-inspector.cmd')) {
367
- $shim = Join-Path $env:APPDATA 'npm/agent-inspector.cmd'
368
- $args = '--mode','simple','--background','--no-open'
369
- } else {
370
- # bin not on PATH and not at the default npm prefix — let cmd resolve it
371
- $shim = 'cmd.exe'
372
- $args = '/c','agent-inspector','--mode','simple','--background','--no-open'
373
- }
374
- Start-Process -FilePath $shim -ArgumentList $args -RedirectStandardOutput $log -RedirectStandardError $err -WindowStyle Hidden
440
+ # Windows PowerShell
441
+ ${powershellStartSnippet}
375
442
  \`\`\`
376
443
 
377
- Then wait for the port to be ready:
444
+ Then wait for the selected backend health URL to be ready:
378
445
 
379
446
  \`\`\`bash
380
447
  for i in $(seq 1 20); do
381
- curl -fsS "http://localhost:${port}/api/health" >/dev/null 2>&1 && echo "ready" && break
448
+ curl -fsS "${healthUrl}" >/dev/null 2>&1 && echo "ready" && break
382
449
  sleep 0.5
383
450
  done
384
451
  \`\`\`
385
452
 
386
- **DO:** Hit the health endpoint to confirm the proxy is alive:
453
+ **DO:** Hit the health endpoint to confirm the backend is alive:
387
454
 
388
455
  \`\`\`bash
389
- curl -sS "http://localhost:${port}/api/health"
456
+ curl -sS "${healthUrl}"
390
457
  \`\`\`
391
458
 
392
- **DO:** Read \`/api/config\` and tell the user which capture mode is active. If it is not \`simple\` during onboarding, explain that an existing process is already running and offer to restart with \`agent-inspector --mode simple --force-restart\`.
459
+ **DO:** Read the token-free runtime discovery document. Report \`deploymentMode\` and capabilities; do not treat \`backend-only\` as a failure or infer that a UI is present.
393
460
 
394
461
  \`\`\`bash
395
- curl -sS "http://localhost:${port}/api/config" | grep -o '"captureMode":"[^"]*"'
462
+ curl -sS "${runtimeUrl}"
463
+ \`\`\`
464
+
465
+ **DO:** Read \`/api/config\` and tell the user which capture mode is active. If deeper capture is required, offer \`${fullModeCommand}\`.
466
+
467
+ \`\`\`bash
468
+ curl -sS "${configUrl}" | grep -o '"captureMode":"[^"]*"'
396
469
  \`\`\`
397
470
 
398
471
  > **PAUSE** — if the health check fails, show the user the log file (\`/tmp/agent-inspector.log\` or \`%TEMP%\\agent-inspector.log\`) and diagnose. Common issues: another process on the port, firewall, missing providers. Use \`AskUserQuestion\` with header \`Proxy up?\` and options \`["Yes, proxy is up", "No, I see an error in the log"]\`. Wait for the answer.
@@ -407,18 +480,18 @@ curl -sS "http://localhost:${port}/api/config" | grep -o '"captureMode":"[^"]*"'
407
480
 
408
481
  \`\`\`bash
409
482
  # Claude Code
410
- export ANTHROPIC_BASE_URL=http://localhost:${port}/proxy
483
+ export ANTHROPIC_BASE_URL=${anthropicProxyUrl}
411
484
  claude
412
485
 
413
486
  # OpenCode
414
- export LLM_BASE_URL=http://localhost:${port}/proxy
487
+ export LLM_BASE_URL=${openAiProxyUrl}
415
488
  opencode
416
489
 
417
490
  # MiMo Code
418
- export OPENAI_BASE_URL=http://localhost:${port}/proxy
491
+ export OPENAI_BASE_URL=${openAiProxyUrl}
419
492
  mimo
420
493
 
421
- # Cursor / Cody — set the OpenAI base URL in each tool's settings panel to http://localhost:${port}/proxy
494
+ # Cursor / Cody — set the OpenAI base URL in each tool's settings panel to ${openAiProxyUrl}
422
495
  \`\`\`
423
496
 
424
497
  **Container/network note:** If the AI tool runs in a different container, VM, WSL distro, or host
@@ -434,32 +507,32 @@ For a tool that wasn't auto-detected, fall through to the generic curl test in t
434
507
 
435
508
  ## Phase 4.5: Wire MCP server
436
509
 
437
- **EXPLAIN:** "The proxy also exposes an MCP server at \`http://localhost:${port}/api/mcp\`. Your AI agent can query logs, replay requests, and test providers through it — no need to leave the editor."
510
+ **EXPLAIN:** "The proxy also exposes an MCP server at \`${mcpUrl}\`. Your AI agent can query logs, replay requests, and test providers through it — no need to leave the editor."
438
511
 
439
512
  **DO:** Skip this phase if Phase 0 reported \`MCP: wired in <path>\` and the user opted to skip done phases.
440
513
 
441
514
  **DO:** Otherwise, check the project-level \`.mcp.json\` first (preferred — modern Claude Code convention), then fall back to \`~/.claude.json\`. Use the \`Read\` tool to inspect; do **not** \`cat\` a 40 KB file into the conversation.
442
515
 
443
- If neither has an \`agent-inspector\` entry, add one. The simplest path is to write to project \`.mcp.json\` (create it if missing):
516
+ If neither has a \`${mcpName}\` entry, add one. The simplest path is to write to project \`.mcp.json\` (create it if missing):
444
517
 
445
518
  \`\`\`json
446
519
  // .mcp.json (project root)
447
520
  {
448
521
  "mcpServers": {
449
- "agent-inspector": {
522
+ "${mcpName}": {
450
523
  "type": "http",
451
- "url": "http://localhost:${port}/api/mcp"
524
+ "url": "${mcpUrl}"
452
525
  }
453
526
  }
454
527
  }
455
528
  \`\`\`
456
529
 
457
- If \`mcpServers\` already exists in \`.mcp.json\`, merge the \`agent-inspector\` key into it via the \`Edit\` tool — do not overwrite other entries. If you can't create a project \`.mcp.json\` (no project root, permission, etc.), fall back to merging into \`~/.claude.json\` using the same \`Read\`/\`Edit\` pattern.
530
+ If \`mcpServers\` already exists in \`.mcp.json\`, merge only the \`${mcpName}\` key into it via the \`Edit\` tool — do not overwrite other entries. If you can't create a project \`.mcp.json\` (no project root, permission, etc.), fall back to merging into \`~/.claude.json\` using the same \`Read\`/\`Edit\` pattern.
458
531
 
459
532
  **DO:** Verify the handshake. The MCP \`initialize\` request should return 200 with a \`serverInfo\` payload — that proves the server is mounted and reachable:
460
533
 
461
534
  \`\`\`bash
462
- curl -sS -X POST "http://localhost:${port}/api/mcp" \\
535
+ curl -sS -X POST "${mcpUrl}" \\
463
536
  -H "Content-Type: application/json" \\
464
537
  -H "Accept: application/json, text/event-stream" \\
465
538
  -d '{
@@ -489,7 +562,7 @@ The \`grep -o '"name":"agent-inspector"'\` extracts only the serverInfo name —
489
562
  Fire a minimal Anthropic-format request through the proxy:
490
563
 
491
564
  \`\`\`bash
492
- curl -sS -X POST "http://localhost:${port}/proxy/v1/messages" \\
565
+ curl -sS -X POST "${anthropicProxyUrl}/v1/messages" \\
493
566
  -H "Content-Type: application/json" \\
494
567
  -H "anthropic-version: 2023-06-01" \\
495
568
  -H "x-api-key: \${AGENT_INSPECTOR_API_KEY:-sk-no-key-needed-for-routing}" \\
@@ -501,7 +574,7 @@ curl -sS -X POST "http://localhost:${port}/proxy/v1/messages" \\
501
574
 
502
575
  \`\`\`bash
503
576
  for i in $(seq 1 10); do
504
- resp=$(curl -sS "http://localhost:${port}/api/logs?limit=1")
577
+ resp=$(curl -sS "${logsUrl}?limit=1")
505
578
  count=$(echo "$resp" | grep -o '"total":[0-9]*' | head -1 | grep -o '[0-9]*$')
506
579
  if [ "\${count:-0}" -ge 1 ]; then
507
580
  echo "captured"
@@ -528,25 +601,22 @@ done
528
601
 
529
602
  ## Phase 6: Tour & wrap
530
603
 
531
- **EXPLAIN:** "Everything's working. Here's the cheat sheet for the Web UI and the supporting surfaces:"
604
+ **EXPLAIN:** "Everything's working. Here's the cheat sheet for the backend surfaces and the optional Web UI:"
532
605
 
533
- - **Web UI**: \`http://localhost:${port}/\`collapsible log rows, per-tab Copy/Expand in the log header, Diff with Raw (request body), Diff with Previous (compare adjacent requests), Replay (re-send a request), Export (JSON ZIP).
534
- - **MCP server**: \`http://localhost:${port}/api/mcp\` — connect from your coding agent to query logs, replay, and test providers without leaving the editor. Look for the "MCP Ready" badge in the Web UI header.
606
+ - **Runtime discovery**: \`${runtimeUrl}\`token-free deployment mode, UI Base Path, control/agent Base URLs, and capabilities.
607
+ - **Web UI**: ${uiTour}.
608
+ - **MCP server**: \`${mcpUrl}\` — connect from the coding agent to query logs, replay, and test providers; it does not require a Web UI process.
535
609
  - **REST API**: \`/api/logs\`, \`/api/sessions\`, \`/api/providers\` — for scripting and shell-based inspection.
536
610
  - **Stop the proxy**:
537
611
 
538
612
  \`\`\`bash
539
- # Unix / macOS
540
- lsof -ti:${port} | xargs -r kill -9
541
-
542
- # Windows PowerShell — single-quoted so $env: expands correctly
543
- Get-NetTCPConnection -LocalPort $port | ForEach-Object { Stop-Process -Id $_.OwningProcess -Force }
613
+ ${stopSnippet}
544
614
  \`\`\`
545
615
 
546
- - **Re-run onboard**: \`agent-inspector onboard --force\` refreshes this skill.
547
- - **Check onboard files**: \`agent-inspector onboard --status\` shows whether generated skills are
616
+ - **Re-run onboard**: \`${refreshCommand}\` refreshes this skill.
617
+ - **Check onboard files**: \`${statusCommand}\` shows whether generated skills are
548
618
  current, outdated, missing, newer, or custom.
549
- - **Full docs**: see the project README (linked from the Web UI footer).
619
+ - **Full docs**: see the project README; do not depend on a UI footer being available.
550
620
 
551
621
  > **PAUSE** — use \`AskUserQuestion\` with header \`All set?\` and options \`["All set, I'm done", "Wait, I want to revisit a phase"]\`. Wait for the answer.
552
622