@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,122 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import { CopyButton, STATUS_TONE, ToneBadge } from "../ui";
|
|
3
|
+
import { formatBytes } from "./formatBytes";
|
|
4
|
+
import type { AttachmentPreview, AttachmentStatusPreview } from "./types";
|
|
5
|
+
|
|
6
|
+
const statusLabel = (status: AttachmentStatusPreview) => {
|
|
7
|
+
if (status.type === "running" && typeof status.progress === "number") {
|
|
8
|
+
const pct = status.progress <= 1 ? status.progress * 100 : status.progress;
|
|
9
|
+
return `${status.reason ?? "uploading"} ${Math.round(pct)}%`;
|
|
10
|
+
}
|
|
11
|
+
return status.reason ? `${status.type} · ${status.reason}` : status.type;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const kindIcon = (attachment: AttachmentPreview) => {
|
|
15
|
+
const kind = attachment.kind ?? attachment.contentType ?? "";
|
|
16
|
+
if (kind.includes("image") || attachment.previewUrl) return "img";
|
|
17
|
+
if (kind.includes("audio")) return "aud";
|
|
18
|
+
if (kind.includes("pdf") || kind === "document") return "doc";
|
|
19
|
+
return "file";
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const AttachmentRow = ({ attachment }: { attachment: AttachmentPreview }) => {
|
|
23
|
+
const size = formatBytes(attachment.sizeBytes);
|
|
24
|
+
const meta = [attachment.kind, attachment.contentType, size]
|
|
25
|
+
.filter(Boolean)
|
|
26
|
+
.join(" · ");
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<details className="group border-border/60 border-b last:border-b-0">
|
|
30
|
+
<summary className="hover:bg-accent/40 flex cursor-pointer list-none items-center gap-1.5 px-2 py-1 text-[11px] select-none">
|
|
31
|
+
<span className="text-muted-foreground inline-block shrink-0 transition-transform group-open:rotate-90">
|
|
32
|
+
›
|
|
33
|
+
</span>
|
|
34
|
+
<ToneBadge tone="zinc" size="sm">
|
|
35
|
+
{kindIcon(attachment)}
|
|
36
|
+
</ToneBadge>
|
|
37
|
+
<span className="text-foreground min-w-0 flex-1 truncate font-medium">
|
|
38
|
+
{attachment.name}
|
|
39
|
+
</span>
|
|
40
|
+
{meta ? (
|
|
41
|
+
<span className="text-muted-foreground hidden max-w-[45%] truncate text-[10px] sm:inline">
|
|
42
|
+
{meta}
|
|
43
|
+
</span>
|
|
44
|
+
) : null}
|
|
45
|
+
{attachment.status ? (
|
|
46
|
+
<ToneBadge
|
|
47
|
+
tone={STATUS_TONE[attachment.status.type] ?? "zinc"}
|
|
48
|
+
size="sm"
|
|
49
|
+
>
|
|
50
|
+
{statusLabel(attachment.status)}
|
|
51
|
+
</ToneBadge>
|
|
52
|
+
) : null}
|
|
53
|
+
</summary>
|
|
54
|
+
<div className="flex flex-col gap-1 px-2 ps-6 pb-1.5">
|
|
55
|
+
{attachment.previewUrl ? (
|
|
56
|
+
<img
|
|
57
|
+
src={attachment.previewUrl}
|
|
58
|
+
alt={attachment.name}
|
|
59
|
+
className="border-border max-h-24 max-w-full rounded border object-contain"
|
|
60
|
+
/>
|
|
61
|
+
) : null}
|
|
62
|
+
<div className="text-muted-foreground flex flex-wrap gap-x-2 gap-y-0.5 text-[10px]">
|
|
63
|
+
{attachment.id ? (
|
|
64
|
+
<span className="font-mono">id: {attachment.id}</span>
|
|
65
|
+
) : null}
|
|
66
|
+
{attachment.kind ? <span>kind: {attachment.kind}</span> : null}
|
|
67
|
+
{attachment.contentType ? (
|
|
68
|
+
<span>type: {attachment.contentType}</span>
|
|
69
|
+
) : null}
|
|
70
|
+
{size ? <span>{size}</span> : null}
|
|
71
|
+
</div>
|
|
72
|
+
{attachment.previewUrl ? (
|
|
73
|
+
<div className="flex justify-end">
|
|
74
|
+
<CopyButton
|
|
75
|
+
value={attachment.previewUrl}
|
|
76
|
+
label="Copy URL"
|
|
77
|
+
iconOnly
|
|
78
|
+
size="sm"
|
|
79
|
+
/>
|
|
80
|
+
</div>
|
|
81
|
+
) : null}
|
|
82
|
+
</div>
|
|
83
|
+
</details>
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export const AttachmentList = ({
|
|
88
|
+
attachments,
|
|
89
|
+
label = "Attachments",
|
|
90
|
+
bordered = true,
|
|
91
|
+
}: {
|
|
92
|
+
attachments: readonly AttachmentPreview[];
|
|
93
|
+
label?: string;
|
|
94
|
+
bordered?: boolean;
|
|
95
|
+
}) => {
|
|
96
|
+
if (!attachments.length) return null;
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<div
|
|
100
|
+
className={clsx(
|
|
101
|
+
bordered && "border-border overflow-hidden rounded-md border",
|
|
102
|
+
)}
|
|
103
|
+
>
|
|
104
|
+
<div
|
|
105
|
+
className={clsx(
|
|
106
|
+
"text-muted-foreground px-2 py-1 text-[10px] font-medium",
|
|
107
|
+
bordered && "border-border border-b",
|
|
108
|
+
)}
|
|
109
|
+
>
|
|
110
|
+
{label} ({attachments.length})
|
|
111
|
+
</div>
|
|
112
|
+
<div>
|
|
113
|
+
{attachments.map((attachment, index) => (
|
|
114
|
+
<AttachmentRow
|
|
115
|
+
key={attachment.id ?? `${attachment.name}-${index}`}
|
|
116
|
+
attachment={attachment}
|
|
117
|
+
/>
|
|
118
|
+
))}
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
);
|
|
122
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { ToneBadge } from "../ui";
|
|
2
|
+
import type {
|
|
3
|
+
AudioPartPreview,
|
|
4
|
+
FilePartPreview,
|
|
5
|
+
ImagePartPreview,
|
|
6
|
+
} from "../message/types";
|
|
7
|
+
import { formatBytes } from "./formatBytes";
|
|
8
|
+
|
|
9
|
+
export const ImagePartView = ({
|
|
10
|
+
part,
|
|
11
|
+
compact = false,
|
|
12
|
+
}: {
|
|
13
|
+
part: ImagePartPreview;
|
|
14
|
+
compact?: boolean;
|
|
15
|
+
}) => (
|
|
16
|
+
<div className={compact ? "px-2 py-1.5" : "flex flex-col gap-1"}>
|
|
17
|
+
{!compact ? <ToneBadge tone="zinc">image</ToneBadge> : null}
|
|
18
|
+
<div className="text-foreground text-[11px]">
|
|
19
|
+
{part.filename ?? "image"}
|
|
20
|
+
{part.sizeBytes ? (
|
|
21
|
+
<span className="text-muted-foreground ml-1">
|
|
22
|
+
{formatBytes(part.sizeBytes)}
|
|
23
|
+
</span>
|
|
24
|
+
) : null}
|
|
25
|
+
</div>
|
|
26
|
+
{part.previewUrl ? (
|
|
27
|
+
<img
|
|
28
|
+
src={part.previewUrl}
|
|
29
|
+
alt={part.filename ?? "image"}
|
|
30
|
+
className="border-border mt-1 max-h-24 max-w-full rounded border object-contain"
|
|
31
|
+
/>
|
|
32
|
+
) : null}
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
export const FilePartView = ({
|
|
37
|
+
part,
|
|
38
|
+
compact = false,
|
|
39
|
+
}: {
|
|
40
|
+
part: FilePartPreview;
|
|
41
|
+
compact?: boolean;
|
|
42
|
+
}) => (
|
|
43
|
+
<div className={compact ? "px-2 py-1.5" : "flex flex-col gap-1"}>
|
|
44
|
+
{!compact ? <ToneBadge tone="zinc">file</ToneBadge> : null}
|
|
45
|
+
<div className="text-foreground text-[11px]">
|
|
46
|
+
{part.filename ?? "file"}
|
|
47
|
+
{part.mimeType ? (
|
|
48
|
+
<span className="text-muted-foreground ml-1">{part.mimeType}</span>
|
|
49
|
+
) : null}
|
|
50
|
+
{part.sizeBytes ? (
|
|
51
|
+
<span className="text-muted-foreground ml-1">
|
|
52
|
+
· {formatBytes(part.sizeBytes)}
|
|
53
|
+
</span>
|
|
54
|
+
) : null}
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
export const AudioPartView = ({
|
|
60
|
+
part,
|
|
61
|
+
compact = false,
|
|
62
|
+
}: {
|
|
63
|
+
part: AudioPartPreview;
|
|
64
|
+
compact?: boolean;
|
|
65
|
+
}) => (
|
|
66
|
+
<div className={compact ? "px-2 py-1.5" : "flex flex-col gap-1"}>
|
|
67
|
+
{!compact ? <ToneBadge tone="zinc">audio</ToneBadge> : null}
|
|
68
|
+
<div className="text-foreground text-[11px]">
|
|
69
|
+
{part.format ?? "audio"}
|
|
70
|
+
{part.sizeBytes ? (
|
|
71
|
+
<span className="text-muted-foreground ml-1">
|
|
72
|
+
· {formatBytes(part.sizeBytes)}
|
|
73
|
+
</span>
|
|
74
|
+
) : null}
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const formatBytes = (bytes: number | undefined): string | undefined => {
|
|
2
|
+
if (bytes === undefined || bytes <= 0) return undefined;
|
|
3
|
+
if (bytes < 1024) return `${bytes} B`;
|
|
4
|
+
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
5
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
/** Rough size from base64 payload (no decoding). */
|
|
9
|
+
export const estimateBase64Bytes = (data: string): number =>
|
|
10
|
+
Math.max(0, Math.floor((data.length * 3) / 4));
|
|
11
|
+
|
|
12
|
+
export const isSafeImagePreviewUrl = (url: string): boolean =>
|
|
13
|
+
url.startsWith("data:image/") ||
|
|
14
|
+
url.startsWith("https://") ||
|
|
15
|
+
url.startsWith("http://");
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { parseAttachment } from "./parseAttachment";
|
|
3
|
+
|
|
4
|
+
describe("parseAttachment", () => {
|
|
5
|
+
it("parses name, kind, contentType, and status", () => {
|
|
6
|
+
expect(
|
|
7
|
+
parseAttachment({
|
|
8
|
+
id: "a1",
|
|
9
|
+
name: "photo.png",
|
|
10
|
+
type: "image",
|
|
11
|
+
contentType: "image/png",
|
|
12
|
+
status: { type: "complete" },
|
|
13
|
+
}),
|
|
14
|
+
).toMatchObject({
|
|
15
|
+
id: "a1",
|
|
16
|
+
name: "photo.png",
|
|
17
|
+
kind: "image",
|
|
18
|
+
contentType: "image/png",
|
|
19
|
+
status: { type: "complete" },
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it("extracts image preview and size from content parts", () => {
|
|
24
|
+
const result = parseAttachment({
|
|
25
|
+
name: "shot.png",
|
|
26
|
+
type: "image",
|
|
27
|
+
content: [
|
|
28
|
+
{
|
|
29
|
+
type: "image",
|
|
30
|
+
image: "data:image/png;base64,abcd",
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
});
|
|
34
|
+
expect(result?.previewUrl).toBe("data:image/png;base64,abcd");
|
|
35
|
+
expect(result?.sizeBytes).toBeGreaterThan(0);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { isRecord } from "../../utils/common";
|
|
2
|
+
import { estimateBase64Bytes, isSafeImagePreviewUrl } from "./formatBytes";
|
|
3
|
+
import type { AttachmentPreview, AttachmentStatusPreview } from "./types";
|
|
4
|
+
|
|
5
|
+
const asString = (value: unknown): string | undefined =>
|
|
6
|
+
typeof value === "string" && value.length > 0 ? value : undefined;
|
|
7
|
+
|
|
8
|
+
const parseAttachmentStatus = (
|
|
9
|
+
value: unknown,
|
|
10
|
+
): AttachmentStatusPreview | undefined => {
|
|
11
|
+
if (!isRecord(value) || typeof value.type !== "string") return undefined;
|
|
12
|
+
return {
|
|
13
|
+
type: value.type,
|
|
14
|
+
...(typeof value.reason === "string" ? { reason: value.reason } : {}),
|
|
15
|
+
...(typeof value.progress === "number" ? { progress: value.progress } : {}),
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const mediaFromContent = (
|
|
20
|
+
content: unknown,
|
|
21
|
+
): { previewUrl?: string; sizeBytes?: number } => {
|
|
22
|
+
if (!Array.isArray(content)) return {};
|
|
23
|
+
for (const part of content) {
|
|
24
|
+
if (!isRecord(part)) continue;
|
|
25
|
+
const type = asString(part.type);
|
|
26
|
+
if (type === "image") {
|
|
27
|
+
const image = asString(part.image);
|
|
28
|
+
if (image && isSafeImagePreviewUrl(image)) {
|
|
29
|
+
const sizeBytes = image.startsWith("data:")
|
|
30
|
+
? estimateBase64Bytes(image.split(",", 2)[1] ?? image)
|
|
31
|
+
: undefined;
|
|
32
|
+
return {
|
|
33
|
+
previewUrl: image,
|
|
34
|
+
...(sizeBytes !== undefined ? { sizeBytes } : {}),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (type === "file") {
|
|
39
|
+
const data = asString(part.data);
|
|
40
|
+
if (data) return { sizeBytes: estimateBase64Bytes(data) };
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return {};
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const parseAttachment = (value: unknown): AttachmentPreview | null => {
|
|
47
|
+
if (!isRecord(value)) return null;
|
|
48
|
+
|
|
49
|
+
const name =
|
|
50
|
+
asString(value.name) ??
|
|
51
|
+
asString(value.filename) ??
|
|
52
|
+
asString(value.id) ??
|
|
53
|
+
"(attachment)";
|
|
54
|
+
|
|
55
|
+
const status = parseAttachmentStatus(value.status);
|
|
56
|
+
const fromContent = mediaFromContent(value.content);
|
|
57
|
+
|
|
58
|
+
const image = asString(value.image);
|
|
59
|
+
const previewUrl =
|
|
60
|
+
fromContent.previewUrl ??
|
|
61
|
+
(image && isSafeImagePreviewUrl(image) ? image : undefined);
|
|
62
|
+
|
|
63
|
+
const data = asString(value.data);
|
|
64
|
+
const sizeBytes =
|
|
65
|
+
fromContent.sizeBytes ?? (data ? estimateBase64Bytes(data) : undefined);
|
|
66
|
+
|
|
67
|
+
return {
|
|
68
|
+
name,
|
|
69
|
+
...(asString(value.id) ? { id: asString(value.id)! } : {}),
|
|
70
|
+
...(asString(value.type) ? { kind: asString(value.type)! } : {}),
|
|
71
|
+
...(asString(value.contentType)
|
|
72
|
+
? { contentType: asString(value.contentType)! }
|
|
73
|
+
: {}),
|
|
74
|
+
...(status ? { status } : {}),
|
|
75
|
+
...(previewUrl ? { previewUrl } : {}),
|
|
76
|
+
...(sizeBytes !== undefined ? { sizeBytes } : {}),
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export const parseAttachments = (value: unknown): AttachmentPreview[] =>
|
|
81
|
+
Array.isArray(value)
|
|
82
|
+
? value
|
|
83
|
+
.map((item) => parseAttachment(item))
|
|
84
|
+
.filter((item): item is AttachmentPreview => Boolean(item))
|
|
85
|
+
: [];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface AttachmentStatusPreview {
|
|
2
|
+
type: string;
|
|
3
|
+
reason?: string;
|
|
4
|
+
progress?: number;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface AttachmentPreview {
|
|
8
|
+
id?: string;
|
|
9
|
+
name: string;
|
|
10
|
+
kind?: string;
|
|
11
|
+
contentType?: string;
|
|
12
|
+
status?: AttachmentStatusPreview;
|
|
13
|
+
previewUrl?: string;
|
|
14
|
+
sizeBytes?: number;
|
|
15
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ApiInfo } from "../../data/types";
|
|
2
|
+
import { McpView } from "../mcp";
|
|
3
|
+
import {
|
|
4
|
+
CallSettingsPane,
|
|
5
|
+
ConfigPane,
|
|
6
|
+
SystemPromptPane,
|
|
7
|
+
ToolDetailPane,
|
|
8
|
+
} from "../model-context/ModelContextView";
|
|
9
|
+
import { ToolUIsView } from "./ToolUIsView";
|
|
10
|
+
import type { ContextNode } from "./contextNodes";
|
|
11
|
+
|
|
12
|
+
export const ContextDetail = ({
|
|
13
|
+
node,
|
|
14
|
+
data,
|
|
15
|
+
}: {
|
|
16
|
+
node: ContextNode;
|
|
17
|
+
data: ApiInfo;
|
|
18
|
+
}) => {
|
|
19
|
+
const model = data.modelContext;
|
|
20
|
+
|
|
21
|
+
switch (node.kind) {
|
|
22
|
+
case "system":
|
|
23
|
+
return <SystemPromptPane system={node.preview} />;
|
|
24
|
+
case "tool":
|
|
25
|
+
return <ToolDetailPane tool={node.tool} />;
|
|
26
|
+
case "callSettings":
|
|
27
|
+
return <CallSettingsPane value={model?.callSettings ?? {}} />;
|
|
28
|
+
case "config":
|
|
29
|
+
return <ConfigPane value={model?.config ?? {}} />;
|
|
30
|
+
case "mcp":
|
|
31
|
+
return <McpView value={data.state.mcp} compact />;
|
|
32
|
+
case "toolUIs":
|
|
33
|
+
return <ToolUIsView value={data.state.tools} />;
|
|
34
|
+
default:
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { isRecord, truncate } from "../../utils/common";
|
|
2
|
+
import { Chip, JSONTree } from "../ui";
|
|
3
|
+
|
|
4
|
+
export const ToolUIsView = ({ value }: { value: unknown }) => {
|
|
5
|
+
if (!isRecord(value)) {
|
|
6
|
+
return <JSONTree value={value} compact />;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const entries = Object.entries(value);
|
|
10
|
+
if (entries.length === 0) {
|
|
11
|
+
return (
|
|
12
|
+
<div className="text-muted-foreground text-[12px]">
|
|
13
|
+
No tool UI mappings registered.
|
|
14
|
+
</div>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div className="flex flex-col gap-2">
|
|
20
|
+
{entries.map(([toolName, components]) => {
|
|
21
|
+
const list = Array.isArray(components) ? components : [];
|
|
22
|
+
const firstEntry = typeof list[0] === "string" ? list[0] : undefined;
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<div key={toolName} className="flex min-w-0 flex-col gap-0.5 py-1">
|
|
26
|
+
<div className="flex min-w-0 items-center justify-between gap-2">
|
|
27
|
+
<span className="text-foreground truncate text-[12px] font-medium">
|
|
28
|
+
{toolName}
|
|
29
|
+
</span>
|
|
30
|
+
<Chip>
|
|
31
|
+
{list.length} component{list.length === 1 ? "" : "s"}
|
|
32
|
+
</Chip>
|
|
33
|
+
</div>
|
|
34
|
+
{firstEntry ? (
|
|
35
|
+
<span className="text-muted-foreground truncate font-mono text-[10px]">
|
|
36
|
+
{truncate(firstEntry, 96)}
|
|
37
|
+
</span>
|
|
38
|
+
) : null}
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
})}
|
|
42
|
+
</div>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { buildContextNav } from "./contextNodes";
|
|
3
|
+
import { flattenNav } from "../nav";
|
|
4
|
+
|
|
5
|
+
describe("buildContextNav", () => {
|
|
6
|
+
it("groups model and runtime slices", () => {
|
|
7
|
+
const groups = buildContextNav({
|
|
8
|
+
id: 1,
|
|
9
|
+
state: {
|
|
10
|
+
mcp: { servers: [] },
|
|
11
|
+
tools: { search: ["SearchUI"] },
|
|
12
|
+
},
|
|
13
|
+
logs: [],
|
|
14
|
+
modelContext: {
|
|
15
|
+
system: "You are helpful.",
|
|
16
|
+
tools: [{ name: "search", type: "function" }],
|
|
17
|
+
config: { modelName: "gpt" },
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
expect(groups.map((group) => group.label)).toEqual(["Model", "Runtime"]);
|
|
22
|
+
const ids = flattenNav(groups).map((node) => node.id);
|
|
23
|
+
expect(ids).toEqual([
|
|
24
|
+
"ctx:system",
|
|
25
|
+
"ctx:tool:search",
|
|
26
|
+
"ctx:config",
|
|
27
|
+
"ctx:mcp",
|
|
28
|
+
"ctx:toolUIs",
|
|
29
|
+
]);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { ApiInfo } from "../../data/types";
|
|
2
|
+
import type { NormalizedTool } from "../../utils/toolNormalization";
|
|
3
|
+
import { isRecord } from "../../utils/common";
|
|
4
|
+
import type { NavGroup } from "../nav";
|
|
5
|
+
|
|
6
|
+
export type ContextNode =
|
|
7
|
+
| { id: "ctx:system"; kind: "system"; preview: string }
|
|
8
|
+
| { id: `ctx:tool:${string}`; kind: "tool"; tool: NormalizedTool }
|
|
9
|
+
| { id: "ctx:callSettings"; kind: "callSettings" }
|
|
10
|
+
| { id: "ctx:config"; kind: "config" }
|
|
11
|
+
| { id: "ctx:mcp"; kind: "mcp" }
|
|
12
|
+
| { id: "ctx:toolUIs"; kind: "toolUIs" };
|
|
13
|
+
|
|
14
|
+
export type ContextNavGroup = NavGroup<ContextNode>;
|
|
15
|
+
|
|
16
|
+
const hasKeys = (value: Record<string, unknown> | undefined) =>
|
|
17
|
+
Boolean(value && Object.keys(value).length > 0);
|
|
18
|
+
|
|
19
|
+
export const buildContextNav = (data: ApiInfo): ContextNavGroup[] => {
|
|
20
|
+
const model = data.modelContext;
|
|
21
|
+
const modelNodes: ContextNode[] = [];
|
|
22
|
+
|
|
23
|
+
if (model?.system) {
|
|
24
|
+
modelNodes.push({
|
|
25
|
+
id: "ctx:system",
|
|
26
|
+
kind: "system",
|
|
27
|
+
preview: model.system,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
for (const tool of model?.tools ?? []) {
|
|
32
|
+
modelNodes.push({
|
|
33
|
+
id: `ctx:tool:${tool.name}`,
|
|
34
|
+
kind: "tool",
|
|
35
|
+
tool,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (hasKeys(model?.callSettings)) {
|
|
40
|
+
modelNodes.push({ id: "ctx:callSettings", kind: "callSettings" });
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (hasKeys(model?.config)) {
|
|
44
|
+
modelNodes.push({ id: "ctx:config", kind: "config" });
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const runtimeNodes: ContextNode[] = [];
|
|
48
|
+
|
|
49
|
+
if (data.state.mcp !== undefined) {
|
|
50
|
+
runtimeNodes.push({ id: "ctx:mcp", kind: "mcp" });
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (data.state.tools !== undefined) {
|
|
54
|
+
runtimeNodes.push({ id: "ctx:toolUIs", kind: "toolUIs" });
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return [
|
|
58
|
+
...(modelNodes.length ? [{ label: "Model", nodes: modelNodes }] : []),
|
|
59
|
+
...(runtimeNodes.length ? [{ label: "Runtime", nodes: runtimeNodes }] : []),
|
|
60
|
+
];
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const toolUiCount = (value: unknown) => {
|
|
64
|
+
if (!isRecord(value)) return 0;
|
|
65
|
+
return Object.keys(value).length;
|
|
66
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import {
|
|
3
|
+
CONNECTION_TONE,
|
|
4
|
+
JSONTree,
|
|
5
|
+
SummaryItem,
|
|
6
|
+
SummaryList,
|
|
7
|
+
ToneBadge,
|
|
8
|
+
} from "../ui";
|
|
9
|
+
import { PartDisclosure } from "../message/PartDisclosure";
|
|
10
|
+
import { parseMcpManager } from "./parse";
|
|
11
|
+
import type { McpServerPreview } from "./types";
|
|
12
|
+
|
|
13
|
+
const ServerRow = ({
|
|
14
|
+
server,
|
|
15
|
+
compact,
|
|
16
|
+
}: {
|
|
17
|
+
server: McpServerPreview;
|
|
18
|
+
compact?: boolean;
|
|
19
|
+
}) => (
|
|
20
|
+
<details className="group">
|
|
21
|
+
<summary
|
|
22
|
+
className={clsx(
|
|
23
|
+
"hover:bg-accent/40 flex cursor-pointer list-none items-center gap-1.5 text-[11px] select-none",
|
|
24
|
+
compact ? "px-0 py-1" : "px-2 py-1.5",
|
|
25
|
+
)}
|
|
26
|
+
>
|
|
27
|
+
<span className="text-muted-foreground inline-block shrink-0 transition-transform group-open:rotate-90">
|
|
28
|
+
›
|
|
29
|
+
</span>
|
|
30
|
+
<span className="text-foreground min-w-0 flex-1 truncate font-medium">
|
|
31
|
+
{server.name}
|
|
32
|
+
</span>
|
|
33
|
+
<ToneBadge tone={CONNECTION_TONE[server.connectionState]} size="sm">
|
|
34
|
+
{server.connectionState}
|
|
35
|
+
</ToneBadge>
|
|
36
|
+
{server.kind ? (
|
|
37
|
+
<span className="text-muted-foreground shrink-0 text-[10px]">
|
|
38
|
+
{server.kind}
|
|
39
|
+
</span>
|
|
40
|
+
) : null}
|
|
41
|
+
</summary>
|
|
42
|
+
|
|
43
|
+
<div
|
|
44
|
+
className={clsx(
|
|
45
|
+
"flex flex-col gap-1.5 pb-1",
|
|
46
|
+
compact ? "ps-3.5" : "border-border border-t px-2 py-1.5",
|
|
47
|
+
)}
|
|
48
|
+
>
|
|
49
|
+
{server.url ? (
|
|
50
|
+
<div className="text-muted-foreground font-mono text-[10px] break-all">
|
|
51
|
+
{server.url}
|
|
52
|
+
</div>
|
|
53
|
+
) : null}
|
|
54
|
+
|
|
55
|
+
{server.lastError ? (
|
|
56
|
+
<div className="text-[11px] text-red-600 dark:text-red-400">
|
|
57
|
+
{server.lastError}
|
|
58
|
+
</div>
|
|
59
|
+
) : null}
|
|
60
|
+
|
|
61
|
+
{server.authorizationUrl ? (
|
|
62
|
+
<div className="text-[11px] break-all text-amber-600 dark:text-amber-400">
|
|
63
|
+
Authorization required: {server.authorizationUrl}
|
|
64
|
+
</div>
|
|
65
|
+
) : null}
|
|
66
|
+
|
|
67
|
+
{server.tools.length ? (
|
|
68
|
+
<PartDisclosure label={`Tools (${server.tools.length})`}>
|
|
69
|
+
<div className="flex flex-col gap-1">
|
|
70
|
+
{server.tools.map((tool) => (
|
|
71
|
+
<div key={tool.name} className="flex min-w-0 flex-col gap-0.5">
|
|
72
|
+
<span className="text-foreground text-[11px] font-medium">
|
|
73
|
+
{tool.name}
|
|
74
|
+
</span>
|
|
75
|
+
{tool.description ? (
|
|
76
|
+
<span className="text-muted-foreground text-[10px] leading-snug">
|
|
77
|
+
{tool.description}
|
|
78
|
+
</span>
|
|
79
|
+
) : null}
|
|
80
|
+
</div>
|
|
81
|
+
))}
|
|
82
|
+
</div>
|
|
83
|
+
</PartDisclosure>
|
|
84
|
+
) : (
|
|
85
|
+
<div className="text-muted-foreground text-[11px]">
|
|
86
|
+
No tools discovered.
|
|
87
|
+
</div>
|
|
88
|
+
)}
|
|
89
|
+
</div>
|
|
90
|
+
</details>
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
export const McpView = ({
|
|
94
|
+
value,
|
|
95
|
+
compact = false,
|
|
96
|
+
}: {
|
|
97
|
+
value: unknown;
|
|
98
|
+
compact?: boolean;
|
|
99
|
+
}) => {
|
|
100
|
+
const manager = parseMcpManager(value);
|
|
101
|
+
if (!manager) return <JSONTree value={value} compact />;
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<div className="flex flex-col gap-2">
|
|
105
|
+
<SummaryList>
|
|
106
|
+
<SummaryItem label="Servers" value={String(manager.servers.length)} />
|
|
107
|
+
{typeof manager.isHydrated === "boolean" ? (
|
|
108
|
+
<SummaryItem label="Hydrated" value={String(manager.isHydrated)} />
|
|
109
|
+
) : null}
|
|
110
|
+
</SummaryList>
|
|
111
|
+
|
|
112
|
+
{manager.servers.length ? (
|
|
113
|
+
<div className="flex flex-col">
|
|
114
|
+
{manager.servers.map((server) => (
|
|
115
|
+
<ServerRow key={server.id} server={server} compact={compact} />
|
|
116
|
+
))}
|
|
117
|
+
</div>
|
|
118
|
+
) : (
|
|
119
|
+
<div className="text-muted-foreground text-[12px]">
|
|
120
|
+
No MCP servers registered.
|
|
121
|
+
</div>
|
|
122
|
+
)}
|
|
123
|
+
</div>
|
|
124
|
+
);
|
|
125
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { McpView } from "./McpView";
|