@assistant-ui/react-devtools 1.2.6 → 1.2.7
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/README.md +26 -8
- package/dist/DevToolsModal.d.ts +18 -2
- package/dist/DevToolsModal.d.ts.map +1 -1
- package/dist/DevToolsModal.js +25 -232
- package/dist/DevToolsModal.js.map +1 -1
- package/dist/DevToolsModalImpl.d.ts +11 -0
- package/dist/DevToolsModalImpl.d.ts.map +1 -0
- package/dist/DevToolsModalImpl.js +62 -0
- package/dist/DevToolsModalImpl.js.map +1 -0
- package/dist/data/createInProcessClient.d.ts +17 -0
- package/dist/data/createInProcessClient.d.ts.map +1 -0
- package/dist/data/createInProcessClient.js +54 -0
- package/dist/data/createInProcessClient.js.map +1 -0
- package/dist/data/projectApi.d.ts +22 -0
- package/dist/data/projectApi.d.ts.map +1 -0
- package/dist/data/projectApi.js +103 -0
- package/dist/data/projectApi.js.map +1 -0
- package/dist/data/types.d.ts +52 -0
- package/dist/data/types.d.ts.map +1 -0
- package/dist/data/types.js +10 -0
- package/dist/data/types.js.map +1 -0
- package/dist/data/useDevToolsClient.d.ts +19 -0
- package/dist/data/useDevToolsClient.d.ts.map +1 -0
- package/dist/data/useDevToolsClient.js +70 -0
- package/dist/data/useDevToolsClient.js.map +1 -0
- package/dist/index.d.ts +9 -10
- package/dist/index.js +7 -9
- package/dist/shell/DevToolsOverlay.d.ts +23 -0
- package/dist/shell/DevToolsOverlay.d.ts.map +1 -0
- package/dist/shell/DevToolsOverlay.js +106 -0
- package/dist/shell/DevToolsOverlay.js.map +1 -0
- package/dist/shell/DevToolsPanel.d.ts +23 -0
- package/dist/shell/DevToolsPanel.d.ts.map +1 -0
- package/dist/shell/DevToolsPanel.js +256 -0
- package/dist/shell/DevToolsPanel.js.map +1 -0
- package/dist/shell/ShadowRoot.d.ts +24 -0
- package/dist/shell/ShadowRoot.d.ts.map +1 -0
- package/dist/shell/ShadowRoot.js +107 -0
- package/dist/shell/ShadowRoot.js.map +1 -0
- package/dist/shell/SplitLayout.d.ts +28 -0
- package/dist/shell/SplitLayout.d.ts.map +1 -0
- package/dist/shell/SplitLayout.js +67 -0
- package/dist/shell/SplitLayout.js.map +1 -0
- package/dist/shell/registry.d.ts +41 -0
- package/dist/shell/registry.d.ts.map +1 -0
- package/dist/shell/registry.js +36 -0
- package/dist/shell/registry.js.map +1 -0
- package/dist/shell/tabs/ActivityTab.d.ts +13 -0
- package/dist/shell/tabs/ActivityTab.d.ts.map +1 -0
- package/dist/shell/tabs/ActivityTab.js +259 -0
- package/dist/shell/tabs/ActivityTab.js.map +1 -0
- package/dist/shell/tabs/ContextTab.d.ts +11 -0
- package/dist/shell/tabs/ContextTab.d.ts.map +1 -0
- package/dist/shell/tabs/ContextTab.js +210 -0
- package/dist/shell/tabs/ContextTab.js.map +1 -0
- package/dist/shell/tabs/RawTab.d.ts +11 -0
- package/dist/shell/tabs/RawTab.d.ts.map +1 -0
- package/dist/shell/tabs/RawTab.js +238 -0
- package/dist/shell/tabs/RawTab.js.map +1 -0
- package/dist/shell/tabs/ThreadTab.d.ts +12 -0
- package/dist/shell/tabs/ThreadTab.d.ts.map +1 -0
- package/dist/shell/tabs/ThreadTab.js +426 -0
- package/dist/shell/tabs/ThreadTab.js.map +1 -0
- package/dist/shell/tabs/navSelection.d.ts +10 -0
- package/dist/shell/tabs/navSelection.d.ts.map +1 -0
- package/dist/shell/tabs/navSelection.js +37 -0
- package/dist/shell/tabs/navSelection.js.map +1 -0
- package/dist/styles/panel.generated.d.ts +5 -0
- package/dist/styles/panel.generated.d.ts.map +1 -0
- package/dist/styles/panel.generated.js +6 -0
- package/dist/styles/panel.generated.js.map +1 -0
- package/dist/types.d.ts +1 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/common.d.ts +24 -0
- package/dist/utils/common.d.ts.map +1 -0
- package/dist/utils/common.js +64 -0
- package/dist/utils/common.js.map +1 -0
- package/dist/utils/diff.d.ts +16 -0
- package/dist/utils/diff.d.ts.map +1 -0
- package/dist/utils/diff.js +41 -0
- package/dist/utils/diff.js.map +1 -0
- package/dist/utils/serialization.d.ts.map +1 -1
- package/dist/utils/serialization.js +4 -1
- package/dist/utils/serialization.js.map +1 -1
- package/dist/views/activity/EventLogRow.d.ts +28 -0
- package/dist/views/activity/EventLogRow.d.ts.map +1 -0
- package/dist/views/activity/EventLogRow.js +185 -0
- package/dist/views/activity/EventLogRow.js.map +1 -0
- package/dist/views/activity/EventStreamPane.d.ts +11 -0
- package/dist/views/activity/EventStreamPane.d.ts.map +1 -0
- package/dist/views/activity/EventStreamPane.js +98 -0
- package/dist/views/activity/EventStreamPane.js.map +1 -0
- package/dist/views/activity/OrphansPane.d.ts +11 -0
- package/dist/views/activity/OrphansPane.d.ts.map +1 -0
- package/dist/views/activity/OrphansPane.js +39 -0
- package/dist/views/activity/OrphansPane.js.map +1 -0
- package/dist/views/activity/RunDetailPane.d.ts +11 -0
- package/dist/views/activity/RunDetailPane.d.ts.map +1 -0
- package/dist/views/activity/RunDetailPane.js +344 -0
- package/dist/views/activity/RunDetailPane.js.map +1 -0
- package/dist/views/activity/activityNodes.d.ts +39 -0
- package/dist/views/activity/activityNodes.d.ts.map +1 -0
- package/dist/views/activity/activityNodes.js +199 -0
- package/dist/views/activity/activityNodes.js.map +1 -0
- package/dist/views/activity/index.d.ts +6 -0
- package/dist/views/activity/index.js +6 -0
- package/dist/views/attachments/AttachmentList.d.ts +15 -0
- package/dist/views/attachments/AttachmentList.d.ts.map +1 -0
- package/dist/views/attachments/AttachmentList.js +279 -0
- package/dist/views/attachments/AttachmentList.js.map +1 -0
- package/dist/views/attachments/MediaPartView.d.ts +27 -0
- package/dist/views/attachments/MediaPartView.d.ts.map +1 -0
- package/dist/views/attachments/MediaPartView.js +180 -0
- package/dist/views/attachments/MediaPartView.js.map +1 -0
- package/dist/views/attachments/formatBytes.d.ts +8 -0
- package/dist/views/attachments/formatBytes.d.ts.map +1 -0
- package/dist/views/attachments/formatBytes.js +14 -0
- package/dist/views/attachments/formatBytes.js.map +1 -0
- package/dist/views/attachments/index.d.ts +5 -0
- package/dist/views/attachments/index.js +4 -0
- package/dist/views/attachments/parseAttachment.d.ts +8 -0
- package/dist/views/attachments/parseAttachment.d.ts.map +1 -0
- package/dist/views/attachments/parseAttachment.js +58 -0
- package/dist/views/attachments/parseAttachment.js.map +1 -0
- package/dist/views/attachments/types.d.ts +18 -0
- package/dist/views/attachments/types.d.ts.map +1 -0
- package/dist/views/attachments/types.js +0 -0
- package/dist/views/context/ContextDetail.d.ts +14 -0
- package/dist/views/context/ContextDetail.d.ts.map +1 -0
- package/dist/views/context/ContextDetail.js +87 -0
- package/dist/views/context/ContextDetail.js.map +1 -0
- package/dist/views/context/ToolUIsView.d.ts +9 -0
- package/dist/views/context/ToolUIsView.d.ts.map +1 -0
- package/dist/views/context/ToolUIsView.js +80 -0
- package/dist/views/context/ToolUIsView.js.map +1 -0
- package/dist/views/context/contextNodes.d.ts +32 -0
- package/dist/views/context/contextNodes.d.ts.map +1 -0
- package/dist/views/context/contextNodes.js +49 -0
- package/dist/views/context/contextNodes.js.map +1 -0
- package/dist/views/context/index.d.ts +4 -0
- package/dist/views/context/index.js +4 -0
- package/dist/views/mcp/McpView.d.ts +11 -0
- package/dist/views/mcp/McpView.d.ts.map +1 -0
- package/dist/views/mcp/McpView.js +239 -0
- package/dist/views/mcp/McpView.js.map +1 -0
- package/dist/views/mcp/index.d.ts +2 -0
- package/dist/views/mcp/index.js +2 -0
- package/dist/views/mcp/parse.d.ts +7 -0
- package/dist/views/mcp/parse.d.ts.map +1 -0
- package/dist/views/mcp/parse.js +43 -0
- package/dist/views/mcp/parse.js.map +1 -0
- package/dist/views/mcp/types.d.ts +22 -0
- package/dist/views/mcp/types.d.ts.map +1 -0
- package/dist/views/mcp/types.js +0 -0
- package/dist/views/message/ChainOfThought.d.ts +11 -0
- package/dist/views/message/ChainOfThought.d.ts.map +1 -0
- package/dist/views/message/ChainOfThought.js +132 -0
- package/dist/views/message/ChainOfThought.js.map +1 -0
- package/dist/views/message/MessageDetailPane.d.ts +12 -0
- package/dist/views/message/MessageDetailPane.d.ts.map +1 -0
- package/dist/views/message/MessageDetailPane.js +38 -0
- package/dist/views/message/MessageDetailPane.js.map +1 -0
- package/dist/views/message/MessageItem.d.ts +13 -0
- package/dist/views/message/MessageItem.d.ts.map +1 -0
- package/dist/views/message/MessageItem.js +136 -0
- package/dist/views/message/MessageItem.js.map +1 -0
- package/dist/views/message/MessageList.d.ts +13 -0
- package/dist/views/message/MessageList.d.ts.map +1 -0
- package/dist/views/message/MessageList.js +95 -0
- package/dist/views/message/MessageList.js.map +1 -0
- package/dist/views/message/MessageMetrics.d.ts +11 -0
- package/dist/views/message/MessageMetrics.d.ts.map +1 -0
- package/dist/views/message/MessageMetrics.js +93 -0
- package/dist/views/message/MessageMetrics.js.map +1 -0
- package/dist/views/message/MessageTimeline.d.ts +16 -0
- package/dist/views/message/MessageTimeline.d.ts.map +1 -0
- package/dist/views/message/MessageTimeline.js +100 -0
- package/dist/views/message/MessageTimeline.js.map +1 -0
- package/dist/views/message/PartDisclosure.d.ts +18 -0
- package/dist/views/message/PartDisclosure.d.ts.map +1 -0
- package/dist/views/message/PartDisclosure.js +79 -0
- package/dist/views/message/PartDisclosure.js.map +1 -0
- package/dist/views/message/PartView.d.ts +13 -0
- package/dist/views/message/PartView.d.ts.map +1 -0
- package/dist/views/message/PartView.js +416 -0
- package/dist/views/message/PartView.js.map +1 -0
- package/dist/views/message/RoleLabel.d.ts +11 -0
- package/dist/views/message/RoleLabel.d.ts.map +1 -0
- package/dist/views/message/RoleLabel.js +30 -0
- package/dist/views/message/RoleLabel.js.map +1 -0
- package/dist/views/message/StatusBadge.d.ts +17 -0
- package/dist/views/message/StatusBadge.d.ts.map +1 -0
- package/dist/views/message/StatusBadge.js +58 -0
- package/dist/views/message/StatusBadge.js.map +1 -0
- package/dist/views/message/ToolCallView.d.ts +13 -0
- package/dist/views/message/ToolCallView.d.ts.map +1 -0
- package/dist/views/message/ToolCallView.js +289 -0
- package/dist/views/message/ToolCallView.js.map +1 -0
- package/dist/views/message/TtftBar.d.ts +16 -0
- package/dist/views/message/TtftBar.d.ts.map +1 -0
- package/dist/views/message/TtftBar.js +128 -0
- package/dist/views/message/TtftBar.js.map +1 -0
- package/dist/views/message/index.d.ts +6 -0
- package/dist/views/message/index.js +5 -0
- package/dist/views/message/messagePlainText.d.ts +8 -0
- package/dist/views/message/messagePlainText.d.ts.map +1 -0
- package/dist/views/message/messagePlainText.js +39 -0
- package/dist/views/message/messagePlainText.js.map +1 -0
- package/dist/views/message/parse.d.ts +10 -0
- package/dist/views/message/parse.d.ts.map +1 -0
- package/dist/views/message/parse.js +235 -0
- package/dist/views/message/parse.js.map +1 -0
- package/dist/views/message/types.d.ts +114 -0
- package/dist/views/message/types.d.ts.map +1 -0
- package/dist/views/message/types.js +0 -0
- package/dist/views/model-context/ModelContextView.d.ts +26 -0
- package/dist/views/model-context/ModelContextView.d.ts.map +1 -0
- package/dist/views/model-context/ModelContextView.js +214 -0
- package/dist/views/model-context/ModelContextView.js.map +1 -0
- package/dist/views/nav.d.ts +19 -0
- package/dist/views/nav.d.ts.map +1 -0
- package/dist/views/nav.js +8 -0
- package/dist/views/nav.js.map +1 -0
- package/dist/views/raw/RawDetail.d.ts +15 -0
- package/dist/views/raw/RawDetail.d.ts.map +1 -0
- package/dist/views/raw/RawDetail.js +79 -0
- package/dist/views/raw/RawDetail.js.map +1 -0
- package/dist/views/raw/index.d.ts +3 -0
- package/dist/views/raw/index.js +3 -0
- package/dist/views/raw/rawNodes.d.ts +20 -0
- package/dist/views/raw/rawNodes.d.ts.map +1 -0
- package/dist/views/raw/rawNodes.js +78 -0
- package/dist/views/raw/rawNodes.js.map +1 -0
- package/dist/views/raw/statePreview.d.ts +5 -0
- package/dist/views/raw/statePreview.d.ts.map +1 -0
- package/dist/views/raw/statePreview.js +213 -0
- package/dist/views/raw/statePreview.js.map +1 -0
- package/dist/views/runs/PayloadDiff.d.ts +11 -0
- package/dist/views/runs/PayloadDiff.d.ts.map +1 -0
- package/dist/views/runs/PayloadDiff.js +92 -0
- package/dist/views/runs/PayloadDiff.js.map +1 -0
- package/dist/views/runs/parse.d.ts +8 -0
- package/dist/views/runs/parse.d.ts.map +1 -0
- package/dist/views/runs/parse.js +78 -0
- package/dist/views/runs/parse.js.map +1 -0
- package/dist/views/runs/types.d.ts +25 -0
- package/dist/views/runs/types.d.ts.map +1 -0
- package/dist/views/runs/types.js +0 -0
- package/dist/views/scopes/ScopesView.d.ts +9 -0
- package/dist/views/scopes/ScopesView.d.ts.map +1 -0
- package/dist/views/scopes/ScopesView.js +235 -0
- package/dist/views/scopes/ScopesView.js.map +1 -0
- package/dist/views/scopes/index.d.ts +2 -0
- package/dist/views/scopes/index.js +2 -0
- package/dist/views/scopes/parse.d.ts +7 -0
- package/dist/views/scopes/parse.d.ts.map +1 -0
- package/dist/views/scopes/parse.js +23 -0
- package/dist/views/scopes/parse.js.map +1 -0
- package/dist/views/scopes/types.d.ts +10 -0
- package/dist/views/scopes/types.d.ts.map +1 -0
- package/dist/views/scopes/types.js +0 -0
- package/dist/views/thread/ComposerAttachments.d.ts +11 -0
- package/dist/views/thread/ComposerAttachments.d.ts.map +1 -0
- package/dist/views/thread/ComposerAttachments.js +22 -0
- package/dist/views/thread/ComposerAttachments.js.map +1 -0
- package/dist/views/thread/ComposerFlags.d.ts +11 -0
- package/dist/views/thread/ComposerFlags.d.ts.map +1 -0
- package/dist/views/thread/ComposerFlags.js +54 -0
- package/dist/views/thread/ComposerFlags.js.map +1 -0
- package/dist/views/thread/ComposerQueue.d.ts +11 -0
- package/dist/views/thread/ComposerQueue.d.ts.map +1 -0
- package/dist/views/thread/ComposerQueue.js +55 -0
- package/dist/views/thread/ComposerQueue.js.map +1 -0
- package/dist/views/thread/ConversationList.d.ts +18 -0
- package/dist/views/thread/ConversationList.d.ts.map +1 -0
- package/dist/views/thread/ConversationList.js +228 -0
- package/dist/views/thread/ConversationList.js.map +1 -0
- package/dist/views/thread/ConversationStatusDot.d.ts +29 -0
- package/dist/views/thread/ConversationStatusDot.d.ts.map +1 -0
- package/dist/views/thread/ConversationStatusDot.js +91 -0
- package/dist/views/thread/ConversationStatusDot.js.map +1 -0
- package/dist/views/thread/ThreadDetails.d.ts +13 -0
- package/dist/views/thread/ThreadDetails.d.ts.map +1 -0
- package/dist/views/thread/ThreadDetails.js +170 -0
- package/dist/views/thread/ThreadDetails.js.map +1 -0
- package/dist/views/thread/Transcript.d.ts +21 -0
- package/dist/views/thread/Transcript.d.ts.map +1 -0
- package/dist/views/thread/Transcript.js +520 -0
- package/dist/views/thread/Transcript.js.map +1 -0
- package/dist/views/thread/index.d.ts +10 -0
- package/dist/views/thread/index.js +9 -0
- package/dist/views/thread/resolve.d.ts +13 -0
- package/dist/views/thread/resolve.d.ts.map +1 -0
- package/dist/views/thread/resolve.js +29 -0
- package/dist/views/thread/resolve.js.map +1 -0
- package/dist/views/thread/types.d.ts +50 -0
- package/dist/views/thread/types.d.ts.map +1 -0
- package/dist/views/thread/types.js +0 -0
- package/dist/views/thread/utils.d.ts +10 -0
- package/dist/views/thread/utils.d.ts.map +1 -0
- package/dist/views/thread/utils.js +77 -0
- package/dist/views/thread/utils.js.map +1 -0
- package/dist/views/ui/CenteredMessage.d.ts +11 -0
- package/dist/views/ui/CenteredMessage.d.ts.map +1 -0
- package/dist/views/ui/CenteredMessage.js +21 -0
- package/dist/views/ui/CenteredMessage.js.map +1 -0
- package/dist/views/ui/Chip.d.ts +13 -0
- package/dist/views/ui/Chip.d.ts.map +1 -0
- package/dist/views/ui/Chip.js +30 -0
- package/dist/views/ui/Chip.js.map +1 -0
- package/dist/views/ui/ControlButton.d.ts +10 -0
- package/dist/views/ui/ControlButton.d.ts.map +1 -0
- package/dist/views/ui/ControlButton.js +39 -0
- package/dist/views/ui/ControlButton.js.map +1 -0
- package/dist/views/ui/CopyButton.d.ts +19 -0
- package/dist/views/ui/CopyButton.d.ts.map +1 -0
- package/dist/views/ui/CopyButton.js +125 -0
- package/dist/views/ui/CopyButton.js.map +1 -0
- package/dist/views/ui/EmptyState.d.ts +11 -0
- package/dist/views/ui/EmptyState.d.ts.map +1 -0
- package/dist/views/ui/EmptyState.js +21 -0
- package/dist/views/ui/EmptyState.js.map +1 -0
- package/dist/views/ui/InfoCard.d.ts +22 -0
- package/dist/views/ui/InfoCard.d.ts.map +1 -0
- package/dist/views/ui/InfoCard.js +44 -0
- package/dist/views/ui/InfoCard.js.map +1 -0
- package/dist/views/ui/JSONTree.d.ts +16 -0
- package/dist/views/ui/JSONTree.d.ts.map +1 -0
- package/dist/views/ui/JSONTree.js +394 -0
- package/dist/views/ui/JSONTree.js.map +1 -0
- package/dist/views/ui/PaneHeader.d.ts +27 -0
- package/dist/views/ui/PaneHeader.d.ts.map +1 -0
- package/dist/views/ui/PaneHeader.js +71 -0
- package/dist/views/ui/PaneHeader.js.map +1 -0
- package/dist/views/ui/RailTime.d.ts +12 -0
- package/dist/views/ui/RailTime.d.ts.map +1 -0
- package/dist/views/ui/RailTime.js +49 -0
- package/dist/views/ui/RailTime.js.map +1 -0
- package/dist/views/ui/SectionLabel.d.ts +11 -0
- package/dist/views/ui/SectionLabel.d.ts.map +1 -0
- package/dist/views/ui/SectionLabel.js +21 -0
- package/dist/views/ui/SectionLabel.js.map +1 -0
- package/dist/views/ui/SelectableRow.d.ts +18 -0
- package/dist/views/ui/SelectableRow.d.ts.map +1 -0
- package/dist/views/ui/SelectableRow.js +49 -0
- package/dist/views/ui/SelectableRow.js.map +1 -0
- package/dist/views/ui/Sparkline.d.ts +17 -0
- package/dist/views/ui/Sparkline.d.ts.map +1 -0
- package/dist/views/ui/Sparkline.js +96 -0
- package/dist/views/ui/Sparkline.js.map +1 -0
- package/dist/views/ui/SummaryItem.d.ts +23 -0
- package/dist/views/ui/SummaryItem.d.ts.map +1 -0
- package/dist/views/ui/SummaryItem.js +59 -0
- package/dist/views/ui/SummaryItem.js.map +1 -0
- package/dist/views/ui/ToneBadge.d.ts +18 -0
- package/dist/views/ui/ToneBadge.d.ts.map +1 -0
- package/dist/views/ui/ToneBadge.js +34 -0
- package/dist/views/ui/ToneBadge.js.map +1 -0
- package/dist/views/ui/badgeTone.d.ts +21 -0
- package/dist/views/ui/badgeTone.d.ts.map +1 -0
- package/dist/views/ui/badgeTone.js +33 -0
- package/dist/views/ui/badgeTone.js.map +1 -0
- package/dist/views/ui/index.d.ts +16 -0
- package/dist/views/ui/index.js +16 -0
- package/dist/views/ui/useCopyToClipboard.d.ts +12 -0
- package/dist/views/ui/useCopyToClipboard.d.ts.map +1 -0
- package/dist/views/ui/useCopyToClipboard.js +44 -0
- package/dist/views/ui/useCopyToClipboard.js.map +1 -0
- package/package.json +9 -5
- package/src/DevToolsModal.tsx +26 -179
- package/src/DevToolsModalImpl.tsx +60 -0
- package/src/data/createInProcessClient.ts +66 -0
- package/src/data/projectApi.test.ts +100 -0
- package/src/data/projectApi.ts +169 -0
- package/src/data/types.ts +54 -0
- package/src/data/useDevToolsClient.ts +59 -0
- package/src/index.ts +16 -13
- package/src/shell/DevToolsOverlay.tsx +84 -0
- package/src/shell/DevToolsPanel.tsx +192 -0
- package/src/shell/ShadowRoot.tsx +85 -0
- package/src/shell/SplitLayout.tsx +46 -0
- package/src/shell/registry.ts +51 -0
- package/src/shell/tabs/ActivityTab.test.tsx +34 -0
- package/src/shell/tabs/ActivityTab.tsx +161 -0
- package/src/shell/tabs/ContextTab.test.tsx +37 -0
- package/src/shell/tabs/ContextTab.tsx +157 -0
- package/src/shell/tabs/RawTab.test.tsx +43 -0
- package/src/shell/tabs/RawTab.tsx +123 -0
- package/src/shell/tabs/ThreadTab.tsx +220 -0
- package/src/shell/tabs/navSelection.ts +17 -0
- package/src/styles/panel.css +153 -0
- package/src/styles/panel.generated.ts +2 -0
- package/src/types.ts +0 -5
- package/src/utils/common.test.ts +30 -0
- package/src/utils/common.ts +101 -0
- package/src/utils/diff.test.ts +37 -0
- package/src/utils/diff.ts +41 -0
- package/src/utils/serialization.test.ts +31 -0
- package/src/utils/serialization.ts +4 -1
- package/src/views/activity/EventLogRow.tsx +108 -0
- package/src/views/activity/EventStreamPane.tsx +86 -0
- package/src/views/activity/OrphansPane.tsx +23 -0
- package/src/views/activity/RunDetailPane.tsx +128 -0
- package/src/views/activity/activityNodes.test.ts +24 -0
- package/src/views/activity/activityNodes.ts +179 -0
- package/src/views/activity/index.ts +10 -0
- package/src/views/attachments/AttachmentList.tsx +122 -0
- package/src/views/attachments/MediaPartView.tsx +77 -0
- package/src/views/attachments/formatBytes.ts +15 -0
- package/src/views/attachments/index.ts +4 -0
- package/src/views/attachments/parseAttachment.test.ts +37 -0
- package/src/views/attachments/parseAttachment.ts +85 -0
- package/src/views/attachments/types.ts +15 -0
- package/src/views/context/ContextDetail.tsx +37 -0
- package/src/views/context/ToolUIsView.tsx +44 -0
- package/src/views/context/contextNodes.test.ts +31 -0
- package/src/views/context/contextNodes.ts +66 -0
- package/src/views/context/index.ts +4 -0
- package/src/views/mcp/McpView.tsx +125 -0
- package/src/views/mcp/index.ts +1 -0
- package/src/views/mcp/parse.test.ts +63 -0
- package/src/views/mcp/parse.ts +65 -0
- package/src/views/mcp/render.test.tsx +34 -0
- package/src/views/mcp/types.ts +20 -0
- package/src/views/message/ChainOfThought.tsx +74 -0
- package/src/views/message/MessageDetailPane.tsx +26 -0
- package/src/views/message/MessageItem.tsx +94 -0
- package/src/views/message/MessageList.tsx +48 -0
- package/src/views/message/MessageMetrics.tsx +68 -0
- package/src/views/message/MessageTimeline.test.tsx +78 -0
- package/src/views/message/MessageTimeline.tsx +51 -0
- package/src/views/message/PartDisclosure.tsx +32 -0
- package/src/views/message/PartView.tsx +197 -0
- package/src/views/message/RoleLabel.tsx +22 -0
- package/src/views/message/StatusBadge.tsx +28 -0
- package/src/views/message/ToolCallView.tsx +151 -0
- package/src/views/message/TtftBar.tsx +44 -0
- package/src/views/message/index.ts +5 -0
- package/src/views/message/messagePlainText.test.ts +48 -0
- package/src/views/message/messagePlainText.ts +65 -0
- package/src/views/message/parse.test.ts +269 -0
- package/src/views/message/parse.ts +282 -0
- package/src/views/message/render.test.tsx +128 -0
- package/src/views/message/types.ts +137 -0
- package/src/views/model-context/ModelContextView.tsx +71 -0
- package/src/views/model-context/render.test.tsx +24 -0
- package/src/views/nav.ts +18 -0
- package/src/views/raw/RawDetail.tsx +39 -0
- package/src/views/raw/index.ts +3 -0
- package/src/views/raw/rawNodes.test.ts +38 -0
- package/src/views/raw/rawNodes.ts +107 -0
- package/src/views/raw/statePreview.tsx +188 -0
- package/src/views/runs/PayloadDiff.tsx +49 -0
- package/src/views/runs/parse.test.ts +152 -0
- package/src/views/runs/parse.ts +110 -0
- package/src/views/runs/types.ts +23 -0
- package/src/views/scopes/ScopesView.tsx +105 -0
- package/src/views/scopes/index.ts +1 -0
- package/src/views/scopes/parse.test.ts +35 -0
- package/src/views/scopes/parse.ts +30 -0
- package/src/views/scopes/render.test.tsx +35 -0
- package/src/views/scopes/types.ts +6 -0
- package/src/views/thread/ComposerAttachments.test.tsx +36 -0
- package/src/views/thread/ComposerAttachments.tsx +8 -0
- package/src/views/thread/ComposerFlags.test.tsx +23 -0
- package/src/views/thread/ComposerFlags.tsx +19 -0
- package/src/views/thread/ComposerQueue.test.tsx +20 -0
- package/src/views/thread/ComposerQueue.tsx +26 -0
- package/src/views/thread/ConversationList.tsx +127 -0
- package/src/views/thread/ConversationStatusDot.test.ts +86 -0
- package/src/views/thread/ConversationStatusDot.tsx +126 -0
- package/src/views/thread/ThreadDetails.tsx +85 -0
- package/src/views/thread/Transcript.test.tsx +56 -0
- package/src/views/thread/Transcript.tsx +332 -0
- package/src/views/thread/index.ts +19 -0
- package/src/views/thread/render.test.tsx +41 -0
- package/src/views/thread/resolve.ts +36 -0
- package/src/views/thread/types.ts +53 -0
- package/src/views/thread/utils.test.ts +72 -0
- package/src/views/thread/utils.ts +149 -0
- package/src/views/ui/CenteredMessage.tsx +7 -0
- package/src/views/ui/Chip.tsx +17 -0
- package/src/views/ui/ControlButton.tsx +15 -0
- package/src/views/ui/CopyButton.tsx +73 -0
- package/src/views/ui/EmptyState.tsx +7 -0
- package/src/views/ui/InfoCard.tsx +35 -0
- package/src/views/ui/JSONTree.test.tsx +29 -0
- package/src/views/ui/JSONTree.tsx +240 -0
- package/src/views/ui/PaneHeader.tsx +46 -0
- package/src/views/ui/RailTime.tsx +27 -0
- package/src/views/ui/SectionLabel.tsx +7 -0
- package/src/views/ui/SelectableRow.tsx +41 -0
- package/src/views/ui/Sparkline.tsx +49 -0
- package/src/views/ui/SummaryItem.tsx +25 -0
- package/src/views/ui/ToneBadge.tsx +26 -0
- package/src/views/ui/badgeTone.ts +40 -0
- package/src/views/ui/index.ts +20 -0
- package/src/views/ui/useCopyToClipboard.ts +27 -0
- package/dist/DevToolsFrame.d.ts +0 -11
- package/dist/DevToolsFrame.d.ts.map +0 -1
- package/dist/DevToolsFrame.js +0 -66
- package/dist/DevToolsFrame.js.map +0 -1
- package/dist/DevToolsHost.d.ts +0 -38
- package/dist/DevToolsHost.d.ts.map +0 -1
- package/dist/DevToolsHost.js +0 -93
- package/dist/DevToolsHost.js.map +0 -1
- package/dist/ExtensionHost.d.ts +0 -10
- package/dist/ExtensionHost.d.ts.map +0 -1
- package/dist/ExtensionHost.js +0 -42
- package/dist/ExtensionHost.js.map +0 -1
- package/dist/FrameClient.d.ts +0 -38
- package/dist/FrameClient.d.ts.map +0 -1
- package/dist/FrameClient.js +0 -53
- package/dist/FrameClient.js.map +0 -1
- package/dist/FrameHost.d.ts +0 -11
- package/dist/FrameHost.d.ts.map +0 -1
- package/dist/FrameHost.js +0 -26
- package/dist/FrameHost.js.map +0 -1
- package/dist/constants.d.ts +0 -6
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js +0 -7
- package/dist/constants.js.map +0 -1
- package/dist/styles/DevToolsModal.styles.d.ts +0 -18
- package/dist/styles/DevToolsModal.styles.d.ts.map +0 -1
- package/dist/styles/DevToolsModal.styles.js +0 -120
- package/dist/styles/DevToolsModal.styles.js.map +0 -1
- package/src/DevToolsFrame.tsx +0 -55
- package/src/DevToolsHost.ts +0 -178
- package/src/ExtensionHost.ts +0 -57
- package/src/FrameClient.ts +0 -99
- package/src/FrameHost.ts +0 -31
- package/src/constants.ts +0 -2
- package/src/styles/DevToolsModal.styles.ts +0 -137
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import { BADGE_BASE } from "./badgeTone";
|
|
4
|
+
|
|
5
|
+
export const Chip = ({
|
|
6
|
+
className,
|
|
7
|
+
children,
|
|
8
|
+
}: {
|
|
9
|
+
className?: string | undefined;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}) => (
|
|
12
|
+
<span
|
|
13
|
+
className={clsx(BADGE_BASE, "bg-muted text-muted-foreground", className)}
|
|
14
|
+
>
|
|
15
|
+
{children}
|
|
16
|
+
</span>
|
|
17
|
+
);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import type { ButtonHTMLAttributes } from "react";
|
|
3
|
+
|
|
4
|
+
export const ControlButton = ({
|
|
5
|
+
className,
|
|
6
|
+
...props
|
|
7
|
+
}: ButtonHTMLAttributes<HTMLButtonElement>) => (
|
|
8
|
+
<button
|
|
9
|
+
className={clsx(
|
|
10
|
+
"text-muted-foreground hover:bg-accent hover:text-foreground border-border inline-flex h-8 items-center rounded-md border px-3 text-[13px] font-medium transition-colors",
|
|
11
|
+
className,
|
|
12
|
+
)}
|
|
13
|
+
{...props}
|
|
14
|
+
/>
|
|
15
|
+
);
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import { useCopyToClipboard } from "./useCopyToClipboard";
|
|
3
|
+
|
|
4
|
+
const ClipboardIcon = ({ size = 12 }: { size?: number }) => (
|
|
5
|
+
<svg
|
|
6
|
+
width={size}
|
|
7
|
+
height={size}
|
|
8
|
+
viewBox="0 0 24 24"
|
|
9
|
+
fill="none"
|
|
10
|
+
aria-hidden="true"
|
|
11
|
+
>
|
|
12
|
+
<rect
|
|
13
|
+
x="9"
|
|
14
|
+
y="9"
|
|
15
|
+
width="11"
|
|
16
|
+
height="11"
|
|
17
|
+
rx="1.5"
|
|
18
|
+
stroke="currentColor"
|
|
19
|
+
strokeWidth="1.75"
|
|
20
|
+
/>
|
|
21
|
+
<path
|
|
22
|
+
d="M7 15H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v1"
|
|
23
|
+
stroke="currentColor"
|
|
24
|
+
strokeWidth="1.75"
|
|
25
|
+
strokeLinecap="round"
|
|
26
|
+
/>
|
|
27
|
+
</svg>
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
export const CopyButton = ({
|
|
31
|
+
value,
|
|
32
|
+
label = "Copy",
|
|
33
|
+
copiedLabel = "Copied",
|
|
34
|
+
className,
|
|
35
|
+
iconOnly = false,
|
|
36
|
+
size = "default",
|
|
37
|
+
}: {
|
|
38
|
+
value: string;
|
|
39
|
+
label?: string;
|
|
40
|
+
copiedLabel?: string;
|
|
41
|
+
className?: string | undefined;
|
|
42
|
+
iconOnly?: boolean;
|
|
43
|
+
size?: "default" | "sm";
|
|
44
|
+
}) => {
|
|
45
|
+
const { isCopied, copy } = useCopyToClipboard();
|
|
46
|
+
const empty = !value.trim();
|
|
47
|
+
const iconPx = size === "sm" ? 10 : 12;
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<button
|
|
51
|
+
type="button"
|
|
52
|
+
disabled={empty}
|
|
53
|
+
aria-label={isCopied ? copiedLabel : label}
|
|
54
|
+
title={isCopied ? copiedLabel : label}
|
|
55
|
+
onClick={(event) => {
|
|
56
|
+
event.stopPropagation();
|
|
57
|
+
copy(value);
|
|
58
|
+
}}
|
|
59
|
+
className={clsx(
|
|
60
|
+
"text-muted-foreground hover:text-foreground inline-flex shrink-0 items-center justify-center rounded transition-colors disabled:pointer-events-none disabled:opacity-40",
|
|
61
|
+
iconOnly
|
|
62
|
+
? size === "sm"
|
|
63
|
+
? "hover:bg-accent/60 size-4"
|
|
64
|
+
: "hover:bg-accent/60 size-6"
|
|
65
|
+
: "hover:bg-accent/60 h-6 gap-1 px-1.5 text-[10px] font-medium",
|
|
66
|
+
className,
|
|
67
|
+
)}
|
|
68
|
+
>
|
|
69
|
+
<ClipboardIcon size={iconPx} />
|
|
70
|
+
{!iconOnly ? <span>{isCopied ? copiedLabel : label}</span> : null}
|
|
71
|
+
</button>
|
|
72
|
+
);
|
|
73
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
export const EmptyState = ({ children }: { children: ReactNode }) => (
|
|
4
|
+
<div className="text-muted-foreground border-border flex items-center justify-center rounded-lg border border-dashed p-6 text-center text-[13px]">
|
|
5
|
+
{children}
|
|
6
|
+
</div>
|
|
7
|
+
);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A flat content section: a header row (title + optional count/action) over its
|
|
5
|
+
* content. No box, no nesting; sections are separated by whitespace on the
|
|
6
|
+
* panel surface.
|
|
7
|
+
*/
|
|
8
|
+
export const InfoCard = ({
|
|
9
|
+
title,
|
|
10
|
+
count,
|
|
11
|
+
action,
|
|
12
|
+
children,
|
|
13
|
+
}: {
|
|
14
|
+
title?: ReactNode;
|
|
15
|
+
count?: ReactNode;
|
|
16
|
+
action?: ReactNode;
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
}) => (
|
|
19
|
+
<section className="flex flex-col gap-2">
|
|
20
|
+
{title != null || action != null ? (
|
|
21
|
+
<div className="flex h-5 items-center justify-between gap-2">
|
|
22
|
+
<h3 className="text-foreground flex items-center gap-1.5 text-[13px] font-medium">
|
|
23
|
+
{title}
|
|
24
|
+
{count != null ? (
|
|
25
|
+
<span className="text-muted-foreground text-[11px] font-normal tabular-nums">
|
|
26
|
+
{count}
|
|
27
|
+
</span>
|
|
28
|
+
) : null}
|
|
29
|
+
</h3>
|
|
30
|
+
{action}
|
|
31
|
+
</div>
|
|
32
|
+
) : null}
|
|
33
|
+
{children}
|
|
34
|
+
</section>
|
|
35
|
+
);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { renderToStaticMarkup } from "react-dom/server";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
import { JSONTree } from "./JSONTree";
|
|
4
|
+
|
|
5
|
+
describe("JSONTree", () => {
|
|
6
|
+
it("renders object keys with container summaries", () => {
|
|
7
|
+
const html = renderToStaticMarkup(
|
|
8
|
+
<JSONTree value={{ status: 200, items: [1, 2, 3] }} />,
|
|
9
|
+
);
|
|
10
|
+
expect(html).toContain("status");
|
|
11
|
+
expect(html).toContain("200");
|
|
12
|
+
expect(html).toContain("items");
|
|
13
|
+
expect(html).toContain("[3]");
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it("inlines small payloads in compact mode", () => {
|
|
17
|
+
const html = renderToStaticMarkup(
|
|
18
|
+
<JSONTree value={{ query: "Singapore" }} compact openDepth={0} />,
|
|
19
|
+
);
|
|
20
|
+
expect(html).toContain("query");
|
|
21
|
+
expect(html).toContain("Singapore");
|
|
22
|
+
expect(html).not.toContain("{1}");
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("falls back to a plain preview for primitive values", () => {
|
|
26
|
+
const html = renderToStaticMarkup(<JSONTree value={42} />);
|
|
27
|
+
expect(html).toContain("42");
|
|
28
|
+
});
|
|
29
|
+
});
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { useMemo, useState } from "react";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { CopyButton } from "./CopyButton";
|
|
4
|
+
|
|
5
|
+
const ENTRY_LIMIT = 100;
|
|
6
|
+
const INLINE_MAX = 88;
|
|
7
|
+
|
|
8
|
+
const isContainer = (value: unknown): value is object =>
|
|
9
|
+
value !== null && typeof value === "object";
|
|
10
|
+
|
|
11
|
+
type Entry = { key: string; value: unknown };
|
|
12
|
+
|
|
13
|
+
const entriesOf = (value: unknown): Entry[] => {
|
|
14
|
+
if (Array.isArray(value)) {
|
|
15
|
+
return value.map((item, index) => ({ key: String(index), value: item }));
|
|
16
|
+
}
|
|
17
|
+
return Object.entries(value as Record<string, unknown>).map(
|
|
18
|
+
([key, value]) => ({ key, value }),
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const summaryOf = (value: unknown): string => {
|
|
23
|
+
if (Array.isArray(value)) return `[${value.length}]`;
|
|
24
|
+
return `{${Object.keys(value as object).length}}`;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const serialize = (value: unknown, compact: boolean) =>
|
|
28
|
+
JSON.stringify(value, null, compact ? 0 : 2);
|
|
29
|
+
|
|
30
|
+
const isInline = (value: unknown, compact: boolean) => {
|
|
31
|
+
if (!compact) return false;
|
|
32
|
+
if (!isContainer(value)) return true;
|
|
33
|
+
return serialize(value, true).length <= INLINE_MAX;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const Leaf = ({ value }: { value: unknown }) => {
|
|
37
|
+
if (typeof value === "string") {
|
|
38
|
+
return (
|
|
39
|
+
<span className="text-foreground break-all">"{value}"</span>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
if (value === null || value === undefined) {
|
|
43
|
+
return (
|
|
44
|
+
<span className="text-muted-foreground italic">{String(value)}</span>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
return (
|
|
48
|
+
<span className="text-muted-foreground break-all">{String(value)}</span>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const TreeNode = ({
|
|
53
|
+
name,
|
|
54
|
+
value,
|
|
55
|
+
depth,
|
|
56
|
+
openDepth,
|
|
57
|
+
compact,
|
|
58
|
+
}: {
|
|
59
|
+
name?: string;
|
|
60
|
+
value: unknown;
|
|
61
|
+
depth: number;
|
|
62
|
+
openDepth: number;
|
|
63
|
+
compact: boolean;
|
|
64
|
+
}) => {
|
|
65
|
+
const [open, setOpen] = useState(depth < openDepth);
|
|
66
|
+
const [showAll, setShowAll] = useState(false);
|
|
67
|
+
|
|
68
|
+
if (!isContainer(value)) {
|
|
69
|
+
return (
|
|
70
|
+
<div
|
|
71
|
+
className={clsx("flex min-w-0", compact ? "gap-1 py-px" : "gap-1.5")}
|
|
72
|
+
>
|
|
73
|
+
{name !== undefined ? (
|
|
74
|
+
<span className="text-muted-foreground shrink-0">{name}:</span>
|
|
75
|
+
) : null}
|
|
76
|
+
<Leaf value={value} />
|
|
77
|
+
</div>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const entries = entriesOf(value);
|
|
82
|
+
const shown = showAll ? entries : entries.slice(0, ENTRY_LIMIT);
|
|
83
|
+
const hidden = entries.length - shown.length;
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<div className="min-w-0">
|
|
87
|
+
<button
|
|
88
|
+
type="button"
|
|
89
|
+
onClick={() => setOpen((prev) => !prev)}
|
|
90
|
+
className={clsx(
|
|
91
|
+
"text-muted-foreground hover:text-foreground flex items-center",
|
|
92
|
+
compact ? "gap-0.5 py-px" : "gap-1",
|
|
93
|
+
)}
|
|
94
|
+
>
|
|
95
|
+
<span
|
|
96
|
+
className={clsx(
|
|
97
|
+
"inline-block transition-transform",
|
|
98
|
+
open && "rotate-90",
|
|
99
|
+
)}
|
|
100
|
+
>
|
|
101
|
+
›
|
|
102
|
+
</span>
|
|
103
|
+
{name !== undefined ? <span>{name}</span> : null}
|
|
104
|
+
<span className="opacity-60">{summaryOf(value)}</span>
|
|
105
|
+
</button>
|
|
106
|
+
{open ? (
|
|
107
|
+
<div
|
|
108
|
+
className={clsx(
|
|
109
|
+
"border-border/60 border-s",
|
|
110
|
+
compact ? "ms-1 ps-2" : "ms-[5px] ps-3",
|
|
111
|
+
)}
|
|
112
|
+
>
|
|
113
|
+
{shown.map((entry) => (
|
|
114
|
+
<TreeNode
|
|
115
|
+
key={entry.key}
|
|
116
|
+
name={entry.key}
|
|
117
|
+
value={entry.value}
|
|
118
|
+
depth={depth + 1}
|
|
119
|
+
openDepth={openDepth}
|
|
120
|
+
compact={compact}
|
|
121
|
+
/>
|
|
122
|
+
))}
|
|
123
|
+
{hidden > 0 ? (
|
|
124
|
+
<button
|
|
125
|
+
type="button"
|
|
126
|
+
onClick={() => setShowAll(true)}
|
|
127
|
+
className="text-muted-foreground hover:text-foreground text-[10px]"
|
|
128
|
+
>
|
|
129
|
+
+{hidden} more
|
|
130
|
+
</button>
|
|
131
|
+
) : null}
|
|
132
|
+
</div>
|
|
133
|
+
) : null}
|
|
134
|
+
</div>
|
|
135
|
+
);
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const InlineJson = ({
|
|
139
|
+
serialized,
|
|
140
|
+
copyText,
|
|
141
|
+
compact,
|
|
142
|
+
}: {
|
|
143
|
+
serialized: string;
|
|
144
|
+
copyText: string;
|
|
145
|
+
compact: boolean;
|
|
146
|
+
}) => (
|
|
147
|
+
<div className="flex min-w-0 items-start gap-0.5">
|
|
148
|
+
<code
|
|
149
|
+
className={clsx(
|
|
150
|
+
"text-foreground min-w-0 flex-1 font-mono leading-snug break-all",
|
|
151
|
+
compact ? "text-[10px]" : "text-[11px]",
|
|
152
|
+
)}
|
|
153
|
+
title={serialized}
|
|
154
|
+
>
|
|
155
|
+
{serialized}
|
|
156
|
+
</code>
|
|
157
|
+
<CopyButton
|
|
158
|
+
value={copyText}
|
|
159
|
+
label="Copy JSON"
|
|
160
|
+
iconOnly
|
|
161
|
+
size={compact ? "sm" : "default"}
|
|
162
|
+
/>
|
|
163
|
+
</div>
|
|
164
|
+
);
|
|
165
|
+
|
|
166
|
+
const TreeWithCopy = ({
|
|
167
|
+
value,
|
|
168
|
+
openDepth,
|
|
169
|
+
copyText,
|
|
170
|
+
compact,
|
|
171
|
+
}: {
|
|
172
|
+
value: unknown;
|
|
173
|
+
openDepth: number;
|
|
174
|
+
copyText: string;
|
|
175
|
+
compact: boolean;
|
|
176
|
+
}) => (
|
|
177
|
+
<div className="flex min-w-0 items-start gap-0.5">
|
|
178
|
+
<div
|
|
179
|
+
className={clsx(
|
|
180
|
+
"min-w-0 flex-1 overflow-auto font-mono [font-variant-numeric:tabular-nums] [font-variant-ligatures:none]",
|
|
181
|
+
compact
|
|
182
|
+
? "max-h-32 text-[10px] leading-snug"
|
|
183
|
+
: "border-border bg-muted/40 max-h-[360px] rounded-md border p-3 text-[11px] leading-relaxed",
|
|
184
|
+
)}
|
|
185
|
+
>
|
|
186
|
+
<TreeNode
|
|
187
|
+
value={value}
|
|
188
|
+
depth={0}
|
|
189
|
+
openDepth={openDepth}
|
|
190
|
+
compact={compact}
|
|
191
|
+
/>
|
|
192
|
+
</div>
|
|
193
|
+
<CopyButton
|
|
194
|
+
value={copyText}
|
|
195
|
+
label="Copy JSON"
|
|
196
|
+
iconOnly
|
|
197
|
+
size={compact ? "sm" : "default"}
|
|
198
|
+
className="pt-px"
|
|
199
|
+
/>
|
|
200
|
+
</div>
|
|
201
|
+
);
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Recursive JSON view. `compact` fits tool rows; copy always provides formatted JSON.
|
|
205
|
+
*/
|
|
206
|
+
export const JSONTree = ({
|
|
207
|
+
value,
|
|
208
|
+
openDepth = 1,
|
|
209
|
+
compact = false,
|
|
210
|
+
}: {
|
|
211
|
+
value: unknown;
|
|
212
|
+
openDepth?: number;
|
|
213
|
+
compact?: boolean;
|
|
214
|
+
}) => {
|
|
215
|
+
const isLeaf = isInline(value, compact) || !isContainer(value);
|
|
216
|
+
const serialized = useMemo(
|
|
217
|
+
() => (isLeaf ? serialize(value, compact) : ""),
|
|
218
|
+
[value, compact, isLeaf],
|
|
219
|
+
);
|
|
220
|
+
const copyText = useMemo(() => JSON.stringify(value, null, 2), [value]);
|
|
221
|
+
|
|
222
|
+
if (isLeaf) {
|
|
223
|
+
return (
|
|
224
|
+
<InlineJson
|
|
225
|
+
serialized={serialized}
|
|
226
|
+
copyText={copyText}
|
|
227
|
+
compact={compact}
|
|
228
|
+
/>
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
return (
|
|
233
|
+
<TreeWithCopy
|
|
234
|
+
value={value}
|
|
235
|
+
openDepth={openDepth}
|
|
236
|
+
copyText={copyText}
|
|
237
|
+
compact={compact}
|
|
238
|
+
/>
|
|
239
|
+
);
|
|
240
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Fixed-height rail header. Every column in a split layout should use this so
|
|
5
|
+
* titles line up across columns.
|
|
6
|
+
*/
|
|
7
|
+
export const PaneHeader = ({
|
|
8
|
+
children,
|
|
9
|
+
trailing,
|
|
10
|
+
borderless = false,
|
|
11
|
+
}: {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
trailing?: ReactNode | undefined;
|
|
14
|
+
borderless?: boolean;
|
|
15
|
+
}) => (
|
|
16
|
+
<div
|
|
17
|
+
className={
|
|
18
|
+
borderless
|
|
19
|
+
? "bg-background flex h-8 max-h-8 min-h-8 shrink-0 items-center justify-between gap-2 overflow-hidden px-3"
|
|
20
|
+
: "border-border bg-background flex h-8 max-h-8 min-h-8 shrink-0 items-center justify-between gap-2 overflow-hidden border-b px-3"
|
|
21
|
+
}
|
|
22
|
+
>
|
|
23
|
+
<div className="text-muted-foreground flex min-w-0 flex-1 items-center truncate text-[11px] leading-none tabular-nums">
|
|
24
|
+
{children}
|
|
25
|
+
</div>
|
|
26
|
+
{trailing ? (
|
|
27
|
+
<div className="text-muted-foreground flex shrink-0 items-center gap-1.5 text-[10px] leading-none">
|
|
28
|
+
{trailing}
|
|
29
|
+
</div>
|
|
30
|
+
) : null}
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
/** Header that grows below a {@link PaneHeader}-height title row. */
|
|
35
|
+
export const PaneHeaderStack = ({
|
|
36
|
+
header,
|
|
37
|
+
children,
|
|
38
|
+
}: {
|
|
39
|
+
header: ReactNode;
|
|
40
|
+
children?: ReactNode | undefined;
|
|
41
|
+
}) => (
|
|
42
|
+
<div className="border-border bg-background shrink-0 border-b">
|
|
43
|
+
{header}
|
|
44
|
+
{children ? <div className="border-border border-t">{children}</div> : null}
|
|
45
|
+
</div>
|
|
46
|
+
);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import { formatWhen, formatWhenLabel } from "../../utils/common";
|
|
3
|
+
|
|
4
|
+
/** Compact timestamp for narrow rails; full value goes in the tooltip. */
|
|
5
|
+
export const RailTime = ({
|
|
6
|
+
value,
|
|
7
|
+
className,
|
|
8
|
+
}: {
|
|
9
|
+
value: string | undefined;
|
|
10
|
+
className?: string | undefined;
|
|
11
|
+
}) => {
|
|
12
|
+
const when = formatWhen(value);
|
|
13
|
+
if (!when) return null;
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<time
|
|
17
|
+
dateTime={value}
|
|
18
|
+
title={formatWhenLabel(value)}
|
|
19
|
+
className={clsx(
|
|
20
|
+
"text-muted-foreground font-mono text-[10px] leading-none whitespace-nowrap tabular-nums",
|
|
21
|
+
className,
|
|
22
|
+
)}
|
|
23
|
+
>
|
|
24
|
+
{when}
|
|
25
|
+
</time>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import { forwardRef, type ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A row in a master rail. The leading border + accent fill mark the current
|
|
6
|
+
* selection; the whole row is the hit target. Content is free-form so a row can
|
|
7
|
+
* be a single line or a small block (a transcript turn).
|
|
8
|
+
*/
|
|
9
|
+
export const SelectableRow = forwardRef<
|
|
10
|
+
HTMLButtonElement,
|
|
11
|
+
{
|
|
12
|
+
selected?: boolean;
|
|
13
|
+
onSelect?: (() => void) | undefined;
|
|
14
|
+
className?: string | undefined;
|
|
15
|
+
/** Fixed-height row for uniform rails. */
|
|
16
|
+
dense?: boolean;
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
}
|
|
19
|
+
>(function SelectableRow(
|
|
20
|
+
{ selected = false, onSelect, className, dense = false, children },
|
|
21
|
+
ref,
|
|
22
|
+
) {
|
|
23
|
+
return (
|
|
24
|
+
<button
|
|
25
|
+
ref={ref}
|
|
26
|
+
type="button"
|
|
27
|
+
onClick={onSelect}
|
|
28
|
+
aria-current={selected || undefined}
|
|
29
|
+
className={clsx(
|
|
30
|
+
"block w-full overflow-hidden border-s-2 px-3 text-left text-[12px] transition-colors",
|
|
31
|
+
dense ? "py-0" : "py-1.5",
|
|
32
|
+
selected
|
|
33
|
+
? "border-foreground bg-accent text-foreground"
|
|
34
|
+
: "text-muted-foreground hover:bg-accent/40 border-transparent",
|
|
35
|
+
className,
|
|
36
|
+
)}
|
|
37
|
+
>
|
|
38
|
+
{children}
|
|
39
|
+
</button>
|
|
40
|
+
);
|
|
41
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A monochrome trend line drawn as an SVG polyline. No axes, legend, or
|
|
5
|
+
* gridlines: it answers "is this metric rising, falling, or spiking" at a
|
|
6
|
+
* glance and nothing more. Renders nothing below 2 points; color comes from the
|
|
7
|
+
* surrounding text color (`currentColor`).
|
|
8
|
+
*/
|
|
9
|
+
export const Sparkline = ({
|
|
10
|
+
values,
|
|
11
|
+
className,
|
|
12
|
+
}: {
|
|
13
|
+
values: readonly number[];
|
|
14
|
+
className?: string;
|
|
15
|
+
}) => {
|
|
16
|
+
if (values.length < 2) return null;
|
|
17
|
+
|
|
18
|
+
const width = 100;
|
|
19
|
+
const height = 24;
|
|
20
|
+
const max = Math.max(...values);
|
|
21
|
+
const min = Math.min(...values);
|
|
22
|
+
const range = max - min || 1;
|
|
23
|
+
const step = width / (values.length - 1);
|
|
24
|
+
|
|
25
|
+
const point = (value: number, index: number) =>
|
|
26
|
+
`${(index * step).toFixed(1)},${(height - ((value - min) / range) * height).toFixed(1)}`;
|
|
27
|
+
const points = values.map(point).join(" ");
|
|
28
|
+
const lastValue = values[values.length - 1]!;
|
|
29
|
+
const [lastX, lastY] = point(lastValue, values.length - 1).split(",");
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<svg
|
|
33
|
+
viewBox={`0 0 ${width} ${height}`}
|
|
34
|
+
className={clsx("text-muted-foreground", className)}
|
|
35
|
+
preserveAspectRatio="none"
|
|
36
|
+
aria-hidden="true"
|
|
37
|
+
>
|
|
38
|
+
<polyline
|
|
39
|
+
points={points}
|
|
40
|
+
fill="none"
|
|
41
|
+
stroke="currentColor"
|
|
42
|
+
strokeWidth="1.5"
|
|
43
|
+
strokeLinejoin="round"
|
|
44
|
+
vectorEffect="non-scaling-stroke"
|
|
45
|
+
/>
|
|
46
|
+
<circle cx={lastX} cy={lastY} r="2" fill="currentColor" />
|
|
47
|
+
</svg>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A key/value row: label left, value right on one baseline. Flat (no box). Group
|
|
5
|
+
* a sequence in `SummaryList` for hairline dividers.
|
|
6
|
+
*/
|
|
7
|
+
export const SummaryItem = ({
|
|
8
|
+
label,
|
|
9
|
+
value,
|
|
10
|
+
}: {
|
|
11
|
+
label: string;
|
|
12
|
+
value: ReactNode;
|
|
13
|
+
}) => (
|
|
14
|
+
<div className="flex min-h-7 items-baseline justify-between gap-2 py-1 text-[11px]">
|
|
15
|
+
<span className="text-muted-foreground shrink-0">{label}</span>
|
|
16
|
+
<span className="text-foreground min-w-0 truncate text-right font-medium tabular-nums">
|
|
17
|
+
{value}
|
|
18
|
+
</span>
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
/** Divided list of `SummaryItem` rows. Unboxed: dividers do the grouping. */
|
|
23
|
+
export const SummaryList = ({ children }: { children: ReactNode }) => (
|
|
24
|
+
<div className="divide-border divide-y">{children}</div>
|
|
25
|
+
);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import { BADGE_BASE, BADGE_SM, BADGE_TONE } from "./badgeTone";
|
|
4
|
+
import type { BadgeTone } from "./badgeTone";
|
|
5
|
+
|
|
6
|
+
export const ToneBadge = ({
|
|
7
|
+
tone,
|
|
8
|
+
size = "default",
|
|
9
|
+
className,
|
|
10
|
+
children,
|
|
11
|
+
}: {
|
|
12
|
+
tone?: BadgeTone | undefined;
|
|
13
|
+
size?: "default" | "sm";
|
|
14
|
+
className?: string | undefined;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
}) => (
|
|
17
|
+
<span
|
|
18
|
+
className={clsx(
|
|
19
|
+
size === "sm" ? BADGE_SM : BADGE_BASE,
|
|
20
|
+
BADGE_TONE[tone ?? "zinc"],
|
|
21
|
+
className,
|
|
22
|
+
)}
|
|
23
|
+
>
|
|
24
|
+
{children}
|
|
25
|
+
</span>
|
|
26
|
+
);
|