@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.
- package/.output/{nitro.json → backend/nitro.json} +3 -3
- package/.output/backend-public/assets/index-D4LX-sw-.js +11 -0
- package/.output/cli.js +8018 -5451
- package/.output/server/_libs/extend.mjs +4 -8
- package/.output/server/_libs/jszip.mjs +9 -35
- package/.output/server/_libs/react-dom.mjs +2 -3
- package/.output/server/_libs/react.mjs +1 -27
- package/.output/server/_libs/tanstack__react-router.mjs +1 -329
- package/.output/server/_libs/tanstack__router-core.mjs +42 -100
- package/.output/server/_libs/use-sync-external-store.mjs +1 -64
- package/.output/server/_libs/ws.mjs +1 -1
- package/.output/server/_ssr/index.mjs +4 -4
- package/.output/server/_ssr/{publicBasePathContext-5264L3rX.mjs → publicBasePathContext-IH2ilOfu.mjs} +52 -24
- package/.output/server/_ssr/{router-BJ_ltLim.mjs → router-BwZEsYfS.mjs} +19794 -19444
- package/.output/server/_ssr/{start-C6MjPjxp.mjs → start-COQu_AgD.mjs} +1 -1
- package/.output/server/_tanstack-start-manifest_v-DnbdNeun.mjs +4 -0
- package/.output/server/index.mjs +5 -145
- package/.output/{public/assets/CompareDrawer-B3_TLTJh.js → ui/assets/CompareDrawer-V-8lPASC.js} +1 -1
- package/.output/{public/assets/InspectorPet-Cpn6hv4P.js → ui/assets/InspectorPet-D4CVnfdf.js} +1 -1
- package/.output/ui/assets/ProxyViewerContainer-CO3ZVHLX.js +59 -0
- package/.output/{public/assets/ReplayDialog-B3EKVdJk.js → ui/assets/ReplayDialog-CpGyTLtt.js} +1 -1
- package/.output/{public/assets/RequestAnatomy-COOQjyUC.js → ui/assets/RequestAnatomy-BLuJL9dZ.js} +1 -1
- package/.output/ui/assets/ResponseView-BuSC-CH7.js +2 -0
- package/.output/ui/assets/StreamingChunkSequence-DeA-JJKa.js +1 -0
- package/.output/{public/assets/_sessionId-zbgYl7ZJ.js → ui/assets/_sessionId-8HuHFhjo.js} +1 -1
- package/.output/{public/assets/_sessionId-BJlM3nmt.js → ui/assets/_sessionId-Chp67th6.js} +1 -1
- package/.output/ui/assets/favicon-DYEkHSNl.svg +21 -0
- package/.output/ui/assets/index-BvXp42al.css +1 -0
- package/.output/{public/assets/index-xF_NY8Yb.js → ui/assets/index-DPmKK_5d.js} +5 -5
- package/.output/{public/assets/index-BIK4bPTv.js → ui/assets/index-atoQrlb8.js} +1 -1
- package/.output/ui/assets/index-nY3E1vxV.js +73 -0
- package/.output/{public/assets/index-D2Qw6Ri2.js → ui/assets/index-nl9-dpZn.js} +1 -1
- package/.output/ui/assets/json-viewer-B9kIzqeX.js +1 -0
- package/.output/{public/assets/jszip.min-B_rfAUCe.js → ui/assets/jszip.min-B7tfyE-I.js} +1 -1
- package/.output/ui/index.html +229 -0
- package/.output/ui/runtime-config.js +2 -0
- package/.output/workers/logFinalizer.worker.js +979 -414
- package/.output/workers/sessionWorkerEntry.js +979 -414
- package/README.md +182 -43
- package/docs/instance-control.openapi.yaml +59 -4
- package/package.json +40 -6
- package/scripts/generate-theme-scales.mjs +3 -3
- package/src/{router.tsx → backend/router.tsx} +3 -15
- package/src/backend/routes/$.ts +26 -0
- package/src/backend/routes/__root.ts +4 -0
- package/src/backend/routes/api/-instances.ts +7 -0
- package/src/{routes → backend/routes}/api/alerts.summary.ts +3 -3
- package/src/{routes → backend/routes}/api/alerts.ts +4 -4
- package/src/{routes → backend/routes}/api/config.paths.ts +1 -1
- package/src/{routes → backend/routes}/api/config.ts +11 -2
- package/src/{routes → backend/routes}/api/ecosystem.packages.$packageId.help.ts +1 -1
- package/src/{routes → backend/routes}/api/ecosystem.packages.$packageId.install.ts +1 -1
- package/src/{routes → backend/routes}/api/ecosystem.packages.$packageId.runner-presets.ts +1 -1
- package/src/{routes → backend/routes}/api/ecosystem.packages.$packageId.upgrade.ts +1 -1
- package/src/{routes → backend/routes}/api/ecosystem.packages.ts +5 -1
- package/src/{routes → backend/routes}/api/ecosystem.recipes.$recipeId.run.ts +1 -1
- package/src/{routes → backend/routes}/api/ecosystem.tasks.$taskId.ts +1 -1
- package/src/{routes → backend/routes}/api/ecosystem.tasks.ts +1 -1
- package/src/{routes → backend/routes}/api/groups.$groupId.evidence.ts +2 -2
- package/src/{routes → backend/routes}/api/groups.$groupId.sessions.ts +2 -2
- package/src/{routes → backend/routes}/api/groups.$groupId.ts +2 -2
- package/src/{routes → backend/routes}/api/groups.ts +2 -2
- package/src/{routes → backend/routes}/api/health.ts +3 -3
- package/src/{routes → backend/routes}/api/instances.$name.connection.ts +1 -1
- package/src/{routes → backend/routes}/api/instances.$name.restart.ts +2 -2
- package/src/{routes → backend/routes}/api/instances.$name.start.ts +2 -2
- package/src/{routes → backend/routes}/api/instances.$name.stop.ts +2 -2
- package/src/{routes → backend/routes}/api/instances.$name.ts +1 -1
- package/src/{routes → backend/routes}/api/instances.ts +1 -1
- package/src/{routes → backend/routes}/api/knowledge.candidates.$candidateId.promote.ts +2 -2
- package/src/{routes → backend/routes}/api/knowledge.candidates.$candidateId.ts +2 -2
- package/src/{routes → backend/routes}/api/knowledge.candidates.ts +1 -1
- package/src/{routes → backend/routes}/api/knowledge.project-context.ts +2 -2
- package/src/{routes → backend/routes}/api/knowledge.search.ts +2 -2
- package/src/{routes → backend/routes}/api/knowledge.sessions.$sessionId.candidates.ts +3 -3
- package/src/{routes → backend/routes}/api/logs.$id.body.ts +6 -6
- package/src/{routes → backend/routes}/api/logs.$id.chunks.ts +5 -4
- package/src/{routes → backend/routes}/api/logs.$id.replay.ts +12 -11
- package/src/{routes → backend/routes}/api/logs.$id.ts +4 -3
- package/src/{routes → backend/routes}/api/logs.import.ts +3 -3
- package/src/{routes → backend/routes}/api/logs.stream.ts +11 -7
- package/src/{routes → backend/routes}/api/logs.ts +17 -9
- package/src/{routes → backend/routes}/api/mcp.ts +1 -1
- package/src/{routes → backend/routes}/api/models.ts +1 -1
- package/src/{routes → backend/routes}/api/pi-agent.ts +2 -2
- package/src/{routes → backend/routes}/api/providers.$providerId.model-metadata.ts +5 -5
- package/src/{routes → backend/routes}/api/providers.$providerId.test.log.ts +7 -7
- package/src/{routes → backend/routes}/api/providers.$providerId.ts +4 -4
- package/src/{routes → backend/routes}/api/providers.export.ts +1 -1
- package/src/{routes → backend/routes}/api/providers.import.ts +3 -3
- package/src/{routes → backend/routes}/api/providers.scan.ts +2 -2
- package/src/{routes → backend/routes}/api/providers.ts +9 -4
- package/src/{routes → backend/routes}/api/runs.$runId.evidence.ts +2 -2
- package/src/{routes → backend/routes}/api/runs.$runId.ts +2 -2
- package/src/{routes → backend/routes}/api/runs.ts +4 -4
- package/src/backend/routes/api/runtime.ts +46 -0
- package/src/{routes → backend/routes}/api/sessions.ts +3 -3
- package/src/{routes → backend/routes}/proxy/$.ts +1 -1
- package/src/{routes → backend/routes}/readyz.ts +1 -1
- package/src/{start.ts → backend/start.ts} +1 -1
- package/src/cli/alias.ts +2 -11
- package/src/cli/doctor.ts +32 -9
- package/src/cli/instance.ts +36 -13
- package/src/cli/instanceApi.ts +213 -0
- package/src/cli/instanceArgs.ts +46 -11
- package/src/cli/instanceControl.ts +10 -2
- package/src/cli/instanceModel.ts +18 -17
- package/src/cli/instanceRegistry.ts +0 -9
- package/src/cli/networkHints.ts +27 -14
- package/src/cli/onboard.ts +69 -2
- package/src/cli/onboardTarget.ts +89 -40
- package/src/cli/rustBackendPackage.ts +450 -0
- package/src/cli/templates/codex-skill-onboard.ts +44 -14
- package/src/cli/templates/skill-onboard.ts +64 -28
- package/src/cli.ts +341 -75
- package/src/components/ProxyViewer.tsx +11 -9
- package/src/components/ProxyViewerContainer.tsx +12 -11
- package/src/components/pi-agent/PiAgentPanel.tsx +2 -2
- package/src/components/providers/ProviderCard.tsx +1 -1
- package/src/components/providers/ProviderTestResultsView.tsx +1 -1
- package/src/components/providers/SettingsDialog.tsx +159 -144
- package/src/components/proxy-viewer/ApplicationBar.tsx +2 -1
- package/src/components/proxy-viewer/LogEntry.tsx +1 -1
- package/src/components/proxy-viewer/log-formats/index.ts +1 -1
- package/src/contracts/index.ts +5 -0
- package/src/contracts/log.ts +33 -3
- package/src/knowledge/types.ts +3 -2
- package/src/lib/alertContract.ts +2 -2
- package/src/lib/apiClient.ts +30 -7
- package/src/lib/apiFormat.ts +29 -0
- package/src/lib/backendImplementation.ts +16 -0
- package/src/lib/basePath.ts +29 -11
- package/src/lib/browserRuntimeContract.ts +124 -0
- package/src/lib/browserRuntimeResolver.ts +244 -0
- package/src/{proxy → lib}/claudeCodeStrip.ts +6 -7
- package/src/lib/codingAgentEndpoints.ts +38 -0
- package/src/lib/instanceContract.ts +30 -11
- package/src/lib/managedInstance.ts +9 -1
- package/src/lib/piAgentContract.ts +3 -2
- package/src/lib/publicBasePathContext.ts +40 -10
- package/src/lib/resourceLimits.ts +2 -0
- package/src/lib/runContract.ts +3 -3
- package/src/lib/sessionInfoContract.ts +3 -2
- package/src/mcp/instanceHandlers.ts +2 -0
- package/src/mcp/server.ts +19 -24
- package/src/proxy/config.ts +25 -30
- package/src/proxy/dataDir.ts +43 -7
- package/src/proxy/ecosystemTasks.ts +161 -70
- package/src/proxy/formats/registry.ts +6 -21
- package/src/proxy/handler.ts +129 -29
- package/src/proxy/identityProxy.ts +567 -39
- package/src/proxy/jsonlRecovery.ts +554 -0
- package/src/proxy/logFinalizer.ts +25 -10
- package/src/proxy/logImporter.ts +2 -1
- package/src/proxy/logIndex.ts +191 -95
- package/src/proxy/logger.ts +77 -14
- package/src/proxy/platformCommands.ts +41 -0
- package/src/proxy/privateDataPath.ts +310 -88
- package/src/proxy/rawStreamCapture.ts +194 -13
- package/src/proxy/runtimeAdmission.ts +5 -2
- package/src/proxy/runtimeHealth.ts +14 -1
- package/src/proxy/runtimeShutdown.ts +11 -1
- package/src/proxy/schemas.ts +7 -1
- package/src/proxy/sessionArchive.ts +70 -14
- package/src/proxy/sqliteLogIndex.ts +65 -42
- package/src/proxy/store.ts +141 -34
- package/src/proxy/uiAssetServer.ts +106 -0
- package/src/proxy/upstream.ts +29 -2
- package/src/ui/bootstrap.ts +167 -0
- package/src/ui/index.html +38 -0
- package/src/ui/logsStreamClient.ts +20 -0
- package/src/ui/main.tsx +13 -0
- package/src/ui/public/runtime-config.js +2 -0
- package/src/ui/router.tsx +13 -0
- package/src/ui/routes/__root.tsx +69 -0
- package/src/{routes → ui/routes}/index.tsx +2 -3
- package/src/{routes → ui/routes}/session/$sessionId.tsx +5 -11
- package/src/ui/runtimeDiscovery.ts +50 -0
- package/styles/globals.css +1 -0
- package/.output/public/assets/ProxyViewerContainer-BEAhuGOJ.js +0 -126
- package/.output/public/assets/ResponseView-DBCjkwye.js +0 -2
- package/.output/public/assets/StreamingChunkSequence-CuXhDgMo.js +0 -1
- package/.output/public/assets/index-BZo_8koU.js +0 -70
- package/.output/public/assets/index-ZWschkCh.css +0 -1
- package/.output/public/assets/json-viewer-B-Ao6pwW.js +0 -1
- package/.output/server/_libs/@radix-ui/react-accessible-icon+[...].mjs +0 -1
- package/.output/server/_libs/@radix-ui/react-dismissable-layer+[...].mjs +0 -344
- package/.output/server/_libs/@radix-ui/react-navigation-menu+[...].mjs +0 -2
- package/.output/server/_libs/@radix-ui/react-one-time-password-field+[...].mjs +0 -2
- package/.output/server/_libs/@radix-ui/react-password-toggle-field+[...].mjs +0 -2
- package/.output/server/_libs/@radix-ui/react-use-callback-ref+[...].mjs +0 -11
- package/.output/server/_libs/@radix-ui/react-use-controllable-state+[...].mjs +0 -69
- package/.output/server/_libs/@radix-ui/react-use-effect-event+[...].mjs +0 -1
- package/.output/server/_libs/@radix-ui/react-use-is-hydrated+[...].mjs +0 -28
- package/.output/server/_libs/@radix-ui/react-use-layout-effect+[...].mjs +0 -6
- package/.output/server/_libs/@radix-ui/react-visually-hidden+[...].mjs +0 -34
- package/.output/server/_libs/aria-hidden.mjs +0 -122
- package/.output/server/_libs/bail.mjs +0 -8
- package/.output/server/_libs/character-entities.mjs +0 -2130
- package/.output/server/_libs/class-variance-authority.mjs +0 -44
- package/.output/server/_libs/clsx.mjs +0 -16
- package/.output/server/_libs/comma-separated-tokens.mjs +0 -10
- package/.output/server/_libs/decode-named-character-reference+[...].mjs +0 -8
- package/.output/server/_libs/dequal.mjs +0 -27
- package/.output/server/_libs/detect-node-es.mjs +0 -1
- package/.output/server/_libs/devlop.mjs +0 -8
- package/.output/server/_libs/diff.mjs +0 -320
- package/.output/server/_libs/estree-util-is-identifier-name.mjs +0 -11
- package/.output/server/_libs/floating-ui__core.mjs +0 -725
- package/.output/server/_libs/floating-ui__dom.mjs +0 -622
- package/.output/server/_libs/floating-ui__react-dom.mjs +0 -292
- package/.output/server/_libs/floating-ui__utils.mjs +0 -320
- package/.output/server/_libs/get-nonce.mjs +0 -9
- package/.output/server/_libs/hast-util-to-jsx-runtime.mjs +0 -388
- package/.output/server/_libs/hast-util-whitespace.mjs +0 -10
- package/.output/server/_libs/html-url-attributes.mjs +0 -26
- package/.output/server/_libs/inline-style-parser.mjs +0 -142
- package/.output/server/_libs/is-plain-obj.mjs +0 -10
- package/.output/server/_libs/lucide-react.mjs +0 -1027
- package/.output/server/_libs/mdast-util-from-markdown.mjs +0 -717
- package/.output/server/_libs/mdast-util-to-hast.mjs +0 -710
- package/.output/server/_libs/mdast-util-to-string.mjs +0 -38
- package/.output/server/_libs/micromark-core-commonmark.mjs +0 -2259
- package/.output/server/_libs/micromark-factory-destination.mjs +0 -94
- package/.output/server/_libs/micromark-factory-label.mjs +0 -63
- package/.output/server/_libs/micromark-factory-space.mjs +0 -24
- package/.output/server/_libs/micromark-factory-title.mjs +0 -65
- package/.output/server/_libs/micromark-factory-whitespace.mjs +0 -22
- package/.output/server/_libs/micromark-util-character.mjs +0 -44
- package/.output/server/_libs/micromark-util-chunked.mjs +0 -36
- package/.output/server/_libs/micromark-util-classify-character+[...].mjs +0 -12
- package/.output/server/_libs/micromark-util-combine-extensions+[...].mjs +0 -41
- package/.output/server/_libs/micromark-util-decode-numeric-character-reference+[...].mjs +0 -19
- package/.output/server/_libs/micromark-util-decode-string.mjs +0 -21
- package/.output/server/_libs/micromark-util-encode.mjs +0 -1
- package/.output/server/_libs/micromark-util-html-tag-name.mjs +0 -69
- package/.output/server/_libs/micromark-util-normalize-identifier+[...].mjs +0 -6
- package/.output/server/_libs/micromark-util-resolve-all.mjs +0 -15
- package/.output/server/_libs/micromark-util-sanitize-uri.mjs +0 -41
- package/.output/server/_libs/micromark-util-subtokenize.mjs +0 -346
- package/.output/server/_libs/micromark.mjs +0 -906
- package/.output/server/_libs/property-information.mjs +0 -1209
- package/.output/server/_libs/radix-ui.mjs +0 -1
- package/.output/server/_libs/radix-ui__number.mjs +0 -6
- package/.output/server/_libs/radix-ui__primitive.mjs +0 -11
- package/.output/server/_libs/radix-ui__react-accordion.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-alert-dialog.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-arrow.mjs +0 -23
- package/.output/server/_libs/radix-ui__react-aspect-ratio.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-avatar.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-checkbox.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-collapsible.mjs +0 -144
- package/.output/server/_libs/radix-ui__react-collection.mjs +0 -69
- package/.output/server/_libs/radix-ui__react-compose-refs.mjs +0 -38
- package/.output/server/_libs/radix-ui__react-context-menu.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-context.mjs +0 -64
- package/.output/server/_libs/radix-ui__react-dialog.mjs +0 -280
- package/.output/server/_libs/radix-ui__react-direction.mjs +0 -9
- package/.output/server/_libs/radix-ui__react-dropdown-menu.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-focus-guards.mjs +0 -39
- package/.output/server/_libs/radix-ui__react-focus-scope.mjs +0 -210
- package/.output/server/_libs/radix-ui__react-form.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-hover-card.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-id.mjs +0 -14
- package/.output/server/_libs/radix-ui__react-label.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-menu.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-menubar.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-popover.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-popper.mjs +0 -340
- package/.output/server/_libs/radix-ui__react-portal.mjs +0 -16
- package/.output/server/_libs/radix-ui__react-presence.mjs +0 -173
- package/.output/server/_libs/radix-ui__react-primitive.mjs +0 -42
- package/.output/server/_libs/radix-ui__react-progress.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-radio-group.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-roving-focus.mjs +0 -235
- package/.output/server/_libs/radix-ui__react-scroll-area.mjs +0 -731
- package/.output/server/_libs/radix-ui__react-select.mjs +0 -1207
- package/.output/server/_libs/radix-ui__react-separator.mjs +0 -28
- package/.output/server/_libs/radix-ui__react-slider.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-slot.mjs +0 -132
- package/.output/server/_libs/radix-ui__react-switch.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-tabs.mjs +0 -194
- package/.output/server/_libs/radix-ui__react-toast.mjs +0 -2
- package/.output/server/_libs/radix-ui__react-toggle-group.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-toggle.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-toolbar.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-tooltip.mjs +0 -498
- package/.output/server/_libs/radix-ui__react-use-previous.mjs +0 -14
- package/.output/server/_libs/radix-ui__react-use-size.mjs +0 -39
- package/.output/server/_libs/react-markdown.mjs +0 -235
- package/.output/server/_libs/react-remove-scroll-bar.mjs +0 -82
- package/.output/server/_libs/react-remove-scroll.mjs +0 -328
- package/.output/server/_libs/react-style-singleton.mjs +0 -69
- package/.output/server/_libs/remark-parse.mjs +0 -19
- package/.output/server/_libs/remark-rehype.mjs +0 -21
- package/.output/server/_libs/space-separated-tokens.mjs +0 -6
- package/.output/server/_libs/style-to-js.mjs +0 -72
- package/.output/server/_libs/style-to-object.mjs +0 -38
- package/.output/server/_libs/swr.mjs +0 -947
- package/.output/server/_libs/tailwind-merge.mjs +0 -3255
- package/.output/server/_libs/tanstack__react-virtual.mjs +0 -130
- package/.output/server/_libs/tanstack__virtual-core.mjs +0 -1319
- package/.output/server/_libs/three.mjs +0 -26016
- package/.output/server/_libs/trim-lines.mjs +0 -41
- package/.output/server/_libs/trough.mjs +0 -85
- package/.output/server/_libs/tslib.mjs +0 -1
- package/.output/server/_libs/ungap__structured-clone.mjs +0 -212
- package/.output/server/_libs/unified.mjs +0 -661
- package/.output/server/_libs/unist-util-is.mjs +0 -100
- package/.output/server/_libs/unist-util-position.mjs +0 -27
- package/.output/server/_libs/unist-util-stringify-position.mjs +0 -27
- package/.output/server/_libs/unist-util-visit-parents.mjs +0 -82
- package/.output/server/_libs/unist-util-visit.mjs +0 -24
- package/.output/server/_libs/use-callback-ref.mjs +0 -66
- package/.output/server/_libs/use-sidecar.mjs +0 -106
- package/.output/server/_libs/vfile-message.mjs +0 -138
- package/.output/server/_libs/vfile.mjs +0 -467
- package/.output/server/_sessionId-CJ99gZFV.mjs +0 -84
- package/.output/server/_sessionId-DEjScBpK.mjs +0 -146
- package/.output/server/_ssr/CompareDrawer-DtOIMeQB.mjs +0 -1060
- package/.output/server/_ssr/InspectorPet-CXc4oCBQ.mjs +0 -938
- package/.output/server/_ssr/ProxyViewerContainer-DVPlwfkt.mjs +0 -17632
- package/.output/server/_ssr/ReplayDialog-BQEA95qC.mjs +0 -725
- package/.output/server/_ssr/RequestAnatomy-BMyd8B7Q.mjs +0 -837
- package/.output/server/_ssr/ResponseView-qrTaEIM8.mjs +0 -757
- package/.output/server/_ssr/StreamingChunkSequence-BFTL8mIy.mjs +0 -274
- package/.output/server/_ssr/index-Bcj1Hcy4.mjs +0 -135
- package/.output/server/_ssr/index-DW-M7XUG.mjs +0 -84
- package/.output/server/_ssr/json-viewer-DiI0Yjsn.mjs +0 -483
- package/.output/server/_tanstack-start-manifest_v-C6pXXX9R.mjs +0 -4
- package/.output/server/node_modules/tslib/modules/index.js +0 -70
- package/.output/server/node_modules/tslib/modules/package.json +0 -3
- package/.output/server/node_modules/tslib/package.json +0 -47
- package/.output/server/node_modules/tslib/tslib.js +0 -484
- package/.output/server/package.json +0 -9
- package/src/routes/__root.tsx +0 -170
- package/src/routes/api/-instances.ts +0 -109
- /package/.output/{public → ui}/assets/agent-inspector-58K1_MsC.ico +0 -0
- /package/.output/{public → ui}/assets/alibaba-TTwafVwX.svg +0 -0
- /package/.output/{public → ui}/assets/minimax-BPMzvuL-.jpeg +0 -0
- /package/.output/{public → ui}/assets/qwen-mMn3f5ul.webp +0 -0
- /package/.output/{public → ui}/assets/zhipuai-BPNAnxo-.svg +0 -0
- /package/src/{routes → backend/routes}/livez.ts +0 -0
|
@@ -42,9 +42,12 @@ import {
|
|
|
42
42
|
} from "lucide-react";
|
|
43
43
|
|
|
44
44
|
import type { CapturedLog } from "../contracts";
|
|
45
|
+
import { withBasePath } from "../lib/basePath";
|
|
45
46
|
import { exportLogsAsZip, type ExportMode } from "../lib/export-logs";
|
|
46
|
-
import {
|
|
47
|
-
|
|
47
|
+
import {
|
|
48
|
+
subscribeCodingAgentEndpoints,
|
|
49
|
+
type CodingAgentEndpoints,
|
|
50
|
+
} from "../lib/codingAgentEndpoints";
|
|
48
51
|
import type { ImportLogsResponse } from "../lib/logImportContract";
|
|
49
52
|
import { copyTextToClipboard } from "../lib/clipboard";
|
|
50
53
|
import type { InspectorGroupEvidence, InspectorGroupMember } from "../lib/groupContract";
|
|
@@ -1213,7 +1216,7 @@ function SessionContextBar({
|
|
|
1213
1216
|
<div className="flex flex-wrap items-center gap-2">
|
|
1214
1217
|
{showBackLink && (
|
|
1215
1218
|
<a
|
|
1216
|
-
href="/"
|
|
1219
|
+
href={withBasePath("/")}
|
|
1217
1220
|
className="bg-white/[0.035] hover:bg-white/[0.065] inline-flex size-8 shrink-0 items-center justify-center rounded-md text-muted-foreground shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)] transition-colors hover:text-foreground"
|
|
1218
1221
|
aria-label="Back to all sessions"
|
|
1219
1222
|
title="Back to all sessions"
|
|
@@ -1385,10 +1388,9 @@ export function ProxyViewer({
|
|
|
1385
1388
|
const exportRequestIdRef = useRef(0);
|
|
1386
1389
|
const detailsPanelResizeRef = useRef<DetailsPanelResizeState | null>(null);
|
|
1387
1390
|
useKeyboardNavigation(logListRef, logListWrapperRef, { pageWide: true });
|
|
1388
|
-
const connectionEndpoints =
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
}, []);
|
|
1391
|
+
const [connectionEndpoints, setConnectionEndpoints] = useState<CodingAgentEndpoints | null>(null);
|
|
1392
|
+
|
|
1393
|
+
useEffect(() => subscribeCodingAgentEndpoints(setConnectionEndpoints), []);
|
|
1392
1394
|
|
|
1393
1395
|
const cancelTransientTasks = useCallback(() => {
|
|
1394
1396
|
exportRequestIdRef.current += 1;
|
|
@@ -2112,7 +2114,7 @@ export function ProxyViewer({
|
|
|
2112
2114
|
)}
|
|
2113
2115
|
{hideSessionFilter ? (
|
|
2114
2116
|
<a
|
|
2115
|
-
href="/"
|
|
2117
|
+
href={withBasePath("/")}
|
|
2116
2118
|
className="inline-flex h-8 items-center rounded-md px-3 text-xs text-muted-foreground underline transition-colors hover:text-foreground focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-none"
|
|
2117
2119
|
>
|
|
2118
2120
|
Back to all sessions
|
|
@@ -2143,7 +2145,7 @@ export function ProxyViewer({
|
|
|
2143
2145
|
Pick a session from the filter panel to load stored logs on demand.
|
|
2144
2146
|
</p>
|
|
2145
2147
|
)}
|
|
2146
|
-
{liveEmptyStateCopy.showConnectionCommands && (
|
|
2148
|
+
{liveEmptyStateCopy.showConnectionCommands && connectionEndpoints !== null && (
|
|
2147
2149
|
<>
|
|
2148
2150
|
<div className="flex flex-col items-center gap-2">
|
|
2149
2151
|
<CopyableCommand
|
|
@@ -2,7 +2,6 @@ import { useState, useEffect, useCallback, useRef, useMemo, useTransition, type
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { CapturedLogSchema, type CapturedLog } from "../contracts";
|
|
4
4
|
import { fetchJson, fetchJsonWithTimeout } from "../lib/apiClient";
|
|
5
|
-
import { withBasePath } from "../lib/basePath";
|
|
6
5
|
import {
|
|
7
6
|
DeleteInspectorGroupsResponseSchema,
|
|
8
7
|
InspectorGroupsListResponseSchema,
|
|
@@ -29,6 +28,7 @@ import {
|
|
|
29
28
|
reduceLiveConnectionState,
|
|
30
29
|
} from "./proxy-viewer/liveConnectionState";
|
|
31
30
|
import { TransientToast, useTransientToast } from "./ui/transient-toast";
|
|
31
|
+
import { openLogsEventSource } from "../ui/logsStreamClient";
|
|
32
32
|
|
|
33
33
|
type SSEUpdate =
|
|
34
34
|
| {
|
|
@@ -134,15 +134,6 @@ const SESSION_MEMBERSHIP_FETCH_TIMEOUT_MS = 10_000;
|
|
|
134
134
|
const SSE_RECONNECT_DELAY_MS = 3_000;
|
|
135
135
|
const SSE_STALE_AFTER_MS = 10_000;
|
|
136
136
|
|
|
137
|
-
function buildLogsStreamUrl(sessionId: string | undefined): string {
|
|
138
|
-
const params = new URLSearchParams({ compact: "1" });
|
|
139
|
-
if (sessionId !== undefined) {
|
|
140
|
-
params.set("sessionId", sessionId);
|
|
141
|
-
}
|
|
142
|
-
const query = params.toString();
|
|
143
|
-
return withBasePath(query.length > 0 ? `/api/logs/stream?${query}` : "/api/logs/stream");
|
|
144
|
-
}
|
|
145
|
-
|
|
146
137
|
function buildSessionLogsPageUrl(
|
|
147
138
|
sessionId: string,
|
|
148
139
|
request: SessionPageRequest,
|
|
@@ -396,7 +387,17 @@ export function ProxyViewerContainer({
|
|
|
396
387
|
reconnectTimeoutRef.current = null;
|
|
397
388
|
}
|
|
398
389
|
setLiveConnection((state) => reduceLiveConnectionState(state, { type: "connect-requested" }));
|
|
399
|
-
const es =
|
|
390
|
+
const es = openLogsEventSource(initialSessionId);
|
|
391
|
+
if (es === null) {
|
|
392
|
+
setLiveConnection((state) =>
|
|
393
|
+
reduceLiveConnectionState(state, {
|
|
394
|
+
type: "recoverable-error",
|
|
395
|
+
message: "The browser runtime does not provide a valid log stream endpoint.",
|
|
396
|
+
}),
|
|
397
|
+
);
|
|
398
|
+
showErrorToast("Failed to resolve the live stream endpoint");
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
400
401
|
eventSourceRef.current = es;
|
|
401
402
|
|
|
402
403
|
es.onmessage = (event: MessageEvent) => {
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
type PiAgentResponseView,
|
|
13
13
|
} from "./piAgentChatLogic";
|
|
14
14
|
import { useProviders } from "../../lib/useProviders";
|
|
15
|
-
import {
|
|
15
|
+
import { fetchControl } from "../../lib/apiClient";
|
|
16
16
|
import { dispatchLogFocusRequest } from "../proxy-viewer/logFocus";
|
|
17
17
|
import { AnswerMarkdown } from "../proxy-viewer/AnswerMarkdown";
|
|
18
18
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../ui/select";
|
|
@@ -274,7 +274,7 @@ export function PiAgentPanel({
|
|
|
274
274
|
logLimit: 16,
|
|
275
275
|
};
|
|
276
276
|
|
|
277
|
-
void
|
|
277
|
+
void fetchControl("/api/pi-agent", {
|
|
278
278
|
method: "POST",
|
|
279
279
|
headers: {
|
|
280
280
|
"content-type": "application/json",
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
ChevronDown,
|
|
12
12
|
ChevronRight,
|
|
13
13
|
} from "lucide-react";
|
|
14
|
-
import type { ProviderConfig } from "../../
|
|
14
|
+
import type { ProviderConfig } from "../../lib/providerContract";
|
|
15
15
|
import {
|
|
16
16
|
findProviderModelMetadata,
|
|
17
17
|
providerHasContextMetadata,
|
|
@@ -22,7 +22,7 @@ import type {
|
|
|
22
22
|
ProviderTestResults as TestResults,
|
|
23
23
|
ProviderTestState,
|
|
24
24
|
} from "../../lib/providerTestContract";
|
|
25
|
-
import type { ProviderConfig } from "../../
|
|
25
|
+
import type { ProviderConfig } from "../../lib/providerContract";
|
|
26
26
|
import { cn } from "../../lib/utils";
|
|
27
27
|
import {
|
|
28
28
|
Dialog,
|
|
@@ -10,8 +10,10 @@ import { useProviders } from "../../lib/useProviders";
|
|
|
10
10
|
import { useStripConfig } from "../../lib/useStripConfig";
|
|
11
11
|
import { copyTextToClipboard } from "../../lib/clipboard";
|
|
12
12
|
import { fetchJsonWithTimeout } from "../../lib/apiClient";
|
|
13
|
-
import {
|
|
14
|
-
|
|
13
|
+
import {
|
|
14
|
+
subscribeCodingAgentEndpoints,
|
|
15
|
+
type CodingAgentEndpoints,
|
|
16
|
+
} from "../../lib/codingAgentEndpoints";
|
|
15
17
|
import {
|
|
16
18
|
MAX_PROVIDER_TEST_TIMEOUT_SECONDS,
|
|
17
19
|
MAX_SLOW_RESPONSE_THRESHOLD_SECONDS,
|
|
@@ -330,14 +332,8 @@ function CopyableSetupValue({
|
|
|
330
332
|
|
|
331
333
|
function OnboardingSettingsTab(): JSX.Element {
|
|
332
334
|
const [copiedId, setCopiedId] = useState<string | null>(null);
|
|
333
|
-
const
|
|
334
|
-
|
|
335
|
-
return window.location.origin;
|
|
336
|
-
}, []);
|
|
337
|
-
const endpoints = useMemo(
|
|
338
|
-
() => deriveCodingAgentEndpoints(origin, getConfiguredBasePath()),
|
|
339
|
-
[origin],
|
|
340
|
-
);
|
|
335
|
+
const [endpoints, setEndpoints] = useState<CodingAgentEndpoints | null>(null);
|
|
336
|
+
useEffect(() => subscribeCodingAgentEndpoints(setEndpoints), []);
|
|
341
337
|
const values = useMemo(
|
|
342
338
|
() => [
|
|
343
339
|
{ id: "status", label: "Check onboarding", value: "agent-inspector onboard --status" },
|
|
@@ -369,11 +365,6 @@ function OnboardingSettingsTab(): JSX.Element {
|
|
|
369
365
|
value: "agent-inspector onboard --status --opencode-only",
|
|
370
366
|
},
|
|
371
367
|
{ id: "opencode-verify", label: "OpenCode verify", value: "opencode mcp list" },
|
|
372
|
-
{
|
|
373
|
-
id: "opencode-proxy",
|
|
374
|
-
label: "OpenCode proxy",
|
|
375
|
-
value: `LLM_BASE_URL=${endpoints.proxy}`,
|
|
376
|
-
},
|
|
377
368
|
{
|
|
378
369
|
id: "mimo-config",
|
|
379
370
|
label: "MiMo Code config",
|
|
@@ -385,23 +376,32 @@ function OnboardingSettingsTab(): JSX.Element {
|
|
|
385
376
|
value: "agent-inspector onboard --status --mimo-only",
|
|
386
377
|
},
|
|
387
378
|
{ id: "mimo-verify", label: "MiMo Code verify", value: "mimo mcp list" },
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
379
|
+
...(endpoints === null
|
|
380
|
+
? []
|
|
381
|
+
: [
|
|
382
|
+
{
|
|
383
|
+
id: "opencode-proxy",
|
|
384
|
+
label: "OpenCode proxy",
|
|
385
|
+
value: `LLM_BASE_URL=${endpoints.proxy}`,
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
id: "mimo-proxy",
|
|
389
|
+
label: "MiMo Code proxy",
|
|
390
|
+
value: `OPENAI_BASE_URL=${endpoints.openAiV1}`,
|
|
391
|
+
},
|
|
392
|
+
{ id: "mcp", label: "MCP URL", value: endpoints.mcp },
|
|
393
|
+
{ id: "proxy", label: "Proxy URL", value: endpoints.proxy },
|
|
394
|
+
{
|
|
395
|
+
id: "anthropic",
|
|
396
|
+
label: "Anthropic base",
|
|
397
|
+
value: `ANTHROPIC_BASE_URL=${endpoints.proxy}`,
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
id: "openai",
|
|
401
|
+
label: "OpenAI base",
|
|
402
|
+
value: `OPENAI_BASE_URL=${endpoints.openAiV1}`,
|
|
403
|
+
},
|
|
404
|
+
]),
|
|
405
405
|
],
|
|
406
406
|
[endpoints],
|
|
407
407
|
);
|
|
@@ -501,111 +501,117 @@ function OnboardingSettingsTab(): JSX.Element {
|
|
|
501
501
|
|
|
502
502
|
function McpSettingsTab(): JSX.Element {
|
|
503
503
|
const [copiedId, setCopiedId] = useState<string | null>(null);
|
|
504
|
-
const
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
504
|
+
const [endpoint, setEndpoint] = useState<string | null>(null);
|
|
505
|
+
useEffect(
|
|
506
|
+
() =>
|
|
507
|
+
subscribeCodingAgentEndpoints((endpoints) => {
|
|
508
|
+
setEndpoint(endpoints?.mcp ?? null);
|
|
509
|
+
}),
|
|
510
|
+
[],
|
|
511
|
+
);
|
|
509
512
|
const values = useMemo(
|
|
510
|
-
() =>
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
label: "Bridge doctor",
|
|
520
|
-
value: `agent-inspector-mcp doctor --url ${endpoint}`,
|
|
521
|
-
},
|
|
522
|
-
{
|
|
523
|
-
id: "writes",
|
|
524
|
-
label: "Enable write tools",
|
|
525
|
-
value: "AGENT_INSPECTOR_MCP_WRITES=1 agent-inspector",
|
|
526
|
-
},
|
|
527
|
-
{
|
|
528
|
-
id: "capabilities",
|
|
529
|
-
label: "Capabilities resource",
|
|
530
|
-
value: "inspector://mcp/capabilities",
|
|
531
|
-
},
|
|
532
|
-
{
|
|
533
|
-
id: "context",
|
|
534
|
-
label: "Current context resource",
|
|
535
|
-
value: "inspector://context/current",
|
|
536
|
-
},
|
|
537
|
-
{
|
|
538
|
-
id: "streamable-json",
|
|
539
|
-
label: "Streamable HTTP JSON",
|
|
540
|
-
value: JSON.stringify(
|
|
541
|
-
{
|
|
542
|
-
mcpServers: {
|
|
543
|
-
"agent-inspector": {
|
|
544
|
-
type: "streamableHttp",
|
|
545
|
-
url: endpoint,
|
|
546
|
-
},
|
|
513
|
+
() =>
|
|
514
|
+
endpoint === null
|
|
515
|
+
? []
|
|
516
|
+
: [
|
|
517
|
+
{ id: "mcp-url", label: "Streamable HTTP MCP URL", value: endpoint },
|
|
518
|
+
{
|
|
519
|
+
id: "stdio",
|
|
520
|
+
label: "Stdio bridge command",
|
|
521
|
+
value: `agent-inspector-mcp stdio --url ${endpoint}`,
|
|
547
522
|
},
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
},
|
|
553
|
-
{
|
|
554
|
-
id: "stdio-json",
|
|
555
|
-
label: "Stdio MCP JSON",
|
|
556
|
-
value: JSON.stringify(
|
|
557
|
-
{
|
|
558
|
-
mcpServers: {
|
|
559
|
-
"agent-inspector": {
|
|
560
|
-
command: "agent-inspector-mcp",
|
|
561
|
-
args: ["stdio", "--url", endpoint],
|
|
562
|
-
},
|
|
523
|
+
{
|
|
524
|
+
id: "doctor",
|
|
525
|
+
label: "Bridge doctor",
|
|
526
|
+
value: `agent-inspector-mcp doctor --url ${endpoint}`,
|
|
563
527
|
},
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
},
|
|
569
|
-
{
|
|
570
|
-
id: "opencode-local",
|
|
571
|
-
label: "OpenCode local MCP",
|
|
572
|
-
value: JSON.stringify(
|
|
573
|
-
{
|
|
574
|
-
mcp: {
|
|
575
|
-
"agent-inspector": {
|
|
576
|
-
type: "local",
|
|
577
|
-
command: ["agent-inspector-mcp", "stdio", "--url", endpoint],
|
|
578
|
-
enabled: true,
|
|
579
|
-
},
|
|
528
|
+
{
|
|
529
|
+
id: "writes",
|
|
530
|
+
label: "Enable write tools",
|
|
531
|
+
value: "AGENT_INSPECTOR_MCP_WRITES=1 agent-inspector",
|
|
580
532
|
},
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
},
|
|
586
|
-
{
|
|
587
|
-
id: "mimo-local",
|
|
588
|
-
label: "MiMo Code local MCP",
|
|
589
|
-
value: JSON.stringify(
|
|
590
|
-
{
|
|
591
|
-
mcp: {
|
|
592
|
-
"agent-inspector": {
|
|
593
|
-
type: "local",
|
|
594
|
-
command: ["agent-inspector-mcp", "stdio", "--url", endpoint],
|
|
595
|
-
enabled: true,
|
|
596
|
-
},
|
|
533
|
+
{
|
|
534
|
+
id: "capabilities",
|
|
535
|
+
label: "Capabilities resource",
|
|
536
|
+
value: "inspector://mcp/capabilities",
|
|
597
537
|
},
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
538
|
+
{
|
|
539
|
+
id: "context",
|
|
540
|
+
label: "Current context resource",
|
|
541
|
+
value: "inspector://context/current",
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
id: "streamable-json",
|
|
545
|
+
label: "Streamable HTTP JSON",
|
|
546
|
+
value: JSON.stringify(
|
|
547
|
+
{
|
|
548
|
+
mcpServers: {
|
|
549
|
+
"agent-inspector": {
|
|
550
|
+
type: "streamableHttp",
|
|
551
|
+
url: endpoint,
|
|
552
|
+
},
|
|
553
|
+
},
|
|
554
|
+
},
|
|
555
|
+
null,
|
|
556
|
+
2,
|
|
557
|
+
),
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
id: "stdio-json",
|
|
561
|
+
label: "Stdio MCP JSON",
|
|
562
|
+
value: JSON.stringify(
|
|
563
|
+
{
|
|
564
|
+
mcpServers: {
|
|
565
|
+
"agent-inspector": {
|
|
566
|
+
command: "agent-inspector-mcp",
|
|
567
|
+
args: ["stdio", "--url", endpoint],
|
|
568
|
+
},
|
|
569
|
+
},
|
|
570
|
+
},
|
|
571
|
+
null,
|
|
572
|
+
2,
|
|
573
|
+
),
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
id: "opencode-local",
|
|
577
|
+
label: "OpenCode local MCP",
|
|
578
|
+
value: JSON.stringify(
|
|
579
|
+
{
|
|
580
|
+
mcp: {
|
|
581
|
+
"agent-inspector": {
|
|
582
|
+
type: "local",
|
|
583
|
+
command: ["agent-inspector-mcp", "stdio", "--url", endpoint],
|
|
584
|
+
enabled: true,
|
|
585
|
+
},
|
|
586
|
+
},
|
|
587
|
+
},
|
|
588
|
+
null,
|
|
589
|
+
2,
|
|
590
|
+
),
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
id: "mimo-local",
|
|
594
|
+
label: "MiMo Code local MCP",
|
|
595
|
+
value: JSON.stringify(
|
|
596
|
+
{
|
|
597
|
+
mcp: {
|
|
598
|
+
"agent-inspector": {
|
|
599
|
+
type: "local",
|
|
600
|
+
command: ["agent-inspector-mcp", "stdio", "--url", endpoint],
|
|
601
|
+
enabled: true,
|
|
602
|
+
},
|
|
603
|
+
},
|
|
604
|
+
},
|
|
605
|
+
null,
|
|
606
|
+
2,
|
|
607
|
+
),
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
id: "codex-toml",
|
|
611
|
+
label: "Codex TOML",
|
|
612
|
+
value: `[mcp_servers.agent-inspector]\ncommand = "agent-inspector-mcp"\nargs = ["stdio", "--url", "${endpoint}"]`,
|
|
613
|
+
},
|
|
614
|
+
],
|
|
609
615
|
[endpoint],
|
|
610
616
|
);
|
|
611
617
|
|
|
@@ -633,18 +639,27 @@ function McpSettingsTab(): JSX.Element {
|
|
|
633
639
|
host/IP and verify the network path.
|
|
634
640
|
</div>
|
|
635
641
|
</div>
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
642
|
+
{endpoint === null ? (
|
|
643
|
+
<div
|
|
644
|
+
role="alert"
|
|
645
|
+
className="rounded-md bg-destructive/10 px-3 py-2 text-xs text-destructive"
|
|
646
|
+
>
|
|
647
|
+
The browser runtime does not provide a valid agent-facing MCP endpoint.
|
|
648
|
+
</div>
|
|
649
|
+
) : (
|
|
650
|
+
<div className="grid gap-2">
|
|
651
|
+
{values.map((item) => (
|
|
652
|
+
<CopyableSetupValue
|
|
653
|
+
key={item.id}
|
|
654
|
+
id={item.id}
|
|
655
|
+
label={item.label}
|
|
656
|
+
value={item.value}
|
|
657
|
+
copiedId={copiedId}
|
|
658
|
+
onCopy={handleCopy}
|
|
659
|
+
/>
|
|
660
|
+
))}
|
|
661
|
+
</div>
|
|
662
|
+
)}
|
|
648
663
|
</div>
|
|
649
664
|
);
|
|
650
665
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Maximize2, Minimize2 } from "lucide-react";
|
|
2
2
|
import { type JSX, type ReactNode, useCallback, useEffect, useState } from "react";
|
|
3
3
|
import packageJson from "../../../package.json";
|
|
4
|
+
import { withBasePath } from "../../lib/basePath";
|
|
4
5
|
import { Button } from "../ui/button";
|
|
5
6
|
import { CrabLogo } from "../ui/crab-logo";
|
|
6
7
|
import { INSPECTOR_ICON_TRIGGER_CLASS } from "../ui/icon-trigger";
|
|
@@ -78,7 +79,7 @@ export function ApplicationBar({
|
|
|
78
79
|
>
|
|
79
80
|
<div className="grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 gap-y-2 sm:grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)]">
|
|
80
81
|
<a
|
|
81
|
-
href="/"
|
|
82
|
+
href={withBasePath("/")}
|
|
82
83
|
aria-label="Agent Inspector home"
|
|
83
84
|
className="flex min-w-0 items-center gap-2 rounded-md focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-none"
|
|
84
85
|
>
|
|
@@ -11,7 +11,7 @@ import { ApiTimeoutError, fetchJsonWithTimeout } from "../../lib/apiClient";
|
|
|
11
11
|
import type { TimeDisplayFormat } from "../../lib/runtimeConfig";
|
|
12
12
|
import { cn } from "../../lib/utils";
|
|
13
13
|
import { LazyFeatureBoundary } from "../errors/SafeErrorBoundary";
|
|
14
|
-
import { stripClaudeCodeBillingHeader } from "../../
|
|
14
|
+
import { stripClaudeCodeBillingHeader } from "../../lib/claudeCodeStrip";
|
|
15
15
|
import { Button } from "../ui/button";
|
|
16
16
|
import { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from "../ui/tooltip";
|
|
17
17
|
import { useJsonBulkExpansion } from "../ui/json-viewer-bulk";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { apiFormatForPath } from "../../../
|
|
1
|
+
import { apiFormatForPath } from "../../../lib/apiFormat";
|
|
2
2
|
import type { ApiFormat, CapturedLog } from "../../../contracts";
|
|
3
3
|
import { anthropicLogFormatAdapter } from "./anthropic";
|
|
4
4
|
import { openAILogFormatAdapter } from "./openai";
|
package/src/contracts/index.ts
CHANGED
|
@@ -2,15 +2,20 @@ export { JsonValueSchema, trustAsJsonValue } from "./json";
|
|
|
2
2
|
export type { JsonValue } from "./json";
|
|
3
3
|
|
|
4
4
|
export {
|
|
5
|
+
CaptureIncompleteReasonSchema,
|
|
5
6
|
CapturedLogSchema,
|
|
6
7
|
LogBodyChunkSchema,
|
|
8
|
+
LogIdSchema,
|
|
7
9
|
LogBodyPartSchema,
|
|
10
|
+
parseLogId,
|
|
8
11
|
StreamingChunkSchema,
|
|
9
12
|
} from "./log";
|
|
10
13
|
export type {
|
|
11
14
|
ApiFormat,
|
|
15
|
+
CaptureIncompleteReason,
|
|
12
16
|
CapturedLog,
|
|
13
17
|
LogBodyChunk,
|
|
18
|
+
LogId,
|
|
14
19
|
LogBodyPart,
|
|
15
20
|
StreamingChunk,
|
|
16
21
|
TokenUsage,
|
package/src/contracts/log.ts
CHANGED
|
@@ -3,6 +3,32 @@ import { JsonValueSchema } from "./json";
|
|
|
3
3
|
|
|
4
4
|
export type ApiFormat = "anthropic" | "openai" | "unknown";
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Persisted log ID contract. New captures allocate positive IDs, while zero
|
|
8
|
+
* remains readable for legacy data. Unsafe integers are never valid IDs.
|
|
9
|
+
*/
|
|
10
|
+
export const LogIdSchema = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
|
|
11
|
+
|
|
12
|
+
export type LogId = z.infer<typeof LogIdSchema>;
|
|
13
|
+
|
|
14
|
+
/** Parse a decimal path/query/header value using the persisted log ID contract. */
|
|
15
|
+
export function parseLogId(value: string): LogId | null {
|
|
16
|
+
if (!/^\d+$/.test(value)) return null;
|
|
17
|
+
const result = LogIdSchema.safeParse(Number(value));
|
|
18
|
+
return result.success ? result.data : null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const CaptureIncompleteReasonSchema = z.enum([
|
|
22
|
+
"capacity-exceeded",
|
|
23
|
+
"pipeline-closed",
|
|
24
|
+
"write-failed",
|
|
25
|
+
"finalize-failed",
|
|
26
|
+
"upstream-stream-error",
|
|
27
|
+
"shutdown",
|
|
28
|
+
]);
|
|
29
|
+
|
|
30
|
+
export type CaptureIncompleteReason = z.infer<typeof CaptureIncompleteReasonSchema>;
|
|
31
|
+
|
|
6
32
|
/**
|
|
7
33
|
* A single SSE event from a streaming response.
|
|
8
34
|
*/
|
|
@@ -24,7 +50,7 @@ export const LogBodyPartSchema = z.enum(["request", "response"]);
|
|
|
24
50
|
export type LogBodyPart = z.infer<typeof LogBodyPartSchema>;
|
|
25
51
|
|
|
26
52
|
export const LogBodyChunkSchema = z.object({
|
|
27
|
-
logId:
|
|
53
|
+
logId: LogIdSchema,
|
|
28
54
|
part: LogBodyPartSchema,
|
|
29
55
|
text: z.string(),
|
|
30
56
|
offset: z.number().int().nonnegative(),
|
|
@@ -39,7 +65,7 @@ export const LogBodyChunkSchema = z.object({
|
|
|
39
65
|
export type LogBodyChunk = z.infer<typeof LogBodyChunkSchema>;
|
|
40
66
|
|
|
41
67
|
export const CapturedLogSchema = z.object({
|
|
42
|
-
id:
|
|
68
|
+
id: LogIdSchema,
|
|
43
69
|
timestamp: z.string(),
|
|
44
70
|
method: z.string(),
|
|
45
71
|
path: z.string(),
|
|
@@ -64,7 +90,7 @@ export const CapturedLogSchema = z.object({
|
|
|
64
90
|
headers: z.record(z.string(), z.string()).optional(),
|
|
65
91
|
apiFormat: z.enum(["anthropic", "openai", "unknown"]).default("unknown"),
|
|
66
92
|
isTest: z.boolean().optional().default(false),
|
|
67
|
-
replayOfLogId:
|
|
93
|
+
replayOfLogId: LogIdSchema.nullable().optional(),
|
|
68
94
|
providerName: z.string().nullable().optional(),
|
|
69
95
|
clientPort: z.number().nullable().optional(),
|
|
70
96
|
clientPid: z.number().nullable().optional(),
|
|
@@ -75,6 +101,10 @@ export const CapturedLogSchema = z.object({
|
|
|
75
101
|
rawRequestBodyBytes: z.number().int().nonnegative().nullable().optional(),
|
|
76
102
|
responseTextBytes: z.number().int().nonnegative().nullable().optional(),
|
|
77
103
|
bodyContentMode: z.enum(["full", "compact", "truncated"]).optional(),
|
|
104
|
+
captureIncomplete: z.boolean().optional(),
|
|
105
|
+
droppedChunks: z.number().int().nonnegative().optional(),
|
|
106
|
+
droppedBytes: z.number().int().nonnegative().optional(),
|
|
107
|
+
captureIncompleteReason: CaptureIncompleteReasonSchema.nullable().optional(),
|
|
78
108
|
warnings: z.array(z.string()).optional(),
|
|
79
109
|
/** Error message from streaming response (e.g., SSE error event) */
|
|
80
110
|
error: z.string().nullable().optional(),
|
package/src/knowledge/types.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { LogIdSchema } from "../contracts";
|
|
2
3
|
|
|
3
4
|
export const KnowledgeCandidateTypeSchema = z.enum([
|
|
4
5
|
"episode",
|
|
@@ -16,7 +17,7 @@ export type KnowledgeCandidateStatus = z.infer<typeof KnowledgeCandidateStatusSc
|
|
|
16
17
|
export const KnowledgeEvidenceSchema = z.object({
|
|
17
18
|
source: z.literal("agent-inspector"),
|
|
18
19
|
sessionId: z.string(),
|
|
19
|
-
logIds: z.array(
|
|
20
|
+
logIds: z.array(LogIdSchema),
|
|
20
21
|
project: z.string().nullable(),
|
|
21
22
|
models: z.array(z.string()),
|
|
22
23
|
});
|
|
@@ -36,7 +37,7 @@ export const KnowledgeCandidateSchema = z.object({
|
|
|
36
37
|
tags: z.array(z.string()),
|
|
37
38
|
source: z.literal("agent-inspector"),
|
|
38
39
|
sessionId: z.string(),
|
|
39
|
-
logIds: z.array(
|
|
40
|
+
logIds: z.array(LogIdSchema),
|
|
40
41
|
evidence: KnowledgeEvidenceSchema,
|
|
41
42
|
status: KnowledgeCandidateStatusSchema,
|
|
42
43
|
createdAt: z.string(),
|
package/src/lib/alertContract.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { JsonValueSchema } from "../contracts";
|
|
2
|
+
import { JsonValueSchema, LogIdSchema } from "../contracts";
|
|
3
3
|
|
|
4
4
|
export const AlertSeveritySchema = z.enum(["critical", "warning", "notice"]);
|
|
5
5
|
export const AlertStatusSchema = z.enum(["open"]);
|
|
@@ -35,7 +35,7 @@ export const AlertSchema = z.object({
|
|
|
35
35
|
count: z.number().int().positive(),
|
|
36
36
|
firstSeenAt: z.string(),
|
|
37
37
|
lastSeenAt: z.string(),
|
|
38
|
-
logIds: z.array(
|
|
38
|
+
logIds: z.array(LogIdSchema),
|
|
39
39
|
sessionIds: z.array(z.string()),
|
|
40
40
|
runIds: z.array(z.string()),
|
|
41
41
|
groupIds: z.array(z.string()),
|