@pennyfarthing/cyclist 10.4.0 → 11.0.0
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/dist/api/agent-load.d.ts +1 -2
- package/dist/api/agent-load.d.ts.map +1 -1
- package/dist/api/agent-load.js +2 -123
- package/dist/api/agent-load.js.map +1 -1
- package/dist/api/audit-log.d.ts +1 -17
- package/dist/api/audit-log.d.ts.map +1 -1
- package/dist/api/audit-log.js +2 -162
- package/dist/api/audit-log.js.map +1 -1
- package/dist/api/background-tasks.d.ts +1 -26
- package/dist/api/background-tasks.d.ts.map +1 -1
- package/dist/api/background-tasks.js +2 -55
- package/dist/api/background-tasks.js.map +1 -1
- package/dist/api/bell.d.ts +1 -18
- package/dist/api/bell.d.ts.map +1 -1
- package/dist/api/bell.js +2 -33
- package/dist/api/bell.js.map +1 -1
- package/dist/api/code-markers.d.ts +1 -8
- package/dist/api/code-markers.d.ts.map +1 -1
- package/dist/api/code-markers.js +2 -61
- package/dist/api/code-markers.js.map +1 -1
- package/dist/api/complexity.d.ts +1 -2
- package/dist/api/complexity.d.ts.map +1 -1
- package/dist/api/complexity.js +2 -46
- package/dist/api/complexity.js.map +1 -1
- package/dist/api/context.d.ts +1 -37
- package/dist/api/context.d.ts.map +1 -1
- package/dist/api/context.js +2 -143
- package/dist/api/context.js.map +1 -1
- package/dist/api/dead-code.d.ts +1 -2
- package/dist/api/dead-code.d.ts.map +1 -1
- package/dist/api/dead-code.js +2 -69
- package/dist/api/dead-code.js.map +1 -1
- package/dist/api/dependencies.d.ts +1 -2
- package/dist/api/dependencies.d.ts.map +1 -1
- package/dist/api/dependencies.js +2 -42
- package/dist/api/dependencies.js.map +1 -1
- package/dist/api/evaluation.d.ts +1 -19
- package/dist/api/evaluation.d.ts.map +1 -1
- package/dist/api/evaluation.js +2 -127
- package/dist/api/evaluation.js.map +1 -1
- package/dist/api/file-browser.d.ts +1 -8
- package/dist/api/file-browser.d.ts.map +1 -1
- package/dist/api/file-browser.js +2 -114
- package/dist/api/file-browser.js.map +1 -1
- package/dist/api/git.d.ts +1 -46
- package/dist/api/git.d.ts.map +1 -1
- package/dist/api/git.js +2 -354
- package/dist/api/git.js.map +1 -1
- package/dist/api/health-score.d.ts +1 -2
- package/dist/api/health-score.d.ts.map +1 -1
- package/dist/api/health-score.js +2 -46
- package/dist/api/health-score.js.map +1 -1
- package/dist/api/hook-request.d.ts +1 -40
- package/dist/api/hook-request.d.ts.map +1 -1
- package/dist/api/hook-request.js +2 -277
- package/dist/api/hook-request.js.map +1 -1
- package/dist/api/hotspots.d.ts +1 -2
- package/dist/api/hotspots.d.ts.map +1 -1
- package/dist/api/hotspots.js +2 -61
- package/dist/api/hotspots.js.map +1 -1
- package/dist/api/identity.d.ts +1 -16
- package/dist/api/identity.d.ts.map +1 -1
- package/dist/api/identity.js +2 -78
- package/dist/api/identity.js.map +1 -1
- package/dist/api/index.d.ts +1 -34
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +2 -44
- package/dist/api/index.js.map +1 -1
- package/dist/api/mode.d.ts +1 -22
- package/dist/api/mode.d.ts.map +1 -1
- package/dist/api/mode.js +2 -37
- package/dist/api/mode.js.map +1 -1
- package/dist/api/otlp.d.ts +1 -2
- package/dist/api/otlp.d.ts.map +1 -1
- package/dist/api/otlp.js +2 -46
- package/dist/api/otlp.js.map +1 -1
- package/dist/api/permissions.d.ts +1 -15
- package/dist/api/permissions.d.ts.map +1 -1
- package/dist/api/permissions.js +2 -66
- package/dist/api/permissions.js.map +1 -1
- package/dist/api/persona.d.ts +1 -8
- package/dist/api/persona.d.ts.map +1 -1
- package/dist/api/persona.js +2 -67
- package/dist/api/persona.js.map +1 -1
- package/dist/api/portrait.d.ts +1 -5
- package/dist/api/portrait.d.ts.map +1 -1
- package/dist/api/portrait.js +2 -27
- package/dist/api/portrait.js.map +1 -1
- package/dist/api/settings.d.ts +1 -53
- package/dist/api/settings.d.ts.map +1 -1
- package/dist/api/settings.js +2 -464
- package/dist/api/settings.js.map +1 -1
- package/dist/api/spans.d.ts +1 -16
- package/dist/api/spans.d.ts.map +1 -1
- package/dist/api/spans.js +2 -244
- package/dist/api/spans.js.map +1 -1
- package/dist/api/stats.d.ts +1 -12
- package/dist/api/stats.d.ts.map +1 -1
- package/dist/api/stats.js +2 -84
- package/dist/api/stats.js.map +1 -1
- package/dist/api/story.d.ts +1 -2
- package/dist/api/story.d.ts.map +1 -1
- package/dist/api/story.js +2 -14
- package/dist/api/story.js.map +1 -1
- package/dist/api/telemetry.d.ts +1 -18
- package/dist/api/telemetry.d.ts.map +1 -1
- package/dist/api/telemetry.js +2 -164
- package/dist/api/telemetry.js.map +1 -1
- package/dist/api/theme-agents.d.ts +1 -60
- package/dist/api/theme-agents.d.ts.map +1 -1
- package/dist/api/theme-agents.js +2 -213
- package/dist/api/theme-agents.js.map +1 -1
- package/dist/api/todos.d.ts +1 -32
- package/dist/api/todos.d.ts.map +1 -1
- package/dist/api/todos.js +2 -43
- package/dist/api/todos.js.map +1 -1
- package/dist/api/token-stats.d.ts +1 -7
- package/dist/api/token-stats.d.ts.map +1 -1
- package/dist/api/token-stats.js +2 -35
- package/dist/api/token-stats.js.map +1 -1
- package/dist/api/welcome.d.ts +1 -21
- package/dist/api/welcome.d.ts.map +1 -1
- package/dist/api/welcome.js +2 -34
- package/dist/api/welcome.js.map +1 -1
- package/dist/bikerack.js +2 -2
- package/dist/bikerack.js.map +1 -1
- package/dist/env.d.ts +6 -0
- package/dist/env.d.ts.map +1 -0
- package/dist/env.js +10 -0
- package/dist/env.js.map +1 -0
- package/dist/focus.d.ts +53 -0
- package/dist/focus.d.ts.map +1 -0
- package/dist/focus.js +122 -0
- package/dist/focus.js.map +1 -0
- package/dist/git-cache.d.ts +1 -0
- package/dist/git-cache.d.ts.map +1 -1
- package/dist/git-cache.js +3 -1
- package/dist/git-cache.js.map +1 -1
- package/dist/menu-builder.d.ts.map +1 -1
- package/dist/menu-builder.js +0 -1
- package/dist/menu-builder.js.map +1 -1
- package/dist/prime.d.ts +3 -3
- package/dist/prime.d.ts.map +1 -1
- package/dist/prime.js +38 -14
- package/dist/prime.js.map +1 -1
- package/dist/public/css/react.css +1 -1
- package/dist/public/js/react/react.js +53 -61
- package/dist/server.d.ts +18 -85
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +105 -405
- package/dist/server.js.map +1 -1
- package/dist/sprint-data.d.ts +1 -1
- package/dist/sprint-data.d.ts.map +1 -1
- package/dist/sprint-data.js +2 -2
- package/dist/sprint-data.js.map +1 -1
- package/dist/theme-metadata.d.ts +3 -3
- package/dist/theme-metadata.d.ts.map +1 -1
- package/dist/theme-metadata.js +4 -4
- package/dist/theme-metadata.js.map +1 -1
- package/dist/websocket.d.ts +2 -0
- package/dist/websocket.d.ts.map +1 -1
- package/dist/websocket.js +53 -75
- package/dist/websocket.js.map +1 -1
- package/package.json +2 -6
- package/portraits/hogans-heroes/large/burkhalter-35312.png +0 -0
- package/portraits/hogans-heroes/large/carter-34352.png +0 -0
- package/portraits/hogans-heroes/large/hochstetter-45314.png +0 -0
- package/portraits/hogans-heroes/large/hogan-44541.png +0 -0
- package/portraits/hogans-heroes/large/kinch-35241.png +0 -0
- package/portraits/hogans-heroes/large/klink-23434.png +0 -0
- package/portraits/hogans-heroes/large/lebeau-45443.png +0 -0
- package/portraits/hogans-heroes/large/marya-53543.png +0 -0
- package/portraits/hogans-heroes/large/newkirk-54432.png +0 -0
- package/portraits/hogans-heroes/large/schultz-42453.png +0 -0
- package/portraits/hogans-heroes/large/underground-55131.png +0 -0
- package/portraits/hogans-heroes/medium/burkhalter-35312.png +0 -0
- package/portraits/hogans-heroes/medium/carter-34352.png +0 -0
- package/portraits/hogans-heroes/medium/hochstetter-45314.png +0 -0
- package/portraits/hogans-heroes/medium/hogan-44541.png +0 -0
- package/portraits/hogans-heroes/medium/kinch-35241.png +0 -0
- package/portraits/hogans-heroes/medium/klink-23434.png +0 -0
- package/portraits/hogans-heroes/medium/lebeau-45443.png +0 -0
- package/portraits/hogans-heroes/medium/marya-53543.png +0 -0
- package/portraits/hogans-heroes/medium/newkirk-54432.png +0 -0
- package/portraits/hogans-heroes/medium/schultz-42453.png +0 -0
- package/portraits/hogans-heroes/medium/underground-55131.png +0 -0
- package/portraits/monty-python/large/announcer-44441.png +0 -0
- package/portraits/monty-python/large/arguer-35412.png +0 -0
- package/portraits/monty-python/large/bicycle-repair-man-35241.png +0 -0
- package/portraits/monty-python/large/colonel-35423.png +0 -0
- package/portraits/monty-python/large/counsellor-45341.png +0 -0
- package/portraits/monty-python/large/gumbys-23524.png +0 -0
- package/portraits/monty-python/large/nudge-43533.png +0 -0
- package/portraits/monty-python/large/praline-45413.png +0 -0
- package/portraits/monty-python/large/silly-walks-55322.png +0 -0
- package/portraits/monty-python/large/wensleydale-54451.png +0 -0
- package/portraits/monty-python/large/xim-nez-43534.png +0 -0
- package/portraits/monty-python/medium/announcer-44441.png +0 -0
- package/portraits/monty-python/medium/arguer-35412.png +0 -0
- package/portraits/monty-python/medium/bicycle-repair-man-35241.png +0 -0
- package/portraits/monty-python/medium/colonel-35423.png +0 -0
- package/portraits/monty-python/medium/counsellor-45341.png +0 -0
- package/portraits/monty-python/medium/gumbys-23524.png +0 -0
- package/portraits/monty-python/medium/nudge-43533.png +0 -0
- package/portraits/monty-python/medium/praline-45413.png +0 -0
- package/portraits/monty-python/medium/silly-walks-55322.png +0 -0
- package/portraits/monty-python/medium/wensleydale-54451.png +0 -0
- package/portraits/monty-python/medium/xim-nez-43534.png +0 -0
- package/portraits/stephen-king/large/andy-55231.png +0 -0
- package/portraits/stephen-king/large/christine-25112.png +0 -0
- package/portraits/stephen-king/large/danny-53243.png +0 -0
- package/portraits/stephen-king/large/flagg-55311.png +0 -0
- package/portraits/stephen-king/large/gaunt-54421.png +0 -0
- package/portraits/stephen-king/large/jack-44224.png +0 -0
- package/portraits/stephen-king/large/johnny-44353.png +0 -0
- package/portraits/stephen-king/large/margaret-15415.png +0 -0
- package/portraits/stephen-king/large/paul-45233.png +0 -0
- package/portraits/stephen-king/large/pennywise-54411.png +0 -0
- package/portraits/stephen-king/large/roland-35121.png +0 -0
- package/portraits/stephen-king/medium/andy-55231.png +0 -0
- package/portraits/stephen-king/medium/christine-25112.png +0 -0
- package/portraits/stephen-king/medium/danny-53243.png +0 -0
- package/portraits/stephen-king/medium/flagg-55311.png +0 -0
- package/portraits/stephen-king/medium/gaunt-54421.png +0 -0
- package/portraits/stephen-king/medium/jack-44224.png +0 -0
- package/portraits/stephen-king/medium/johnny-44353.png +0 -0
- package/portraits/stephen-king/medium/margaret-15415.png +0 -0
- package/portraits/stephen-king/medium/paul-45233.png +0 -0
- package/portraits/stephen-king/medium/pennywise-54411.png +0 -0
- package/portraits/stephen-king/medium/roland-35121.png +0 -0
- package/portraits/star-trek-tng/large/beverly-44352.png +0 -0
- package/portraits/star-trek-tng/large/data-55241.png +0 -0
- package/portraits/star-trek-tng/large/deanna-43353.png +0 -0
- package/portraits/star-trek-tng/large/geordi-54342.png +0 -0
- package/portraits/star-trek-tng/large/jean-luc-45342.png +0 -0
- package/portraits/star-trek-tng/large/kathryn-45332.png +0 -0
- package/portraits/star-trek-tng/large/miles-35342.png +0 -0
- package/portraits/star-trek-tng/large/q-53521.png +0 -0
- package/portraits/star-trek-tng/large/spock-45231.png +0 -0
- package/portraits/star-trek-tng/large/troi-44352.png +0 -0
- package/portraits/star-trek-tng/medium/beverly-44352.png +0 -0
- package/portraits/star-trek-tng/medium/data-55241.png +0 -0
- package/portraits/star-trek-tng/medium/deanna-43353.png +0 -0
- package/portraits/star-trek-tng/medium/geordi-54342.png +0 -0
- package/portraits/star-trek-tng/medium/jean-luc-45342.png +0 -0
- package/portraits/star-trek-tng/medium/kathryn-45332.png +0 -0
- package/portraits/star-trek-tng/medium/miles-35342.png +0 -0
- package/portraits/star-trek-tng/medium/q-53521.png +0 -0
- package/portraits/star-trek-tng/medium/spock-45231.png +0 -0
- package/portraits/star-trek-tng/medium/troi-44352.png +0 -0
- package/src/public/App.tsx +0 -340
- package/src/public/components/AgentLoadDialog.tsx +0 -202
- package/src/public/components/AgentPopup.tsx +0 -308
- package/src/public/components/ApprovalModal/ApprovalModal.css +0 -35
- package/src/public/components/ApprovalModal/index.tsx +0 -632
- package/src/public/components/BikeRackIndex.tsx +0 -54
- package/src/public/components/BikeRackWorkspace.tsx +0 -142
- package/src/public/components/CommandPalette.tsx +0 -555
- package/src/public/components/ConfirmDialog.tsx +0 -168
- package/src/public/components/ContextIndicator/ContextIndicator.css +0 -85
- package/src/public/components/ContextIndicator/index.tsx +0 -330
- package/src/public/components/ContextSparkline.tsx +0 -56
- package/src/public/components/ControlBar.tsx +0 -636
- package/src/public/components/DeadCodeDialog.tsx +0 -169
- package/src/public/components/DiffViewer.tsx +0 -585
- package/src/public/components/DockviewWorkspace.tsx +0 -737
- package/src/public/components/Editor.tsx +0 -630
- package/src/public/components/ErrorBoundary.tsx +0 -67
- package/src/public/components/FileTree.tsx +0 -379
- package/src/public/components/FontPicker/FontPicker.css +0 -276
- package/src/public/components/FontPicker/index.tsx +0 -430
- package/src/public/components/FullFileTree.tsx +0 -237
- package/src/public/components/HealthGauge.tsx +0 -181
- package/src/public/components/Message.tsx +0 -225
- package/src/public/components/MessageList.tsx +0 -98
- package/src/public/components/MessageView.tsx +0 -400
- package/src/public/components/ModeSwitch/ModeSwitch.css +0 -165
- package/src/public/components/ModeSwitch/index.tsx +0 -372
- package/src/public/components/PersonaHeader.tsx +0 -240
- package/src/public/components/QuickActions.tsx +0 -267
- package/src/public/components/SpanTimeline.tsx +0 -352
- package/src/public/components/StandalonePanel.tsx +0 -84
- package/src/public/components/StatsStrip.tsx +0 -162
- package/src/public/components/StreamingContent.tsx +0 -77
- package/src/public/components/SubagentSpan.tsx +0 -180
- package/src/public/components/TandemPortrait.tsx +0 -72
- package/src/public/components/ThemePalette/ThemePalette.css +0 -179
- package/src/public/components/ThemePalette/index.tsx +0 -326
- package/src/public/components/ToolCallBlock.tsx +0 -252
- package/src/public/components/ToolStack.tsx +0 -209
- package/src/public/components/ToolStatus.tsx +0 -57
- package/src/public/components/dialogs/CodeMarkersDialog.tsx +0 -169
- package/src/public/components/dialogs/ComplexityDialog.tsx +0 -163
- package/src/public/components/dialogs/DependenciesDialog.tsx +0 -120
- package/src/public/components/dialogs/HotspotsDialog.tsx +0 -451
- package/src/public/components/dialogs/ToolDialog.tsx +0 -43
- package/src/public/components/panel-registry.ts +0 -11
- package/src/public/components/panels/ACPanel.tsx +0 -93
- package/src/public/components/panels/AcceptanceCriteriaPanel.tsx +0 -104
- package/src/public/components/panels/AuditLogPanel.tsx +0 -465
- package/src/public/components/panels/BackgroundPanel.tsx +0 -115
- package/src/public/components/panels/BikeLanePanel.tsx +0 -214
- package/src/public/components/panels/ChangedPanel.tsx +0 -65
- package/src/public/components/panels/DebugPanel.tsx +0 -344
- package/src/public/components/panels/DiffsPanel.tsx +0 -155
- package/src/public/components/panels/GitPanel.tsx +0 -216
- package/src/public/components/panels/HotspotsPanel.tsx +0 -365
- package/src/public/components/panels/MessagePanel.tsx +0 -497
- package/src/public/components/panels/SettingsPanel.tsx +0 -453
- package/src/public/components/panels/SprintPanel.tsx +0 -670
- package/src/public/components/panels/TTYPanel.tsx +0 -299
- package/src/public/components/panels/TodoPanel.tsx +0 -142
- package/src/public/components/panels/WorkflowPanel.tsx +0 -224
- package/src/public/components/panels/index.ts +0 -24
- package/src/public/components/ui/alert-dialog.tsx +0 -139
- package/src/public/components/ui/badge.tsx +0 -36
- package/src/public/components/ui/button.tsx +0 -57
- package/src/public/components/ui/checkbox.tsx +0 -28
- package/src/public/components/ui/collapsible.tsx +0 -9
- package/src/public/components/ui/command.tsx +0 -151
- package/src/public/components/ui/dialog.tsx +0 -120
- package/src/public/components/ui/popover.tsx +0 -31
- package/src/public/components/ui/progress.tsx +0 -28
- package/src/public/components/ui/scroll-area.tsx +0 -46
- package/src/public/components/ui/select.tsx +0 -157
- package/src/public/components/ui/separator.tsx +0 -29
- package/src/public/components/ui/skeleton.tsx +0 -15
- package/src/public/components/ui/switch.tsx +0 -27
- package/src/public/components/ui/toggle-group.tsx +0 -59
- package/src/public/components/ui/toggle.tsx +0 -43
- package/src/public/components/ui/tooltip.tsx +0 -30
- package/src/public/contexts/ClaudeContext.tsx +0 -311
- package/src/public/contexts/MessageQueueContext.tsx +0 -143
- package/src/public/css/theme-browser.css +0 -550
- package/src/public/css/theme-system.css +0 -630
- package/src/public/hooks/index.ts +0 -49
- package/src/public/hooks/useAgentLoad.ts +0 -105
- package/src/public/hooks/useBackgroundTasks.ts +0 -131
- package/src/public/hooks/useClaude.ts +0 -234
- package/src/public/hooks/useCodeMarkers.ts +0 -101
- package/src/public/hooks/useColorScheme.ts +0 -42
- package/src/public/hooks/useCommandHistory.ts +0 -99
- package/src/public/hooks/useComplexity.ts +0 -80
- package/src/public/hooks/useDeadCode.ts +0 -99
- package/src/public/hooks/useDependencies.ts +0 -82
- package/src/public/hooks/useDiffs.ts +0 -143
- package/src/public/hooks/useFileBrowser.ts +0 -71
- package/src/public/hooks/useGitStatus.ts +0 -233
- package/src/public/hooks/useHealthScore.ts +0 -69
- package/src/public/hooks/useHotspots.ts +0 -123
- package/src/public/hooks/useLayoutPersistence.ts +0 -138
- package/src/public/hooks/useMarkdownParser.ts +0 -36
- package/src/public/hooks/useMarkerActions.ts +0 -234
- package/src/public/hooks/useMessageQueue.ts +0 -380
- package/src/public/hooks/useMessageStream.ts +0 -131
- package/src/public/hooks/usePersona.ts +0 -112
- package/src/public/hooks/usePlanModeExit.ts +0 -105
- package/src/public/hooks/useResponsiveLayout.ts +0 -173
- package/src/public/hooks/useSprint.ts +0 -147
- package/src/public/hooks/useStatsStrip.ts +0 -204
- package/src/public/hooks/useStory.ts +0 -135
- package/src/public/hooks/useSubagentHelper.ts +0 -64
- package/src/public/hooks/useSyntaxHighlighter.ts +0 -52
- package/src/public/hooks/useTabCompletion.ts +0 -124
- package/src/public/hooks/useTodos.ts +0 -93
- package/src/public/hooks/useUserAvatar.ts +0 -54
- package/src/public/index.tsx +0 -10
- package/src/public/lib/utils.ts +0 -6
- package/src/public/styles/dockview-theme.css +0 -459
- package/src/public/styles/tailwind.css +0 -4396
- package/src/public/types/electron.d.ts +0 -18
- package/src/public/types/message.ts +0 -51
- package/src/public/utils/avatar-service.ts +0 -73
- package/src/public/utils/color-presets.ts +0 -940
- package/src/public/utils/font-presets.ts +0 -362
- package/src/public/utils/formatDuration.ts +0 -14
- package/src/public/utils/markdown.ts +0 -249
- package/src/public/utils/messageFilters.ts +0 -128
- package/src/public/utils/slash-commands.ts +0 -353
- package/src/public/utils/subagent-display.ts +0 -146
- package/src/public/utils/syntax.ts +0 -219
- package/src/public/utils/toolIntentSummarizer.ts +0 -199
- package/src/public/utils/toolStackGrouper.ts +0 -106
- package/src/public/utils/toolTypeColors.ts +0 -45
|
@@ -1,326 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ThemePalette Component
|
|
3
|
-
*
|
|
4
|
-
* A dropdown component for quick theme switching between color presets.
|
|
5
|
-
* Story MSSCI-12768 - Color Palette System
|
|
6
|
-
*
|
|
7
|
-
* Features:
|
|
8
|
-
* - Popover menu with presets grouped by variant (dark/light)
|
|
9
|
-
* - Searchable preset list via Command input
|
|
10
|
-
* - 4-swatch visual preview (bg, bgSecondary, text, accent)
|
|
11
|
-
* - Keyboard navigation (handled by Popover + Command primitives)
|
|
12
|
-
* - ARIA attributes for accessibility
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
import React, { useMemo, useState } from 'react';
|
|
16
|
-
import { Check, ChevronsUpDown } from 'lucide-react';
|
|
17
|
-
import { getPresetIds, getPreset } from '../../utils/color-presets';
|
|
18
|
-
import { cn } from '@/lib/utils';
|
|
19
|
-
import { Button } from '@/components/ui/button';
|
|
20
|
-
import { Popover, PopoverTrigger, PopoverContent } from '@/components/ui/popover';
|
|
21
|
-
import {
|
|
22
|
-
Command,
|
|
23
|
-
CommandInput,
|
|
24
|
-
CommandList,
|
|
25
|
-
CommandGroup,
|
|
26
|
-
CommandItem,
|
|
27
|
-
CommandEmpty,
|
|
28
|
-
} from '@/components/ui/command';
|
|
29
|
-
import './ThemePalette.css';
|
|
30
|
-
|
|
31
|
-
// =============================================================================
|
|
32
|
-
// Types
|
|
33
|
-
// =============================================================================
|
|
34
|
-
|
|
35
|
-
export interface ThemePaletteProps {
|
|
36
|
-
currentPreset: string;
|
|
37
|
-
onSelect?: (presetId: string) => void;
|
|
38
|
-
className?: string;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface RenderThemePaletteOptions {
|
|
42
|
-
currentPreset: string;
|
|
43
|
-
onSelect?: (presetId: string) => void;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// =============================================================================
|
|
47
|
-
// Helpers
|
|
48
|
-
// =============================================================================
|
|
49
|
-
|
|
50
|
-
interface GroupedPresets {
|
|
51
|
-
dark: string[];
|
|
52
|
-
light: string[];
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function groupPresetsByVariant(): GroupedPresets {
|
|
56
|
-
const ids = getPresetIds();
|
|
57
|
-
const dark: string[] = [];
|
|
58
|
-
const light: string[] = [];
|
|
59
|
-
|
|
60
|
-
for (const id of ids) {
|
|
61
|
-
const preset = getPreset(id);
|
|
62
|
-
if (!preset) continue;
|
|
63
|
-
if (preset.variant === 'light') {
|
|
64
|
-
light.push(id);
|
|
65
|
-
} else {
|
|
66
|
-
dark.push(id);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
dark.sort((a, b) => (getPreset(a)?.name || '').localeCompare(getPreset(b)?.name || ''));
|
|
71
|
-
light.sort((a, b) => (getPreset(a)?.name || '').localeCompare(getPreset(b)?.name || ''));
|
|
72
|
-
|
|
73
|
-
return { dark, light };
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// =============================================================================
|
|
77
|
-
// Swatch rendering
|
|
78
|
-
// =============================================================================
|
|
79
|
-
|
|
80
|
-
function PresetSwatches({ presetId }: { presetId: string }) {
|
|
81
|
-
const preset = getPreset(presetId);
|
|
82
|
-
if (!preset) return null;
|
|
83
|
-
|
|
84
|
-
return (
|
|
85
|
-
<div className="preset-swatches">
|
|
86
|
-
<span
|
|
87
|
-
className="preset-swatch"
|
|
88
|
-
style={{ backgroundColor: preset.colors.bgPrimary }}
|
|
89
|
-
title="Background"
|
|
90
|
-
/>
|
|
91
|
-
<span
|
|
92
|
-
className="preset-swatch"
|
|
93
|
-
style={{ backgroundColor: preset.colors.bgSecondary }}
|
|
94
|
-
title="Surface"
|
|
95
|
-
/>
|
|
96
|
-
<span
|
|
97
|
-
className="preset-swatch"
|
|
98
|
-
style={{ backgroundColor: preset.colors.textPrimary }}
|
|
99
|
-
title="Text"
|
|
100
|
-
/>
|
|
101
|
-
<span
|
|
102
|
-
className="preset-swatch"
|
|
103
|
-
style={{ backgroundColor: preset.colors.accent }}
|
|
104
|
-
title="Accent"
|
|
105
|
-
/>
|
|
106
|
-
</div>
|
|
107
|
-
);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// =============================================================================
|
|
111
|
-
// ThemePalette Component
|
|
112
|
-
// =============================================================================
|
|
113
|
-
|
|
114
|
-
export function ThemePalette({ currentPreset, onSelect, className = '' }: ThemePaletteProps) {
|
|
115
|
-
const [open, setOpen] = useState(false);
|
|
116
|
-
const grouped = useMemo(() => groupPresetsByVariant(), []);
|
|
117
|
-
const currentPresetData = getPreset(currentPreset);
|
|
118
|
-
|
|
119
|
-
const handleSelect = (presetId: string) => {
|
|
120
|
-
onSelect?.(presetId);
|
|
121
|
-
setOpen(false);
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
return (
|
|
125
|
-
<Popover open={open} onOpenChange={setOpen}>
|
|
126
|
-
<PopoverTrigger asChild>
|
|
127
|
-
<Button
|
|
128
|
-
variant="outline"
|
|
129
|
-
className={cn('theme-palette-button', className)}
|
|
130
|
-
aria-label={`Select theme, current: ${currentPresetData?.name || currentPreset}`}
|
|
131
|
-
>
|
|
132
|
-
<span className="theme-palette-current">
|
|
133
|
-
{currentPresetData && (
|
|
134
|
-
<span
|
|
135
|
-
className="preset-swatch"
|
|
136
|
-
style={{ backgroundColor: currentPresetData.colors.bgPrimary }}
|
|
137
|
-
/>
|
|
138
|
-
)}
|
|
139
|
-
<span className="theme-palette-name">
|
|
140
|
-
{currentPresetData?.name || currentPreset}
|
|
141
|
-
</span>
|
|
142
|
-
</span>
|
|
143
|
-
<ChevronsUpDown className="theme-palette-chevron" />
|
|
144
|
-
</Button>
|
|
145
|
-
</PopoverTrigger>
|
|
146
|
-
<PopoverContent className="theme-palette-popover p-0" align="start">
|
|
147
|
-
<Command>
|
|
148
|
-
<CommandInput placeholder="Search themes..." />
|
|
149
|
-
<CommandList>
|
|
150
|
-
<CommandEmpty>No theme found.</CommandEmpty>
|
|
151
|
-
<CommandGroup heading={`Dark (${grouped.dark.length})`}>
|
|
152
|
-
{grouped.dark.map((id) => {
|
|
153
|
-
const preset = getPreset(id);
|
|
154
|
-
if (!preset) return null;
|
|
155
|
-
const isActive = id === currentPreset;
|
|
156
|
-
return (
|
|
157
|
-
<CommandItem
|
|
158
|
-
key={id}
|
|
159
|
-
value={preset.name}
|
|
160
|
-
onSelect={() => handleSelect(id)}
|
|
161
|
-
data-preset-id={id}
|
|
162
|
-
>
|
|
163
|
-
<PresetSwatches presetId={id} />
|
|
164
|
-
<span className="preset-name">{preset.name}</span>
|
|
165
|
-
<Check
|
|
166
|
-
className={cn(
|
|
167
|
-
'preset-check-icon ml-auto',
|
|
168
|
-
isActive ? 'opacity-100' : 'opacity-0'
|
|
169
|
-
)}
|
|
170
|
-
/>
|
|
171
|
-
</CommandItem>
|
|
172
|
-
);
|
|
173
|
-
})}
|
|
174
|
-
</CommandGroup>
|
|
175
|
-
<CommandGroup heading={`Light (${grouped.light.length})`}>
|
|
176
|
-
{grouped.light.map((id) => {
|
|
177
|
-
const preset = getPreset(id);
|
|
178
|
-
if (!preset) return null;
|
|
179
|
-
const isActive = id === currentPreset;
|
|
180
|
-
return (
|
|
181
|
-
<CommandItem
|
|
182
|
-
key={id}
|
|
183
|
-
value={preset.name}
|
|
184
|
-
onSelect={() => handleSelect(id)}
|
|
185
|
-
data-preset-id={id}
|
|
186
|
-
>
|
|
187
|
-
<PresetSwatches presetId={id} />
|
|
188
|
-
<span className="preset-name">{preset.name}</span>
|
|
189
|
-
<Check
|
|
190
|
-
className={cn(
|
|
191
|
-
'preset-check-icon ml-auto',
|
|
192
|
-
isActive ? 'opacity-100' : 'opacity-0'
|
|
193
|
-
)}
|
|
194
|
-
/>
|
|
195
|
-
</CommandItem>
|
|
196
|
-
);
|
|
197
|
-
})}
|
|
198
|
-
</CommandGroup>
|
|
199
|
-
</CommandList>
|
|
200
|
-
</Command>
|
|
201
|
-
</PopoverContent>
|
|
202
|
-
</Popover>
|
|
203
|
-
);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
// =============================================================================
|
|
207
|
-
// Render Function (for vanilla JS usage)
|
|
208
|
-
// =============================================================================
|
|
209
|
-
|
|
210
|
-
export function renderThemePalette(
|
|
211
|
-
container: HTMLElement,
|
|
212
|
-
options: RenderThemePaletteOptions
|
|
213
|
-
): void {
|
|
214
|
-
const { currentPreset, onSelect } = options;
|
|
215
|
-
|
|
216
|
-
const wrapper = document.createElement('div');
|
|
217
|
-
wrapper.className = 'theme-palette';
|
|
218
|
-
|
|
219
|
-
const button = document.createElement('button');
|
|
220
|
-
button.className = 'theme-palette-button';
|
|
221
|
-
const preset = getPreset(currentPreset);
|
|
222
|
-
button.setAttribute('aria-label', `Select theme, current: ${preset?.name || currentPreset}`);
|
|
223
|
-
button.setAttribute('aria-expanded', 'false');
|
|
224
|
-
button.setAttribute('aria-haspopup', 'listbox');
|
|
225
|
-
|
|
226
|
-
button.innerHTML = `
|
|
227
|
-
<span class="theme-palette-current">
|
|
228
|
-
${preset ? `<span class="preset-swatch" style="background-color: ${preset.colors.bgPrimary}"></span>` : ''}
|
|
229
|
-
<span class="theme-palette-name">${preset?.name || currentPreset}</span>
|
|
230
|
-
</span>
|
|
231
|
-
<span class="theme-palette-chevron" aria-hidden="true">▼</span>
|
|
232
|
-
`;
|
|
233
|
-
|
|
234
|
-
const menu = document.createElement('div');
|
|
235
|
-
menu.className = 'theme-palette-menu';
|
|
236
|
-
menu.setAttribute('role', 'listbox');
|
|
237
|
-
menu.setAttribute('aria-label', 'Available themes');
|
|
238
|
-
|
|
239
|
-
const grouped = groupPresetsByVariant();
|
|
240
|
-
|
|
241
|
-
const renderGroup = (ids: string[], label: string) => {
|
|
242
|
-
const header = document.createElement('div');
|
|
243
|
-
header.className = 'preset-group-header';
|
|
244
|
-
header.setAttribute('role', 'presentation');
|
|
245
|
-
header.textContent = `${label} (${ids.length})`;
|
|
246
|
-
menu.appendChild(header);
|
|
247
|
-
|
|
248
|
-
ids.forEach((id) => {
|
|
249
|
-
const p = getPreset(id);
|
|
250
|
-
if (!p) return;
|
|
251
|
-
|
|
252
|
-
const option = document.createElement('button');
|
|
253
|
-
option.className = `theme-palette-option ${id === currentPreset ? 'active' : ''}`;
|
|
254
|
-
option.setAttribute('role', 'option');
|
|
255
|
-
option.setAttribute('aria-selected', id === currentPreset ? 'true' : 'false');
|
|
256
|
-
option.setAttribute('data-preset-id', id);
|
|
257
|
-
option.tabIndex = -1;
|
|
258
|
-
|
|
259
|
-
option.innerHTML = `
|
|
260
|
-
<div class="preset-swatches">
|
|
261
|
-
<span class="preset-swatch" style="background-color: ${p.colors.bgPrimary}" title="Background"></span>
|
|
262
|
-
<span class="preset-swatch" style="background-color: ${p.colors.bgSecondary}" title="Surface"></span>
|
|
263
|
-
<span class="preset-swatch" style="background-color: ${p.colors.textPrimary}" title="Text"></span>
|
|
264
|
-
<span class="preset-swatch" style="background-color: ${p.colors.accent}" title="Accent"></span>
|
|
265
|
-
</div>
|
|
266
|
-
<span class="preset-name">${p.name}</span>
|
|
267
|
-
${id === currentPreset ? '<span class="preset-check" aria-hidden="true">✓</span>' : ''}
|
|
268
|
-
`;
|
|
269
|
-
|
|
270
|
-
option.addEventListener('click', () => {
|
|
271
|
-
onSelect?.(id);
|
|
272
|
-
menu.classList.remove('open');
|
|
273
|
-
button.setAttribute('aria-expanded', 'false');
|
|
274
|
-
});
|
|
275
|
-
|
|
276
|
-
menu.appendChild(option);
|
|
277
|
-
});
|
|
278
|
-
};
|
|
279
|
-
|
|
280
|
-
renderGroup(grouped.dark, 'Dark');
|
|
281
|
-
renderGroup(grouped.light, 'Light');
|
|
282
|
-
|
|
283
|
-
// Toggle menu
|
|
284
|
-
button.addEventListener('click', () => {
|
|
285
|
-
const isOpen = menu.classList.toggle('open');
|
|
286
|
-
button.setAttribute('aria-expanded', isOpen ? 'true' : 'false');
|
|
287
|
-
});
|
|
288
|
-
|
|
289
|
-
// Close on click outside
|
|
290
|
-
document.addEventListener('click', (e) => {
|
|
291
|
-
if (!wrapper.contains(e.target as Node)) {
|
|
292
|
-
menu.classList.remove('open');
|
|
293
|
-
button.setAttribute('aria-expanded', 'false');
|
|
294
|
-
}
|
|
295
|
-
});
|
|
296
|
-
|
|
297
|
-
// Close on escape
|
|
298
|
-
document.addEventListener('keydown', (e) => {
|
|
299
|
-
if (e.key === 'Escape' && menu.classList.contains('open')) {
|
|
300
|
-
menu.classList.remove('open');
|
|
301
|
-
button.setAttribute('aria-expanded', 'false');
|
|
302
|
-
}
|
|
303
|
-
});
|
|
304
|
-
|
|
305
|
-
// Keyboard navigation
|
|
306
|
-
menu.addEventListener('keydown', (e) => {
|
|
307
|
-
const options = Array.from(menu.querySelectorAll('.theme-palette-option'));
|
|
308
|
-
const focusedIdx = options.findIndex((el) => el === document.activeElement);
|
|
309
|
-
|
|
310
|
-
if (e.key === 'ArrowDown') {
|
|
311
|
-
e.preventDefault();
|
|
312
|
-
const nextIndex = (focusedIdx + 1) % options.length;
|
|
313
|
-
(options[nextIndex] as HTMLElement).focus();
|
|
314
|
-
} else if (e.key === 'ArrowUp') {
|
|
315
|
-
e.preventDefault();
|
|
316
|
-
const prevIndex = (focusedIdx - 1 + options.length) % options.length;
|
|
317
|
-
(options[prevIndex] as HTMLElement).focus();
|
|
318
|
-
}
|
|
319
|
-
});
|
|
320
|
-
|
|
321
|
-
wrapper.appendChild(button);
|
|
322
|
-
wrapper.appendChild(menu);
|
|
323
|
-
container.appendChild(wrapper);
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
export default ThemePalette;
|
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ToolCallBlock Component
|
|
3
|
-
*
|
|
4
|
-
* Displays tool use and result in a distinct block.
|
|
5
|
-
* Story MSSCI-12698 - MessageView Component with Streaming
|
|
6
|
-
* Story MSSCI-13398 - Collapsible tool result display
|
|
7
|
-
* Story MSSCI-13402 - Tool use visual design polish
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import React, { useState, useMemo } from 'react';
|
|
11
|
-
import { Button } from '@/components/ui/button';
|
|
12
|
-
import { Badge } from '@/components/ui/badge';
|
|
13
|
-
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';
|
|
14
|
-
import { getToolTypeClass } from '../utils/toolTypeColors.js';
|
|
15
|
-
import { formatDuration } from '../utils/formatDuration.js';
|
|
16
|
-
import { generateToolIntentSummary } from '../utils/toolIntentSummarizer.js';
|
|
17
|
-
|
|
18
|
-
interface ToolUseMessage {
|
|
19
|
-
type: 'tool_use';
|
|
20
|
-
tool_name: string;
|
|
21
|
-
tool_id: string;
|
|
22
|
-
input: Record<string, unknown>;
|
|
23
|
-
timestamp: number;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
interface ToolResultMessage {
|
|
27
|
-
type: 'tool_result';
|
|
28
|
-
tool_id: string;
|
|
29
|
-
content: string;
|
|
30
|
-
timestamp: number;
|
|
31
|
-
/** Whether this result represents an error */
|
|
32
|
-
is_error?: boolean;
|
|
33
|
-
/** Duration in milliseconds */
|
|
34
|
-
durationMs?: number;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
interface ToolCallBlockProps {
|
|
38
|
-
toolUse: ToolUseMessage;
|
|
39
|
-
result?: ToolResultMessage;
|
|
40
|
-
className?: string;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const TRUNCATION_THRESHOLD = 50;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Count lines in content, handling both Unix and Windows line endings
|
|
47
|
-
*/
|
|
48
|
-
function countLines(content: string): number {
|
|
49
|
-
if (!content) return 0;
|
|
50
|
-
// Normalize CRLF to LF, then count
|
|
51
|
-
const normalized = content.replace(/\r\n/g, '\n');
|
|
52
|
-
return normalized.split('\n').length;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Get truncated content (first N lines)
|
|
57
|
-
*/
|
|
58
|
-
function getTruncatedContent(content: string, maxLines: number): string {
|
|
59
|
-
const normalized = content.replace(/\r\n/g, '\n');
|
|
60
|
-
const lines = normalized.split('\n');
|
|
61
|
-
return lines.slice(0, maxLines).join('\n');
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function formatToolInput(toolName: string, input: Record<string, unknown>): string {
|
|
65
|
-
// Display the most relevant input field based on tool type
|
|
66
|
-
if (toolName === 'Read' && input.file_path) {
|
|
67
|
-
return String(input.file_path);
|
|
68
|
-
}
|
|
69
|
-
if (toolName === 'Bash' && input.command) {
|
|
70
|
-
return String(input.command);
|
|
71
|
-
}
|
|
72
|
-
if (toolName === 'Glob' && input.pattern) {
|
|
73
|
-
return String(input.pattern);
|
|
74
|
-
}
|
|
75
|
-
if (toolName === 'Grep' && input.pattern) {
|
|
76
|
-
return String(input.pattern);
|
|
77
|
-
}
|
|
78
|
-
if (toolName === 'Write' && input.file_path) {
|
|
79
|
-
return String(input.file_path);
|
|
80
|
-
}
|
|
81
|
-
// Default: show JSON
|
|
82
|
-
return JSON.stringify(input, null, 2);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Get single-letter badge label for tool type
|
|
87
|
-
*/
|
|
88
|
-
export function getToolBadgeLabel(toolName: string): string {
|
|
89
|
-
const labels: Record<string, string> = {
|
|
90
|
-
Read: 'R',
|
|
91
|
-
Write: 'W',
|
|
92
|
-
Bash: 'B',
|
|
93
|
-
Glob: 'G',
|
|
94
|
-
Grep: 'S', // S for Search
|
|
95
|
-
Edit: 'E',
|
|
96
|
-
Task: 'T',
|
|
97
|
-
WebFetch: 'F',
|
|
98
|
-
WebSearch: 'W',
|
|
99
|
-
TodoWrite: 'D', // D for Do/Tasks
|
|
100
|
-
};
|
|
101
|
-
return labels[toolName] || toolName.charAt(0).toUpperCase();
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export default function ToolCallBlock({ toolUse, result, className }: ToolCallBlockProps): React.ReactElement {
|
|
105
|
-
// AC1: Start collapsed by default
|
|
106
|
-
const [isCollapsed, setIsCollapsed] = useState(true);
|
|
107
|
-
const [isPromptCollapsed, setIsPromptCollapsed] = useState(true);
|
|
108
|
-
// AC3: Track whether showing full content or truncated
|
|
109
|
-
const [showFullContent, setShowFullContent] = useState(false);
|
|
110
|
-
// AC4: Track copy state
|
|
111
|
-
const [copyState, setCopyState] = useState<'idle' | 'copied' | 'error'>('idle');
|
|
112
|
-
|
|
113
|
-
// MSSCI-13402: Determine error state for styling
|
|
114
|
-
const isError = result?.is_error === true;
|
|
115
|
-
const inputDisplay = formatToolInput(toolUse.tool_name, toolUse.input);
|
|
116
|
-
const paramCount = Object.keys(toolUse.input).length;
|
|
117
|
-
|
|
118
|
-
// MSSCI-13402: Get tool type CSS class
|
|
119
|
-
const toolTypeClass = getToolTypeClass(toolUse.tool_name);
|
|
120
|
-
|
|
121
|
-
// Generate human-readable intent summary (Story 74-1)
|
|
122
|
-
const intentSummary = useMemo(() => {
|
|
123
|
-
return generateToolIntentSummary(toolUse.tool_name, toolUse.input);
|
|
124
|
-
}, [toolUse.tool_name, toolUse.input]);
|
|
125
|
-
|
|
126
|
-
// AC2: Memoize line count for performance
|
|
127
|
-
const lineCount = useMemo(() => {
|
|
128
|
-
return result ? countLines(result.content) : 0;
|
|
129
|
-
}, [result?.content]);
|
|
130
|
-
|
|
131
|
-
// AC3: Determine if truncation applies
|
|
132
|
-
const shouldTruncate = lineCount > TRUNCATION_THRESHOLD;
|
|
133
|
-
const isTruncated = shouldTruncate && !showFullContent;
|
|
134
|
-
|
|
135
|
-
// AC3: Get display content (truncated or full)
|
|
136
|
-
const displayContent = useMemo(() => {
|
|
137
|
-
if (!result) return '';
|
|
138
|
-
if (isTruncated) {
|
|
139
|
-
return getTruncatedContent(result.content, TRUNCATION_THRESHOLD);
|
|
140
|
-
}
|
|
141
|
-
return result.content;
|
|
142
|
-
}, [result?.content, isTruncated]);
|
|
143
|
-
|
|
144
|
-
// AC4: Handle copy to clipboard
|
|
145
|
-
const handleCopy = async () => {
|
|
146
|
-
if (!result) return;
|
|
147
|
-
try {
|
|
148
|
-
await navigator.clipboard.writeText(result.content);
|
|
149
|
-
setCopyState('copied');
|
|
150
|
-
setTimeout(() => setCopyState('idle'), 2000);
|
|
151
|
-
} catch {
|
|
152
|
-
setCopyState('error');
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
// AC2: Format line count text
|
|
157
|
-
const lineCountText = lineCount === 1 ? '1 line' : `${lineCount} lines`;
|
|
158
|
-
|
|
159
|
-
// MSSCI-13402: Build class list with tool type and error state
|
|
160
|
-
const blockClasses = [
|
|
161
|
-
'tool-call-block',
|
|
162
|
-
toolTypeClass,
|
|
163
|
-
isError ? 'tool-error' : '',
|
|
164
|
-
className || '',
|
|
165
|
-
].filter(Boolean).join(' ');
|
|
166
|
-
|
|
167
|
-
// Get badge label for tool type
|
|
168
|
-
const badgeLabel = getToolBadgeLabel(toolUse.tool_name);
|
|
169
|
-
|
|
170
|
-
return (
|
|
171
|
-
<TooltipProvider delayDuration={300}>
|
|
172
|
-
<div data-testid="tool-call-block" className={blockClasses}>
|
|
173
|
-
<div className="tool-header">
|
|
174
|
-
{/* Tool type badge - colored pill for instant recognition */}
|
|
175
|
-
<Tooltip>
|
|
176
|
-
<TooltipTrigger asChild>
|
|
177
|
-
<Badge variant="default" className="tool-type-badge">
|
|
178
|
-
{badgeLabel}
|
|
179
|
-
</Badge>
|
|
180
|
-
</TooltipTrigger>
|
|
181
|
-
<TooltipContent>{toolUse.tool_name}</TooltipContent>
|
|
182
|
-
</Tooltip>
|
|
183
|
-
<span className="tool-name">{intentSummary}</span>
|
|
184
|
-
{/* MSSCI-13402: Duration display */}
|
|
185
|
-
<span data-testid="tool-duration" className="tool-duration">
|
|
186
|
-
{result?.durationMs !== undefined ? formatDuration(result.durationMs) : ''}
|
|
187
|
-
</span>
|
|
188
|
-
</div>
|
|
189
|
-
{/* Prompt section - collapsible tool input display */}
|
|
190
|
-
<div className="tool-result-header">
|
|
191
|
-
<Button
|
|
192
|
-
variant="ghost"
|
|
193
|
-
size="sm"
|
|
194
|
-
data-testid="tool-prompt-toggle"
|
|
195
|
-
className="tool-result-toggle"
|
|
196
|
-
onClick={() => setIsPromptCollapsed(!isPromptCollapsed)}
|
|
197
|
-
>
|
|
198
|
-
{isPromptCollapsed ? '▶' : '▼'} Prompt ({paramCount} {paramCount === 1 ? 'param' : 'params'})
|
|
199
|
-
</Button>
|
|
200
|
-
</div>
|
|
201
|
-
<div
|
|
202
|
-
data-testid="tool-prompt-content"
|
|
203
|
-
className={`tool-result-content ${isPromptCollapsed ? 'collapsed' : ''}`}
|
|
204
|
-
>
|
|
205
|
-
<pre>{inputDisplay}</pre>
|
|
206
|
-
</div>
|
|
207
|
-
{result && (
|
|
208
|
-
<>
|
|
209
|
-
<div className="tool-result-header">
|
|
210
|
-
<Button
|
|
211
|
-
variant="ghost"
|
|
212
|
-
size="sm"
|
|
213
|
-
data-testid="tool-result-toggle"
|
|
214
|
-
className="tool-result-toggle"
|
|
215
|
-
onClick={() => setIsCollapsed(!isCollapsed)}
|
|
216
|
-
>
|
|
217
|
-
{isCollapsed ? '▶' : '▼'} Result ({lineCountText})
|
|
218
|
-
</Button>
|
|
219
|
-
<Button
|
|
220
|
-
variant="ghost"
|
|
221
|
-
size="icon"
|
|
222
|
-
data-testid="tool-result-copy"
|
|
223
|
-
className={`tool-result-copy ${copyState === 'copied' ? 'copied' : ''} ${copyState === 'error' ? 'copy-error' : ''}`}
|
|
224
|
-
onClick={handleCopy}
|
|
225
|
-
aria-label="Copy result to clipboard"
|
|
226
|
-
>
|
|
227
|
-
{copyState === 'copied' ? '✓' : '📋'}
|
|
228
|
-
</Button>
|
|
229
|
-
</div>
|
|
230
|
-
<div
|
|
231
|
-
data-testid="tool-result-content"
|
|
232
|
-
className={`tool-result-content ${isCollapsed ? 'collapsed' : ''} ${isTruncated && !isCollapsed ? 'truncated' : ''} ${isError ? 'error-content' : ''}`}
|
|
233
|
-
>
|
|
234
|
-
<pre>{displayContent}</pre>
|
|
235
|
-
{shouldTruncate && !isCollapsed && isTruncated && (
|
|
236
|
-
<Button
|
|
237
|
-
variant="link"
|
|
238
|
-
size="sm"
|
|
239
|
-
data-testid="tool-result-expand"
|
|
240
|
-
className="tool-result-expand"
|
|
241
|
-
onClick={() => setShowFullContent(true)}
|
|
242
|
-
>
|
|
243
|
-
Show all ({lineCount} lines)
|
|
244
|
-
</Button>
|
|
245
|
-
)}
|
|
246
|
-
</div>
|
|
247
|
-
</>
|
|
248
|
-
)}
|
|
249
|
-
</div>
|
|
250
|
-
</TooltipProvider>
|
|
251
|
-
);
|
|
252
|
-
}
|