@tonyclaw/agent-inspector 3.1.32 → 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 +241 -120
- package/.output/server/_ssr/index.mjs +1 -1
- package/.output/server/_ssr/{router-oXUk3MBR.mjs → router-BBY_zWRK.mjs} +91 -3
- package/.output/server/index.mjs +1 -1
- package/.output/ui/assets/{CompareDrawer-BtfPSpkV.js → CompareDrawer-rtNElN-B.js} +1 -1
- package/.output/ui/assets/{InspectorPet-D9DPPQ3n.js → InspectorPet-QaAiuF3d.js} +1 -1
- package/.output/ui/assets/{ProxyViewerContainer-Buu8vkCK.js → ProxyViewerContainer-6twNZHwl.js} +4 -4
- package/.output/ui/assets/{ReplayDialog-BER-QzpD.js → ReplayDialog-B7KlziO2.js} +1 -1
- package/.output/ui/assets/{RequestAnatomy-C8Zwxrr7.js → RequestAnatomy-2XVFBrW4.js} +1 -1
- package/.output/ui/assets/{ResponseView-DDpKdYk6.js → ResponseView-BULgzLVB.js} +1 -1
- package/.output/ui/assets/{StreamingChunkSequence-sMPGG7Sw.js → StreamingChunkSequence-DSkvkbns.js} +1 -1
- package/.output/ui/assets/{_sessionId-e4IheHnP.js → _sessionId-D2dmJi3G.js} +1 -1
- package/.output/ui/assets/{_sessionId-C5Uv72Fx.js → _sessionId-DcS0s1Mr.js} +1 -1
- package/.output/ui/assets/{index-B__qT0Yd.js → index-B0TN1KKO.js} +2 -2
- package/.output/ui/assets/{index-Be3bTCzi.js → index-Bva1zHEs.js} +1 -1
- package/.output/ui/assets/{index-C9q__p8J.js → index-BzBExOxu.js} +1 -1
- package/.output/ui/assets/{index-CtB0deSZ.js → index-k6sRQz55.js} +1 -1
- package/.output/ui/assets/{json-viewer-Db0AFp-7.js → json-viewer-CWM4tY-j.js} +1 -1
- package/.output/ui/assets/{jszip.min-DkY0Ym_q.js → jszip.min-BkWvRFlo.js} +1 -1
- package/.output/ui/index.html +1 -1
- package/package.json +8 -13
- 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 -1397
- 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 -253
- 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,902 +0,0 @@
|
|
|
1
|
-
import { useCallback, useMemo, useState, type JSX } from "react";
|
|
2
|
-
import {
|
|
3
|
-
AlertTriangle,
|
|
4
|
-
Brain,
|
|
5
|
-
ChevronDown,
|
|
6
|
-
ChevronRight,
|
|
7
|
-
CircleCheck,
|
|
8
|
-
Clock,
|
|
9
|
-
FileSearch,
|
|
10
|
-
Loader2,
|
|
11
|
-
MessageSquare,
|
|
12
|
-
Pencil,
|
|
13
|
-
RefreshCw,
|
|
14
|
-
Save,
|
|
15
|
-
ShieldCheck,
|
|
16
|
-
UploadCloud,
|
|
17
|
-
Wrench,
|
|
18
|
-
X,
|
|
19
|
-
XCircle,
|
|
20
|
-
Zap,
|
|
21
|
-
} from "lucide-react";
|
|
22
|
-
import { z } from "zod";
|
|
23
|
-
import type { TimeDisplayFormat } from "../../lib/runtimeConfig";
|
|
24
|
-
import { formatTimestampRange } from "../../lib/timeDisplay";
|
|
25
|
-
import { cn, formatTokens } from "../../lib/utils";
|
|
26
|
-
import { fetchJsonWithTimeout, fetchWithTimeout } from "../../lib/apiClient";
|
|
27
|
-
import {
|
|
28
|
-
KnowledgeCandidateSchema,
|
|
29
|
-
type KnowledgeCandidate,
|
|
30
|
-
type KnowledgeCandidateStatus,
|
|
31
|
-
} from "../../knowledge/types";
|
|
32
|
-
import type { CapturedLog } from "../../contracts";
|
|
33
|
-
import { Badge } from "../ui/badge";
|
|
34
|
-
import { Button } from "../ui/button";
|
|
35
|
-
import { buildTraceSummary, extractToolTraceEvents, type TraceSummary } from "./viewerState";
|
|
36
|
-
|
|
37
|
-
const CandidateResponseSchema = z.object({
|
|
38
|
-
candidates: z.array(KnowledgeCandidateSchema),
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
const CandidatePromotionResponseSchema = z.object({
|
|
42
|
-
candidate: KnowledgeCandidateSchema,
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
const CandidatePromotionFailureResponseSchema = z.object({
|
|
46
|
-
error: z.string().optional(),
|
|
47
|
-
candidate: KnowledgeCandidateSchema.optional(),
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
const CandidateUpdateResponseSchema = z.object({
|
|
51
|
-
candidate: KnowledgeCandidateSchema,
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
type CandidateDraftUpdate = {
|
|
55
|
-
type: KnowledgeCandidate["type"];
|
|
56
|
-
title: string;
|
|
57
|
-
content: string;
|
|
58
|
-
tags: string[];
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
type CandidateLoadState =
|
|
62
|
-
| { status: "idle"; error: null }
|
|
63
|
-
| { status: "loading"; error: null }
|
|
64
|
-
| { status: "ready"; error: null }
|
|
65
|
-
| { status: "failed"; error: string };
|
|
66
|
-
|
|
67
|
-
const CANDIDATE_GENERATE_TIMEOUT_MS = 30_000;
|
|
68
|
-
const CANDIDATE_PROMOTE_TIMEOUT_MS = 15_000;
|
|
69
|
-
const CANDIDATE_UPDATE_TIMEOUT_MS = 15_000;
|
|
70
|
-
|
|
71
|
-
type TraceInsightKind = "session" | "tool" | "slow" | "failure" | "candidate";
|
|
72
|
-
|
|
73
|
-
type TraceInsight = {
|
|
74
|
-
kind: TraceInsightKind;
|
|
75
|
-
title: string;
|
|
76
|
-
detail: string;
|
|
77
|
-
logId: number | null;
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const CANDIDATE_STATUS_CLASSES: Record<KnowledgeCandidateStatus, string> = {
|
|
81
|
-
draft: "border-amber-500/30 bg-amber-500/10 text-amber-500",
|
|
82
|
-
promoted: "border-emerald-500/30 bg-emerald-500/10 text-emerald-500",
|
|
83
|
-
failed: "border-destructive/30 bg-destructive/10 text-destructive",
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
type AgentTraceSummaryProps = {
|
|
87
|
-
logs: CapturedLog[];
|
|
88
|
-
scopeId: string;
|
|
89
|
-
slowResponseThresholdSeconds: number;
|
|
90
|
-
showRollupMetrics: boolean;
|
|
91
|
-
timeDisplayFormat: TimeDisplayFormat;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
function formatElapsed(ms: number | null): string {
|
|
95
|
-
if (ms === null) return "-";
|
|
96
|
-
if (ms < 1000) return `${String(ms)}ms`;
|
|
97
|
-
return `${(ms / 1000).toFixed(1)}s`;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
function formatTimeRange(
|
|
101
|
-
startedAt: string | null,
|
|
102
|
-
endedAt: string | null,
|
|
103
|
-
timeDisplayFormat: TimeDisplayFormat,
|
|
104
|
-
): string | null {
|
|
105
|
-
if (startedAt === null || endedAt === null) return null;
|
|
106
|
-
return formatTimestampRange(startedAt, endedAt, timeDisplayFormat);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
function formatCandidateCount(count: number): string {
|
|
110
|
-
return `${String(count)} candidate${count === 1 ? "" : "s"}`;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
function getLogAnchor(logId: number): string {
|
|
114
|
-
return `log-${String(logId)}`;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function jumpToLog(logId: number): void {
|
|
118
|
-
const anchor = getLogAnchor(logId);
|
|
119
|
-
const target = document.getElementById(anchor);
|
|
120
|
-
window.history.replaceState(null, "", `#${anchor}`);
|
|
121
|
-
if (!(target instanceof HTMLElement)) return;
|
|
122
|
-
target.scrollIntoView({ block: "center", behavior: "smooth" });
|
|
123
|
-
target.focus({ preventScroll: true });
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
function firstFailureLog(logs: CapturedLog[]): CapturedLog | null {
|
|
127
|
-
for (const log of logs) {
|
|
128
|
-
if (log.responseStatus !== null && log.responseStatus >= 400) return log;
|
|
129
|
-
}
|
|
130
|
-
return null;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
function slowestLog(logs: CapturedLog[]): CapturedLog | null {
|
|
134
|
-
let current: CapturedLog | null = null;
|
|
135
|
-
let currentElapsed = -1;
|
|
136
|
-
for (const log of logs) {
|
|
137
|
-
if (log.elapsedMs === null) continue;
|
|
138
|
-
if (log.elapsedMs > currentElapsed) {
|
|
139
|
-
current = log;
|
|
140
|
-
currentElapsed = log.elapsedMs;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
return current;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
function firstToolLog(logs: CapturedLog[]): CapturedLog | null {
|
|
147
|
-
for (const log of logs) {
|
|
148
|
-
if (extractToolTraceEvents(log).length > 0) return log;
|
|
149
|
-
}
|
|
150
|
-
return null;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
function buildDisplayNumberByLogId(logs: readonly CapturedLog[]): Map<number, number> {
|
|
154
|
-
const result = new Map<number, number>();
|
|
155
|
-
for (let index = 0; index < logs.length; index += 1) {
|
|
156
|
-
const log = logs[index];
|
|
157
|
-
if (log === undefined) continue;
|
|
158
|
-
result.set(log.id, index + 1);
|
|
159
|
-
}
|
|
160
|
-
return result;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
function displayLogNumber(
|
|
164
|
-
logId: number,
|
|
165
|
-
displayNumberByLogId: ReadonlyMap<number, number>,
|
|
166
|
-
): string {
|
|
167
|
-
return String(displayNumberByLogId.get(logId) ?? logId);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
function buildTraceInsights(input: {
|
|
171
|
-
logs: CapturedLog[];
|
|
172
|
-
scopeId: string;
|
|
173
|
-
summary: TraceSummary;
|
|
174
|
-
candidates: KnowledgeCandidate[];
|
|
175
|
-
displayNumberByLogId: ReadonlyMap<number, number>;
|
|
176
|
-
}): TraceInsight[] {
|
|
177
|
-
const insights: TraceInsight[] = [
|
|
178
|
-
{
|
|
179
|
-
kind: "session",
|
|
180
|
-
title: `${String(input.summary.llmCallCount)} LLM call${
|
|
181
|
-
input.summary.llmCallCount === 1 ? "" : "s"
|
|
182
|
-
}`,
|
|
183
|
-
detail: `Scope ${input.scopeId}`,
|
|
184
|
-
logId: input.logs[0]?.id ?? null,
|
|
185
|
-
},
|
|
186
|
-
];
|
|
187
|
-
|
|
188
|
-
const toolLog = firstToolLog(input.logs);
|
|
189
|
-
if (input.summary.toolCallCount > 0 && toolLog !== null) {
|
|
190
|
-
insights.push({
|
|
191
|
-
kind: "tool",
|
|
192
|
-
title: `${String(input.summary.toolCallCount)} tool call${
|
|
193
|
-
input.summary.toolCallCount === 1 ? "" : "s"
|
|
194
|
-
}`,
|
|
195
|
-
detail: `First tool evidence at #${displayLogNumber(toolLog.id, input.displayNumberByLogId)}`,
|
|
196
|
-
logId: toolLog.id,
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
const failure = firstFailureLog(input.logs);
|
|
201
|
-
if (failure !== null) {
|
|
202
|
-
insights.push({
|
|
203
|
-
kind: "failure",
|
|
204
|
-
title: `Failure #${String(failure.responseStatus)}`,
|
|
205
|
-
detail: `First failed request is #${displayLogNumber(failure.id, input.displayNumberByLogId)}`,
|
|
206
|
-
logId: failure.id,
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
const slowest = slowestLog(input.logs);
|
|
211
|
-
if (slowest !== null && input.summary.maxElapsedMs !== null) {
|
|
212
|
-
insights.push({
|
|
213
|
-
kind: "slow",
|
|
214
|
-
title: `Slowest ${formatElapsed(input.summary.maxElapsedMs)}`,
|
|
215
|
-
detail: `Max latency observed at #${displayLogNumber(slowest.id, input.displayNumberByLogId)}`,
|
|
216
|
-
logId: slowest.id,
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
if (input.candidates.length > 0) {
|
|
221
|
-
const draftCount = input.candidates.filter((candidate) => candidate.status === "draft").length;
|
|
222
|
-
const promotedCount = input.candidates.filter(
|
|
223
|
-
(candidate) => candidate.status === "promoted",
|
|
224
|
-
).length;
|
|
225
|
-
insights.push({
|
|
226
|
-
kind: "candidate",
|
|
227
|
-
title: `${String(input.candidates.length)} memory candidate${
|
|
228
|
-
input.candidates.length === 1 ? "" : "s"
|
|
229
|
-
}`,
|
|
230
|
-
detail: `${String(draftCount)} draft / ${String(promotedCount)} promoted`,
|
|
231
|
-
logId: input.candidates[0]?.logIds[0] ?? null,
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
return insights;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
function insightIcon(kind: TraceInsightKind): JSX.Element {
|
|
239
|
-
switch (kind) {
|
|
240
|
-
case "session":
|
|
241
|
-
return <MessageSquare className="size-3.5 text-blue-400" />;
|
|
242
|
-
case "tool":
|
|
243
|
-
return <Wrench className="size-3.5 text-sky-400/70" />;
|
|
244
|
-
case "slow":
|
|
245
|
-
return <Clock className="size-3.5 text-amber-400" />;
|
|
246
|
-
case "failure":
|
|
247
|
-
return <XCircle className="size-3.5 text-destructive" />;
|
|
248
|
-
case "candidate":
|
|
249
|
-
return <Brain className="size-3.5 text-emerald-400" />;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
function TraceInsights({ insights }: { insights: TraceInsight[] }): JSX.Element | null {
|
|
254
|
-
if (insights.length === 0) return null;
|
|
255
|
-
return (
|
|
256
|
-
<div className="mt-2 grid gap-1.5 border-t border-border/70 pt-2 md:grid-cols-2 xl:grid-cols-3">
|
|
257
|
-
{insights.map((insight) => (
|
|
258
|
-
<button
|
|
259
|
-
key={`${insight.kind}-${insight.title}`}
|
|
260
|
-
type="button"
|
|
261
|
-
className={cn(
|
|
262
|
-
"flex min-w-0 items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs",
|
|
263
|
-
"text-muted-foreground transition-colors hover:bg-muted/40 hover:text-foreground",
|
|
264
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
265
|
-
)}
|
|
266
|
-
onClick={() => {
|
|
267
|
-
if (insight.logId !== null) jumpToLog(insight.logId);
|
|
268
|
-
}}
|
|
269
|
-
disabled={insight.logId === null}
|
|
270
|
-
>
|
|
271
|
-
{insightIcon(insight.kind)}
|
|
272
|
-
<span className="min-w-0">
|
|
273
|
-
<span className="block truncate font-medium text-foreground/90">{insight.title}</span>
|
|
274
|
-
<span className="block truncate font-mono text-[10px]">{insight.detail}</span>
|
|
275
|
-
</span>
|
|
276
|
-
</button>
|
|
277
|
-
))}
|
|
278
|
-
</div>
|
|
279
|
-
);
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
function candidateStatusLabel(status: KnowledgeCandidateStatus): string {
|
|
283
|
-
switch (status) {
|
|
284
|
-
case "draft":
|
|
285
|
-
return "Draft";
|
|
286
|
-
case "promoted":
|
|
287
|
-
return "Promoted";
|
|
288
|
-
case "failed":
|
|
289
|
-
return "Failed";
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
function candidatePromoteLabel(candidate: KnowledgeCandidate, promoting: boolean): string {
|
|
294
|
-
if (promoting) return "Promoting";
|
|
295
|
-
switch (candidate.status) {
|
|
296
|
-
case "draft":
|
|
297
|
-
return "Promote";
|
|
298
|
-
case "failed":
|
|
299
|
-
return "Retry";
|
|
300
|
-
case "promoted":
|
|
301
|
-
return "Promoted";
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
function redactionLabel(candidate: KnowledgeCandidate): string {
|
|
306
|
-
if (!candidate.redaction.redacted) return "No sensitive pattern matched";
|
|
307
|
-
return `Redacted ${candidate.redaction.patterns.join(", ")}`;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
function previewText(value: string, maxLength: number): string {
|
|
311
|
-
const normalized = value.replace(/\s+/g, " ").trim();
|
|
312
|
-
if (normalized.length <= maxLength) return normalized;
|
|
313
|
-
return `${normalized.slice(0, maxLength - 3)}...`;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
function logRangeLabel(
|
|
317
|
-
logIds: number[],
|
|
318
|
-
displayNumberByLogId: ReadonlyMap<number, number>,
|
|
319
|
-
): string {
|
|
320
|
-
const first = logIds[0];
|
|
321
|
-
const last = logIds[logIds.length - 1];
|
|
322
|
-
if (first === undefined) return "No evidence logs";
|
|
323
|
-
const firstLabel = displayLogNumber(first, displayNumberByLogId);
|
|
324
|
-
if (last === undefined || first === last) return `#${firstLabel}`;
|
|
325
|
-
return `#${firstLabel}-#${displayLogNumber(last, displayNumberByLogId)}`;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
function tagsToText(tags: string[]): string {
|
|
329
|
-
return tags.join(", ");
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
function textToTags(value: string): string[] {
|
|
333
|
-
return value
|
|
334
|
-
.split(",")
|
|
335
|
-
.map((tag) => tag.trim())
|
|
336
|
-
.filter((tag) => tag.length > 0);
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
function CandidateItem({
|
|
340
|
-
candidate,
|
|
341
|
-
isPromoting,
|
|
342
|
-
isUpdating,
|
|
343
|
-
onPromoteCandidate,
|
|
344
|
-
onUpdateCandidate,
|
|
345
|
-
displayNumberByLogId,
|
|
346
|
-
}: {
|
|
347
|
-
candidate: KnowledgeCandidate;
|
|
348
|
-
isPromoting: boolean;
|
|
349
|
-
isUpdating: boolean;
|
|
350
|
-
onPromoteCandidate: (candidateId: string) => void;
|
|
351
|
-
onUpdateCandidate: (candidateId: string, update: CandidateDraftUpdate) => Promise<boolean>;
|
|
352
|
-
displayNumberByLogId: ReadonlyMap<number, number>;
|
|
353
|
-
}): JSX.Element {
|
|
354
|
-
const [editing, setEditing] = useState(false);
|
|
355
|
-
const [draftType, setDraftType] = useState<KnowledgeCandidate["type"]>(candidate.type);
|
|
356
|
-
const [draftTitle, setDraftTitle] = useState(candidate.title);
|
|
357
|
-
const [draftContent, setDraftContent] = useState(candidate.content);
|
|
358
|
-
const [draftTags, setDraftTags] = useState(tagsToText(candidate.tags));
|
|
359
|
-
const [localError, setLocalError] = useState<string | null>(null);
|
|
360
|
-
const canPromote = candidate.status !== "promoted";
|
|
361
|
-
const canEdit = candidate.status !== "promoted";
|
|
362
|
-
|
|
363
|
-
const resetDraft = useCallback(() => {
|
|
364
|
-
setDraftType(candidate.type);
|
|
365
|
-
setDraftTitle(candidate.title);
|
|
366
|
-
setDraftContent(candidate.content);
|
|
367
|
-
setDraftTags(tagsToText(candidate.tags));
|
|
368
|
-
setLocalError(null);
|
|
369
|
-
}, [candidate.content, candidate.tags, candidate.title, candidate.type]);
|
|
370
|
-
|
|
371
|
-
const saveDraft = useCallback(async () => {
|
|
372
|
-
const title = draftTitle.trim();
|
|
373
|
-
const content = draftContent.trim();
|
|
374
|
-
const tags = textToTags(draftTags);
|
|
375
|
-
if (title.length === 0) {
|
|
376
|
-
setLocalError("Title is required.");
|
|
377
|
-
return;
|
|
378
|
-
}
|
|
379
|
-
if (content.length === 0) {
|
|
380
|
-
setLocalError("Content is required.");
|
|
381
|
-
return;
|
|
382
|
-
}
|
|
383
|
-
if (tags.length === 0) {
|
|
384
|
-
setLocalError("At least one tag is required.");
|
|
385
|
-
return;
|
|
386
|
-
}
|
|
387
|
-
setLocalError(null);
|
|
388
|
-
const saved = await onUpdateCandidate(candidate.id, {
|
|
389
|
-
type: draftType,
|
|
390
|
-
title,
|
|
391
|
-
content,
|
|
392
|
-
tags,
|
|
393
|
-
});
|
|
394
|
-
if (saved) setEditing(false);
|
|
395
|
-
}, [candidate.id, draftContent, draftTags, draftTitle, draftType, onUpdateCandidate]);
|
|
396
|
-
|
|
397
|
-
if (editing) {
|
|
398
|
-
return (
|
|
399
|
-
<div className="border border-border bg-card shadow-sm rounded-[8px] px-2.5 py-2">
|
|
400
|
-
<div className="grid gap-2">
|
|
401
|
-
<div className="flex flex-wrap items-center gap-2">
|
|
402
|
-
<select
|
|
403
|
-
value={draftType}
|
|
404
|
-
disabled={isUpdating}
|
|
405
|
-
onChange={(event) => {
|
|
406
|
-
const parsed = KnowledgeCandidateSchema.shape.type.safeParse(
|
|
407
|
-
event.currentTarget.value,
|
|
408
|
-
);
|
|
409
|
-
if (parsed.success) setDraftType(parsed.data);
|
|
410
|
-
}}
|
|
411
|
-
className="border border-input bg-background hover:bg-accent hover:text-accent-foreground h-7 rounded-md px-2 text-xs"
|
|
412
|
-
aria-label="Candidate type"
|
|
413
|
-
>
|
|
414
|
-
<option value="episode">episode</option>
|
|
415
|
-
<option value="procedure">procedure</option>
|
|
416
|
-
<option value="preference">preference</option>
|
|
417
|
-
<option value="project-fact">project-fact</option>
|
|
418
|
-
</select>
|
|
419
|
-
<input
|
|
420
|
-
value={draftTitle}
|
|
421
|
-
disabled={isUpdating}
|
|
422
|
-
onChange={(event) => setDraftTitle(event.currentTarget.value)}
|
|
423
|
-
className="border border-input bg-background hover:bg-accent hover:text-accent-foreground h-7 min-w-[220px] flex-1 rounded-md px-2 text-xs"
|
|
424
|
-
aria-label="Candidate title"
|
|
425
|
-
/>
|
|
426
|
-
</div>
|
|
427
|
-
<textarea
|
|
428
|
-
value={draftContent}
|
|
429
|
-
disabled={isUpdating}
|
|
430
|
-
onChange={(event) => setDraftContent(event.currentTarget.value)}
|
|
431
|
-
className="border border-input bg-background hover:bg-accent hover:text-accent-foreground min-h-28 rounded-md px-2 py-1.5 font-mono text-[11px] leading-relaxed"
|
|
432
|
-
aria-label="Candidate content"
|
|
433
|
-
/>
|
|
434
|
-
<input
|
|
435
|
-
value={draftTags}
|
|
436
|
-
disabled={isUpdating}
|
|
437
|
-
onChange={(event) => setDraftTags(event.currentTarget.value)}
|
|
438
|
-
className="border border-input bg-background hover:bg-accent hover:text-accent-foreground h-7 rounded-md px-2 text-xs"
|
|
439
|
-
aria-label="Candidate tags"
|
|
440
|
-
/>
|
|
441
|
-
<div className="flex flex-wrap items-center gap-2">
|
|
442
|
-
<span className="inline-flex items-center gap-1 text-[10px] text-muted-foreground">
|
|
443
|
-
<ShieldCheck className="size-3" />
|
|
444
|
-
Saving reruns Inspector redaction before promotion.
|
|
445
|
-
</span>
|
|
446
|
-
<span className="flex-1" />
|
|
447
|
-
{localError !== null && (
|
|
448
|
-
<span className="text-[10px] text-destructive">{localError}</span>
|
|
449
|
-
)}
|
|
450
|
-
<Button
|
|
451
|
-
type="button"
|
|
452
|
-
variant="ghost"
|
|
453
|
-
size="sm"
|
|
454
|
-
className="h-7 gap-1.5 px-2 text-xs"
|
|
455
|
-
disabled={isUpdating}
|
|
456
|
-
onClick={() => {
|
|
457
|
-
resetDraft();
|
|
458
|
-
setEditing(false);
|
|
459
|
-
}}
|
|
460
|
-
>
|
|
461
|
-
<X className="size-3.5" />
|
|
462
|
-
Cancel
|
|
463
|
-
</Button>
|
|
464
|
-
<Button
|
|
465
|
-
type="button"
|
|
466
|
-
variant="outline"
|
|
467
|
-
size="sm"
|
|
468
|
-
className="h-7 gap-1.5 px-2 text-xs"
|
|
469
|
-
disabled={isUpdating}
|
|
470
|
-
onClick={() => {
|
|
471
|
-
void saveDraft();
|
|
472
|
-
}}
|
|
473
|
-
>
|
|
474
|
-
{isUpdating ? (
|
|
475
|
-
<RefreshCw className="size-3.5 animate-spin" />
|
|
476
|
-
) : (
|
|
477
|
-
<Save className="size-3.5" />
|
|
478
|
-
)}
|
|
479
|
-
Save
|
|
480
|
-
</Button>
|
|
481
|
-
</div>
|
|
482
|
-
</div>
|
|
483
|
-
</div>
|
|
484
|
-
);
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
return (
|
|
488
|
-
<div className="rounded-md border border-border/80 bg-background/60 px-2.5 py-2">
|
|
489
|
-
<div className="flex min-w-0 items-center gap-2">
|
|
490
|
-
<Badge variant="outline" className="h-5 px-1.5 text-[10px] font-mono">
|
|
491
|
-
{candidate.type}
|
|
492
|
-
</Badge>
|
|
493
|
-
<span className="min-w-0 flex-1 truncate text-xs font-medium" title={candidate.title}>
|
|
494
|
-
{candidate.title}
|
|
495
|
-
</span>
|
|
496
|
-
<Badge
|
|
497
|
-
variant="outline"
|
|
498
|
-
className={cn(
|
|
499
|
-
"h-5 shrink-0 px-1.5 text-[10px] font-mono",
|
|
500
|
-
CANDIDATE_STATUS_CLASSES[candidate.status],
|
|
501
|
-
)}
|
|
502
|
-
>
|
|
503
|
-
{candidateStatusLabel(candidate.status)}
|
|
504
|
-
</Badge>
|
|
505
|
-
</div>
|
|
506
|
-
<p
|
|
507
|
-
className="mt-1 text-[11px] leading-relaxed text-muted-foreground"
|
|
508
|
-
title={candidate.content}
|
|
509
|
-
>
|
|
510
|
-
{previewText(candidate.content, 360)}
|
|
511
|
-
</p>
|
|
512
|
-
<div className="mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 text-[10px] text-muted-foreground">
|
|
513
|
-
<span className="inline-flex items-center gap-1">
|
|
514
|
-
<FileSearch className="size-3" />
|
|
515
|
-
{logRangeLabel(candidate.logIds, displayNumberByLogId)}
|
|
516
|
-
</span>
|
|
517
|
-
<span className="inline-flex items-center gap-1">
|
|
518
|
-
<ShieldCheck className="size-3" />
|
|
519
|
-
{redactionLabel(candidate)}
|
|
520
|
-
</span>
|
|
521
|
-
{candidate.status === "promoted" && (
|
|
522
|
-
<span className="inline-flex items-center gap-1 text-emerald-500">
|
|
523
|
-
<CircleCheck className="size-3" />
|
|
524
|
-
{candidate.openClawMemoryId ?? "OpenClaw"}
|
|
525
|
-
</span>
|
|
526
|
-
)}
|
|
527
|
-
{candidate.status === "failed" && candidate.error !== null && (
|
|
528
|
-
<span className="inline-flex items-center gap-1 text-destructive">
|
|
529
|
-
<XCircle className="size-3" />
|
|
530
|
-
{candidate.error}
|
|
531
|
-
</span>
|
|
532
|
-
)}
|
|
533
|
-
</div>
|
|
534
|
-
<div className="mt-1 flex flex-wrap items-center gap-1.5">
|
|
535
|
-
{candidate.logIds.map((logId) => {
|
|
536
|
-
const displayNumber = displayLogNumber(logId, displayNumberByLogId);
|
|
537
|
-
return (
|
|
538
|
-
<a
|
|
539
|
-
key={logId}
|
|
540
|
-
href={`#${getLogAnchor(logId)}`}
|
|
541
|
-
onClick={(event) => {
|
|
542
|
-
event.preventDefault();
|
|
543
|
-
jumpToLog(logId);
|
|
544
|
-
}}
|
|
545
|
-
className="rounded border border-blue-400/25 px-1.5 py-0.5 font-mono text-[10px] text-blue-400 underline-offset-2 transition-colors hover:bg-blue-400/10 hover:text-blue-300 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
546
|
-
aria-label={`Jump to evidence log ${displayNumber}`}
|
|
547
|
-
title={`Log ID ${String(logId)}`}
|
|
548
|
-
>
|
|
549
|
-
#{displayNumber}
|
|
550
|
-
</a>
|
|
551
|
-
);
|
|
552
|
-
})}
|
|
553
|
-
<span className="flex-1" />
|
|
554
|
-
{canEdit && (
|
|
555
|
-
<Button
|
|
556
|
-
type="button"
|
|
557
|
-
variant="ghost"
|
|
558
|
-
size="sm"
|
|
559
|
-
className="h-6 gap-1.5 px-2 text-[10px]"
|
|
560
|
-
disabled={isUpdating || isPromoting}
|
|
561
|
-
onClick={() => setEditing(true)}
|
|
562
|
-
>
|
|
563
|
-
<Pencil className="size-3" />
|
|
564
|
-
Review
|
|
565
|
-
</Button>
|
|
566
|
-
)}
|
|
567
|
-
<Button
|
|
568
|
-
type="button"
|
|
569
|
-
variant={canPromote ? "outline" : "ghost"}
|
|
570
|
-
size="sm"
|
|
571
|
-
className="h-6 gap-1.5 px-2 text-[10px]"
|
|
572
|
-
onClick={() => onPromoteCandidate(candidate.id)}
|
|
573
|
-
disabled={!canPromote || isPromoting || isUpdating}
|
|
574
|
-
>
|
|
575
|
-
{isPromoting ? (
|
|
576
|
-
<RefreshCw className="size-3 animate-spin" />
|
|
577
|
-
) : canPromote ? (
|
|
578
|
-
<UploadCloud className="size-3" />
|
|
579
|
-
) : (
|
|
580
|
-
<CircleCheck className="size-3" />
|
|
581
|
-
)}
|
|
582
|
-
{candidatePromoteLabel(candidate, isPromoting)}
|
|
583
|
-
</Button>
|
|
584
|
-
</div>
|
|
585
|
-
</div>
|
|
586
|
-
);
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
function CandidateList({
|
|
590
|
-
candidates,
|
|
591
|
-
promotingCandidateIds,
|
|
592
|
-
updatingCandidateIds,
|
|
593
|
-
onPromoteCandidate,
|
|
594
|
-
onUpdateCandidate,
|
|
595
|
-
displayNumberByLogId,
|
|
596
|
-
}: {
|
|
597
|
-
candidates: KnowledgeCandidate[];
|
|
598
|
-
promotingCandidateIds: ReadonlySet<string>;
|
|
599
|
-
updatingCandidateIds: ReadonlySet<string>;
|
|
600
|
-
onPromoteCandidate: (candidateId: string) => void;
|
|
601
|
-
onUpdateCandidate: (candidateId: string, update: CandidateDraftUpdate) => Promise<boolean>;
|
|
602
|
-
displayNumberByLogId: ReadonlyMap<number, number>;
|
|
603
|
-
}): JSX.Element | null {
|
|
604
|
-
if (candidates.length === 0) return null;
|
|
605
|
-
return (
|
|
606
|
-
<div className="mt-2 grid gap-1.5">
|
|
607
|
-
{candidates.map((candidate) => (
|
|
608
|
-
<CandidateItem
|
|
609
|
-
key={candidate.id}
|
|
610
|
-
candidate={candidate}
|
|
611
|
-
isPromoting={promotingCandidateIds.has(candidate.id)}
|
|
612
|
-
isUpdating={updatingCandidateIds.has(candidate.id)}
|
|
613
|
-
onPromoteCandidate={onPromoteCandidate}
|
|
614
|
-
onUpdateCandidate={onUpdateCandidate}
|
|
615
|
-
displayNumberByLogId={displayNumberByLogId}
|
|
616
|
-
/>
|
|
617
|
-
))}
|
|
618
|
-
</div>
|
|
619
|
-
);
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
export function AgentTraceSummary({
|
|
623
|
-
logs,
|
|
624
|
-
scopeId,
|
|
625
|
-
slowResponseThresholdSeconds,
|
|
626
|
-
showRollupMetrics,
|
|
627
|
-
timeDisplayFormat,
|
|
628
|
-
}: AgentTraceSummaryProps): JSX.Element | null {
|
|
629
|
-
const [candidates, setCandidates] = useState<KnowledgeCandidate[]>([]);
|
|
630
|
-
const [candidatesExpanded, setCandidatesExpanded] = useState(true);
|
|
631
|
-
const [candidateState, setCandidateState] = useState<CandidateLoadState>({
|
|
632
|
-
status: "idle",
|
|
633
|
-
error: null,
|
|
634
|
-
});
|
|
635
|
-
const [promotingCandidateIds, setPromotingCandidateIds] = useState<ReadonlySet<string>>(
|
|
636
|
-
() => new Set(),
|
|
637
|
-
);
|
|
638
|
-
const [updatingCandidateIds, setUpdatingCandidateIds] = useState<ReadonlySet<string>>(
|
|
639
|
-
() => new Set(),
|
|
640
|
-
);
|
|
641
|
-
const hasCandidates = candidates.length > 0;
|
|
642
|
-
const summary = useMemo(
|
|
643
|
-
() => buildTraceSummary(logs, slowResponseThresholdSeconds, candidates.length),
|
|
644
|
-
[candidates.length, logs, slowResponseThresholdSeconds],
|
|
645
|
-
);
|
|
646
|
-
const displayNumberByLogId = useMemo(() => buildDisplayNumberByLogId(logs), [logs]);
|
|
647
|
-
const traceInsights = useMemo(
|
|
648
|
-
() => buildTraceInsights({ logs, scopeId, summary, candidates, displayNumberByLogId }),
|
|
649
|
-
[candidates, displayNumberByLogId, logs, scopeId, summary],
|
|
650
|
-
);
|
|
651
|
-
const showElapsedSummary = showRollupMetrics || summary.maxElapsedMs !== null;
|
|
652
|
-
const timeRange = useMemo(
|
|
653
|
-
() => formatTimeRange(summary.startedAt, summary.endedAt, timeDisplayFormat),
|
|
654
|
-
[summary.endedAt, summary.startedAt, timeDisplayFormat],
|
|
655
|
-
);
|
|
656
|
-
|
|
657
|
-
const createCandidates = useCallback(() => {
|
|
658
|
-
if (logs.length === 0 || candidateState.status === "loading") return;
|
|
659
|
-
setCandidateState({ status: "loading", error: null });
|
|
660
|
-
void (async () => {
|
|
661
|
-
try {
|
|
662
|
-
const parsed = await fetchJsonWithTimeout(
|
|
663
|
-
`/api/knowledge/sessions/${encodeURIComponent(scopeId)}/candidates`,
|
|
664
|
-
CandidateResponseSchema,
|
|
665
|
-
CANDIDATE_GENERATE_TIMEOUT_MS,
|
|
666
|
-
{ method: "POST" },
|
|
667
|
-
(response) => `Candidate generation failed with ${String(response.status)}`,
|
|
668
|
-
);
|
|
669
|
-
setCandidates(parsed.candidates);
|
|
670
|
-
setCandidatesExpanded(parsed.candidates.length > 0);
|
|
671
|
-
setCandidateState(
|
|
672
|
-
parsed.candidates.length > 0
|
|
673
|
-
? { status: "ready", error: null }
|
|
674
|
-
: { status: "failed", error: "No candidate was generated for this trace scope." },
|
|
675
|
-
);
|
|
676
|
-
} catch (error) {
|
|
677
|
-
setCandidateState({
|
|
678
|
-
status: "failed",
|
|
679
|
-
error: error instanceof Error ? error.message : "Candidate response was invalid",
|
|
680
|
-
});
|
|
681
|
-
}
|
|
682
|
-
})();
|
|
683
|
-
}, [candidateState.status, logs.length, scopeId]);
|
|
684
|
-
|
|
685
|
-
const promoteCandidate = useCallback((candidateId: string) => {
|
|
686
|
-
setPromotingCandidateIds((current) => {
|
|
687
|
-
if (current.has(candidateId)) return current;
|
|
688
|
-
const next = new Set(current);
|
|
689
|
-
next.add(candidateId);
|
|
690
|
-
return next;
|
|
691
|
-
});
|
|
692
|
-
|
|
693
|
-
void (async () => {
|
|
694
|
-
try {
|
|
695
|
-
const response = await fetchWithTimeout(
|
|
696
|
-
`/api/knowledge/candidates/${encodeURIComponent(candidateId)}/promote`,
|
|
697
|
-
CANDIDATE_PROMOTE_TIMEOUT_MS,
|
|
698
|
-
{ method: "POST" },
|
|
699
|
-
);
|
|
700
|
-
const raw: unknown = await response.json().catch(() => null);
|
|
701
|
-
const parsed = CandidatePromotionResponseSchema.safeParse(raw);
|
|
702
|
-
if (response.ok && parsed.success) {
|
|
703
|
-
setCandidates((current) =>
|
|
704
|
-
current.map((candidate) =>
|
|
705
|
-
candidate.id === parsed.data.candidate.id ? parsed.data.candidate : candidate,
|
|
706
|
-
),
|
|
707
|
-
);
|
|
708
|
-
setCandidateState({ status: "ready", error: null });
|
|
709
|
-
return;
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
const failure = CandidatePromotionFailureResponseSchema.safeParse(raw);
|
|
713
|
-
if (failure.success && failure.data.candidate !== undefined) {
|
|
714
|
-
setCandidates((current) =>
|
|
715
|
-
current.map((candidate) =>
|
|
716
|
-
candidate.id === failure.data.candidate?.id ? failure.data.candidate : candidate,
|
|
717
|
-
),
|
|
718
|
-
);
|
|
719
|
-
}
|
|
720
|
-
setCandidateState({
|
|
721
|
-
status: "failed",
|
|
722
|
-
error: failure.success
|
|
723
|
-
? (failure.data.error ?? "Candidate promotion failed")
|
|
724
|
-
: `Candidate promotion failed with ${String(response.status)}`,
|
|
725
|
-
});
|
|
726
|
-
} catch (error) {
|
|
727
|
-
setCandidateState({
|
|
728
|
-
status: "failed",
|
|
729
|
-
error: error instanceof Error ? error.message : "Candidate promotion failed",
|
|
730
|
-
});
|
|
731
|
-
} finally {
|
|
732
|
-
setPromotingCandidateIds((current) => {
|
|
733
|
-
const next = new Set(current);
|
|
734
|
-
next.delete(candidateId);
|
|
735
|
-
return next;
|
|
736
|
-
});
|
|
737
|
-
}
|
|
738
|
-
})();
|
|
739
|
-
}, []);
|
|
740
|
-
|
|
741
|
-
const updateCandidate = useCallback(
|
|
742
|
-
async (candidateId: string, update: CandidateDraftUpdate): Promise<boolean> => {
|
|
743
|
-
setUpdatingCandidateIds((current) => {
|
|
744
|
-
if (current.has(candidateId)) return current;
|
|
745
|
-
const next = new Set(current);
|
|
746
|
-
next.add(candidateId);
|
|
747
|
-
return next;
|
|
748
|
-
});
|
|
749
|
-
|
|
750
|
-
try {
|
|
751
|
-
const parsed = await fetchJsonWithTimeout(
|
|
752
|
-
`/api/knowledge/candidates/${encodeURIComponent(candidateId)}`,
|
|
753
|
-
CandidateUpdateResponseSchema,
|
|
754
|
-
CANDIDATE_UPDATE_TIMEOUT_MS,
|
|
755
|
-
{
|
|
756
|
-
method: "PATCH",
|
|
757
|
-
headers: { "Content-Type": "application/json" },
|
|
758
|
-
body: JSON.stringify(update),
|
|
759
|
-
},
|
|
760
|
-
(response) => `Candidate update failed with ${String(response.status)}`,
|
|
761
|
-
);
|
|
762
|
-
setCandidates((current) =>
|
|
763
|
-
current.map((candidate) =>
|
|
764
|
-
candidate.id === parsed.candidate.id ? parsed.candidate : candidate,
|
|
765
|
-
),
|
|
766
|
-
);
|
|
767
|
-
setCandidateState({ status: "ready", error: null });
|
|
768
|
-
return true;
|
|
769
|
-
} catch (error) {
|
|
770
|
-
setCandidateState({
|
|
771
|
-
status: "failed",
|
|
772
|
-
error: error instanceof Error ? error.message : "Candidate update failed",
|
|
773
|
-
});
|
|
774
|
-
return false;
|
|
775
|
-
} finally {
|
|
776
|
-
setUpdatingCandidateIds((current) => {
|
|
777
|
-
const next = new Set(current);
|
|
778
|
-
next.delete(candidateId);
|
|
779
|
-
return next;
|
|
780
|
-
});
|
|
781
|
-
}
|
|
782
|
-
},
|
|
783
|
-
[],
|
|
784
|
-
);
|
|
785
|
-
|
|
786
|
-
if (logs.length === 0) return null;
|
|
787
|
-
|
|
788
|
-
return (
|
|
789
|
-
<section className="border border-border bg-card shadow-sm mb-2 rounded-[8px] px-3 py-2">
|
|
790
|
-
<div className="flex flex-wrap items-center gap-x-3 gap-y-2 text-xs">
|
|
791
|
-
{showRollupMetrics && (
|
|
792
|
-
<span className="inline-flex items-center gap-1.5 font-semibold text-foreground">
|
|
793
|
-
<MessageSquare className="size-3.5 text-blue-400" />
|
|
794
|
-
{summary.llmCallCount} LLM
|
|
795
|
-
</span>
|
|
796
|
-
)}
|
|
797
|
-
<span className="inline-flex items-center gap-1.5 text-muted-foreground">
|
|
798
|
-
<Wrench className="size-3.5 text-sky-400/70" />
|
|
799
|
-
{summary.toolCallCount} tools
|
|
800
|
-
</span>
|
|
801
|
-
{showRollupMetrics && (
|
|
802
|
-
<span className="inline-flex items-center gap-1.5 text-muted-foreground">
|
|
803
|
-
<Zap className="size-3.5 text-emerald-400" />
|
|
804
|
-
<span className="font-mono">
|
|
805
|
-
{formatTokens(summary.totalInputTokens)} / {formatTokens(summary.totalOutputTokens)}
|
|
806
|
-
</span>
|
|
807
|
-
</span>
|
|
808
|
-
)}
|
|
809
|
-
{(summary.totalCacheCreationInputTokens > 0 || summary.totalCacheReadInputTokens > 0) && (
|
|
810
|
-
<span className="inline-flex items-center gap-1.5 text-muted-foreground">
|
|
811
|
-
<Zap className="size-3.5 text-purple-400" />
|
|
812
|
-
<span className="font-mono">
|
|
813
|
-
KV Cache +{formatTokens(summary.totalCacheCreationInputTokens)} / ~
|
|
814
|
-
{formatTokens(summary.totalCacheReadInputTokens)}
|
|
815
|
-
</span>
|
|
816
|
-
</span>
|
|
817
|
-
)}
|
|
818
|
-
{showElapsedSummary && (
|
|
819
|
-
<span className="inline-flex items-center gap-1.5 text-muted-foreground">
|
|
820
|
-
<Clock className="size-3.5" />
|
|
821
|
-
{showRollupMetrics && (
|
|
822
|
-
<span className="font-mono">{formatElapsed(summary.totalElapsedMs)}</span>
|
|
823
|
-
)}
|
|
824
|
-
{summary.maxElapsedMs !== null && (
|
|
825
|
-
<span className="font-mono text-muted-foreground/70">
|
|
826
|
-
max {formatElapsed(summary.maxElapsedMs)}
|
|
827
|
-
</span>
|
|
828
|
-
)}
|
|
829
|
-
</span>
|
|
830
|
-
)}
|
|
831
|
-
{showRollupMetrics && timeRange !== null && (
|
|
832
|
-
<span className="font-mono text-muted-foreground/70">{timeRange}</span>
|
|
833
|
-
)}
|
|
834
|
-
{(summary.failedCallCount > 0 ||
|
|
835
|
-
summary.pendingCallCount > 0 ||
|
|
836
|
-
summary.slowCallCount > 0) && (
|
|
837
|
-
<span className="inline-flex items-center gap-1.5 text-amber-400">
|
|
838
|
-
<AlertTriangle className="size-3.5" />
|
|
839
|
-
<span className="font-mono">
|
|
840
|
-
{summary.failedCallCount} fail / {summary.pendingCallCount} pending /{" "}
|
|
841
|
-
{summary.slowCallCount} slow
|
|
842
|
-
</span>
|
|
843
|
-
</span>
|
|
844
|
-
)}
|
|
845
|
-
<span className="flex-1" />
|
|
846
|
-
{hasCandidates && (
|
|
847
|
-
<Badge variant="outline" className="h-6 px-2 text-[10px] font-mono">
|
|
848
|
-
{formatCandidateCount(summary.knowledgeCandidateCount)}
|
|
849
|
-
</Badge>
|
|
850
|
-
)}
|
|
851
|
-
<Button
|
|
852
|
-
type="button"
|
|
853
|
-
variant="outline"
|
|
854
|
-
size="sm"
|
|
855
|
-
className="h-7 gap-1.5 px-2 text-xs"
|
|
856
|
-
onClick={createCandidates}
|
|
857
|
-
disabled={candidateState.status === "loading"}
|
|
858
|
-
>
|
|
859
|
-
{candidateState.status === "loading" ? (
|
|
860
|
-
<Loader2 className="size-3.5 animate-spin" />
|
|
861
|
-
) : (
|
|
862
|
-
<Brain className="size-3.5" />
|
|
863
|
-
)}
|
|
864
|
-
Candidate
|
|
865
|
-
</Button>
|
|
866
|
-
{hasCandidates && (
|
|
867
|
-
<Button
|
|
868
|
-
type="button"
|
|
869
|
-
variant="ghost"
|
|
870
|
-
size="icon"
|
|
871
|
-
className="size-7 text-muted-foreground"
|
|
872
|
-
onClick={() => setCandidatesExpanded((value) => !value)}
|
|
873
|
-
aria-expanded={candidatesExpanded}
|
|
874
|
-
aria-label={
|
|
875
|
-
candidatesExpanded ? "Collapse memory candidates" : "Expand memory candidates"
|
|
876
|
-
}
|
|
877
|
-
>
|
|
878
|
-
{candidatesExpanded ? (
|
|
879
|
-
<ChevronDown className="size-3.5" />
|
|
880
|
-
) : (
|
|
881
|
-
<ChevronRight className="size-3.5" />
|
|
882
|
-
)}
|
|
883
|
-
</Button>
|
|
884
|
-
)}
|
|
885
|
-
</div>
|
|
886
|
-
{candidateState.status === "failed" && (
|
|
887
|
-
<p className="mt-2 text-xs text-destructive">{candidateState.error}</p>
|
|
888
|
-
)}
|
|
889
|
-
<TraceInsights insights={traceInsights} />
|
|
890
|
-
{candidatesExpanded && (
|
|
891
|
-
<CandidateList
|
|
892
|
-
candidates={candidates}
|
|
893
|
-
promotingCandidateIds={promotingCandidateIds}
|
|
894
|
-
updatingCandidateIds={updatingCandidateIds}
|
|
895
|
-
onPromoteCandidate={promoteCandidate}
|
|
896
|
-
onUpdateCandidate={updateCandidate}
|
|
897
|
-
displayNumberByLogId={displayNumberByLogId}
|
|
898
|
-
/>
|
|
899
|
-
)}
|
|
900
|
-
</section>
|
|
901
|
-
);
|
|
902
|
-
}
|