@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,446 +0,0 @@
|
|
|
1
|
-
import { BrainCircuit, Loader2, RotateCcw, Send, Sparkles } from "lucide-react";
|
|
2
|
-
import { useMemo, useState, type ChangeEvent, type JSX } from "react";
|
|
3
|
-
import {
|
|
4
|
-
buildPiAgentHistory,
|
|
5
|
-
createEmptyPiAgentConversation,
|
|
6
|
-
getPiAgentResultLogIds,
|
|
7
|
-
normalizePiAgentResponse,
|
|
8
|
-
PI_AGENT_STARTERS,
|
|
9
|
-
type PiAgentConversationMessage,
|
|
10
|
-
type PiAgentEvidenceView,
|
|
11
|
-
type PiAgentMetricView,
|
|
12
|
-
type PiAgentResponseView,
|
|
13
|
-
} from "./piAgentChatLogic";
|
|
14
|
-
import { useProviders } from "../../lib/useProviders";
|
|
15
|
-
import { fetchControl } from "../../lib/apiClient";
|
|
16
|
-
import { dispatchLogFocusRequest } from "../proxy-viewer/logFocus";
|
|
17
|
-
import { AnswerMarkdown } from "../proxy-viewer/AnswerMarkdown";
|
|
18
|
-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../ui/select";
|
|
19
|
-
|
|
20
|
-
type PiAgentPanelProps = {
|
|
21
|
-
currentSessionId: string | null;
|
|
22
|
-
logCount: number;
|
|
23
|
-
onResultChange: (result: PiAgentSearchResult | null) => void;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export type PiAgentSearchResult = {
|
|
27
|
-
question: string;
|
|
28
|
-
logIds: number[];
|
|
29
|
-
reportedLogCount: number;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const DEFAULT_QUESTION = "What looks abnormal, slow, or likely to hang?";
|
|
33
|
-
|
|
34
|
-
function providerSupportsPiAgent(provider: {
|
|
35
|
-
anthropicBaseUrl?: string;
|
|
36
|
-
openaiBaseUrl?: string;
|
|
37
|
-
openaiResponsesBaseUrl?: string;
|
|
38
|
-
}): boolean {
|
|
39
|
-
return (
|
|
40
|
-
provider.openaiResponsesBaseUrl !== undefined ||
|
|
41
|
-
provider.openaiBaseUrl !== undefined ||
|
|
42
|
-
provider.anthropicBaseUrl !== undefined
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function providerProtocolLabel(provider: {
|
|
47
|
-
anthropicBaseUrl?: string;
|
|
48
|
-
openaiBaseUrl?: string;
|
|
49
|
-
openaiResponsesBaseUrl?: string;
|
|
50
|
-
}): string {
|
|
51
|
-
if (provider.openaiResponsesBaseUrl !== undefined && provider.openaiResponsesBaseUrl !== "") {
|
|
52
|
-
return "Responses";
|
|
53
|
-
}
|
|
54
|
-
if (provider.openaiBaseUrl !== undefined && provider.openaiBaseUrl !== "") {
|
|
55
|
-
return "Chat";
|
|
56
|
-
}
|
|
57
|
-
return "Anthropic";
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function sortProviderBySource<T extends { name: string; source?: "company" | "personal" }>(
|
|
61
|
-
providers: readonly T[],
|
|
62
|
-
): T[] {
|
|
63
|
-
return providers.toSorted((left, right) => {
|
|
64
|
-
const leftCompanyRank = left.source === "company" ? 0 : 1;
|
|
65
|
-
const rightCompanyRank = right.source === "company" ? 0 : 1;
|
|
66
|
-
if (leftCompanyRank !== rightCompanyRank) return leftCompanyRank - rightCompanyRank;
|
|
67
|
-
return left.name.localeCompare(right.name);
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function nextMessageId(role: "user" | "assistant"): string {
|
|
72
|
-
return `${role}-${String(Date.now())}-${String(Math.random()).slice(2)}`;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function TerminalLabel({
|
|
76
|
-
label,
|
|
77
|
-
value,
|
|
78
|
-
tone = "muted",
|
|
79
|
-
}: {
|
|
80
|
-
label: string;
|
|
81
|
-
value?: string;
|
|
82
|
-
tone?: "cyan" | "muted";
|
|
83
|
-
}): JSX.Element {
|
|
84
|
-
return (
|
|
85
|
-
<div className="flex min-w-0 items-center gap-1.5 font-mono text-[10px]">
|
|
86
|
-
<span className={tone === "cyan" ? "text-cyan-100" : "text-muted-foreground"}>{label}</span>
|
|
87
|
-
{value !== undefined && (
|
|
88
|
-
<>
|
|
89
|
-
<span className="text-muted-foreground/55">:</span>
|
|
90
|
-
<span className="truncate text-muted-foreground">{value}</span>
|
|
91
|
-
</>
|
|
92
|
-
)}
|
|
93
|
-
</div>
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
function MetricStrip({ metrics }: { metrics: readonly PiAgentMetricView[] }): JSX.Element | null {
|
|
98
|
-
if (metrics.length === 0) return null;
|
|
99
|
-
return (
|
|
100
|
-
<div className="grid grid-cols-2 gap-1.5">
|
|
101
|
-
{metrics.slice(0, 8).map((metric) => (
|
|
102
|
-
<div
|
|
103
|
-
key={metric.key}
|
|
104
|
-
className="rounded-sm bg-black/25 px-2 py-1 shadow-[inset_2px_0_0_rgba(103,232,249,0.22)]"
|
|
105
|
-
>
|
|
106
|
-
<div className="truncate font-mono text-[9px] text-muted-foreground">{metric.label}</div>
|
|
107
|
-
<div className="truncate font-mono text-[11px] text-cyan-50/95">{metric.value}</div>
|
|
108
|
-
</div>
|
|
109
|
-
))}
|
|
110
|
-
</div>
|
|
111
|
-
);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
function EvidenceCard({ evidence }: { evidence: PiAgentEvidenceView }): JSX.Element {
|
|
115
|
-
const openLog = (): void => {
|
|
116
|
-
if (evidence.logId === null) return;
|
|
117
|
-
dispatchLogFocusRequest({ logId: evidence.logId, tab: "anatomy" });
|
|
118
|
-
};
|
|
119
|
-
const title =
|
|
120
|
-
evidence.logId === null
|
|
121
|
-
? `${evidence.source}:${evidence.id}`
|
|
122
|
-
: `${evidence.source}:log #${String(evidence.logId)}`;
|
|
123
|
-
|
|
124
|
-
return (
|
|
125
|
-
<button
|
|
126
|
-
type="button"
|
|
127
|
-
onClick={openLog}
|
|
128
|
-
disabled={evidence.logId === null}
|
|
129
|
-
className="w-full rounded-sm bg-black/25 px-2 py-2 text-left shadow-[inset_2px_0_0_rgba(103,232,249,0.22),inset_0_0_0_1px_rgba(255,255,255,0.045)] transition-colors hover:bg-black/35 disabled:cursor-default disabled:hover:bg-black/25"
|
|
130
|
-
>
|
|
131
|
-
<div className="flex min-w-0 items-center justify-between gap-2">
|
|
132
|
-
<span className="truncate font-mono text-[10px] text-cyan-100">{title}</span>
|
|
133
|
-
{evidence.score !== null && (
|
|
134
|
-
<span className="shrink-0 font-mono text-[9px] text-muted-foreground">
|
|
135
|
-
{evidence.score.toFixed(1)}
|
|
136
|
-
</span>
|
|
137
|
-
)}
|
|
138
|
-
</div>
|
|
139
|
-
<div className="mt-1 flex flex-wrap gap-x-2 gap-y-1 text-[10px] text-muted-foreground">
|
|
140
|
-
{evidence.providerName !== null && <span>{evidence.providerName}</span>}
|
|
141
|
-
{evidence.model !== null && <span>{evidence.model}</span>}
|
|
142
|
-
{evidence.status !== null && <span>status {String(evidence.status)}</span>}
|
|
143
|
-
{evidence.elapsedMs !== null && <span>{String(evidence.elapsedMs)} ms</span>}
|
|
144
|
-
</div>
|
|
145
|
-
<p className="mt-1 line-clamp-3 text-[11px] leading-4 text-foreground/85">
|
|
146
|
-
{evidence.excerpt}
|
|
147
|
-
</p>
|
|
148
|
-
</button>
|
|
149
|
-
);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
function AssistantMessage({ response }: { response: PiAgentResponseView }): JSX.Element {
|
|
153
|
-
return (
|
|
154
|
-
<div className="overflow-hidden rounded-md bg-[#050b12]/85 shadow-[inset_0_0_0_1px_rgba(103,232,249,0.12),0_10px_24px_rgba(0,0,0,0.18)]">
|
|
155
|
-
<div className="flex min-w-0 items-center justify-between gap-2 border-b border-cyan-100/[0.08] bg-cyan-400/[0.045] px-3 py-2">
|
|
156
|
-
<TerminalLabel label="assistant@inspector" value="output" tone="cyan" />
|
|
157
|
-
<span className="shrink-0 font-mono text-[9px] text-muted-foreground">
|
|
158
|
-
{String(response.logCount)} logs
|
|
159
|
-
</span>
|
|
160
|
-
</div>
|
|
161
|
-
<div className="space-y-3 p-3">
|
|
162
|
-
<div className="rounded-sm bg-black/20 px-2.5 py-2 text-xs leading-5 shadow-[inset_2px_0_0_rgba(103,232,249,0.28)]">
|
|
163
|
-
<AnswerMarkdown text={response.answer} />
|
|
164
|
-
</div>
|
|
165
|
-
<div className="grid gap-1.5 rounded-sm bg-black/20 px-2 py-1.5">
|
|
166
|
-
<TerminalLabel label="provider" value={response.providerName} />
|
|
167
|
-
<TerminalLabel label="model" value={response.model} />
|
|
168
|
-
<TerminalLabel label="protocol" value={response.protocol} />
|
|
169
|
-
</div>
|
|
170
|
-
{(response.summaryMetrics.length > 0 || response.queryMetrics.length > 0) && (
|
|
171
|
-
<div className="space-y-1.5">
|
|
172
|
-
<TerminalLabel label="metrics" tone="cyan" />
|
|
173
|
-
<MetricStrip metrics={[...response.summaryMetrics, ...response.queryMetrics]} />
|
|
174
|
-
</div>
|
|
175
|
-
)}
|
|
176
|
-
{response.evidence.length > 0 && (
|
|
177
|
-
<div className="space-y-1.5">
|
|
178
|
-
<TerminalLabel label="evidence" value="click to inspect source log" tone="cyan" />
|
|
179
|
-
{response.evidence.slice(0, 6).map((evidence) => (
|
|
180
|
-
<EvidenceCard key={`${evidence.source}-${evidence.id}`} evidence={evidence} />
|
|
181
|
-
))}
|
|
182
|
-
</div>
|
|
183
|
-
)}
|
|
184
|
-
</div>
|
|
185
|
-
</div>
|
|
186
|
-
);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
function ConversationMessage({ message }: { message: PiAgentConversationMessage }): JSX.Element {
|
|
190
|
-
if (message.role === "assistant" && message.response !== null) {
|
|
191
|
-
return <AssistantMessage response={message.response} />;
|
|
192
|
-
}
|
|
193
|
-
return (
|
|
194
|
-
<div className="overflow-hidden rounded-md bg-black/25 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.055)]">
|
|
195
|
-
<div className="border-b border-white/[0.06] px-3 py-1.5">
|
|
196
|
-
<TerminalLabel label="user@inspector" value="query" tone="cyan" />
|
|
197
|
-
</div>
|
|
198
|
-
<div className="px-3 py-2 font-mono text-[11px] leading-5 text-cyan-50">
|
|
199
|
-
<span className="select-none text-cyan-100/60">> </span>
|
|
200
|
-
{message.content}
|
|
201
|
-
</div>
|
|
202
|
-
</div>
|
|
203
|
-
);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
export function PiAgentPanel({
|
|
207
|
-
currentSessionId,
|
|
208
|
-
logCount,
|
|
209
|
-
onResultChange,
|
|
210
|
-
}: PiAgentPanelProps): JSX.Element | null {
|
|
211
|
-
const { providers } = useProviders();
|
|
212
|
-
const piProviders = useMemo(
|
|
213
|
-
() => sortProviderBySource(providers.filter(providerSupportsPiAgent)),
|
|
214
|
-
[providers],
|
|
215
|
-
);
|
|
216
|
-
const [conversation, setConversation] = useState(() => ({
|
|
217
|
-
...createEmptyPiAgentConversation(),
|
|
218
|
-
question: DEFAULT_QUESTION,
|
|
219
|
-
}));
|
|
220
|
-
const [providerId, setProviderId] = useState<string>("__auto__");
|
|
221
|
-
const [model, setModel] = useState<string>("__auto__");
|
|
222
|
-
const [loading, setLoading] = useState(false);
|
|
223
|
-
|
|
224
|
-
const selectedProvider = piProviders.find((provider) => provider.id === providerId);
|
|
225
|
-
const modelOptions = selectedProvider?.models ?? [];
|
|
226
|
-
const question = conversation.question;
|
|
227
|
-
const canAsk = question.trim() !== "" && piProviders.length > 0 && !loading;
|
|
228
|
-
|
|
229
|
-
if (piProviders.length === 0) return null;
|
|
230
|
-
|
|
231
|
-
const handleQuestionChange = (event: ChangeEvent<HTMLTextAreaElement>): void => {
|
|
232
|
-
setConversation((current) => ({ ...current, question: event.currentTarget.value }));
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
const handleProviderChange = (value: string): void => {
|
|
236
|
-
setProviderId(value);
|
|
237
|
-
setModel("__auto__");
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
const resetConversation = (): void => {
|
|
241
|
-
setConversation({ ...createEmptyPiAgentConversation(), question: DEFAULT_QUESTION });
|
|
242
|
-
onResultChange(null);
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
const setStarter = (questionText: string): void => {
|
|
246
|
-
setConversation((current) => ({ ...current, question: questionText, error: null }));
|
|
247
|
-
};
|
|
248
|
-
|
|
249
|
-
const askPiAgent = (): void => {
|
|
250
|
-
if (!canAsk) return;
|
|
251
|
-
const trimmedQuestion = question.trim();
|
|
252
|
-
const history = buildPiAgentHistory(conversation.messages);
|
|
253
|
-
const userMessage: PiAgentConversationMessage = {
|
|
254
|
-
id: nextMessageId("user"),
|
|
255
|
-
role: "user",
|
|
256
|
-
content: trimmedQuestion,
|
|
257
|
-
response: null,
|
|
258
|
-
};
|
|
259
|
-
|
|
260
|
-
setLoading(true);
|
|
261
|
-
setConversation((current) => ({
|
|
262
|
-
...current,
|
|
263
|
-
messages: [...current.messages, userMessage],
|
|
264
|
-
question: "",
|
|
265
|
-
error: null,
|
|
266
|
-
}));
|
|
267
|
-
|
|
268
|
-
const body = {
|
|
269
|
-
question: trimmedQuestion,
|
|
270
|
-
history,
|
|
271
|
-
...(currentSessionId !== null ? { sessionId: currentSessionId } : {}),
|
|
272
|
-
...(providerId !== "__auto__" ? { providerId } : {}),
|
|
273
|
-
...(model !== "__auto__" ? { model } : {}),
|
|
274
|
-
logLimit: 16,
|
|
275
|
-
};
|
|
276
|
-
|
|
277
|
-
void fetchControl("/api/pi-agent", {
|
|
278
|
-
method: "POST",
|
|
279
|
-
headers: {
|
|
280
|
-
"content-type": "application/json",
|
|
281
|
-
"x-agent-inspector-csrf": "1",
|
|
282
|
-
},
|
|
283
|
-
body: JSON.stringify(body),
|
|
284
|
-
})
|
|
285
|
-
.then(async (response) => {
|
|
286
|
-
const raw = await response.text();
|
|
287
|
-
if (!response.ok) {
|
|
288
|
-
setConversation((current) => ({
|
|
289
|
-
...current,
|
|
290
|
-
error: `Inspector Assistant failed: HTTP ${String(response.status)} ${raw}`,
|
|
291
|
-
}));
|
|
292
|
-
return;
|
|
293
|
-
}
|
|
294
|
-
const parsedJson: unknown = JSON.parse(raw);
|
|
295
|
-
const normalized = normalizePiAgentResponse(parsedJson);
|
|
296
|
-
if (normalized === null) {
|
|
297
|
-
setConversation((current) => ({
|
|
298
|
-
...current,
|
|
299
|
-
error: "Inspector Assistant returned an unexpected response.",
|
|
300
|
-
}));
|
|
301
|
-
return;
|
|
302
|
-
}
|
|
303
|
-
setConversation((current) => ({
|
|
304
|
-
...current,
|
|
305
|
-
messages: [
|
|
306
|
-
...current.messages,
|
|
307
|
-
{
|
|
308
|
-
id: nextMessageId("assistant"),
|
|
309
|
-
role: "assistant",
|
|
310
|
-
content: normalized.answer,
|
|
311
|
-
response: normalized,
|
|
312
|
-
},
|
|
313
|
-
],
|
|
314
|
-
}));
|
|
315
|
-
onResultChange({
|
|
316
|
-
question: trimmedQuestion,
|
|
317
|
-
logIds: getPiAgentResultLogIds(normalized),
|
|
318
|
-
reportedLogCount: normalized.logCount,
|
|
319
|
-
});
|
|
320
|
-
})
|
|
321
|
-
.catch((err: unknown) => {
|
|
322
|
-
setConversation((current) => ({
|
|
323
|
-
...current,
|
|
324
|
-
error: err instanceof Error ? err.message : "Inspector Assistant request failed.",
|
|
325
|
-
}));
|
|
326
|
-
})
|
|
327
|
-
.finally(() => {
|
|
328
|
-
setLoading(false);
|
|
329
|
-
});
|
|
330
|
-
};
|
|
331
|
-
|
|
332
|
-
return (
|
|
333
|
-
<section className="rounded-md bg-black/20 px-3 py-3 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.045)]">
|
|
334
|
-
<div className="flex items-center gap-2">
|
|
335
|
-
<BrainCircuit className="size-4 text-cyan-200" />
|
|
336
|
-
<div className="min-w-0 flex-1">
|
|
337
|
-
<div className="text-xs font-semibold text-foreground">Assistant</div>
|
|
338
|
-
<div className="text-[11px] text-muted-foreground">
|
|
339
|
-
{currentSessionId === null ? "All evidence" : "Current session"}
|
|
340
|
-
</div>
|
|
341
|
-
</div>
|
|
342
|
-
<button
|
|
343
|
-
type="button"
|
|
344
|
-
onClick={resetConversation}
|
|
345
|
-
className="inline-flex size-7 items-center justify-center rounded-md bg-black/25 text-muted-foreground transition-colors hover:text-foreground"
|
|
346
|
-
title="Reset conversation"
|
|
347
|
-
>
|
|
348
|
-
<RotateCcw className="size-3.5" />
|
|
349
|
-
</button>
|
|
350
|
-
</div>
|
|
351
|
-
|
|
352
|
-
{conversation.messages.length === 0 && (
|
|
353
|
-
<p className="mt-3 text-[11px] leading-5 text-muted-foreground">
|
|
354
|
-
Ask about failures, latency, tokens, and tools.
|
|
355
|
-
</p>
|
|
356
|
-
)}
|
|
357
|
-
|
|
358
|
-
<div className="mt-3 grid grid-cols-2 gap-2">
|
|
359
|
-
<Select value={providerId} onValueChange={handleProviderChange}>
|
|
360
|
-
<SelectTrigger className="h-8 border-0 bg-black/25 text-xs shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)]">
|
|
361
|
-
<SelectValue placeholder="Provider" />
|
|
362
|
-
</SelectTrigger>
|
|
363
|
-
<SelectContent>
|
|
364
|
-
<SelectItem value="__auto__">Auto provider</SelectItem>
|
|
365
|
-
{piProviders.map((provider) => (
|
|
366
|
-
<SelectItem key={provider.id} value={provider.id}>
|
|
367
|
-
{provider.name} / {providerProtocolLabel(provider)}
|
|
368
|
-
</SelectItem>
|
|
369
|
-
))}
|
|
370
|
-
</SelectContent>
|
|
371
|
-
</Select>
|
|
372
|
-
<Select value={model} onValueChange={setModel}>
|
|
373
|
-
<SelectTrigger className="h-8 border-0 bg-black/25 text-xs shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)]">
|
|
374
|
-
<SelectValue placeholder="Model" />
|
|
375
|
-
</SelectTrigger>
|
|
376
|
-
<SelectContent>
|
|
377
|
-
<SelectItem value="__auto__">Auto model</SelectItem>
|
|
378
|
-
{modelOptions.map((modelName) => (
|
|
379
|
-
<SelectItem key={modelName} value={modelName}>
|
|
380
|
-
{modelName}
|
|
381
|
-
</SelectItem>
|
|
382
|
-
))}
|
|
383
|
-
</SelectContent>
|
|
384
|
-
</Select>
|
|
385
|
-
</div>
|
|
386
|
-
|
|
387
|
-
{conversation.messages.length === 0 && (
|
|
388
|
-
<div className="mt-3 flex flex-wrap gap-1.5">
|
|
389
|
-
{PI_AGENT_STARTERS.map((starter) => (
|
|
390
|
-
<button
|
|
391
|
-
key={starter.id}
|
|
392
|
-
type="button"
|
|
393
|
-
onClick={() => {
|
|
394
|
-
setStarter(starter.question);
|
|
395
|
-
}}
|
|
396
|
-
className="inline-flex h-7 items-center gap-1.5 rounded-sm bg-black/25 px-2 text-[11px] text-cyan-50 transition-colors hover:bg-cyan-400/12"
|
|
397
|
-
>
|
|
398
|
-
<Sparkles className="size-3" />
|
|
399
|
-
<span>{starter.label}</span>
|
|
400
|
-
</button>
|
|
401
|
-
))}
|
|
402
|
-
</div>
|
|
403
|
-
)}
|
|
404
|
-
|
|
405
|
-
{conversation.messages.length > 0 && (
|
|
406
|
-
<div className="mt-3 max-h-96 space-y-2 overflow-y-auto pr-1">
|
|
407
|
-
{conversation.messages.map((message) => (
|
|
408
|
-
<ConversationMessage key={message.id} message={message} />
|
|
409
|
-
))}
|
|
410
|
-
{loading && (
|
|
411
|
-
<div className="inline-flex items-center gap-2 rounded-md bg-black/25 px-3 py-2 text-xs text-muted-foreground">
|
|
412
|
-
<Loader2 className="size-3.5 animate-spin" />
|
|
413
|
-
<span>Searching Inspector...</span>
|
|
414
|
-
</div>
|
|
415
|
-
)}
|
|
416
|
-
</div>
|
|
417
|
-
)}
|
|
418
|
-
|
|
419
|
-
<textarea
|
|
420
|
-
value={question}
|
|
421
|
-
onChange={handleQuestionChange}
|
|
422
|
-
className="mt-3 min-h-20 w-full resize-y rounded-md bg-black/25 px-3 py-2 text-xs leading-5 text-foreground outline-none shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)] transition-colors placeholder:text-muted-foreground focus-visible:ring-1 focus-visible:ring-ring"
|
|
423
|
-
placeholder="Ask about this Inspector data..."
|
|
424
|
-
/>
|
|
425
|
-
|
|
426
|
-
<button
|
|
427
|
-
type="button"
|
|
428
|
-
onClick={askPiAgent}
|
|
429
|
-
disabled={!canAsk}
|
|
430
|
-
className="mt-2 inline-flex h-8 w-full items-center justify-center gap-2 rounded-md bg-cyan-400/12 px-3 text-xs font-medium text-cyan-100 shadow-[inset_0_0_0_1px_rgba(103,232,249,0.18)] transition-colors hover:bg-cyan-400/18 disabled:cursor-not-allowed disabled:opacity-50"
|
|
431
|
-
>
|
|
432
|
-
{loading ? <Loader2 className="size-3.5 animate-spin" /> : <Send className="size-3.5" />}
|
|
433
|
-
<span>{loading ? "Searching..." : "Ask Assistant"}</span>
|
|
434
|
-
</button>
|
|
435
|
-
|
|
436
|
-
{conversation.error !== null && (
|
|
437
|
-
<p className="mt-2 break-words text-[11px] leading-5 text-red-200">{conversation.error}</p>
|
|
438
|
-
)}
|
|
439
|
-
{logCount === 0 && (
|
|
440
|
-
<p className="mt-2 text-[11px] leading-5 text-muted-foreground">
|
|
441
|
-
No logs in this scope. Setup questions still work.
|
|
442
|
-
</p>
|
|
443
|
-
)}
|
|
444
|
-
</section>
|
|
445
|
-
);
|
|
446
|
-
}
|