@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
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
//#region src/styles/DevToolsModal.styles.ts
|
|
2
|
-
const COLORS = {
|
|
3
|
-
light: {
|
|
4
|
-
primary: "#2563EB",
|
|
5
|
-
background: "#f8fafc",
|
|
6
|
-
surface: "#ffffff",
|
|
7
|
-
text: "#111827",
|
|
8
|
-
textLight: "#6b7280",
|
|
9
|
-
border: "rgba(148, 163, 184, 0.35)",
|
|
10
|
-
shadow: "rgba(37, 99, 235, 0.35)",
|
|
11
|
-
buttonText: "#f9fafb",
|
|
12
|
-
hoverBg: "rgba(148, 163, 184, 0.18)"
|
|
13
|
-
},
|
|
14
|
-
dark: {
|
|
15
|
-
primary: "#111827",
|
|
16
|
-
background: "#09090b",
|
|
17
|
-
surface: "#09090b",
|
|
18
|
-
text: "#e5e7eb",
|
|
19
|
-
textLight: "#9ca3af",
|
|
20
|
-
border: "rgba(63, 63, 70, 0.6)",
|
|
21
|
-
shadow: "rgba(0, 0, 0, 0.55)",
|
|
22
|
-
buttonText: "#e5e7eb",
|
|
23
|
-
hoverBg: "rgba(148, 163, 184, 0.12)"
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
const getStyles = (darkMode) => {
|
|
27
|
-
const theme = darkMode ? COLORS.dark : COLORS.light;
|
|
28
|
-
return {
|
|
29
|
-
floatingContainer: {
|
|
30
|
-
position: "fixed",
|
|
31
|
-
bottom: "24px",
|
|
32
|
-
right: "24px",
|
|
33
|
-
zIndex: 2147483647
|
|
34
|
-
},
|
|
35
|
-
floatingButton: {
|
|
36
|
-
width: "42px",
|
|
37
|
-
height: "42px",
|
|
38
|
-
borderRadius: "9999px",
|
|
39
|
-
border: "none",
|
|
40
|
-
background: theme.primary,
|
|
41
|
-
color: theme.buttonText,
|
|
42
|
-
cursor: "pointer",
|
|
43
|
-
display: "flex",
|
|
44
|
-
alignItems: "center",
|
|
45
|
-
justifyContent: "center",
|
|
46
|
-
boxShadow: darkMode ? `0 10px 40px ${COLORS.dark.shadow}` : `0 10px 40px ${COLORS.light.shadow}`,
|
|
47
|
-
transition: "transform 0.2s ease, box-shadow 0.2s ease"
|
|
48
|
-
},
|
|
49
|
-
floatingButtonHover: {
|
|
50
|
-
transform: "translateY(-2px)",
|
|
51
|
-
boxShadow: darkMode ? "0 16px 50px rgba(17, 24, 39, 0.55)" : "0 16px 50px rgba(37, 99, 235, 0.45)"
|
|
52
|
-
},
|
|
53
|
-
backdrop: {
|
|
54
|
-
position: "fixed",
|
|
55
|
-
inset: 0,
|
|
56
|
-
background: "rgba(15, 23, 42, 0.45)",
|
|
57
|
-
backdropFilter: "blur(6px)",
|
|
58
|
-
animation: "fadeIn 0.12s ease",
|
|
59
|
-
zIndex: 2147483646
|
|
60
|
-
},
|
|
61
|
-
modal: {
|
|
62
|
-
position: "fixed",
|
|
63
|
-
top: "50%",
|
|
64
|
-
left: "50%",
|
|
65
|
-
transform: "translate(-50%, -50%)",
|
|
66
|
-
width: "min(960px, 90vw)",
|
|
67
|
-
height: "min(720px, 85vh)",
|
|
68
|
-
background: theme.background,
|
|
69
|
-
borderRadius: "16px",
|
|
70
|
-
border: `1px solid ${theme.border}`,
|
|
71
|
-
boxShadow: darkMode ? "0 32px 120px rgba(0, 0, 0, 0.55)" : "0 32px 120px rgba(15, 23, 42, 0.35)",
|
|
72
|
-
display: "flex",
|
|
73
|
-
flexDirection: "column",
|
|
74
|
-
overflow: "hidden",
|
|
75
|
-
animation: "slideIn 0.16s ease",
|
|
76
|
-
zIndex: 2147483647
|
|
77
|
-
},
|
|
78
|
-
dismissButton: {
|
|
79
|
-
alignSelf: "flex-end",
|
|
80
|
-
margin: "10px 12px 0 0",
|
|
81
|
-
background: "transparent",
|
|
82
|
-
border: "none",
|
|
83
|
-
color: theme.textLight,
|
|
84
|
-
cursor: "pointer",
|
|
85
|
-
padding: "6px",
|
|
86
|
-
borderRadius: "6px",
|
|
87
|
-
transition: "background 0.2s ease, color 0.2s ease"
|
|
88
|
-
},
|
|
89
|
-
dismissButtonHover: {
|
|
90
|
-
background: theme.hoverBg,
|
|
91
|
-
color: theme.text
|
|
92
|
-
},
|
|
93
|
-
modalContent: {
|
|
94
|
-
flex: 1,
|
|
95
|
-
overflow: "hidden",
|
|
96
|
-
position: "relative",
|
|
97
|
-
background: theme.background
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
const ANIMATION_STYLES = `
|
|
102
|
-
@keyframes fadeIn {
|
|
103
|
-
from { opacity: 0; }
|
|
104
|
-
to { opacity: 1; }
|
|
105
|
-
}
|
|
106
|
-
@keyframes slideIn {
|
|
107
|
-
from {
|
|
108
|
-
opacity: 0;
|
|
109
|
-
transform: translate(-50%, -48%) scale(0.95);
|
|
110
|
-
}
|
|
111
|
-
to {
|
|
112
|
-
opacity: 1;
|
|
113
|
-
transform: translate(-50%, -50%) scale(1);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
`;
|
|
117
|
-
//#endregion
|
|
118
|
-
export { ANIMATION_STYLES, getStyles };
|
|
119
|
-
|
|
120
|
-
//# sourceMappingURL=DevToolsModal.styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DevToolsModal.styles.js","names":["CSSProperties","DevToolsModalStyles","floatingContainer","floatingButton","floatingButtonHover","backdrop","modal","dismissButton","dismissButtonHover","modalContent","COLORS","light","primary","background","surface","text","textLight","border","shadow","buttonText","hoverBg","dark","const","getStyles","darkMode","theme","position","bottom","right","zIndex","width","height","borderRadius","color","cursor","display","alignItems","justifyContent","boxShadow","transition","transform","inset","backdropFilter","animation","top","left","flexDirection","overflow","alignSelf","margin","padding","flex","ANIMATION_STYLES"],"sources":["../../src/styles/DevToolsModal.styles.ts"],"sourcesContent":["import type { CSSProperties } from \"react\";\n\nexport interface DevToolsModalStyles {\n floatingContainer: CSSProperties;\n floatingButton: CSSProperties;\n floatingButtonHover: CSSProperties;\n backdrop: CSSProperties;\n modal: CSSProperties;\n dismissButton: CSSProperties;\n dismissButtonHover: CSSProperties;\n modalContent: CSSProperties;\n}\n\nconst COLORS = {\n light: {\n primary: \"#2563EB\",\n background: \"#f8fafc\",\n surface: \"#ffffff\",\n text: \"#111827\",\n textLight: \"#6b7280\",\n border: \"rgba(148, 163, 184, 0.35)\",\n shadow: \"rgba(37, 99, 235, 0.35)\",\n buttonText: \"#f9fafb\",\n hoverBg: \"rgba(148, 163, 184, 0.18)\",\n },\n dark: {\n primary: \"#111827\",\n background: \"#09090b\",\n surface: \"#09090b\",\n text: \"#e5e7eb\",\n textLight: \"#9ca3af\",\n border: \"rgba(63, 63, 70, 0.6)\",\n shadow: \"rgba(0, 0, 0, 0.55)\",\n buttonText: \"#e5e7eb\",\n hoverBg: \"rgba(148, 163, 184, 0.12)\",\n },\n} as const;\n\nexport const getStyles = (darkMode: boolean): DevToolsModalStyles => {\n const theme = darkMode ? COLORS.dark : COLORS.light;\n\n return {\n floatingContainer: {\n position: \"fixed\",\n bottom: \"24px\",\n right: \"24px\",\n zIndex: 2147483647,\n },\n floatingButton: {\n width: \"42px\",\n height: \"42px\",\n borderRadius: \"9999px\",\n border: \"none\",\n background: theme.primary,\n color: theme.buttonText,\n cursor: \"pointer\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n boxShadow: darkMode\n ? `0 10px 40px ${COLORS.dark.shadow}`\n : `0 10px 40px ${COLORS.light.shadow}`,\n transition: \"transform 0.2s ease, box-shadow 0.2s ease\",\n },\n floatingButtonHover: {\n transform: \"translateY(-2px)\",\n boxShadow: darkMode\n ? \"0 16px 50px rgba(17, 24, 39, 0.55)\"\n : \"0 16px 50px rgba(37, 99, 235, 0.45)\",\n },\n backdrop: {\n position: \"fixed\",\n inset: 0,\n background: \"rgba(15, 23, 42, 0.45)\",\n backdropFilter: \"blur(6px)\",\n animation: \"fadeIn 0.12s ease\",\n zIndex: 2147483646,\n },\n modal: {\n position: \"fixed\",\n top: \"50%\",\n left: \"50%\",\n transform: \"translate(-50%, -50%)\",\n width: \"min(960px, 90vw)\",\n height: \"min(720px, 85vh)\",\n background: theme.background,\n borderRadius: \"16px\",\n border: `1px solid ${theme.border}`,\n boxShadow: darkMode\n ? \"0 32px 120px rgba(0, 0, 0, 0.55)\"\n : \"0 32px 120px rgba(15, 23, 42, 0.35)\",\n display: \"flex\",\n flexDirection: \"column\",\n overflow: \"hidden\",\n animation: \"slideIn 0.16s ease\",\n zIndex: 2147483647,\n },\n dismissButton: {\n alignSelf: \"flex-end\",\n margin: \"10px 12px 0 0\",\n background: \"transparent\",\n border: \"none\",\n color: theme.textLight,\n cursor: \"pointer\",\n padding: \"6px\",\n borderRadius: \"6px\",\n transition: \"background 0.2s ease, color 0.2s ease\",\n },\n dismissButtonHover: {\n background: theme.hoverBg,\n color: theme.text,\n },\n modalContent: {\n flex: 1,\n overflow: \"hidden\",\n position: \"relative\",\n background: theme.background,\n },\n };\n};\n\nexport const ANIMATION_STYLES = `\n @keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n @keyframes slideIn {\n from {\n opacity: 0;\n transform: translate(-50%, -48%) scale(0.95);\n }\n to {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n }\n`;\n"],"mappings":";AAaA,MAAMU,SAAS;CACbC,OAAO;EACLC,SAAS;EACTC,YAAY;EACZC,SAAS;EACTC,MAAM;EACNC,WAAW;EACXC,QAAQ;EACRC,QAAQ;EACRC,YAAY;EACZC,SAAS;CACX;CACAC,MAAM;EACJT,SAAS;EACTC,YAAY;EACZC,SAAS;EACTC,MAAM;EACNC,WAAW;EACXC,QAAQ;EACRC,QAAQ;EACRC,YAAY;EACZC,SAAS;CACX;AACF;AAEA,MAAaG,aAAaC,aAA2C;CACnE,MAAMC,QAAQD,WAAWd,OAAOW,OAAOX,OAAOC;CAE9C,OAAO;EACLT,mBAAmB;GACjBwB,UAAU;GACVC,QAAQ;GACRC,OAAO;GACPC,QAAQ;EACV;EACA1B,gBAAgB;GACd2B,OAAO;GACPC,QAAQ;GACRC,cAAc;GACdf,QAAQ;GACRJ,YAAYY,MAAMb;GAClBqB,OAAOR,MAAMN;GACbe,QAAQ;GACRC,SAAS;GACTC,YAAY;GACZC,gBAAgB;GAChBC,WAAWd,WACP,eAAed,OAAOW,KAAKH,WAC3B,eAAeR,OAAOC,MAAMO;GAChCqB,YAAY;EACd;EACAnC,qBAAqB;GACnBoC,WAAW;GACXF,WAAWd,WACP,uCACA;EACN;EACAnB,UAAU;GACRqB,UAAU;GACVe,OAAO;GACP5B,YAAY;GACZ6B,gBAAgB;GAChBC,WAAW;GACXd,QAAQ;EACV;EACAvB,OAAO;GACLoB,UAAU;GACVkB,KAAK;GACLC,MAAM;GACNL,WAAW;GACXV,OAAO;GACPC,QAAQ;GACRlB,YAAYY,MAAMZ;GAClBmB,cAAc;GACdf,QAAQ,aAAaQ,MAAMR;GAC3BqB,WAAWd,WACP,qCACA;GACJW,SAAS;GACTW,eAAe;GACfC,UAAU;GACVJ,WAAW;GACXd,QAAQ;EACV;EACAtB,eAAe;GACbyC,WAAW;GACXC,QAAQ;GACRpC,YAAY;GACZI,QAAQ;GACRgB,OAAOR,MAAMT;GACbkB,QAAQ;GACRgB,SAAS;GACTlB,cAAc;GACdO,YAAY;EACd;EACA/B,oBAAoB;GAClBK,YAAYY,MAAML;GAClBa,OAAOR,MAAMV;EACf;EACAN,cAAc;GACZ0C,MAAM;GACNJ,UAAU;GACVrB,UAAU;GACVb,YAAYY,MAAMZ;EACpB;CACF;AACF;AAEA,MAAauC,mBAAmB"}
|
package/src/DevToolsFrame.tsx
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { useCallback, useEffect, useMemo, useRef } from "react";
|
|
4
|
-
import { FrameHost } from "./FrameHost";
|
|
5
|
-
import { DEFAULT_FRAME_URL } from "./constants";
|
|
6
|
-
|
|
7
|
-
export interface DevToolsFrameProps {
|
|
8
|
-
frameUrl?: string;
|
|
9
|
-
className?: string;
|
|
10
|
-
style?: React.CSSProperties;
|
|
11
|
-
title?: string;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const DevToolsFrame: React.FC<DevToolsFrameProps> = ({
|
|
15
|
-
frameUrl = DEFAULT_FRAME_URL,
|
|
16
|
-
className,
|
|
17
|
-
style,
|
|
18
|
-
title = "assistant-ui DevTools",
|
|
19
|
-
}) => {
|
|
20
|
-
const iframeRef = useRef<HTMLIFrameElement | null>(null);
|
|
21
|
-
const frameHostRef = useRef<FrameHost | null>(null);
|
|
22
|
-
|
|
23
|
-
const resolvedFrameUrl = useMemo(() => frameUrl, [frameUrl]);
|
|
24
|
-
|
|
25
|
-
const handleFrameLoad = useCallback(() => {
|
|
26
|
-
if (frameHostRef.current) {
|
|
27
|
-
frameHostRef.current.destroy();
|
|
28
|
-
frameHostRef.current = null;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if (iframeRef.current) {
|
|
32
|
-
frameHostRef.current = new FrameHost(iframeRef.current);
|
|
33
|
-
}
|
|
34
|
-
}, []);
|
|
35
|
-
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
return () => {
|
|
38
|
-
if (frameHostRef.current) {
|
|
39
|
-
frameHostRef.current.destroy();
|
|
40
|
-
frameHostRef.current = null;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
}, []);
|
|
44
|
-
|
|
45
|
-
return (
|
|
46
|
-
<iframe
|
|
47
|
-
ref={iframeRef}
|
|
48
|
-
src={resolvedFrameUrl}
|
|
49
|
-
onLoad={handleFrameLoad}
|
|
50
|
-
className={className}
|
|
51
|
-
style={style}
|
|
52
|
-
title={title}
|
|
53
|
-
/>
|
|
54
|
-
);
|
|
55
|
-
};
|
package/src/DevToolsHost.ts
DELETED
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import { DevToolsHooks } from "@assistant-ui/react";
|
|
2
|
-
import {
|
|
3
|
-
sanitizeAndRedact,
|
|
4
|
-
sanitizeForMessage,
|
|
5
|
-
serializeModelContext,
|
|
6
|
-
} from "./utils/serialization";
|
|
7
|
-
|
|
8
|
-
interface FrameToHostMessage {
|
|
9
|
-
type: "subscription" | "clearEvents";
|
|
10
|
-
data: {
|
|
11
|
-
apiList?: boolean;
|
|
12
|
-
apis?: number[];
|
|
13
|
-
apiId?: number;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
interface HostToFrameMessage {
|
|
18
|
-
type: "update";
|
|
19
|
-
data: {
|
|
20
|
-
apiList?: Array<{ apiId: number }>;
|
|
21
|
-
apis?: Array<{
|
|
22
|
-
apiId: number;
|
|
23
|
-
state: any;
|
|
24
|
-
events: any[];
|
|
25
|
-
modelContext?: any;
|
|
26
|
-
scopes?: any;
|
|
27
|
-
}>;
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export class DevToolsHost {
|
|
32
|
-
private subscription: {
|
|
33
|
-
apiList: boolean;
|
|
34
|
-
apis: Set<number>;
|
|
35
|
-
} = {
|
|
36
|
-
apiList: false,
|
|
37
|
-
apis: new Set(),
|
|
38
|
-
};
|
|
39
|
-
private unsubscribe?: () => void;
|
|
40
|
-
private onSendMessage: (message: HostToFrameMessage) => void;
|
|
41
|
-
|
|
42
|
-
constructor(onSendMessage: (message: HostToFrameMessage) => void) {
|
|
43
|
-
this.onSendMessage = onSendMessage;
|
|
44
|
-
this.subscribeToDevTools();
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
onReceiveMessage(message: FrameToHostMessage) {
|
|
48
|
-
switch (message.type) {
|
|
49
|
-
case "subscription":
|
|
50
|
-
this.handleSubscription(message.data);
|
|
51
|
-
break;
|
|
52
|
-
case "clearEvents":
|
|
53
|
-
if (typeof message.data.apiId === "number") {
|
|
54
|
-
DevToolsHooks.clearEventLogs(message.data.apiId);
|
|
55
|
-
// The subscription will automatically trigger an update
|
|
56
|
-
}
|
|
57
|
-
break;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
private handleSubscription(data: FrameToHostMessage["data"]) {
|
|
62
|
-
const prevApiList = this.subscription.apiList;
|
|
63
|
-
const prevApis = new Set(this.subscription.apis);
|
|
64
|
-
|
|
65
|
-
this.subscription.apiList = data.apiList || false;
|
|
66
|
-
this.subscription.apis = new Set(data.apis);
|
|
67
|
-
|
|
68
|
-
// Only send update if subscription actually changed
|
|
69
|
-
const apisChanged =
|
|
70
|
-
prevApis.size !== this.subscription.apis.size ||
|
|
71
|
-
[...this.subscription.apis].some((id) => !prevApis.has(id));
|
|
72
|
-
|
|
73
|
-
if (prevApiList !== this.subscription.apiList || apisChanged) {
|
|
74
|
-
this.sendUpdate();
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
private subscribeToDevTools() {
|
|
79
|
-
this.unsubscribe = DevToolsHooks.subscribe(() => {
|
|
80
|
-
this.sendUpdate();
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
private sendUpdate() {
|
|
85
|
-
const update: HostToFrameMessage = {
|
|
86
|
-
type: "update",
|
|
87
|
-
data: {},
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
const allApis = DevToolsHooks.getApis();
|
|
91
|
-
for (const subscriptionApiId of this.subscription.apis) {
|
|
92
|
-
if (!allApis.has(subscriptionApiId)) {
|
|
93
|
-
this.subscription.apis.delete(subscriptionApiId);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
if (this.subscription.apiList) {
|
|
98
|
-
update.data.apiList = [...allApis.keys()].map((apiId) => ({ apiId }));
|
|
99
|
-
|
|
100
|
-
if (this.subscription.apis.size === 0 && allApis.size > 0) {
|
|
101
|
-
this.subscription.apis = new Set([allApis.keys().next().value!]);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
if (this.subscription.apis.size > 0) {
|
|
106
|
-
update.data.apis = [];
|
|
107
|
-
|
|
108
|
-
for (const apiId of this.subscription.apis) {
|
|
109
|
-
const apiEntry = allApis.get(apiId);
|
|
110
|
-
if (apiEntry) {
|
|
111
|
-
// Collect root-scope state plus the identity and method catalog of
|
|
112
|
-
// every accessor (root and derived) for the scope graph.
|
|
113
|
-
const state: Record<string, unknown> = {};
|
|
114
|
-
const scopes: Array<{
|
|
115
|
-
name: string;
|
|
116
|
-
source: string | null;
|
|
117
|
-
query: Record<string, unknown> | null;
|
|
118
|
-
methods: string[];
|
|
119
|
-
}> = [];
|
|
120
|
-
if (apiEntry.api) {
|
|
121
|
-
for (const [name, scope] of Object.entries(apiEntry.api)) {
|
|
122
|
-
if (typeof scope === "function" && "source" in scope) {
|
|
123
|
-
let methods: string[] = [];
|
|
124
|
-
try {
|
|
125
|
-
const scopeValue = scope();
|
|
126
|
-
if (scopeValue && typeof scopeValue === "object") {
|
|
127
|
-
methods = Object.keys(scopeValue).filter(
|
|
128
|
-
(key) =>
|
|
129
|
-
typeof (scopeValue as Record<string, unknown>)[key] ===
|
|
130
|
-
"function",
|
|
131
|
-
);
|
|
132
|
-
}
|
|
133
|
-
if (scope.source === "root") {
|
|
134
|
-
state[name] = scopeValue?.getState?.() ?? scopeValue;
|
|
135
|
-
}
|
|
136
|
-
} catch {
|
|
137
|
-
// scope() may throw (derived scopes before the client is
|
|
138
|
-
// mounted, or a broken root scope implementation).
|
|
139
|
-
}
|
|
140
|
-
scopes.push({
|
|
141
|
-
name,
|
|
142
|
-
source: scope.source,
|
|
143
|
-
query: scope.query,
|
|
144
|
-
methods,
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
// Extract model context from thread runtime
|
|
151
|
-
const modelContext = serializeModelContext(
|
|
152
|
-
apiEntry.api?.thread?.().getModelContext(),
|
|
153
|
-
);
|
|
154
|
-
|
|
155
|
-
update.data.apis.push({
|
|
156
|
-
apiId,
|
|
157
|
-
state: sanitizeForMessage(state),
|
|
158
|
-
events: sanitizeForMessage(apiEntry.logs) as unknown[],
|
|
159
|
-
modelContext: modelContext,
|
|
160
|
-
scopes: sanitizeAndRedact(scopes),
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
if (Object.keys(update.data).length === 0) {
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
this.onSendMessage(update);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
destroy() {
|
|
174
|
-
if (this.unsubscribe) {
|
|
175
|
-
this.unsubscribe();
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
package/src/ExtensionHost.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { DevToolsHost } from "./DevToolsHost";
|
|
2
|
-
|
|
3
|
-
export class ExtensionHost {
|
|
4
|
-
private devToolsHost: DevToolsHost;
|
|
5
|
-
private messageListener: (event: MessageEvent) => void;
|
|
6
|
-
|
|
7
|
-
constructor() {
|
|
8
|
-
// Create DevToolsHost with callback to send messages through extension
|
|
9
|
-
this.devToolsHost = new DevToolsHost((message) => {
|
|
10
|
-
console.log("[ExtensionHost] Sending message to iframe:", message);
|
|
11
|
-
window.postMessage(
|
|
12
|
-
{
|
|
13
|
-
source: "assistant-ui-devtools-page",
|
|
14
|
-
payload: message,
|
|
15
|
-
},
|
|
16
|
-
"*",
|
|
17
|
-
);
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
// Setup listener to forward messages from extension to DevToolsHost
|
|
21
|
-
this.messageListener = (event: MessageEvent) => {
|
|
22
|
-
if (event.source !== window) return;
|
|
23
|
-
|
|
24
|
-
// Log ALL messages to see what's coming through
|
|
25
|
-
if (event.data.source === "assistant-ui-devtools-iframe") {
|
|
26
|
-
console.log("[ExtensionHost] Received message from iframe:", {
|
|
27
|
-
source: event.data.source,
|
|
28
|
-
payload: event.data.payload,
|
|
29
|
-
fullData: event.data,
|
|
30
|
-
});
|
|
31
|
-
this.devToolsHost.onReceiveMessage(event.data.payload);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
window.addEventListener("message", this.messageListener);
|
|
36
|
-
|
|
37
|
-
// Announce that a new host has connected
|
|
38
|
-
// This tells the iframe to re-send its subscription
|
|
39
|
-
setTimeout(() => {
|
|
40
|
-
console.log("[ExtensionHost] Announcing connection to iframe");
|
|
41
|
-
window.postMessage(
|
|
42
|
-
{
|
|
43
|
-
source: "assistant-ui-devtools-page",
|
|
44
|
-
payload: {
|
|
45
|
-
type: "host-connected",
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
"*",
|
|
49
|
-
);
|
|
50
|
-
}, 100);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
destroy() {
|
|
54
|
-
window.removeEventListener("message", this.messageListener);
|
|
55
|
-
this.devToolsHost.destroy();
|
|
56
|
-
}
|
|
57
|
-
}
|
package/src/FrameClient.ts
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
interface ApiData {
|
|
2
|
-
apiId: number;
|
|
3
|
-
state: any;
|
|
4
|
-
events: any[];
|
|
5
|
-
modelContext?: any;
|
|
6
|
-
scopes?: any;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
interface UpdateMessage {
|
|
10
|
-
type: "update";
|
|
11
|
-
data: {
|
|
12
|
-
apiList?: Array<{ apiId: number }>;
|
|
13
|
-
apis?: ApiData[];
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
interface HostConnectedMessage {
|
|
18
|
-
type: "host-connected";
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
type UpdateListener = (data: {
|
|
22
|
-
apiList?: Array<{ apiId: number }>;
|
|
23
|
-
apis?: ApiData[];
|
|
24
|
-
}) => void;
|
|
25
|
-
|
|
26
|
-
export class FrameClient {
|
|
27
|
-
private listeners = new Set<UpdateListener>();
|
|
28
|
-
private connectionListeners = new Set<() => void>();
|
|
29
|
-
private lastUpdate: {
|
|
30
|
-
apiList?: Array<{ apiId: number }>;
|
|
31
|
-
apis?: ApiData[];
|
|
32
|
-
} = {};
|
|
33
|
-
|
|
34
|
-
constructor() {
|
|
35
|
-
this.setupMessageListener();
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
private setupMessageListener() {
|
|
39
|
-
window.addEventListener("message", (event) => {
|
|
40
|
-
const message = event.data as UpdateMessage | HostConnectedMessage;
|
|
41
|
-
|
|
42
|
-
if (message.type === "update") {
|
|
43
|
-
this.lastUpdate = message.data;
|
|
44
|
-
this.notifyListeners(message.data);
|
|
45
|
-
} else if (message.type === "host-connected") {
|
|
46
|
-
// Host has reconnected (page refresh), notify listeners to re-subscribe
|
|
47
|
-
this.connectionListeners.forEach((listener) => listener());
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
onHostConnected(listener: () => void): () => void {
|
|
53
|
-
this.connectionListeners.add(listener);
|
|
54
|
-
return () => {
|
|
55
|
-
this.connectionListeners.delete(listener);
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
subscribe(listener: UpdateListener): () => void {
|
|
60
|
-
this.listeners.add(listener);
|
|
61
|
-
|
|
62
|
-
// Send the last update to the new listener
|
|
63
|
-
if (this.lastUpdate.apiList || this.lastUpdate.apis) {
|
|
64
|
-
listener(this.lastUpdate);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return () => {
|
|
68
|
-
this.listeners.delete(listener);
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
setSubscription(options: { apiList?: boolean; apis?: number[] }) {
|
|
73
|
-
window.parent.postMessage(
|
|
74
|
-
{
|
|
75
|
-
type: "subscription",
|
|
76
|
-
data: options,
|
|
77
|
-
},
|
|
78
|
-
"*",
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
clearEvents(apiId: number) {
|
|
83
|
-
window.parent.postMessage(
|
|
84
|
-
{
|
|
85
|
-
type: "clearEvents",
|
|
86
|
-
data: { apiId },
|
|
87
|
-
},
|
|
88
|
-
"*",
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
private notifyListeners(data: UpdateMessage["data"]) {
|
|
93
|
-
this.listeners.forEach((listener) => listener(data));
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
getLastUpdate() {
|
|
97
|
-
return this.lastUpdate;
|
|
98
|
-
}
|
|
99
|
-
}
|
package/src/FrameHost.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { DevToolsHost } from "./DevToolsHost";
|
|
2
|
-
|
|
3
|
-
export class FrameHost {
|
|
4
|
-
private frame: HTMLIFrameElement;
|
|
5
|
-
private devToolsHost: DevToolsHost;
|
|
6
|
-
private messageListener: (event: MessageEvent) => void;
|
|
7
|
-
|
|
8
|
-
constructor(frame: HTMLIFrameElement) {
|
|
9
|
-
this.frame = frame;
|
|
10
|
-
|
|
11
|
-
// Create DevToolsHost with callback to send messages to iframe
|
|
12
|
-
this.devToolsHost = new DevToolsHost((message) => {
|
|
13
|
-
if (this.frame.contentWindow) {
|
|
14
|
-
this.frame.contentWindow.postMessage(message, "*");
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
// Setup listener to forward messages from iframe to DevToolsHost
|
|
19
|
-
this.messageListener = (event: MessageEvent) => {
|
|
20
|
-
if (event.source !== this.frame.contentWindow) return;
|
|
21
|
-
this.devToolsHost.onReceiveMessage(event.data);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
window.addEventListener("message", this.messageListener);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
destroy() {
|
|
28
|
-
window.removeEventListener("message", this.messageListener);
|
|
29
|
-
this.devToolsHost.destroy();
|
|
30
|
-
}
|
|
31
|
-
}
|
package/src/constants.ts
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties } from "react";
|
|
2
|
-
|
|
3
|
-
export interface DevToolsModalStyles {
|
|
4
|
-
floatingContainer: CSSProperties;
|
|
5
|
-
floatingButton: CSSProperties;
|
|
6
|
-
floatingButtonHover: CSSProperties;
|
|
7
|
-
backdrop: CSSProperties;
|
|
8
|
-
modal: CSSProperties;
|
|
9
|
-
dismissButton: CSSProperties;
|
|
10
|
-
dismissButtonHover: CSSProperties;
|
|
11
|
-
modalContent: CSSProperties;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const COLORS = {
|
|
15
|
-
light: {
|
|
16
|
-
primary: "#2563EB",
|
|
17
|
-
background: "#f8fafc",
|
|
18
|
-
surface: "#ffffff",
|
|
19
|
-
text: "#111827",
|
|
20
|
-
textLight: "#6b7280",
|
|
21
|
-
border: "rgba(148, 163, 184, 0.35)",
|
|
22
|
-
shadow: "rgba(37, 99, 235, 0.35)",
|
|
23
|
-
buttonText: "#f9fafb",
|
|
24
|
-
hoverBg: "rgba(148, 163, 184, 0.18)",
|
|
25
|
-
},
|
|
26
|
-
dark: {
|
|
27
|
-
primary: "#111827",
|
|
28
|
-
background: "#09090b",
|
|
29
|
-
surface: "#09090b",
|
|
30
|
-
text: "#e5e7eb",
|
|
31
|
-
textLight: "#9ca3af",
|
|
32
|
-
border: "rgba(63, 63, 70, 0.6)",
|
|
33
|
-
shadow: "rgba(0, 0, 0, 0.55)",
|
|
34
|
-
buttonText: "#e5e7eb",
|
|
35
|
-
hoverBg: "rgba(148, 163, 184, 0.12)",
|
|
36
|
-
},
|
|
37
|
-
} as const;
|
|
38
|
-
|
|
39
|
-
export const getStyles = (darkMode: boolean): DevToolsModalStyles => {
|
|
40
|
-
const theme = darkMode ? COLORS.dark : COLORS.light;
|
|
41
|
-
|
|
42
|
-
return {
|
|
43
|
-
floatingContainer: {
|
|
44
|
-
position: "fixed",
|
|
45
|
-
bottom: "24px",
|
|
46
|
-
right: "24px",
|
|
47
|
-
zIndex: 2147483647,
|
|
48
|
-
},
|
|
49
|
-
floatingButton: {
|
|
50
|
-
width: "42px",
|
|
51
|
-
height: "42px",
|
|
52
|
-
borderRadius: "9999px",
|
|
53
|
-
border: "none",
|
|
54
|
-
background: theme.primary,
|
|
55
|
-
color: theme.buttonText,
|
|
56
|
-
cursor: "pointer",
|
|
57
|
-
display: "flex",
|
|
58
|
-
alignItems: "center",
|
|
59
|
-
justifyContent: "center",
|
|
60
|
-
boxShadow: darkMode
|
|
61
|
-
? `0 10px 40px ${COLORS.dark.shadow}`
|
|
62
|
-
: `0 10px 40px ${COLORS.light.shadow}`,
|
|
63
|
-
transition: "transform 0.2s ease, box-shadow 0.2s ease",
|
|
64
|
-
},
|
|
65
|
-
floatingButtonHover: {
|
|
66
|
-
transform: "translateY(-2px)",
|
|
67
|
-
boxShadow: darkMode
|
|
68
|
-
? "0 16px 50px rgba(17, 24, 39, 0.55)"
|
|
69
|
-
: "0 16px 50px rgba(37, 99, 235, 0.45)",
|
|
70
|
-
},
|
|
71
|
-
backdrop: {
|
|
72
|
-
position: "fixed",
|
|
73
|
-
inset: 0,
|
|
74
|
-
background: "rgba(15, 23, 42, 0.45)",
|
|
75
|
-
backdropFilter: "blur(6px)",
|
|
76
|
-
animation: "fadeIn 0.12s ease",
|
|
77
|
-
zIndex: 2147483646,
|
|
78
|
-
},
|
|
79
|
-
modal: {
|
|
80
|
-
position: "fixed",
|
|
81
|
-
top: "50%",
|
|
82
|
-
left: "50%",
|
|
83
|
-
transform: "translate(-50%, -50%)",
|
|
84
|
-
width: "min(960px, 90vw)",
|
|
85
|
-
height: "min(720px, 85vh)",
|
|
86
|
-
background: theme.background,
|
|
87
|
-
borderRadius: "16px",
|
|
88
|
-
border: `1px solid ${theme.border}`,
|
|
89
|
-
boxShadow: darkMode
|
|
90
|
-
? "0 32px 120px rgba(0, 0, 0, 0.55)"
|
|
91
|
-
: "0 32px 120px rgba(15, 23, 42, 0.35)",
|
|
92
|
-
display: "flex",
|
|
93
|
-
flexDirection: "column",
|
|
94
|
-
overflow: "hidden",
|
|
95
|
-
animation: "slideIn 0.16s ease",
|
|
96
|
-
zIndex: 2147483647,
|
|
97
|
-
},
|
|
98
|
-
dismissButton: {
|
|
99
|
-
alignSelf: "flex-end",
|
|
100
|
-
margin: "10px 12px 0 0",
|
|
101
|
-
background: "transparent",
|
|
102
|
-
border: "none",
|
|
103
|
-
color: theme.textLight,
|
|
104
|
-
cursor: "pointer",
|
|
105
|
-
padding: "6px",
|
|
106
|
-
borderRadius: "6px",
|
|
107
|
-
transition: "background 0.2s ease, color 0.2s ease",
|
|
108
|
-
},
|
|
109
|
-
dismissButtonHover: {
|
|
110
|
-
background: theme.hoverBg,
|
|
111
|
-
color: theme.text,
|
|
112
|
-
},
|
|
113
|
-
modalContent: {
|
|
114
|
-
flex: 1,
|
|
115
|
-
overflow: "hidden",
|
|
116
|
-
position: "relative",
|
|
117
|
-
background: theme.background,
|
|
118
|
-
},
|
|
119
|
-
};
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
export const ANIMATION_STYLES = `
|
|
123
|
-
@keyframes fadeIn {
|
|
124
|
-
from { opacity: 0; }
|
|
125
|
-
to { opacity: 1; }
|
|
126
|
-
}
|
|
127
|
-
@keyframes slideIn {
|
|
128
|
-
from {
|
|
129
|
-
opacity: 0;
|
|
130
|
-
transform: translate(-50%, -48%) scale(0.95);
|
|
131
|
-
}
|
|
132
|
-
to {
|
|
133
|
-
opacity: 1;
|
|
134
|
-
transform: translate(-50%, -50%) scale(1);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
`;
|