@tonyclaw/agent-inspector 4.0.1 → 4.0.2
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/backend/nitro.json +1 -1
- package/.output/cli.js +192 -109
- package/.output/server/_ssr/index.mjs +1 -1
- package/.output/server/_ssr/{router-CTHqmroT.mjs → router-BBY_zWRK.mjs} +91 -3
- package/.output/server/index.mjs +1 -1
- package/.output/ui/assets/{CompareDrawer-L3n4J-Or.js → CompareDrawer-rtNElN-B.js} +1 -1
- package/.output/ui/assets/{InspectorPet-D5o_3OZS.js → InspectorPet-QaAiuF3d.js} +1 -1
- package/.output/ui/assets/{ProxyViewerContainer-Ocagx75S.js → ProxyViewerContainer-6twNZHwl.js} +4 -4
- package/.output/ui/assets/{ReplayDialog-Bk7x1h-y.js → ReplayDialog-B7KlziO2.js} +1 -1
- package/.output/ui/assets/{RequestAnatomy-U4lzL7Sc.js → RequestAnatomy-2XVFBrW4.js} +1 -1
- package/.output/ui/assets/{ResponseView-LOWfvBLK.js → ResponseView-BULgzLVB.js} +1 -1
- package/.output/ui/assets/{StreamingChunkSequence-DPfsrrXQ.js → StreamingChunkSequence-DSkvkbns.js} +1 -1
- package/.output/ui/assets/{_sessionId-OdX2Jvt1.js → _sessionId-D2dmJi3G.js} +1 -1
- package/.output/ui/assets/{_sessionId-0MlWS-CO.js → _sessionId-DcS0s1Mr.js} +1 -1
- package/.output/ui/assets/{index-Du4qNOOt.js → index-B0TN1KKO.js} +2 -2
- package/.output/ui/assets/{index-gvFj_9K6.js → index-Bva1zHEs.js} +1 -1
- package/.output/ui/assets/{index-Ea-c8hPg.js → index-BzBExOxu.js} +1 -1
- package/.output/ui/assets/{index-zVVS53Hd.js → index-k6sRQz55.js} +1 -1
- package/.output/ui/assets/{json-viewer-C1WAMzg3.js → json-viewer-CWM4tY-j.js} +1 -1
- package/.output/ui/assets/{jszip.min-B8AKu2zm.js → jszip.min-BkWvRFlo.js} +1 -1
- package/.output/ui/index.html +1 -1
- package/package.json +5 -10
- package/src/assets/IDE/claudecode-color.svg +0 -1
- package/src/assets/IDE/codex-color.svg +0 -1
- package/src/assets/IDE/opencode.svg +0 -1
- package/src/assets/IDE/xiaomimimo.svg +0 -1
- package/src/assets/favicon.svg +0 -21
- package/src/assets/logos/alibaba.svg +0 -1
- package/src/assets/logos/anthropic.svg +0 -1
- package/src/assets/logos/claude-code.svg +0 -4
- package/src/assets/logos/deepseek.svg +0 -1
- package/src/assets/logos/minimax.jpeg +0 -0
- package/src/assets/logos/openai.svg +0 -1
- package/src/assets/logos/opencode.svg +0 -4
- package/src/assets/logos/qwen.webp +0 -0
- package/src/assets/logos/zhipuai.svg +0 -219
- package/src/backend/router.tsx +0 -36
- package/src/backend/routes/$.ts +0 -26
- package/src/backend/routes/__root.ts +0 -4
- package/src/backend/routes/api/-instances.ts +0 -7
- package/src/backend/routes/api/alerts.summary.ts +0 -28
- package/src/backend/routes/api/alerts.ts +0 -70
- package/src/backend/routes/api/config.paths.ts +0 -14
- package/src/backend/routes/api/config.ts +0 -73
- package/src/backend/routes/api/ecosystem.packages.$packageId.help.ts +0 -11
- package/src/backend/routes/api/ecosystem.packages.$packageId.install.ts +0 -11
- package/src/backend/routes/api/ecosystem.packages.$packageId.runner-presets.ts +0 -11
- package/src/backend/routes/api/ecosystem.packages.$packageId.upgrade.ts +0 -11
- package/src/backend/routes/api/ecosystem.packages.ts +0 -21
- package/src/backend/routes/api/ecosystem.recipes.$recipeId.run.ts +0 -11
- package/src/backend/routes/api/ecosystem.tasks.$taskId.ts +0 -16
- package/src/backend/routes/api/ecosystem.tasks.ts +0 -12
- package/src/backend/routes/api/groups.$groupId.evidence.ts +0 -55
- package/src/backend/routes/api/groups.$groupId.sessions.ts +0 -50
- package/src/backend/routes/api/groups.$groupId.ts +0 -93
- package/src/backend/routes/api/groups.ts +0 -79
- package/src/backend/routes/api/health.ts +0 -22
- package/src/backend/routes/api/instances.$name.connection.ts +0 -12
- package/src/backend/routes/api/instances.$name.restart.ts +0 -23
- package/src/backend/routes/api/instances.$name.start.ts +0 -18
- package/src/backend/routes/api/instances.$name.stop.ts +0 -23
- package/src/backend/routes/api/instances.$name.ts +0 -12
- package/src/backend/routes/api/instances.ts +0 -16
- package/src/backend/routes/api/knowledge.candidates.$candidateId.promote.ts +0 -32
- package/src/backend/routes/api/knowledge.candidates.$candidateId.ts +0 -50
- package/src/backend/routes/api/knowledge.candidates.ts +0 -10
- package/src/backend/routes/api/knowledge.project-context.ts +0 -29
- package/src/backend/routes/api/knowledge.search.ts +0 -62
- package/src/backend/routes/api/knowledge.sessions.$sessionId.candidates.ts +0 -26
- package/src/backend/routes/api/logs.$id.body.ts +0 -58
- package/src/backend/routes/api/logs.$id.chunks.ts +0 -37
- package/src/backend/routes/api/logs.$id.replay.ts +0 -297
- package/src/backend/routes/api/logs.$id.ts +0 -23
- package/src/backend/routes/api/logs.import.ts +0 -39
- package/src/backend/routes/api/logs.stream.ts +0 -174
- package/src/backend/routes/api/logs.ts +0 -214
- package/src/backend/routes/api/mcp.ts +0 -25
- package/src/backend/routes/api/models.ts +0 -10
- package/src/backend/routes/api/pi-agent.ts +0 -29
- package/src/backend/routes/api/providers.$providerId.model-metadata.ts +0 -173
- package/src/backend/routes/api/providers.$providerId.test.log.ts +0 -342
- package/src/backend/routes/api/providers.$providerId.ts +0 -111
- package/src/backend/routes/api/providers.export.ts +0 -44
- package/src/backend/routes/api/providers.import.ts +0 -81
- package/src/backend/routes/api/providers.scan.ts +0 -28
- package/src/backend/routes/api/providers.ts +0 -102
- package/src/backend/routes/api/runs.$runId.evidence.ts +0 -55
- package/src/backend/routes/api/runs.$runId.ts +0 -50
- package/src/backend/routes/api/runs.ts +0 -62
- package/src/backend/routes/api/runtime.ts +0 -46
- package/src/backend/routes/api/sessions.ts +0 -51
- package/src/backend/routes/api/storage.ts +0 -56
- package/src/backend/routes/livez.ts +0 -13
- package/src/backend/routes/metrics.ts +0 -14
- package/src/backend/routes/proxy/$.ts +0 -15
- package/src/backend/routes/readyz.ts +0 -18
- package/src/backend/start.ts +0 -10
- package/src/cli/alias.ts +0 -431
- package/src/cli/detect-tools.ts +0 -123
- package/src/cli/doctor.ts +0 -836
- package/src/cli/instance.ts +0 -1071
- package/src/cli/instanceApi.ts +0 -213
- package/src/cli/instanceArgs.ts +0 -301
- package/src/cli/instanceControl.ts +0 -191
- package/src/cli/instanceModel.ts +0 -276
- package/src/cli/instanceRegistry.ts +0 -731
- package/src/cli/networkHints.ts +0 -170
- package/src/cli/onboard.ts +0 -1668
- package/src/cli/onboardTarget.ts +0 -228
- package/src/cli/rustBackendPackage.ts +0 -458
- package/src/cli/startupOutput.ts +0 -16
- package/src/cli/templates/codex-skill-onboard.ts +0 -320
- package/src/cli/templates/command-onboard.ts +0 -25
- package/src/cli/templates/skill-onboard.ts +0 -625
- package/src/cli.ts +0 -1433
- package/src/components/OnboardingBanner.tsx +0 -115
- package/src/components/ProxyViewer.tsx +0 -2259
- package/src/components/ProxyViewerContainer.tsx +0 -1076
- package/src/components/alerts/AlertsDialog.tsx +0 -615
- package/src/components/clients/ClientLogo.tsx +0 -175
- package/src/components/ecosystem/AgentLabDialog.tsx +0 -947
- package/src/components/errors/SafeErrorBoundary.tsx +0 -201
- package/src/components/groups/GroupsDialog.tsx +0 -1304
- package/src/components/inspector-pet/InspectorPet.tsx +0 -398
- package/src/components/inspector-pet/InspectorPetCrab3D.tsx +0 -455
- package/src/components/inspector-pet/inspectorPetLogic.ts +0 -272
- package/src/components/pi-agent/PiAgentPanel.tsx +0 -446
- package/src/components/pi-agent/piAgentChatLogic.ts +0 -273
- package/src/components/providers/ImportWizardDialog.tsx +0 -281
- package/src/components/providers/ProviderCard.tsx +0 -347
- package/src/components/providers/ProviderForm.tsx +0 -1183
- package/src/components/providers/ProviderLogo.tsx +0 -122
- package/src/components/providers/ProviderTestResultsView.tsx +0 -734
- package/src/components/providers/ProvidersPanel.tsx +0 -714
- package/src/components/providers/SettingsDialog.tsx +0 -1042
- package/src/components/providers/providerFormCapabilities.ts +0 -36
- package/src/components/proxy-viewer/AgentTraceSummary.tsx +0 -902
- package/src/components/proxy-viewer/AnswerMarkdown.tsx +0 -51
- package/src/components/proxy-viewer/ApplicationBar.tsx +0 -123
- package/src/components/proxy-viewer/CompareDrawer.tsx +0 -984
- package/src/components/proxy-viewer/ConversationGroup.tsx +0 -208
- package/src/components/proxy-viewer/ConversationGroupList.tsx +0 -652
- package/src/components/proxy-viewer/ConversationHeader.tsx +0 -429
- package/src/components/proxy-viewer/LiveConnectionStatus.tsx +0 -186
- package/src/components/proxy-viewer/LogEntry.tsx +0 -1419
- package/src/components/proxy-viewer/LogEntryHeader.tsx +0 -596
- package/src/components/proxy-viewer/ProviderLogoStack.tsx +0 -57
- package/src/components/proxy-viewer/RawExportWarning.tsx +0 -77
- package/src/components/proxy-viewer/ReplayDialog.tsx +0 -636
- package/src/components/proxy-viewer/RequestToolsPanel.tsx +0 -299
- package/src/components/proxy-viewer/ResponseView.tsx +0 -202
- package/src/components/proxy-viewer/SessionLoadProgressBar.tsx +0 -61
- package/src/components/proxy-viewer/StreamingChunkSequence.tsx +0 -265
- package/src/components/proxy-viewer/ThreadConnector.tsx +0 -165
- package/src/components/proxy-viewer/ToolTraceEvents.tsx +0 -64
- package/src/components/proxy-viewer/TurnGroup.tsx +0 -383
- package/src/components/proxy-viewer/TurnGroupList.tsx +0 -156
- package/src/components/proxy-viewer/accessibility.ts +0 -8
- package/src/components/proxy-viewer/anatomy/RequestAnatomy.tsx +0 -887
- package/src/components/proxy-viewer/anatomy/SegmentBar.tsx +0 -222
- package/src/components/proxy-viewer/anatomy/contextIntelligence.ts +0 -737
- package/src/components/proxy-viewer/anatomy/sessionContextSummary.ts +0 -268
- package/src/components/proxy-viewer/anatomy/tokenEstimate.ts +0 -53
- package/src/components/proxy-viewer/anatomy/types.ts +0 -41
- package/src/components/proxy-viewer/anatomy/useAnatomyJump.ts +0 -114
- package/src/components/proxy-viewer/bodyHydration.ts +0 -123
- package/src/components/proxy-viewer/cacheTrend.ts +0 -50
- package/src/components/proxy-viewer/diff/DiffView.tsx +0 -321
- package/src/components/proxy-viewer/diff/computeDiff.ts +0 -178
- package/src/components/proxy-viewer/diff/index.ts +0 -3
- package/src/components/proxy-viewer/formats/anthropic/ContentBlocks.tsx +0 -194
- package/src/components/proxy-viewer/formats/anthropic/ResponseView.tsx +0 -81
- package/src/components/proxy-viewer/formats/anthropic/thinkingExtract.ts +0 -21
- package/src/components/proxy-viewer/formats/index.tsx +0 -47
- package/src/components/proxy-viewer/formats/openai/ResponseView.tsx +0 -442
- package/src/components/proxy-viewer/index.ts +0 -9
- package/src/components/proxy-viewer/lazy.ts +0 -41
- package/src/components/proxy-viewer/liveConnectionState.ts +0 -158
- package/src/components/proxy-viewer/log-formats/anthropic.ts +0 -191
- package/src/components/proxy-viewer/log-formats/index.ts +0 -23
- package/src/components/proxy-viewer/log-formats/openai.ts +0 -256
- package/src/components/proxy-viewer/log-formats/types.ts +0 -40
- package/src/components/proxy-viewer/log-formats/unknown.ts +0 -18
- package/src/components/proxy-viewer/logEntryVisibility.ts +0 -73
- package/src/components/proxy-viewer/logFocus.ts +0 -54
- package/src/components/proxy-viewer/proxyViewerContainerLogic.ts +0 -124
- package/src/components/proxy-viewer/proxyViewerLogic.ts +0 -488
- package/src/components/proxy-viewer/replayComparison.ts +0 -131
- package/src/components/proxy-viewer/requestDiff.ts +0 -277
- package/src/components/proxy-viewer/requestTools.ts +0 -220
- package/src/components/proxy-viewer/useCopyFeedback.ts +0 -38
- package/src/components/proxy-viewer/useKeyboardNavigation.ts +0 -232
- package/src/components/proxy-viewer/viewerState.ts +0 -176
- package/src/components/ui/badge.tsx +0 -47
- package/src/components/ui/button.tsx +0 -47
- package/src/components/ui/collapsible.tsx +0 -21
- package/src/components/ui/confirm-dialog.tsx +0 -51
- package/src/components/ui/crab-logo.tsx +0 -45
- package/src/components/ui/crab-variants.tsx +0 -467
- package/src/components/ui/dialog.tsx +0 -130
- package/src/components/ui/icon-trigger.ts +0 -2
- package/src/components/ui/json-viewer-bulk.ts +0 -132
- package/src/components/ui/json-viewer.tsx +0 -508
- package/src/components/ui/scroll-area.tsx +0 -54
- package/src/components/ui/select.tsx +0 -178
- package/src/components/ui/separator.tsx +0 -28
- package/src/components/ui/tabs.tsx +0 -88
- package/src/components/ui/tooltip.tsx +0 -51
- package/src/components/ui/transient-toast.tsx +0 -105
- package/src/contracts/anthropic.ts +0 -230
- package/src/contracts/index.ts +0 -59
- package/src/contracts/json.ts +0 -37
- package/src/contracts/log.ts +0 -139
- package/src/contracts/openai.ts +0 -267
- package/src/index.css +0 -11
- package/src/knowledge/candidateStore.ts +0 -94
- package/src/knowledge/distiller.ts +0 -98
- package/src/knowledge/openclawClient.ts +0 -161
- package/src/knowledge/openclawGatewayClient.ts +0 -249
- package/src/knowledge/openclawMarkdown.ts +0 -146
- package/src/knowledge/redactor.ts +0 -80
- package/src/knowledge/types.ts +0 -83
- package/src/lib/alertContract.ts +0 -76
- package/src/lib/apiClient.ts +0 -166
- package/src/lib/apiFormat.ts +0 -29
- package/src/lib/backendImplementation.ts +0 -16
- package/src/lib/basePath.ts +0 -107
- package/src/lib/browserRuntimeContract.ts +0 -124
- package/src/lib/browserRuntimeResolver.ts +0 -333
- package/src/lib/chunkLoadRecovery.ts +0 -83
- package/src/lib/claudeCodeStrip.ts +0 -98
- package/src/lib/clipboard.ts +0 -67
- package/src/lib/codingAgentEndpoints.ts +0 -54
- package/src/lib/ecosystemContract.ts +0 -130
- package/src/lib/export-logs.ts +0 -287
- package/src/lib/groupContract.ts +0 -166
- package/src/lib/instanceContract.ts +0 -239
- package/src/lib/jsonFile.ts +0 -46
- package/src/lib/logImportContract.ts +0 -12
- package/src/lib/managedInstance.ts +0 -112
- package/src/lib/mask.ts +0 -4
- package/src/lib/objectUtils.ts +0 -22
- package/src/lib/piAgentContract.ts +0 -102
- package/src/lib/providerContract.ts +0 -125
- package/src/lib/providerImportContract.ts +0 -27
- package/src/lib/providerModelMetadata.ts +0 -458
- package/src/lib/providerTestContract.ts +0 -170
- package/src/lib/providerTestPrompt.ts +0 -100
- package/src/lib/publicBasePathContext.ts +0 -137
- package/src/lib/resourceLimits.ts +0 -345
- package/src/lib/runContract.ts +0 -164
- package/src/lib/runtimeConfig.ts +0 -43
- package/src/lib/safeDiagnostic.ts +0 -38
- package/src/lib/safeFetch.ts +0 -508
- package/src/lib/serverPort.ts +0 -47
- package/src/lib/sessionInfoContract.ts +0 -78
- package/src/lib/sessionUrl.ts +0 -46
- package/src/lib/ssrfGuard.ts +0 -133
- package/src/lib/stopReason.ts +0 -130
- package/src/lib/themeMode.ts +0 -41
- package/src/lib/timeDisplay.ts +0 -22
- package/src/lib/toolTrace.ts +0 -290
- package/src/lib/uiScale.ts +0 -117
- package/src/lib/unknown.ts +0 -27
- package/src/lib/upstreamUrl.ts +0 -150
- package/src/lib/useAlerts.ts +0 -82
- package/src/lib/useGroupEvidence.ts +0 -37
- package/src/lib/useGroups.ts +0 -32
- package/src/lib/useOnboarding.ts +0 -93
- package/src/lib/useProviders.ts +0 -30
- package/src/lib/useStripConfig.ts +0 -154
- package/src/lib/useThemeMode.ts +0 -40
- package/src/lib/useUiScale.ts +0 -52
- package/src/lib/utils.ts +0 -78
- package/src/mcp/currentContext.ts +0 -65
- package/src/mcp/instanceHandlers.ts +0 -151
- package/src/mcp/loopback.ts +0 -88
- package/src/mcp/mode.ts +0 -75
- package/src/mcp/previewExtractor.ts +0 -233
- package/src/mcp/server.ts +0 -2274
- package/src/mcp/toolHandlers.ts +0 -1533
- package/src/proxy/alerts.ts +0 -664
- package/src/proxy/chunkStorage.ts +0 -123
- package/src/proxy/config.ts +0 -218
- package/src/proxy/constants.ts +0 -66
- package/src/proxy/dataDir.ts +0 -147
- package/src/proxy/ecosystemExecutionConfirmation.ts +0 -114
- package/src/proxy/ecosystemExecutionRoute.ts +0 -116
- package/src/proxy/ecosystemRegistry.ts +0 -296
- package/src/proxy/ecosystemTasks.ts +0 -415
- package/src/proxy/evidenceAnalysis.ts +0 -526
- package/src/proxy/evidenceExporter.ts +0 -235
- package/src/proxy/formats/anthropic/anthropicProvider.ts +0 -75
- package/src/proxy/formats/anthropic/handler.ts +0 -75
- package/src/proxy/formats/anthropic/index.ts +0 -13
- package/src/proxy/formats/anthropic/register.ts +0 -4
- package/src/proxy/formats/anthropic/schemas.ts +0 -6
- package/src/proxy/formats/anthropic/stream.ts +0 -205
- package/src/proxy/formats/handler.ts +0 -46
- package/src/proxy/formats/index.ts +0 -13
- package/src/proxy/formats/jsonSchema.ts +0 -2
- package/src/proxy/formats/openai/alibabaProvider.ts +0 -34
- package/src/proxy/formats/openai/codexMetadata.ts +0 -61
- package/src/proxy/formats/openai/handler.ts +0 -133
- package/src/proxy/formats/openai/index.ts +0 -33
- package/src/proxy/formats/openai/provider.ts +0 -50
- package/src/proxy/formats/openai/register.ts +0 -4
- package/src/proxy/formats/openai/schemas.ts +0 -25
- package/src/proxy/formats/openai/stream.ts +0 -600
- package/src/proxy/formats/openai/zhipuProvider.ts +0 -31
- package/src/proxy/formats/providerAdapter.ts +0 -50
- package/src/proxy/formats/providerRegistry.ts +0 -51
- package/src/proxy/formats/providers/index.ts +0 -3
- package/src/proxy/formats/registry.ts +0 -65
- package/src/proxy/groupEvidenceExporter.ts +0 -371
- package/src/proxy/groupStore.ts +0 -336
- package/src/proxy/handler.ts +0 -729
- package/src/proxy/identityProxy.ts +0 -1842
- package/src/proxy/jsonlRecovery.ts +0 -554
- package/src/proxy/logBodyChunks.ts +0 -91
- package/src/proxy/logFinalizer.ts +0 -777
- package/src/proxy/logFinalizer.worker.ts +0 -24
- package/src/proxy/logImportUpload.ts +0 -128
- package/src/proxy/logImporter.ts +0 -813
- package/src/proxy/logIndex.ts +0 -663
- package/src/proxy/logSearch.ts +0 -122
- package/src/proxy/logger.ts +0 -537
- package/src/proxy/openaiOrphanToolStrip.ts +0 -142
- package/src/proxy/platformCommands.ts +0 -258
- package/src/proxy/privateDataPath.ts +0 -419
- package/src/proxy/providerImporters.ts +0 -578
- package/src/proxy/providerScanStore.ts +0 -87
- package/src/proxy/providerSecretStore.ts +0 -216
- package/src/proxy/providers.ts +0 -998
- package/src/proxy/rawStreamCapture.ts +0 -342
- package/src/proxy/runFailures.ts +0 -94
- package/src/proxy/runStore.ts +0 -214
- package/src/proxy/runtimeAdmission.ts +0 -55
- package/src/proxy/runtimeHealth.ts +0 -221
- package/src/proxy/runtimeMetrics.ts +0 -149
- package/src/proxy/runtimeShutdown.ts +0 -157
- package/src/proxy/schemas.ts +0 -112
- package/src/proxy/sessionArchive.ts +0 -479
- package/src/proxy/sessionInfo.ts +0 -266
- package/src/proxy/sessionProcess.ts +0 -194
- package/src/proxy/sessionRuntime.ts +0 -121
- package/src/proxy/sessionSupervisor.ts +0 -305
- package/src/proxy/sessionWorkerEntry.ts +0 -26
- package/src/proxy/shutdownCoordinator.ts +0 -90
- package/src/proxy/socketTracker.ts +0 -639
- package/src/proxy/sqliteLogIndex.ts +0 -733
- package/src/proxy/storageLifecycle.ts +0 -432
- package/src/proxy/store.ts +0 -1773
- package/src/proxy/streamTiming.ts +0 -31
- package/src/proxy/toolSchemaWarnings.ts +0 -529
- package/src/proxy/uiAssetServer.ts +0 -106
- package/src/proxy/upstream.ts +0 -127
- package/src/services/alerts.ts +0 -12
- package/src/services/groups.ts +0 -119
- package/src/services/piAgent.ts +0 -421
- package/src/services/piAgentRetrieval.ts +0 -1180
- package/src/services/result.ts +0 -17
- package/src/services/runs.ts +0 -76
- package/src/ui/bootstrap.ts +0 -167
- package/src/ui/index.html +0 -38
- package/src/ui/logsStreamClient.ts +0 -20
- package/src/ui/main.tsx +0 -13
- package/src/ui/public/runtime-config.js +0 -2
- package/src/ui/router.tsx +0 -13
- package/src/ui/routes/__root.tsx +0 -69
- package/src/ui/routes/index.tsx +0 -35
- package/src/ui/routes/session/$sessionId.tsx +0 -50
- package/src/ui/runtimeDiscovery.ts +0 -50
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import {
|
|
4
|
-
getProviders,
|
|
5
|
-
addProvider,
|
|
6
|
-
redactProvider,
|
|
7
|
-
redactProviders,
|
|
8
|
-
} from "../../../proxy/providers";
|
|
9
|
-
import {
|
|
10
|
-
getProviderModelLimitViolation,
|
|
11
|
-
ProviderModelMetadataListSchema,
|
|
12
|
-
ProviderModelNameSchema,
|
|
13
|
-
ProviderModelsSchema,
|
|
14
|
-
} from "../../../lib/providerContract";
|
|
15
|
-
import { evaluateUpstreamUrl } from "../../../lib/ssrfGuard";
|
|
16
|
-
import { resourceLimitResponse } from "../../../lib/resourceLimits";
|
|
17
|
-
|
|
18
|
-
const ALLOW_LOOPBACK = process.env["AGENT_INSPECTOR_ALLOW_LOOPBACK"] === "1";
|
|
19
|
-
|
|
20
|
-
const ProviderInputSchema = z.object({
|
|
21
|
-
name: z.string().min(1, "Name is required"),
|
|
22
|
-
apiKey: z.string().min(1, "API key is required"),
|
|
23
|
-
format: z.enum(["anthropic", "openai"]).optional(),
|
|
24
|
-
anthropicBaseUrl: z.string().optional(),
|
|
25
|
-
openaiBaseUrl: z.string().optional(),
|
|
26
|
-
openaiResponsesBaseUrl: z.string().optional(),
|
|
27
|
-
models: ProviderModelsSchema.min(1, "At least one model is required"),
|
|
28
|
-
model: ProviderModelNameSchema.optional(),
|
|
29
|
-
authHeader: z.enum(["bearer", "x-api-key"]).optional().default("bearer"),
|
|
30
|
-
apiDocsUrl: z.string().optional(),
|
|
31
|
-
modelMetadataUrl: z.string().optional(),
|
|
32
|
-
modelMetadata: ProviderModelMetadataListSchema.optional(),
|
|
33
|
-
source: z.enum(["company", "personal"]).optional(),
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
export const Route = createFileRoute("/api/providers")({
|
|
37
|
-
server: {
|
|
38
|
-
handlers: {
|
|
39
|
-
GET: () => {
|
|
40
|
-
return Response.json(redactProviders(getProviders()));
|
|
41
|
-
},
|
|
42
|
-
POST: async ({ request }: { request: Request }) => {
|
|
43
|
-
let body: unknown;
|
|
44
|
-
try {
|
|
45
|
-
body = await request.json();
|
|
46
|
-
} catch {
|
|
47
|
-
return Response.json({ error: "Invalid JSON body" }, { status: 400 });
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const violation = getProviderModelLimitViolation(body);
|
|
51
|
-
if (violation !== null) {
|
|
52
|
-
return resourceLimitResponse({
|
|
53
|
-
error: `Provider model collections may contain at most ${String(violation.limit)} entries.`,
|
|
54
|
-
code: "provider-model-limit-exceeded",
|
|
55
|
-
status: 413,
|
|
56
|
-
resource: violation.resource,
|
|
57
|
-
limit: violation.limit,
|
|
58
|
-
retryable: false,
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const parsed = ProviderInputSchema.safeParse(body);
|
|
63
|
-
if (!parsed.success) {
|
|
64
|
-
return Response.json({ error: parsed.error.message }, { status: 400 });
|
|
65
|
-
}
|
|
66
|
-
for (const candidate of [
|
|
67
|
-
parsed.data.anthropicBaseUrl,
|
|
68
|
-
parsed.data.openaiBaseUrl,
|
|
69
|
-
parsed.data.openaiResponsesBaseUrl,
|
|
70
|
-
]) {
|
|
71
|
-
if (candidate === undefined || candidate === "") continue;
|
|
72
|
-
const decision = evaluateUpstreamUrl(candidate, { allowLoopback: ALLOW_LOOPBACK });
|
|
73
|
-
if (!decision.allow) {
|
|
74
|
-
return Response.json({ error: decision.reason }, { status: 400 });
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
const newProvider = addProvider(
|
|
78
|
-
parsed.data.name,
|
|
79
|
-
parsed.data.apiKey,
|
|
80
|
-
parsed.data.format,
|
|
81
|
-
undefined, // baseUrl (legacy) — use format-specific URLs instead
|
|
82
|
-
parsed.data.models,
|
|
83
|
-
parsed.data.authHeader,
|
|
84
|
-
parsed.data.apiDocsUrl,
|
|
85
|
-
parsed.data.anthropicBaseUrl,
|
|
86
|
-
parsed.data.openaiBaseUrl,
|
|
87
|
-
parsed.data.source,
|
|
88
|
-
parsed.data.modelMetadataUrl,
|
|
89
|
-
parsed.data.modelMetadata,
|
|
90
|
-
parsed.data.openaiResponsesBaseUrl,
|
|
91
|
-
);
|
|
92
|
-
if (newProvider === null) {
|
|
93
|
-
return Response.json(
|
|
94
|
-
{ error: "Secure provider storage is unavailable; provider was not created" },
|
|
95
|
-
{ status: 503 },
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
return Response.json(redactProvider(newProvider), { status: 201 });
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
});
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
-
import { EvidenceExportOptionsSchema } from "../../../lib/runContract";
|
|
3
|
-
import { exportInspectorRunEvidence, readInspectorRunEvidence } from "../../../services/runs";
|
|
4
|
-
|
|
5
|
-
type JsonBodyResult = { ok: true; value: unknown } | { ok: false };
|
|
6
|
-
|
|
7
|
-
async function readJsonBody(request: Request): Promise<JsonBodyResult> {
|
|
8
|
-
try {
|
|
9
|
-
const raw = await request.text();
|
|
10
|
-
if (raw.trim().length === 0) return { ok: true, value: undefined };
|
|
11
|
-
return { ok: true, value: JSON.parse(raw) };
|
|
12
|
-
} catch {
|
|
13
|
-
return { ok: false };
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const Route = createFileRoute("/api/runs/$runId/evidence")({
|
|
18
|
-
server: {
|
|
19
|
-
handlers: {
|
|
20
|
-
GET: ({ params }: { params: { runId: string } }) => {
|
|
21
|
-
const evidence = readInspectorRunEvidence(params.runId);
|
|
22
|
-
if (!evidence.ok) {
|
|
23
|
-
return Response.json({ error: evidence.message }, { status: evidence.status });
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return Response.json(evidence.value);
|
|
27
|
-
},
|
|
28
|
-
POST: async ({ params, request }: { params: { runId: string }; request: Request }) => {
|
|
29
|
-
const body = await readJsonBody(request);
|
|
30
|
-
if (!body.ok) {
|
|
31
|
-
return Response.json({ error: "Invalid JSON body" }, { status: 400 });
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const parsed = EvidenceExportOptionsSchema.safeParse(body.value);
|
|
35
|
-
if (!parsed.success) {
|
|
36
|
-
return Response.json(
|
|
37
|
-
{ error: "Invalid request body", details: parsed.error.format() },
|
|
38
|
-
{ status: 400 },
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const exported = await exportInspectorRunEvidence(
|
|
43
|
-
params.runId,
|
|
44
|
-
parsed.data,
|
|
45
|
-
new URL(request.url).origin,
|
|
46
|
-
);
|
|
47
|
-
if (!exported.ok) {
|
|
48
|
-
return Response.json({ error: exported.message }, { status: exported.status });
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return Response.json(exported.value);
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
});
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
-
import { UpdateInspectorRunInputSchema } from "../../../lib/runContract";
|
|
3
|
-
import { getInspectorRun, updateInspectorRun } from "../../../services/runs";
|
|
4
|
-
|
|
5
|
-
type JsonBodyResult = { ok: true; value: unknown } | { ok: false };
|
|
6
|
-
|
|
7
|
-
async function readJsonBody(request: Request): Promise<JsonBodyResult> {
|
|
8
|
-
try {
|
|
9
|
-
const raw = await request.text();
|
|
10
|
-
if (raw.trim().length === 0) return { ok: true, value: {} };
|
|
11
|
-
return { ok: true, value: JSON.parse(raw) };
|
|
12
|
-
} catch {
|
|
13
|
-
return { ok: false };
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const Route = createFileRoute("/api/runs/$runId")({
|
|
18
|
-
server: {
|
|
19
|
-
handlers: {
|
|
20
|
-
GET: ({ params }: { params: { runId: string } }) => {
|
|
21
|
-
const run = getInspectorRun(params.runId);
|
|
22
|
-
if (!run.ok) {
|
|
23
|
-
return Response.json({ error: run.message }, { status: run.status });
|
|
24
|
-
}
|
|
25
|
-
return Response.json(run.value);
|
|
26
|
-
},
|
|
27
|
-
PATCH: async ({ params, request }: { params: { runId: string }; request: Request }) => {
|
|
28
|
-
const body = await readJsonBody(request);
|
|
29
|
-
if (!body.ok) {
|
|
30
|
-
return Response.json({ error: "Invalid JSON body" }, { status: 400 });
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const parsed = UpdateInspectorRunInputSchema.safeParse(body.value);
|
|
34
|
-
if (!parsed.success) {
|
|
35
|
-
return Response.json(
|
|
36
|
-
{ error: "Invalid request body", details: parsed.error.format() },
|
|
37
|
-
{ status: 400 },
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const updated = updateInspectorRun(params.runId, parsed.data);
|
|
42
|
-
if (!updated.ok) {
|
|
43
|
-
return Response.json({ error: updated.message }, { status: updated.status });
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return Response.json(updated.value);
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
});
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
-
import { CreateInspectorRunInputSchema } from "../../../lib/runContract";
|
|
3
|
-
import {
|
|
4
|
-
RECENT_FAILURES_DEFAULT_LIMIT,
|
|
5
|
-
createInspectorRun,
|
|
6
|
-
listInspectorRecentFailures,
|
|
7
|
-
listInspectorRuns,
|
|
8
|
-
} from "../../../services/runs";
|
|
9
|
-
import { RECENT_FAILURES_MAX_LIMIT } from "../../../proxy/runFailures";
|
|
10
|
-
import { parseBoundedIntegerParameter } from "../../../lib/resourceLimits";
|
|
11
|
-
|
|
12
|
-
type JsonBodyResult = { ok: true; value: unknown } | { ok: false };
|
|
13
|
-
|
|
14
|
-
async function readJsonBody(request: Request): Promise<JsonBodyResult> {
|
|
15
|
-
try {
|
|
16
|
-
const raw = await request.text();
|
|
17
|
-
if (raw.trim().length === 0) return { ok: true, value: undefined };
|
|
18
|
-
return { ok: true, value: JSON.parse(raw) };
|
|
19
|
-
} catch {
|
|
20
|
-
return { ok: false };
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export const Route = createFileRoute("/api/runs")({
|
|
25
|
-
server: {
|
|
26
|
-
handlers: {
|
|
27
|
-
GET: ({ request }: { request: Request }) => {
|
|
28
|
-
const url = new URL(request.url);
|
|
29
|
-
if (url.searchParams.get("failures") === "1") {
|
|
30
|
-
const limitResult = parseBoundedIntegerParameter({
|
|
31
|
-
value: url.searchParams.get("limit"),
|
|
32
|
-
parameter: "limit",
|
|
33
|
-
fallback: RECENT_FAILURES_DEFAULT_LIMIT,
|
|
34
|
-
minimum: 1,
|
|
35
|
-
maximum: RECENT_FAILURES_MAX_LIMIT,
|
|
36
|
-
resource: "recent-failures-page-size",
|
|
37
|
-
});
|
|
38
|
-
if (!limitResult.ok) return limitResult.response;
|
|
39
|
-
return Response.json(listInspectorRecentFailures(limitResult.value));
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return Response.json(listInspectorRuns());
|
|
43
|
-
},
|
|
44
|
-
POST: async ({ request }: { request: Request }) => {
|
|
45
|
-
const body = await readJsonBody(request);
|
|
46
|
-
if (!body.ok) {
|
|
47
|
-
return Response.json({ error: "Invalid JSON body" }, { status: 400 });
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const parsed = CreateInspectorRunInputSchema.safeParse(body.value);
|
|
51
|
-
if (!parsed.success) {
|
|
52
|
-
return Response.json(
|
|
53
|
-
{ error: "Invalid request body", details: parsed.error.format() },
|
|
54
|
-
{ status: 400 },
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return Response.json(createInspectorRun(parsed.data), { status: 201 });
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
});
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
-
import { appendBasePathToOrigin } from "../../../lib/basePath";
|
|
3
|
-
import {
|
|
4
|
-
BROWSER_RUNTIME_SCHEMA_VERSION,
|
|
5
|
-
type BrowserRuntimeDeployment,
|
|
6
|
-
} from "../../../lib/browserRuntimeContract";
|
|
7
|
-
import { getPublicBasePath, getPublicOrigin } from "../../../lib/publicBasePathContext";
|
|
8
|
-
|
|
9
|
-
type RuntimeEnvironment = Readonly<Record<string, string | undefined>>;
|
|
10
|
-
|
|
11
|
-
export const AGENT_INSPECTOR_BACKEND_ONLY_ENV = "AGENT_INSPECTOR_BACKEND_ONLY";
|
|
12
|
-
|
|
13
|
-
export function runtimeDiscoveryDocument(
|
|
14
|
-
env: RuntimeEnvironment = process.env,
|
|
15
|
-
): BrowserRuntimeDeployment {
|
|
16
|
-
const basePath = getPublicBasePath(env);
|
|
17
|
-
const baseUrl = appendBasePathToOrigin(getPublicOrigin(), "/", basePath);
|
|
18
|
-
|
|
19
|
-
return {
|
|
20
|
-
schemaVersion: BROWSER_RUNTIME_SCHEMA_VERSION,
|
|
21
|
-
deploymentMode: env[AGENT_INSPECTOR_BACKEND_ONLY_ENV] === "1" ? "backend-only" : "composed",
|
|
22
|
-
ui: { basePath: basePath.length === 0 ? "/" : basePath },
|
|
23
|
-
control: { baseUrl },
|
|
24
|
-
agent: { baseUrl },
|
|
25
|
-
capabilities: {
|
|
26
|
-
rest: true,
|
|
27
|
-
sse: true,
|
|
28
|
-
proxy: true,
|
|
29
|
-
mcp: true,
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export function runtimeDiscoveryResponse(env: RuntimeEnvironment = process.env): Response {
|
|
35
|
-
return Response.json(runtimeDiscoveryDocument(env), {
|
|
36
|
-
headers: { "cache-control": "no-store" },
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export const Route = createFileRoute("/api/runtime")({
|
|
41
|
-
server: {
|
|
42
|
-
handlers: {
|
|
43
|
-
GET: () => runtimeDiscoveryResponse(),
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
});
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
-
import { getSessionInfo, getSessionSnapshots, listSessions } from "../../../proxy/store";
|
|
3
|
-
import {
|
|
4
|
-
SESSION_INFO_DEFAULT_LATEST_LOG_LIMIT,
|
|
5
|
-
SESSION_INFO_MAX_LATEST_LOG_LIMIT,
|
|
6
|
-
} from "../../../proxy/sessionInfo";
|
|
7
|
-
import { parseBoundedIntegerParameter } from "../../../lib/resourceLimits";
|
|
8
|
-
|
|
9
|
-
function parseBooleanFlag(value: string | null): boolean {
|
|
10
|
-
return value === "1" || value === "true";
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const Route = createFileRoute("/api/sessions")({
|
|
14
|
-
server: {
|
|
15
|
-
handlers: {
|
|
16
|
-
GET: async ({ request }: { request: Request }) => {
|
|
17
|
-
const url = new URL(request.url);
|
|
18
|
-
const sessionId = url.searchParams.get("sessionId");
|
|
19
|
-
if (sessionId !== null) {
|
|
20
|
-
if (sessionId.length === 0) {
|
|
21
|
-
return Response.json({ error: "sessionId is required" }, { status: 400 });
|
|
22
|
-
}
|
|
23
|
-
const limitResult = parseBoundedIntegerParameter({
|
|
24
|
-
value: url.searchParams.get("limit"),
|
|
25
|
-
parameter: "limit",
|
|
26
|
-
fallback: SESSION_INFO_DEFAULT_LATEST_LOG_LIMIT,
|
|
27
|
-
minimum: 1,
|
|
28
|
-
maximum: SESSION_INFO_MAX_LATEST_LOG_LIMIT,
|
|
29
|
-
resource: "session-log-page-size",
|
|
30
|
-
});
|
|
31
|
-
if (!limitResult.ok) return limitResult.response;
|
|
32
|
-
const info = await getSessionInfo(sessionId, {
|
|
33
|
-
baseUrl: url.origin,
|
|
34
|
-
includeHistory: parseBooleanFlag(url.searchParams.get("includeHistory")),
|
|
35
|
-
latestLogLimit: limitResult.value,
|
|
36
|
-
});
|
|
37
|
-
if (info === null) {
|
|
38
|
-
return Response.json({ error: "Session not found" }, { status: 404 });
|
|
39
|
-
}
|
|
40
|
-
return Response.json(info);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const details = url.searchParams.get("details");
|
|
44
|
-
if (details === "true" || details === "1") {
|
|
45
|
-
return Response.json(getSessionSnapshots());
|
|
46
|
-
}
|
|
47
|
-
return Response.json(await listSessions());
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
});
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
-
import { getLogStorageStats } from "../../../proxy/store";
|
|
3
|
-
import {
|
|
4
|
-
getLastStorageLifecycleGcResult,
|
|
5
|
-
getStorageLifecycleInventory,
|
|
6
|
-
resolveStorageLifecycleQuotaPolicy,
|
|
7
|
-
runStorageLifecycleGc,
|
|
8
|
-
type StorageLifecycleGcResult,
|
|
9
|
-
} from "../../../proxy/storageLifecycle";
|
|
10
|
-
|
|
11
|
-
function summarizeGcResult(result: StorageLifecycleGcResult | null) {
|
|
12
|
-
if (result === null) return null;
|
|
13
|
-
return {
|
|
14
|
-
checkedAt: result.checkedAt,
|
|
15
|
-
filesDeleted: result.filesDeleted,
|
|
16
|
-
bytesDeleted: result.bytesDeleted,
|
|
17
|
-
errors: result.errors.length,
|
|
18
|
-
beforeTotalBytes: result.before.totalBytes,
|
|
19
|
-
afterTotalBytes: result.after.totalBytes,
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function getStorageResponse() {
|
|
24
|
-
const logStats = getLogStorageStats();
|
|
25
|
-
const inventory = getStorageLifecycleInventory();
|
|
26
|
-
const policy = resolveStorageLifecycleQuotaPolicy();
|
|
27
|
-
const reclaimableBytes = inventory.artifacts
|
|
28
|
-
.filter(
|
|
29
|
-
(artifact) =>
|
|
30
|
-
artifact.cleanupBehavior === "retention-gc" ||
|
|
31
|
-
artifact.cleanupBehavior === "orphan-reclaim",
|
|
32
|
-
)
|
|
33
|
-
.reduce((sum, artifact) => sum + artifact.bytes, 0);
|
|
34
|
-
|
|
35
|
-
return {
|
|
36
|
-
memoryCount: logStats.memoryCount,
|
|
37
|
-
inventory,
|
|
38
|
-
policy,
|
|
39
|
-
reclaimableBytes,
|
|
40
|
-
lastGc: summarizeGcResult(getLastStorageLifecycleGcResult()),
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export const Route = createFileRoute("/api/storage")({
|
|
45
|
-
server: {
|
|
46
|
-
handlers: {
|
|
47
|
-
GET: () => {
|
|
48
|
-
return Response.json(getStorageResponse(), { headers: { "cache-control": "no-store" } });
|
|
49
|
-
},
|
|
50
|
-
POST: () => {
|
|
51
|
-
runStorageLifecycleGc();
|
|
52
|
-
return Response.json(getStorageResponse(), { headers: { "cache-control": "no-store" } });
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
-
|
|
3
|
-
export function livenessResponse(): Response {
|
|
4
|
-
return Response.json({ status: "ok" }, { headers: { "cache-control": "no-store" } });
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export const Route = createFileRoute("/livez")({
|
|
8
|
-
server: {
|
|
9
|
-
handlers: {
|
|
10
|
-
GET: livenessResponse,
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
-
import { getLogsStreamMetrics } from "./api/logs.stream";
|
|
3
|
-
import { getSafeOperationalMetrics } from "../../proxy/runtimeMetrics";
|
|
4
|
-
|
|
5
|
-
export const Route = createFileRoute("/metrics")({
|
|
6
|
-
server: {
|
|
7
|
-
handlers: {
|
|
8
|
-
GET: async () => {
|
|
9
|
-
const metrics = await getSafeOperationalMetrics(getLogsStreamMetrics());
|
|
10
|
-
return Response.json(metrics, { headers: { "cache-control": "no-store" } });
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
-
import { handleProxy } from "../../../proxy/handler";
|
|
3
|
-
|
|
4
|
-
export const Route = createFileRoute("/proxy/$")({
|
|
5
|
-
server: {
|
|
6
|
-
handlers: {
|
|
7
|
-
GET: ({ request }: { request: Request }) => handleProxy(request),
|
|
8
|
-
POST: ({ request }: { request: Request }) => handleProxy(request),
|
|
9
|
-
PUT: ({ request }: { request: Request }) => handleProxy(request),
|
|
10
|
-
DELETE: ({ request }: { request: Request }) => handleProxy(request),
|
|
11
|
-
PATCH: ({ request }: { request: Request }) => handleProxy(request),
|
|
12
|
-
OPTIONS: ({ request }: { request: Request }) => handleProxy(request),
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
-
import { getRuntimeReadiness } from "../../proxy/runtimeHealth";
|
|
3
|
-
|
|
4
|
-
export async function readinessResponse(): Promise<Response> {
|
|
5
|
-
const readiness = await getRuntimeReadiness();
|
|
6
|
-
return Response.json(readiness, {
|
|
7
|
-
status: readiness.status === "unavailable" ? 503 : 200,
|
|
8
|
-
headers: { "cache-control": "no-store" },
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const Route = createFileRoute("/readyz")({
|
|
13
|
-
server: {
|
|
14
|
-
handlers: {
|
|
15
|
-
GET: readinessResponse,
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
});
|
package/src/backend/start.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { createMiddleware, createStart } from "@tanstack/react-start";
|
|
2
|
-
|
|
3
|
-
const publicBasePathMiddleware = createMiddleware().server(async ({ next, request }) => {
|
|
4
|
-
const { runWithRequestPublicBasePath } = await import("../lib/publicBasePathContext");
|
|
5
|
-
return runWithRequestPublicBasePath(request, () => next());
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
export const startInstance = createStart(() => ({
|
|
9
|
-
requestMiddleware: [publicBasePathMiddleware],
|
|
10
|
-
}));
|