@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
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
openapi: 3.1.0
|
|
2
|
+
info:
|
|
3
|
+
title: Agent Inspector Named Instance Control API
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
description: |
|
|
6
|
+
Local control-plane API for discovering and managing Windows named Agent Inspector instances.
|
|
7
|
+
Paths are relative to the selected backend control Base URL. Loopback clients are trusted by the
|
|
8
|
+
native ingress; direct non-loopback clients must send the configured control Bearer token.
|
|
9
|
+
Browser mutations also require same-origin CSRF proof. A reverse proxy whose upstream appears
|
|
10
|
+
as loopback must authenticate its own remote clients.
|
|
11
|
+
servers:
|
|
12
|
+
- url: http://127.0.0.1:9527
|
|
13
|
+
description: Root-mounted controller example
|
|
14
|
+
- url: http://127.0.0.1:9530/inspector
|
|
15
|
+
description: Prefixed named-instance controller example
|
|
16
|
+
tags:
|
|
17
|
+
- name: Instances
|
|
18
|
+
paths:
|
|
19
|
+
/api/instances:
|
|
20
|
+
get:
|
|
21
|
+
tags: [Instances]
|
|
22
|
+
operationId: listNamedInstances
|
|
23
|
+
summary: List registered named instances and derived live state
|
|
24
|
+
responses:
|
|
25
|
+
"200":
|
|
26
|
+
description: Versioned instance list
|
|
27
|
+
content:
|
|
28
|
+
application/json:
|
|
29
|
+
schema:
|
|
30
|
+
$ref: "#/components/schemas/InstanceList"
|
|
31
|
+
default:
|
|
32
|
+
$ref: "#/components/responses/InstanceError"
|
|
33
|
+
/api/instances/{name}:
|
|
34
|
+
parameters:
|
|
35
|
+
- $ref: "#/components/parameters/InstanceName"
|
|
36
|
+
get:
|
|
37
|
+
tags: [Instances]
|
|
38
|
+
operationId: getNamedInstance
|
|
39
|
+
summary: Read one named instance and its live state
|
|
40
|
+
responses:
|
|
41
|
+
"200":
|
|
42
|
+
description: Instance view
|
|
43
|
+
content:
|
|
44
|
+
application/json:
|
|
45
|
+
schema:
|
|
46
|
+
$ref: "#/components/schemas/InstanceView"
|
|
47
|
+
default:
|
|
48
|
+
$ref: "#/components/responses/InstanceError"
|
|
49
|
+
/api/instances/{name}/connection:
|
|
50
|
+
parameters:
|
|
51
|
+
- $ref: "#/components/parameters/InstanceName"
|
|
52
|
+
get:
|
|
53
|
+
tags: [Instances]
|
|
54
|
+
operationId: getNamedInstanceConnection
|
|
55
|
+
summary: Read protocol-correct Coding Agent connection settings
|
|
56
|
+
responses:
|
|
57
|
+
"200":
|
|
58
|
+
description: Token-free connection descriptor
|
|
59
|
+
content:
|
|
60
|
+
application/json:
|
|
61
|
+
schema:
|
|
62
|
+
$ref: "#/components/schemas/InstanceConnection"
|
|
63
|
+
default:
|
|
64
|
+
$ref: "#/components/responses/InstanceError"
|
|
65
|
+
/api/instances/{name}/start:
|
|
66
|
+
parameters:
|
|
67
|
+
- $ref: "#/components/parameters/InstanceName"
|
|
68
|
+
post:
|
|
69
|
+
tags: [Instances]
|
|
70
|
+
operationId: startNamedInstance
|
|
71
|
+
summary: Idempotently create, start, or reuse a named instance
|
|
72
|
+
requestBody:
|
|
73
|
+
required: false
|
|
74
|
+
content:
|
|
75
|
+
application/json:
|
|
76
|
+
schema:
|
|
77
|
+
$ref: "#/components/schemas/InstanceStartRequest"
|
|
78
|
+
responses:
|
|
79
|
+
"200":
|
|
80
|
+
description: Existing instance started or reused
|
|
81
|
+
content:
|
|
82
|
+
application/json:
|
|
83
|
+
schema:
|
|
84
|
+
$ref: "#/components/schemas/InstanceOperation"
|
|
85
|
+
"201":
|
|
86
|
+
description: New instance record created and started
|
|
87
|
+
content:
|
|
88
|
+
application/json:
|
|
89
|
+
schema:
|
|
90
|
+
$ref: "#/components/schemas/InstanceOperation"
|
|
91
|
+
default:
|
|
92
|
+
$ref: "#/components/responses/InstanceError"
|
|
93
|
+
/api/instances/{name}/stop:
|
|
94
|
+
parameters:
|
|
95
|
+
- $ref: "#/components/parameters/InstanceName"
|
|
96
|
+
post:
|
|
97
|
+
tags: [Instances]
|
|
98
|
+
operationId: stopNamedInstance
|
|
99
|
+
summary: Gracefully stop a matching sibling instance
|
|
100
|
+
requestBody:
|
|
101
|
+
required: false
|
|
102
|
+
content:
|
|
103
|
+
application/json:
|
|
104
|
+
schema:
|
|
105
|
+
type: object
|
|
106
|
+
additionalProperties: false
|
|
107
|
+
responses:
|
|
108
|
+
"200":
|
|
109
|
+
description: Instance stopped or already stopped
|
|
110
|
+
content:
|
|
111
|
+
application/json:
|
|
112
|
+
schema:
|
|
113
|
+
$ref: "#/components/schemas/InstanceOperation"
|
|
114
|
+
default:
|
|
115
|
+
$ref: "#/components/responses/InstanceError"
|
|
116
|
+
/api/instances/{name}/restart:
|
|
117
|
+
parameters:
|
|
118
|
+
- $ref: "#/components/parameters/InstanceName"
|
|
119
|
+
post:
|
|
120
|
+
tags: [Instances]
|
|
121
|
+
operationId: restartNamedInstance
|
|
122
|
+
summary: Validate configuration, gracefully stop, and relaunch a sibling instance
|
|
123
|
+
requestBody:
|
|
124
|
+
required: false
|
|
125
|
+
content:
|
|
126
|
+
application/json:
|
|
127
|
+
schema:
|
|
128
|
+
$ref: "#/components/schemas/InstanceStartRequest"
|
|
129
|
+
responses:
|
|
130
|
+
"200":
|
|
131
|
+
description: Replacement launch reached readiness
|
|
132
|
+
content:
|
|
133
|
+
application/json:
|
|
134
|
+
schema:
|
|
135
|
+
$ref: "#/components/schemas/InstanceOperation"
|
|
136
|
+
default:
|
|
137
|
+
$ref: "#/components/responses/InstanceError"
|
|
138
|
+
components:
|
|
139
|
+
securitySchemes:
|
|
140
|
+
controlBearer:
|
|
141
|
+
type: http
|
|
142
|
+
scheme: bearer
|
|
143
|
+
description: Value of AGENT_INSPECTOR_CONTROL_TOKEN for direct non-loopback access.
|
|
144
|
+
parameters:
|
|
145
|
+
InstanceName:
|
|
146
|
+
name: name
|
|
147
|
+
in: path
|
|
148
|
+
required: true
|
|
149
|
+
schema:
|
|
150
|
+
type: string
|
|
151
|
+
pattern: "^[a-z0-9._-]{1,64}$"
|
|
152
|
+
example: review
|
|
153
|
+
responses:
|
|
154
|
+
InstanceError:
|
|
155
|
+
description: Versioned machine-readable lifecycle error
|
|
156
|
+
content:
|
|
157
|
+
application/json:
|
|
158
|
+
schema:
|
|
159
|
+
$ref: "#/components/schemas/InstanceError"
|
|
160
|
+
schemas:
|
|
161
|
+
InstanceUrls:
|
|
162
|
+
type: object
|
|
163
|
+
additionalProperties: false
|
|
164
|
+
required: [ui, api, health, proxy, openai, mcp]
|
|
165
|
+
properties:
|
|
166
|
+
ui: { type: string, format: uri, example: "http://127.0.0.1:9530/inspector" }
|
|
167
|
+
api: { type: string, format: uri, example: "http://127.0.0.1:9530/inspector/api" }
|
|
168
|
+
health:
|
|
169
|
+
{ type: string, format: uri, example: "http://127.0.0.1:9530/inspector/api/health" }
|
|
170
|
+
proxy:
|
|
171
|
+
{ type: string, format: uri, example: "http://127.0.0.1:9530/inspector/proxy" }
|
|
172
|
+
openai:
|
|
173
|
+
{ type: string, format: uri, example: "http://127.0.0.1:9530/inspector/proxy/v1" }
|
|
174
|
+
mcp:
|
|
175
|
+
{ type: string, format: uri, example: "http://127.0.0.1:9530/inspector/api/mcp" }
|
|
176
|
+
InstanceView:
|
|
177
|
+
type: object
|
|
178
|
+
additionalProperties: false
|
|
179
|
+
required:
|
|
180
|
+
- schemaVersion
|
|
181
|
+
- name
|
|
182
|
+
- instanceId
|
|
183
|
+
- state
|
|
184
|
+
- stateReason
|
|
185
|
+
- checkedAt
|
|
186
|
+
- createdAt
|
|
187
|
+
- updatedAt
|
|
188
|
+
- launch
|
|
189
|
+
- host
|
|
190
|
+
- publicPort
|
|
191
|
+
- upstreamPort
|
|
192
|
+
- basePath
|
|
193
|
+
- captureMode
|
|
194
|
+
- uiEnabled
|
|
195
|
+
- dataDir
|
|
196
|
+
- supervisorPid
|
|
197
|
+
- urls
|
|
198
|
+
properties:
|
|
199
|
+
schemaVersion: { const: 1 }
|
|
200
|
+
name: { type: string, example: review }
|
|
201
|
+
instanceId: { type: string, example: "d8805ce7-5ec7-41fb-a370-c56b57418839" }
|
|
202
|
+
state: { type: string, enum: [running, stopped, conflict] }
|
|
203
|
+
stateReason:
|
|
204
|
+
oneOf:
|
|
205
|
+
- { type: string, enum: [identity_mismatch, port_conflict] }
|
|
206
|
+
- { type: "null" }
|
|
207
|
+
checkedAt: { type: string, format: date-time }
|
|
208
|
+
createdAt: { type: string, format: date-time }
|
|
209
|
+
updatedAt: { type: string, format: date-time }
|
|
210
|
+
launch:
|
|
211
|
+
type: object
|
|
212
|
+
additionalProperties: false
|
|
213
|
+
required: [launchId, startedAt]
|
|
214
|
+
properties:
|
|
215
|
+
launchId: { type: string }
|
|
216
|
+
startedAt: { type: string, format: date-time }
|
|
217
|
+
host: { type: string, example: "127.0.0.1" }
|
|
218
|
+
publicPort: { type: integer, minimum: 1, maximum: 65535, example: 9530 }
|
|
219
|
+
upstreamPort: { type: integer, minimum: 1, maximum: 65535, example: 9532 }
|
|
220
|
+
basePath: { type: string, example: /inspector }
|
|
221
|
+
captureMode: { type: string, enum: [simple, full] }
|
|
222
|
+
uiEnabled:
|
|
223
|
+
type: boolean
|
|
224
|
+
description: Whether this instance serves the composed Web UI. Backend endpoints remain available when false.
|
|
225
|
+
dataDir: { type: string, example: "C:\\Users\\me\\AppData\\Local\\agent-inspector\\instances\\review\\data" }
|
|
226
|
+
supervisorPid:
|
|
227
|
+
oneOf:
|
|
228
|
+
- { type: integer, minimum: 1 }
|
|
229
|
+
- { type: "null" }
|
|
230
|
+
urls:
|
|
231
|
+
$ref: "#/components/schemas/InstanceUrls"
|
|
232
|
+
InstanceList:
|
|
233
|
+
type: object
|
|
234
|
+
additionalProperties: false
|
|
235
|
+
required: [schemaVersion, instances]
|
|
236
|
+
properties:
|
|
237
|
+
schemaVersion: { const: 1 }
|
|
238
|
+
instances:
|
|
239
|
+
type: array
|
|
240
|
+
items:
|
|
241
|
+
$ref: "#/components/schemas/InstanceView"
|
|
242
|
+
InstanceStartRequest:
|
|
243
|
+
type: object
|
|
244
|
+
additionalProperties: false
|
|
245
|
+
properties:
|
|
246
|
+
port: { type: integer, minimum: 1, maximum: 65535 }
|
|
247
|
+
basePath: { type: string, example: /inspector }
|
|
248
|
+
host: { type: string, example: "127.0.0.1" }
|
|
249
|
+
captureMode: { type: string, enum: [simple, full] }
|
|
250
|
+
uiEnabled:
|
|
251
|
+
type: boolean
|
|
252
|
+
description: Persist composed UI serving when true or backend-only mode when false.
|
|
253
|
+
dataDir: { type: string }
|
|
254
|
+
InstanceOperation:
|
|
255
|
+
type: object
|
|
256
|
+
additionalProperties: false
|
|
257
|
+
required: [schemaVersion, operation, outcome, instance]
|
|
258
|
+
properties:
|
|
259
|
+
schemaVersion: { const: 1 }
|
|
260
|
+
operation: { type: string, enum: [start, stop, restart] }
|
|
261
|
+
outcome:
|
|
262
|
+
type: string
|
|
263
|
+
enum: [created, started, already_running, stopped, already_stopped, restarted]
|
|
264
|
+
instance:
|
|
265
|
+
$ref: "#/components/schemas/InstanceView"
|
|
266
|
+
InstanceConnectionSurfaces:
|
|
267
|
+
type: object
|
|
268
|
+
additionalProperties: false
|
|
269
|
+
required: [ui, control, agent]
|
|
270
|
+
properties:
|
|
271
|
+
ui:
|
|
272
|
+
type: object
|
|
273
|
+
additionalProperties: false
|
|
274
|
+
required: [enabled, baseUrl]
|
|
275
|
+
properties:
|
|
276
|
+
enabled:
|
|
277
|
+
type: boolean
|
|
278
|
+
description: Whether this instance serves its composed Web UI.
|
|
279
|
+
baseUrl:
|
|
280
|
+
description: Composed UI Base URL, or null for a backend-only instance.
|
|
281
|
+
oneOf:
|
|
282
|
+
- { type: string, format: uri }
|
|
283
|
+
- { type: "null" }
|
|
284
|
+
control:
|
|
285
|
+
type: object
|
|
286
|
+
additionalProperties: false
|
|
287
|
+
required: [baseUrl]
|
|
288
|
+
properties:
|
|
289
|
+
baseUrl:
|
|
290
|
+
type: string
|
|
291
|
+
format: uri
|
|
292
|
+
description: Base URL for REST, mutation, upload/download, and SSE traffic.
|
|
293
|
+
agent:
|
|
294
|
+
type: object
|
|
295
|
+
additionalProperties: false
|
|
296
|
+
required: [baseUrl]
|
|
297
|
+
properties:
|
|
298
|
+
baseUrl:
|
|
299
|
+
type: string
|
|
300
|
+
format: uri
|
|
301
|
+
description: Base URL from which proxy and MCP client endpoints are derived.
|
|
302
|
+
InstanceConnection:
|
|
303
|
+
type: object
|
|
304
|
+
additionalProperties: false
|
|
305
|
+
required: [schemaVersion, uiEnabled, instance, surfaces, baseUrl, endpoints, environment, mcp, codex]
|
|
306
|
+
properties:
|
|
307
|
+
schemaVersion: { const: 1 }
|
|
308
|
+
uiEnabled:
|
|
309
|
+
type: boolean
|
|
310
|
+
description: Whether the instance currently serves its composed Web UI; proxy, REST, health, and MCP remain valid when false.
|
|
311
|
+
instance: { $ref: "#/components/schemas/InstanceView" }
|
|
312
|
+
surfaces: { $ref: "#/components/schemas/InstanceConnectionSurfaces" }
|
|
313
|
+
baseUrl:
|
|
314
|
+
type: string
|
|
315
|
+
format: uri
|
|
316
|
+
deprecated: true
|
|
317
|
+
description: Legacy backend Base URL; use surfaces.control.baseUrl or surfaces.agent.baseUrl.
|
|
318
|
+
endpoints:
|
|
319
|
+
allOf:
|
|
320
|
+
- { $ref: "#/components/schemas/InstanceUrls" }
|
|
321
|
+
deprecated: true
|
|
322
|
+
description: Legacy derived endpoint set retained for compatibility; use surfaces for Base URLs.
|
|
323
|
+
environment:
|
|
324
|
+
type: object
|
|
325
|
+
additionalProperties: false
|
|
326
|
+
required: [ANTHROPIC_BASE_URL, LLM_BASE_URL, OPENAI_BASE_URL, AGENT_INSPECTOR_MCP_URL]
|
|
327
|
+
properties:
|
|
328
|
+
ANTHROPIC_BASE_URL: { type: string, format: uri }
|
|
329
|
+
LLM_BASE_URL: { type: string, format: uri }
|
|
330
|
+
OPENAI_BASE_URL: { type: string, format: uri }
|
|
331
|
+
AGENT_INSPECTOR_MCP_URL: { type: string, format: uri }
|
|
332
|
+
mcp:
|
|
333
|
+
type: object
|
|
334
|
+
additionalProperties: false
|
|
335
|
+
required: [serverName, transport, url]
|
|
336
|
+
properties:
|
|
337
|
+
serverName: { type: string, example: agent-inspector-review }
|
|
338
|
+
transport: { const: streamable-http }
|
|
339
|
+
url: { type: string, format: uri }
|
|
340
|
+
codex:
|
|
341
|
+
type: object
|
|
342
|
+
additionalProperties: false
|
|
343
|
+
required: [providerName, baseUrl, wireApi]
|
|
344
|
+
properties:
|
|
345
|
+
providerName: { type: string, example: agent-inspector-review }
|
|
346
|
+
baseUrl: { type: string, format: uri }
|
|
347
|
+
wireApi: { const: responses }
|
|
348
|
+
InstanceError:
|
|
349
|
+
type: object
|
|
350
|
+
additionalProperties: false
|
|
351
|
+
required: [schemaVersion, error]
|
|
352
|
+
properties:
|
|
353
|
+
schemaVersion: { const: 1 }
|
|
354
|
+
error:
|
|
355
|
+
type: object
|
|
356
|
+
additionalProperties: false
|
|
357
|
+
required: [code, message, retryable]
|
|
358
|
+
properties:
|
|
359
|
+
code: { type: string }
|
|
360
|
+
message: { type: string }
|
|
361
|
+
retryable: { type: boolean }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tonyclaw/agent-inspector",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.46",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Agent observability and knowledge capture layer for AI coding tools.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,28 +44,48 @@
|
|
|
44
44
|
"!src/**/*.test.ts",
|
|
45
45
|
"!src/**/*.stories.tsx",
|
|
46
46
|
"!src/**/__fixtures__",
|
|
47
|
-
"!src/routeTree.gen.ts",
|
|
47
|
+
"!src/ui/routeTree.gen.ts",
|
|
48
|
+
"!src/backend/routeTree.gen.ts",
|
|
48
49
|
"scripts/setup-windows-runtime.mjs",
|
|
49
50
|
"scripts/setup-agent-skills.mjs",
|
|
50
51
|
"scripts/generate-theme-scales.mjs",
|
|
52
|
+
"docs/instance-control.openapi.yaml",
|
|
51
53
|
"styles",
|
|
52
54
|
".output",
|
|
53
55
|
"!.output/*.exe"
|
|
54
56
|
],
|
|
55
57
|
"scripts": {
|
|
56
|
-
"dev": "
|
|
58
|
+
"dev": "node scripts/dev-decoupled.mjs",
|
|
59
|
+
"dev:ui": "vite dev --config vite.ui.config.ts",
|
|
60
|
+
"dev:backend": "node scripts/dev-backend.mjs",
|
|
57
61
|
"test:smoke": "bun scripts/run-test-suite.mjs smoke",
|
|
58
62
|
"test:fast": "bun scripts/run-test-suite.mjs smoke",
|
|
59
63
|
"test:unit": "bun scripts/run-test-suite.mjs unit",
|
|
60
64
|
"test:integration": "bun scripts/run-test-suite.mjs integration",
|
|
61
65
|
"test:changed": "bun scripts/run-test-suite.mjs changed",
|
|
62
66
|
"test:all": "bun scripts/run-test-suite.mjs all",
|
|
67
|
+
"test:compatibility-tooling": "node --test scripts/compatibility/*.test.mjs",
|
|
63
68
|
"start": "node .output/cli.js",
|
|
64
|
-
"
|
|
69
|
+
"start:backend": "node .output/cli.js --backend-only --no-open",
|
|
70
|
+
"preview:ui": "vite preview --config vite.ui.config.ts",
|
|
71
|
+
"clean:output": "node scripts/clean-output.mjs",
|
|
72
|
+
"build": "bun clean:output && bun build:backend && bun build:ui && bun smoke:ui-preview && bun build:workers && bun build:cli && bun build:mcp && bun check:bundle && bun check:boundaries",
|
|
73
|
+
"build:backend": "vite build --config vite.backend.config.ts",
|
|
74
|
+
"build:ui": "vite build --config vite.ui.config.ts",
|
|
65
75
|
"build:workers": "npx esbuild src/proxy/logFinalizer.worker.ts src/proxy/sessionWorkerEntry.ts --bundle --platform=node --target=node22 --format=esm --outdir=.output/workers --external:better-sqlite3",
|
|
66
76
|
"smoke:workers": "node scripts/smoke-production-workers.mjs",
|
|
67
77
|
"smoke:packed-workers": "node scripts/smoke-packed-workers.mjs",
|
|
78
|
+
"smoke:instances": "node scripts/smoke-windows-instances.mjs",
|
|
79
|
+
"smoke:coding-agent-instances": "node scripts/smoke-coding-agent-instances.mjs",
|
|
80
|
+
"smoke:ui-preview": "node scripts/smoke-decoupled-ui-preview.mjs",
|
|
68
81
|
"check:bundle": "node scripts/check-client-bundle.mjs",
|
|
82
|
+
"check:boundaries": "node scripts/check-runtime-boundaries.mjs",
|
|
83
|
+
"compatibility:bdd": "node scripts/lint-bdd-catalog.mjs",
|
|
84
|
+
"compatibility:compare": "node scripts/compatibility/cli.mjs compare",
|
|
85
|
+
"compatibility:drift": "node scripts/check-backend-compatibility.mjs",
|
|
86
|
+
"compatibility:fixtures": "bun scripts/validate-compatibility-fixtures.ts",
|
|
87
|
+
"compatibility:freeze": "node scripts/freeze-backend-baseline.mjs",
|
|
88
|
+
"compatibility:run": "node scripts/compatibility/cli.mjs run",
|
|
69
89
|
"build:cli": "npx esbuild src/cli.ts --bundle --platform=node --target=node22 --format=esm --outfile=.output/cli.js",
|
|
70
90
|
"build:mcp": "npx esbuild packages/agent-inspector-mcp/src/cli.ts --bundle --platform=node --target=node22 --format=esm --outfile=packages/agent-inspector-mcp/dist/cli.js",
|
|
71
91
|
"themes:generate": "node scripts/generate-theme-scales.mjs",
|
|
@@ -80,7 +100,7 @@
|
|
|
80
100
|
"extension:release": "node scripts/release-chrome-extension.mjs",
|
|
81
101
|
"release": "node scripts/release.mjs",
|
|
82
102
|
"knip": "knip",
|
|
83
|
-
"check": "bun scripts/run-static-checks.mjs --format",
|
|
103
|
+
"check": "bun scripts/run-static-checks.mjs --format && bun check:boundaries && bun compatibility:bdd",
|
|
84
104
|
"prepare": "husky",
|
|
85
105
|
"ladle": "ladle serve",
|
|
86
106
|
"ladle:build": "ladle build"
|
|
@@ -119,6 +139,7 @@
|
|
|
119
139
|
"@ladle/react": "^5.1.1",
|
|
120
140
|
"@radix-ui/colors": "^3.0.0",
|
|
121
141
|
"@tailwindcss/vite": "^4.3.2",
|
|
142
|
+
"@tanstack/router-plugin": "^1.168.20",
|
|
122
143
|
"@types/bun": "^1.3.14",
|
|
123
144
|
"@types/react": "^19.2.17",
|
|
124
145
|
"@types/react-dom": "^19.2.3",
|
|
@@ -126,6 +147,8 @@
|
|
|
126
147
|
"@typescript-eslint/eslint-plugin": "^8.64.0",
|
|
127
148
|
"@typescript-eslint/parser": "^8.64.0",
|
|
128
149
|
"@vitejs/plugin-react": "^5.2.0",
|
|
150
|
+
"ajv": "8.20.0",
|
|
151
|
+
"ajv-formats": "3.0.1",
|
|
129
152
|
"colorjs.io": "^0.7.0",
|
|
130
153
|
"esbuild": "^0.28.1",
|
|
131
154
|
"eslint": "^9.39.5",
|
|
@@ -3,9 +3,9 @@ import { URL } from "node:url";
|
|
|
3
3
|
import { olive, sand, slateDark } from "@radix-ui/colors";
|
|
4
4
|
|
|
5
5
|
const themes = [
|
|
6
|
-
{ selector:
|
|
7
|
-
{ selector:
|
|
8
|
-
{ selector:
|
|
6
|
+
{ selector: ':root,\n:root[data-theme="light"]', scale: sand, source: "sand" },
|
|
7
|
+
{ selector: ':root[data-theme="dark"]', scale: slateDark, source: "slateDark" },
|
|
8
|
+
{ selector: ':root[data-theme="eye-care"]', scale: olive, source: "olive" },
|
|
9
9
|
];
|
|
10
10
|
|
|
11
11
|
function renderTheme({ selector, scale, source }) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRouter } from "@tanstack/react-router";
|
|
2
|
-
import { getRouterBasePath } from "
|
|
2
|
+
import { getRouterBasePath } from "../lib/basePath";
|
|
3
3
|
import { routeTree } from "./routeTree.gen";
|
|
4
4
|
|
|
5
5
|
function defaultRouterBasePath(): string {
|
|
@@ -19,14 +19,8 @@ export function getRouter(basepath = defaultRouterBasePath()) {
|
|
|
19
19
|
function attachServerSsrStoreCompatibility(
|
|
20
20
|
router: Readonly<{ state: Readonly<{ matches: unknown }> }>,
|
|
21
21
|
): void {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
// Installing a `stores` value here would shadow that lazy init
|
|
25
|
-
// (`if (!this.stores && this.latestLocation) { this.stores = … }`) and break
|
|
26
|
-
// `router.state`. When `state` is already a prototype accessor the new store
|
|
27
|
-
// architecture handles SSR natively and this shim is obsolete.
|
|
28
|
-
const stateDesc = Object.getOwnPropertyDescriptor(router, "state");
|
|
29
|
-
if (stateDesc === undefined) return;
|
|
22
|
+
const stateDescriptor = Object.getOwnPropertyDescriptor(router, "state");
|
|
23
|
+
if (stateDescriptor === undefined) return;
|
|
30
24
|
|
|
31
25
|
const existingStores = Object.getOwnPropertyDescriptor(router, "stores");
|
|
32
26
|
if (existingStores !== undefined) return;
|
|
@@ -40,9 +34,3 @@ function attachServerSsrStoreCompatibility(
|
|
|
40
34
|
},
|
|
41
35
|
});
|
|
42
36
|
}
|
|
43
|
-
|
|
44
|
-
declare module "@tanstack/react-router" {
|
|
45
|
-
interface Register {
|
|
46
|
-
router: ReturnType<typeof getRouter>;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
|
|
3
|
+
const BACKEND_NOT_FOUND_BODY = {
|
|
4
|
+
error: "not_found",
|
|
5
|
+
message: "Agent Inspector backend does not serve the web UI.",
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export function backendNotFoundResponse(): Response {
|
|
9
|
+
return Response.json(BACKEND_NOT_FOUND_BODY, {
|
|
10
|
+
status: 404,
|
|
11
|
+
headers: { "cache-control": "no-store" },
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const Route = createFileRoute("/$")({
|
|
16
|
+
server: {
|
|
17
|
+
handlers: {
|
|
18
|
+
GET: backendNotFoundResponse,
|
|
19
|
+
POST: backendNotFoundResponse,
|
|
20
|
+
PUT: backendNotFoundResponse,
|
|
21
|
+
PATCH: backendNotFoundResponse,
|
|
22
|
+
DELETE: backendNotFoundResponse,
|
|
23
|
+
OPTIONS: backendNotFoundResponse,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
});
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { type z } from "zod";
|
|
2
|
+
import type { InstanceLifecycleError, InstanceLifecycleResult } from "../../../cli/instance";
|
|
3
|
+
import {
|
|
4
|
+
type InstancePublicErrorCode,
|
|
5
|
+
INSTANCE_API_SCHEMA_VERSION,
|
|
6
|
+
instanceErrorOutput,
|
|
7
|
+
} from "../../../lib/instanceContract";
|
|
8
|
+
import { readManagedInstanceLaunch } from "../../../lib/managedInstance";
|
|
9
|
+
|
|
10
|
+
const NO_STORE_HEADERS = { "cache-control": "no-store" };
|
|
11
|
+
|
|
12
|
+
type ParsedBody<T> = { ok: true; value: T } | { ok: false; response: Response };
|
|
13
|
+
|
|
14
|
+
function errorStatus(code: InstancePublicErrorCode): number {
|
|
15
|
+
switch (code) {
|
|
16
|
+
case "argument_invalid":
|
|
17
|
+
case "data_dir_invalid":
|
|
18
|
+
case "name_invalid":
|
|
19
|
+
case "port_invalid":
|
|
20
|
+
case "record_invalid":
|
|
21
|
+
return 400;
|
|
22
|
+
case "instance_not_found":
|
|
23
|
+
return 404;
|
|
24
|
+
case "config_mismatch":
|
|
25
|
+
case "data_dir_conflict":
|
|
26
|
+
case "identity_mismatch":
|
|
27
|
+
case "port_conflict":
|
|
28
|
+
case "self_lifecycle_unsupported":
|
|
29
|
+
return 409;
|
|
30
|
+
case "lock_not_owned":
|
|
31
|
+
case "lock_timeout":
|
|
32
|
+
return 423;
|
|
33
|
+
case "launch_failed":
|
|
34
|
+
case "launch_unavailable":
|
|
35
|
+
case "port_exhausted":
|
|
36
|
+
case "registry_io":
|
|
37
|
+
case "restart_failed_degraded":
|
|
38
|
+
case "restart_failed_rolled_back":
|
|
39
|
+
case "shutdown_failed":
|
|
40
|
+
return 503;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function instanceErrorResponse(error: InstanceLifecycleError): Response {
|
|
45
|
+
return Response.json(instanceErrorOutput(error), {
|
|
46
|
+
status: errorStatus(error.code),
|
|
47
|
+
headers: NO_STORE_HEADERS,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function instanceResultResponse<T>(
|
|
52
|
+
result: InstanceLifecycleResult<T>,
|
|
53
|
+
successStatus = 200,
|
|
54
|
+
): Response {
|
|
55
|
+
return result.kind === "error"
|
|
56
|
+
? instanceErrorResponse(result.error)
|
|
57
|
+
: Response.json(result.value, { status: successStatus, headers: NO_STORE_HEADERS });
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export async function parseInstanceBody<T extends z.ZodType>(
|
|
61
|
+
request: Request,
|
|
62
|
+
schema: T,
|
|
63
|
+
): Promise<ParsedBody<z.output<T>>> {
|
|
64
|
+
let value: unknown;
|
|
65
|
+
try {
|
|
66
|
+
const text = await request.text();
|
|
67
|
+
value = text.trim().length === 0 ? {} : JSON.parse(text);
|
|
68
|
+
} catch {
|
|
69
|
+
return {
|
|
70
|
+
ok: false,
|
|
71
|
+
response: instanceErrorResponse({
|
|
72
|
+
code: "argument_invalid",
|
|
73
|
+
message: "Request body must be valid JSON.",
|
|
74
|
+
retryable: false,
|
|
75
|
+
}),
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
const parsed = schema.safeParse(value);
|
|
79
|
+
if (!parsed.success) {
|
|
80
|
+
return {
|
|
81
|
+
ok: false,
|
|
82
|
+
response: instanceErrorResponse({
|
|
83
|
+
code: "argument_invalid",
|
|
84
|
+
message: `Invalid instance request: ${parsed.error.issues[0]?.message ?? "invalid body"}`,
|
|
85
|
+
retryable: false,
|
|
86
|
+
}),
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
return { ok: true, value: parsed.data };
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function selfLifecycleError(rawName: string): InstanceLifecycleError | null {
|
|
93
|
+
const current = readManagedInstanceLaunch(process.env);
|
|
94
|
+
return current.kind === "managed" && current.launch.name.toLowerCase() === rawName.toLowerCase()
|
|
95
|
+
? {
|
|
96
|
+
code: "self_lifecycle_unsupported",
|
|
97
|
+
message:
|
|
98
|
+
"A managed runtime cannot stop or restart itself through its own REST/MCP transport; use the CLI or a different controller instance.",
|
|
99
|
+
retryable: false,
|
|
100
|
+
}
|
|
101
|
+
: null;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function instanceListResponse(instances: readonly unknown[]): Response {
|
|
105
|
+
return Response.json(
|
|
106
|
+
{ schemaVersion: INSTANCE_API_SCHEMA_VERSION, instances },
|
|
107
|
+
{ headers: NO_STORE_HEADERS },
|
|
108
|
+
);
|
|
109
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
-
import { getInspectorAlertSummary } from "
|
|
3
|
-
import { DEFAULT_ALERT_SCAN_LIMIT, MAX_ALERT_SCAN_LIMIT } from "
|
|
4
|
-
import { parseBoundedIntegerParameter } from "
|
|
2
|
+
import { getInspectorAlertSummary } from "../../../services/alerts";
|
|
3
|
+
import { DEFAULT_ALERT_SCAN_LIMIT, MAX_ALERT_SCAN_LIMIT } from "../../../proxy/alerts";
|
|
4
|
+
import { parseBoundedIntegerParameter } from "../../../lib/resourceLimits";
|
|
5
5
|
|
|
6
6
|
export const Route = createFileRoute("/api/alerts/summary")({
|
|
7
7
|
server: {
|
|
@@ -6,15 +6,15 @@ import {
|
|
|
6
6
|
type AlertCategory,
|
|
7
7
|
type AlertSeverity,
|
|
8
8
|
type AlertSource,
|
|
9
|
-
} from "
|
|
10
|
-
import { listInspectorAlerts } from "
|
|
9
|
+
} from "../../../lib/alertContract";
|
|
10
|
+
import { listInspectorAlerts } from "../../../services/alerts";
|
|
11
11
|
import {
|
|
12
12
|
DEFAULT_ALERT_LIMIT,
|
|
13
13
|
DEFAULT_ALERT_SCAN_LIMIT,
|
|
14
14
|
MAX_ALERT_LIMIT,
|
|
15
15
|
MAX_ALERT_SCAN_LIMIT,
|
|
16
|
-
} from "
|
|
17
|
-
import { parseBoundedIntegerParameter } from "
|
|
16
|
+
} from "../../../proxy/alerts";
|
|
17
|
+
import { parseBoundedIntegerParameter } from "../../../lib/resourceLimits";
|
|
18
18
|
|
|
19
19
|
type ParsedFilters = {
|
|
20
20
|
severity?: AlertSeverity;
|