@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
@@ -0,0 +1,167 @@
1
+ import { AGENT_INSPECTOR_BASE_PATH_META_NAME } from "../lib/basePath";
2
+ import { THEME_MODE_STORAGE_KEY } from "../lib/themeMode";
3
+ import {
4
+ UI_SCALE_AUTO_LARGE_WIDTH,
5
+ UI_SCALE_AUTO_MAX_DPR,
6
+ UI_SCALE_AUTO_MEDIUM_WIDTH,
7
+ UI_SCALE_MINIMUM_COMPACT_FONT_SIZE,
8
+ UI_SCALE_STORAGE_KEY,
9
+ } from "../lib/uiScale";
10
+
11
+ export const UI_BASE_PATH_BOOTSTRAP_PLACEHOLDER = "__AGENT_INSPECTOR_BASE_PATH_BOOTSTRAP__";
12
+ export const UI_BASE_PATH_META_PLACEHOLDER = "__AGENT_INSPECTOR_BASE_PATH__";
13
+ export const UI_RUNTIME_CSP_BOOTSTRAP_PLACEHOLDER = "__AGENT_INSPECTOR_RUNTIME_CSP_BOOTSTRAP__";
14
+ export const UI_THEME_BOOTSTRAP_PLACEHOLDER = "__AGENT_INSPECTOR_THEME_BOOTSTRAP__";
15
+ export const UI_SCALE_BOOTSTRAP_PLACEHOLDER = "__AGENT_INSPECTOR_UI_SCALE_BOOTSTRAP__";
16
+
17
+ export const basePathBootstrapScript = `
18
+ (function () {
19
+ var placeholder = "__AGENT_INSPECTOR_" + "BASE_PATH__";
20
+ var meta = document.querySelector('meta[name="${AGENT_INSPECTOR_BASE_PATH_META_NAME}"]');
21
+ var base = document.querySelector("base");
22
+
23
+ function normalize(value) {
24
+ var trimmed = typeof value === "string" ? value.trim() : "";
25
+ if (trimmed === "" || trimmed === "/") return "";
26
+ return "/" + trimmed.replace(/^\\/+|\\/+$/g, "");
27
+ }
28
+
29
+ function inferFromKnownUiRoute() {
30
+ var pathname = window.location.pathname;
31
+ var sessionMarker = "/session/";
32
+ var sessionIndex = pathname.indexOf(sessionMarker);
33
+ if (sessionIndex >= 0) return normalize(pathname.slice(0, sessionIndex));
34
+ return normalize(pathname.replace(/\\/index\\.html$/, ""));
35
+ }
36
+
37
+ function runtimeBasePath() {
38
+ var runtime = window.__AGENT_INSPECTOR_RUNTIME__;
39
+ if (
40
+ runtime !== null &&
41
+ typeof runtime === "object" &&
42
+ runtime.ui !== null &&
43
+ typeof runtime.ui === "object" &&
44
+ typeof runtime.ui.basePath === "string"
45
+ ) {
46
+ return runtime.ui.basePath;
47
+ }
48
+ return null;
49
+ }
50
+
51
+ var configured = meta === null ? placeholder : meta.getAttribute("content");
52
+ var runtimePath = runtimeBasePath();
53
+ var basePath = configured !== null && configured !== placeholder
54
+ ? normalize(configured)
55
+ : runtimePath === null
56
+ ? inferFromKnownUiRoute()
57
+ : normalize(runtimePath);
58
+ var baseHref = basePath === "" ? "/" : basePath + "/";
59
+
60
+ if (meta !== null) meta.setAttribute("content", basePath === "" ? "/" : basePath);
61
+ if (base !== null) base.setAttribute("href", baseHref);
62
+ })();
63
+ `;
64
+
65
+ export const runtimeCspBootstrapScript = `
66
+ (function () {
67
+ var runtime = window.__AGENT_INSPECTOR_RUNTIME__;
68
+ var controlBaseUrl = runtime !== null && typeof runtime === "object" &&
69
+ runtime.control !== null && typeof runtime.control === "object" &&
70
+ typeof runtime.control.baseUrl === "string"
71
+ ? runtime.control.baseUrl
72
+ : null;
73
+ var controlOrigin = null;
74
+ if (controlBaseUrl !== null) {
75
+ try {
76
+ var parsed = new URL(controlBaseUrl);
77
+ if (parsed.protocol === "http:" || parsed.protocol === "https:") {
78
+ controlOrigin = parsed.origin;
79
+ }
80
+ } catch (error) {}
81
+ }
82
+ var uiOrigin = new URL(document.baseURI).origin;
83
+ var connectSources = controlOrigin === null || controlOrigin === uiOrigin
84
+ ? "'self'"
85
+ : "'self' " + controlOrigin;
86
+ var policy = [
87
+ "default-src 'self'",
88
+ "base-uri 'self'",
89
+ "connect-src " + connectSources,
90
+ "font-src 'self' data:",
91
+ "form-action 'self'",
92
+ "img-src 'self' data: blob:",
93
+ "object-src 'none'",
94
+ "script-src 'self' 'unsafe-inline'",
95
+ "style-src 'self' 'unsafe-inline'",
96
+ "worker-src 'self' blob:"
97
+ ].join("; ");
98
+ var meta = document.querySelector('meta[http-equiv="Content-Security-Policy"]');
99
+ if (meta === null) {
100
+ meta = document.createElement("meta");
101
+ meta.setAttribute("http-equiv", "Content-Security-Policy");
102
+ document.head.appendChild(meta);
103
+ }
104
+ meta.setAttribute("content", policy);
105
+ })();
106
+ `;
107
+
108
+ export const themeModeBootstrapScript = `
109
+ (function () {
110
+ try {
111
+ var storedThemeMode = window.localStorage.getItem("${THEME_MODE_STORAGE_KEY}");
112
+ var themeMode = storedThemeMode === "light" || storedThemeMode === "eye-care"
113
+ ? storedThemeMode
114
+ : "dark";
115
+ document.documentElement.dataset.theme = themeMode;
116
+ } catch (error) {
117
+ document.documentElement.dataset.theme = "dark";
118
+ }
119
+ })();
120
+ `;
121
+
122
+ export const uiScaleBootstrapScript = `
123
+ (function () {
124
+ try {
125
+ var storedUiScale = window.localStorage.getItem("${UI_SCALE_STORAGE_KEY}");
126
+ var uiScalePreference = storedUiScale === "100" || storedUiScale === "125" || storedUiScale === "150"
127
+ ? storedUiScale
128
+ : "auto";
129
+ var resolvedUiScale = 1;
130
+ if (uiScalePreference === "125") resolvedUiScale = 1.25;
131
+ if (uiScalePreference === "150") resolvedUiScale = 1.5;
132
+ if (uiScalePreference === "auto") {
133
+ var viewportWidth = Number.isFinite(window.innerWidth) && window.innerWidth > 0
134
+ ? window.innerWidth
135
+ : 1280;
136
+ var rawScreenWidth = typeof window.screen === "undefined"
137
+ ? viewportWidth
138
+ : window.screen.availWidth;
139
+ var screenWidth = Number.isFinite(rawScreenWidth) && rawScreenWidth > 0
140
+ ? rawScreenWidth
141
+ : viewportWidth;
142
+ var rawDevicePixelRatio = window.devicePixelRatio;
143
+ var devicePixelRatio = Number.isFinite(rawDevicePixelRatio) && rawDevicePixelRatio > 0
144
+ ? rawDevicePixelRatio
145
+ : 1;
146
+ var availableWidth = Math.min(viewportWidth, screenWidth);
147
+ if (devicePixelRatio <= ${String(UI_SCALE_AUTO_MAX_DPR)} && availableWidth >= ${String(UI_SCALE_AUTO_LARGE_WIDTH)}) {
148
+ resolvedUiScale = 1.25;
149
+ } else if (devicePixelRatio <= ${String(UI_SCALE_AUTO_MAX_DPR)} && availableWidth >= ${String(UI_SCALE_AUTO_MEDIUM_WIDTH)}) {
150
+ resolvedUiScale = 1.125;
151
+ }
152
+ }
153
+ var root = document.documentElement;
154
+ root.dataset.uiScale = uiScalePreference;
155
+ root.dataset.uiScaleResolved = String(Math.round(resolvedUiScale * 100));
156
+ root.style.setProperty("--inspector-ui-scale", String(resolvedUiScale));
157
+ root.style.setProperty("--inspector-root-font-size", String(16 * resolvedUiScale) + "px");
158
+ root.style.setProperty("--inspector-font-9", String(Math.max(${String(UI_SCALE_MINIMUM_COMPACT_FONT_SIZE)}, 9 * resolvedUiScale)) + "px");
159
+ root.style.setProperty("--inspector-font-10", String(Math.max(${String(UI_SCALE_MINIMUM_COMPACT_FONT_SIZE)}, 10 * resolvedUiScale)) + "px");
160
+ root.style.setProperty("--inspector-font-11", String(Math.max(${String(UI_SCALE_MINIMUM_COMPACT_FONT_SIZE)}, 11 * resolvedUiScale)) + "px");
161
+ root.style.setProperty("--inspector-font-13", String(13 * resolvedUiScale) + "px");
162
+ } catch (error) {
163
+ document.documentElement.dataset.uiScale = "auto";
164
+ document.documentElement.dataset.uiScaleResolved = "100";
165
+ }
166
+ })();
167
+ `;
@@ -0,0 +1,38 @@
1
+ <!doctype html>
2
+ <html lang="en" data-theme="dark">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <meta name="agent-inspector-base-path" content="__AGENT_INSPECTOR_BASE_PATH__" />
7
+ <base href="/" />
8
+ <script>
9
+ __AGENT_INSPECTOR_BASE_PATH_BOOTSTRAP__
10
+ </script>
11
+ <script vite-ignore src="./runtime-config.js"></script>
12
+ <script>
13
+ try {
14
+ window.__AGENT_INSPECTOR_RUNTIME__ = __AGENT_INSPECTOR_RUNTIME_JSON__;
15
+ } catch (error) {
16
+ window.__AGENT_INSPECTOR_RUNTIME__ = window.__AGENT_INSPECTOR_RUNTIME_CONFIG__ || {};
17
+ }
18
+ </script>
19
+ <script>
20
+ __AGENT_INSPECTOR_RUNTIME_CSP_BOOTSTRAP__
21
+ </script>
22
+ <script>
23
+ __AGENT_INSPECTOR_BASE_PATH_BOOTSTRAP__
24
+ </script>
25
+ <script>
26
+ __AGENT_INSPECTOR_THEME_BOOTSTRAP__
27
+ </script>
28
+ <script>
29
+ __AGENT_INSPECTOR_UI_SCALE_BOOTSTRAP__
30
+ </script>
31
+ <link rel="icon" type="image/svg+xml" href="../assets/favicon.svg" />
32
+ <title>Agent Inspector</title>
33
+ </head>
34
+ <body>
35
+ <div id="root"><p role="status">Connecting to Agent Inspector…</p></div>
36
+ <script type="module" src="./main.tsx"></script>
37
+ </body>
38
+ </html>
@@ -0,0 +1,20 @@
1
+ import {
2
+ buildControlRuntimeUrl,
3
+ resolveBrowserRuntimeForDocument,
4
+ } from "../lib/browserRuntimeResolver";
5
+
6
+ export function buildLogsStreamUrl(sessionId: string | undefined): string | null {
7
+ const params = new URLSearchParams({ compact: "1" });
8
+ if (sessionId !== undefined) {
9
+ params.set("sessionId", sessionId);
10
+ }
11
+ const runtime = resolveBrowserRuntimeForDocument();
12
+ if (!runtime.ok) return null;
13
+ return buildControlRuntimeUrl(runtime.runtime, `/api/logs/stream?${params.toString()}`);
14
+ }
15
+
16
+ export function openLogsEventSource(sessionId: string | undefined): EventSource | null {
17
+ const url = buildLogsStreamUrl(sessionId);
18
+ if (url === null) return null;
19
+ return new EventSource(url);
20
+ }
@@ -0,0 +1,13 @@
1
+ import { RouterProvider } from "@tanstack/react-router";
2
+ import { createRoot } from "react-dom/client";
3
+ import "../index.css";
4
+ import { router } from "./router";
5
+ import { validateBrowserRuntimeForStartup } from "./runtimeDiscovery";
6
+
7
+ const rootElement = document.getElementById("root");
8
+
9
+ if (rootElement !== null) {
10
+ createRoot(rootElement).render(<RouterProvider router={router} />);
11
+ }
12
+
13
+ void validateBrowserRuntimeForStartup();
@@ -0,0 +1,2 @@
1
+ /* global window */
2
+ window.__AGENT_INSPECTOR_RUNTIME_CONFIG__ = window.__AGENT_INSPECTOR_RUNTIME_CONFIG__ || {};
@@ -0,0 +1,13 @@
1
+ import { createRouter } from "@tanstack/react-router";
2
+ import { getConfiguredBasePath } from "../lib/basePath";
3
+ import { routeTree } from "./routeTree.gen";
4
+
5
+ export function createUiRouter(basepath = getConfiguredBasePath()) {
6
+ return createRouter({
7
+ routeTree,
8
+ basepath,
9
+ scrollRestoration: false,
10
+ });
11
+ }
12
+
13
+ export const router = createUiRouter();
@@ -0,0 +1,69 @@
1
+ import { Outlet, createRootRoute } from "@tanstack/react-router";
2
+ import { useEffect, type ReactNode } from "react";
3
+ import { SWRConfig } from "swr";
4
+ import { SafeErrorBoundary, SafeRouteError } from "../../components/errors/SafeErrorBoundary";
5
+ import { withBasePath } from "../../lib/basePath";
6
+ import { installChunkLoadRecovery } from "../../lib/chunkLoadRecovery";
7
+
8
+ export const Route = createRootRoute({
9
+ component: RootComponent,
10
+ errorComponent: RootRouteErrorComponent,
11
+ notFoundComponent: RootNotFoundComponent,
12
+ });
13
+
14
+ function UiProviders({ children }: Readonly<{ children: ReactNode }>) {
15
+ return (
16
+ <SWRConfig value={{ revalidateOnFocus: false, revalidateIfStale: false }}>{children}</SWRConfig>
17
+ );
18
+ }
19
+
20
+ function RootComponent() {
21
+ useEffect(() => installChunkLoadRecovery(), []);
22
+
23
+ return (
24
+ <UiProviders>
25
+ <SafeErrorBoundary
26
+ scope="root-render"
27
+ title="Agent Inspector could not continue"
28
+ description="The application stopped this render safely. Retry or reload Inspector."
29
+ variant="page"
30
+ >
31
+ <Outlet />
32
+ </SafeErrorBoundary>
33
+ </UiProviders>
34
+ );
35
+ }
36
+
37
+ function RootRouteErrorComponent({ error, reset }: { error: Error; reset: () => void }) {
38
+ return (
39
+ <UiProviders>
40
+ <SafeRouteError error={error} reset={reset} scope="root-route" />
41
+ </UiProviders>
42
+ );
43
+ }
44
+
45
+ function RootNotFoundComponent() {
46
+ return (
47
+ <UiProviders>
48
+ <main className="min-h-screen bg-background text-foreground">
49
+ <div className="mx-auto flex min-h-screen w-full max-w-3xl flex-col justify-center px-6 py-16">
50
+ <div className="rounded-lg border border-border/70 bg-card/60 p-8 shadow-sm">
51
+ <div className="font-mono text-xs uppercase tracking-wider text-muted-foreground">
52
+ 404
53
+ </div>
54
+ <h1 className="mt-3 text-2xl font-semibold">Page not found</h1>
55
+ <p className="mt-3 max-w-xl text-sm leading-6 text-muted-foreground">
56
+ This route is not part of the Agent Inspector UI.
57
+ </p>
58
+ <a
59
+ href={withBasePath("/")}
60
+ className="mt-6 inline-flex h-9 items-center justify-center rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90"
61
+ >
62
+ Open Agent Inspector
63
+ </a>
64
+ </div>
65
+ </div>
66
+ </main>
67
+ </UiProviders>
68
+ );
69
+ }
@@ -1,10 +1,9 @@
1
1
  import { createFileRoute } from "@tanstack/react-router";
