@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.
- package/.output/{nitro.json → backend/nitro.json} +3 -3
- package/.output/backend-public/assets/index-D4LX-sw-.js +11 -0
- package/.output/cli.js +22707 -17099
- package/.output/server/_libs/extend.mjs +4 -8
- package/.output/server/_libs/jszip.mjs +9 -35
- package/.output/server/_libs/modelcontextprotocol__core.mjs +25 -25
- package/.output/server/_libs/modelcontextprotocol__server.mjs +2 -2
- 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/_libs/zod.mjs +6 -6
- package/.output/server/_ssr/index.mjs +5 -4
- package/.output/server/_ssr/publicBasePathContext-IH2ilOfu.mjs +176 -0
- package/.output/server/_ssr/{router-DWcUFPR3.mjs → router-D18yUq36.mjs} +7877 -5597
- package/.output/server/_ssr/start-COQu_AgD.mjs +57 -0
- package/.output/server/_tanstack-start-manifest_v-DnbdNeun.mjs +4 -0
- package/.output/server/index.mjs +5 -145
- package/.output/{public/assets/CompareDrawer-DQHjxFO6.js → ui/assets/CompareDrawer-DAUuIJ6G.js} +1 -1
- package/.output/{public/assets/InspectorPet-D1A4505B.js → ui/assets/InspectorPet-BRBVjOWI.js} +1 -1
- package/.output/ui/assets/ProxyViewerContainer-D7Sq0ctc.js +59 -0
- package/.output/{public/assets/ReplayDialog-C5vmbecv.js → ui/assets/ReplayDialog-nDLsjOhs.js} +1 -1
- package/.output/{public/assets/RequestAnatomy-CPGNB8lk.js → ui/assets/RequestAnatomy-zd4BDgL0.js} +1 -1
- package/.output/ui/assets/ResponseView-AdIXGcSn.js +2 -0
- package/.output/ui/assets/StreamingChunkSequence-CesTz8He.js +1 -0
- package/.output/{public/assets/_sessionId-CDhRgzf6.js → ui/assets/_sessionId-BAfzrhSU.js} +1 -1
- package/.output/{public/assets/_sessionId-mw3aA8Bp.js → ui/assets/_sessionId-QnBomgPD.js} +1 -1
- package/.output/ui/assets/favicon-DYEkHSNl.svg +21 -0
- package/.output/{public/assets/index-B2eoeT-Z.js → ui/assets/index-BcsdxBAd.js} +1 -1
- package/.output/ui/assets/index-BvXp42al.css +1 -0
- package/.output/{public/assets/index-CX7_rf7o.js → ui/assets/index-D0rtCN9V.js} +1 -1
- package/.output/ui/assets/index-DHpwr08Z.js +73 -0
- package/.output/{public/assets/index-BfRhTvOd.js → ui/assets/index-dNuk2dsU.js} +1 -1
- package/.output/ui/assets/json-viewer-BvFHglMb.js +1 -0
- package/.output/{public/assets/jszip.min-C9rCFoU3.js → ui/assets/jszip.min-B5Z7gNZB.js} +1 -1
- package/.output/ui/index.html +229 -0
- package/.output/ui/runtime-config.js +2 -0
- package/.output/workers/logFinalizer.worker.js +983 -414
- package/.output/workers/sessionWorkerEntry.js +983 -414
- package/README.md +363 -35
- package/docs/instance-control.openapi.yaml +361 -0
- package/package.json +28 -5
- 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 +109 -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/backend/routes/api/instances.$name.connection.ts +12 -0
- package/src/backend/routes/api/instances.$name.restart.ts +23 -0
- package/src/backend/routes/api/instances.$name.start.ts +18 -0
- package/src/backend/routes/api/instances.$name.stop.ts +23 -0
- package/src/backend/routes/api/instances.$name.ts +12 -0
- package/src/backend/routes/api/instances.ts +16 -0
- 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/backend/start.ts +10 -0
- package/src/cli/alias.ts +431 -0
- package/src/cli/doctor.ts +32 -9
- package/src/cli/instance.ts +1050 -0
- package/src/cli/instanceArgs.ts +285 -0
- package/src/cli/instanceControl.ts +181 -0
- package/src/cli/instanceModel.ts +267 -0
- package/src/cli/instanceRegistry.ts +731 -0
- package/src/cli/networkHints.ts +27 -14
- package/src/cli/onboard.ts +190 -35
- package/src/cli/onboardTarget.ts +228 -0
- package/src/cli/templates/codex-skill-onboard.ts +109 -31
- package/src/cli/templates/skill-onboard.ts +140 -70
- package/src/cli.ts +338 -77
- package/src/components/ProxyViewer.tsx +20 -10
- 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 +160 -140
- 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/basePath.ts +31 -7
- 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 +54 -0
- package/src/lib/instanceContract.ts +236 -0
- package/src/lib/managedInstance.ts +104 -0
- package/src/lib/piAgentContract.ts +3 -2
- package/src/lib/publicBasePathContext.ts +137 -0
- 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 +150 -0
- package/src/mcp/loopback.ts +16 -5
- package/src/mcp/mode.ts +25 -0
- package/src/mcp/server.ts +274 -39
- package/src/mcp/toolHandlers.ts +2 -2
- 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 +1049 -50
- 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 +84 -2
- package/src/proxy/schemas.ts +7 -1
- package/src/proxy/sessionArchive.ts +78 -14
- package/src/proxy/sessionInfo.ts +5 -4
- package/src/proxy/sqliteLogIndex.ts +65 -2
- 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-BhpIgfBi.js +0 -126
- package/.output/public/assets/ResponseView-DUfrajCm.js +0 -2
- package/.output/public/assets/StreamingChunkSequence-nbeCQqOz.js +0 -1
- package/.output/public/assets/index-BWjeqxbk.css +0 -1
- package/.output/public/assets/index-C6qZwYlR.js +0 -70
- package/.output/public/assets/json-viewer-BLmF1sOZ.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-E_Dmopc-.mjs +0 -144
- package/.output/server/_sessionId-U54BAqdp.mjs +0 -82
- package/.output/server/_ssr/CompareDrawer-CksatPed.mjs +0 -1058
- package/.output/server/_ssr/InspectorPet-DNc4GQ7z.mjs +0 -936
- package/.output/server/_ssr/ProxyViewerContainer-B02Ey0p_.mjs +0 -17607
- package/.output/server/_ssr/ReplayDialog-DdMvHJF1.mjs +0 -723
- package/.output/server/_ssr/RequestAnatomy--vh2Z8__.mjs +0 -835
- package/.output/server/_ssr/ResponseView-Dhxc-cKC.mjs +0 -755
- package/.output/server/_ssr/StreamingChunkSequence-BG0EQmaD.mjs +0 -272
- package/.output/server/_ssr/index-D0At9nfd.mjs +0 -82
- package/.output/server/_ssr/index-lcfulIXa.mjs +0 -133
- package/.output/server/_ssr/json-viewer-My1J1_5R.mjs +0 -481
- package/.output/server/_ssr/start-HYkvq4Ni.mjs +0 -4
- package/.output/server/_tanstack-start-manifest_v-B2chR8ef.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/.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,8 +42,12 @@ import {
|
|
|
42
42
|
} from "lucide-react";
|
|
43
43
|
|
|
44
44
|
import type { CapturedLog } from "../contracts";
|
|
45
|
-
import { exportLogsAsZip, type ExportMode } from "../lib/export-logs";
|
|
46
45
|
import { withBasePath } from "../lib/basePath";
|
|
46
|
+
import { exportLogsAsZip, type ExportMode } from "../lib/export-logs";
|
|
47
|
+
import {
|
|
48
|
+
subscribeCodingAgentEndpoints,
|
|
49
|
+
type CodingAgentEndpoints,
|
|
50
|
+
} from "../lib/codingAgentEndpoints";
|
|
47
51
|
import type { ImportLogsResponse } from "../lib/logImportContract";
|
|
48
52
|
import { copyTextToClipboard } from "../lib/clipboard";
|
|
49
53
|
import type { InspectorGroupEvidence, InspectorGroupMember } from "../lib/groupContract";
|
|
@@ -1212,7 +1216,7 @@ function SessionContextBar({
|
|
|
1212
1216
|
<div className="flex flex-wrap items-center gap-2">
|
|
1213
1217
|
{showBackLink && (
|
|
1214
1218
|
<a
|
|
1215
|
-
href="/"
|
|
1219
|
+
href={withBasePath("/")}
|
|
1216
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"
|
|
1217
1221
|
aria-label="Back to all sessions"
|
|
1218
1222
|
title="Back to all sessions"
|
|
@@ -1384,10 +1388,9 @@ export function ProxyViewer({
|
|
|
1384
1388
|
const exportRequestIdRef = useRef(0);
|
|
1385
1389
|
const detailsPanelResizeRef = useRef<DetailsPanelResizeState | null>(null);
|
|
1386
1390
|
useKeyboardNavigation(logListRef, logListWrapperRef, { pageWide: true });
|
|
1387
|
-
const
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
}, []);
|
|
1391
|
+
const [connectionEndpoints, setConnectionEndpoints] = useState<CodingAgentEndpoints | null>(null);
|
|
1392
|
+
|
|
1393
|
+
useEffect(() => subscribeCodingAgentEndpoints(setConnectionEndpoints), []);
|
|
1391
1394
|
|
|
1392
1395
|
const cancelTransientTasks = useCallback(() => {
|
|
1393
1396
|
exportRequestIdRef.current += 1;
|
|
@@ -2111,7 +2114,7 @@ export function ProxyViewer({
|
|
|
2111
2114
|
)}
|
|
2112
2115
|
{hideSessionFilter ? (
|
|
2113
2116
|
<a
|
|
2114
|
-
href="/"
|
|
2117
|
+
href={withBasePath("/")}
|
|
2115
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"
|
|
2116
2119
|
>
|
|
2117
2120
|
Back to all sessions
|
|
@@ -2142,15 +2145,22 @@ export function ProxyViewer({
|
|
|
2142
2145
|
Pick a session from the filter panel to load stored logs on demand.
|
|
2143
2146
|
</p>
|
|
2144
2147
|
)}
|
|
2145
|
-
{liveEmptyStateCopy.showConnectionCommands && (
|
|
2148
|
+
{liveEmptyStateCopy.showConnectionCommands && connectionEndpoints !== null && (
|
|
2146
2149
|
<>
|
|
2147
2150
|
<div className="flex flex-col items-center gap-2">
|
|
2148
2151
|
<CopyableCommand
|
|
2149
|
-
command={`ANTHROPIC_BASE_URL=${
|
|
2152
|
+
command={`ANTHROPIC_BASE_URL=${connectionEndpoints.proxy} <your-tool>`}
|
|
2153
|
+
/>
|
|
2154
|
+
<CopyableCommand
|
|
2155
|
+
command={`LLM_BASE_URL=${connectionEndpoints.proxy} opencode`}
|
|
2156
|
+
/>
|
|
2157
|
+
<CopyableCommand
|
|
2158
|
+
command={`OPENAI_BASE_URL=${connectionEndpoints.openAiV1} <your-tool>`}
|
|
2150
2159
|
/>
|
|
2151
2160
|
<CopyableCommand
|
|
2152
|
-
command={`
|
|
2161
|
+
command={`base_url = "${connectionEndpoints.openAiV1}"`}
|
|
2153
2162
|
/>
|
|
2163
|
+
<CopyableCommand command={`MCP_URL=${connectionEndpoints.mcp}`} />
|
|
2154
2164
|
</div>
|
|
2155
2165
|
<p className="mx-auto max-w-xl text-xs leading-relaxed text-muted-foreground">
|
|
2156
2166
|
Container note: if your AI tool runs in a different container or host than
|
|
@@ -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,7 +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 {
|
|
13
|
+
import {
|
|
14
|
+
subscribeCodingAgentEndpoints,
|
|
15
|
+
type CodingAgentEndpoints,
|
|
16
|
+
} from "../../lib/codingAgentEndpoints";
|
|
14
17
|
import {
|
|
15
18
|
MAX_PROVIDER_TEST_TIMEOUT_SECONDS,
|
|
16
19
|
MAX_SLOW_RESPONSE_THRESHOLD_SECONDS,
|
|
@@ -329,10 +332,8 @@ function CopyableSetupValue({
|
|
|
329
332
|
|
|
330
333
|
function OnboardingSettingsTab(): JSX.Element {
|
|
331
334
|
const [copiedId, setCopiedId] = useState<string | null>(null);
|
|
332
|
-
const
|
|
333
|
-
|
|
334
|
-
return window.location.origin;
|
|
335
|
-
}, []);
|
|
335
|
+
const [endpoints, setEndpoints] = useState<CodingAgentEndpoints | null>(null);
|
|
336
|
+
useEffect(() => subscribeCodingAgentEndpoints(setEndpoints), []);
|
|
336
337
|
const values = useMemo(
|
|
337
338
|
() => [
|
|
338
339
|
{ id: "status", label: "Check onboarding", value: "agent-inspector onboard --status" },
|
|
@@ -364,11 +365,6 @@ function OnboardingSettingsTab(): JSX.Element {
|
|
|
364
365
|
value: "agent-inspector onboard --status --opencode-only",
|
|
365
366
|
},
|
|
366
367
|
{ id: "opencode-verify", label: "OpenCode verify", value: "opencode mcp list" },
|
|
367
|
-
{
|
|
368
|
-
id: "opencode-proxy",
|
|
369
|
-
label: "OpenCode proxy",
|
|
370
|
-
value: `LLM_BASE_URL=${origin}${withBasePath("/proxy")}`,
|
|
371
|
-
},
|
|
372
368
|
{
|
|
373
369
|
id: "mimo-config",
|
|
374
370
|
label: "MiMo Code config",
|
|
@@ -380,25 +376,34 @@ function OnboardingSettingsTab(): JSX.Element {
|
|
|
380
376
|
value: "agent-inspector onboard --status --mimo-only",
|
|
381
377
|
},
|
|
382
378
|
{ id: "mimo-verify", label: "MiMo Code verify", value: "mimo mcp list" },
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
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
|
+
]),
|
|
400
405
|
],
|
|
401
|
-
[
|
|
406
|
+
[endpoints],
|
|
402
407
|
);
|
|
403
408
|
|
|
404
409
|
const handleCopy = useCallback((id: string, value: string) => {
|
|
@@ -496,111 +501,117 @@ function OnboardingSettingsTab(): JSX.Element {
|
|
|
496
501
|
|
|
497
502
|
function McpSettingsTab(): JSX.Element {
|
|
498
503
|
const [copiedId, setCopiedId] = useState<string | null>(null);
|
|
499
|
-
const
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
+
const [endpoint, setEndpoint] = useState<string | null>(null);
|
|
505
|
+
useEffect(
|
|
506
|
+
() =>
|
|
507
|
+
subscribeCodingAgentEndpoints((endpoints) => {
|
|
508
|
+
setEndpoint(endpoints?.mcp ?? null);
|
|
509
|
+
}),
|
|
510
|
+
[],
|
|
511
|
+
);
|
|
504
512
|
const values = useMemo(
|
|
505
|
-
() =>
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
label: "Bridge doctor",
|
|
515
|
-
value: `agent-inspector-mcp doctor --url ${endpoint}`,
|
|
516
|
-
},
|
|
517
|
-
{
|
|
518
|
-
id: "writes",
|
|
519
|
-
label: "Enable write tools",
|
|
520
|
-
value: "AGENT_INSPECTOR_MCP_WRITES=1 agent-inspector",
|
|
521
|
-
},
|
|
522
|
-
{
|
|
523
|
-
id: "capabilities",
|
|
524
|
-
label: "Capabilities resource",
|
|
525
|
-
value: "inspector://mcp/capabilities",
|
|
526
|
-
},
|
|
527
|
-
{
|
|
528
|
-
id: "context",
|
|
529
|
-
label: "Current context resource",
|
|
530
|
-
value: "inspector://context/current",
|
|
531
|
-
},
|
|
532
|
-
{
|
|
533
|
-
id: "streamable-json",
|
|
534
|
-
label: "Streamable HTTP JSON",
|
|
535
|
-
value: JSON.stringify(
|
|
536
|
-
{
|
|
537
|
-
mcpServers: {
|
|
538
|
-
"agent-inspector": {
|
|
539
|
-
type: "streamableHttp",
|
|
540
|
-
url: endpoint,
|
|
541
|
-
},
|
|
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}`,
|
|
542
522
|
},
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
},
|
|
548
|
-
{
|
|
549
|
-
id: "stdio-json",
|
|
550
|
-
label: "Stdio MCP JSON",
|
|
551
|
-
value: JSON.stringify(
|
|
552
|
-
{
|
|
553
|
-
mcpServers: {
|
|
554
|
-
"agent-inspector": {
|
|
555
|
-
command: "agent-inspector-mcp",
|
|
556
|
-
args: ["stdio", "--url", endpoint],
|
|
557
|
-
},
|
|
523
|
+
{
|
|
524
|
+
id: "doctor",
|
|
525
|
+
label: "Bridge doctor",
|
|
526
|
+
value: `agent-inspector-mcp doctor --url ${endpoint}`,
|
|
558
527
|
},
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
},
|
|
564
|
-
{
|
|
565
|
-
id: "opencode-local",
|
|
566
|
-
label: "OpenCode local MCP",
|
|
567
|
-
value: JSON.stringify(
|
|
568
|
-
{
|
|
569
|
-
mcp: {
|
|
570
|
-
"agent-inspector": {
|
|
571
|
-
type: "local",
|
|
572
|
-
command: ["agent-inspector-mcp", "stdio", "--url", endpoint],
|
|
573
|
-
enabled: true,
|
|
574
|
-
},
|
|
528
|
+
{
|
|
529
|
+
id: "writes",
|
|
530
|
+
label: "Enable write tools",
|
|
531
|
+
value: "AGENT_INSPECTOR_MCP_WRITES=1 agent-inspector",
|
|
575
532
|
},
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
},
|
|
581
|
-
{
|
|
582
|
-
id: "mimo-local",
|
|
583
|
-
label: "MiMo Code local MCP",
|
|
584
|
-
value: JSON.stringify(
|
|
585
|
-
{
|
|
586
|
-
mcp: {
|
|
587
|
-
"agent-inspector": {
|
|
588
|
-
type: "local",
|
|
589
|
-
command: ["agent-inspector-mcp", "stdio", "--url", endpoint],
|
|
590
|
-
enabled: true,
|
|
591
|
-
},
|
|
533
|
+
{
|
|
534
|
+
id: "capabilities",
|
|
535
|
+
label: "Capabilities resource",
|
|
536
|
+
value: "inspector://mcp/capabilities",
|
|
592
537
|
},
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
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
|
+
],
|
|
604
615
|
[endpoint],
|
|
605
616
|
);
|
|
606
617
|
|
|
@@ -628,18 +639,27 @@ function McpSettingsTab(): JSX.Element {
|
|
|
628
639
|
host/IP and verify the network path.
|
|
629
640
|
</div>
|
|
630
641
|
</div>
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
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
|
+
)}
|
|
643
663
|
</div>
|
|
644
664
|
);
|
|
645
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(),
|