@tonyclaw/agent-inspector 4.0.1 → 4.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/backend/nitro.json +1 -1
- package/.output/cli.js +193 -110
- package/.output/server/_ssr/index.mjs +1 -1
- package/.output/server/_ssr/{router-CTHqmroT.mjs → router-ChILzhmz.mjs} +92 -4
- package/.output/server/index.mjs +1 -1
- package/.output/ui/assets/{CompareDrawer-L3n4J-Or.js → CompareDrawer-Co3cUF_I.js} +1 -1
- package/.output/ui/assets/{InspectorPet-D5o_3OZS.js → InspectorPet-jFcrL37X.js} +1 -1
- package/.output/ui/assets/{ProxyViewerContainer-Ocagx75S.js → ProxyViewerContainer-BPzt_VpM.js} +4 -4
- package/.output/ui/assets/{ReplayDialog-Bk7x1h-y.js → ReplayDialog-C6O_zuwI.js} +1 -1
- package/.output/ui/assets/{RequestAnatomy-U4lzL7Sc.js → RequestAnatomy-Ca6NvB7L.js} +1 -1
- package/.output/ui/assets/{ResponseView-LOWfvBLK.js → ResponseView-BzqKcveJ.js} +1 -1
- package/.output/ui/assets/{StreamingChunkSequence-DPfsrrXQ.js → StreamingChunkSequence-9pCZIsS_.js} +1 -1
- package/.output/ui/assets/{_sessionId-0MlWS-CO.js → _sessionId-BMP3KVGR.js} +1 -1
- package/.output/ui/assets/{_sessionId-OdX2Jvt1.js → _sessionId-y4eRoT1H.js} +1 -1
- package/.output/ui/assets/{index-Ea-c8hPg.js → index-CH5w-haG.js} +1 -1
- package/.output/ui/assets/{index-zVVS53Hd.js → index-CmocEhyU.js} +1 -1
- package/.output/ui/assets/{index-Du4qNOOt.js → index-DT8sMJ_n.js} +2 -2
- package/.output/ui/assets/{index-gvFj_9K6.js → index-bfsbIRZa.js} +1 -1
- package/.output/ui/assets/{json-viewer-C1WAMzg3.js → json-viewer-BfFOSDG5.js} +1 -1
- package/.output/ui/assets/{jszip.min-B8AKu2zm.js → jszip.min-BkbVkOsp.js} +1 -1
- package/.output/ui/index.html +1 -1
- package/package.json +5 -10
- package/src/assets/IDE/claudecode-color.svg +0 -1
- package/src/assets/IDE/codex-color.svg +0 -1
- package/src/assets/IDE/opencode.svg +0 -1
- package/src/assets/IDE/xiaomimimo.svg +0 -1
- package/src/assets/favicon.svg +0 -21
- package/src/assets/logos/alibaba.svg +0 -1
- package/src/assets/logos/anthropic.svg +0 -1
- package/src/assets/logos/claude-code.svg +0 -4
- package/src/assets/logos/deepseek.svg +0 -1
- package/src/assets/logos/minimax.jpeg +0 -0
- package/src/assets/logos/openai.svg +0 -1
- package/src/assets/logos/opencode.svg +0 -4
- package/src/assets/logos/qwen.webp +0 -0
- package/src/assets/logos/zhipuai.svg +0 -219
- package/src/backend/router.tsx +0 -36
- package/src/backend/routes/$.ts +0 -26
- package/src/backend/routes/__root.ts +0 -4
- package/src/backend/routes/api/-instances.ts +0 -7
- package/src/backend/routes/api/alerts.summary.ts +0 -28
- package/src/backend/routes/api/alerts.ts +0 -70
- package/src/backend/routes/api/config.paths.ts +0 -14
- package/src/backend/routes/api/config.ts +0 -73
- package/src/backend/routes/api/ecosystem.packages.$packageId.help.ts +0 -11
- package/src/backend/routes/api/ecosystem.packages.$packageId.install.ts +0 -11
- package/src/backend/routes/api/ecosystem.packages.$packageId.runner-presets.ts +0 -11
- package/src/backend/routes/api/ecosystem.packages.$packageId.upgrade.ts +0 -11
- package/src/backend/routes/api/ecosystem.packages.ts +0 -21
- package/src/backend/routes/api/ecosystem.recipes.$recipeId.run.ts +0 -11
- package/src/backend/routes/api/ecosystem.tasks.$taskId.ts +0 -16
- package/src/backend/routes/api/ecosystem.tasks.ts +0 -12
- package/src/backend/routes/api/groups.$groupId.evidence.ts +0 -55
- package/src/backend/routes/api/groups.$groupId.sessions.ts +0 -50
- package/src/backend/routes/api/groups.$groupId.ts +0 -93
- package/src/backend/routes/api/groups.ts +0 -79
- package/src/backend/routes/api/health.ts +0 -22
- package/src/backend/routes/api/instances.$name.connection.ts +0 -12
- package/src/backend/routes/api/instances.$name.restart.ts +0 -23
- package/src/backend/routes/api/instances.$name.start.ts +0 -18
- package/src/backend/routes/api/instances.$name.stop.ts +0 -23
- package/src/backend/routes/api/instances.$name.ts +0 -12
- package/src/backend/routes/api/instances.ts +0 -16
- package/src/backend/routes/api/knowledge.candidates.$candidateId.promote.ts +0 -32
- package/src/backend/routes/api/knowledge.candidates.$candidateId.ts +0 -50
- package/src/backend/routes/api/knowledge.candidates.ts +0 -10
- package/src/backend/routes/api/knowledge.project-context.ts +0 -29
- package/src/backend/routes/api/knowledge.search.ts +0 -62
- package/src/backend/routes/api/knowledge.sessions.$sessionId.candidates.ts +0 -26
- package/src/backend/routes/api/logs.$id.body.ts +0 -58
- package/src/backend/routes/api/logs.$id.chunks.ts +0 -37
- package/src/backend/routes/api/logs.$id.replay.ts +0 -297
- package/src/backend/routes/api/logs.$id.ts +0 -23
- package/src/backend/routes/api/logs.import.ts +0 -39
- package/src/backend/routes/api/logs.stream.ts +0 -174
- package/src/backend/routes/api/logs.ts +0 -214
- package/src/backend/routes/api/mcp.ts +0 -25
- package/src/backend/routes/api/models.ts +0 -10
- package/src/backend/routes/api/pi-agent.ts +0 -29
- package/src/backend/routes/api/providers.$providerId.model-metadata.ts +0 -173
- package/src/backend/routes/api/providers.$providerId.test.log.ts +0 -342
- package/src/backend/routes/api/providers.$providerId.ts +0 -111
- package/src/backend/routes/api/providers.export.ts +0 -44
- package/src/backend/routes/api/providers.import.ts +0 -81
- package/src/backend/routes/api/providers.scan.ts +0 -28
- package/src/backend/routes/api/providers.ts +0 -102
- package/src/backend/routes/api/runs.$runId.evidence.ts +0 -55
- package/src/backend/routes/api/runs.$runId.ts +0 -50
- package/src/backend/routes/api/runs.ts +0 -62
- package/src/backend/routes/api/runtime.ts +0 -46
- package/src/backend/routes/api/sessions.ts +0 -51
- package/src/backend/routes/api/storage.ts +0 -56
- package/src/backend/routes/livez.ts +0 -13
- package/src/backend/routes/metrics.ts +0 -14
- package/src/backend/routes/proxy/$.ts +0 -15
- package/src/backend/routes/readyz.ts +0 -18
- package/src/backend/start.ts +0 -10
- package/src/cli/alias.ts +0 -431
- package/src/cli/detect-tools.ts +0 -123
- package/src/cli/doctor.ts +0 -836
- package/src/cli/instance.ts +0 -1071
- package/src/cli/instanceApi.ts +0 -213
- package/src/cli/instanceArgs.ts +0 -301
- package/src/cli/instanceControl.ts +0 -191
- package/src/cli/instanceModel.ts +0 -276
- package/src/cli/instanceRegistry.ts +0 -731
- package/src/cli/networkHints.ts +0 -170
- package/src/cli/onboard.ts +0 -1668
- package/src/cli/onboardTarget.ts +0 -228
- package/src/cli/rustBackendPackage.ts +0 -458
- package/src/cli/startupOutput.ts +0 -16
- package/src/cli/templates/codex-skill-onboard.ts +0 -320
- package/src/cli/templates/command-onboard.ts +0 -25
- package/src/cli/templates/skill-onboard.ts +0 -625
- package/src/cli.ts +0 -1433
- package/src/components/OnboardingBanner.tsx +0 -115
- package/src/components/ProxyViewer.tsx +0 -2259
- package/src/components/ProxyViewerContainer.tsx +0 -1076
- package/src/components/alerts/AlertsDialog.tsx +0 -615
- package/src/components/clients/ClientLogo.tsx +0 -175
- package/src/components/ecosystem/AgentLabDialog.tsx +0 -947
- package/src/components/errors/SafeErrorBoundary.tsx +0 -201
- package/src/components/groups/GroupsDialog.tsx +0 -1304
- package/src/components/inspector-pet/InspectorPet.tsx +0 -398
- package/src/components/inspector-pet/InspectorPetCrab3D.tsx +0 -455
- package/src/components/inspector-pet/inspectorPetLogic.ts +0 -272
- package/src/components/pi-agent/PiAgentPanel.tsx +0 -446
- package/src/components/pi-agent/piAgentChatLogic.ts +0 -273
- package/src/components/providers/ImportWizardDialog.tsx +0 -281
- package/src/components/providers/ProviderCard.tsx +0 -347
- package/src/components/providers/ProviderForm.tsx +0 -1183
- package/src/components/providers/ProviderLogo.tsx +0 -122
- package/src/components/providers/ProviderTestResultsView.tsx +0 -734
- package/src/components/providers/ProvidersPanel.tsx +0 -714
- package/src/components/providers/SettingsDialog.tsx +0 -1042
- package/src/components/providers/providerFormCapabilities.ts +0 -36
- package/src/components/proxy-viewer/AgentTraceSummary.tsx +0 -902
- package/src/components/proxy-viewer/AnswerMarkdown.tsx +0 -51
- package/src/components/proxy-viewer/ApplicationBar.tsx +0 -123
- package/src/components/proxy-viewer/CompareDrawer.tsx +0 -984
- package/src/components/proxy-viewer/ConversationGroup.tsx +0 -208
- package/src/components/proxy-viewer/ConversationGroupList.tsx +0 -652
- package/src/components/proxy-viewer/ConversationHeader.tsx +0 -429
- package/src/components/proxy-viewer/LiveConnectionStatus.tsx +0 -186
- package/src/components/proxy-viewer/LogEntry.tsx +0 -1419
- package/src/components/proxy-viewer/LogEntryHeader.tsx +0 -596
- package/src/components/proxy-viewer/ProviderLogoStack.tsx +0 -57
- package/src/components/proxy-viewer/RawExportWarning.tsx +0 -77
- package/src/components/proxy-viewer/ReplayDialog.tsx +0 -636
- package/src/components/proxy-viewer/RequestToolsPanel.tsx +0 -299
- package/src/components/proxy-viewer/ResponseView.tsx +0 -202
- package/src/components/proxy-viewer/SessionLoadProgressBar.tsx +0 -61
- package/src/components/proxy-viewer/StreamingChunkSequence.tsx +0 -265
- package/src/components/proxy-viewer/ThreadConnector.tsx +0 -165
- package/src/components/proxy-viewer/ToolTraceEvents.tsx +0 -64
- package/src/components/proxy-viewer/TurnGroup.tsx +0 -383
- package/src/components/proxy-viewer/TurnGroupList.tsx +0 -156
- package/src/components/proxy-viewer/accessibility.ts +0 -8
- package/src/components/proxy-viewer/anatomy/RequestAnatomy.tsx +0 -887
- package/src/components/proxy-viewer/anatomy/SegmentBar.tsx +0 -222
- package/src/components/proxy-viewer/anatomy/contextIntelligence.ts +0 -737
- package/src/components/proxy-viewer/anatomy/sessionContextSummary.ts +0 -268
- package/src/components/proxy-viewer/anatomy/tokenEstimate.ts +0 -53
- package/src/components/proxy-viewer/anatomy/types.ts +0 -41
- package/src/components/proxy-viewer/anatomy/useAnatomyJump.ts +0 -114
- package/src/components/proxy-viewer/bodyHydration.ts +0 -123
- package/src/components/proxy-viewer/cacheTrend.ts +0 -50
- package/src/components/proxy-viewer/diff/DiffView.tsx +0 -321
- package/src/components/proxy-viewer/diff/computeDiff.ts +0 -178
- package/src/components/proxy-viewer/diff/index.ts +0 -3
- package/src/components/proxy-viewer/formats/anthropic/ContentBlocks.tsx +0 -194
- package/src/components/proxy-viewer/formats/anthropic/ResponseView.tsx +0 -81
- package/src/components/proxy-viewer/formats/anthropic/thinkingExtract.ts +0 -21
- package/src/components/proxy-viewer/formats/index.tsx +0 -47
- package/src/components/proxy-viewer/formats/openai/ResponseView.tsx +0 -442
- package/src/components/proxy-viewer/index.ts +0 -9
- package/src/components/proxy-viewer/lazy.ts +0 -41
- package/src/components/proxy-viewer/liveConnectionState.ts +0 -158
- package/src/components/proxy-viewer/log-formats/anthropic.ts +0 -191
- package/src/components/proxy-viewer/log-formats/index.ts +0 -23
- package/src/components/proxy-viewer/log-formats/openai.ts +0 -256
- package/src/components/proxy-viewer/log-formats/types.ts +0 -40
- package/src/components/proxy-viewer/log-formats/unknown.ts +0 -18
- package/src/components/proxy-viewer/logEntryVisibility.ts +0 -73
- package/src/components/proxy-viewer/logFocus.ts +0 -54
- package/src/components/proxy-viewer/proxyViewerContainerLogic.ts +0 -124
- package/src/components/proxy-viewer/proxyViewerLogic.ts +0 -488
- package/src/components/proxy-viewer/replayComparison.ts +0 -131
- package/src/components/proxy-viewer/requestDiff.ts +0 -277
- package/src/components/proxy-viewer/requestTools.ts +0 -220
- package/src/components/proxy-viewer/useCopyFeedback.ts +0 -38
- package/src/components/proxy-viewer/useKeyboardNavigation.ts +0 -232
- package/src/components/proxy-viewer/viewerState.ts +0 -176
- package/src/components/ui/badge.tsx +0 -47
- package/src/components/ui/button.tsx +0 -47
- package/src/components/ui/collapsible.tsx +0 -21
- package/src/components/ui/confirm-dialog.tsx +0 -51
- package/src/components/ui/crab-logo.tsx +0 -45
- package/src/components/ui/crab-variants.tsx +0 -467
- package/src/components/ui/dialog.tsx +0 -130
- package/src/components/ui/icon-trigger.ts +0 -2
- package/src/components/ui/json-viewer-bulk.ts +0 -132
- package/src/components/ui/json-viewer.tsx +0 -508
- package/src/components/ui/scroll-area.tsx +0 -54
- package/src/components/ui/select.tsx +0 -178
- package/src/components/ui/separator.tsx +0 -28
- package/src/components/ui/tabs.tsx +0 -88
- package/src/components/ui/tooltip.tsx +0 -51
- package/src/components/ui/transient-toast.tsx +0 -105
- package/src/contracts/anthropic.ts +0 -230
- package/src/contracts/index.ts +0 -59
- package/src/contracts/json.ts +0 -37
- package/src/contracts/log.ts +0 -139
- package/src/contracts/openai.ts +0 -267
- package/src/index.css +0 -11
- package/src/knowledge/candidateStore.ts +0 -94
- package/src/knowledge/distiller.ts +0 -98
- package/src/knowledge/openclawClient.ts +0 -161
- package/src/knowledge/openclawGatewayClient.ts +0 -249
- package/src/knowledge/openclawMarkdown.ts +0 -146
- package/src/knowledge/redactor.ts +0 -80
- package/src/knowledge/types.ts +0 -83
- package/src/lib/alertContract.ts +0 -76
- package/src/lib/apiClient.ts +0 -166
- package/src/lib/apiFormat.ts +0 -29
- package/src/lib/backendImplementation.ts +0 -16
- package/src/lib/basePath.ts +0 -107
- package/src/lib/browserRuntimeContract.ts +0 -124
- package/src/lib/browserRuntimeResolver.ts +0 -333
- package/src/lib/chunkLoadRecovery.ts +0 -83
- package/src/lib/claudeCodeStrip.ts +0 -98
- package/src/lib/clipboard.ts +0 -67
- package/src/lib/codingAgentEndpoints.ts +0 -54
- package/src/lib/ecosystemContract.ts +0 -130
- package/src/lib/export-logs.ts +0 -287
- package/src/lib/groupContract.ts +0 -166
- package/src/lib/instanceContract.ts +0 -239
- package/src/lib/jsonFile.ts +0 -46
- package/src/lib/logImportContract.ts +0 -12
- package/src/lib/managedInstance.ts +0 -112
- package/src/lib/mask.ts +0 -4
- package/src/lib/objectUtils.ts +0 -22
- package/src/lib/piAgentContract.ts +0 -102
- package/src/lib/providerContract.ts +0 -125
- package/src/lib/providerImportContract.ts +0 -27
- package/src/lib/providerModelMetadata.ts +0 -458
- package/src/lib/providerTestContract.ts +0 -170
- package/src/lib/providerTestPrompt.ts +0 -100
- package/src/lib/publicBasePathContext.ts +0 -137
- package/src/lib/resourceLimits.ts +0 -345
- package/src/lib/runContract.ts +0 -164
- package/src/lib/runtimeConfig.ts +0 -43
- package/src/lib/safeDiagnostic.ts +0 -38
- package/src/lib/safeFetch.ts +0 -508
- package/src/lib/serverPort.ts +0 -47
- package/src/lib/sessionInfoContract.ts +0 -78
- package/src/lib/sessionUrl.ts +0 -46
- package/src/lib/ssrfGuard.ts +0 -133
- package/src/lib/stopReason.ts +0 -130
- package/src/lib/themeMode.ts +0 -41
- package/src/lib/timeDisplay.ts +0 -22
- package/src/lib/toolTrace.ts +0 -290
- package/src/lib/uiScale.ts +0 -117
- package/src/lib/unknown.ts +0 -27
- package/src/lib/upstreamUrl.ts +0 -150
- package/src/lib/useAlerts.ts +0 -82
- package/src/lib/useGroupEvidence.ts +0 -37
- package/src/lib/useGroups.ts +0 -32
- package/src/lib/useOnboarding.ts +0 -93
- package/src/lib/useProviders.ts +0 -30
- package/src/lib/useStripConfig.ts +0 -154
- package/src/lib/useThemeMode.ts +0 -40
- package/src/lib/useUiScale.ts +0 -52
- package/src/lib/utils.ts +0 -78
- package/src/mcp/currentContext.ts +0 -65
- package/src/mcp/instanceHandlers.ts +0 -151
- package/src/mcp/loopback.ts +0 -88
- package/src/mcp/mode.ts +0 -75
- package/src/mcp/previewExtractor.ts +0 -233
- package/src/mcp/server.ts +0 -2274
- package/src/mcp/toolHandlers.ts +0 -1533
- package/src/proxy/alerts.ts +0 -664
- package/src/proxy/chunkStorage.ts +0 -123
- package/src/proxy/config.ts +0 -218
- package/src/proxy/constants.ts +0 -66
- package/src/proxy/dataDir.ts +0 -147
- package/src/proxy/ecosystemExecutionConfirmation.ts +0 -114
- package/src/proxy/ecosystemExecutionRoute.ts +0 -116
- package/src/proxy/ecosystemRegistry.ts +0 -296
- package/src/proxy/ecosystemTasks.ts +0 -415
- package/src/proxy/evidenceAnalysis.ts +0 -526
- package/src/proxy/evidenceExporter.ts +0 -235
- package/src/proxy/formats/anthropic/anthropicProvider.ts +0 -75
- package/src/proxy/formats/anthropic/handler.ts +0 -75
- package/src/proxy/formats/anthropic/index.ts +0 -13
- package/src/proxy/formats/anthropic/register.ts +0 -4
- package/src/proxy/formats/anthropic/schemas.ts +0 -6
- package/src/proxy/formats/anthropic/stream.ts +0 -205
- package/src/proxy/formats/handler.ts +0 -46
- package/src/proxy/formats/index.ts +0 -13
- package/src/proxy/formats/jsonSchema.ts +0 -2
- package/src/proxy/formats/openai/alibabaProvider.ts +0 -34
- package/src/proxy/formats/openai/codexMetadata.ts +0 -61
- package/src/proxy/formats/openai/handler.ts +0 -133
- package/src/proxy/formats/openai/index.ts +0 -33
- package/src/proxy/formats/openai/provider.ts +0 -50
- package/src/proxy/formats/openai/register.ts +0 -4
- package/src/proxy/formats/openai/schemas.ts +0 -25
- package/src/proxy/formats/openai/stream.ts +0 -600
- package/src/proxy/formats/openai/zhipuProvider.ts +0 -31
- package/src/proxy/formats/providerAdapter.ts +0 -50
- package/src/proxy/formats/providerRegistry.ts +0 -51
- package/src/proxy/formats/providers/index.ts +0 -3
- package/src/proxy/formats/registry.ts +0 -65
- package/src/proxy/groupEvidenceExporter.ts +0 -371
- package/src/proxy/groupStore.ts +0 -336
- package/src/proxy/handler.ts +0 -729
- package/src/proxy/identityProxy.ts +0 -1842
- package/src/proxy/jsonlRecovery.ts +0 -554
- package/src/proxy/logBodyChunks.ts +0 -91
- package/src/proxy/logFinalizer.ts +0 -777
- package/src/proxy/logFinalizer.worker.ts +0 -24
- package/src/proxy/logImportUpload.ts +0 -128
- package/src/proxy/logImporter.ts +0 -813
- package/src/proxy/logIndex.ts +0 -663
- package/src/proxy/logSearch.ts +0 -122
- package/src/proxy/logger.ts +0 -537
- package/src/proxy/openaiOrphanToolStrip.ts +0 -142
- package/src/proxy/platformCommands.ts +0 -258
- package/src/proxy/privateDataPath.ts +0 -419
- package/src/proxy/providerImporters.ts +0 -578
- package/src/proxy/providerScanStore.ts +0 -87
- package/src/proxy/providerSecretStore.ts +0 -216
- package/src/proxy/providers.ts +0 -998
- package/src/proxy/rawStreamCapture.ts +0 -342
- package/src/proxy/runFailures.ts +0 -94
- package/src/proxy/runStore.ts +0 -214
- package/src/proxy/runtimeAdmission.ts +0 -55
- package/src/proxy/runtimeHealth.ts +0 -221
- package/src/proxy/runtimeMetrics.ts +0 -149
- package/src/proxy/runtimeShutdown.ts +0 -157
- package/src/proxy/schemas.ts +0 -112
- package/src/proxy/sessionArchive.ts +0 -479
- package/src/proxy/sessionInfo.ts +0 -266
- package/src/proxy/sessionProcess.ts +0 -194
- package/src/proxy/sessionRuntime.ts +0 -121
- package/src/proxy/sessionSupervisor.ts +0 -305
- package/src/proxy/sessionWorkerEntry.ts +0 -26
- package/src/proxy/shutdownCoordinator.ts +0 -90
- package/src/proxy/socketTracker.ts +0 -639
- package/src/proxy/sqliteLogIndex.ts +0 -733
- package/src/proxy/storageLifecycle.ts +0 -432
- package/src/proxy/store.ts +0 -1773
- package/src/proxy/streamTiming.ts +0 -31
- package/src/proxy/toolSchemaWarnings.ts +0 -529
- package/src/proxy/uiAssetServer.ts +0 -106
- package/src/proxy/upstream.ts +0 -127
- package/src/services/alerts.ts +0 -12
- package/src/services/groups.ts +0 -119
- package/src/services/piAgent.ts +0 -421
- package/src/services/piAgentRetrieval.ts +0 -1180
- package/src/services/result.ts +0 -17
- package/src/services/runs.ts +0 -76
- package/src/ui/bootstrap.ts +0 -167
- package/src/ui/index.html +0 -38
- package/src/ui/logsStreamClient.ts +0 -20
- package/src/ui/main.tsx +0 -13
- package/src/ui/public/runtime-config.js +0 -2
- package/src/ui/router.tsx +0 -13
- package/src/ui/routes/__root.tsx +0 -69
- package/src/ui/routes/index.tsx +0 -35
- package/src/ui/routes/session/$sessionId.tsx +0 -50
- package/src/ui/runtimeDiscovery.ts +0 -50
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
import { useCallback, useEffect } from "react";
|
|
2
|
-
|
|
3
|
-
const NAV_ATTR = "data-nav-id";
|
|
4
|
-
const NAV_ACTION_ATTR = "data-nav-action";
|
|
5
|
-
|
|
6
|
-
export type NavAction = "toggle" | "expand" | "collapse";
|
|
7
|
-
|
|
8
|
-
type KeyboardNavigationOptions = {
|
|
9
|
-
/** When true, Arrow/WASD navigation works even when focus is on the page body. */
|
|
10
|
-
pageWide?: boolean;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
function findNavItems(container: HTMLElement): HTMLElement[] {
|
|
14
|
-
return Array.from(container.querySelectorAll<HTMLElement>(`[${NAV_ATTR}]`));
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function isFocusTarget(node: EventTarget | null): node is HTMLElement {
|
|
18
|
-
return node instanceof HTMLElement;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function findClosestNavItem(target: HTMLElement, container: HTMLElement): HTMLElement | null {
|
|
22
|
-
let el: HTMLElement | null = target;
|
|
23
|
-
while (el !== null && el !== container) {
|
|
24
|
-
if (el.hasAttribute(NAV_ATTR)) return el;
|
|
25
|
-
el = el.parentElement;
|
|
26
|
-
}
|
|
27
|
-
if (target.hasAttribute(NAV_ATTR)) return target;
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function getAction(el: HTMLElement): NavAction | null {
|
|
32
|
-
const val = el.getAttribute(NAV_ACTION_ATTR);
|
|
33
|
-
if (val === "toggle" || val === "expand" || val === "collapse") return val;
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function focusAndScroll(el: HTMLElement): void {
|
|
38
|
-
el.focus({ preventScroll: true });
|
|
39
|
-
el.scrollIntoView({ block: "nearest", behavior: "smooth" });
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function safeItemAt(items: HTMLElement[], index: number): HTMLElement | null {
|
|
43
|
-
const el = items[index];
|
|
44
|
-
return el ?? null;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function isEditableTarget(target: HTMLElement): boolean {
|
|
48
|
-
const tag = target.tagName;
|
|
49
|
-
if (tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT") return true;
|
|
50
|
-
if (target.isContentEditable) return true;
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function isInteractiveTarget(target: HTMLElement): boolean {
|
|
55
|
-
const tag = target.tagName;
|
|
56
|
-
if (tag === "BUTTON" || tag === "A") return true;
|
|
57
|
-
if (isEditableTarget(target)) return true;
|
|
58
|
-
return target.closest("[role='button'],[role='menuitem'],[role='option']") !== null;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function isInOpenOverlay(target: HTMLElement): boolean {
|
|
62
|
-
if (target.closest("[role='dialog'],[role='menu'],[role='listbox']") !== null) return true;
|
|
63
|
-
return document.querySelector("[role='dialog'],[role='menu'],[role='listbox']") !== null;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function hasActiveTextSelection(): boolean {
|
|
67
|
-
const selection = window.getSelection();
|
|
68
|
-
if (selection === null) return false;
|
|
69
|
-
return selection.type === "Range" && selection.toString().length > 0;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function isLetterNavigationKey(event: KeyboardEvent, key: "W" | "A" | "S" | "D"): boolean {
|
|
73
|
-
return event.key === key && event.shiftKey;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Enables keyboard navigation within a log-list container.
|
|
78
|
-
*
|
|
79
|
-
* Navigation keys:
|
|
80
|
-
* - ArrowUp / Shift+W : previous thread/turn/log item
|
|
81
|
-
* - ArrowDown / Shift+S : next thread/turn/log item
|
|
82
|
-
* - ArrowLeft / Shift+A : collapse or move to previous item
|
|
83
|
-
* - ArrowRight / Shift+D : expand or move to next item
|
|
84
|
-
* - Space : toggle expand/collapse
|
|
85
|
-
*
|
|
86
|
-
* Attach `data-nav-id` to any focusable navigation item.
|
|
87
|
-
* Attach `data-nav-action` ("toggle" | "expand" | "collapse") for items
|
|
88
|
-
* that support expand/collapse.
|
|
89
|
-
*/
|
|
90
|
-
export function useKeyboardNavigation(
|
|
91
|
-
/** Ref to the inner container that holds all nav items. */
|
|
92
|
-
containerRef: React.RefObject<HTMLElement | null>,
|
|
93
|
-
/** Ref to the outer focus-receiving wrapper (the one with tabIndex).
|
|
94
|
-
* Defaults to `containerRef` when omitted. */
|
|
95
|
-
wrapperRef?: React.RefObject<HTMLElement | null>,
|
|
96
|
-
options: KeyboardNavigationOptions = {},
|
|
97
|
-
): void {
|
|
98
|
-
const rootRef = wrapperRef ?? containerRef;
|
|
99
|
-
const pageWide = options.pageWide === true;
|
|
100
|
-
|
|
101
|
-
const handleFocusContainer = useCallback(
|
|
102
|
-
(e: FocusEvent) => {
|
|
103
|
-
const container = containerRef.current;
|
|
104
|
-
const root = rootRef.current;
|
|
105
|
-
if (!container) return;
|
|
106
|
-
if (!root) return;
|
|
107
|
-
const target = e.target;
|
|
108
|
-
if (!isFocusTarget(target)) return;
|
|
109
|
-
if (target !== root) return;
|
|
110
|
-
const items = findNavItems(container);
|
|
111
|
-
const first = safeItemAt(items, 0);
|
|
112
|
-
if (first !== null) focusAndScroll(first);
|
|
113
|
-
},
|
|
114
|
-
[containerRef, rootRef],
|
|
115
|
-
);
|
|
116
|
-
|
|
117
|
-
useEffect(() => {
|
|
118
|
-
const handleKeyDown = (e: KeyboardEvent) => {
|
|
119
|
-
if (e.altKey || e.ctrlKey || e.metaKey) return;
|
|
120
|
-
|
|
121
|
-
const container = containerRef.current;
|
|
122
|
-
if (!container) return;
|
|
123
|
-
|
|
124
|
-
const target = e.target;
|
|
125
|
-
if (!isFocusTarget(target)) return;
|
|
126
|
-
|
|
127
|
-
if (isEditableTarget(target)) return;
|
|
128
|
-
if (hasActiveTextSelection()) return;
|
|
129
|
-
|
|
130
|
-
const isInsideContainer = container.contains(target);
|
|
131
|
-
if (isInsideContainer && isInteractiveTarget(target) && !target.hasAttribute(NAV_ATTR)) {
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
if (!isInsideContainer) {
|
|
136
|
-
if (!pageWide) return;
|
|
137
|
-
if (isInteractiveTarget(target) || isInOpenOverlay(target)) return;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
const items = findNavItems(container);
|
|
141
|
-
if (items.length === 0) return;
|
|
142
|
-
|
|
143
|
-
const current = findClosestNavItem(target, container);
|
|
144
|
-
const currentIdx = current !== null ? items.indexOf(current) : -1;
|
|
145
|
-
|
|
146
|
-
let handled = false;
|
|
147
|
-
|
|
148
|
-
switch (e.key) {
|
|
149
|
-
case "ArrowUp":
|
|
150
|
-
case "W": {
|
|
151
|
-
if (e.shiftKey && e.key === "ArrowUp") break;
|
|
152
|
-
if (e.key === "W" && !isLetterNavigationKey(e, "W")) break;
|
|
153
|
-
e.preventDefault();
|
|
154
|
-
const prevIdx =
|
|
155
|
-
currentIdx > 0 ? currentIdx - 1 : currentIdx === -1 ? items.length - 1 : -1;
|
|
156
|
-
if (prevIdx !== -1) {
|
|
157
|
-
const prev = safeItemAt(items, prevIdx);
|
|
158
|
-
if (prev !== null) focusAndScroll(prev);
|
|
159
|
-
}
|
|
160
|
-
handled = true;
|
|
161
|
-
break;
|
|
162
|
-
}
|
|
163
|
-
case "ArrowDown":
|
|
164
|
-
case "S": {
|
|
165
|
-
if (e.shiftKey && e.key === "ArrowDown") break;
|
|
166
|
-
if (e.key === "S" && !isLetterNavigationKey(e, "S")) break;
|
|
167
|
-
e.preventDefault();
|
|
168
|
-
const nextIdx =
|
|
169
|
-
currentIdx < items.length - 1 ? currentIdx + 1 : currentIdx === -1 ? 0 : -1;
|
|
170
|
-
if (nextIdx !== -1) {
|
|
171
|
-
const next = safeItemAt(items, nextIdx);
|
|
172
|
-
if (next !== null) focusAndScroll(next);
|
|
173
|
-
}
|
|
174
|
-
handled = true;
|
|
175
|
-
break;
|
|
176
|
-
}
|
|
177
|
-
case "ArrowLeft":
|
|
178
|
-
case "A": {
|
|
179
|
-
if (e.shiftKey && e.key === "ArrowLeft") break;
|
|
180
|
-
if (e.key === "A" && !isLetterNavigationKey(e, "A")) break;
|
|
181
|
-
if (current === null) break;
|
|
182
|
-
e.preventDefault();
|
|
183
|
-
const action = getAction(current);
|
|
184
|
-
if (action === "collapse") {
|
|
185
|
-
current.click();
|
|
186
|
-
} else if (currentIdx > 0) {
|
|
187
|
-
const prev = safeItemAt(items, currentIdx - 1);
|
|
188
|
-
if (prev !== null) focusAndScroll(prev);
|
|
189
|
-
}
|
|
190
|
-
handled = true;
|
|
191
|
-
break;
|
|
192
|
-
}
|
|
193
|
-
case "ArrowRight":
|
|
194
|
-
case "D": {
|
|
195
|
-
if (e.shiftKey && e.key === "ArrowRight") break;
|
|
196
|
-
if (e.key === "D" && !isLetterNavigationKey(e, "D")) break;
|
|
197
|
-
if (current === null) break;
|
|
198
|
-
e.preventDefault();
|
|
199
|
-
const action = getAction(current);
|
|
200
|
-
if (action === "expand") {
|
|
201
|
-
current.click();
|
|
202
|
-
} else if (currentIdx < items.length - 1) {
|
|
203
|
-
const next = safeItemAt(items, currentIdx + 1);
|
|
204
|
-
if (next !== null) focusAndScroll(next);
|
|
205
|
-
}
|
|
206
|
-
handled = true;
|
|
207
|
-
break;
|
|
208
|
-
}
|
|
209
|
-
case " ": {
|
|
210
|
-
if (current === null) break;
|
|
211
|
-
e.preventDefault();
|
|
212
|
-
const action = getAction(current);
|
|
213
|
-
if (action !== null) current.click();
|
|
214
|
-
handled = true;
|
|
215
|
-
break;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
if (handled) {
|
|
220
|
-
e.stopPropagation();
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
document.addEventListener("keydown", handleKeyDown, { capture: true });
|
|
225
|
-
return () => document.removeEventListener("keydown", handleKeyDown, { capture: true });
|
|
226
|
-
}, [containerRef, pageWide, rootRef]);
|
|
227
|
-
|
|
228
|
-
useEffect(() => {
|
|
229
|
-
document.addEventListener("focusin", handleFocusContainer);
|
|
230
|
-
return () => document.removeEventListener("focusin", handleFocusContainer);
|
|
231
|
-
}, [handleFocusContainer]);
|
|
232
|
-
}
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import { extractStopReason, isTurnBoundary, type StopReason } from "../../lib/stopReason";
|
|
2
|
-
import type { CapturedLog } from "../../contracts";
|
|
3
|
-
import {
|
|
4
|
-
extractToolTraceEvents as extractSharedToolTraceEvents,
|
|
5
|
-
type ToolTraceEvent,
|
|
6
|
-
} from "../../lib/toolTrace";
|
|
7
|
-
import { resolveLogFormat } from "./log-formats";
|
|
8
|
-
|
|
9
|
-
export type { ToolTraceEvent };
|
|
10
|
-
|
|
11
|
-
export type TurnEntry = {
|
|
12
|
-
log: CapturedLog;
|
|
13
|
-
stopReason: StopReason;
|
|
14
|
-
sessionLogNumber: number;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export type TurnGroupData = {
|
|
18
|
-
entries: TurnEntry[];
|
|
19
|
-
turnIndex: number;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
type ConversationLike = {
|
|
23
|
-
logs: CapturedLog[];
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export type TraceSummary = {
|
|
27
|
-
llmCallCount: number;
|
|
28
|
-
toolCallCount: number;
|
|
29
|
-
failedCallCount: number;
|
|
30
|
-
pendingCallCount: number;
|
|
31
|
-
slowCallCount: number;
|
|
32
|
-
totalInputTokens: number;
|
|
33
|
-
totalOutputTokens: number;
|
|
34
|
-
totalCacheCreationInputTokens: number;
|
|
35
|
-
totalCacheReadInputTokens: number;
|
|
36
|
-
totalElapsedMs: number;
|
|
37
|
-
maxElapsedMs: number | null;
|
|
38
|
-
startedAt: string | null;
|
|
39
|
-
endedAt: string | null;
|
|
40
|
-
knowledgeCandidateCount: number;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
type ToolTraceCacheEntry = {
|
|
44
|
-
apiFormat: CapturedLog["apiFormat"];
|
|
45
|
-
responseText: string | null;
|
|
46
|
-
toolTraceEvents: CapturedLog["toolTraceEvents"];
|
|
47
|
-
events: ToolTraceEvent[];
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const toolTraceCache = new WeakMap<CapturedLog, ToolTraceCacheEntry>();
|
|
51
|
-
|
|
52
|
-
export function isTurnCollapsible(entryCount: number): boolean {
|
|
53
|
-
return entryCount > 1;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export function buildTurnGroups(logs: CapturedLog[]): TurnGroupData[] {
|
|
57
|
-
const groups: TurnGroupData[] = [];
|
|
58
|
-
let entries: TurnEntry[] = [];
|
|
59
|
-
let turnIndex = 0;
|
|
60
|
-
|
|
61
|
-
for (let index = 0; index < logs.length; index += 1) {
|
|
62
|
-
const log = logs[index];
|
|
63
|
-
if (log === undefined) continue;
|
|
64
|
-
entries.push({ log, stopReason: extractStopReason(log), sessionLogNumber: index + 1 });
|
|
65
|
-
const current = entries[entries.length - 1];
|
|
66
|
-
if (current !== undefined && isTurnBoundary(current.stopReason)) {
|
|
67
|
-
groups.push({ entries, turnIndex });
|
|
68
|
-
entries = [];
|
|
69
|
-
turnIndex += 1;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
if (entries.length > 0) groups.push({ entries, turnIndex });
|
|
74
|
-
return groups;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export function buildValidPredecessors(groups: ConversationLike[]): Map<number, CapturedLog> {
|
|
78
|
-
const predecessors = new Map<number, CapturedLog>();
|
|
79
|
-
|
|
80
|
-
for (const group of groups) {
|
|
81
|
-
for (let index = 1; index < group.logs.length; index += 1) {
|
|
82
|
-
const current = group.logs[index];
|
|
83
|
-
const previous = group.logs[index - 1];
|
|
84
|
-
if (current === undefined || previous === undefined) continue;
|
|
85
|
-
const currentFormat = resolveLogFormat(current);
|
|
86
|
-
const previousFormat = resolveLogFormat(previous);
|
|
87
|
-
if (currentFormat === "unknown" || currentFormat !== previousFormat) continue;
|
|
88
|
-
predecessors.set(current.id, previous);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
return predecessors;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export function extractToolTraceEvents(log: CapturedLog): ToolTraceEvent[] {
|
|
96
|
-
const cached = toolTraceCache.get(log);
|
|
97
|
-
if (
|
|
98
|
-
cached !== undefined &&
|
|
99
|
-
cached.apiFormat === log.apiFormat &&
|
|
100
|
-
cached.responseText === log.responseText &&
|
|
101
|
-
cached.toolTraceEvents === log.toolTraceEvents
|
|
102
|
-
) {
|
|
103
|
-
return cached.events;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const events = extractSharedToolTraceEvents(log);
|
|
107
|
-
toolTraceCache.set(log, {
|
|
108
|
-
apiFormat: log.apiFormat,
|
|
109
|
-
responseText: log.responseText,
|
|
110
|
-
toolTraceEvents: log.toolTraceEvents,
|
|
111
|
-
events,
|
|
112
|
-
});
|
|
113
|
-
return events;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export function buildTraceSummary(
|
|
117
|
-
logs: CapturedLog[],
|
|
118
|
-
slowResponseThresholdSeconds: number,
|
|
119
|
-
knowledgeCandidateCount = 0,
|
|
120
|
-
): TraceSummary {
|
|
121
|
-
let failedCallCount = 0;
|
|
122
|
-
let pendingCallCount = 0;
|
|
123
|
-
let slowCallCount = 0;
|
|
124
|
-
let totalInputTokens = 0;
|
|
125
|
-
let totalOutputTokens = 0;
|
|
126
|
-
let totalCacheCreationInputTokens = 0;
|
|
127
|
-
let totalCacheReadInputTokens = 0;
|
|
128
|
-
let totalElapsedMs = 0;
|
|
129
|
-
let maxElapsedMs: number | null = null;
|
|
130
|
-
let toolCallCount = 0;
|
|
131
|
-
|
|
132
|
-
for (const log of logs) {
|
|
133
|
-
if (log.responseStatus === null) {
|
|
134
|
-
pendingCallCount += 1;
|
|
135
|
-
} else if (log.responseStatus >= 400) {
|
|
136
|
-
failedCallCount += 1;
|
|
137
|
-
}
|
|
138
|
-
if (
|
|
139
|
-
log.elapsedMs !== null &&
|
|
140
|
-
slowResponseThresholdSeconds > 0 &&
|
|
141
|
-
log.elapsedMs > slowResponseThresholdSeconds * 1000
|
|
142
|
-
) {
|
|
143
|
-
slowCallCount += 1;
|
|
144
|
-
}
|
|
145
|
-
if (log.inputTokens !== null) totalInputTokens += log.inputTokens;
|
|
146
|
-
if (log.outputTokens !== null) totalOutputTokens += log.outputTokens;
|
|
147
|
-
if (log.cacheCreationInputTokens !== null) {
|
|
148
|
-
totalCacheCreationInputTokens += log.cacheCreationInputTokens;
|
|
149
|
-
}
|
|
150
|
-
if (log.cacheReadInputTokens !== null) {
|
|
151
|
-
totalCacheReadInputTokens += log.cacheReadInputTokens;
|
|
152
|
-
}
|
|
153
|
-
if (log.elapsedMs !== null) {
|
|
154
|
-
totalElapsedMs += log.elapsedMs;
|
|
155
|
-
maxElapsedMs = maxElapsedMs === null ? log.elapsedMs : Math.max(maxElapsedMs, log.elapsedMs);
|
|
156
|
-
}
|
|
157
|
-
toolCallCount += extractToolTraceEvents(log).length;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
return {
|
|
161
|
-
llmCallCount: logs.length,
|
|
162
|
-
toolCallCount,
|
|
163
|
-
failedCallCount,
|
|
164
|
-
pendingCallCount,
|
|
165
|
-
slowCallCount,
|
|
166
|
-
totalInputTokens,
|
|
167
|
-
totalOutputTokens,
|
|
168
|
-
totalCacheCreationInputTokens,
|
|
169
|
-
totalCacheReadInputTokens,
|
|
170
|
-
totalElapsedMs,
|
|
171
|
-
maxElapsedMs,
|
|
172
|
-
startedAt: logs[0]?.timestamp ?? null,
|
|
173
|
-
endedAt: logs[logs.length - 1]?.timestamp ?? null,
|
|
174
|
-
knowledgeCandidateCount,
|
|
175
|
-
};
|
|
176
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
|
-
import { Slot } from "radix-ui";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
|
|
5
|
-
import { cn } from "../../lib/utils";
|
|
6
|
-
|
|
7
|
-
const badgeVariants = cva(
|
|
8
|
-
"inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
|
|
9
|
-
{
|
|
10
|
-
variants: {
|
|
11
|
-
variant: {
|
|
12
|
-
default: "bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
13
|
-
secondary: "bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
|
|
14
|
-
destructive:
|
|
15
|
-
"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
16
|
-
outline:
|
|
17
|
-
"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
18
|
-
ghost: "[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
19
|
-
link: "text-primary underline-offset-4 [a&]:hover:underline",
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
defaultVariants: {
|
|
23
|
-
variant: "default",
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
function Badge({
|
|
29
|
-
className,
|
|
30
|
-
variant = "default",
|
|
31
|
-
asChild = false,
|
|
32
|
-
...props
|
|
33
|
-
}: React.ComponentProps<"span"> &
|
|
34
|
-
VariantProps<typeof badgeVariants> & { asChild?: boolean }): React.JSX.Element {
|
|
35
|
-
const Comp = asChild ? Slot.Root : "span";
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<Comp
|
|
39
|
-
data-slot="badge"
|
|
40
|
-
data-variant={variant}
|
|
41
|
-
className={cn(badgeVariants({ variant }), className)}
|
|
42
|
-
{...props}
|
|
43
|
-
/>
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export { Badge, badgeVariants };
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
|
|
4
|
-
import { cn } from "../../lib/utils";
|
|
5
|
-
|
|
6
|
-
const buttonVariants = cva(
|
|
7
|
-
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
8
|
-
{
|
|
9
|
-
variants: {
|
|
10
|
-
variant: {
|
|
11
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
12
|
-
destructive: "bg-destructive text-white hover:bg-destructive/90",
|
|
13
|
-
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
14
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
15
|
-
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
16
|
-
link: "text-primary underline-offset-4 hover:underline",
|
|
17
|
-
},
|
|
18
|
-
size: {
|
|
19
|
-
default: "h-9 px-4 py-2",
|
|
20
|
-
sm: "h-8 rounded-md px-3 text-xs",
|
|
21
|
-
lg: "h-10 rounded-md px-8",
|
|
22
|
-
icon: "size-9",
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
defaultVariants: {
|
|
26
|
-
variant: "default",
|
|
27
|
-
size: "default",
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
function Button({
|
|
33
|
-
className,
|
|
34
|
-
variant,
|
|
35
|
-
size,
|
|
36
|
-
...props
|
|
37
|
-
}: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants>): React.JSX.Element {
|
|
38
|
-
return (
|
|
39
|
-
<button
|
|
40
|
-
data-slot="button"
|
|
41
|
-
className={cn(buttonVariants({ variant, size, className }))}
|
|
42
|
-
{...props}
|
|
43
|
-
/>
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export { Button, buttonVariants };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Collapsible as CollapsiblePrimitive } from "radix-ui";
|
|
2
|
-
|
|
3
|
-
function Collapsible({
|
|
4
|
-
...props
|
|
5
|
-
}: React.ComponentProps<typeof CollapsiblePrimitive.Root>): React.JSX.Element {
|
|
6
|
-
return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
function CollapsibleTrigger({
|
|
10
|
-
...props
|
|
11
|
-
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>): React.JSX.Element {
|
|
12
|
-
return <CollapsiblePrimitive.CollapsibleTrigger data-slot="collapsible-trigger" {...props} />;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function CollapsibleContent({
|
|
16
|
-
...props
|
|
17
|
-
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>): React.JSX.Element {
|
|
18
|
-
return <CollapsiblePrimitive.CollapsibleContent data-slot="collapsible-content" {...props} />;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { type JSX } from "react";
|
|
2
|
-
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "../ui/dialog";
|
|
3
|
-
import { Button } from "../ui/button";
|
|
4
|
-
|
|
5
|
-
export type ConfirmDialogVariant = "default" | "destructive";
|
|
6
|
-
|
|
7
|
-
export type ConfirmDialogProps = {
|
|
8
|
-
open: boolean;
|
|
9
|
-
onOpenChange: (open: boolean) => void;
|
|
10
|
-
title: string;
|
|
11
|
-
description: string;
|
|
12
|
-
confirmLabel?: string;
|
|
13
|
-
variant?: ConfirmDialogVariant;
|
|
14
|
-
onConfirm: () => void;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export function ConfirmDialog({
|
|
18
|
-
open,
|
|
19
|
-
onOpenChange,
|
|
20
|
-
title,
|
|
21
|
-
description,
|
|
22
|
-
confirmLabel = "Confirm",
|
|
23
|
-
variant = "default",
|
|
24
|
-
onConfirm,
|
|
25
|
-
}: ConfirmDialogProps): JSX.Element {
|
|
26
|
-
return (
|
|
27
|
-
<Dialog open={open} onOpenChange={onOpenChange}>
|
|
28
|
-
<DialogContent>
|
|
29
|
-
<DialogHeader>
|
|
30
|
-
<DialogTitle>{title}</DialogTitle>
|
|
31
|
-
</DialogHeader>
|
|
32
|
-
<p className="text-sm text-muted-foreground">{description}</p>
|
|
33
|
-
<div className="flex justify-end gap-2 pt-2">
|
|
34
|
-
<Button variant="outline" size="sm" onClick={() => onOpenChange(false)}>
|
|
35
|
-
Cancel
|
|
36
|
-
</Button>
|
|
37
|
-
<Button
|
|
38
|
-
variant={variant}
|
|
39
|
-
size="sm"
|
|
40
|
-
onClick={() => {
|
|
41
|
-
onConfirm();
|
|
42
|
-
onOpenChange(false);
|
|
43
|
-
}}
|
|
44
|
-
>
|
|
45
|
-
{confirmLabel}
|
|
46
|
-
</Button>
|
|
47
|
-
</div>
|
|
48
|
-
</DialogContent>
|
|
49
|
-
</Dialog>
|
|
50
|
-
);
|
|
51
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { JSX } from "react";
|
|
2
|
-
import { cn } from "../../lib/utils";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Small inline-SVG crab mark used in the inspector header. Stroke-based so
|
|
6
|
-
* the colour follows `currentColor` — pair with a Tailwind text colour class
|
|
7
|
-
* (e.g. `text-amber-500`) to recolour without editing the SVG. Sized to
|
|
8
|
-
* match the title text by default; pass `className` to override.
|
|
9
|
-
*
|
|
10
|
-
* Plays on the project owner's `TonyClaw` handle and keeps the title bar
|
|
11
|
-
* visually distinct in the same way Claude Code's CLI uses a small
|
|
12
|
-
* block-cursor mark next to its name.
|
|
13
|
-
*/
|
|
14
|
-
export function CrabLogo({ className }: { className?: string }): JSX.Element {
|
|
15
|
-
return (
|
|
16
|
-
<svg
|
|
17
|
-
viewBox="0 0 24 24"
|
|
18
|
-
fill="none"
|
|
19
|
-
stroke="currentColor"
|
|
20
|
-
strokeWidth="1.5"
|
|
21
|
-
strokeLinecap="round"
|
|
22
|
-
strokeLinejoin="round"
|
|
23
|
-
aria-hidden="true"
|
|
24
|
-
className={cn("inline-block size-5", className)}
|
|
25
|
-
>
|
|
26
|
-
{/* Body */}
|
|
27
|
-
<path d="M5 13 C5 9 8 7 12 7 C16 7 19 9 19 13 C19 16 16 18 12 18 C8 18 5 16 5 13 Z" />
|
|
28
|
-
{/* Left claw */}
|
|
29
|
-
<path d="M5 11 C3.5 9.5 1.5 10 2 12.5 C2.5 14 4 13.5 5 12.5" />
|
|
30
|
-
{/* Right claw */}
|
|
31
|
-
<path d="M19 11 C20.5 9.5 22.5 10 22 12.5 C21.5 14 20 13.5 19 12.5" />
|
|
32
|
-
{/* Eye stalks */}
|
|
33
|
-
<line x1="10" y1="7" x2="9.5" y2="5" />
|
|
34
|
-
<line x1="14" y1="7" x2="14.5" y2="5" />
|
|
35
|
-
{/* Eyes */}
|
|
36
|
-
<circle cx="9.5" cy="4.5" r="0.9" fill="currentColor" stroke="none" />
|
|
37
|
-
<circle cx="14.5" cy="4.5" r="0.9" fill="currentColor" stroke="none" />
|
|
38
|
-
{/* Legs */}
|
|
39
|
-
<line x1="6.5" y1="16" x2="4.5" y2="19.5" />
|
|
40
|
-
<line x1="9" y1="17.5" x2="8" y2="20.5" />
|
|
41
|
-
<line x1="15" y1="17.5" x2="16" y2="20.5" />
|
|
42
|
-
<line x1="17.5" y1="16" x2="19.5" y2="19.5" />
|
|
43
|
-
</svg>
|
|
44
|
-
);
|
|
45
|
-
}
|