2
2
  import { useEffect, useState, type JSX } from "react";
3
- import { SafeRouteError } from "../components/errors/SafeErrorBoundary";
4
- import { ProxyViewerContainer } from "../components/ProxyViewerContainer";
3
+ import { SafeRouteError } from "../../components/errors/SafeErrorBoundary";
4
+ import { ProxyViewerContainer } from "../../components/ProxyViewerContainer";
5
5
 
6
6
  export const Route = createFileRoute("/")({
7
- ssr: false,
8
7
  component: ClientOnlyProxyViewerRoute,
9
8
  errorComponent: HomeRouteError,
10
9
  });
@@ -1,16 +1,10 @@
1
1
  import { createFileRoute } from "@tanstack/react-router";
2
2
  import { useEffect, useState, type JSX } from "react";
3
- import { SafeRouteError } from "../../components/errors/SafeErrorBoundary";
4
- import { ProxyViewerContainer } from "../../components/ProxyViewerContainer";
5
- import { decodeSessionIdFromPath, encodeSessionIdForPath } from "../../lib/sessionUrl";
3
+ import { SafeRouteError } from "../../../components/errors/SafeErrorBoundary";
4
+ import { ProxyViewerContainer } from "../../../components/ProxyViewerContainer";
5
+ import { decodeSessionIdFromPath, encodeSessionIdForPath } from "../../../lib/sessionUrl";
6
6
 
