@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
|
@@ -24,6 +24,22 @@ export type SkillOnboardContext = {
|
|
|
24
24
|
readonly version: string;
|
|
25
25
|
/** The default proxy port (mirrors `DEFAULT_PORT` in `src/cli.ts`). */
|
|
26
26
|
readonly port: number;
|
|
27
|
+
/** Public backend control/agent Base URL, including the configured Base Path. */
|
|
28
|
+
readonly baseUrl: string;
|
|
29
|
+
/** Optional composed or standalone UI URL. Undefined preserves the legacy composed default. */
|
|
30
|
+
readonly uiUrl?: string | null;
|
|
31
|
+
/** REST/SSE Base URL. Falls back to baseUrl for compatibility. */
|
|
32
|
+
readonly controlBaseUrl?: string;
|
|
33
|
+
/** Proxy/MCP Base URL. Falls back to baseUrl for compatibility. */
|
|
34
|
+
readonly agentBaseUrl?: string;
|
|
35
|
+
/** MCP config key selected by onboarding. */
|
|
36
|
+
readonly mcpName?: string;
|
|
37
|
+
/** Selected onboarding target type. */
|
|
38
|
+
readonly targetKind?: "default" | "instance" | "base-url";
|
|
39
|
+
/** Normalized registry name for a named target. */
|
|
40
|
+
readonly instanceName?: string | null;
|
|
41
|
+
/** CLI arguments that reproduce the selected target. */
|
|
42
|
+
readonly onboardTargetArguments?: string;
|
|
27
43
|
/**
|
|
28
44
|
* One-line "detected tools" summary written into the Preflight phase so the
|
|
29
45
|
* skill's instructions match the user's actual environment. Empty string
|
|
@@ -47,9 +63,70 @@ export const REQUIRED_PHASE_HEADINGS = [
|
|
|
47
63
|
|
|
48
64
|
export function renderSkillOnboard(ctx: SkillOnboardContext): string {
|
|
49
65
|
const { version, port, detectedSummary } = ctx;
|
|
66
|
+
const controlBaseUrl = ctx.controlBaseUrl ?? ctx.baseUrl;
|
|
67
|
+
const agentBaseUrl = ctx.agentBaseUrl ?? ctx.baseUrl;
|
|
68
|
+
const uiUrl = ctx.uiUrl === undefined ? ctx.baseUrl : ctx.uiUrl;
|
|
69
|
+
const mcpName = ctx.mcpName ?? "agent-inspector";
|
|
70
|
+
const targetKind = ctx.targetKind ?? "default";
|
|
71
|
+
const targetArguments = ctx.onboardTargetArguments ?? "";
|
|
72
|
+
const instanceName = ctx.instanceName ?? null;
|
|
73
|
+
const healthUrl = `${controlBaseUrl}/api/health`;
|
|
74
|
+
const runtimeUrl = `${controlBaseUrl}/api/runtime`;
|
|
75
|
+
const configUrl = `${controlBaseUrl}/api/config`;
|
|
76
|
+
const anthropicProxyUrl = `${agentBaseUrl}/proxy`;
|
|
77
|
+
const openAiProxyUrl = `${agentBaseUrl}/proxy/v1`;
|
|
78
|
+
const mcpUrl = `${agentBaseUrl}/api/mcp`;
|
|
79
|
+
const logsUrl = `${controlBaseUrl}/api/logs`;
|
|
80
|
+
const providersUrl = `${controlBaseUrl}/api/providers`;
|
|
81
|
+
const statusCommand = `agent-inspector onboard --status${targetArguments}`;
|
|
82
|
+
const refreshCommand = `agent-inspector onboard --force${targetArguments}`;
|
|
83
|
+
const startCommand =
|
|
84
|
+
targetKind === "instance" && instanceName !== null
|
|
85
|
+
? `agent-inspector instance start ${instanceName}`
|
|
86
|
+
: targetKind === "base-url"
|
|
87
|
+
? `# Explicit control target ${controlBaseUrl}: do not start a replacement local runtime.`
|
|
88
|
+
: "agent-inspector --mode simple --background --no-open";
|
|
89
|
+
const fullModeCommand =
|
|
90
|
+
targetKind === "instance" && instanceName !== null
|
|
91
|
+
? `agent-inspector instance restart ${instanceName} --mode full`
|
|
92
|
+
: targetKind === "base-url"
|
|
93
|
+
? "ask the target operator to enable Full capture mode"
|
|
94
|
+
: "agent-inspector --mode full --force-restart";
|
|
95
|
+
const bashStartSnippet =
|
|
96
|
+
targetKind === "base-url" ? startCommand : `${startCommand} > /tmp/agent-inspector.log 2>&1`;
|
|
97
|
+
const windowsStartArguments =
|
|
98
|
+
targetKind === "instance" && instanceName !== null
|
|
99
|
+
? `instance start ${instanceName}`
|
|
100
|
+
: "--mode simple --background --no-open";
|
|
101
|
+
const powershellStartSnippet =
|
|
102
|
+
targetKind === "base-url"
|
|
103
|
+
? startCommand
|
|
104
|
+
: `$found = Get-Command agent-inspector -ErrorAction SilentlyContinue
|
|
105
|
+
if (-not $found) { throw 'agent-inspector is not on PATH' }
|
|
106
|
+
& $found.Source ${windowsStartArguments}`;
|
|
107
|
+
const startExplanation =
|
|
108
|
+
targetKind === "base-url"
|
|
109
|
+
? `The selected Inspector target uses control Base URL \`${controlBaseUrl}\` and agent Base URL \`${agentBaseUrl}\`. Do not launch a default local runtime as a substitute; verify the selected target and ask its operator for help if it is unavailable.`
|
|
110
|
+
: `Start or reuse the selected Inspector backend. Its public control and agent endpoints preserve the selected Base Path; a Web UI may be composed at the same URL, hosted separately, or intentionally absent in backend-only mode. Use \`${fullModeCommand}\` only when the user needs raw headers, raw response, or SSE chunks.`;
|
|
111
|
+
const stopSnippet =
|
|
112
|
+
targetKind === "instance" && instanceName !== null
|
|
113
|
+
? `agent-inspector instance stop ${instanceName}`
|
|
114
|
+
: targetKind === "base-url"
|
|
115
|
+
? `# Ask the operator of ${controlBaseUrl} to stop the selected runtime.`
|
|
116
|
+
: `# Unix / macOS\n lsof -ti:${String(port)} | xargs -r kill -9\n\n # Windows PowerShell\n Get-NetTCPConnection -LocalPort ${String(port)} | ForEach-Object { Stop-Process -Id $_.OwningProcess -Force }`;
|
|
117
|
+
const providerScopeGuidance =
|
|
118
|
+
targetKind === "default"
|
|
119
|
+
? "The unmanaged default target owns the local Agent Inspector data directory used by the file checks below."
|
|
120
|
+
: `The selected target is not the unmanaged default data directory. Do not inspect or edit local ~/.agent-inspector Provider files as a substitute. Query \`${providersUrl}\`, use the selected target's MCP Provider tools with explicit approval, or ask its operator to configure Providers. Skip local-file commands below.`;
|
|
121
|
+
const selectedUi =
|
|
122
|
+
uiUrl === null ? "not supplied (do not infer one from a backend URL)" : `\`${uiUrl}\``;
|
|
123
|
+
const uiTour =
|
|
124
|
+
uiUrl === null
|
|
125
|
+
? "not supplied; continue with MCP/REST, and ask the operator for a standalone UI URL only if the user needs one"
|
|
126
|
+
: `\`${uiUrl}\` — use this explicit composed or standalone browser URL; do not replace it with the control or agent Base URL`;
|
|
50
127
|
return `---
|
|
51
128
|
name: agent-inspector-onboard
|
|
52
|
-
description: Guided setup for Agent Inspector v${version}: start the
|
|
129
|
+
description: Guided setup for Agent Inspector v${version}: start or select the backend, wire your AI coding tool, and capture your first request with or without a Web UI.
|
|
53
130
|
metadata:
|
|
54
131
|
author: agent-inspector
|
|
55
132
|
version: ${version}
|
|
@@ -57,12 +134,16 @@ metadata:
|
|
|
57
134
|
|
|
58
135
|
# Agent Inspector onboard
|
|
59
136
|
|
|
60
|
-
Guide the user from "I just installed Agent Inspector" to "
|
|
137
|
+
Guide the user from "I just installed Agent Inspector" to "my coding agent can use the proxy, REST API, and MCP surface". The backend works in composed and headless deployments; treat the Web UI as an optional presentation surface.
|
|
61
138
|
|
|
62
139
|
Environment detected by the installer:
|
|
63
140
|
${detectedSummary || " (no known AI tool detected — the user can still use the generic curl example in Phase 4)"}
|
|
64
141
|
|
|
65
|
-
|
|
142
|
+
Selected Inspector surfaces:
|
|
143
|
+
- UI URL: ${selectedUi}
|
|
144
|
+
- Control Base URL: \`${controlBaseUrl}\`
|
|
145
|
+
- Agent Base URL: \`${agentBaseUrl}\`
|
|
146
|
+
- MCP key: \`${mcpName}\`
|
|
66
147
|
|
|
67
148
|
> **PAUSE protocol.** Every \`**PAUSE**\` marker in this skill is a real stop.
|
|
68
149
|
> Use the \`AskUserQuestion\` tool to actually wait for the user before
|
|
@@ -77,22 +158,24 @@ Default proxy port: \`${port}\` (override with \`PORT=<n> agent-inspector\` or \
|
|
|
77
158
|
**EXPLAIN:** "Before we do anything, let me see what's already set up. If some of the steps are already done, we can skip them."
|
|
78
159
|
|
|
79
160
|
**DO:** First check whether the generated onboarding files match the installed npm package. If any
|
|
80
|
-
entry is \`outdated\` or \`missing\`, tell the user to run \`
|
|
161
|
+
entry is \`outdated\` or \`missing\`, tell the user to run \`${refreshCommand}\` before
|
|
81
162
|
continuing so they are not guided by stale instructions.
|
|
82
163
|
|
|
83
164
|
\`\`\`bash
|
|
84
|
-
|
|
165
|
+
${statusCommand}
|
|
85
166
|
\`\`\`
|
|
86
167
|
|
|
87
168
|
\`\`\`powershell
|
|
88
|
-
|
|
169
|
+
${statusCommand}
|
|
89
170
|
\`\`\`
|
|
90
171
|
|
|
91
172
|
**DO:** Then probe the three pieces of state this skill touches. Use targeted checks — do **not** read large JSON files into the conversation.
|
|
92
173
|
|
|
174
|
+
**DO:** ${providerScopeGuidance}
|
|
175
|
+
|
|
93
176
|
\`\`\`bash
|
|
94
|
-
# 1. Is the
|
|
95
|
-
curl -fsS "
|
|
177
|
+
# 1. Is the backend already up?
|
|
178
|
+
curl -fsS "${healthUrl}" 2>/dev/null && echo "BACKEND: up" || echo "BACKEND: down"
|
|
96
179
|
|
|
97
180
|
# 2. Does the provider config have a real provider key?
|
|
98
181
|
agent_inspector_data_dir() {
|
|
@@ -123,9 +206,9 @@ fi
|
|
|
123
206
|
# 3. Is the MCP server already wired? (project .mcp.json wins)
|
|
124
207
|
PROJ_MCP=".mcp.json"
|
|
125
208
|
HOME_MCP="$HOME/.claude.json"
|
|
126
|
-
if [ -f "$PROJ_MCP" ] && grep -q '"
|
|
209
|
+
if [ -f "$PROJ_MCP" ] && grep -q '"${mcpName}"' "$PROJ_MCP"; then
|
|
127
210
|
echo "MCP: wired in $PROJ_MCP"
|
|
128
|
-
elif [ -f "$HOME_MCP" ] && grep -q '"
|
|
211
|
+
elif [ -f "$HOME_MCP" ] && grep -q '"${mcpName}"' "$HOME_MCP"; then
|
|
129
212
|
echo "MCP: wired in $HOME_MCP"
|
|
130
213
|
else
|
|
131
214
|
echo "MCP: not wired"
|
|
@@ -153,12 +236,12 @@ $dataDir = Resolve-AgentInspectorDataDir
|
|
|
153
236
|
$providers = Join-Path $dataDir 'providers.json'
|
|
154
237
|
$legacyConfig = Join-Path $dataDir 'config.json'
|
|
155
238
|
|
|
156
|
-
# 1. Is the
|
|
239
|
+
# 1. Is the backend already up?
|
|
157
240
|
try {
|
|
158
|
-
$null = Invoke-RestMethod -Uri "
|
|
159
|
-
Write-Host '
|
|
241
|
+
$null = Invoke-RestMethod -Uri "${healthUrl}" -TimeoutSec 2 -ErrorAction Stop
|
|
242
|
+
Write-Host 'BACKEND: up'
|
|
160
243
|
} catch {
|
|
161
|
-
Write-Host '
|
|
244
|
+
Write-Host 'BACKEND: down'
|
|
162
245
|
}
|
|
163
246
|
|
|
164
247
|
# 2. Does the config have a real provider key?
|
|
@@ -180,9 +263,9 @@ if ((Test-Path $providers) -or (Test-Path $legacyConfig)) {
|
|
|
180
263
|
# 3. Is the MCP server already wired? (project .mcp.json wins)
|
|
181
264
|
$projMcp = Join-Path (Get-Location) '.mcp.json'
|
|
182
265
|
$homeMcp = Join-Path $env:USERPROFILE '.claude.json'
|
|
183
|
-
if ((Test-Path $projMcp) -and (Select-String -Path $projMcp -
|
|
266
|
+
if ((Test-Path $projMcp) -and (Select-String -Path $projMcp -SimpleMatch '${mcpName}' -Quiet)) {
|
|
184
267
|
Write-Host "MCP: wired in $projMcp"
|
|
185
|
-
} elseif ((Test-Path $homeMcp) -and (Select-String -Path $homeMcp -
|
|
268
|
+
} elseif ((Test-Path $homeMcp) -and (Select-String -Path $homeMcp -SimpleMatch '${mcpName}' -Quiet)) {
|
|
186
269
|
Write-Host "MCP: wired in $homeMcp"
|
|
187
270
|
} else {
|
|
188
271
|
Write-Host 'MCP: not wired'
|
|
@@ -228,7 +311,7 @@ node -e "const fs=require('node:fs'),p=require('node:path');const names=process.
|
|
|
228
311
|
\`\`\`
|
|
229
312
|
## Welcome to Agent Inspector!
|
|
230
313
|
|
|
231
|
-
Agent Inspector is an agent observability and knowledge-capture platform for AI coding tools.
|
|
314
|
+
Agent Inspector is an agent observability and knowledge-capture platform for AI coding tools. Its backend owns the transparent model proxy, REST/SSE APIs, capture storage, and MCP server. The default CLI composes a Web UI at the same public Base URL, while \`--backend-only\` keeps every Coding Agent surface available without serving UI files.
|
|
232
315
|
|
|
233
316
|
Agent Inspector starts in **Simple mode** by default. Simple mode is the right habit for everyday use: it keeps requests, responses, tools, timing, and token usage while avoiding heavier raw headers, raw response, and detailed SSE chunk artifacts. Use **Full mode** only when the user is debugging provider headers, raw response payloads, or SSE stream details.
|
|
234
317
|
|
|
@@ -248,6 +331,8 @@ Ready? Let's start with the provider.
|
|
|
248
331
|
|
|
249
332
|
## Phase 2: Provider setup
|
|
250
333
|
|
|
334
|
+
**DO:** ${providerScopeGuidance}
|
|
335
|
+
|
|
251
336
|
**EXPLAIN:** "A 'provider' is an upstream LLM endpoint — Anthropic, OpenAI, MiniMax, etc. agent-inspector routes each request to the right upstream based on the model name. You need at least one provider configured for the proxy to forward traffic."
|
|
252
337
|
|
|
253
338
|
**DO:** First, re-check whether \`<dataDir>/providers.json\` already has a real key (Phase 0 may have raced with a manual edit). Use the same data-dir resolution and \`grep -qE '"apiKey":"sk-'\` (bash) or \`Select-String\` (PowerShell) check from Phase 0. If a real key is present, skip the rest of this phase.
|
|
@@ -341,58 +426,46 @@ $json | Set-Content -Path $file -Encoding UTF8
|
|
|
341
426
|
|
|
342
427
|
## Phase 3: Start proxy
|
|
343
428
|
|
|
344
|
-
**EXPLAIN:** "
|
|
429
|
+
**EXPLAIN:** "${startExplanation}"
|
|
345
430
|
|
|
346
|
-
**DO:** Skip this phase entirely if the Phase 0 health check already reported \`
|
|
431
|
+
**DO:** Skip this phase entirely if the Phase 0 health check already reported \`BACKEND: up\` and the user opted to skip done phases.
|
|
347
432
|
|
|
348
|
-
**DO:** Otherwise,
|
|
433
|
+
**DO:** Otherwise, use the selected target command below. An explicit wrapper Base URL is connection-only and must not cause a replacement local runtime to start.
|
|
349
434
|
|
|
350
435
|
\`\`\`bash
|
|
351
|
-
|
|
352
|
-
agent-inspector --mode simple --background --no-open > /tmp/agent-inspector.log 2>&1
|
|
436
|
+
${bashStartSnippet}
|
|
353
437
|
\`\`\`
|
|
354
438
|
|
|
355
439
|
\`\`\`powershell
|
|
356
|
-
# Windows PowerShell
|
|
357
|
-
|
|
358
|
-
# If not on PATH, fall back to the common npm global shim at $env:APPDATA.
|
|
359
|
-
# As a last resort, let cmd /c resolve it through PATHEXT.
|
|
360
|
-
$log = Join-Path $env:TEMP 'agent-inspector.log'
|
|
361
|
-
$err = Join-Path $env:TEMP 'agent-inspector.err.log'
|
|
362
|
-
$found = Get-Command agent-inspector -ErrorAction SilentlyContinue
|
|
363
|
-
if ($found) {
|
|
364
|
-
$shim = $found.Source
|
|
365
|
-
$args = '--mode','simple','--background','--no-open'
|
|
366
|
-
} elseif (Test-Path (Join-Path $env:APPDATA 'npm/agent-inspector.cmd')) {
|
|
367
|
-
$shim = Join-Path $env:APPDATA 'npm/agent-inspector.cmd'
|
|
368
|
-
$args = '--mode','simple','--background','--no-open'
|
|
369
|
-
} else {
|
|
370
|
-
# bin not on PATH and not at the default npm prefix — let cmd resolve it
|
|
371
|
-
$shim = 'cmd.exe'
|
|
372
|
-
$args = '/c','agent-inspector','--mode','simple','--background','--no-open'
|
|
373
|
-
}
|
|
374
|
-
Start-Process -FilePath $shim -ArgumentList $args -RedirectStandardOutput $log -RedirectStandardError $err -WindowStyle Hidden
|
|
440
|
+
# Windows PowerShell
|
|
441
|
+
${powershellStartSnippet}
|
|
375
442
|
\`\`\`
|
|
376
443
|
|
|
377
|
-
Then wait for the
|
|
444
|
+
Then wait for the selected backend health URL to be ready:
|
|
378
445
|
|
|
379
446
|
\`\`\`bash
|
|
380
447
|
for i in $(seq 1 20); do
|
|
381
|
-
curl -fsS "
|
|
448
|
+
curl -fsS "${healthUrl}" >/dev/null 2>&1 && echo "ready" && break
|
|
382
449
|
sleep 0.5
|
|
383
450
|
done
|
|
384
451
|
\`\`\`
|
|
385
452
|
|
|
386
|
-
**DO:** Hit the health endpoint to confirm the
|
|
453
|
+
**DO:** Hit the health endpoint to confirm the backend is alive:
|
|
387
454
|
|
|
388
455
|
\`\`\`bash
|
|
389
|
-
curl -sS "
|
|
456
|
+
curl -sS "${healthUrl}"
|
|
390
457
|
\`\`\`
|
|
391
458
|
|
|
392
|
-
**DO:** Read
|
|
459
|
+
**DO:** Read the token-free runtime discovery document. Report \`deploymentMode\` and capabilities; do not treat \`backend-only\` as a failure or infer that a UI is present.
|
|
393
460
|
|
|
394
461
|
\`\`\`bash
|
|
395
|
-
curl -sS "
|
|
462
|
+
curl -sS "${runtimeUrl}"
|
|
463
|
+
\`\`\`
|
|
464
|
+
|
|
465
|
+
**DO:** Read \`/api/config\` and tell the user which capture mode is active. If deeper capture is required, offer \`${fullModeCommand}\`.
|
|
466
|
+
|
|
467
|
+
\`\`\`bash
|
|
468
|
+
curl -sS "${configUrl}" | grep -o '"captureMode":"[^"]*"'
|
|
396
469
|
\`\`\`
|
|
397
470
|
|
|
398
471
|
> **PAUSE** — if the health check fails, show the user the log file (\`/tmp/agent-inspector.log\` or \`%TEMP%\\agent-inspector.log\`) and diagnose. Common issues: another process on the port, firewall, missing providers. Use \`AskUserQuestion\` with header \`Proxy up?\` and options \`["Yes, proxy is up", "No, I see an error in the log"]\`. Wait for the answer.
|
|
@@ -407,18 +480,18 @@ curl -sS "http://localhost:${port}/api/config" | grep -o '"captureMode":"[^"]*"'
|
|
|
407
480
|
|
|
408
481
|
\`\`\`bash
|
|
409
482
|
# Claude Code
|
|
410
|
-
export ANTHROPIC_BASE_URL
|
|
483
|
+
export ANTHROPIC_BASE_URL=${anthropicProxyUrl}
|
|
411
484
|
claude
|
|
412
485
|
|
|
413
486
|
# OpenCode
|
|
414
|
-
export LLM_BASE_URL
|
|
487
|
+
export LLM_BASE_URL=${openAiProxyUrl}
|
|
415
488
|
opencode
|
|
416
489
|
|
|
417
490
|
# MiMo Code
|
|
418
|
-
export OPENAI_BASE_URL
|
|
491
|
+
export OPENAI_BASE_URL=${openAiProxyUrl}
|
|
419
492
|
mimo
|
|
420
493
|
|
|
421
|
-
# Cursor / Cody — set the OpenAI base URL in each tool's settings panel to
|
|
494
|
+
# Cursor / Cody — set the OpenAI base URL in each tool's settings panel to ${openAiProxyUrl}
|
|
422
495
|
\`\`\`
|
|
423
496
|
|
|
424
497
|
**Container/network note:** If the AI tool runs in a different container, VM, WSL distro, or host
|
|
@@ -434,32 +507,32 @@ For a tool that wasn't auto-detected, fall through to the generic curl test in t
|
|
|
434
507
|
|
|
435
508
|
## Phase 4.5: Wire MCP server
|
|
436
509
|
|
|
437
|
-
**EXPLAIN:** "The proxy also exposes an MCP server at
|
|
510
|
+
**EXPLAIN:** "The proxy also exposes an MCP server at \`${mcpUrl}\`. Your AI agent can query logs, replay requests, and test providers through it — no need to leave the editor."
|
|
438
511
|
|
|
439
512
|
**DO:** Skip this phase if Phase 0 reported \`MCP: wired in <path>\` and the user opted to skip done phases.
|
|
440
513
|
|
|
441
514
|
**DO:** Otherwise, check the project-level \`.mcp.json\` first (preferred — modern Claude Code convention), then fall back to \`~/.claude.json\`. Use the \`Read\` tool to inspect; do **not** \`cat\` a 40 KB file into the conversation.
|
|
442
515
|
|
|
443
|
-
If neither has
|
|
516
|
+
If neither has a \`${mcpName}\` entry, add one. The simplest path is to write to project \`.mcp.json\` (create it if missing):
|
|
444
517
|
|
|
445
518
|
\`\`\`json
|
|
446
519
|
// .mcp.json (project root)
|
|
447
520
|
{
|
|
448
521
|
"mcpServers": {
|
|
449
|
-
"
|
|
522
|
+
"${mcpName}": {
|
|
450
523
|
"type": "http",
|
|
451
|
-
"url": "
|
|
524
|
+
"url": "${mcpUrl}"
|
|
452
525
|
}
|
|
453
526
|
}
|
|
454
527
|
}
|
|
455
528
|
\`\`\`
|
|
456
529
|
|
|
457
|
-
If \`mcpServers\` already exists in \`.mcp.json\`, merge the \`
|
|
530
|
+
If \`mcpServers\` already exists in \`.mcp.json\`, merge only the \`${mcpName}\` key into it via the \`Edit\` tool — do not overwrite other entries. If you can't create a project \`.mcp.json\` (no project root, permission, etc.), fall back to merging into \`~/.claude.json\` using the same \`Read\`/\`Edit\` pattern.
|
|
458
531
|
|
|
459
532
|
**DO:** Verify the handshake. The MCP \`initialize\` request should return 200 with a \`serverInfo\` payload — that proves the server is mounted and reachable:
|
|
460
533
|
|
|
461
534
|
\`\`\`bash
|
|
462
|
-
curl -sS -X POST "
|
|
535
|
+
curl -sS -X POST "${mcpUrl}" \\
|
|
463
536
|
-H "Content-Type: application/json" \\
|
|
464
537
|
-H "Accept: application/json, text/event-stream" \\
|
|
465
538
|
-d '{
|
|
@@ -489,7 +562,7 @@ The \`grep -o '"name":"agent-inspector"'\` extracts only the serverInfo name —
|
|
|
489
562
|
Fire a minimal Anthropic-format request through the proxy:
|
|
490
563
|
|
|
491
564
|
\`\`\`bash
|
|
492
|
-
curl -sS -X POST "
|
|
565
|
+
curl -sS -X POST "${anthropicProxyUrl}/v1/messages" \\
|
|
493
566
|
-H "Content-Type: application/json" \\
|
|
494
567
|
-H "anthropic-version: 2023-06-01" \\
|
|
495
568
|
-H "x-api-key: \${AGENT_INSPECTOR_API_KEY:-sk-no-key-needed-for-routing}" \\
|
|
@@ -501,7 +574,7 @@ curl -sS -X POST "http://localhost:${port}/proxy/v1/messages" \\
|
|
|
501
574
|
|
|
502
575
|
\`\`\`bash
|
|
503
576
|
for i in $(seq 1 10); do
|
|
504
|
-
resp=$(curl -sS "
|
|
577
|
+
resp=$(curl -sS "${logsUrl}?limit=1")
|
|
505
578
|
count=$(echo "$resp" | grep -o '"total":[0-9]*' | head -1 | grep -o '[0-9]*$')
|
|
506
579
|
if [ "\${count:-0}" -ge 1 ]; then
|
|
507
580
|
echo "captured"
|
|
@@ -528,25 +601,22 @@ done
|
|
|
528
601
|
|
|
529
602
|
## Phase 6: Tour & wrap
|
|
530
603
|
|
|
531
|
-
**EXPLAIN:** "Everything's working. Here's the cheat sheet for the
|
|
604
|
+
**EXPLAIN:** "Everything's working. Here's the cheat sheet for the backend surfaces and the optional Web UI:"
|
|
532
605
|
|
|
533
|
-
- **
|
|
534
|
-
- **
|
|
606
|
+
- **Runtime discovery**: \`${runtimeUrl}\` — token-free deployment mode, UI Base Path, control/agent Base URLs, and capabilities.
|
|
607
|
+
- **Web UI**: ${uiTour}.
|
|
608
|
+
- **MCP server**: \`${mcpUrl}\` — connect from the coding agent to query logs, replay, and test providers; it does not require a Web UI process.
|
|
535
609
|
- **REST API**: \`/api/logs\`, \`/api/sessions\`, \`/api/providers\` — for scripting and shell-based inspection.
|
|
536
610
|
- **Stop the proxy**:
|
|
537
611
|
|
|
538
612
|
\`\`\`bash
|
|
539
|
-
|
|
540
|
-
lsof -ti:${port} | xargs -r kill -9
|
|
541
|
-
|
|
542
|
-
# Windows PowerShell — single-quoted so $env: expands correctly
|
|
543
|
-
Get-NetTCPConnection -LocalPort $port | ForEach-Object { Stop-Process -Id $_.OwningProcess -Force }
|
|
613
|
+
${stopSnippet}
|
|
544
614
|
\`\`\`
|
|
545
615
|
|
|
546
|
-
- **Re-run onboard**: \`
|
|
547
|
-
- **Check onboard files**: \`
|
|
616
|
+
- **Re-run onboard**: \`${refreshCommand}\` refreshes this skill.
|
|
617
|
+
- **Check onboard files**: \`${statusCommand}\` shows whether generated skills are
|
|
548
618
|
current, outdated, missing, newer, or custom.
|
|
549
|
-
- **Full docs**: see the project README
|
|
619
|
+
- **Full docs**: see the project README; do not depend on a UI footer being available.
|
|
550
620
|
|
|
551
621
|
> **PAUSE** — use \`AskUserQuestion\` with header \`All set?\` and options \`["All set, I'm done", "Wait, I want to revisit a phase"]\`. Wait for the answer.
|
|
552
622
|
|