@tonyclaw/agent-inspector 4.0.1 → 4.0.3
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 +193 -110
- package/.output/server/_ssr/index.mjs +1 -1
- package/.output/server/_ssr/{router-CTHqmroT.mjs → router-ChILzhmz.mjs} +92 -4
- package/.output/server/index.mjs +1 -1
- package/.output/ui/assets/{CompareDrawer-L3n4J-Or.js → CompareDrawer-Co3cUF_I.js} +1 -1
- package/.output/ui/assets/{InspectorPet-D5o_3OZS.js → InspectorPet-jFcrL37X.js} +1 -1
- package/.output/ui/assets/{ProxyViewerContainer-Ocagx75S.js → ProxyViewerContainer-BPzt_VpM.js} +4 -4
- package/.output/ui/assets/{ReplayDialog-Bk7x1h-y.js → ReplayDialog-C6O_zuwI.js} +1 -1
- package/.output/ui/assets/{RequestAnatomy-U4lzL7Sc.js → RequestAnatomy-Ca6NvB7L.js} +1 -1
- package/.output/ui/assets/{ResponseView-LOWfvBLK.js → ResponseView-BzqKcveJ.js} +1 -1
- package/.output/ui/assets/{StreamingChunkSequence-DPfsrrXQ.js → StreamingChunkSequence-9pCZIsS_.js} +1 -1
- package/.output/ui/assets/{_sessionId-0MlWS-CO.js → _sessionId-BMP3KVGR.js} +1 -1
- package/.output/ui/assets/{_sessionId-OdX2Jvt1.js → _sessionId-y4eRoT1H.js} +1 -1
- package/.output/ui/assets/{index-Ea-c8hPg.js → index-CH5w-haG.js} +1 -1
- package/.output/ui/assets/{index-zVVS53Hd.js → index-CmocEhyU.js} +1 -1
- package/.output/ui/assets/{index-Du4qNOOt.js → index-DT8sMJ_n.js} +2 -2
- package/.output/ui/assets/{index-gvFj_9K6.js → index-bfsbIRZa.js} +1 -1
- package/.output/ui/assets/{json-viewer-C1WAMzg3.js → json-viewer-BfFOSDG5.js} +1 -1
- package/.output/ui/assets/{jszip.min-B8AKu2zm.js → jszip.min-BkbVkOsp.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,130 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
export const EcosystemPackageStateSchema = z.enum([
|
|
4
|
-
"installed",
|
|
5
|
-
"update-available",
|
|
6
|
-
"available",
|
|
7
|
-
"planned",
|
|
8
|
-
"unknown",
|
|
9
|
-
]);
|
|
10
|
-
|
|
11
|
-
export const EcosystemPackageSchema = z.object({
|
|
12
|
-
id: z.string(),
|
|
13
|
-
name: z.string(),
|
|
14
|
-
npmName: z.string(),
|
|
15
|
-
capability: z.string(),
|
|
16
|
-
description: z.string(),
|
|
17
|
-
workflow: z.string(),
|
|
18
|
-
installCommand: z.string(),
|
|
19
|
-
state: EcosystemPackageStateSchema,
|
|
20
|
-
installedVersion: z.string().nullable(),
|
|
21
|
-
latestVersion: z.string().nullable(),
|
|
22
|
-
primary: z.boolean(),
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
export const EcosystemRunnerPresetSchema = z.object({
|
|
26
|
-
id: z.string(),
|
|
27
|
-
name: z.string(),
|
|
28
|
-
validatedVersion: z.string(),
|
|
29
|
-
binary: z.string(),
|
|
30
|
-
modelFlag: z.string(),
|
|
31
|
-
variantFlag: z.string().nullable(),
|
|
32
|
-
tools: z.array(z.string()),
|
|
33
|
-
logDir: z.string(),
|
|
34
|
-
skillsDir: z.string(),
|
|
35
|
-
agentsDir: z.string(),
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
export const EcosystemRecipeSchema = z.object({
|
|
39
|
-
id: z.string(),
|
|
40
|
-
title: z.string(),
|
|
41
|
-
stage: z.string(),
|
|
42
|
-
packageId: z.string(),
|
|
43
|
-
description: z.string(),
|
|
44
|
-
command: z.string(),
|
|
45
|
-
requiresSession: z.boolean(),
|
|
46
|
-
runnable: z.boolean(),
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
export const EcosystemPackagesResponseSchema = z.object({
|
|
50
|
-
checkedAt: z.string(),
|
|
51
|
-
packages: z.array(EcosystemPackageSchema),
|
|
52
|
-
runnerPresets: z.array(EcosystemRunnerPresetSchema),
|
|
53
|
-
recipes: z.array(EcosystemRecipeSchema),
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
export const EcosystemTaskActionSchema = z.enum([
|
|
57
|
-
"install",
|
|
58
|
-
"upgrade",
|
|
59
|
-
"help",
|
|
60
|
-
"runner-presets",
|
|
61
|
-
"recipe",
|
|
62
|
-
]);
|
|
63
|
-
|
|
64
|
-
export const ECOSYSTEM_EXECUTION_CONFIRMATION_PHRASE = "RUN_LOCAL_COMMAND";
|
|
65
|
-
|
|
66
|
-
export const EcosystemExecutionPlanSchema = z.object({
|
|
67
|
-
action: EcosystemTaskActionSchema,
|
|
68
|
-
targetId: z.string(),
|
|
69
|
-
targetName: z.string(),
|
|
70
|
-
command: z.string(),
|
|
71
|
-
source: z.string(),
|
|
72
|
-
timeoutMs: z.number().int().positive(),
|
|
73
|
-
scope: z.string(),
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
export const EcosystemExecutionConfirmationSchema = z.object({
|
|
77
|
-
nonce: z.string().uuid(),
|
|
78
|
-
phrase: z.literal(ECOSYSTEM_EXECUTION_CONFIRMATION_PHRASE),
|
|
79
|
-
expiresAt: z.string().datetime(),
|
|
80
|
-
plan: EcosystemExecutionPlanSchema,
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
export const EcosystemExecutionConfirmationResponseSchema = z.object({
|
|
84
|
-
confirmation: EcosystemExecutionConfirmationSchema,
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
export const EcosystemExecutionRequestSchema = z.discriminatedUnion("intent", [
|
|
88
|
-
z.object({ intent: z.literal("prepare") }),
|
|
89
|
-
z.object({
|
|
90
|
-
intent: z.literal("confirm"),
|
|
91
|
-
nonce: z.string().uuid(),
|
|
92
|
-
confirmation: z.literal(ECOSYSTEM_EXECUTION_CONFIRMATION_PHRASE),
|
|
93
|
-
}),
|
|
94
|
-
]);
|
|
95
|
-
|
|
96
|
-
export const EcosystemTaskStatusSchema = z.enum(["queued", "running", "succeeded", "failed"]);
|
|
97
|
-
|
|
98
|
-
export const EcosystemTaskSchema = z.object({
|
|
99
|
-
id: z.string(),
|
|
100
|
-
packageId: z.string(),
|
|
101
|
-
npmName: z.string(),
|
|
102
|
-
recipeId: z.string().nullable().default(null),
|
|
103
|
-
action: EcosystemTaskActionSchema,
|
|
104
|
-
status: EcosystemTaskStatusSchema,
|
|
105
|
-
command: z.string(),
|
|
106
|
-
output: z.string(),
|
|
107
|
-
createdAt: z.string(),
|
|
108
|
-
startedAt: z.string().nullable(),
|
|
109
|
-
finishedAt: z.string().nullable(),
|
|
110
|
-
exitCode: z.number().nullable(),
|
|
111
|
-
error: z.string().nullable(),
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
export const EcosystemTaskResponseSchema = z.object({
|
|
115
|
-
task: EcosystemTaskSchema,
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
export const EcosystemTasksResponseSchema = z.object({
|
|
119
|
-
tasks: z.array(EcosystemTaskSchema),
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
export type EcosystemPackageState = z.infer<typeof EcosystemPackageStateSchema>;
|
|
123
|
-
export type EcosystemPackage = z.infer<typeof EcosystemPackageSchema>;
|
|
124
|
-
export type EcosystemRunnerPreset = z.infer<typeof EcosystemRunnerPresetSchema>;
|
|
125
|
-
export type EcosystemRecipe = z.infer<typeof EcosystemRecipeSchema>;
|
|
126
|
-
export type EcosystemTaskAction = z.infer<typeof EcosystemTaskActionSchema>;
|
|
127
|
-
export type EcosystemExecutionPlan = z.infer<typeof EcosystemExecutionPlanSchema>;
|
|
128
|
-
export type EcosystemExecutionConfirmation = z.infer<typeof EcosystemExecutionConfirmationSchema>;
|
|
129
|
-
export type EcosystemTaskStatus = z.infer<typeof EcosystemTaskStatusSchema>;
|
|
130
|
-
export type EcosystemTask = z.infer<typeof EcosystemTaskSchema>;
|
package/src/lib/export-logs.ts
DELETED
|
@@ -1,287 +0,0 @@
|
|
|
1
|
-
import { LogBodyChunkSchema, type CapturedLog, type LogBodyPart } from "../contracts";
|
|
2
|
-
import { fetchWithTimeout } from "./apiClient";
|
|
3
|
-
import packageJson from "../../package.json";
|
|
4
|
-
import { isRecord } from "./unknown";
|
|
5
|
-
|
|
6
|
-
export type ExportMode = "redacted" | "raw";
|
|
7
|
-
export type ExportLogsResult =
|
|
8
|
-
| { ok: true }
|
|
9
|
-
| {
|
|
10
|
-
ok: false;
|
|
11
|
-
message: string;
|
|
12
|
-
canceled?: boolean;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const REDACTED = "[REDACTED]";
|
|
16
|
-
const SECRET_KEY_PATTERN =
|
|
17
|
-
/(^|[-_])(api[-_]?key|authorization|cookie|token|secret|password|access[-_]?token|refresh[-_]?token)([-_]|$)/i;
|
|
18
|
-
const SECRET_TEXT_PATTERNS: readonly RegExp[] = [
|
|
19
|
-
/Bearer\s+[A-Za-z0-9._~+/=-]{12,}/gi,
|
|
20
|
-
/\bsk-[A-Za-z0-9_-]{12,}\b/g,
|
|
21
|
-
/\bsk-ant-[A-Za-z0-9_-]{12,}\b/g,
|
|
22
|
-
/\bghp_[A-Za-z0-9_]{12,}\b/g,
|
|
23
|
-
/\bglpat-[A-Za-z0-9_-]{12,}\b/g,
|
|
24
|
-
];
|
|
25
|
-
const MAX_EXPORT_LOGS = 200;
|
|
26
|
-
const MAX_EXPORT_TEXT_CHARS = 25_000_000;
|
|
27
|
-
const MAX_STREAMING_CHUNK_EXPORTS = 50;
|
|
28
|
-
const STREAMING_CHUNK_EXPORT_TIMEOUT_MS = 10_000;
|
|
29
|
-
const BODY_EXPORT_CHUNK_BYTES = 1024 * 1024;
|
|
30
|
-
const MAX_BODY_EXPORT_CHUNKS = 64;
|
|
31
|
-
const BODY_EXPORT_TIMEOUT_MS = 10_000;
|
|
32
|
-
|
|
33
|
-
export type ExportManifest = {
|
|
34
|
-
version: string;
|
|
35
|
-
exportedAt: string;
|
|
36
|
-
mode: ExportMode;
|
|
37
|
-
redacted: boolean;
|
|
38
|
-
logCount: number;
|
|
39
|
-
logIds: number[];
|
|
40
|
-
streamingChunkExportLimit: number;
|
|
41
|
-
streamingChunkLogIds: number[];
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
function formatApproxSize(chars: number): string {
|
|
45
|
-
if (chars < 1024) return `${chars} chars`;
|
|
46
|
-
if (chars < 1024 * 1024) return `${Math.ceil(chars / 1024)} KB`;
|
|
47
|
-
return `${Math.ceil(chars / (1024 * 1024))} MB`;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function estimateExportTextChars(logs: readonly CapturedLog[]): number {
|
|
51
|
-
let total = 0;
|
|
52
|
-
for (const log of logs) {
|
|
53
|
-
total += log.rawRequestBody?.length ?? log.rawRequestBodyBytes ?? 0;
|
|
54
|
-
total += log.responseText?.length ?? log.responseTextBytes ?? 0;
|
|
55
|
-
}
|
|
56
|
-
return total;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function exportLimitMessage(logs: readonly CapturedLog[]): string | null {
|
|
60
|
-
if (logs.length > MAX_EXPORT_LOGS) {
|
|
61
|
-
return `Export is limited to ${MAX_EXPORT_LOGS} logs at once. Narrow the filter and try again.`;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
const estimatedChars = estimateExportTextChars(logs);
|
|
65
|
-
if (estimatedChars > MAX_EXPORT_TEXT_CHARS) {
|
|
66
|
-
return `Export is too large (${formatApproxSize(
|
|
67
|
-
estimatedChars,
|
|
68
|
-
)} of text). Narrow the filter and try again.`;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
type ExportLogsOptions = {
|
|
75
|
-
signal?: AbortSignal;
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
function exportCanceled(signal: AbortSignal | undefined): ExportLogsResult | null {
|
|
79
|
-
if (signal?.aborted === true) {
|
|
80
|
-
return { ok: false, message: "Export canceled.", canceled: true };
|
|
81
|
-
}
|
|
82
|
-
return null;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
async function fetchStreamingChunks(
|
|
86
|
-
logId: number,
|
|
87
|
-
signal: AbortSignal | undefined,
|
|
88
|
-
): Promise<string | null> {
|
|
89
|
-
try {
|
|
90
|
-
const response = await fetchWithTimeout(
|
|
91
|
-
`/api/logs/${logId}/chunks`,
|
|
92
|
-
STREAMING_CHUNK_EXPORT_TIMEOUT_MS,
|
|
93
|
-
{ signal },
|
|
94
|
-
);
|
|
95
|
-
if (!response.ok) return null;
|
|
96
|
-
const data: unknown = await response.json();
|
|
97
|
-
return JSON.stringify(data, null, 2);
|
|
98
|
-
} catch {
|
|
99
|
-
return null;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function existingBodyText(log: CapturedLog, part: LogBodyPart): string | null {
|
|
104
|
-
switch (part) {
|
|
105
|
-
case "request":
|
|
106
|
-
return log.rawRequestBody;
|
|
107
|
-
case "response":
|
|
108
|
-
return log.responseText;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export async function fetchLogBodyText(
|
|
113
|
-
log: CapturedLog,
|
|
114
|
-
part: LogBodyPart,
|
|
115
|
-
signal: AbortSignal | undefined,
|
|
116
|
-
): Promise<string | null> {
|
|
117
|
-
const existing = existingBodyText(log, part);
|
|
118
|
-
if (existing !== null) return existing;
|
|
119
|
-
|
|
120
|
-
let offset = 0;
|
|
121
|
-
let text = "";
|
|
122
|
-
for (let chunkIndex = 0; chunkIndex < MAX_BODY_EXPORT_CHUNKS; chunkIndex += 1) {
|
|
123
|
-
const params = new URLSearchParams({
|
|
124
|
-
part,
|
|
125
|
-
offset: String(offset),
|
|
126
|
-
limit: String(BODY_EXPORT_CHUNK_BYTES),
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
try {
|
|
130
|
-
const response = await fetchWithTimeout(
|
|
131
|
-
`/api/logs/${String(log.id)}/body?${params.toString()}`,
|
|
132
|
-
BODY_EXPORT_TIMEOUT_MS,
|
|
133
|
-
{ signal },
|
|
134
|
-
);
|
|
135
|
-
if (!response.ok) return text.length > 0 ? text : null;
|
|
136
|
-
|
|
137
|
-
const data: unknown = await response.json();
|
|
138
|
-
const chunk = LogBodyChunkSchema.safeParse(data);
|
|
139
|
-
if (!chunk.success) return text.length > 0 ? text : null;
|
|
140
|
-
|
|
141
|
-
text = `${text}${chunk.data.text}`;
|
|
142
|
-
if (!chunk.data.hasMore || chunk.data.nextOffset === null) {
|
|
143
|
-
return text.length > 0 ? text : null;
|
|
144
|
-
}
|
|
145
|
-
offset = chunk.data.nextOffset;
|
|
146
|
-
} catch {
|
|
147
|
-
return text.length > 0 ? text : null;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
return text.length > 0 ? text : null;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
function redactValue(value: unknown): unknown {
|
|
155
|
-
if (Array.isArray(value)) return value.map((item) => redactValue(item));
|
|
156
|
-
if (!isRecord(value)) return value;
|
|
157
|
-
|
|
158
|
-
const result: Record<string, unknown> = {};
|
|
159
|
-
for (const [key, item] of Object.entries(value)) {
|
|
160
|
-
result[key] = SECRET_KEY_PATTERN.test(key) ? REDACTED : redactValue(item);
|
|
161
|
-
}
|
|
162
|
-
return result;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
export function redactJsonText(text: string): string {
|
|
166
|
-
const redactText = (value: string): string => {
|
|
167
|
-
let result = value;
|
|
168
|
-
for (const pattern of SECRET_TEXT_PATTERNS) {
|
|
169
|
-
result = result.replace(pattern, REDACTED);
|
|
170
|
-
}
|
|
171
|
-
return result;
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
try {
|
|
175
|
-
const parsed: unknown = JSON.parse(text);
|
|
176
|
-
return redactText(JSON.stringify(redactValue(parsed), null, 2));
|
|
177
|
-
} catch {
|
|
178
|
-
return redactText(text);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
function exportText(text: string, mode: ExportMode): string {
|
|
183
|
-
return mode === "redacted" ? redactJsonText(text) : text;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
export function buildExportLogMetadata(log: CapturedLog, mode: ExportMode): CapturedLog {
|
|
187
|
-
return {
|
|
188
|
-
...log,
|
|
189
|
-
rawRequestBody: null,
|
|
190
|
-
responseText: null,
|
|
191
|
-
rawHeaders: mode === "raw" ? log.rawHeaders : undefined,
|
|
192
|
-
headers: mode === "raw" ? log.headers : undefined,
|
|
193
|
-
streamingChunks: undefined,
|
|
194
|
-
bodyContentMode: "compact",
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
export function buildExportManifest(
|
|
199
|
-
logs: readonly CapturedLog[],
|
|
200
|
-
mode: ExportMode,
|
|
201
|
-
streamingLogs: readonly CapturedLog[],
|
|
202
|
-
exportedAt: string = new Date().toISOString(),
|
|
203
|
-
): ExportManifest {
|
|
204
|
-
return {
|
|
205
|
-
version: packageJson.version,
|
|
206
|
-
exportedAt,
|
|
207
|
-
mode,
|
|
208
|
-
redacted: mode === "redacted",
|
|
209
|
-
logCount: logs.length,
|
|
210
|
-
logIds: logs.map((log) => log.id),
|
|
211
|
-
streamingChunkExportLimit: MAX_STREAMING_CHUNK_EXPORTS,
|
|
212
|
-
streamingChunkLogIds: streamingLogs.map((log) => log.id),
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
export async function exportLogsAsZip(
|
|
217
|
-
logs: CapturedLog[],
|
|
218
|
-
mode: ExportMode = "redacted",
|
|
219
|
-
options: ExportLogsOptions = {},
|
|
220
|
-
): Promise<ExportLogsResult> {
|
|
221
|
-
const initialCancel = exportCanceled(options.signal);
|
|
222
|
-
if (initialCancel !== null) return initialCancel;
|
|
223
|
-
|
|
224
|
-
const limitMessage = exportLimitMessage(logs);
|
|
225
|
-
if (limitMessage !== null) return { ok: false, message: limitMessage };
|
|
226
|
-
|
|
227
|
-
const { default: JSZip } = await import("jszip");
|
|
228
|
-
const zip = new JSZip();
|
|
229
|
-
const suffix = mode === "redacted" ? "redacted" : "raw";
|
|
230
|
-
const streamingLogs = logs.filter((log) => log.streaming).slice(0, MAX_STREAMING_CHUNK_EXPORTS);
|
|
231
|
-
zip.file(
|
|
232
|
-
"manifest.json",
|
|
233
|
-
JSON.stringify(buildExportManifest(logs, mode, streamingLogs), null, 2),
|
|
234
|
-
);
|
|
235
|
-
zip.file(
|
|
236
|
-
"logs.json",
|
|
237
|
-
JSON.stringify(
|
|
238
|
-
logs.map((log) => buildExportLogMetadata(log, mode)),
|
|
239
|
-
null,
|
|
240
|
-
2,
|
|
241
|
-
),
|
|
242
|
-
);
|
|
243
|
-
|
|
244
|
-
// Add regular request/response files
|
|
245
|
-
for (const log of logs) {
|
|
246
|
-
const canceled = exportCanceled(options.signal);
|
|
247
|
-
if (canceled !== null) return canceled;
|
|
248
|
-
|
|
249
|
-
const requestText = await fetchLogBodyText(log, "request", options.signal);
|
|
250
|
-
if (requestText !== null) {
|
|
251
|
-
zip.file(`#${log.id}.Request.json`, exportText(requestText, mode));
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
const responseText = await fetchLogBodyText(log, "response", options.signal);
|
|
255
|
-
if (responseText !== null) {
|
|
256
|
-
zip.file(`#${log.id}.Response.json`, exportText(responseText, mode));
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
// Fetch SSE chunks sequentially so exports do not spike browser memory.
|
|
261
|
-
for (const log of streamingLogs) {
|
|
262
|
-
const canceled = exportCanceled(options.signal);
|
|
263
|
-
if (canceled !== null) return canceled;
|
|
264
|
-
|
|
265
|
-
const chunks = await fetchStreamingChunks(log.id, options.signal);
|
|
266
|
-
if (chunks !== null) {
|
|
267
|
-
zip.file(`#${log.id}.SSE.Response.json`, exportText(chunks, mode));
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
// Generate and download ZIP
|
|
272
|
-
const blob = await zip.generateAsync({ type: "blob" });
|
|
273
|
-
const canceled = exportCanceled(options.signal);
|
|
274
|
-
if (canceled !== null) return canceled;
|
|
275
|
-
|
|
276
|
-
const url = URL.createObjectURL(blob);
|
|
277
|
-
|
|
278
|
-
const anchor = document.createElement("a");
|
|
279
|
-
anchor.href = url;
|
|
280
|
-
anchor.download = `agent-inspector-export-${suffix}-${new Date().toISOString().slice(0, 10)}.zip`;
|
|
281
|
-
document.body.appendChild(anchor);
|
|
282
|
-
anchor.click();
|
|
283
|
-
document.body.removeChild(anchor);
|
|
284
|
-
|
|
285
|
-
URL.revokeObjectURL(url);
|
|
286
|
-
return { ok: true };
|
|
287
|
-
}
|
package/src/lib/groupContract.ts
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { JsonValueSchema } from "../contracts";
|
|
3
|
-
import { EvidenceReportSchema, InspectorRunSchema, InspectorRunStatusSchema } from "./runContract";
|
|
4
|
-
import { SessionInfoSchema, SessionTokenUsageSchema } from "./sessionInfoContract";
|
|
5
|
-
|
|
6
|
-
export const InspectorGroupStatusSchema = z.enum([
|
|
7
|
-
"created",
|
|
8
|
-
"running",
|
|
9
|
-
"completed",
|
|
10
|
-
"failed",
|
|
11
|
-
"cancelled",
|
|
12
|
-
]);
|
|
13
|
-
|
|
14
|
-
export const InspectorGroupKindSchema = z.enum(["evaluation", "batch", "manual"]);
|
|
15
|
-
|
|
16
|
-
export const InspectorGroupEvidenceSchema = z.object({
|
|
17
|
-
jsonPath: z.string(),
|
|
18
|
-
markdownPath: z.string(),
|
|
19
|
-
htmlPath: z.string(),
|
|
20
|
-
exportedAt: z.string(),
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
export const InspectorGroupMemberSchema = z.object({
|
|
24
|
-
id: z.string(),
|
|
25
|
-
groupId: z.string(),
|
|
26
|
-
sessionId: z.string(),
|
|
27
|
-
runId: z.string().nullable(),
|
|
28
|
-
label: z.string().nullable(),
|
|
29
|
-
agent: z.string().nullable(),
|
|
30
|
-
provider: z.string().nullable(),
|
|
31
|
-
model: z.string().nullable(),
|
|
32
|
-
status: InspectorRunStatusSchema.nullable(),
|
|
33
|
-
metadata: z.record(z.string(), JsonValueSchema),
|
|
34
|
-
addedAt: z.string(),
|
|
35
|
-
updatedAt: z.string(),
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
export const InspectorGroupSchema = z.object({
|
|
39
|
-
id: z.string(),
|
|
40
|
-
title: z.string(),
|
|
41
|
-
kind: InspectorGroupKindSchema,
|
|
42
|
-
task: z.string().nullable(),
|
|
43
|
-
project: z.string().nullable(),
|
|
44
|
-
status: InspectorGroupStatusSchema,
|
|
45
|
-
tags: z.array(z.string()),
|
|
46
|
-
metadata: z.record(z.string(), JsonValueSchema),
|
|
47
|
-
evidence: InspectorGroupEvidenceSchema.nullable(),
|
|
48
|
-
members: z.array(InspectorGroupMemberSchema),
|
|
49
|
-
createdAt: z.string(),
|
|
50
|
-
updatedAt: z.string(),
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
export const CreateInspectorGroupInputSchema = z
|
|
54
|
-
.object({
|
|
55
|
-
groupId: z.string().min(1).optional(),
|
|
56
|
-
title: z.string().min(1).optional(),
|
|
57
|
-
kind: InspectorGroupKindSchema.optional(),
|
|
58
|
-
task: z.string().nullable().optional(),
|
|
59
|
-
project: z.string().nullable().optional(),
|
|
60
|
-
status: InspectorGroupStatusSchema.optional(),
|
|
61
|
-
tags: z.array(z.string()).optional(),
|
|
62
|
-
metadata: z.record(z.string(), JsonValueSchema).optional(),
|
|
63
|
-
})
|
|
64
|
-
.optional();
|
|
65
|
-
|
|
66
|
-
export const UpdateInspectorGroupInputSchema = z.object({
|
|
67
|
-
title: z.string().min(1).optional(),
|
|
68
|
-
kind: InspectorGroupKindSchema.optional(),
|
|
69
|
-
task: z.string().nullable().optional(),
|
|
70
|
-
project: z.string().nullable().optional(),
|
|
71
|
-
status: InspectorGroupStatusSchema.optional(),
|
|
72
|
-
tags: z.array(z.string()).optional(),
|
|
73
|
-
metadata: z.record(z.string(), JsonValueSchema).optional(),
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
export const AddInspectorGroupSessionInputSchema = z.object({
|
|
77
|
-
memberId: z.string().min(1).optional(),
|
|
78
|
-
sessionId: z.string().min(1),
|
|
79
|
-
runId: z.string().min(1).nullable().optional(),
|
|
80
|
-
label: z.string().min(1).nullable().optional(),
|
|
81
|
-
agent: z.string().min(1).nullable().optional(),
|
|
82
|
-
provider: z.string().min(1).nullable().optional(),
|
|
83
|
-
model: z.string().min(1).nullable().optional(),
|
|
84
|
-
status: InspectorRunStatusSchema.nullable().optional(),
|
|
85
|
-
metadata: z.record(z.string(), JsonValueSchema).optional(),
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
export const GroupEvidenceExportOptionsSchema = z
|
|
89
|
-
.object({
|
|
90
|
-
includeHistory: z.boolean().optional(),
|
|
91
|
-
latestLogLimit: z.number().int().positive().max(50).optional(),
|
|
92
|
-
})
|
|
93
|
-
.optional();
|
|
94
|
-
|
|
95
|
-
export const DeleteInspectorGroupOptionsSchema = z.object({
|
|
96
|
-
deleteEvidence: z.boolean().optional(),
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
export const DeleteInspectorGroupResponseSchema = z.object({
|
|
100
|
-
groupId: z.string(),
|
|
101
|
-
deleted: z.boolean(),
|
|
102
|
-
evidenceDeleted: z.boolean(),
|
|
103
|
-
evidencePath: z.string().nullable(),
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
export const DeleteInspectorGroupsResponseSchema = z.object({
|
|
107
|
-
deleted: z.number().int().nonnegative(),
|
|
108
|
-
groups: z.array(DeleteInspectorGroupResponseSchema),
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
export const InspectorGroupExportMemberSchema = z.object({
|
|
112
|
-
member: InspectorGroupMemberSchema,
|
|
113
|
-
run: InspectorRunSchema.nullable(),
|
|
114
|
-
session: SessionInfoSchema.nullable(),
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
export const InspectorGroupEvidenceSummarySchema = z.object({
|
|
118
|
-
memberCount: z.number().int().nonnegative(),
|
|
119
|
-
sessionsWithData: z.number().int().nonnegative(),
|
|
120
|
-
missingSessions: z.number().int().nonnegative(),
|
|
121
|
-
requestCount: z.number().int().nonnegative(),
|
|
122
|
-
errorCount: z.number().int().nonnegative(),
|
|
123
|
-
tokenUsage: SessionTokenUsageSchema,
|
|
124
|
-
models: z.array(z.string()),
|
|
125
|
-
providers: z.array(z.string()),
|
|
126
|
-
completedMembers: z.number().int().nonnegative(),
|
|
127
|
-
failedMembers: z.number().int().nonnegative(),
|
|
128
|
-
runningMembers: z.number().int().nonnegative(),
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
export const GroupEvidenceReadResponseSchema = z.object({
|
|
132
|
-
group: InspectorGroupSchema,
|
|
133
|
-
evidence: InspectorGroupEvidenceSchema,
|
|
134
|
-
members: z.array(InspectorGroupExportMemberSchema).nullable(),
|
|
135
|
-
markdown: z.string(),
|
|
136
|
-
summary: InspectorGroupEvidenceSummarySchema.nullable(),
|
|
137
|
-
report: EvidenceReportSchema.nullable(),
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
export const GroupEvidenceExportResultSchema = z.object({
|
|
141
|
-
group: InspectorGroupSchema,
|
|
142
|
-
evidence: InspectorGroupEvidenceSchema,
|
|
143
|
-
members: z.array(InspectorGroupExportMemberSchema),
|
|
144
|
-
summary: InspectorGroupEvidenceSummarySchema,
|
|
145
|
-
jenkinsReport: EvidenceReportSchema,
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
export const InspectorGroupsListResponseSchema = z.object({
|
|
149
|
-
groups: z.array(InspectorGroupSchema),
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
export type InspectorGroupEvidence = z.infer<typeof InspectorGroupEvidenceSchema>;
|
|
153
|
-
export type InspectorGroupMember = z.infer<typeof InspectorGroupMemberSchema>;
|
|
154
|
-
export type InspectorGroup = z.infer<typeof InspectorGroupSchema>;
|
|
155
|
-
export type CreateInspectorGroupInput = z.infer<typeof CreateInspectorGroupInputSchema>;
|
|
156
|
-
export type UpdateInspectorGroupInput = z.infer<typeof UpdateInspectorGroupInputSchema>;
|
|
157
|
-
export type AddInspectorGroupSessionInput = z.infer<typeof AddInspectorGroupSessionInputSchema>;
|
|
158
|
-
export type GroupEvidenceExportOptions = z.infer<typeof GroupEvidenceExportOptionsSchema>;
|
|
159
|
-
export type DeleteInspectorGroupOptions = z.infer<typeof DeleteInspectorGroupOptionsSchema>;
|
|
160
|
-
export type DeleteInspectorGroupResponse = z.infer<typeof DeleteInspectorGroupResponseSchema>;
|
|
161
|
-
export type DeleteInspectorGroupsResponse = z.infer<typeof DeleteInspectorGroupsResponseSchema>;
|
|
162
|
-
export type InspectorGroupExportMember = z.infer<typeof InspectorGroupExportMemberSchema>;
|
|
163
|
-
export type InspectorGroupEvidenceSummary = z.infer<typeof InspectorGroupEvidenceSummarySchema>;
|
|
164
|
-
export type GroupEvidenceReadResponse = z.infer<typeof GroupEvidenceReadResponseSchema>;
|
|
165
|
-
export type GroupEvidenceExportResult = z.infer<typeof GroupEvidenceExportResultSchema>;
|
|
166
|
-
export type InspectorGroupsListResponse = z.infer<typeof InspectorGroupsListResponseSchema>;
|