@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,137 @@
|
|
|
1
|
+
import type { AttachmentPreview } from "../attachments/types";
|
|
2
|
+
|
|
3
|
+
export interface PartStatusPreview {
|
|
4
|
+
readonly type: string;
|
|
5
|
+
readonly reason?: string;
|
|
6
|
+
readonly error?: unknown;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface ToolCallApprovalPreview {
|
|
10
|
+
readonly id?: string;
|
|
11
|
+
readonly approved?: boolean;
|
|
12
|
+
readonly reason?: string;
|
|
13
|
+
readonly isAutomatic?: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface ToolCallInterruptPreview {
|
|
17
|
+
readonly type?: string;
|
|
18
|
+
readonly payload?: unknown;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface BasePartPreview {
|
|
22
|
+
readonly status?: PartStatusPreview;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface TextPartPreview extends BasePartPreview {
|
|
26
|
+
readonly type: "text";
|
|
27
|
+
readonly text: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface ReasoningPartPreview extends BasePartPreview {
|
|
31
|
+
readonly type: "reasoning";
|
|
32
|
+
readonly text: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface SourcePartPreview extends BasePartPreview {
|
|
36
|
+
readonly type: "source";
|
|
37
|
+
readonly sourceType?: string;
|
|
38
|
+
readonly title?: string;
|
|
39
|
+
readonly url?: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface ImagePartPreview extends BasePartPreview {
|
|
43
|
+
readonly type: "image";
|
|
44
|
+
readonly filename?: string;
|
|
45
|
+
readonly previewUrl?: string;
|
|
46
|
+
readonly sizeBytes?: number;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface FilePartPreview extends BasePartPreview {
|
|
50
|
+
readonly type: "file";
|
|
51
|
+
readonly filename?: string;
|
|
52
|
+
readonly mimeType?: string;
|
|
53
|
+
readonly sizeBytes?: number;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface AudioPartPreview extends BasePartPreview {
|
|
57
|
+
readonly type: "audio";
|
|
58
|
+
readonly format?: string;
|
|
59
|
+
readonly sizeBytes?: number;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface DataPartPreview extends BasePartPreview {
|
|
63
|
+
readonly type: "data";
|
|
64
|
+
readonly name?: string;
|
|
65
|
+
readonly data: unknown;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface GenerativeUiPartPreview extends BasePartPreview {
|
|
69
|
+
readonly type: "generative-ui";
|
|
70
|
+
readonly spec: unknown;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface ToolCallPartPreview extends BasePartPreview {
|
|
74
|
+
readonly type: "tool-call";
|
|
75
|
+
readonly toolCallId: string;
|
|
76
|
+
readonly toolName: string;
|
|
77
|
+
readonly args: unknown;
|
|
78
|
+
readonly argsText?: string;
|
|
79
|
+
readonly result?: unknown;
|
|
80
|
+
readonly isError?: boolean;
|
|
81
|
+
readonly artifact?: unknown;
|
|
82
|
+
readonly mcp?: unknown;
|
|
83
|
+
readonly modelContent?: unknown;
|
|
84
|
+
readonly interrupt?: ToolCallInterruptPreview;
|
|
85
|
+
readonly approval?: ToolCallApprovalPreview;
|
|
86
|
+
readonly subMessageCount: number;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface UnknownPartPreview extends BasePartPreview {
|
|
90
|
+
readonly type: "unknown";
|
|
91
|
+
readonly rawType: string;
|
|
92
|
+
readonly raw: unknown;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export type PartPreview =
|
|
96
|
+
| TextPartPreview
|
|
97
|
+
| ReasoningPartPreview
|
|
98
|
+
| SourcePartPreview
|
|
99
|
+
| ImagePartPreview
|
|
100
|
+
| FilePartPreview
|
|
101
|
+
| AudioPartPreview
|
|
102
|
+
| DataPartPreview
|
|
103
|
+
| GenerativeUiPartPreview
|
|
104
|
+
| ToolCallPartPreview
|
|
105
|
+
| UnknownPartPreview;
|
|
106
|
+
|
|
107
|
+
export interface MessageTimingPreview {
|
|
108
|
+
readonly streamStartTime?: number;
|
|
109
|
+
readonly firstTokenTime?: number;
|
|
110
|
+
readonly totalStreamTime?: number;
|
|
111
|
+
readonly tokenCount?: number;
|
|
112
|
+
readonly tokensPerSecond?: number;
|
|
113
|
+
readonly totalChunks?: number;
|
|
114
|
+
readonly toolCallCount?: number;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export interface MessageUsagePreview {
|
|
118
|
+
readonly inputTokens: number;
|
|
119
|
+
readonly outputTokens: number;
|
|
120
|
+
readonly stepCount: number;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface MessagePreview {
|
|
124
|
+
readonly id: string;
|
|
125
|
+
readonly role: string;
|
|
126
|
+
readonly createdAt?: string;
|
|
127
|
+
readonly status?: PartStatusPreview;
|
|
128
|
+
readonly parts: readonly PartPreview[];
|
|
129
|
+
readonly attachments: readonly AttachmentPreview[];
|
|
130
|
+
readonly timing?: MessageTimingPreview;
|
|
131
|
+
readonly usage?: MessageUsagePreview;
|
|
132
|
+
readonly branchNumber?: number;
|
|
133
|
+
readonly branchCount?: number;
|
|
134
|
+
readonly index?: number;
|
|
135
|
+
readonly isOptimistic?: boolean;
|
|
136
|
+
readonly submittedFeedback?: string;
|
|
137
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { NormalizedTool } from "../../utils/toolNormalization";
|
|
2
|
+
import { PartDisclosure } from "../message/PartDisclosure";
|
|
3
|
+
import { Chip, JSONTree, ToneBadge } from "../ui";
|
|
4
|
+
|
|
5
|
+
export const SystemPromptPane = ({ system }: { system: string }) => (
|
|
6
|
+
<div className="text-foreground text-[12px] wrap-break-word whitespace-pre-wrap">
|
|
7
|
+
{system}
|
|
8
|
+
</div>
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
export const ToolDetailPane = ({ tool }: { tool: NormalizedTool }) => (
|
|
12
|
+
<div className="flex flex-col gap-2">
|
|
13
|
+
<div className="flex flex-wrap items-center gap-1.5">
|
|
14
|
+
{tool.type ? <Chip>{tool.type}</Chip> : null}
|
|
15
|
+
{tool.providerId ? (
|
|
16
|
+
<ToneBadge tone="violet" size="sm">
|
|
17
|
+
{tool.providerId}
|
|
18
|
+
</ToneBadge>
|
|
19
|
+
) : null}
|
|
20
|
+
{tool.display ? <Chip>{tool.display}</Chip> : null}
|
|
21
|
+
{tool.supportsDeferredResults ? <Chip>deferred</Chip> : null}
|
|
22
|
+
{tool.disabled ? (
|
|
23
|
+
<ToneBadge tone="amber" size="sm">
|
|
24
|
+
disabled
|
|
25
|
+
</ToneBadge>
|
|
26
|
+
) : null}
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
{tool.description ? (
|
|
30
|
+
<p className="text-muted-foreground text-[11px] leading-snug">
|
|
31
|
+
{tool.description}
|
|
32
|
+
</p>
|
|
33
|
+
) : null}
|
|
34
|
+
|
|
35
|
+
{tool.parameters !== undefined ? (
|
|
36
|
+
<PartDisclosure label="Parameters">
|
|
37
|
+
<JSONTree value={tool.parameters} openDepth={0} compact />
|
|
38
|
+
</PartDisclosure>
|
|
39
|
+
) : null}
|
|
40
|
+
{tool.providerArgs !== undefined ? (
|
|
41
|
+
<PartDisclosure label="Provider args">
|
|
42
|
+
<JSONTree value={tool.providerArgs} openDepth={0} compact />
|
|
43
|
+
</PartDisclosure>
|
|
44
|
+
) : null}
|
|
45
|
+
{tool.providerOptions !== undefined ? (
|
|
46
|
+
<PartDisclosure label="Provider options">
|
|
47
|
+
<JSONTree value={tool.providerOptions} openDepth={0} compact />
|
|
48
|
+
</PartDisclosure>
|
|
49
|
+
) : null}
|
|
50
|
+
{tool.backendDefault !== undefined ? (
|
|
51
|
+
<PartDisclosure label="Backend defaults">
|
|
52
|
+
<JSONTree value={tool.backendDefault} openDepth={0} compact />
|
|
53
|
+
</PartDisclosure>
|
|
54
|
+
) : null}
|
|
55
|
+
{tool.server !== undefined ? (
|
|
56
|
+
<PartDisclosure label="MCP server">
|
|
57
|
+
<JSONTree value={tool.server} openDepth={0} compact />
|
|
58
|
+
</PartDisclosure>
|
|
59
|
+
) : null}
|
|
60
|
+
</div>
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
export const CallSettingsPane = ({
|
|
64
|
+
value,
|
|
65
|
+
}: {
|
|
66
|
+
value: Record<string, unknown>;
|
|
67
|
+
}) => <JSONTree value={value} openDepth={1} compact />;
|
|
68
|
+
|
|
69
|
+
export const ConfigPane = ({ value }: { value: Record<string, unknown> }) => (
|
|
70
|
+
<JSONTree value={value} openDepth={1} compact />
|
|
71
|
+
);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { renderToStaticMarkup } from "react-dom/server";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
import { ToolDetailPane } from "./ModelContextView";
|
|
4
|
+
|
|
5
|
+
describe("ToolDetailPane", () => {
|
|
6
|
+
it("renders provider args and backend defaults from an already-normalized tool", () => {
|
|
7
|
+
const html = renderToStaticMarkup(
|
|
8
|
+
<ToolDetailPane
|
|
9
|
+
tool={{
|
|
10
|
+
name: "web_search",
|
|
11
|
+
type: "provider",
|
|
12
|
+
providerId: "openai.web_search_preview",
|
|
13
|
+
providerArgs: { searchContextSize: "high" },
|
|
14
|
+
backendDefault: { parameters: true },
|
|
15
|
+
}}
|
|
16
|
+
/>,
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
expect(html).toContain("openai.web_search_preview");
|
|
20
|
+
expect(html).toContain("Provider args");
|
|
21
|
+
expect(html).toContain("searchContextSize");
|
|
22
|
+
expect(html).toContain("Backend defaults");
|
|
23
|
+
});
|
|
24
|
+
});
|
package/src/views/nav.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type NavGroup<N extends { id: string }> = {
|
|
2
|
+
label: string;
|
|
3
|
+
nodes: N[];
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
export const flattenNav = <N extends { id: string }>(
|
|
7
|
+
groups: readonly NavGroup<N>[],
|
|
8
|
+
): N[] => groups.flatMap((group) => group.nodes);
|
|
9
|
+
|
|
10
|
+
export const findNavNode = <N extends { id: string }>(
|
|
11
|
+
groups: readonly NavGroup<N>[],
|
|
12
|
+
nodeId: string | null,
|
|
13
|
+
): N | undefined =>
|
|
14
|
+
nodeId ? flattenNav(groups).find((node) => node.id === nodeId) : undefined;
|
|
15
|
+
|
|
16
|
+
export const firstNavId = <N extends { id: string }>(
|
|
17
|
+
groups: readonly NavGroup<N>[],
|
|
18
|
+
): string | null => flattenNav(groups)[0]?.id ?? null;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { PartDisclosure } from "../message/PartDisclosure";
|
|
2
|
+
import { ScopesView } from "../scopes";
|
|
3
|
+
import { JSONTree } from "../ui";
|
|
4
|
+
import { renderStatePreview } from "./statePreview";
|
|
5
|
+
import type { RawNode } from "./rawNodes";
|
|
6
|
+
|
|
7
|
+
export const RawDetail = ({
|
|
8
|
+
node,
|
|
9
|
+
state,
|
|
10
|
+
scopes,
|
|
11
|
+
}: {
|
|
12
|
+
node: RawNode;
|
|
13
|
+
state: Record<string, unknown>;
|
|
14
|
+
scopes: unknown;
|
|
15
|
+
}) => {
|
|
16
|
+
if (node.kind === "scopes") {
|
|
17
|
+
return (
|
|
18
|
+
<div className="flex flex-col gap-3">
|
|
19
|
+
<ScopesView scopes={scopes} />
|
|
20
|
+
{scopes !== undefined ? (
|
|
21
|
+
<PartDisclosure label="Raw JSON">
|
|
22
|
+
<JSONTree value={scopes} openDepth={1} compact />
|
|
23
|
+
</PartDisclosure>
|
|
24
|
+
) : null}
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const value = state[node.key];
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<div className="flex flex-col gap-3">
|
|
33
|
+
{renderStatePreview(node.key, value)}
|
|
34
|
+
<PartDisclosure label="Raw JSON">
|
|
35
|
+
<JSONTree value={value} openDepth={1} compact />
|
|
36
|
+
</PartDisclosure>
|
|
37
|
+
</div>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { buildRawNav, sliceHint } from "./rawNodes";
|
|
3
|
+
|
|
4
|
+
describe("buildRawNav", () => {
|
|
5
|
+
it("orders known slices and groups scopes separately", () => {
|
|
6
|
+
const groups = buildRawNav({
|
|
7
|
+
id: 1,
|
|
8
|
+
state: {
|
|
9
|
+
mcp: { servers: [] },
|
|
10
|
+
composer: { text: "hi", textLength: 2 },
|
|
11
|
+
thread: { messages: [{ id: "m1" }], isRunning: false },
|
|
12
|
+
tools: { search: ["SearchUI"] },
|
|
13
|
+
},
|
|
14
|
+
logs: [],
|
|
15
|
+
scopes: [{ name: "thread", source: "root", methods: ["send"] }],
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
expect(groups.map((group) => group.label)).toEqual(["State", "Graph"]);
|
|
19
|
+
const sliceKeys = groups[0]!.nodes.map((node) =>
|
|
20
|
+
node.kind === "slice" ? node.key : null,
|
|
21
|
+
);
|
|
22
|
+
expect(sliceKeys).toEqual(["thread", "composer", "tools", "mcp"]);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
describe("sliceHint", () => {
|
|
27
|
+
it("summarizes thread and composer slices", () => {
|
|
28
|
+
expect(
|
|
29
|
+
sliceHint("thread", {
|
|
30
|
+
messages: [{ id: "m1" }, { id: "m2" }],
|
|
31
|
+
isRunning: false,
|
|
32
|
+
}),
|
|
33
|
+
).toBe("2 msgs");
|
|
34
|
+
expect(sliceHint("composer", { text: "hello", textLength: 5 })).toBe(
|
|
35
|
+
"5 chars",
|
|
36
|
+
);
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import type { ApiInfo } from "../../data/types";
|
|
2
|
+
import { isRecord } from "../../utils/common";
|
|
3
|
+
import {
|
|
4
|
+
parseComposerPreview,
|
|
5
|
+
parseThreadListPreview,
|
|
6
|
+
parseThreadPreview,
|
|
7
|
+
} from "../thread";
|
|
8
|
+
import { parseScopes } from "../scopes/parse";
|
|
9
|
+
import type { NavGroup } from "../nav";
|
|
10
|
+
|
|
11
|
+
export type RawNode =
|
|
12
|
+
| {
|
|
13
|
+
id: `raw:slice:${string}`;
|
|
14
|
+
kind: "slice";
|
|
15
|
+
key: string;
|
|
16
|
+
hint: string | null;
|
|
17
|
+
}
|
|
18
|
+
| { id: "raw:scopes"; kind: "scopes"; count: number };
|
|
19
|
+
|
|
20
|
+
export type RawNavGroup = NavGroup<RawNode>;
|
|
21
|
+
|
|
22
|
+
const SLICE_ORDER = [
|
|
23
|
+
"thread",
|
|
24
|
+
"threads",
|
|
25
|
+
"threadListItem",
|
|
26
|
+
"threadlistitem",
|
|
27
|
+
"composer",
|
|
28
|
+
"tools",
|
|
29
|
+
"mcp",
|
|
30
|
+
] as const;
|
|
31
|
+
|
|
32
|
+
const sortSliceKeys = (keys: string[]) => {
|
|
33
|
+
const rank = new Map<string, number>(
|
|
34
|
+
SLICE_ORDER.map((key, index) => [key, index]),
|
|
35
|
+
);
|
|
36
|
+
return [...keys].sort((left, right) => {
|
|
37
|
+
const leftRank = rank.get(left) ?? rank.get(left.toLowerCase()) ?? 999;
|
|
38
|
+
const rightRank = rank.get(right) ?? rank.get(right.toLowerCase()) ?? 999;
|
|
39
|
+
if (leftRank !== rightRank) return leftRank - rightRank;
|
|
40
|
+
return left.localeCompare(right);
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const sliceHint = (key: string, value: unknown): string | null => {
|
|
45
|
+
switch (key) {
|
|
46
|
+
case "thread": {
|
|
47
|
+
const thread = parseThreadPreview(value);
|
|
48
|
+
if (!thread) return null;
|
|
49
|
+
return `${thread.messages.length} msgs`;
|
|
50
|
+
}
|
|
51
|
+
case "threads": {
|
|
52
|
+
const threads = parseThreadListPreview(value);
|
|
53
|
+
if (!threads) return null;
|
|
54
|
+
return `${threads.threadIds.length} active`;
|
|
55
|
+
}
|
|
56
|
+
case "composer": {
|
|
57
|
+
const composer = parseComposerPreview(value);
|
|
58
|
+
if (!composer) return null;
|
|
59
|
+
return `${composer.textLength} chars`;
|
|
60
|
+
}
|
|
61
|
+
case "tools": {
|
|
62
|
+
if (!isRecord(value)) return null;
|
|
63
|
+
const count = Object.keys(value).length;
|
|
64
|
+
return count ? `${count} mapped` : "empty";
|
|
65
|
+
}
|
|
66
|
+
case "mcp": {
|
|
67
|
+
if (!isRecord(value)) return null;
|
|
68
|
+
const servers = Array.isArray(value.servers)
|
|
69
|
+
? value.servers.length
|
|
70
|
+
: (Array.isArray(value.connectors) ? value.connectors.length : 0) +
|
|
71
|
+
(Array.isArray(value.customServers) ? value.customServers.length : 0);
|
|
72
|
+
return servers ? `${servers} servers` : "empty";
|
|
73
|
+
}
|
|
74
|
+
default:
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const buildRawNav = (data: ApiInfo): RawNavGroup[] => {
|
|
80
|
+
const sliceKeys = sortSliceKeys(Object.keys(data.state));
|
|
81
|
+
const stateNodes: RawNode[] = sliceKeys.map((key) => ({
|
|
82
|
+
id: `raw:slice:${key}`,
|
|
83
|
+
kind: "slice",
|
|
84
|
+
key,
|
|
85
|
+
hint: sliceHint(key, data.state[key]),
|
|
86
|
+
}));
|
|
87
|
+
|
|
88
|
+
const groups: RawNavGroup[] = [];
|
|
89
|
+
if (stateNodes.length) {
|
|
90
|
+
groups.push({ label: "State", nodes: stateNodes });
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (data.scopes !== undefined) {
|
|
94
|
+
groups.push({
|
|
95
|
+
label: "Graph",
|
|
96
|
+
nodes: [
|
|
97
|
+
{
|
|
98
|
+
id: "raw:scopes",
|
|
99
|
+
kind: "scopes",
|
|
100
|
+
count: parseScopes(data.scopes).length,
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return groups;
|
|
107
|
+
};
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { isRecord, truncate } from "../../utils/common";
|
|
2
|
+
import { McpView } from "../mcp";
|
|
3
|
+
import { ToolUIsView } from "../context";
|
|
4
|
+
import {
|
|
5
|
+
ComposerAttachments,
|
|
6
|
+
ComposerFlags,
|
|
7
|
+
ComposerQueue,
|
|
8
|
+
ThreadDetails,
|
|
9
|
+
parseComposerPreview,
|
|
10
|
+
parseThreadListItemPreview,
|
|
11
|
+
parseThreadListPreview,
|
|
12
|
+
parseThreadPreview,
|
|
13
|
+
} from "../thread";
|
|
14
|
+
import { InfoCard, JSONTree, SummaryItem, SummaryList } from "../ui";
|
|
15
|
+
|
|
16
|
+
const renderToolUIsStatePreview = (value: unknown) => (
|
|
17
|
+
<ToolUIsView value={value} />
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
const renderThreadsStatePreview = (value: unknown) => {
|
|
21
|
+
const state = parseThreadListPreview(value);
|
|
22
|
+
if (!state) {
|
|
23
|
+
return <JSONTree value={value} />;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const threadItems = state.threadItems.slice(0, 8);
|
|
27
|
+
const main = state.main;
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<div className="flex flex-col gap-6">
|
|
31
|
+
<InfoCard title="Threads">
|
|
32
|
+
<SummaryList>
|
|
33
|
+
<SummaryItem label="Main thread" value={state.mainThreadId ?? "—"} />
|
|
34
|
+
<SummaryItem label="New thread" value={state.newThreadId ?? "—"} />
|
|
35
|
+
<SummaryItem label="Active" value={String(state.threadIds.length)} />
|
|
36
|
+
<SummaryItem
|
|
37
|
+
label="Archived"
|
|
38
|
+
value={String(state.archivedThreadIds.length)}
|
|
39
|
+
/>
|
|
40
|
+
</SummaryList>
|
|
41
|
+
</InfoCard>
|
|
42
|
+
|
|
43
|
+
{threadItems.length ? (
|
|
44
|
+
<InfoCard title="Thread items" count={state.threadItems.length}>
|
|
45
|
+
<table className="w-full table-fixed text-left">
|
|
46
|
+
<thead className="text-muted-foreground text-[11px]">
|
|
47
|
+
<tr className="border-border border-b">
|
|
48
|
+
<th className="py-1.5 pr-3 font-medium">Title</th>
|
|
49
|
+
<th className="py-1.5 pr-3 font-medium">Status</th>
|
|
50
|
+
<th className="py-1.5 font-medium">Identifiers</th>
|
|
51
|
+
</tr>
|
|
52
|
+
</thead>
|
|
53
|
+
<tbody className="text-foreground text-[12px]">
|
|
54
|
+
{threadItems.map((item) => (
|
|
55
|
+
<tr
|
|
56
|
+
key={item.id}
|
|
57
|
+
className="border-border/70 border-b last:border-b-0"
|
|
58
|
+
>
|
|
59
|
+
<td className="py-2 pr-3 align-top">
|
|
60
|
+
<div className="text-foreground truncate font-medium">
|
|
61
|
+
{item.title || "(untitled)"}
|
|
62
|
+
</div>
|
|
63
|
+
<div className="text-muted-foreground truncate font-mono text-[11px]">
|
|
64
|
+
{item.id}
|
|
65
|
+
</div>
|
|
66
|
+
</td>
|
|
67
|
+
<td className="text-muted-foreground py-2 pr-3 align-top">
|
|
68
|
+
{item.status ?? "—"}
|
|
69
|
+
</td>
|
|
70
|
+
<td className="text-muted-foreground py-2 align-top font-mono text-[11px]">
|
|
71
|
+
{item.remoteId ? `Remote: ${item.remoteId}` : null}
|
|
72
|
+
{item.remoteId && item.externalId ? <br /> : null}
|
|
73
|
+
{item.externalId ? `External: ${item.externalId}` : null}
|
|
74
|
+
{!item.remoteId && !item.externalId ? "—" : null}
|
|
75
|
+
</td>
|
|
76
|
+
</tr>
|
|
77
|
+
))}
|
|
78
|
+
</tbody>
|
|
79
|
+
</table>
|
|
80
|
+
{state.threadItems.length > threadItems.length ? (
|
|
81
|
+
<div className="text-muted-foreground text-[11px]">
|
|
82
|
+
Showing first {threadItems.length}
|
|
83
|
+
</div>
|
|
84
|
+
) : null}
|
|
85
|
+
</InfoCard>
|
|
86
|
+
) : null}
|
|
87
|
+
|
|
88
|
+
{main ? <ThreadDetails thread={main} title="Main thread" /> : null}
|
|
89
|
+
</div>
|
|
90
|
+
);
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const renderThreadStatePreview = (value: unknown) => {
|
|
94
|
+
const thread = parseThreadPreview(value);
|
|
95
|
+
if (!thread) {
|
|
96
|
+
return <JSONTree value={value} />;
|
|
97
|
+
}
|
|
98
|
+
return <ThreadDetails thread={thread} title="Thread" />;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const renderThreadListItemStatePreview = (value: unknown) => {
|
|
102
|
+
const item = parseThreadListItemPreview(value);
|
|
103
|
+
if (!item) {
|
|
104
|
+
return <JSONTree value={value} />;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return (
|
|
108
|
+
<SummaryList>
|
|
109
|
+
<SummaryItem label="ID" value={item.id} />
|
|
110
|
+
<SummaryItem label="Title" value={item.title ?? "(untitled)"} />
|
|
111
|
+
<SummaryItem label="Status" value={item.status ?? "—"} />
|
|
112
|
+
<SummaryItem label="Remote ID" value={item.remoteId ?? "—"} />
|
|
113
|
+
<SummaryItem label="External ID" value={item.externalId ?? "—"} />
|
|
114
|
+
</SummaryList>
|
|
115
|
+
);
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
const renderComposerStatePreview = (value: unknown) => {
|
|
119
|
+
const composer = parseComposerPreview(value);
|
|
120
|
+
if (!composer || !isRecord(value)) {
|
|
121
|
+
return <JSONTree value={value} />;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const text = typeof value.text === "string" ? value.text : "";
|
|
125
|
+
const runConfig = value.runConfig;
|
|
126
|
+
|
|
127
|
+
return (
|
|
128
|
+
<div className="flex flex-col gap-6">
|
|
129
|
+
<InfoCard title="Composer">
|
|
130
|
+
<SummaryList>
|
|
131
|
+
<SummaryItem label="Role" value={composer.role ?? "—"} />
|
|
132
|
+
<SummaryItem
|
|
133
|
+
label="Text length"
|
|
134
|
+
value={String(composer.textLength)}
|
|
135
|
+
/>
|
|
136
|
+
<SummaryItem
|
|
137
|
+
label="Attachments"
|
|
138
|
+
value={String(composer.attachments.length)}
|
|
139
|
+
/>
|
|
140
|
+
<SummaryItem label="Mode" value={composer.type ?? "—"} />
|
|
141
|
+
</SummaryList>
|
|
142
|
+
<ComposerFlags composer={composer} />
|
|
143
|
+
<ComposerAttachments attachments={composer.attachments} />
|
|
144
|
+
<ComposerQueue queue={composer.queue} />
|
|
145
|
+
</InfoCard>
|
|
146
|
+
|
|
147
|
+
{text ? (
|
|
148
|
+
<InfoCard title="Text preview">
|
|
149
|
+
<p className="text-foreground text-[12px] wrap-break-word whitespace-pre-wrap">
|
|
150
|
+
{truncate(text, 240)}
|
|
151
|
+
</p>
|
|
152
|
+
</InfoCard>
|
|
153
|
+
) : null}
|
|
154
|
+
|
|
155
|
+
{runConfig !== undefined ? (
|
|
156
|
+
<InfoCard title="Run config">
|
|
157
|
+
<JSONTree value={runConfig} />
|
|
158
|
+
</InfoCard>
|
|
159
|
+
) : null}
|
|
160
|
+
</div>
|
|
161
|
+
);
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
export const renderStatePreview = (key: string, value: unknown) => {
|
|
165
|
+
switch (key) {
|
|
166
|
+
case "threads":
|
|
167
|
+
return renderThreadsStatePreview(value);
|
|
168
|
+
case "threadListItems":
|
|
169
|
+
return renderThreadsStatePreview({
|
|
170
|
+
threadItems: value,
|
|
171
|
+
threadIds: [],
|
|
172
|
+
archivedThreadIds: [],
|
|
173
|
+
});
|
|
174
|
+
case "thread":
|
|
175
|
+
return renderThreadStatePreview(value);
|
|
176
|
+
case "threadListItem":
|
|
177
|
+
case "threadlistitem":
|
|
178
|
+
return renderThreadListItemStatePreview(value);
|
|
179
|
+
case "tools":
|
|
180
|
+
return renderToolUIsStatePreview(value);
|
|
181
|
+
case "composer":
|
|
182
|
+
return renderComposerStatePreview(value);
|
|
183
|
+
case "mcp":
|
|
184
|
+
return <McpView value={value} />;
|
|
185
|
+
default:
|
|
186
|
+
return <JSONTree value={value} />;
|
|
187
|
+
}
|
|
188
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import { diffValues } from "../../utils/diff";
|
|
3
|
+
import type { DiffEntry } from "../../utils/diff";
|
|
4
|
+
|
|
5
|
+
const SIGN: Record<DiffEntry["kind"], { mark: string; tone: string }> = {
|
|
6
|
+
added: { mark: "+", tone: "text-emerald-600 dark:text-emerald-400" },
|
|
7
|
+
removed: { mark: "−", tone: "text-red-600 dark:text-red-400" },
|
|
8
|
+
changed: { mark: "~", tone: "text-amber-600 dark:text-amber-400" },
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const format = (value: unknown) =>
|
|
12
|
+
typeof value === "string" ? `"${value}"` : JSON.stringify(value);
|
|
13
|
+
|
|
14
|
+
export const PayloadDiff = ({
|
|
15
|
+
before,
|
|
16
|
+
after,
|
|
17
|
+
}: {
|
|
18
|
+
before: unknown;
|
|
19
|
+
after: unknown;
|
|
20
|
+
}) => {
|
|
21
|
+
const entries = diffValues(before, after);
|
|
22
|
+
|
|
23
|
+
if (entries.length === 0) {
|
|
24
|
+
return (
|
|
25
|
+
<div className="text-muted-foreground text-[11px]">
|
|
26
|
+
no change from the previous event in this scope
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<div className="flex flex-col gap-0.5 font-mono text-[11px]">
|
|
33
|
+
{entries.map((entry, index) => {
|
|
34
|
+
const { mark, tone } = SIGN[entry.kind];
|
|
35
|
+
return (
|
|
36
|
+
<div key={index} className="flex flex-wrap items-baseline gap-1.5">
|
|
37
|
+
<span className={clsx("shrink-0", tone)}>{mark}</span>
|
|
38
|
+
<span className="text-muted-foreground">{entry.path}</span>
|
|
39
|
+
<span className="text-foreground break-all">
|
|
40
|
+
{entry.kind === "changed"
|
|
41
|
+
? `${format(entry.before)} → ${format(entry.after)}`
|
|
42
|
+
: format(entry.kind === "added" ? entry.after : entry.before)}
|
|
43
|
+
</span>
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
})}
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
};
|