@agent-native/toolkit 0.0.0-beta-20260819143124
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 +151 -0
- package/agent-native.eject.json +588 -0
- package/dist/app-shell/header-actions.d.ts +18 -0
- package/dist/app-shell/header-actions.d.ts.map +1 -0
- package/dist/app-shell/header-actions.js +52 -0
- package/dist/app-shell/header-actions.js.map +1 -0
- package/dist/app-shell/index.d.ts +3 -0
- package/dist/app-shell/index.d.ts.map +1 -0
- package/dist/app-shell/index.js +3 -0
- package/dist/app-shell/index.js.map +1 -0
- package/dist/app-shell/sidebar-footer-actions.d.ts +14 -0
- package/dist/app-shell/sidebar-footer-actions.d.ts.map +1 -0
- package/dist/app-shell/sidebar-footer-actions.js +10 -0
- package/dist/app-shell/sidebar-footer-actions.js.map +1 -0
- package/dist/app-shell/sidebar-footer-actions.spec.d.ts +2 -0
- package/dist/app-shell/sidebar-footer-actions.spec.d.ts.map +1 -0
- package/dist/app-shell/sidebar-footer-actions.spec.js +43 -0
- package/dist/app-shell/sidebar-footer-actions.spec.js.map +1 -0
- package/dist/canvas-annotations/CanvasCommentPins.d.ts +68 -0
- package/dist/canvas-annotations/CanvasCommentPins.d.ts.map +1 -0
- package/dist/canvas-annotations/CanvasCommentPins.js +513 -0
- package/dist/canvas-annotations/CanvasCommentPins.js.map +1 -0
- package/dist/canvas-annotations/DrawOverlay.d.ts +108 -0
- package/dist/canvas-annotations/DrawOverlay.d.ts.map +1 -0
- package/dist/canvas-annotations/DrawOverlay.js +746 -0
- package/dist/canvas-annotations/DrawOverlay.js.map +1 -0
- package/dist/canvas-annotations/DrawOverlay.spec.d.ts +2 -0
- package/dist/canvas-annotations/DrawOverlay.spec.d.ts.map +1 -0
- package/dist/canvas-annotations/DrawOverlay.spec.js +111 -0
- package/dist/canvas-annotations/DrawOverlay.spec.js.map +1 -0
- package/dist/canvas-annotations/index.d.ts +4 -0
- package/dist/canvas-annotations/index.d.ts.map +1 -0
- package/dist/canvas-annotations/index.js +3 -0
- package/dist/canvas-annotations/index.js.map +1 -0
- package/dist/canvas-annotations/types.d.ts +8 -0
- package/dist/canvas-annotations/types.d.ts.map +1 -0
- package/dist/canvas-annotations/types.js +2 -0
- package/dist/canvas-annotations/types.js.map +1 -0
- package/dist/canvas-interactions/canvas-interactions.d.ts +334 -0
- package/dist/canvas-interactions/canvas-interactions.d.ts.map +1 -0
- package/dist/canvas-interactions/canvas-interactions.js +486 -0
- package/dist/canvas-interactions/canvas-interactions.js.map +1 -0
- package/dist/canvas-interactions/canvas-interactions.spec.d.ts +2 -0
- package/dist/canvas-interactions/canvas-interactions.spec.d.ts.map +1 -0
- package/dist/canvas-interactions/canvas-interactions.spec.js +593 -0
- package/dist/canvas-interactions/canvas-interactions.spec.js.map +1 -0
- package/dist/canvas-interactions/index.d.ts +2 -0
- package/dist/canvas-interactions/index.d.ts.map +1 -0
- package/dist/canvas-interactions/index.js +2 -0
- package/dist/canvas-interactions/index.js.map +1 -0
- package/dist/chat-history/ChatHistoryList.d.ts +103 -0
- package/dist/chat-history/ChatHistoryList.d.ts.map +1 -0
- package/dist/chat-history/ChatHistoryList.js +102 -0
- package/dist/chat-history/ChatHistoryList.js.map +1 -0
- package/dist/chat-history/ChatHistoryList.spec.d.ts +2 -0
- package/dist/chat-history/ChatHistoryList.spec.d.ts.map +1 -0
- package/dist/chat-history/ChatHistoryList.spec.js +293 -0
- package/dist/chat-history/ChatHistoryList.spec.js.map +1 -0
- package/dist/chat-history/ChatHistoryRail.d.ts +33 -0
- package/dist/chat-history/ChatHistoryRail.d.ts.map +1 -0
- package/dist/chat-history/ChatHistoryRail.js +35 -0
- package/dist/chat-history/ChatHistoryRail.js.map +1 -0
- package/dist/chat-history/ChatHistoryRail.spec.d.ts +2 -0
- package/dist/chat-history/ChatHistoryRail.spec.d.ts.map +1 -0
- package/dist/chat-history/ChatHistoryRail.spec.js +157 -0
- package/dist/chat-history/ChatHistoryRail.spec.js.map +1 -0
- package/dist/chat-history/index.d.ts +4 -0
- package/dist/chat-history/index.d.ts.map +1 -0
- package/dist/chat-history/index.js +4 -0
- package/dist/chat-history/index.js.map +1 -0
- package/dist/chat-history/useChatHistoryRailController.d.ts +26 -0
- package/dist/chat-history/useChatHistoryRailController.d.ts.map +1 -0
- package/dist/chat-history/useChatHistoryRailController.js +36 -0
- package/dist/chat-history/useChatHistoryRailController.js.map +1 -0
- package/dist/chat-history/useChatHistoryRailController.spec.d.ts +2 -0
- package/dist/chat-history/useChatHistoryRailController.spec.d.ts.map +1 -0
- package/dist/chat-history/useChatHistoryRailController.spec.js +101 -0
- package/dist/chat-history/useChatHistoryRailController.spec.js.map +1 -0
- package/dist/chat-history.css +469 -0
- package/dist/collab-ui/AgentPresenceChip.d.ts +12 -0
- package/dist/collab-ui/AgentPresenceChip.d.ts.map +1 -0
- package/dist/collab-ui/AgentPresenceChip.js +42 -0
- package/dist/collab-ui/AgentPresenceChip.js.map +1 -0
- package/dist/collab-ui/LiveCursorOverlay.d.ts +46 -0
- package/dist/collab-ui/LiveCursorOverlay.d.ts.map +1 -0
- package/dist/collab-ui/LiveCursorOverlay.js +125 -0
- package/dist/collab-ui/LiveCursorOverlay.js.map +1 -0
- package/dist/collab-ui/PresenceBar.d.ts +30 -0
- package/dist/collab-ui/PresenceBar.d.ts.map +1 -0
- package/dist/collab-ui/PresenceBar.js +172 -0
- package/dist/collab-ui/PresenceBar.js.map +1 -0
- package/dist/collab-ui/PresenceBar.spec.d.ts +2 -0
- package/dist/collab-ui/PresenceBar.spec.d.ts.map +1 -0
- package/dist/collab-ui/PresenceBar.spec.js +30 -0
- package/dist/collab-ui/PresenceBar.spec.js.map +1 -0
- package/dist/collab-ui/RecentEditHighlights.d.ts +46 -0
- package/dist/collab-ui/RecentEditHighlights.d.ts.map +1 -0
- package/dist/collab-ui/RecentEditHighlights.js +154 -0
- package/dist/collab-ui/RecentEditHighlights.js.map +1 -0
- package/dist/collab-ui/RemoteSelectionRings.d.ts +53 -0
- package/dist/collab-ui/RemoteSelectionRings.d.ts.map +1 -0
- package/dist/collab-ui/RemoteSelectionRings.js +130 -0
- package/dist/collab-ui/RemoteSelectionRings.js.map +1 -0
- package/dist/collab-ui/agent-identity.d.ts +9 -0
- package/dist/collab-ui/agent-identity.d.ts.map +1 -0
- package/dist/collab-ui/agent-identity.js +9 -0
- package/dist/collab-ui/agent-identity.js.map +1 -0
- package/dist/collab-ui/index.d.ts +9 -0
- package/dist/collab-ui/index.d.ts.map +1 -0
- package/dist/collab-ui/index.js +9 -0
- package/dist/collab-ui/index.js.map +1 -0
- package/dist/collab-ui/lead-client.d.ts +3 -0
- package/dist/collab-ui/lead-client.d.ts.map +1 -0
- package/dist/collab-ui/lead-client.js +29 -0
- package/dist/collab-ui/lead-client.js.map +1 -0
- package/dist/collab-ui/types.d.ts +48 -0
- package/dist/collab-ui/types.d.ts.map +1 -0
- package/dist/collab-ui/types.js +52 -0
- package/dist/collab-ui/types.js.map +1 -0
- package/dist/collab-ui/types.spec.d.ts +2 -0
- package/dist/collab-ui/types.spec.d.ts.map +1 -0
- package/dist/collab-ui/types.spec.js +15 -0
- package/dist/collab-ui/types.spec.js.map +1 -0
- package/dist/composer/AgentComposerFrame.d.ts +19 -0
- package/dist/composer/AgentComposerFrame.d.ts.map +1 -0
- package/dist/composer/AgentComposerFrame.js +17 -0
- package/dist/composer/AgentComposerFrame.js.map +1 -0
- package/dist/composer/ComposerPlusMenu.d.ts +30 -0
- package/dist/composer/ComposerPlusMenu.d.ts.map +1 -0
- package/dist/composer/ComposerPlusMenu.js +635 -0
- package/dist/composer/ComposerPlusMenu.js.map +1 -0
- package/dist/composer/ComposerPlusMenu.spec.d.ts +2 -0
- package/dist/composer/ComposerPlusMenu.spec.d.ts.map +1 -0
- package/dist/composer/ComposerPlusMenu.spec.js +12 -0
- package/dist/composer/ComposerPlusMenu.spec.js.map +1 -0
- package/dist/composer/MentionPopover.d.ts +29 -0
- package/dist/composer/MentionPopover.d.ts.map +1 -0
- package/dist/composer/MentionPopover.js +221 -0
- package/dist/composer/MentionPopover.js.map +1 -0
- package/dist/composer/PastedTextChip.d.ts +9 -0
- package/dist/composer/PastedTextChip.d.ts.map +1 -0
- package/dist/composer/PastedTextChip.js +71 -0
- package/dist/composer/PastedTextChip.js.map +1 -0
- package/dist/composer/PastedTextChip.spec.d.ts +2 -0
- package/dist/composer/PastedTextChip.spec.d.ts.map +1 -0
- package/dist/composer/PastedTextChip.spec.js +42 -0
- package/dist/composer/PastedTextChip.spec.js.map +1 -0
- package/dist/composer/PromptComposer.d.ts +151 -0
- package/dist/composer/PromptComposer.d.ts.map +1 -0
- package/dist/composer/PromptComposer.js +322 -0
- package/dist/composer/PromptComposer.js.map +1 -0
- package/dist/composer/PromptComposer.spec.d.ts +2 -0
- package/dist/composer/PromptComposer.spec.d.ts.map +1 -0
- package/dist/composer/PromptComposer.spec.js +87 -0
- package/dist/composer/PromptComposer.spec.js.map +1 -0
- package/dist/composer/RealtimeVoiceMode.d.ts +108 -0
- package/dist/composer/RealtimeVoiceMode.d.ts.map +1 -0
- package/dist/composer/RealtimeVoiceMode.js +312 -0
- package/dist/composer/RealtimeVoiceMode.js.map +1 -0
- package/dist/composer/RealtimeVoiceMode.spec.d.ts +2 -0
- package/dist/composer/RealtimeVoiceMode.spec.d.ts.map +1 -0
- package/dist/composer/RealtimeVoiceMode.spec.js +540 -0
- package/dist/composer/RealtimeVoiceMode.spec.js.map +1 -0
- package/dist/composer/TiptapComposer.d.ts +288 -0
- package/dist/composer/TiptapComposer.d.ts.map +1 -0
- package/dist/composer/TiptapComposer.js +2233 -0
- package/dist/composer/TiptapComposer.js.map +1 -0
- package/dist/composer/TiptapComposer.spec.d.ts +2 -0
- package/dist/composer/TiptapComposer.spec.d.ts.map +1 -0
- package/dist/composer/TiptapComposer.spec.js +415 -0
- package/dist/composer/TiptapComposer.spec.js.map +1 -0
- package/dist/composer/VoiceButton.d.ts +27 -0
- package/dist/composer/VoiceButton.d.ts.map +1 -0
- package/dist/composer/VoiceButton.js +151 -0
- package/dist/composer/VoiceButton.js.map +1 -0
- package/dist/composer/VoiceButton.spec.d.ts +2 -0
- package/dist/composer/VoiceButton.spec.d.ts.map +1 -0
- package/dist/composer/VoiceButton.spec.js +27 -0
- package/dist/composer/VoiceButton.spec.js.map +1 -0
- package/dist/composer/asset-picker-url.d.ts +16 -0
- package/dist/composer/asset-picker-url.d.ts.map +1 -0
- package/dist/composer/asset-picker-url.js +64 -0
- package/dist/composer/asset-picker-url.js.map +1 -0
- package/dist/composer/asset-picker-url.spec.d.ts +2 -0
- package/dist/composer/asset-picker-url.spec.d.ts.map +1 -0
- package/dist/composer/asset-picker-url.spec.js +23 -0
- package/dist/composer/asset-picker-url.spec.js.map +1 -0
- package/dist/composer/attachment-accept.d.ts +9 -0
- package/dist/composer/attachment-accept.d.ts.map +1 -0
- package/dist/composer/attachment-accept.js +69 -0
- package/dist/composer/attachment-accept.js.map +1 -0
- package/dist/composer/attachment-accept.spec.d.ts +2 -0
- package/dist/composer/attachment-accept.spec.d.ts.map +1 -0
- package/dist/composer/attachment-accept.spec.js +24 -0
- package/dist/composer/attachment-accept.spec.js.map +1 -0
- package/dist/composer/draft-key.d.ts +2 -0
- package/dist/composer/draft-key.d.ts.map +1 -0
- package/dist/composer/draft-key.js +8 -0
- package/dist/composer/draft-key.js.map +1 -0
- package/dist/composer/draft-key.spec.d.ts +2 -0
- package/dist/composer/draft-key.spec.d.ts.map +1 -0
- package/dist/composer/draft-key.spec.js +13 -0
- package/dist/composer/draft-key.spec.js.map +1 -0
- package/dist/composer/extensions/FileReference.d.ts +3 -0
- package/dist/composer/extensions/FileReference.d.ts.map +1 -0
- package/dist/composer/extensions/FileReference.js +36 -0
- package/dist/composer/extensions/FileReference.js.map +1 -0
- package/dist/composer/extensions/MentionReference.d.ts +3 -0
- package/dist/composer/extensions/MentionReference.d.ts.map +1 -0
- package/dist/composer/extensions/MentionReference.js +66 -0
- package/dist/composer/extensions/MentionReference.js.map +1 -0
- package/dist/composer/extensions/SkillReference.d.ts +3 -0
- package/dist/composer/extensions/SkillReference.d.ts.map +1 -0
- package/dist/composer/extensions/SkillReference.js +40 -0
- package/dist/composer/extensions/SkillReference.js.map +1 -0
- package/dist/composer/index.d.ts +16 -0
- package/dist/composer/index.d.ts.map +1 -0
- package/dist/composer/index.js +14 -0
- package/dist/composer/index.js.map +1 -0
- package/dist/composer/model-selection.d.ts +12 -0
- package/dist/composer/model-selection.d.ts.map +1 -0
- package/dist/composer/model-selection.js +31 -0
- package/dist/composer/model-selection.js.map +1 -0
- package/dist/composer/model-selection.spec.d.ts +2 -0
- package/dist/composer/model-selection.spec.d.ts.map +1 -0
- package/dist/composer/model-selection.spec.js +38 -0
- package/dist/composer/model-selection.spec.js.map +1 -0
- package/dist/composer/pasted-text.d.ts +31 -0
- package/dist/composer/pasted-text.d.ts.map +1 -0
- package/dist/composer/pasted-text.js +130 -0
- package/dist/composer/pasted-text.js.map +1 -0
- package/dist/composer/pasted-text.spec.d.ts +2 -0
- package/dist/composer/pasted-text.spec.d.ts.map +1 -0
- package/dist/composer/pasted-text.spec.js +107 -0
- package/dist/composer/pasted-text.spec.js.map +1 -0
- package/dist/composer/prompt-attachments.d.ts +18 -0
- package/dist/composer/prompt-attachments.d.ts.map +1 -0
- package/dist/composer/prompt-attachments.js +65 -0
- package/dist/composer/prompt-attachments.js.map +1 -0
- package/dist/composer/prompt-attachments.spec.d.ts +2 -0
- package/dist/composer/prompt-attachments.spec.d.ts.map +1 -0
- package/dist/composer/prompt-attachments.spec.js +63 -0
- package/dist/composer/prompt-attachments.spec.js.map +1 -0
- package/dist/composer/realtime-voice-audio-level.d.ts +14 -0
- package/dist/composer/realtime-voice-audio-level.d.ts.map +1 -0
- package/dist/composer/realtime-voice-audio-level.js +48 -0
- package/dist/composer/realtime-voice-audio-level.js.map +1 -0
- package/dist/composer/realtime-voice-audio-level.spec.d.ts +2 -0
- package/dist/composer/realtime-voice-audio-level.spec.d.ts.map +1 -0
- package/dist/composer/realtime-voice-audio-level.spec.js +32 -0
- package/dist/composer/realtime-voice-audio-level.spec.js.map +1 -0
- package/dist/composer/realtime-voice-transcript.d.ts +26 -0
- package/dist/composer/realtime-voice-transcript.d.ts.map +1 -0
- package/dist/composer/realtime-voice-transcript.js +103 -0
- package/dist/composer/realtime-voice-transcript.js.map +1 -0
- package/dist/composer/realtime-voice-transcript.spec.d.ts +2 -0
- package/dist/composer/realtime-voice-transcript.spec.d.ts.map +1 -0
- package/dist/composer/realtime-voice-transcript.spec.js +76 -0
- package/dist/composer/realtime-voice-transcript.spec.js.map +1 -0
- package/dist/composer/runtime-adapters.d.ts +169 -0
- package/dist/composer/runtime-adapters.d.ts.map +1 -0
- package/dist/composer/runtime-adapters.js +141 -0
- package/dist/composer/runtime-adapters.js.map +1 -0
- package/dist/composer/runtime-adapters.spec.d.ts +2 -0
- package/dist/composer/runtime-adapters.spec.d.ts.map +1 -0
- package/dist/composer/runtime-adapters.spec.js +69 -0
- package/dist/composer/runtime-adapters.spec.js.map +1 -0
- package/dist/composer/types.d.ts +60 -0
- package/dist/composer/types.d.ts.map +1 -0
- package/dist/composer/types.js +2 -0
- package/dist/composer/types.js.map +1 -0
- package/dist/composer/use-file-search.d.ts +6 -0
- package/dist/composer/use-file-search.d.ts.map +1 -0
- package/dist/composer/use-file-search.js +53 -0
- package/dist/composer/use-file-search.js.map +1 -0
- package/dist/composer/use-mention-search.d.ts +6 -0
- package/dist/composer/use-mention-search.d.ts.map +1 -0
- package/dist/composer/use-mention-search.js +75 -0
- package/dist/composer/use-mention-search.js.map +1 -0
- package/dist/composer/use-skills.d.ts +7 -0
- package/dist/composer/use-skills.d.ts.map +1 -0
- package/dist/composer/use-skills.js +40 -0
- package/dist/composer/use-skills.js.map +1 -0
- package/dist/composer/useRealtimeVoiceMode.d.ts +189 -0
- package/dist/composer/useRealtimeVoiceMode.d.ts.map +1 -0
- package/dist/composer/useRealtimeVoiceMode.js +1899 -0
- package/dist/composer/useRealtimeVoiceMode.js.map +1 -0
- package/dist/composer/useRealtimeVoiceMode.spec.d.ts +2 -0
- package/dist/composer/useRealtimeVoiceMode.spec.d.ts.map +1 -0
- package/dist/composer/useRealtimeVoiceMode.spec.js +716 -0
- package/dist/composer/useRealtimeVoiceMode.spec.js.map +1 -0
- package/dist/composer/useVoiceDictation.browser.spec.d.ts +2 -0
- package/dist/composer/useVoiceDictation.browser.spec.d.ts.map +1 -0
- package/dist/composer/useVoiceDictation.browser.spec.js +220 -0
- package/dist/composer/useVoiceDictation.browser.spec.js.map +1 -0
- package/dist/composer/useVoiceDictation.d.ts +58 -0
- package/dist/composer/useVoiceDictation.d.ts.map +1 -0
- package/dist/composer/useVoiceDictation.js +1058 -0
- package/dist/composer/useVoiceDictation.js.map +1 -0
- package/dist/composer/useVoiceDictation.spec.d.ts +2 -0
- package/dist/composer/useVoiceDictation.spec.d.ts.map +1 -0
- package/dist/composer/useVoiceDictation.spec.js +32 -0
- package/dist/composer/useVoiceDictation.spec.js.map +1 -0
- package/dist/conformance/__fixtures__/css-in-js-adapter.d.ts +7 -0
- package/dist/conformance/__fixtures__/css-in-js-adapter.d.ts.map +1 -0
- package/dist/conformance/__fixtures__/css-in-js-adapter.js +84 -0
- package/dist/conformance/__fixtures__/css-in-js-adapter.js.map +1 -0
- package/dist/conformance/conformance.spec.d.ts +2 -0
- package/dist/conformance/conformance.spec.d.ts.map +1 -0
- package/dist/conformance/conformance.spec.js +87 -0
- package/dist/conformance/conformance.spec.js.map +1 -0
- package/dist/conformance/index.d.ts +4 -0
- package/dist/conformance/index.d.ts.map +1 -0
- package/dist/conformance/index.js +4 -0
- package/dist/conformance/index.js.map +1 -0
- package/dist/conformance/runner.d.ts +12 -0
- package/dist/conformance/runner.d.ts.map +1 -0
- package/dist/conformance/runner.js +515 -0
- package/dist/conformance/runner.js.map +1 -0
- package/dist/conformance/types.d.ts +26 -0
- package/dist/conformance/types.d.ts.map +1 -0
- package/dist/conformance/types.js +13 -0
- package/dist/conformance/types.js.map +1 -0
- package/dist/conformance/version.d.ts +6 -0
- package/dist/conformance/version.d.ts.map +1 -0
- package/dist/conformance/version.js +14 -0
- package/dist/conformance/version.js.map +1 -0
- package/dist/context-ui/ContextMeter.d.ts +11 -0
- package/dist/context-ui/ContextMeter.d.ts.map +1 -0
- package/dist/context-ui/ContextMeter.js +40 -0
- package/dist/context-ui/ContextMeter.js.map +1 -0
- package/dist/context-ui/ContextMeter.spec.d.ts +2 -0
- package/dist/context-ui/ContextMeter.spec.d.ts.map +1 -0
- package/dist/context-ui/ContextMeter.spec.js +52 -0
- package/dist/context-ui/ContextMeter.spec.js.map +1 -0
- package/dist/context-ui/ContextSegmentRow.d.ts +16 -0
- package/dist/context-ui/ContextSegmentRow.d.ts.map +1 -0
- package/dist/context-ui/ContextSegmentRow.js +92 -0
- package/dist/context-ui/ContextSegmentRow.js.map +1 -0
- package/dist/context-ui/ContextTreemap.d.ts +8 -0
- package/dist/context-ui/ContextTreemap.d.ts.map +1 -0
- package/dist/context-ui/ContextTreemap.js +58 -0
- package/dist/context-ui/ContextTreemap.js.map +1 -0
- package/dist/context-ui/ContextXRayPanel.d.ts +14 -0
- package/dist/context-ui/ContextXRayPanel.d.ts.map +1 -0
- package/dist/context-ui/ContextXRayPanel.js +209 -0
- package/dist/context-ui/ContextXRayPanel.js.map +1 -0
- package/dist/context-ui/format.d.ts +6 -0
- package/dist/context-ui/format.d.ts.map +1 -0
- package/dist/context-ui/format.js +58 -0
- package/dist/context-ui/format.js.map +1 -0
- package/dist/context-ui/index.d.ts +7 -0
- package/dist/context-ui/index.d.ts.map +1 -0
- package/dist/context-ui/index.js +6 -0
- package/dist/context-ui/index.js.map +1 -0
- package/dist/context-ui/types.d.ts +41 -0
- package/dist/context-ui/types.d.ts.map +1 -0
- package/dist/context-ui/types.js +8 -0
- package/dist/context-ui/types.js.map +1 -0
- package/dist/dashboard/DataTable.d.ts +20 -0
- package/dist/dashboard/DataTable.d.ts.map +1 -0
- package/dist/dashboard/DataTable.js +87 -0
- package/dist/dashboard/DataTable.js.map +1 -0
- package/dist/dashboard/DateRangePicker.d.ts +15 -0
- package/dist/dashboard/DateRangePicker.d.ts.map +1 -0
- package/dist/dashboard/DateRangePicker.js +15 -0
- package/dist/dashboard/DateRangePicker.js.map +1 -0
- package/dist/dashboard/GenericChartPanel.d.ts +57 -0
- package/dist/dashboard/GenericChartPanel.d.ts.map +1 -0
- package/dist/dashboard/GenericChartPanel.js +119 -0
- package/dist/dashboard/GenericChartPanel.js.map +1 -0
- package/dist/dashboard/GenericChartPanel.spec.d.ts +2 -0
- package/dist/dashboard/GenericChartPanel.spec.d.ts.map +1 -0
- package/dist/dashboard/GenericChartPanel.spec.js +41 -0
- package/dist/dashboard/GenericChartPanel.spec.js.map +1 -0
- package/dist/dashboard/MetricCard.d.ts +14 -0
- package/dist/dashboard/MetricCard.d.ts.map +1 -0
- package/dist/dashboard/MetricCard.js +10 -0
- package/dist/dashboard/MetricCard.js.map +1 -0
- package/dist/dashboard/StatsCard.d.ts +16 -0
- package/dist/dashboard/StatsCard.d.ts.map +1 -0
- package/dist/dashboard/StatsCard.js +8 -0
- package/dist/dashboard/StatsCard.js.map +1 -0
- package/dist/dashboard/dashboard-layout.d.ts +49 -0
- package/dist/dashboard/dashboard-layout.d.ts.map +1 -0
- package/dist/dashboard/dashboard-layout.js +231 -0
- package/dist/dashboard/dashboard-layout.js.map +1 -0
- package/dist/dashboard/dashboard-layout.spec.d.ts +2 -0
- package/dist/dashboard/dashboard-layout.spec.d.ts.map +1 -0
- package/dist/dashboard/dashboard-layout.spec.js +52 -0
- package/dist/dashboard/dashboard-layout.spec.js.map +1 -0
- package/dist/dashboard/index.d.ts +7 -0
- package/dist/dashboard/index.d.ts.map +1 -0
- package/dist/dashboard/index.js +7 -0
- package/dist/dashboard/index.js.map +1 -0
- package/dist/data-grid/DataGrid.d.ts +92 -0
- package/dist/data-grid/DataGrid.d.ts.map +1 -0
- package/dist/data-grid/DataGrid.js +315 -0
- package/dist/data-grid/DataGrid.js.map +1 -0
- package/dist/data-grid/DataGrid.spec.d.ts +2 -0
- package/dist/data-grid/DataGrid.spec.d.ts.map +1 -0
- package/dist/data-grid/DataGrid.spec.js +134 -0
- package/dist/data-grid/DataGrid.spec.js.map +1 -0
- package/dist/data-grid/index.d.ts +2 -0
- package/dist/data-grid/index.d.ts.map +1 -0
- package/dist/data-grid/index.js +2 -0
- package/dist/data-grid/index.js.map +1 -0
- package/dist/design-system/components.d.ts +58 -0
- package/dist/design-system/components.d.ts.map +1 -0
- package/dist/design-system/components.js +88 -0
- package/dist/design-system/components.js.map +1 -0
- package/dist/design-system/context.d.ts +11 -0
- package/dist/design-system/context.d.ts.map +1 -0
- package/dist/design-system/context.js +17 -0
- package/dist/design-system/context.js.map +1 -0
- package/dist/design-system/default-adapter.d.ts +3 -0
- package/dist/design-system/default-adapter.d.ts.map +1 -0
- package/dist/design-system/default-adapter.js +172 -0
- package/dist/design-system/default-adapter.js.map +1 -0
- package/dist/design-system/default-adapter.spec.d.ts +2 -0
- package/dist/design-system/default-adapter.spec.d.ts.map +1 -0
- package/dist/design-system/default-adapter.spec.js +108 -0
- package/dist/design-system/default-adapter.spec.js.map +1 -0
- package/dist/design-system/definition.d.ts +9 -0
- package/dist/design-system/definition.d.ts.map +1 -0
- package/dist/design-system/definition.js +4 -0
- package/dist/design-system/definition.js.map +1 -0
- package/dist/design-system/design-system.spec.d.ts +2 -0
- package/dist/design-system/design-system.spec.d.ts.map +1 -0
- package/dist/design-system/design-system.spec.js +208 -0
- package/dist/design-system/design-system.spec.js.map +1 -0
- package/dist/design-system/error-boundary.d.ts +18 -0
- package/dist/design-system/error-boundary.d.ts.map +1 -0
- package/dist/design-system/error-boundary.js +16 -0
- package/dist/design-system/error-boundary.js.map +1 -0
- package/dist/design-system/index.d.ts +8 -0
- package/dist/design-system/index.d.ts.map +1 -0
- package/dist/design-system/index.js +8 -0
- package/dist/design-system/index.js.map +1 -0
- package/dist/design-system/theme.d.ts +30 -0
- package/dist/design-system/theme.d.ts.map +1 -0
- package/dist/design-system/theme.js +95 -0
- package/dist/design-system/theme.js.map +1 -0
- package/dist/design-system/theme.spec.d.ts +2 -0
- package/dist/design-system/theme.spec.d.ts.map +1 -0
- package/dist/design-system/theme.spec.js +43 -0
- package/dist/design-system/theme.spec.js.map +1 -0
- package/dist/design-system/types.d.ts +292 -0
- package/dist/design-system/types.d.ts.map +1 -0
- package/dist/design-system/types.js +2 -0
- package/dist/design-system/types.js.map +1 -0
- package/dist/design-tweaks/index.d.ts +2 -0
- package/dist/design-tweaks/index.d.ts.map +1 -0
- package/dist/design-tweaks/index.js +2 -0
- package/dist/design-tweaks/index.js.map +1 -0
- package/dist/design-tweaks/scrub-input-utils.d.ts +61 -0
- package/dist/design-tweaks/scrub-input-utils.d.ts.map +1 -0
- package/dist/design-tweaks/scrub-input-utils.js +235 -0
- package/dist/design-tweaks/scrub-input-utils.js.map +1 -0
- package/dist/design-tweaks/scrub-input.d.ts +70 -0
- package/dist/design-tweaks/scrub-input.d.ts.map +1 -0
- package/dist/design-tweaks/scrub-input.js +319 -0
- package/dist/design-tweaks/scrub-input.js.map +1 -0
- package/dist/design-tweaks/visual-style-controls.d.ts +90 -0
- package/dist/design-tweaks/visual-style-controls.d.ts.map +1 -0
- package/dist/design-tweaks/visual-style-controls.js +423 -0
- package/dist/design-tweaks/visual-style-controls.js.map +1 -0
- package/dist/design-tweaks/visual-style-controls.spec.d.ts +2 -0
- package/dist/design-tweaks/visual-style-controls.spec.d.ts.map +1 -0
- package/dist/design-tweaks/visual-style-controls.spec.js +84 -0
- package/dist/design-tweaks/visual-style-controls.spec.js.map +1 -0
- package/dist/editor/BubbleToolbar.d.ts +37 -0
- package/dist/editor/BubbleToolbar.d.ts.map +1 -0
- package/dist/editor/BubbleToolbar.js +171 -0
- package/dist/editor/BubbleToolbar.js.map +1 -0
- package/dist/editor/CodeBlockNode.d.ts +49 -0
- package/dist/editor/CodeBlockNode.d.ts.map +1 -0
- package/dist/editor/CodeBlockNode.js +127 -0
- package/dist/editor/CodeBlockNode.js.map +1 -0
- package/dist/editor/DragHandle.d.ts +103 -0
- package/dist/editor/DragHandle.d.ts.map +1 -0
- package/dist/editor/DragHandle.js +1101 -0
- package/dist/editor/DragHandle.js.map +1 -0
- package/dist/editor/DragHandle.spec.d.ts +2 -0
- package/dist/editor/DragHandle.spec.d.ts.map +1 -0
- package/dist/editor/DragHandle.spec.js +495 -0
- package/dist/editor/DragHandle.spec.js.map +1 -0
- package/dist/editor/ImageExtension.d.ts +63 -0
- package/dist/editor/ImageExtension.d.ts.map +1 -0
- package/dist/editor/ImageExtension.js +243 -0
- package/dist/editor/ImageExtension.js.map +1 -0
- package/dist/editor/ImageExtension.roundtrip.spec.d.ts +2 -0
- package/dist/editor/ImageExtension.roundtrip.spec.d.ts.map +1 -0
- package/dist/editor/ImageExtension.roundtrip.spec.js +103 -0
- package/dist/editor/ImageExtension.roundtrip.spec.js.map +1 -0
- package/dist/editor/RegistryBlockContext.d.ts +68 -0
- package/dist/editor/RegistryBlockContext.d.ts.map +1 -0
- package/dist/editor/RegistryBlockContext.js +10 -0
- package/dist/editor/RegistryBlockContext.js.map +1 -0
- package/dist/editor/RegistryBlockNode.d.ts +66 -0
- package/dist/editor/RegistryBlockNode.d.ts.map +1 -0
- package/dist/editor/RegistryBlockNode.js +406 -0
- package/dist/editor/RegistryBlockNode.js.map +1 -0
- package/dist/editor/RegistryBlockNode.spec.d.ts +2 -0
- package/dist/editor/RegistryBlockNode.spec.d.ts.map +1 -0
- package/dist/editor/RegistryBlockNode.spec.js +215 -0
- package/dist/editor/RegistryBlockNode.spec.js.map +1 -0
- package/dist/editor/RichMarkdownEditor.collab.spec.d.ts +2 -0
- package/dist/editor/RichMarkdownEditor.collab.spec.d.ts.map +1 -0
- package/dist/editor/RichMarkdownEditor.collab.spec.js +65 -0
- package/dist/editor/RichMarkdownEditor.collab.spec.js.map +1 -0
- package/dist/editor/RichMarkdownEditor.d.ts +52 -0
- package/dist/editor/RichMarkdownEditor.d.ts.map +1 -0
- package/dist/editor/RichMarkdownEditor.js +38 -0
- package/dist/editor/RichMarkdownEditor.js.map +1 -0
- package/dist/editor/RichMarkdownEditor.roundtrip.spec.d.ts +2 -0
- package/dist/editor/RichMarkdownEditor.roundtrip.spec.d.ts.map +1 -0
- package/dist/editor/RichMarkdownEditor.roundtrip.spec.js +186 -0
- package/dist/editor/RichMarkdownEditor.roundtrip.spec.js.map +1 -0
- package/dist/editor/RunId.d.ts +28 -0
- package/dist/editor/RunId.d.ts.map +1 -0
- package/dist/editor/RunId.js +60 -0
- package/dist/editor/RunId.js.map +1 -0
- package/dist/editor/SharedRichEditor.d.ts +112 -0
- package/dist/editor/SharedRichEditor.d.ts.map +1 -0
- package/dist/editor/SharedRichEditor.js +159 -0
- package/dist/editor/SharedRichEditor.js.map +1 -0
- package/dist/editor/SharedRichEditor.spec.d.ts +2 -0
- package/dist/editor/SharedRichEditor.spec.d.ts.map +1 -0
- package/dist/editor/SharedRichEditor.spec.js +63 -0
- package/dist/editor/SharedRichEditor.spec.js.map +1 -0
- package/dist/editor/SlashCommandMenu.d.ts +59 -0
- package/dist/editor/SlashCommandMenu.d.ts.map +1 -0
- package/dist/editor/SlashCommandMenu.js +279 -0
- package/dist/editor/SlashCommandMenu.js.map +1 -0
- package/dist/editor/SlashCommandMenu.spec.d.ts +2 -0
- package/dist/editor/SlashCommandMenu.spec.d.ts.map +1 -0
- package/dist/editor/SlashCommandMenu.spec.js +67 -0
- package/dist/editor/SlashCommandMenu.spec.js.map +1 -0
- package/dist/editor/disableHistory.spec.d.ts +2 -0
- package/dist/editor/disableHistory.spec.d.ts.map +1 -0
- package/dist/editor/disableHistory.spec.js +73 -0
- package/dist/editor/disableHistory.spec.js.map +1 -0
- package/dist/editor/extensions.d.ts +178 -0
- package/dist/editor/extensions.d.ts.map +1 -0
- package/dist/editor/extensions.js +264 -0
- package/dist/editor/extensions.js.map +1 -0
- package/dist/editor/gfmDoc.d.ts +24 -0
- package/dist/editor/gfmDoc.d.ts.map +1 -0
- package/dist/editor/gfmDoc.js +83 -0
- package/dist/editor/gfmDoc.js.map +1 -0
- package/dist/editor/gfmDoc.spec.d.ts +2 -0
- package/dist/editor/gfmDoc.spec.d.ts.map +1 -0
- package/dist/editor/gfmDoc.spec.js +194 -0
- package/dist/editor/gfmDoc.spec.js.map +1 -0
- package/dist/editor/index.d.ts +16 -0
- package/dist/editor/index.d.ts.map +1 -0
- package/dist/editor/index.js +15 -0
- package/dist/editor/index.js.map +1 -0
- package/dist/editor/registrySlashCommands.d.ts +68 -0
- package/dist/editor/registrySlashCommands.d.ts.map +1 -0
- package/dist/editor/registrySlashCommands.js +51 -0
- package/dist/editor/registrySlashCommands.js.map +1 -0
- package/dist/editor/structuralReorderUndo.spec.d.ts +2 -0
- package/dist/editor/structuralReorderUndo.spec.d.ts.map +1 -0
- package/dist/editor/structuralReorderUndo.spec.js +120 -0
- package/dist/editor/structuralReorderUndo.spec.js.map +1 -0
- package/dist/editor/surgical-apply.d.ts +66 -0
- package/dist/editor/surgical-apply.d.ts.map +1 -0
- package/dist/editor/surgical-apply.js +147 -0
- package/dist/editor/surgical-apply.js.map +1 -0
- package/dist/editor/surgical-apply.spec.d.ts +2 -0
- package/dist/editor/surgical-apply.spec.d.ts.map +1 -0
- package/dist/editor/surgical-apply.spec.js +257 -0
- package/dist/editor/surgical-apply.spec.js.map +1 -0
- package/dist/editor/useCollabReconcile.concurrent.spec.d.ts +2 -0
- package/dist/editor/useCollabReconcile.concurrent.spec.d.ts.map +1 -0
- package/dist/editor/useCollabReconcile.concurrent.spec.js +641 -0
- package/dist/editor/useCollabReconcile.concurrent.spec.js.map +1 -0
- package/dist/editor/useCollabReconcile.d.ts +117 -0
- package/dist/editor/useCollabReconcile.d.ts.map +1 -0
- package/dist/editor/useCollabReconcile.idempotent.spec.d.ts +2 -0
- package/dist/editor/useCollabReconcile.idempotent.spec.d.ts.map +1 -0
- package/dist/editor/useCollabReconcile.idempotent.spec.js +248 -0
- package/dist/editor/useCollabReconcile.idempotent.spec.js.map +1 -0
- package/dist/editor/useCollabReconcile.js +521 -0
- package/dist/editor/useCollabReconcile.js.map +1 -0
- package/dist/editor.css +587 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +3 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +16 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/hooks/use-toast.d.ts +45 -0
- package/dist/hooks/use-toast.d.ts.map +1 -0
- package/dist/hooks/use-toast.js +127 -0
- package/dist/hooks/use-toast.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/onboarding/index.d.ts +2 -0
- package/dist/onboarding/index.d.ts.map +1 -0
- package/dist/onboarding/index.js +2 -0
- package/dist/onboarding/index.js.map +1 -0
- package/dist/provider.d.ts +15 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +60 -0
- package/dist/provider.js.map +1 -0
- package/dist/sharing/SharePrimitives.d.ts +42 -0
- package/dist/sharing/SharePrimitives.d.ts.map +1 -0
- package/dist/sharing/SharePrimitives.js +53 -0
- package/dist/sharing/SharePrimitives.js.map +1 -0
- package/dist/sharing/VisibilityBadge.d.ts +11 -0
- package/dist/sharing/VisibilityBadge.d.ts.map +1 -0
- package/dist/sharing/VisibilityBadge.js +19 -0
- package/dist/sharing/VisibilityBadge.js.map +1 -0
- package/dist/sharing/VisibilityBadge.spec.d.ts +2 -0
- package/dist/sharing/VisibilityBadge.spec.d.ts.map +1 -0
- package/dist/sharing/VisibilityBadge.spec.js +60 -0
- package/dist/sharing/VisibilityBadge.spec.js.map +1 -0
- package/dist/sharing/index.d.ts +3 -0
- package/dist/sharing/index.d.ts.map +1 -0
- package/dist/sharing/index.js +3 -0
- package/dist/sharing/index.js.map +1 -0
- package/dist/styles.css +232 -0
- package/dist/ui/accordion.d.ts +8 -0
- package/dist/ui/accordion.d.ts.map +1 -0
- package/dist/ui/accordion.js +14 -0
- package/dist/ui/accordion.js.map +1 -0
- package/dist/ui/alert-dialog.d.ts +21 -0
- package/dist/ui/alert-dialog.d.ts.map +1 -0
- package/dist/ui/alert-dialog.js +27 -0
- package/dist/ui/alert-dialog.js.map +1 -0
- package/dist/ui/alert.d.ts +9 -0
- package/dist/ui/alert.d.ts.map +1 -0
- package/dist/ui/alert.js +23 -0
- package/dist/ui/alert.js.map +1 -0
- package/dist/ui/aspect-ratio.d.ts +4 -0
- package/dist/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/ui/aspect-ratio.js +4 -0
- package/dist/ui/aspect-ratio.js.map +1 -0
- package/dist/ui/avatar.d.ts +7 -0
- package/dist/ui/avatar.d.ts.map +1 -0
- package/dist/ui/avatar.js +12 -0
- package/dist/ui/avatar.js.map +1 -0
- package/dist/ui/badge.d.ts +10 -0
- package/dist/ui/badge.d.ts.map +1 -0
- package/dist/ui/badge.js +21 -0
- package/dist/ui/badge.js.map +1 -0
- package/dist/ui/breadcrumb.d.ts +20 -0
- package/dist/ui/breadcrumb.d.ts.map +1 -0
- package/dist/ui/breadcrumb.js +24 -0
- package/dist/ui/breadcrumb.js.map +1 -0
- package/dist/ui/button.d.ts +18 -0
- package/dist/ui/button.d.ts.map +1 -0
- package/dist/ui/button.js +67 -0
- package/dist/ui/button.js.map +1 -0
- package/dist/ui/calendar.d.ts +9 -0
- package/dist/ui/calendar.d.ts.map +1 -0
- package/dist/ui/calendar.js +74 -0
- package/dist/ui/calendar.js.map +1 -0
- package/dist/ui/card.d.ts +9 -0
- package/dist/ui/card.d.ts.map +1 -0
- package/dist/ui/card.js +17 -0
- package/dist/ui/card.js.map +1 -0
- package/dist/ui/carousel.d.ts +19 -0
- package/dist/ui/carousel.d.ts.map +1 -0
- package/dist/ui/carousel.js +99 -0
- package/dist/ui/carousel.js.map +1 -0
- package/dist/ui/chart.d.ts +80 -0
- package/dist/ui/chart.d.ts.map +1 -0
- package/dist/ui/chart.js +131 -0
- package/dist/ui/chart.js.map +1 -0
- package/dist/ui/checkbox.d.ts +5 -0
- package/dist/ui/checkbox.d.ts.map +1 -0
- package/dist/ui/checkbox.js +9 -0
- package/dist/ui/checkbox.js.map +1 -0
- package/dist/ui/collapsible.d.ts +6 -0
- package/dist/ui/collapsible.d.ts.map +1 -0
- package/dist/ui/collapsible.js +6 -0
- package/dist/ui/collapsible.js.map +1 -0
- package/dist/ui/command.d.ts +85 -0
- package/dist/ui/command.d.ts.map +1 -0
- package/dist/ui/command.js +29 -0
- package/dist/ui/command.js.map +1 -0
- package/dist/ui/command.spec.d.ts +2 -0
- package/dist/ui/command.spec.d.ts.map +1 -0
- package/dist/ui/command.spec.js +29 -0
- package/dist/ui/command.spec.js.map +1 -0
- package/dist/ui/context-menu.d.ts +28 -0
- package/dist/ui/context-menu.d.ts.map +1 -0
- package/dist/ui/context-menu.js +34 -0
- package/dist/ui/context-menu.js.map +1 -0
- package/dist/ui/date-picker.d.ts +10 -0
- package/dist/ui/date-picker.d.ts.map +1 -0
- package/dist/ui/date-picker.js +20 -0
- package/dist/ui/date-picker.js.map +1 -0
- package/dist/ui/dialog.d.ts +32 -0
- package/dist/ui/dialog.d.ts.map +1 -0
- package/dist/ui/dialog.js +26 -0
- package/dist/ui/dialog.js.map +1 -0
- package/dist/ui/dialog.spec.d.ts +2 -0
- package/dist/ui/dialog.spec.d.ts.map +1 -0
- package/dist/ui/dialog.spec.js +21 -0
- package/dist/ui/dialog.spec.js.map +1 -0
- package/dist/ui/drawer.d.ts +35 -0
- package/dist/ui/drawer.d.ts.map +1 -0
- package/dist/ui/drawer.js +25 -0
- package/dist/ui/drawer.js.map +1 -0
- package/dist/ui/dropdown-menu.d.ts +32 -0
- package/dist/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/ui/dropdown-menu.js +42 -0
- package/dist/ui/dropdown-menu.js.map +1 -0
- package/dist/ui/form.d.ts +26 -0
- package/dist/ui/form.d.ts.map +1 -0
- package/dist/ui/form.js +63 -0
- package/dist/ui/form.js.map +1 -0
- package/dist/ui/hover-card.d.ts +7 -0
- package/dist/ui/hover-card.d.ts.map +1 -0
- package/dist/ui/hover-card.js +10 -0
- package/dist/ui/hover-card.js.map +1 -0
- package/dist/ui/index.d.ts +53 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +53 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/input-otp.d.ts +35 -0
- package/dist/ui/input-otp.d.ts.map +1 -0
- package/dist/ui/input-otp.js +19 -0
- package/dist/ui/input-otp.js.map +1 -0
- package/dist/ui/input.d.ts +4 -0
- package/dist/ui/input.d.ts.map +1 -0
- package/dist/ui/input.js +9 -0
- package/dist/ui/input.js.map +1 -0
- package/dist/ui/label.d.ts +6 -0
- package/dist/ui/label.d.ts.map +1 -0
- package/dist/ui/label.js +10 -0
- package/dist/ui/label.js.map +1 -0
- package/dist/ui/logo.d.ts +7 -0
- package/dist/ui/logo.d.ts.map +1 -0
- package/dist/ui/logo.js +10 -0
- package/dist/ui/logo.js.map +1 -0
- package/dist/ui/menubar.d.ts +29 -0
- package/dist/ui/menubar.d.ts.map +1 -0
- package/dist/ui/menubar.js +36 -0
- package/dist/ui/menubar.js.map +1 -0
- package/dist/ui/navigation-menu.d.ts +13 -0
- package/dist/ui/navigation-menu.d.ts.map +1 -0
- package/dist/ui/navigation-menu.js +25 -0
- package/dist/ui/navigation-menu.js.map +1 -0
- package/dist/ui/pagination.d.ts +29 -0
- package/dist/ui/pagination.d.ts.map +1 -0
- package/dist/ui/pagination.js +24 -0
- package/dist/ui/pagination.js.map +1 -0
- package/dist/ui/popover.d.ts +11 -0
- package/dist/ui/popover.d.ts.map +1 -0
- package/dist/ui/popover.js +16 -0
- package/dist/ui/popover.js.map +1 -0
- package/dist/ui/progress.d.ts +5 -0
- package/dist/ui/progress.d.ts.map +1 -0
- package/dist/ui/progress.js +8 -0
- package/dist/ui/progress.js.map +1 -0
- package/dist/ui/radio-group.d.ts +6 -0
- package/dist/ui/radio-group.d.ts.map +1 -0
- package/dist/ui/radio-group.js +15 -0
- package/dist/ui/radio-group.js.map +1 -0
- package/dist/ui/resizable.d.ts +8 -0
- package/dist/ui/resizable.d.ts.map +1 -0
- package/dist/ui/resizable.js +9 -0
- package/dist/ui/resizable.js.map +1 -0
- package/dist/ui/scroll-area.d.ts +6 -0
- package/dist/ui/scroll-area.d.ts.map +1 -0
- package/dist/ui/scroll-area.js +12 -0
- package/dist/ui/scroll-area.js.map +1 -0
- package/dist/ui/select.d.ts +16 -0
- package/dist/ui/select.d.ts.map +1 -0
- package/dist/ui/select.js +27 -0
- package/dist/ui/select.js.map +1 -0
- package/dist/ui/separator.d.ts +5 -0
- package/dist/ui/separator.d.ts.map +1 -0
- package/dist/ui/separator.js +8 -0
- package/dist/ui/separator.js.map +1 -0
- package/dist/ui/sheet.d.ts +29 -0
- package/dist/ui/sheet.d.ts.map +1 -0
- package/dist/ui/sheet.js +37 -0
- package/dist/ui/sheet.js.map +1 -0
- package/dist/ui/sidebar.d.ts +71 -0
- package/dist/ui/sidebar.d.ts.map +1 -0
- package/dist/ui/sidebar.js +230 -0
- package/dist/ui/sidebar.js.map +1 -0
- package/dist/ui/skeleton.d.ts +3 -0
- package/dist/ui/skeleton.d.ts.map +1 -0
- package/dist/ui/skeleton.js +7 -0
- package/dist/ui/skeleton.js.map +1 -0
- package/dist/ui/slider.d.ts +5 -0
- package/dist/ui/slider.d.ts.map +1 -0
- package/dist/ui/slider.js +8 -0
- package/dist/ui/slider.js.map +1 -0
- package/dist/ui/sonner.d.ts +5 -0
- package/dist/ui/sonner.d.ts.map +1 -0
- package/dist/ui/sonner.js +25 -0
- package/dist/ui/sonner.js.map +1 -0
- package/dist/ui/spinner.d.ts +3 -0
- package/dist/ui/spinner.d.ts.map +1 -0
- package/dist/ui/spinner.js +7 -0
- package/dist/ui/spinner.js.map +1 -0
- package/dist/ui/switch.d.ts +5 -0
- package/dist/ui/switch.d.ts.map +1 -0
- package/dist/ui/switch.js +8 -0
- package/dist/ui/switch.js.map +1 -0
- package/dist/ui/table.d.ts +11 -0
- package/dist/ui/table.d.ts.map +1 -0
- package/dist/ui/table.js +21 -0
- package/dist/ui/table.js.map +1 -0
- package/dist/ui/tabs.d.ts +8 -0
- package/dist/ui/tabs.d.ts.map +1 -0
- package/dist/ui/tabs.js +13 -0
- package/dist/ui/tabs.js.map +1 -0
- package/dist/ui/textarea.d.ts +6 -0
- package/dist/ui/textarea.d.ts.map +1 -0
- package/dist/ui/textarea.js +9 -0
- package/dist/ui/textarea.js.map +1 -0
- package/dist/ui/toast.d.ts +16 -0
- package/dist/ui/toast.d.ts.map +1 -0
- package/dist/ui/toast.js +34 -0
- package/dist/ui/toast.js.map +1 -0
- package/dist/ui/toaster.d.ts +2 -0
- package/dist/ui/toaster.d.ts.map +1 -0
- package/dist/ui/toaster.js +10 -0
- package/dist/ui/toaster.js.map +1 -0
- package/dist/ui/toggle-group.d.ts +13 -0
- package/dist/ui/toggle-group.d.ts.map +1 -0
- package/dist/ui/toggle-group.js +21 -0
- package/dist/ui/toggle-group.js.map +1 -0
- package/dist/ui/toggle.d.ts +13 -0
- package/dist/ui/toggle.d.ts.map +1 -0
- package/dist/ui/toggle.js +26 -0
- package/dist/ui/toggle.js.map +1 -0
- package/dist/ui/tooltip.d.ts +11 -0
- package/dist/ui/tooltip.d.ts.map +1 -0
- package/dist/ui/tooltip.js +18 -0
- package/dist/ui/tooltip.js.map +1 -0
- package/dist/ui/use-toast.d.ts +3 -0
- package/dist/ui/use-toast.d.ts.map +1 -0
- package/dist/ui/use-toast.js +3 -0
- package/dist/ui/use-toast.js.map +1 -0
- package/dist/utils.d.ts +4 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +7 -0
- package/dist/utils.js.map +1 -0
- package/migration-manifest.json +4 -0
- package/package.json +369 -0
- package/src/app-shell/header-actions.tsx +84 -0
- package/src/app-shell/index.ts +2 -0
- package/src/app-shell/sidebar-footer-actions.spec.tsx +81 -0
- package/src/app-shell/sidebar-footer-actions.tsx +45 -0
- package/src/canvas-annotations/CanvasCommentPins.tsx +861 -0
- package/src/canvas-annotations/DrawOverlay.spec.tsx +145 -0
- package/src/canvas-annotations/DrawOverlay.tsx +1233 -0
- package/src/canvas-annotations/index.ts +15 -0
- package/src/canvas-annotations/types.ts +14 -0
- package/src/canvas-interactions/canvas-interactions.spec.ts +765 -0
- package/src/canvas-interactions/canvas-interactions.ts +965 -0
- package/src/canvas-interactions/index.ts +67 -0
- package/src/chat-history/ChatHistoryList.spec.tsx +485 -0
- package/src/chat-history/ChatHistoryList.tsx +481 -0
- package/src/chat-history/ChatHistoryRail.spec.tsx +312 -0
- package/src/chat-history/ChatHistoryRail.tsx +150 -0
- package/src/chat-history/index.ts +21 -0
- package/src/chat-history/useChatHistoryRailController.spec.tsx +131 -0
- package/src/chat-history/useChatHistoryRailController.ts +76 -0
- package/src/chat-history.css +469 -0
- package/src/collab-ui/AgentPresenceChip.tsx +69 -0
- package/src/collab-ui/LiveCursorOverlay.tsx +241 -0
- package/src/collab-ui/PresenceBar.spec.tsx +44 -0
- package/src/collab-ui/PresenceBar.tsx +373 -0
- package/src/collab-ui/RecentEditHighlights.tsx +239 -0
- package/src/collab-ui/RemoteSelectionRings.tsx +227 -0
- package/src/collab-ui/agent-identity.ts +16 -0
- package/src/collab-ui/index.ts +39 -0
- package/src/collab-ui/lead-client.ts +32 -0
- package/src/collab-ui/types.spec.ts +18 -0
- package/src/collab-ui/types.ts +96 -0
- package/src/composer/AgentComposerFrame.tsx +62 -0
- package/src/composer/ComposerPlusMenu.spec.ts +14 -0
- package/src/composer/ComposerPlusMenu.tsx +1266 -0
- package/src/composer/MentionPopover.tsx +483 -0
- package/src/composer/PastedTextChip.spec.tsx +58 -0
- package/src/composer/PastedTextChip.tsx +178 -0
- package/src/composer/PromptComposer.spec.ts +110 -0
- package/src/composer/PromptComposer.tsx +796 -0
- package/src/composer/RealtimeVoiceMode.spec.tsx +998 -0
- package/src/composer/RealtimeVoiceMode.tsx +1019 -0
- package/src/composer/TiptapComposer.spec.ts +592 -0
- package/src/composer/TiptapComposer.tsx +3746 -0
- package/src/composer/VoiceButton.spec.ts +49 -0
- package/src/composer/VoiceButton.tsx +329 -0
- package/src/composer/asset-picker-url.spec.ts +56 -0
- package/src/composer/asset-picker-url.ts +80 -0
- package/src/composer/attachment-accept.spec.ts +32 -0
- package/src/composer/attachment-accept.ts +75 -0
- package/src/composer/draft-key.spec.ts +19 -0
- package/src/composer/draft-key.ts +7 -0
- package/src/composer/extensions/FileReference.tsx +55 -0
- package/src/composer/extensions/MentionReference.tsx +93 -0
- package/src/composer/extensions/SkillReference.tsx +56 -0
- package/src/composer/index.ts +86 -0
- package/src/composer/model-selection.spec.ts +45 -0
- package/src/composer/model-selection.ts +51 -0
- package/src/composer/pasted-text.spec.ts +162 -0
- package/src/composer/pasted-text.ts +160 -0
- package/src/composer/prompt-attachments.spec.ts +80 -0
- package/src/composer/prompt-attachments.ts +93 -0
- package/src/composer/realtime-voice-audio-level.spec.ts +47 -0
- package/src/composer/realtime-voice-audio-level.ts +65 -0
- package/src/composer/realtime-voice-transcript.spec.ts +95 -0
- package/src/composer/realtime-voice-transcript.ts +134 -0
- package/src/composer/runtime-adapters.spec.tsx +102 -0
- package/src/composer/runtime-adapters.tsx +364 -0
- package/src/composer/types.ts +66 -0
- package/src/composer/use-file-search.ts +64 -0
- package/src/composer/use-mention-search.ts +90 -0
- package/src/composer/use-skills.ts +45 -0
- package/src/composer/useRealtimeVoiceMode.spec.ts +952 -0
- package/src/composer/useRealtimeVoiceMode.tsx +2388 -0
- package/src/composer/useVoiceDictation.browser.spec.tsx +265 -0
- package/src/composer/useVoiceDictation.spec.ts +45 -0
- package/src/composer/useVoiceDictation.ts +1256 -0
- package/src/conformance/__fixtures__/css-in-js-adapter.tsx +401 -0
- package/src/conformance/conformance.spec.tsx +143 -0
- package/src/conformance/index.ts +3 -0
- package/src/conformance/runner.tsx +862 -0
- package/src/conformance/types.ts +45 -0
- package/src/conformance/version.ts +22 -0
- package/src/context-ui/ContextMeter.spec.tsx +73 -0
- package/src/context-ui/ContextMeter.tsx +131 -0
- package/src/context-ui/ContextSegmentRow.tsx +273 -0
- package/src/context-ui/ContextTreemap.tsx +131 -0
- package/src/context-ui/ContextXRayPanel.tsx +491 -0
- package/src/context-ui/format.ts +42 -0
- package/src/context-ui/index.ts +15 -0
- package/src/context-ui/types.ts +57 -0
- package/src/dashboard/DataTable.tsx +273 -0
- package/src/dashboard/DateRangePicker.tsx +57 -0
- package/src/dashboard/GenericChartPanel.spec.tsx +53 -0
- package/src/dashboard/GenericChartPanel.tsx +461 -0
- package/src/dashboard/MetricCard.tsx +54 -0
- package/src/dashboard/StatsCard.tsx +49 -0
- package/src/dashboard/dashboard-layout.spec.ts +79 -0
- package/src/dashboard/dashboard-layout.ts +329 -0
- package/src/dashboard/index.ts +6 -0
- package/src/data-grid/DataGrid.spec.tsx +243 -0
- package/src/data-grid/DataGrid.tsx +754 -0
- package/src/data-grid/index.ts +15 -0
- package/src/design-system/components.tsx +196 -0
- package/src/design-system/context.tsx +31 -0
- package/src/design-system/default-adapter.spec.tsx +158 -0
- package/src/design-system/default-adapter.tsx +923 -0
- package/src/design-system/definition.ts +14 -0
- package/src/design-system/design-system.spec.tsx +356 -0
- package/src/design-system/error-boundary.tsx +37 -0
- package/src/design-system/index.ts +7 -0
- package/src/design-system/theme.spec.ts +61 -0
- package/src/design-system/theme.ts +145 -0
- package/src/design-system/types.ts +367 -0
- package/src/design-tweaks/index.ts +1 -0
- package/src/design-tweaks/scrub-input-utils.ts +311 -0
- package/src/design-tweaks/scrub-input.tsx +525 -0
- package/src/design-tweaks/visual-style-controls.spec.tsx +172 -0
- package/src/design-tweaks/visual-style-controls.tsx +1043 -0
- package/src/editor/BubbleToolbar.tsx +253 -0
- package/src/editor/CodeBlockNode.tsx +254 -0
- package/src/editor/DragHandle.spec.ts +694 -0
- package/src/editor/DragHandle.ts +1491 -0
- package/src/editor/ImageExtension.roundtrip.spec.ts +117 -0
- package/src/editor/ImageExtension.ts +306 -0
- package/src/editor/RegistryBlockContext.tsx +107 -0
- package/src/editor/RegistryBlockNode.spec.ts +279 -0
- package/src/editor/RegistryBlockNode.tsx +652 -0
- package/src/editor/RichMarkdownEditor.collab.spec.ts +79 -0
- package/src/editor/RichMarkdownEditor.roundtrip.spec.ts +226 -0
- package/src/editor/RichMarkdownEditor.tsx +81 -0
- package/src/editor/RunId.ts +61 -0
- package/src/editor/SharedRichEditor.spec.tsx +82 -0
- package/src/editor/SharedRichEditor.tsx +353 -0
- package/src/editor/SlashCommandMenu.spec.ts +90 -0
- package/src/editor/SlashCommandMenu.tsx +396 -0
- package/src/editor/disableHistory.spec.ts +85 -0
- package/src/editor/extensions.ts +454 -0
- package/src/editor/gfmDoc.spec.ts +230 -0
- package/src/editor/gfmDoc.ts +92 -0
- package/src/editor/index.ts +96 -0
- package/src/editor/registrySlashCommands.ts +131 -0
- package/src/editor/structuralReorderUndo.spec.ts +144 -0
- package/src/editor/surgical-apply.spec.ts +279 -0
- package/src/editor/surgical-apply.ts +192 -0
- package/src/editor/useCollabReconcile.concurrent.spec.ts +781 -0
- package/src/editor/useCollabReconcile.idempotent.spec.ts +324 -0
- package/src/editor/useCollabReconcile.ts +684 -0
- package/src/editor.css +587 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/use-mobile.tsx +21 -0
- package/src/hooks/use-toast.ts +188 -0
- package/src/index.ts +10 -0
- package/src/onboarding/index.ts +1 -0
- package/src/provider.tsx +148 -0
- package/src/sharing/SharePrimitives.tsx +224 -0
- package/src/sharing/VisibilityBadge.spec.ts +96 -0
- package/src/sharing/VisibilityBadge.tsx +37 -0
- package/src/sharing/index.ts +16 -0
- package/src/styles.css +232 -0
- package/src/ui/accordion.tsx +56 -0
- package/src/ui/alert-dialog.tsx +141 -0
- package/src/ui/alert.tsx +59 -0
- package/src/ui/aspect-ratio.tsx +5 -0
- package/src/ui/avatar.tsx +48 -0
- package/src/ui/badge.tsx +37 -0
- package/src/ui/breadcrumb.tsx +115 -0
- package/src/ui/button.tsx +167 -0
- package/src/ui/calendar.tsx +214 -0
- package/src/ui/card.tsx +86 -0
- package/src/ui/carousel.tsx +260 -0
- package/src/ui/chart.tsx +375 -0
- package/src/ui/checkbox.tsx +28 -0
- package/src/ui/collapsible.tsx +9 -0
- package/src/ui/command.spec.tsx +51 -0
- package/src/ui/command.tsx +174 -0
- package/src/ui/context-menu.tsx +202 -0
- package/src/ui/date-picker.tsx +67 -0
- package/src/ui/dialog.spec.tsx +43 -0
- package/src/ui/dialog.tsx +171 -0
- package/src/ui/drawer.tsx +126 -0
- package/src/ui/dropdown-menu.tsx +222 -0
- package/src/ui/form.tsx +177 -0
- package/src/ui/hover-card.tsx +27 -0
- package/src/ui/index.ts +52 -0
- package/src/ui/input-otp.tsx +69 -0
- package/src/ui/input.tsx +22 -0
- package/src/ui/label.tsx +24 -0
- package/src/ui/logo.tsx +36 -0
- package/src/ui/menubar.tsx +235 -0
- package/src/ui/navigation-menu.tsx +128 -0
- package/src/ui/pagination.tsx +121 -0
- package/src/ui/popover.tsx +58 -0
- package/src/ui/progress.tsx +27 -0
- package/src/ui/radio-group.tsx +42 -0
- package/src/ui/resizable.tsx +43 -0
- package/src/ui/scroll-area.tsx +46 -0
- package/src/ui/select.tsx +162 -0
- package/src/ui/separator.tsx +29 -0
- package/src/ui/sheet.tsx +160 -0
- package/src/ui/sidebar.tsx +776 -0
- package/src/ui/skeleton.tsx +18 -0
- package/src/ui/slider.tsx +26 -0
- package/src/ui/sonner.tsx +58 -0
- package/src/ui/spinner.tsx +17 -0
- package/src/ui/switch.tsx +27 -0
- package/src/ui/table.tsx +110 -0
- package/src/ui/tabs.tsx +53 -0
- package/src/ui/textarea.tsx +23 -0
- package/src/ui/toast.tsx +127 -0
- package/src/ui/toaster.tsx +33 -0
- package/src/ui/toggle-group.tsx +59 -0
- package/src/ui/toggle.tsx +43 -0
- package/src/ui/tooltip.tsx +57 -0
- package/src/ui/use-toast.ts +3 -0
- package/src/utils.ts +8 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
// Page-sized pastes turn into a `Pasted text` attachment chip instead of being
|
|
2
|
+
// dumped into the editor. Short paragraphs and everyday lists should stay
|
|
3
|
+
// inline so the composer still feels like a normal text field.
|
|
4
|
+
const PASTED_TEXT_MIN_CHARS = 3200;
|
|
5
|
+
const PASTED_TEXT_MIN_LINES = 24;
|
|
6
|
+
|
|
7
|
+
const PASTED_TEXT_FILENAME_PREFIX = "pasted-text-";
|
|
8
|
+
|
|
9
|
+
// A copied HTML document/source is recognizable from its markup: a closing tag
|
|
10
|
+
// (`</div>`), a doctype, or a common structural/element tag. We key off the
|
|
11
|
+
// *content* the user actually pasted, not the clipboard's `text/html` flavor —
|
|
12
|
+
// editors (VS Code) and rich-text apps (Google Docs) populate `text/html` with
|
|
13
|
+
// syntax-highlight spans or formatting wrappers even when the real content is
|
|
14
|
+
// plain code/prose, so trusting `text/html` blindly would mangle those pastes.
|
|
15
|
+
const HTML_SOURCE_SIGNAL =
|
|
16
|
+
/<!doctype\s+html|<html[\s>]|<\/[a-z][a-z0-9-]*\s*>|<(?:body|head|div|span|section|main|header|footer|nav|article|aside|ul|ol|li|table|thead|tbody|tr|td|th|h[1-6]|p|a|img|button|input|textarea|select|form|label|script|style|link|meta|svg|canvas|template)\b/i;
|
|
17
|
+
|
|
18
|
+
// A real HTML *document* announces itself with a doctype / html / head / body.
|
|
19
|
+
// When one of these is present we keep the HTML classification even if an inline
|
|
20
|
+
// <script> contains JS keywords — it's a genuine page.
|
|
21
|
+
const HTML_DOCUMENT_SIGNAL =
|
|
22
|
+
/<!doctype\s+html|<html[\s>]|<head[\s>]|<body[\s>]/i;
|
|
23
|
+
|
|
24
|
+
// JSX/TSX source contains the same `</div>`/`<span>` tags as an HTML document,
|
|
25
|
+
// so the HTML tag signal alone misfiles a pasted React/TS component (even a bare
|
|
26
|
+
// function component) as an `.html` artifact — the agent then mishandles it as a
|
|
27
|
+
// hostable document instead of source. These markers appear in JS/TS/JSX source
|
|
28
|
+
// but not in a plain HTML *fragment*: `className=` (JSX uses it; HTML uses
|
|
29
|
+
// `class=`), ES module import/export, arrow functions, TS type/React annotations,
|
|
30
|
+
// React hooks, and the basic JS declaration/return keywords that make up a
|
|
31
|
+
// component body.
|
|
32
|
+
const CODE_SOURCE_SIGNAL =
|
|
33
|
+
/\bclassName=|\bimport\b|\bexport\b|=>|:\s*React\.|\buse[A-Z]\w*\(|\b(?:function|const|let|var|return|class|interface|type|enum)\b/;
|
|
34
|
+
|
|
35
|
+
function looksLikeHtml(value: string): boolean {
|
|
36
|
+
if (!value || !HTML_SOURCE_SIGNAL.test(value)) return false;
|
|
37
|
+
// A self-announcing HTML document stays HTML even if it embeds a <script>.
|
|
38
|
+
if (HTML_DOCUMENT_SIGNAL.test(value)) return true;
|
|
39
|
+
// Otherwise it's a bare fragment — if it carries JS/TS/JSX code signals,
|
|
40
|
+
// treat it as source code, not an HTML attachment.
|
|
41
|
+
if (CODE_SOURCE_SIGNAL.test(value)) return false;
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** The clipboard flavors we care about for a paste. */
|
|
46
|
+
export interface ClipboardPaste {
|
|
47
|
+
/** `text/plain` flavor — used for size heuristics and as the default body. */
|
|
48
|
+
text: string;
|
|
49
|
+
/** `text/html` flavor when the source provided one. */
|
|
50
|
+
html?: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** Read the relevant clipboard flavors from a paste/drop DataTransfer. */
|
|
54
|
+
export function readClipboardPaste(
|
|
55
|
+
data: { getData(type: string): string } | null | undefined,
|
|
56
|
+
): ClipboardPaste {
|
|
57
|
+
const text = data?.getData("text/plain") ?? "";
|
|
58
|
+
const html = data?.getData("text/html") ?? "";
|
|
59
|
+
return { text, html: html.trim() ? html : undefined };
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
interface SelectedPasteBody {
|
|
63
|
+
body: string;
|
|
64
|
+
ext: "html" | "txt";
|
|
65
|
+
type: "text/html" | "text/plain";
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Decide what to actually store for a paste. Preserving HTML markup means a
|
|
69
|
+
// pasted HTML document behaves exactly like uploading that .html file: the agent
|
|
70
|
+
// recognizes it as a hostable artifact and reads it verbatim via
|
|
71
|
+
// `contentFromAttachment` instead of retyping it inline (which cuts off
|
|
72
|
+
// mid-stream on large files and triggers a continuation loop / "spin").
|
|
73
|
+
function selectPasteBody(paste: ClipboardPaste): SelectedPasteBody {
|
|
74
|
+
const plain = paste.text ?? "";
|
|
75
|
+
const html = paste.html ?? "";
|
|
76
|
+
|
|
77
|
+
// 1) The pasted text is itself HTML source (copied from an editor, a file, or
|
|
78
|
+
// view-source). The plain text *is* the markup, so keep it as .html.
|
|
79
|
+
if (plain.trim() && looksLikeHtml(plain)) {
|
|
80
|
+
return { body: plain, ext: "html", type: "text/html" };
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// 2) No usable plain text, but a real HTML flavor exists (some apps only
|
|
84
|
+
// expose text/html). Fall back to the markup so nothing is dropped.
|
|
85
|
+
if (!plain.trim() && looksLikeHtml(html)) {
|
|
86
|
+
return { body: html, ext: "html", type: "text/html" };
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// 3) Default: keep the clean plain text. Avoids the syntax-highlight /
|
|
90
|
+
// rich-text noise that lives in text/html when the plain text is already
|
|
91
|
+
// the real content (code from an editor, prose from a doc).
|
|
92
|
+
return { body: plain, ext: "txt", type: "text/plain" };
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function shouldConvertPasteToAttachment(text: string): boolean {
|
|
96
|
+
if (!text) return false;
|
|
97
|
+
if (text.length >= PASTED_TEXT_MIN_CHARS) return true;
|
|
98
|
+
let lines = 1;
|
|
99
|
+
for (let i = 0; i < text.length; i++) {
|
|
100
|
+
if (text.charCodeAt(i) === 10) {
|
|
101
|
+
lines++;
|
|
102
|
+
if (lines >= PASTED_TEXT_MIN_LINES) return true;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Whether a clipboard paste is large enough to become a `Pasted text`
|
|
110
|
+
* attachment chip. Mirrors `shouldConvertPasteToAttachment` but evaluates the
|
|
111
|
+
* representation we'd actually store, so an HTML-only paste (empty text/plain)
|
|
112
|
+
* still converts on the strength of its markup.
|
|
113
|
+
*/
|
|
114
|
+
export function shouldConvertClipboardToAttachment(
|
|
115
|
+
paste: ClipboardPaste,
|
|
116
|
+
): boolean {
|
|
117
|
+
return shouldConvertPasteToAttachment(selectPasteBody(paste).body);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function pastedAttachmentName(ext: "html" | "txt"): string {
|
|
121
|
+
return `${PASTED_TEXT_FILENAME_PREFIX}${Date.now()}-${Math.random()
|
|
122
|
+
.toString(36)
|
|
123
|
+
.slice(2, 8)}.${ext}`;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Build the attachment File for a page-sized paste, preserving HTML markup when
|
|
128
|
+
* the pasted content is an HTML document so it travels the same rail as an
|
|
129
|
+
* uploaded .html file.
|
|
130
|
+
*/
|
|
131
|
+
export function createPastedAttachmentFile(paste: ClipboardPaste): File {
|
|
132
|
+
const { body, ext, type } = selectPasteBody(paste);
|
|
133
|
+
return new File([body], pastedAttachmentName(ext), { type });
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/** Back-compat helper for callers that only have plain text. */
|
|
137
|
+
export function createPastedTextFile(text: string): File {
|
|
138
|
+
return createPastedAttachmentFile({ text });
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export function isPastedTextAttachmentName(name: string | undefined): boolean {
|
|
142
|
+
return !!name && name.startsWith(PASTED_TEXT_FILENAME_PREFIX);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Strips the `<attachment name=...>\n` / `\n</attachment>` envelope that
|
|
146
|
+
// SimpleTextAttachmentAdapter wraps the file body in when sending. Returns the
|
|
147
|
+
// raw body for previewing.
|
|
148
|
+
export function unwrapAttachmentEnvelope(text: string): string {
|
|
149
|
+
const match = text.match(/^<attachment\b[^>]*>\n([\s\S]*)\n<\/attachment>$/);
|
|
150
|
+
return match ? match[1] : text;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export function countLines(text: string): number {
|
|
154
|
+
if (!text) return 0;
|
|
155
|
+
let lines = 1;
|
|
156
|
+
for (let i = 0; i < text.length; i++) {
|
|
157
|
+
if (text.charCodeAt(i) === 10) lines++;
|
|
158
|
+
}
|
|
159
|
+
return lines;
|
|
160
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// @vitest-environment happy-dom
|
|
2
|
+
|
|
3
|
+
import { describe, expect, it } from "vitest";
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
escapePromptAttachmentAttribute,
|
|
7
|
+
formatPromptWithAttachments,
|
|
8
|
+
isInlineableAgentPromptFile,
|
|
9
|
+
readAgentPromptAttachment,
|
|
10
|
+
} from "./prompt-attachments.js";
|
|
11
|
+
|
|
12
|
+
describe("prompt attachment helpers", () => {
|
|
13
|
+
it("inlines readable text files up to the configured limit", async () => {
|
|
14
|
+
const file = new File(["hello"], "notes.md", {
|
|
15
|
+
type: "text/markdown",
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const attachment = await readAgentPromptAttachment(file);
|
|
19
|
+
|
|
20
|
+
expect(isInlineableAgentPromptFile(file)).toBe(true);
|
|
21
|
+
expect(attachment).toEqual({
|
|
22
|
+
name: "notes.md",
|
|
23
|
+
type: "text/markdown",
|
|
24
|
+
size: 5,
|
|
25
|
+
text: "hello",
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it("falls back to filename metadata for oversized text files", async () => {
|
|
30
|
+
const file = new File(["hello"], "notes.md", {
|
|
31
|
+
type: "text/markdown",
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const attachment = await readAgentPromptAttachment(file, {
|
|
35
|
+
maxInlineTextChars: 2,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
expect(attachment).toEqual({
|
|
39
|
+
name: "notes.md",
|
|
40
|
+
type: "text/markdown",
|
|
41
|
+
size: 5,
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it("inlines small image files as data URLs", async () => {
|
|
46
|
+
const file = new File(["fake image"], "screenshot.png", {
|
|
47
|
+
type: "image/png",
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const attachment = await readAgentPromptAttachment(file);
|
|
51
|
+
|
|
52
|
+
expect(attachment.name).toBe("screenshot.png");
|
|
53
|
+
expect(attachment.type).toBe("image/png");
|
|
54
|
+
expect(attachment.dataUrl).toContain("data:image/png;base64,");
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it("formats attachments with escaped XML attributes", () => {
|
|
58
|
+
const formatted = formatPromptWithAttachments("Review this", [
|
|
59
|
+
{
|
|
60
|
+
name: 'bad"name&.ts',
|
|
61
|
+
type: "text/plain",
|
|
62
|
+
size: 12,
|
|
63
|
+
text: "const x = 1;",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "shot.png",
|
|
67
|
+
type: "image/png",
|
|
68
|
+
size: 3,
|
|
69
|
+
dataUrl: "data:image/png;base64,abc",
|
|
70
|
+
},
|
|
71
|
+
]);
|
|
72
|
+
|
|
73
|
+
expect(escapePromptAttachmentAttribute('a&"b')).toBe("a&"b");
|
|
74
|
+
expect(formatted).toContain("Attached context:");
|
|
75
|
+
expect(formatted).toContain('name="bad"name&.ts"');
|
|
76
|
+
expect(formatted).toContain("<attached-file");
|
|
77
|
+
expect(formatted).toContain("<attached-image");
|
|
78
|
+
expect(formatted).toContain("data:image/png;base64,abc");
|
|
79
|
+
});
|
|
80
|
+
});
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
export interface AgentPromptAttachment {
|
|
2
|
+
name: string;
|
|
3
|
+
type?: string;
|
|
4
|
+
size?: number;
|
|
5
|
+
text?: string;
|
|
6
|
+
dataUrl?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function escapePromptAttachmentAttribute(value: string): string {
|
|
10
|
+
return value.replace(/&/g, "&").replace(/"/g, """);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function formatPromptWithAttachments(
|
|
14
|
+
prompt: string,
|
|
15
|
+
attachments: readonly AgentPromptAttachment[],
|
|
16
|
+
): string {
|
|
17
|
+
if (attachments.length === 0) return prompt;
|
|
18
|
+
const attachmentText = attachments
|
|
19
|
+
.map((attachment) => {
|
|
20
|
+
const size = attachment.size ? ` size="${attachment.size}"` : "";
|
|
21
|
+
const type = attachment.type
|
|
22
|
+
? ` type="${escapePromptAttachmentAttribute(attachment.type)}"`
|
|
23
|
+
: "";
|
|
24
|
+
if (attachment.dataUrl) {
|
|
25
|
+
return `<attached-image name="${escapePromptAttachmentAttribute(attachment.name)}"${type}${size}>\n${attachment.dataUrl}\n</attached-image>`;
|
|
26
|
+
}
|
|
27
|
+
const body =
|
|
28
|
+
attachment.text?.trim() ||
|
|
29
|
+
"Selected in the UI. If this file is needed, inspect it from the workspace or ask for a readable copy.";
|
|
30
|
+
return `<attached-file name="${escapePromptAttachmentAttribute(attachment.name)}"${type}${size}>\n${body}\n</attached-file>`;
|
|
31
|
+
})
|
|
32
|
+
.join("\n\n");
|
|
33
|
+
return `${prompt.trimEnd()}\n\nAttached context:\n${attachmentText}`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const AGENT_PROMPT_MAX_INLINE_TEXT_CHARS = 60_000;
|
|
37
|
+
export const AGENT_PROMPT_MAX_INLINE_IMAGE_BYTES = 2 * 1024 * 1024;
|
|
38
|
+
|
|
39
|
+
export interface ReadAgentPromptAttachmentOptions {
|
|
40
|
+
maxInlineTextChars?: number;
|
|
41
|
+
maxInlineImageBytes?: number;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export async function readAgentPromptAttachment(
|
|
45
|
+
file: File,
|
|
46
|
+
options: ReadAgentPromptAttachmentOptions = {},
|
|
47
|
+
): Promise<AgentPromptAttachment> {
|
|
48
|
+
const maxInlineTextChars =
|
|
49
|
+
options.maxInlineTextChars ?? AGENT_PROMPT_MAX_INLINE_TEXT_CHARS;
|
|
50
|
+
const maxInlineImageBytes =
|
|
51
|
+
options.maxInlineImageBytes ?? AGENT_PROMPT_MAX_INLINE_IMAGE_BYTES;
|
|
52
|
+
const attachment: AgentPromptAttachment = {
|
|
53
|
+
name: file.name,
|
|
54
|
+
type: file.type || undefined,
|
|
55
|
+
size: file.size,
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
if (isInlineableAgentPromptFile(file) && file.size <= maxInlineTextChars) {
|
|
59
|
+
try {
|
|
60
|
+
attachment.text = await file.text();
|
|
61
|
+
} catch {
|
|
62
|
+
// Keep the filename-only attachment if the browser cannot read it.
|
|
63
|
+
}
|
|
64
|
+
} else if (
|
|
65
|
+
file.type.startsWith("image/") &&
|
|
66
|
+
file.size <= maxInlineImageBytes
|
|
67
|
+
) {
|
|
68
|
+
try {
|
|
69
|
+
attachment.dataUrl = await readFileAsDataUrl(file);
|
|
70
|
+
} catch {
|
|
71
|
+
// Keep the filename-only attachment if the browser cannot read it.
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return attachment;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function isInlineableAgentPromptFile(file: File): boolean {
|
|
79
|
+
if (file.type.startsWith("text/")) return true;
|
|
80
|
+
return /\.(cjs|css|csv|html|js|json|jsx|md|mdx|mjs|sql|tsx?|txt|xml|yaml|yml)$/i.test(
|
|
81
|
+
file.name,
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function readFileAsDataUrl(file: File): Promise<string> {
|
|
86
|
+
return new Promise((resolve, reject) => {
|
|
87
|
+
const reader = new FileReader();
|
|
88
|
+
reader.onload = () => resolve(String(reader.result ?? ""));
|
|
89
|
+
reader.onerror = () =>
|
|
90
|
+
reject(reader.error ?? new Error("Could not read file"));
|
|
91
|
+
reader.readAsDataURL(file);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from "vitest";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
createRealtimeVoiceAudioLevelStore,
|
|
5
|
+
normalizeRealtimeVoiceRms,
|
|
6
|
+
smoothRealtimeVoiceLevel,
|
|
7
|
+
} from "./realtime-voice-audio-level.js";
|
|
8
|
+
|
|
9
|
+
describe("realtime voice audio levels", () => {
|
|
10
|
+
it("normalizes silence and clamps loud audio", () => {
|
|
11
|
+
expect(normalizeRealtimeVoiceRms(new Uint8Array(32).fill(128))).toBe(0);
|
|
12
|
+
expect(normalizeRealtimeVoiceRms(new Uint8Array(32).fill(255))).toBe(1);
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it("makes ordinary speech visibly responsive above the noise floor", () => {
|
|
16
|
+
const quietSpeech = Uint8Array.from({ length: 32 }, (_, index) =>
|
|
17
|
+
index % 2 === 0 ? 124 : 132,
|
|
18
|
+
);
|
|
19
|
+
const typicalSpeech = Uint8Array.from({ length: 32 }, (_, index) =>
|
|
20
|
+
index % 2 === 0 ? 120 : 136,
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
expect(normalizeRealtimeVoiceRms(quietSpeech)).toBeGreaterThan(0.3);
|
|
24
|
+
expect(normalizeRealtimeVoiceRms(typicalSpeech)).toBeGreaterThan(0.5);
|
|
25
|
+
expect(normalizeRealtimeVoiceRms(typicalSpeech)).toBeGreaterThan(
|
|
26
|
+
normalizeRealtimeVoiceRms(quietSpeech),
|
|
27
|
+
);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("attacks faster than it decays", () => {
|
|
31
|
+
expect(smoothRealtimeVoiceLevel(0, 1)).toBe(0.55);
|
|
32
|
+
expect(smoothRealtimeVoiceLevel(1, 0)).toBe(0.8);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it("notifies only on changes and resets both channels", () => {
|
|
36
|
+
const store = createRealtimeVoiceAudioLevelStore();
|
|
37
|
+
const listener = vi.fn();
|
|
38
|
+
store.subscribe(listener);
|
|
39
|
+
store.set({ input: 0.5, output: 0.25 });
|
|
40
|
+
store.set({ input: 0.5, output: 0.25 });
|
|
41
|
+
expect(listener).toHaveBeenCalledOnce();
|
|
42
|
+
expect(store.getSnapshot()).toEqual({ input: 0.5, output: 0.25 });
|
|
43
|
+
store.reset();
|
|
44
|
+
expect(store.getSnapshot()).toEqual({ input: 0, output: 0 });
|
|
45
|
+
expect(listener).toHaveBeenCalledTimes(2);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export interface RealtimeVoiceAudioLevels {
|
|
2
|
+
input: number;
|
|
3
|
+
output: number;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface RealtimeVoiceAudioLevelStore {
|
|
7
|
+
getSnapshot: () => RealtimeVoiceAudioLevels;
|
|
8
|
+
subscribe: (listener: () => void) => () => void;
|
|
9
|
+
set: (levels: RealtimeVoiceAudioLevels) => void;
|
|
10
|
+
reset: () => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const SILENT_LEVELS: RealtimeVoiceAudioLevels = { input: 0, output: 0 };
|
|
14
|
+
|
|
15
|
+
function clampLevel(value: number): number {
|
|
16
|
+
if (!Number.isFinite(value)) return 0;
|
|
17
|
+
return Math.max(0, Math.min(1, value));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function normalizeRealtimeVoiceRms(samples: Uint8Array): number {
|
|
21
|
+
if (samples.length === 0) return 0;
|
|
22
|
+
let sumSquares = 0;
|
|
23
|
+
for (const sample of samples) {
|
|
24
|
+
const normalized = (sample - 128) / 128;
|
|
25
|
+
sumSquares += normalized * normalized;
|
|
26
|
+
}
|
|
27
|
+
const rms = Math.sqrt(sumSquares / samples.length);
|
|
28
|
+
const activeLevel = clampLevel((rms - 0.012) / 0.18);
|
|
29
|
+
return Math.sqrt(activeLevel);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function smoothRealtimeVoiceLevel(
|
|
33
|
+
previous: number,
|
|
34
|
+
next: number,
|
|
35
|
+
): number {
|
|
36
|
+
const target = clampLevel(next);
|
|
37
|
+
const factor = target > previous ? 0.55 : 0.2;
|
|
38
|
+
return clampLevel(previous + (target - previous) * factor);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function createRealtimeVoiceAudioLevelStore(): RealtimeVoiceAudioLevelStore {
|
|
42
|
+
let snapshot = SILENT_LEVELS;
|
|
43
|
+
const listeners = new Set<() => void>();
|
|
44
|
+
|
|
45
|
+
const set = (levels: RealtimeVoiceAudioLevels) => {
|
|
46
|
+
const next = {
|
|
47
|
+
input: clampLevel(levels.input),
|
|
48
|
+
output: clampLevel(levels.output),
|
|
49
|
+
};
|
|
50
|
+
if (next.input === snapshot.input && next.output === snapshot.output)
|
|
51
|
+
return;
|
|
52
|
+
snapshot = next;
|
|
53
|
+
for (const listener of listeners) listener();
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
return {
|
|
57
|
+
getSnapshot: () => snapshot,
|
|
58
|
+
subscribe(listener) {
|
|
59
|
+
listeners.add(listener);
|
|
60
|
+
return () => listeners.delete(listener);
|
|
61
|
+
},
|
|
62
|
+
set,
|
|
63
|
+
reset: () => set(SILENT_LEVELS),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from "vitest";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
appendRealtimeVoiceTranscriptToRepository,
|
|
5
|
+
createRealtimeVoiceTranscriptRegistry,
|
|
6
|
+
type RealtimeVoiceTranscriptMessage,
|
|
7
|
+
} from "./realtime-voice-transcript.js";
|
|
8
|
+
|
|
9
|
+
function transcript(
|
|
10
|
+
overrides: Partial<RealtimeVoiceTranscriptMessage> = {},
|
|
11
|
+
): RealtimeVoiceTranscriptMessage {
|
|
12
|
+
return {
|
|
13
|
+
id: "voice-1",
|
|
14
|
+
threadId: "thread-1",
|
|
15
|
+
role: "user",
|
|
16
|
+
text: "Open sources",
|
|
17
|
+
createdAt: "2026-07-10T20:00:00.000Z",
|
|
18
|
+
...overrides,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
describe("realtime voice transcript registry", () => {
|
|
23
|
+
it("captures the latest active thread and buffers until its sink mounts", () => {
|
|
24
|
+
const registry = createRealtimeVoiceTranscriptRegistry();
|
|
25
|
+
registry.register({
|
|
26
|
+
threadId: "thread-old",
|
|
27
|
+
active: true,
|
|
28
|
+
append: vi.fn(() => true),
|
|
29
|
+
});
|
|
30
|
+
registry.register({
|
|
31
|
+
threadId: "thread-1",
|
|
32
|
+
active: true,
|
|
33
|
+
// Simulate the chat surface being selected but not yet ready to apply
|
|
34
|
+
// the completed transcript. The registry must retain it for the sink
|
|
35
|
+
// that mounts once the surface is ready.
|
|
36
|
+
append: vi.fn(() => false),
|
|
37
|
+
});
|
|
38
|
+
expect(registry.activeThreadId()).toBe("thread-1");
|
|
39
|
+
|
|
40
|
+
registry.publish(transcript());
|
|
41
|
+
expect(registry.pendingCount()).toBe(1);
|
|
42
|
+
const append = vi.fn(() => true);
|
|
43
|
+
registry.register({ threadId: "thread-1", active: false, append });
|
|
44
|
+
expect(append).toHaveBeenCalledOnce();
|
|
45
|
+
expect(registry.pendingCount()).toBe(0);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it("deduplicates completed provider transcript events", () => {
|
|
49
|
+
const registry = createRealtimeVoiceTranscriptRegistry();
|
|
50
|
+
const append = vi.fn(() => true);
|
|
51
|
+
registry.register({ threadId: "thread-1", active: true, append });
|
|
52
|
+
registry.publish(transcript());
|
|
53
|
+
registry.publish(transcript());
|
|
54
|
+
expect(append).toHaveBeenCalledOnce();
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
describe("appendRealtimeVoiceTranscriptToRepository", () => {
|
|
59
|
+
it("links completed user and assistant messages without starting a run", () => {
|
|
60
|
+
const first = appendRealtimeVoiceTranscriptToRepository({}, transcript());
|
|
61
|
+
const second = appendRealtimeVoiceTranscriptToRepository(
|
|
62
|
+
first.repository,
|
|
63
|
+
transcript({
|
|
64
|
+
id: "voice-2",
|
|
65
|
+
role: "assistant",
|
|
66
|
+
text: "Opening Sources.",
|
|
67
|
+
}),
|
|
68
|
+
);
|
|
69
|
+
expect(second.repository.headId).toBe("voice-2");
|
|
70
|
+
expect(second.repository.messages).toMatchObject([
|
|
71
|
+
{
|
|
72
|
+
parentId: null,
|
|
73
|
+
message: {
|
|
74
|
+
id: "voice-1",
|
|
75
|
+
role: "user",
|
|
76
|
+
metadata: { custom: { source: "realtime-voice" } },
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
parentId: "voice-1",
|
|
81
|
+
message: {
|
|
82
|
+
id: "voice-2",
|
|
83
|
+
role: "assistant",
|
|
84
|
+
status: { type: "complete", reason: "stop" },
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
]);
|
|
88
|
+
expect(
|
|
89
|
+
appendRealtimeVoiceTranscriptToRepository(
|
|
90
|
+
second.repository,
|
|
91
|
+
transcript({ id: "voice-2" }),
|
|
92
|
+
).appended,
|
|
93
|
+
).toBe(false);
|
|
94
|
+
});
|
|
95
|
+
});
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
export type RealtimeVoiceTranscriptRole = "user" | "assistant";
|
|
2
|
+
|
|
3
|
+
export interface RealtimeVoiceTranscriptMessage {
|
|
4
|
+
id: string;
|
|
5
|
+
threadId: string;
|
|
6
|
+
role: RealtimeVoiceTranscriptRole;
|
|
7
|
+
text: string;
|
|
8
|
+
createdAt: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface RealtimeVoiceTranscriptSink {
|
|
12
|
+
threadId: string;
|
|
13
|
+
active: boolean;
|
|
14
|
+
append: (message: RealtimeVoiceTranscriptMessage) => boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface RealtimeVoiceTranscriptRegistry {
|
|
18
|
+
activeThreadId: () => string | undefined;
|
|
19
|
+
publish: (message: RealtimeVoiceTranscriptMessage) => void;
|
|
20
|
+
register: (sink: RealtimeVoiceTranscriptSink) => () => void;
|
|
21
|
+
pendingCount: () => number;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function appendRealtimeVoiceTranscriptToRepository(
|
|
25
|
+
value: unknown,
|
|
26
|
+
transcript: RealtimeVoiceTranscriptMessage,
|
|
27
|
+
): { appended: boolean; repository: Record<string, unknown> } {
|
|
28
|
+
const repository =
|
|
29
|
+
value && typeof value === "object" && !Array.isArray(value)
|
|
30
|
+
? (value as Record<string, unknown>)
|
|
31
|
+
: {};
|
|
32
|
+
const messages = Array.isArray(repository.messages)
|
|
33
|
+
? [...repository.messages]
|
|
34
|
+
: [];
|
|
35
|
+
const duplicate = messages.some((entry) => {
|
|
36
|
+
if (!entry || typeof entry !== "object") return false;
|
|
37
|
+
const record = entry as Record<string, unknown>;
|
|
38
|
+
const message =
|
|
39
|
+
record.message && typeof record.message === "object"
|
|
40
|
+
? (record.message as Record<string, unknown>)
|
|
41
|
+
: record;
|
|
42
|
+
return message.id === transcript.id;
|
|
43
|
+
});
|
|
44
|
+
if (duplicate) return { appended: false, repository };
|
|
45
|
+
|
|
46
|
+
const parentId =
|
|
47
|
+
typeof repository.headId === "string" ? repository.headId : null;
|
|
48
|
+
const createdAt = new Date(transcript.createdAt);
|
|
49
|
+
const message = {
|
|
50
|
+
id: transcript.id,
|
|
51
|
+
role: transcript.role,
|
|
52
|
+
content: [{ type: "text", text: transcript.text }],
|
|
53
|
+
createdAt: Number.isNaN(createdAt.getTime()) ? new Date() : createdAt,
|
|
54
|
+
metadata: {
|
|
55
|
+
custom: {
|
|
56
|
+
source: "realtime-voice",
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
...(transcript.role === "assistant"
|
|
60
|
+
? { status: { type: "complete", reason: "stop" } }
|
|
61
|
+
: {}),
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
appended: true,
|
|
66
|
+
repository: {
|
|
67
|
+
...repository,
|
|
68
|
+
messages: [...messages, { message, parentId }],
|
|
69
|
+
headId: transcript.id,
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function createRealtimeVoiceTranscriptRegistry(): RealtimeVoiceTranscriptRegistry {
|
|
75
|
+
const sinks = new Map<
|
|
76
|
+
symbol,
|
|
77
|
+
RealtimeVoiceTranscriptSink & { order: number }
|
|
78
|
+
>();
|
|
79
|
+
const pending = new Map<string, RealtimeVoiceTranscriptMessage>();
|
|
80
|
+
const delivered = new Set<string>();
|
|
81
|
+
let order = 0;
|
|
82
|
+
|
|
83
|
+
const flush = () => {
|
|
84
|
+
for (const [id, message] of pending) {
|
|
85
|
+
let consumed = false;
|
|
86
|
+
for (const sink of sinks.values()) {
|
|
87
|
+
if (sink.threadId !== message.threadId) continue;
|
|
88
|
+
try {
|
|
89
|
+
consumed = sink.append(message) || consumed;
|
|
90
|
+
} catch {
|
|
91
|
+
// Keep the completed transcript queued until the chat can import it.
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (!consumed) continue;
|
|
95
|
+
pending.delete(id);
|
|
96
|
+
delivered.add(id);
|
|
97
|
+
if (delivered.size > 1_000) {
|
|
98
|
+
const oldest = delivered.values().next().value;
|
|
99
|
+
if (typeof oldest === "string") delivered.delete(oldest);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
return {
|
|
105
|
+
activeThreadId() {
|
|
106
|
+
let active: (RealtimeVoiceTranscriptSink & { order: number }) | undefined;
|
|
107
|
+
for (const sink of sinks.values()) {
|
|
108
|
+
if (!sink.active || (active && sink.order <= active.order)) continue;
|
|
109
|
+
active = sink;
|
|
110
|
+
}
|
|
111
|
+
return active?.threadId;
|
|
112
|
+
},
|
|
113
|
+
publish(message) {
|
|
114
|
+
const id = message.id.trim();
|
|
115
|
+
const threadId = message.threadId.trim();
|
|
116
|
+
const text = message.text.trim();
|
|
117
|
+
if (!id || !threadId || !text || delivered.has(id) || pending.has(id)) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
pending.set(id, { ...message, id, threadId, text });
|
|
121
|
+
flush();
|
|
122
|
+
},
|
|
123
|
+
register(sink) {
|
|
124
|
+
const token = Symbol("realtime-voice-transcript-sink");
|
|
125
|
+
sinks.set(token, { ...sink, order: ++order });
|
|
126
|
+
flush();
|
|
127
|
+
return () => sinks.delete(token);
|
|
128
|
+
},
|
|
129
|
+
pendingCount: () => pending.size,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export const realtimeVoiceTranscriptRegistry =
|
|
134
|
+
createRealtimeVoiceTranscriptRegistry();
|