7
- /**
8
- * Per-session deep link: opens a page that is pre-scoped to a single
9
- * session id. The path segment is base64url-encoded so JSON session blobs
10
- * and Unicode project paths survive dev-server URL normalization.
11
- */
12
7
  export const Route = createFileRoute("/session/$sessionId")({
13
- ssr: false,
14
8
  component: SessionViewerRoute,
15
9
  errorComponent: SessionRouteError,
16
10
  parseParams: (params) => ({
@@ -41,9 +35,9 @@ function ClientOnlySessionViewer({ sessionId }: { sessionId: string }): JSX.Elem
41
35
  return (
42
36
  <main className="min-h-screen bg-background text-foreground">
43
37
  <div className="mx-auto flex min-h-screen w-full max-w-2xl flex-col justify-center px-6 py-16 text-center">
44
- <div className="border border-border bg-card shadow-sm rounded-[8px] px-4 py-8">
38
+ <div className="rounded-[8px] border border-border bg-card px-4 py-8 shadow-sm">
45
39
  <p className="text-sm font-medium text-muted-foreground">Loading session data...</p>
46
- <p className="mt-3 inline-block max-w-full rounded bg-muted px-3 py-1 font-mono text-xs break-all text-muted-foreground">
40
+ <p className="mt-3 inline-block max-w-full break-all rounded bg-muted px-3 py-1 font-mono text-xs text-muted-foreground">
47
41
  {sessionId}
48
42
  </p>
49
43
  </div>
@@ -0,0 +1,50 @@
1
+ import { fetchWithTimeout } from "../lib/apiClient";
2
+ import {
3
+ acceptBrowserRuntimeDiscovery,
4
+ resolveBrowserRuntimeForDocument,
5
+ type BrowserRuntimeResolution,
6
+ } from "../lib/browserRuntimeResolver";
7
+
8
+ const RUNTIME_DISCOVERY_TIMEOUT_MS = 2_000;
9
+ type RuntimeDiscoveryRequest = () => Promise<Response>;
10
+
11
+ function requestRuntimeDiscovery(): Promise<Response> {
12
+ return fetchWithTimeout("/api/runtime", RUNTIME_DISCOVERY_TIMEOUT_MS, {
13
+ cache: "no-store",
14
+ });
15
+ }
16
+
17
+ function discoveryFailure(issue: string): BrowserRuntimeResolution {
18
+ return {
19
+ ok: false,
20
+ source: "discovered",
21
+ code: "invalid",
22
+ issues: [issue],
23
+ };
24
+ }
25
+
26
+ /**
27
+ * Validate the backend discovery document before same-origin fallback values
28
+ * are exposed as verified Coding Agent endpoints. Injected/operator contracts
29
+ * are already schema-validated and need no discovery round trip.
30
+ */
31
+ export async function validateBrowserRuntimeForStartup(
32
+ request: RuntimeDiscoveryRequest = requestRuntimeDiscovery,
33
+ ): Promise<BrowserRuntimeResolution> {
34
+ const fallback = resolveBrowserRuntimeForDocument();
35
+ if (!fallback.ok || fallback.source !== "composed-fallback") return fallback;
36
+
37
+ try {
38
+ const response = await request();
39
+ if (!response.ok) {
40
+ return discoveryFailure(
41
+ `Backend runtime discovery returned HTTP ${String(response.status)}.`,
42
+ );
43
+ }
44
+ const value: unknown = await response.json();
45
+ return acceptBrowserRuntimeDiscovery(fallback.runtime, value);
46
+ } catch (error) {
47
+ const message = error instanceof Error ? error.message : "unknown discovery failure";
48
+ return discoveryFailure(`Backend runtime discovery failed: ${message}`);
49
+ }
50
+ }
@@ -2,6 +2,7 @@
2
2
  @import "tw-animate-css";
3
3
  @import "./themes.css";
4
4
  @plugin "@tailwindcss/typography";
5
+ @source "../src";
5
6
 
6
7
  @custom-variant dark (&:where([data-theme="dark"], [data-theme="dark"] *));
7
8
  @custom-variant eye-care (&:where([data-theme="eye-care"], [data-theme="eye-care"] *));