@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
package/src/cli/networkHints.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { networkInterfaces } from "node:os";
|
|
2
|
+
import { isIP } from "node:net";
|
|
2
3
|
import { appendBasePathToOrigin, normalizeBasePath } from "../lib/basePath";
|
|
3
4
|
|
|
4
5
|
export type NetworkInterfaceMap = ReturnType<typeof networkInterfaces>;
|
|
@@ -22,12 +23,12 @@ export function isWildcardHost(host: BindHost): boolean {
|
|
|
22
23
|
export function isLoopbackHost(host: BindHost): boolean {
|
|
23
24
|
const trimmed = trimHost(host);
|
|
24
25
|
if (trimmed === undefined) return false;
|
|
25
|
-
|
|
26
|
-
trimmed
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
);
|
|
26
|
+
const normalized =
|
|
27
|
+
trimmed.startsWith("[") && trimmed.endsWith("]")
|
|
28
|
+
? trimmed.slice(1, -1).toLowerCase()
|
|
29
|
+
: trimmed.toLowerCase();
|
|
30
|
+
if (normalized === "localhost" || normalized === "::1") return true;
|
|
31
|
+
return isIP(normalized) === 4 && normalized.split(".", 1)[0] === "127";
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
function bracketIpv6(host: string): string {
|
|
@@ -112,11 +113,28 @@ function accessUrl(origin: string, path: string, basePath: string): string {
|
|
|
112
113
|
return appendBasePathToOrigin(origin, path, basePath);
|
|
113
114
|
}
|
|
114
115
|
|
|
116
|
+
function appendSurfaceLines(
|
|
117
|
+
lines: string[],
|
|
118
|
+
label: "Local" | "Bound" | "Network",
|
|
119
|
+
origin: string,
|
|
120
|
+
basePath: string,
|
|
121
|
+
uiEnabled: boolean,
|
|
122
|
+
): void {
|
|
123
|
+
const baseUrl = accessUrl(origin, "/", basePath);
|
|
124
|
+
if (uiEnabled) lines.push(` ${label} UI: ${baseUrl}`);
|
|
125
|
+
lines.push(` ${label} control Base: ${baseUrl}`);
|
|
126
|
+
lines.push(` ${label} agent Base: ${baseUrl}`);
|
|
127
|
+
lines.push(` ${label} REST API: ${accessUrl(origin, "/api", basePath)}`);
|
|
128
|
+
lines.push(` ${label} proxy: ${accessUrl(origin, "/proxy", basePath)}`);
|
|
129
|
+
lines.push(` ${label} MCP: ${accessUrl(origin, "/api/mcp", basePath)}`);
|
|
130
|
+
}
|
|
131
|
+
|
|
115
132
|
export function formatAccessHintLines(
|
|
116
133
|
port: number,
|
|
117
134
|
networkUrls: readonly string[],
|
|
118
135
|
host: BindHost = undefined,
|
|
119
136
|
basePath = "",
|
|
137
|
+
uiEnabled = true,
|
|
120
138
|
): string[] {
|
|
121
139
|
const normalizedBasePath = normalizeBasePath(basePath);
|
|
122
140
|
const localUrl = localUrlForPort(port);
|
|
@@ -124,14 +142,10 @@ export function formatAccessHintLines(
|
|
|
124
142
|
const lines = ["Access URLs:", ` Bind host: ${hostLabel}`];
|
|
125
143
|
|
|
126
144
|
if (isLoopbackHost(host) || isWildcardHost(host)) {
|
|
127
|
-
lines
|
|
128
|
-
lines.push(` Local proxy: ${accessUrl(localUrl, "/proxy", normalizedBasePath)}`);
|
|
129
|
-
lines.push(` Local MCP: ${accessUrl(localUrl, "/api/mcp", normalizedBasePath)}`);
|
|
145
|
+
appendSurfaceLines(lines, "Local", localUrl, normalizedBasePath, uiEnabled);
|
|
130
146
|
} else {
|
|
131
147
|
const boundUrl = urlForHost(port, host);
|
|
132
|
-
lines
|
|
133
|
-
lines.push(` Bound proxy: ${accessUrl(boundUrl, "/proxy", normalizedBasePath)}`);
|
|
134
|
-
lines.push(` Bound MCP: ${accessUrl(boundUrl, "/api/mcp", normalizedBasePath)}`);
|
|
148
|
+
appendSurfaceLines(lines, "Bound", boundUrl, normalizedBasePath, uiEnabled);
|
|
135
149
|
lines.push(" Localhost: may not work because the server is bound to a specific host");
|
|
136
150
|
}
|
|
137
151
|
|
|
@@ -141,8 +155,7 @@ export function formatAccessHintLines(
|
|
|
141
155
|
} else if (firstNetworkUrl === undefined) {
|
|
142
156
|
lines.push(" Network: no non-loopback IPv4 address detected");
|
|
143
157
|
} else {
|
|
144
|
-
lines
|
|
145
|
-
lines.push(` Network proxy: ${accessUrl(firstNetworkUrl, "/proxy", normalizedBasePath)}`);
|
|
158
|
+
appendSurfaceLines(lines, "Network", firstNetworkUrl, normalizedBasePath, uiEnabled);
|
|
146
159
|
const moreUrls = networkUrls.slice(1);
|
|
147
160
|
if (moreUrls.length > 0) {
|
|
148
161
|
lines.push(` Other IPs: ${moreUrls.join(", ")}`);
|
package/src/cli/onboard.ts
CHANGED
|
@@ -26,6 +26,7 @@ import { fileURLToPath } from "node:url";
|
|
|
26
26
|
|
|
27
27
|
import { appendBasePathToOrigin, getConfiguredBasePath } from "../lib/basePath.js";
|
|
28
28
|
import { detectAll, detectFirst } from "./detect-tools.js";
|
|
29
|
+
import { type OnboardTarget, resolveOnboardTarget } from "./onboardTarget.js";
|
|
29
30
|
import { renderCommandOnboard } from "./templates/command-onboard.js";
|
|
30
31
|
import {
|
|
31
32
|
renderCodexSkillOnboard,
|
|
@@ -38,7 +39,11 @@ const __dirname = dirname(__filename);
|
|
|
38
39
|
|
|
39
40
|
const DEFAULT_PORT = 9527;
|
|
40
41
|
const DEFAULT_ORIGIN = `http://localhost:${DEFAULT_PORT}`;
|
|
41
|
-
const DEFAULT_MCP_URL =
|
|
42
|
+
const DEFAULT_MCP_URL = appendBasePathToOrigin(
|
|
43
|
+
DEFAULT_ORIGIN,
|
|
44
|
+
"/api/mcp",
|
|
45
|
+
getConfiguredBasePath({}),
|
|
46
|
+
);
|
|
42
47
|
const LEGACY_MCP_URL = "http://localhost:9527/api/mcp";
|
|
43
48
|
const SKILL_DIR_NAME = "agent-inspector-onboard";
|
|
44
49
|
const SKILL_FILE_NAME = "SKILL.md";
|
|
@@ -65,12 +70,18 @@ export type OnboardFlags = {
|
|
|
65
70
|
opencodeOnly: boolean;
|
|
66
71
|
opencodeConfig: string | null;
|
|
67
72
|
opencodeTransport: AgentMcpTransport;
|
|
68
|
-
opencodeMcpUrl: string;
|
|
73
|
+
opencodeMcpUrl: string | null;
|
|
69
74
|
mimo: boolean;
|
|
70
75
|
mimoOnly: boolean;
|
|
71
76
|
mimoConfig: string | null;
|
|
72
77
|
mimoTransport: AgentMcpTransport;
|
|
73
|
-
mimoMcpUrl: string;
|
|
78
|
+
mimoMcpUrl: string | null;
|
|
79
|
+
instanceName: string | null;
|
|
80
|
+
baseUrl: string | null;
|
|
81
|
+
controlBaseUrl: string | null;
|
|
82
|
+
agentBaseUrl: string | null;
|
|
83
|
+
uiUrl: string | null | undefined;
|
|
84
|
+
mcpName: string | null;
|
|
74
85
|
uninstall: boolean;
|
|
75
86
|
status: boolean;
|
|
76
87
|
json: boolean;
|
|
@@ -88,6 +99,7 @@ type AgentMcpConfigTarget = {
|
|
|
88
99
|
configPath: string;
|
|
89
100
|
transport: AgentMcpTransport;
|
|
90
101
|
endpoint: string;
|
|
102
|
+
mcpName: string;
|
|
91
103
|
setupAction: string;
|
|
92
104
|
forceAction: string;
|
|
93
105
|
verifyCommand: string;
|
|
@@ -102,6 +114,7 @@ type AgentMcpConfigStatus = {
|
|
|
102
114
|
state: AgentMcpConfigState;
|
|
103
115
|
transport: AgentMcpStatusTransport;
|
|
104
116
|
endpoint: string;
|
|
117
|
+
mcpName: string;
|
|
105
118
|
action: string;
|
|
106
119
|
forceAction: string;
|
|
107
120
|
verifyCommand: string;
|
|
@@ -183,11 +196,6 @@ function actionForStatus(label: string, state: GeneratedFileState): string {
|
|
|
183
196
|
}
|
|
184
197
|
|
|
185
198
|
function parseFlags(argv: readonly string[]): OnboardFlags {
|
|
186
|
-
const defaultMcpUrl = appendBasePathToOrigin(
|
|
187
|
-
DEFAULT_ORIGIN,
|
|
188
|
-
"/api/mcp",
|
|
189
|
-
getConfiguredBasePath(process.env),
|
|
190
|
-
);
|
|
191
199
|
const flags: OnboardFlags = {
|
|
192
200
|
force: false,
|
|
193
201
|
dryRun: false,
|
|
@@ -199,12 +207,18 @@ function parseFlags(argv: readonly string[]): OnboardFlags {
|
|
|
199
207
|
opencodeOnly: false,
|
|
200
208
|
opencodeConfig: null,
|
|
201
209
|
opencodeTransport: "local",
|
|
202
|
-
opencodeMcpUrl:
|
|
210
|
+
opencodeMcpUrl: null,
|
|
203
211
|
mimo: false,
|
|
204
212
|
mimoOnly: false,
|
|
205
213
|
mimoConfig: null,
|
|
206
214
|
mimoTransport: "local",
|
|
207
|
-
mimoMcpUrl:
|
|
215
|
+
mimoMcpUrl: null,
|
|
216
|
+
instanceName: null,
|
|
217
|
+
baseUrl: null,
|
|
218
|
+
controlBaseUrl: null,
|
|
219
|
+
agentBaseUrl: null,
|
|
220
|
+
uiUrl: undefined,
|
|
221
|
+
mcpName: null,
|
|
208
222
|
uninstall: false,
|
|
209
223
|
status: false,
|
|
210
224
|
json: false,
|
|
@@ -332,6 +346,69 @@ function parseFlags(argv: readonly string[]): OnboardFlags {
|
|
|
332
346
|
i++;
|
|
333
347
|
break;
|
|
334
348
|
}
|
|
349
|
+
case "--instance": {
|
|
350
|
+
const next = argv[i + 1];
|
|
351
|
+
if (next === undefined || next.trim().length === 0) {
|
|
352
|
+
process.stderr.write("agent-inspector onboard: --instance requires a name\n");
|
|
353
|
+
process.exit(2);
|
|
354
|
+
}
|
|
355
|
+
flags.instanceName = next;
|
|
356
|
+
i++;
|
|
357
|
+
break;
|
|
358
|
+
}
|
|
359
|
+
case "--base-url": {
|
|
360
|
+
const next = argv[i + 1];
|
|
361
|
+
if (next === undefined || next.trim().length === 0) {
|
|
362
|
+
process.stderr.write("agent-inspector onboard: --base-url requires a URL\n");
|
|
363
|
+
process.exit(2);
|
|
364
|
+
}
|
|
365
|
+
flags.baseUrl = next;
|
|
366
|
+
i++;
|
|
367
|
+
break;
|
|
368
|
+
}
|
|
369
|
+
case "--control-base-url": {
|
|
370
|
+
const next = argv[i + 1];
|
|
371
|
+
if (next === undefined || next.trim().length === 0) {
|
|
372
|
+
process.stderr.write("agent-inspector onboard: --control-base-url requires a URL\n");
|
|
373
|
+
process.exit(2);
|
|
374
|
+
}
|
|
375
|
+
flags.controlBaseUrl = next;
|
|
376
|
+
i++;
|
|
377
|
+
break;
|
|
378
|
+
}
|
|
379
|
+
case "--agent-base-url": {
|
|
380
|
+
const next = argv[i + 1];
|
|
381
|
+
if (next === undefined || next.trim().length === 0) {
|
|
382
|
+
process.stderr.write("agent-inspector onboard: --agent-base-url requires a URL\n");
|
|
383
|
+
process.exit(2);
|
|
384
|
+
}
|
|
385
|
+
flags.agentBaseUrl = next;
|
|
386
|
+
i++;
|
|
387
|
+
break;
|
|
388
|
+
}
|
|
389
|
+
case "--ui-url": {
|
|
390
|
+
const next = argv[i + 1];
|
|
391
|
+
if (next === undefined || next.trim().length === 0) {
|
|
392
|
+
process.stderr.write("agent-inspector onboard: --ui-url requires a URL\n");
|
|
393
|
+
process.exit(2);
|
|
394
|
+
}
|
|
395
|
+
flags.uiUrl = next;
|
|
396
|
+
i++;
|
|
397
|
+
break;
|
|
398
|
+
}
|
|
399
|
+
case "--no-ui":
|
|
400
|
+
flags.uiUrl = null;
|
|
401
|
+
break;
|
|
402
|
+
case "--mcp-name": {
|
|
403
|
+
const next = argv[i + 1];
|
|
404
|
+
if (next === undefined || next.trim().length === 0) {
|
|
405
|
+
process.stderr.write("agent-inspector onboard: --mcp-name requires a name\n");
|
|
406
|
+
process.exit(2);
|
|
407
|
+
}
|
|
408
|
+
flags.mcpName = next;
|
|
409
|
+
i++;
|
|
410
|
+
break;
|
|
411
|
+
}
|
|
335
412
|
case "--uninstall":
|
|
336
413
|
flags.uninstall = true;
|
|
337
414
|
break;
|
|
@@ -401,6 +478,13 @@ Options:
|
|
|
401
478
|
--mimo-transport <local|remote>
|
|
402
479
|
MiMo Code MCP transport to write (default: local)
|
|
403
480
|
--mimo-mcp-url <url> Agent Inspector MCP endpoint for MiMo Code
|
|
481
|
+
--instance <name> Target a registered named Inspector instance
|
|
482
|
+
--base-url <url> Target an explicit credential-free backend control/agent Base URL
|
|
483
|
+
--control-base-url <url> Control API Base URL for a separated deployment
|
|
484
|
+
--agent-base-url <url> Proxy and MCP Base URL for Coding Agents
|
|
485
|
+
--ui-url <url> Browser UI URL for a separated deployment
|
|
486
|
+
--no-ui Declare that the explicit target has no browser UI
|
|
487
|
+
--mcp-name <name> MCP config key (named default: agent-inspector-<instance>)
|
|
404
488
|
--uninstall Remove generated files whose version matches this package
|
|
405
489
|
--status Show installed onboarding file versions and suggested action
|
|
406
490
|
--json Emit machine-readable JSON with --status
|
|
@@ -487,34 +571,64 @@ function resolveMiMoConfigPath(flags: OnboardFlags): string {
|
|
|
487
571
|
return jsoncPath;
|
|
488
572
|
}
|
|
489
573
|
|
|
490
|
-
function
|
|
574
|
+
function onboardSelectionArguments(flags: OnboardFlags, target: OnboardTarget): string {
|
|
575
|
+
const args: string[] = [];
|
|
576
|
+
if (target.kind === "instance" && target.instanceName !== null) {
|
|
577
|
+
args.push("--instance", target.instanceName);
|
|
578
|
+
} else if (target.kind === "base-url") {
|
|
579
|
+
const usedSharedBaseUrl =
|
|
580
|
+
flags.baseUrl !== null &&
|
|
581
|
+
flags.controlBaseUrl === null &&
|
|
582
|
+
flags.agentBaseUrl === null &&
|
|
583
|
+
flags.uiUrl === undefined;
|
|
584
|
+
if (usedSharedBaseUrl) {
|
|
585
|
+
args.push("--base-url", target.baseUrl);
|
|
586
|
+
} else {
|
|
587
|
+
args.push("--control-base-url", target.controlBaseUrl);
|
|
588
|
+
args.push("--agent-base-url", target.agentBaseUrl);
|
|
589
|
+
if (target.uiUrl === null) {
|
|
590
|
+
args.push("--no-ui");
|
|
591
|
+
} else {
|
|
592
|
+
args.push("--ui-url", target.uiUrl);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
if (flags.mcpName !== null) args.push("--mcp-name", target.mcpName);
|
|
597
|
+
return args.length === 0 ? "" : ` ${args.join(" ")}`;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
function openCodeTarget(flags: OnboardFlags, onboardTarget: OnboardTarget): AgentMcpConfigTarget {
|
|
601
|
+
const setupAction = `agent-inspector onboard --opencode-only${onboardSelectionArguments(flags, onboardTarget)}`;
|
|
491
602
|
return {
|
|
492
603
|
label: "OpenCode",
|
|
493
604
|
configLabel: "OpenCode MCP config",
|
|
494
605
|
configPath: resolveOpenCodeConfigPath(flags),
|
|
495
606
|
transport: flags.opencodeTransport,
|
|
496
|
-
endpoint: flags.opencodeMcpUrl,
|
|
497
|
-
|
|
498
|
-
|
|
607
|
+
endpoint: flags.opencodeMcpUrl ?? onboardTarget.mcpUrl,
|
|
608
|
+
mcpName: onboardTarget.mcpName,
|
|
609
|
+
setupAction,
|
|
610
|
+
forceAction: `${setupAction} --force`,
|
|
499
611
|
verifyCommand: "opencode mcp list",
|
|
500
|
-
invalidAction:
|
|
501
|
-
configObjectName:
|
|
612
|
+
invalidAction: `fix OpenCode JSON/JSONC, then rerun ${setupAction}`,
|
|
613
|
+
configObjectName: `mcp.${onboardTarget.mcpName}`,
|
|
502
614
|
defaultSchema: "https://opencode.ai/config.json",
|
|
503
615
|
};
|
|
504
616
|
}
|
|
505
617
|
|
|
506
|
-
function miMoTarget(flags: OnboardFlags): AgentMcpConfigTarget {
|
|
618
|
+
function miMoTarget(flags: OnboardFlags, onboardTarget: OnboardTarget): AgentMcpConfigTarget {
|
|
619
|
+
const setupAction = `agent-inspector onboard --mimo-only${onboardSelectionArguments(flags, onboardTarget)}`;
|
|
507
620
|
return {
|
|
508
621
|
label: "MiMo Code",
|
|
509
622
|
configLabel: "MiMo Code MCP config",
|
|
510
623
|
configPath: resolveMiMoConfigPath(flags),
|
|
511
624
|
transport: flags.mimoTransport,
|
|
512
|
-
endpoint: flags.mimoMcpUrl,
|
|
513
|
-
|
|
514
|
-
|
|
625
|
+
endpoint: flags.mimoMcpUrl ?? onboardTarget.mcpUrl,
|
|
626
|
+
mcpName: onboardTarget.mcpName,
|
|
627
|
+
setupAction,
|
|
628
|
+
forceAction: `${setupAction} --force`,
|
|
515
629
|
verifyCommand: "mimo mcp list",
|
|
516
|
-
invalidAction:
|
|
517
|
-
configObjectName:
|
|
630
|
+
invalidAction: `fix MiMo Code JSON/JSONC, then rerun ${setupAction}`,
|
|
631
|
+
configObjectName: `mcp.${onboardTarget.mcpName}`,
|
|
518
632
|
defaultSchema: "https://mimo.xiaomi.com/mimocode/config.json",
|
|
519
633
|
};
|
|
520
634
|
}
|
|
@@ -731,6 +845,7 @@ function makeAgentStatus(
|
|
|
731
845
|
state,
|
|
732
846
|
transport,
|
|
733
847
|
endpoint: target.endpoint,
|
|
848
|
+
mcpName: target.mcpName,
|
|
734
849
|
action: target.setupAction,
|
|
735
850
|
forceAction: target.forceAction,
|
|
736
851
|
verifyCommand: target.verifyCommand,
|
|
@@ -743,12 +858,12 @@ function makeAgentStatus(
|
|
|
743
858
|
};
|
|
744
859
|
}
|
|
745
860
|
|
|
746
|
-
function getAgentEntry(config: Record<string, unknown
|
|
861
|
+
function getAgentEntry(config: Record<string, unknown>, mcpName: string): unknown {
|
|
747
862
|
const mcp = config["mcp"];
|
|
748
863
|
if (!isObject(mcp)) {
|
|
749
864
|
return undefined;
|
|
750
865
|
}
|
|
751
|
-
return mcp[
|
|
866
|
+
return mcp[mcpName];
|
|
752
867
|
}
|
|
753
868
|
|
|
754
869
|
function buildAgentConfig(
|
|
@@ -768,7 +883,7 @@ function buildAgentConfig(
|
|
|
768
883
|
|
|
769
884
|
const currentMcp = config["mcp"];
|
|
770
885
|
const nextMcp: Record<string, unknown> = isObject(currentMcp) ? { ...currentMcp } : {};
|
|
771
|
-
nextMcp[
|
|
886
|
+
nextMcp[target.mcpName] = buildAgentMcpEntry(target.transport, target.endpoint);
|
|
772
887
|
nextConfig["mcp"] = nextMcp;
|
|
773
888
|
return nextConfig;
|
|
774
889
|
}
|
|
@@ -777,7 +892,10 @@ function formatAgentConfig(config: Record<string, unknown>): string {
|
|
|
777
892
|
return `${JSON.stringify(config, null, 2)}\n`;
|
|
778
893
|
}
|
|
779
894
|
|
|
780
|
-
function removeAgentEntry(
|
|
895
|
+
function removeAgentEntry(
|
|
896
|
+
config: Record<string, unknown>,
|
|
897
|
+
mcpName: string,
|
|
898
|
+
): Record<string, unknown> {
|
|
781
899
|
const nextConfig: Record<string, unknown> = {};
|
|
782
900
|
for (const [key, value] of Object.entries(config)) {
|
|
783
901
|
if (key !== "mcp") {
|
|
@@ -792,7 +910,7 @@ function removeAgentEntry(config: Record<string, unknown>): Record<string, unkno
|
|
|
792
910
|
|
|
793
911
|
const nextMcp: Record<string, unknown> = {};
|
|
794
912
|
for (const [key, value] of Object.entries(currentMcp)) {
|
|
795
|
-
if (key !==
|
|
913
|
+
if (key !== mcpName) {
|
|
796
914
|
nextMcp[key] = value;
|
|
797
915
|
}
|
|
798
916
|
}
|
|
@@ -809,7 +927,7 @@ function readAgentStatus(target: AgentMcpConfigTarget): AgentMcpConfigStatus {
|
|
|
809
927
|
return makeAgentStatus(target, "invalid", "unknown", read.message);
|
|
810
928
|
}
|
|
811
929
|
|
|
812
|
-
const entry = getAgentEntry(read.config);
|
|
930
|
+
const entry = getAgentEntry(read.config, target.mcpName);
|
|
813
931
|
if (entry === undefined) {
|
|
814
932
|
const detail = read.exists
|
|
815
933
|
? `${target.label} config has no ${target.configObjectName}`
|
|
@@ -861,12 +979,14 @@ function buildAgentPlan(
|
|
|
861
979
|
}
|
|
862
980
|
|
|
863
981
|
const status = readAgentStatus(target);
|
|
864
|
-
const entry = getAgentEntry(read.config);
|
|
982
|
+
const entry = getAgentEntry(read.config, target.mcpName);
|
|
865
983
|
const nextBody = formatAgentConfig(buildAgentConfig(read.config, target));
|
|
866
984
|
|
|
867
985
|
if (uninstall) {
|
|
868
986
|
const shouldRemove = entry !== undefined && isKnownAgentEntry(entry, target.endpoint, true);
|
|
869
|
-
const removeBody = shouldRemove
|
|
987
|
+
const removeBody = shouldRemove
|
|
988
|
+
? formatAgentConfig(removeAgentEntry(read.config, target.mcpName))
|
|
989
|
+
: null;
|
|
870
990
|
return {
|
|
871
991
|
status,
|
|
872
992
|
body: removeBody,
|
|
@@ -1129,14 +1249,24 @@ function buildPlannedFiles(
|
|
|
1129
1249
|
flags: OnboardFlags,
|
|
1130
1250
|
targets: OnboardTargets,
|
|
1131
1251
|
version: string,
|
|
1252
|
+
onboardTarget: OnboardTarget,
|
|
1132
1253
|
): PlannedFile[] {
|
|
1133
1254
|
const installClaude = !flags.codexOnly && !hasOnlyAgentMcpTarget(flags);
|
|
1134
1255
|
const installCodex = !flags.skipCodexSkill && !hasOnlyAgentMcpTarget(flags);
|
|
1135
1256
|
const detectedSummary = installClaude ? buildDetectedSummary() : "";
|
|
1257
|
+
const targetArguments = onboardSelectionArguments(flags, onboardTarget);
|
|
1136
1258
|
const claudeSkillBody = installClaude
|
|
1137
1259
|
? renderSkillOnboard({
|
|
1138
1260
|
version,
|
|
1139
|
-
port:
|
|
1261
|
+
port: onboardTarget.port,
|
|
1262
|
+
baseUrl: onboardTarget.baseUrl,
|
|
1263
|
+
controlBaseUrl: onboardTarget.controlBaseUrl,
|
|
1264
|
+
agentBaseUrl: onboardTarget.agentBaseUrl,
|
|
1265
|
+
uiUrl: onboardTarget.uiUrl,
|
|
1266
|
+
mcpName: onboardTarget.mcpName,
|
|
1267
|
+
targetKind: onboardTarget.kind,
|
|
1268
|
+
instanceName: onboardTarget.instanceName,
|
|
1269
|
+
onboardTargetArguments: targetArguments,
|
|
1140
1270
|
detectedSummary,
|
|
1141
1271
|
})
|
|
1142
1272
|
: "";
|
|
@@ -1144,7 +1274,15 @@ function buildPlannedFiles(
|
|
|
1144
1274
|
const codexSkillBody = installCodex
|
|
1145
1275
|
? renderCodexSkillOnboard({
|
|
1146
1276
|
version,
|
|
1147
|
-
port:
|
|
1277
|
+
port: onboardTarget.port,
|
|
1278
|
+
baseUrl: onboardTarget.baseUrl,
|
|
1279
|
+
controlBaseUrl: onboardTarget.controlBaseUrl,
|
|
1280
|
+
agentBaseUrl: onboardTarget.agentBaseUrl,
|
|
1281
|
+
uiUrl: onboardTarget.uiUrl,
|
|
1282
|
+
mcpName: onboardTarget.mcpName,
|
|
1283
|
+
targetKind: onboardTarget.kind,
|
|
1284
|
+
instanceName: onboardTarget.instanceName,
|
|
1285
|
+
onboardTargetArguments: targetArguments,
|
|
1148
1286
|
})
|
|
1149
1287
|
: "";
|
|
1150
1288
|
|
|
@@ -1348,6 +1486,7 @@ function runStatus(
|
|
|
1348
1486
|
process.stdout.write(`${agentStatus.label}: ${agentStatus.state}`);
|
|
1349
1487
|
process.stdout.write(`, transport ${agentStatus.transport}\n`);
|
|
1350
1488
|
process.stdout.write(` ${agentStatus.path}\n`);
|
|
1489
|
+
process.stdout.write(` MCP key: ${agentStatus.mcpName}\n`);
|
|
1351
1490
|
process.stdout.write(` Endpoint: ${agentStatus.endpoint}\n`);
|
|
1352
1491
|
process.stdout.write(` Detail: ${agentStatus.detail}\n`);
|
|
1353
1492
|
process.stdout.write(` Action: ${agentStatus.action}\n`);
|
|
@@ -1371,16 +1510,31 @@ export function runOnboard(argv: readonly string[]): Promise<number> {
|
|
|
1371
1510
|
|
|
1372
1511
|
function runOnboardSync(argv: readonly string[]): number {
|
|
1373
1512
|
const flags = parseFlags(argv);
|
|
1513
|
+
const resolvedTarget = resolveOnboardTarget({
|
|
1514
|
+
instanceName: flags.instanceName,
|
|
1515
|
+
baseUrl: flags.baseUrl,
|
|
1516
|
+
controlBaseUrl: flags.controlBaseUrl,
|
|
1517
|
+
agentBaseUrl: flags.agentBaseUrl,
|
|
1518
|
+
uiUrl: flags.uiUrl,
|
|
1519
|
+
mcpName: flags.mcpName,
|
|
1520
|
+
});
|
|
1521
|
+
if (!resolvedTarget.ok) {
|
|
1522
|
+
process.stderr.write(`agent-inspector onboard: ${resolvedTarget.message}\n`);
|
|
1523
|
+
return 2;
|
|
1524
|
+
}
|
|
1525
|
+
const onboardTarget = resolvedTarget.target;
|
|
1374
1526
|
const targets = resolveTargets(flags);
|
|
1375
1527
|
const version = readPackageVersion();
|
|
1376
|
-
const plannedFiles = buildPlannedFiles(flags, targets, version);
|
|
1528
|
+
const plannedFiles = buildPlannedFiles(flags, targets, version, onboardTarget);
|
|
1377
1529
|
const enabledFiles = plannedFiles.filter((file) => file.enabled);
|
|
1378
1530
|
const agentPlans: AgentMcpConfigPlan[] = [];
|
|
1379
1531
|
if (isOpenCodeEnabled(flags)) {
|
|
1380
|
-
agentPlans.push(
|
|
1532
|
+
agentPlans.push(
|
|
1533
|
+
buildAgentPlan(openCodeTarget(flags, onboardTarget), flags.uninstall, flags.force),
|
|
1534
|
+
);
|
|
1381
1535
|
}
|
|
1382
1536
|
if (isMiMoEnabled(flags)) {
|
|
1383
|
-
agentPlans.push(buildAgentPlan(miMoTarget(flags), flags.uninstall, flags.force));
|
|
1537
|
+
agentPlans.push(buildAgentPlan(miMoTarget(flags, onboardTarget), flags.uninstall, flags.force));
|
|
1384
1538
|
}
|
|
1385
1539
|
const agentStatuses = agentPlans.map((plan) => plan.status);
|
|
1386
1540
|
|
|
@@ -1411,6 +1565,7 @@ function runOnboardSync(argv: readonly string[]): number {
|
|
|
1411
1565
|
for (const plan of agentPlans) {
|
|
1412
1566
|
process.stdout.write(`${plan.status.label}: ${plan.status.path} (${plan.status.state})\n`);
|
|
1413
1567
|
process.stdout.write(` Transport: ${plan.status.transport}\n`);
|
|
1568
|
+
process.stdout.write(` MCP key: ${plan.status.mcpName}\n`);
|
|
1414
1569
|
process.stdout.write(` Endpoint: ${plan.status.endpoint}\n`);
|
|
1415
1570
|
process.stdout.write(` Action: ${plan.status.action}\n`);
|
|
1416
1571
|
if (plan.blockedMessage !== null) {
|