@athenaintel/react 0.18.0 → 0.20.0
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 +195 -7
- package/dist/assets/AssetPanel.cjs +277 -0
- package/dist/assets/AssetPanel.cjs.map +1 -0
- package/dist/assets/AssetPanel.js +277 -0
- package/dist/assets/AssetPanel.js.map +1 -0
- package/dist/assets/AthenaAssetEmbed.cjs +151 -0
- package/dist/assets/AthenaAssetEmbed.cjs.map +1 -0
- package/dist/assets/AthenaAssetEmbed.js +151 -0
- package/dist/assets/AthenaAssetEmbed.js.map +1 -0
- package/dist/assets/AthenaLayout.cjs +69 -0
- package/dist/assets/AthenaLayout.cjs.map +1 -0
- package/dist/assets/AthenaLayout.js +69 -0
- package/dist/assets/AthenaLayout.js.map +1 -0
- package/dist/assets/asset-embed-messages.cjs +39 -0
- package/dist/assets/asset-embed-messages.cjs.map +1 -0
- package/dist/assets/asset-embed-messages.js +39 -0
- package/dist/assets/asset-embed-messages.js.map +1 -0
- package/dist/assets/asset-panel-store.cjs +124 -0
- package/dist/assets/asset-panel-store.cjs.map +1 -0
- package/dist/assets/asset-panel-store.js +124 -0
- package/dist/assets/asset-panel-store.js.map +1 -0
- package/dist/assets/asset-panel-url.cjs +40 -0
- package/dist/assets/asset-panel-url.cjs.map +1 -0
- package/dist/assets/asset-panel-url.js +40 -0
- package/dist/assets/asset-panel-url.js.map +1 -0
- package/dist/assets/use-asset-embed.cjs +362 -0
- package/dist/assets/use-asset-embed.cjs.map +1 -0
- package/dist/assets/use-asset-embed.js +362 -0
- package/dist/assets/use-asset-embed.js.map +1 -0
- package/dist/{AthenaAuthContext-B3AwLA5Z.cjs → auth/AthenaAuthContext.cjs} +5 -4
- package/dist/auth/AthenaAuthContext.cjs.map +1 -0
- package/dist/{AthenaAuthContext-DQsdayH2.js → auth/AthenaAuthContext.js} +3 -3
- package/dist/auth/AthenaAuthContext.js.map +1 -0
- package/dist/auth/AthenaAuthProvider.cjs +141 -0
- package/dist/auth/AthenaAuthProvider.cjs.map +1 -0
- package/dist/auth/AthenaAuthProvider.js +141 -0
- package/dist/auth/AthenaAuthProvider.js.map +1 -0
- package/dist/{auth.cjs → auth/AthenaSSOProvider.cjs} +14 -151
- package/dist/auth/AthenaSSOProvider.cjs.map +1 -0
- package/dist/{auth.js → auth/AthenaSSOProvider.js} +4 -142
- package/dist/auth/AthenaSSOProvider.js.map +1 -0
- package/dist/auth/index.cjs +10 -0
- package/dist/auth/index.cjs.map +1 -0
- package/dist/auth/index.js +10 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/chat/AthenaChat.cjs +753 -0
- package/dist/chat/AthenaChat.cjs.map +1 -0
- package/dist/chat/AthenaChat.d.ts +3 -2
- package/dist/chat/AthenaChat.js +753 -0
- package/dist/chat/AthenaChat.js.map +1 -0
- package/dist/chat/AthenaChatErrorBoundary.cjs +53 -0
- package/dist/chat/AthenaChatErrorBoundary.cjs.map +1 -0
- package/dist/chat/AthenaChatErrorBoundary.js +53 -0
- package/dist/chat/AthenaChatErrorBoundary.js.map +1 -0
- package/dist/chat/StatewireApprovalCard.cjs +171 -0
- package/dist/chat/StatewireApprovalCard.cjs.map +1 -0
- package/dist/chat/StatewireApprovalCard.d.ts +59 -2
- package/dist/chat/StatewireApprovalCard.js +171 -0
- package/dist/chat/StatewireApprovalCard.js.map +1 -0
- package/dist/chat/StatewireClientToolBridge.cjs +50 -0
- package/dist/chat/StatewireClientToolBridge.cjs.map +1 -0
- package/dist/chat/StatewireClientToolBridge.d.ts +3 -3
- package/dist/chat/StatewireClientToolBridge.js +50 -0
- package/dist/chat/StatewireClientToolBridge.js.map +1 -0
- package/dist/chat/StatewireQueuedMessages.cjs +432 -0
- package/dist/chat/StatewireQueuedMessages.cjs.map +1 -0
- package/dist/chat/StatewireQueuedMessages.d.ts +104 -6
- package/dist/chat/StatewireQueuedMessages.js +432 -0
- package/dist/chat/StatewireQueuedMessages.js.map +1 -0
- package/dist/chat/athena-citation-links.cjs +326 -0
- package/dist/chat/athena-citation-links.cjs.map +1 -0
- package/dist/chat/athena-citation-links.js +326 -0
- package/dist/chat/athena-citation-links.js.map +1 -0
- package/dist/chat/run-activity.cjs +28 -0
- package/dist/chat/run-activity.cjs.map +1 -0
- package/dist/chat/run-activity.js +28 -0
- package/dist/chat/run-activity.js.map +1 -0
- package/dist/chat/statewire-approval.d.ts +1 -1
- package/dist/chat/statewire-banners.cjs +83 -0
- package/dist/chat/statewire-banners.cjs.map +1 -0
- package/dist/chat/statewire-banners.js +83 -0
- package/dist/chat/statewire-banners.js.map +1 -0
- package/dist/chat/statewire-client-tools.cjs +73 -0
- package/dist/chat/statewire-client-tools.cjs.map +1 -0
- package/dist/chat/statewire-client-tools.d.ts +15 -21
- package/dist/chat/statewire-client-tools.js +73 -0
- package/dist/chat/statewire-client-tools.js.map +1 -0
- package/dist/chat/super-grouping/CollapsibleGroup.cjs +158 -0
- package/dist/chat/super-grouping/CollapsibleGroup.cjs.map +1 -0
- package/dist/chat/super-grouping/CollapsibleGroup.d.ts +52 -11
- package/dist/chat/super-grouping/CollapsibleGroup.js +158 -0
- package/dist/chat/super-grouping/CollapsibleGroup.js.map +1 -0
- package/dist/chat/super-grouping/SuperGroupingCard.cjs +361 -0
- package/dist/chat/super-grouping/SuperGroupingCard.cjs.map +1 -0
- package/dist/chat/super-grouping/SuperGroupingCard.d.ts +81 -21
- package/dist/chat/super-grouping/SuperGroupingCard.js +361 -0
- package/dist/chat/super-grouping/SuperGroupingCard.js.map +1 -0
- package/dist/chat/super-grouping/activity-timeline.cjs +151 -0
- package/dist/chat/super-grouping/activity-timeline.cjs.map +1 -0
- package/dist/chat/super-grouping/activity-timeline.d.ts +91 -0
- package/dist/chat/super-grouping/activity-timeline.js +151 -0
- package/dist/chat/super-grouping/activity-timeline.js.map +1 -0
- package/dist/chat/super-grouping/grouping-function.cjs +55 -0
- package/dist/chat/super-grouping/grouping-function.cjs.map +1 -0
- package/dist/chat/super-grouping/grouping-function.d.ts +13 -10
- package/dist/chat/super-grouping/grouping-function.js +55 -0
- package/dist/chat/super-grouping/grouping-function.js.map +1 -0
- package/dist/chat/super-grouping/index.cjs +26 -0
- package/dist/chat/super-grouping/index.cjs.map +1 -0
- package/dist/chat/super-grouping/index.d.ts +12 -0
- package/dist/chat/super-grouping/index.js +26 -0
- package/dist/chat/super-grouping/index.js.map +1 -0
- package/dist/chat/super-grouping/toolkit-map.cjs +96 -0
- package/dist/chat/super-grouping/toolkit-map.cjs.map +1 -0
- package/dist/chat/super-grouping/toolkit-map.d.ts +8 -1
- package/dist/chat/super-grouping/toolkit-map.js +96 -0
- package/dist/chat/super-grouping/toolkit-map.js.map +1 -0
- package/dist/chat/tiptap-text.cjs +101 -0
- package/dist/chat/tiptap-text.cjs.map +1 -0
- package/dist/chat/tiptap-text.js +101 -0
- package/dist/chat/tiptap-text.js.map +1 -0
- package/dist/chat/tooltip-icon-button.cjs +32 -0
- package/dist/chat/tooltip-icon-button.cjs.map +1 -0
- package/dist/chat/tooltip-icon-button.js +32 -0
- package/dist/chat/tooltip-icon-button.js.map +1 -0
- package/dist/chat/use-athena-run-live.cjs +23 -0
- package/dist/chat/use-athena-run-live.cjs.map +1 -0
- package/dist/chat/use-athena-run-live.d.ts +10 -0
- package/dist/chat/use-athena-run-live.js +23 -0
- package/dist/chat/use-athena-run-live.js.map +1 -0
- package/dist/chat/use-statewire-approval-request.cjs +46 -0
- package/dist/chat/use-statewire-approval-request.cjs.map +1 -0
- package/dist/chat/use-statewire-approval-request.d.ts +44 -0
- package/dist/chat/use-statewire-approval-request.js +46 -0
- package/dist/chat/use-statewire-approval-request.js.map +1 -0
- package/dist/chat-ui/auth/sign-in-card.cjs +128 -0
- package/dist/chat-ui/auth/sign-in-card.cjs.map +1 -0
- package/dist/chat-ui/auth/sign-in-card.js +128 -0
- package/dist/chat-ui/auth/sign-in-card.js.map +1 -0
- package/dist/chat-ui/composer/composer-action.cjs +11 -0
- package/dist/chat-ui/composer/composer-action.cjs.map +1 -0
- package/dist/chat-ui/composer/composer-action.d.ts +5 -8
- package/dist/chat-ui/composer/composer-action.js +11 -0
- package/dist/chat-ui/composer/composer-action.js.map +1 -0
- package/dist/chat-ui/composer/pending-attachment-uploads.cjs +25 -0
- package/dist/chat-ui/composer/pending-attachment-uploads.cjs.map +1 -0
- package/dist/chat-ui/composer/pending-attachment-uploads.js +25 -0
- package/dist/chat-ui/composer/pending-attachment-uploads.js.map +1 -0
- package/dist/chat-ui/composer/tiptap-composer.cjs +590 -0
- package/dist/chat-ui/composer/tiptap-composer.cjs.map +1 -0
- package/dist/chat-ui/composer/tiptap-composer.d.ts +44 -7
- package/dist/chat-ui/composer/tiptap-composer.js +590 -0
- package/dist/chat-ui/composer/tiptap-composer.js.map +1 -0
- package/dist/chat-ui/header/chat-header.cjs +33 -0
- package/dist/chat-ui/header/chat-header.cjs.map +1 -0
- package/dist/chat-ui/header/chat-header.js +33 -0
- package/dist/chat-ui/header/chat-header.js.map +1 -0
- package/dist/chat-ui/header/conversation-history-panel.cjs +369 -0
- package/dist/chat-ui/header/conversation-history-panel.cjs.map +1 -0
- package/dist/chat-ui/header/conversation-history-panel.d.ts +11 -1
- package/dist/chat-ui/header/conversation-history-panel.js +369 -0
- package/dist/chat-ui/header/conversation-history-panel.js.map +1 -0
- package/dist/chat-ui/index.cjs +139 -0
- package/dist/chat-ui/index.cjs.map +1 -0
- package/dist/chat-ui/index.d.ts +11 -4
- package/dist/chat-ui/index.js +139 -0
- package/dist/chat-ui/index.js.map +1 -0
- package/dist/chat-ui/lib/asset-urls.cjs +18 -0
- package/dist/chat-ui/lib/asset-urls.cjs.map +1 -0
- package/dist/chat-ui/lib/asset-urls.js +18 -0
- package/dist/chat-ui/lib/asset-urls.js.map +1 -0
- package/dist/chat-ui/mentions/mention-chip.cjs +208 -0
- package/dist/chat-ui/mentions/mention-chip.cjs.map +1 -0
- package/dist/chat-ui/mentions/mention-chip.js +208 -0
- package/dist/chat-ui/mentions/mention-chip.js.map +1 -0
- package/dist/chat-ui/mentions/mention-extension.cjs +184 -0
- package/dist/chat-ui/mentions/mention-extension.cjs.map +1 -0
- package/dist/chat-ui/mentions/mention-extension.d.ts +24 -2
- package/dist/chat-ui/mentions/mention-extension.js +184 -0
- package/dist/chat-ui/mentions/mention-extension.js.map +1 -0
- package/dist/chat-ui/mentions/suggestions/components/get-scope-name.cjs +35 -0
- package/dist/chat-ui/mentions/suggestions/components/get-scope-name.cjs.map +1 -0
- package/dist/chat-ui/mentions/suggestions/components/get-scope-name.js +35 -0
- package/dist/chat-ui/mentions/suggestions/components/get-scope-name.js.map +1 -0
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.cjs +95 -0
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.cjs.map +1 -0
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.d.ts +5 -0
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.js +95 -0
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.js.map +1 -0
- package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.cjs +116 -0
- package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.cjs.map +1 -0
- package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.js +116 -0
- package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.js.map +1 -0
- package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-popup.cjs +31 -0
- package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-popup.cjs.map +1 -0
- package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-popup.js +31 -0
- package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-popup.js.map +1 -0
- package/dist/chat-ui/mentions/suggestions/components/menu-breadcrumbs.cjs +27 -0
- package/dist/chat-ui/mentions/suggestions/components/menu-breadcrumbs.cjs.map +1 -0
- package/dist/chat-ui/mentions/suggestions/components/menu-breadcrumbs.js +27 -0
- package/dist/chat-ui/mentions/suggestions/components/menu-breadcrumbs.js.map +1 -0
- package/dist/chat-ui/mentions/suggestions/components/menu-item.cjs +62 -0
- package/dist/chat-ui/mentions/suggestions/components/menu-item.cjs.map +1 -0
- package/dist/chat-ui/mentions/suggestions/components/menu-item.js +62 -0
- package/dist/chat-ui/mentions/suggestions/components/menu-item.js.map +1 -0
- package/dist/chat-ui/mentions/suggestions/components/menu-list.cjs +63 -0
- package/dist/chat-ui/mentions/suggestions/components/menu-list.cjs.map +1 -0
- package/dist/chat-ui/mentions/suggestions/components/menu-list.js +63 -0
- package/dist/chat-ui/mentions/suggestions/components/menu-list.js.map +1 -0
- package/dist/chat-ui/mentions/suggestions/components/menu-skeleton.cjs +11 -0
- package/dist/chat-ui/mentions/suggestions/components/menu-skeleton.cjs.map +1 -0
- package/dist/chat-ui/mentions/suggestions/components/menu-skeleton.js +11 -0
- package/dist/chat-ui/mentions/suggestions/components/menu-skeleton.js.map +1 -0
- package/dist/chat-ui/mentions/suggestions/components/menu-summary.cjs +33 -0
- package/dist/chat-ui/mentions/suggestions/components/menu-summary.cjs.map +1 -0
- package/dist/chat-ui/mentions/suggestions/components/menu-summary.js +33 -0
- package/dist/chat-ui/mentions/suggestions/components/menu-summary.js.map +1 -0
- package/dist/chat-ui/mentions/suggestions/components/use-keyboard-navigation.cjs +58 -0
- package/dist/chat-ui/mentions/suggestions/components/use-keyboard-navigation.cjs.map +1 -0
- package/dist/chat-ui/mentions/suggestions/components/use-keyboard-navigation.js +58 -0
- package/dist/chat-ui/mentions/suggestions/components/use-keyboard-navigation.js.map +1 -0
- package/dist/chat-ui/mentions/suggestions/components/use-menu-navigation.cjs +81 -0
- package/dist/chat-ui/mentions/suggestions/components/use-menu-navigation.cjs.map +1 -0
- package/dist/chat-ui/mentions/suggestions/components/use-menu-navigation.js +81 -0
- package/dist/chat-ui/mentions/suggestions/components/use-menu-navigation.js.map +1 -0
- package/dist/chat-ui/mentions/suggestions/components/utils.cjs +18 -0
- package/dist/chat-ui/mentions/suggestions/components/utils.cjs.map +1 -0
- package/dist/chat-ui/mentions/suggestions/components/utils.js +18 -0
- package/dist/chat-ui/mentions/suggestions/components/utils.js.map +1 -0
- package/dist/chat-ui/mentions/suggestions/data/api-client.cjs +123 -0
- package/dist/chat-ui/mentions/suggestions/data/api-client.cjs.map +1 -0
- package/dist/chat-ui/mentions/suggestions/data/api-client.d.ts +10 -0
- package/dist/chat-ui/mentions/suggestions/data/api-client.js +123 -0
- package/dist/chat-ui/mentions/suggestions/data/api-client.js.map +1 -0
- package/dist/chat-ui/mentions/suggestions/data/item-cache.cjs +37 -0
- package/dist/chat-ui/mentions/suggestions/data/item-cache.cjs.map +1 -0
- package/dist/chat-ui/mentions/suggestions/data/item-cache.js +37 -0
- package/dist/chat-ui/mentions/suggestions/data/item-cache.js.map +1 -0
- package/dist/chat-ui/mentions/suggestions/data/orchestrator.cjs +134 -0
- package/dist/chat-ui/mentions/suggestions/data/orchestrator.cjs.map +1 -0
- package/dist/chat-ui/mentions/suggestions/data/orchestrator.js +134 -0
- package/dist/chat-ui/mentions/suggestions/data/orchestrator.js.map +1 -0
- package/dist/chat-ui/mentions/suggestions/data/scope-registry.cjs +91 -0
- package/dist/chat-ui/mentions/suggestions/data/scope-registry.cjs.map +1 -0
- package/dist/chat-ui/mentions/suggestions/data/scope-registry.js +91 -0
- package/dist/chat-ui/mentions/suggestions/data/scope-registry.js.map +1 -0
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.cjs +137 -0
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.cjs.map +1 -0
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.js +137 -0
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.js.map +1 -0
- package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs +375 -0
- package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs.map +1 -0
- package/dist/chat-ui/mentions/suggestions/data/sources/index.d.ts +16 -1
- package/dist/chat-ui/mentions/suggestions/data/sources/index.js +375 -0
- package/dist/chat-ui/mentions/suggestions/data/sources/index.js.map +1 -0
- package/dist/chat-ui/mentions/suggestions/data/types.cjs +9 -0
- package/dist/chat-ui/mentions/suggestions/data/types.cjs.map +1 -0
- package/dist/chat-ui/mentions/suggestions/data/types.d.ts +14 -0
- package/dist/chat-ui/mentions/suggestions/data/types.js +9 -0
- package/dist/chat-ui/mentions/suggestions/data/types.js.map +1 -0
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.cjs +173 -0
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.cjs.map +1 -0
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.d.ts +14 -4
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.js +173 -0
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.js.map +1 -0
- package/dist/chat-ui/mentions/suggestions/data/use-menu-items.cjs +45 -0
- package/dist/chat-ui/mentions/suggestions/data/use-menu-items.cjs.map +1 -0
- package/dist/chat-ui/mentions/suggestions/data/use-menu-items.js +45 -0
- package/dist/chat-ui/mentions/suggestions/data/use-menu-items.js.map +1 -0
- package/dist/chat-ui/mentions/suggestions/data/utils/filter-items.cjs +43 -0
- package/dist/chat-ui/mentions/suggestions/data/utils/filter-items.cjs.map +1 -0
- package/dist/chat-ui/mentions/suggestions/data/utils/filter-items.js +43 -0
- package/dist/chat-ui/mentions/suggestions/data/utils/filter-items.js.map +1 -0
- package/dist/chat-ui/mentions/suggestions/data/utils/match-query.cjs +14 -0
- package/dist/chat-ui/mentions/suggestions/data/utils/match-query.cjs.map +1 -0
- package/dist/chat-ui/mentions/suggestions/data/utils/match-query.js +14 -0
- package/dist/chat-ui/mentions/suggestions/data/utils/match-query.js.map +1 -0
- package/dist/chat-ui/mentions/suggestions/data/utils/score-match.cjs +48 -0
- package/dist/chat-ui/mentions/suggestions/data/utils/score-match.cjs.map +1 -0
- package/dist/chat-ui/mentions/suggestions/data/utils/score-match.js +48 -0
- package/dist/chat-ui/mentions/suggestions/data/utils/score-match.js.map +1 -0
- package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.cjs +71 -0
- package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.cjs.map +1 -0
- package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.js +71 -0
- package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.js.map +1 -0
- package/dist/chat-ui/mentions/suggestions/shims.d.ts +0 -4
- package/dist/chat-ui/messages/continue-pill.cjs +54 -0
- package/dist/chat-ui/messages/continue-pill.cjs.map +1 -0
- package/dist/chat-ui/messages/continue-pill.js +54 -0
- package/dist/chat-ui/messages/continue-pill.js.map +1 -0
- package/dist/chat-ui/messages/message-actions-config.cjs +12 -0
- package/dist/chat-ui/messages/message-actions-config.cjs.map +1 -0
- package/dist/chat-ui/messages/message-actions-config.js +12 -0
- package/dist/chat-ui/messages/message-actions-config.js.map +1 -0
- package/dist/chat-ui/messages/message-components.cjs +343 -0
- package/dist/chat-ui/messages/message-components.cjs.map +1 -0
- package/dist/chat-ui/messages/message-components.d.ts +13 -1
- package/dist/chat-ui/messages/message-components.js +343 -0
- package/dist/chat-ui/messages/message-components.js.map +1 -0
- package/dist/chat-ui/messages/running-indicator.cjs +49 -0
- package/dist/chat-ui/messages/running-indicator.cjs.map +1 -0
- package/dist/chat-ui/messages/running-indicator.js +49 -0
- package/dist/chat-ui/messages/running-indicator.js.map +1 -0
- package/dist/chat-ui/messages/runtime-message.cjs +65 -0
- package/dist/chat-ui/messages/runtime-message.cjs.map +1 -0
- package/dist/chat-ui/messages/runtime-message.d.ts +2 -3
- package/dist/chat-ui/messages/runtime-message.js +65 -0
- package/dist/chat-ui/messages/runtime-message.js.map +1 -0
- package/dist/chat-ui/messages/statewire-continue-run.cjs +154 -0
- package/dist/chat-ui/messages/statewire-continue-run.cjs.map +1 -0
- package/dist/chat-ui/messages/statewire-continue-run.d.ts +52 -7
- package/dist/chat-ui/messages/statewire-continue-run.js +154 -0
- package/dist/chat-ui/messages/statewire-continue-run.js.map +1 -0
- package/dist/chat-ui/messages/user-edit-composer.cjs +61 -0
- package/dist/chat-ui/messages/user-edit-composer.cjs.map +1 -0
- package/dist/chat-ui/messages/user-edit-composer.d.ts +5 -2
- package/dist/chat-ui/messages/user-edit-composer.js +61 -0
- package/dist/chat-ui/messages/user-edit-composer.js.map +1 -0
- package/dist/chat-ui/messages/voice-delegation-card.cjs +51 -0
- package/dist/chat-ui/messages/voice-delegation-card.cjs.map +1 -0
- package/dist/chat-ui/messages/voice-delegation-card.d.ts +26 -0
- package/dist/chat-ui/messages/voice-delegation-card.js +51 -0
- package/dist/chat-ui/messages/voice-delegation-card.js.map +1 -0
- package/dist/chat-ui/statewire.cjs +39 -0
- package/dist/chat-ui/statewire.cjs.map +1 -0
- package/dist/chat-ui/statewire.d.ts +19 -0
- package/dist/chat-ui/statewire.js +39 -0
- package/dist/chat-ui/statewire.js.map +1 -0
- package/dist/chat-ui/thread/chat-composer-dock.cjs +37 -0
- package/dist/chat-ui/thread/chat-composer-dock.cjs.map +1 -0
- package/dist/chat-ui/thread/chat-composer-dock.js +37 -0
- package/dist/chat-ui/thread/chat-composer-dock.js.map +1 -0
- package/dist/chat-ui/thread/chat-thread-shell.cjs +102 -0
- package/dist/chat-ui/thread/chat-thread-shell.cjs.map +1 -0
- package/dist/chat-ui/thread/chat-thread-shell.d.ts +7 -1
- package/dist/chat-ui/thread/chat-thread-shell.js +102 -0
- package/dist/chat-ui/thread/chat-thread-shell.js.map +1 -0
- package/dist/chat-ui/thread/composer-send-or-stop.cjs +75 -0
- package/dist/chat-ui/thread/composer-send-or-stop.cjs.map +1 -0
- package/dist/chat-ui/thread/composer-send-or-stop.d.ts +0 -6
- package/dist/chat-ui/thread/composer-send-or-stop.js +75 -0
- package/dist/chat-ui/thread/composer-send-or-stop.js.map +1 -0
- package/dist/chat-ui/thread/statewire-history-edge.cjs +134 -0
- package/dist/chat-ui/thread/statewire-history-edge.cjs.map +1 -0
- package/dist/chat-ui/thread/statewire-history-edge.d.ts +52 -0
- package/dist/chat-ui/thread/statewire-history-edge.js +134 -0
- package/dist/chat-ui/thread/statewire-history-edge.js.map +1 -0
- package/dist/{collab.cjs → collab/client.cjs} +6 -166
- package/dist/collab/client.cjs.map +1 -0
- package/dist/{collab.js → collab/client.js} +5 -164
- package/dist/collab/client.js.map +1 -0
- package/dist/collab/close-policy.cjs +14 -0
- package/dist/collab/close-policy.cjs.map +1 -0
- package/dist/collab/close-policy.js +14 -0
- package/dist/collab/close-policy.js.map +1 -0
- package/dist/collab/index.cjs +17 -0
- package/dist/collab/index.cjs.map +1 -0
- package/dist/collab/index.js +17 -0
- package/dist/collab/index.js.map +1 -0
- package/dist/collab/mint.cjs +59 -0
- package/dist/collab/mint.cjs.map +1 -0
- package/dist/collab/mint.js +59 -0
- package/dist/collab/mint.js.map +1 -0
- package/dist/collab/react.cjs +58 -0
- package/dist/collab/react.cjs.map +1 -0
- package/dist/collab/react.js +58 -0
- package/dist/collab/react.js.map +1 -0
- package/dist/collab/shape.cjs +45 -0
- package/dist/collab/shape.cjs.map +1 -0
- package/dist/collab/shape.js +45 -0
- package/dist/collab/shape.js.map +1 -0
- package/dist/composer/AttachmentContext.cjs +40 -0
- package/dist/composer/AttachmentContext.cjs.map +1 -0
- package/dist/composer/AttachmentContext.js +40 -0
- package/dist/composer/AttachmentContext.js.map +1 -0
- package/dist/composer/ComposerAttachmentPreview.cjs +39 -0
- package/dist/composer/ComposerAttachmentPreview.cjs.map +1 -0
- package/dist/composer/ComposerAttachmentPreview.js +39 -0
- package/dist/composer/ComposerAttachmentPreview.js.map +1 -0
- package/dist/composer/ComposerDropZone.cjs +61 -0
- package/dist/composer/ComposerDropZone.cjs.map +1 -0
- package/dist/composer/ComposerDropZone.d.ts +1 -1
- package/dist/composer/ComposerDropZone.js +61 -0
- package/dist/composer/ComposerDropZone.js.map +1 -0
- package/dist/composer/ComposerQuotePreview.cjs +42 -0
- package/dist/composer/ComposerQuotePreview.cjs.map +1 -0
- package/dist/composer/ComposerQuotePreview.js +42 -0
- package/dist/composer/ComposerQuotePreview.js.map +1 -0
- package/dist/composer/FileUploadButton.cjs +65 -0
- package/dist/composer/FileUploadButton.cjs.map +1 -0
- package/dist/composer/FileUploadButton.d.ts +1 -1
- package/dist/composer/FileUploadButton.js +65 -0
- package/dist/composer/FileUploadButton.js.map +1 -0
- package/dist/composer/QuoteContext.cjs +68 -0
- package/dist/composer/QuoteContext.cjs.map +1 -0
- package/dist/composer/QuoteContext.js +68 -0
- package/dist/composer/QuoteContext.js.map +1 -0
- package/dist/composer/build-composed-message.cjs +25 -0
- package/dist/composer/build-composed-message.cjs.map +1 -0
- package/dist/composer/build-composed-message.js +25 -0
- package/dist/composer/build-composed-message.js.map +1 -0
- package/dist/composer/clipboard.cjs +62 -0
- package/dist/composer/clipboard.cjs.map +1 -0
- package/dist/composer/clipboard.d.ts +27 -3
- package/dist/composer/clipboard.js +62 -0
- package/dist/composer/clipboard.js.map +1 -0
- package/dist/composer/useAppendToComposer.cjs +21 -0
- package/dist/composer/useAppendToComposer.cjs.map +1 -0
- package/dist/composer/useAppendToComposer.js +21 -0
- package/dist/composer/useAppendToComposer.js.map +1 -0
- package/dist/composer/useAttachFiles.cjs +40 -0
- package/dist/composer/useAttachFiles.cjs.map +1 -0
- package/dist/composer/useAttachFiles.d.ts +24 -0
- package/dist/composer/useAttachFiles.js +40 -0
- package/dist/composer/useAttachFiles.js.map +1 -0
- package/dist/composer/useComposerAttachment.cjs +25 -0
- package/dist/composer/useComposerAttachment.cjs.map +1 -0
- package/dist/composer/useComposerAttachment.js +25 -0
- package/dist/composer/useComposerAttachment.js.map +1 -0
- package/dist/composer/useFileUpload.cjs +123 -0
- package/dist/composer/useFileUpload.cjs.map +1 -0
- package/dist/composer/useFileUpload.js +123 -0
- package/dist/composer/useFileUpload.js.map +1 -0
- package/dist/composer/useSendMessage.cjs +22 -0
- package/dist/composer/useSendMessage.cjs.map +1 -0
- package/dist/composer/useSendMessage.js +22 -0
- package/dist/composer/useSendMessage.js.map +1 -0
- package/dist/diagnostics/athena-diagnostics.cjs +329 -0
- package/dist/diagnostics/athena-diagnostics.cjs.map +1 -0
- package/dist/diagnostics/athena-diagnostics.d.ts +1 -1
- package/dist/diagnostics/athena-diagnostics.js +329 -0
- package/dist/diagnostics/athena-diagnostics.js.map +1 -0
- package/dist/diagnostics/errors.cjs +89 -0
- package/dist/diagnostics/errors.cjs.map +1 -0
- package/dist/diagnostics/errors.d.ts +4 -0
- package/dist/diagnostics/errors.js +89 -0
- package/dist/diagnostics/errors.js.map +1 -0
- package/dist/diagnostics/useAthenaDiagnostics.cjs +16 -0
- package/dist/diagnostics/useAthenaDiagnostics.cjs.map +1 -0
- package/dist/diagnostics/useAthenaDiagnostics.js +16 -0
- package/dist/diagnostics/useAthenaDiagnostics.js.map +1 -0
- package/dist/index.cjs +283 -30852
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +27 -10
- package/dist/index.js +155 -30711
- package/dist/index.js.map +1 -1
- package/dist/lib/athena-urls.cjs +194 -0
- package/dist/lib/athena-urls.cjs.map +1 -0
- package/dist/lib/athena-urls.d.ts +20 -5
- package/dist/lib/athena-urls.js +194 -0
- package/dist/lib/athena-urls.js.map +1 -0
- package/dist/lib/posthog/before-send.cjs +58 -0
- package/dist/lib/posthog/before-send.cjs.map +1 -0
- package/dist/lib/posthog/before-send.js +58 -0
- package/dist/lib/posthog/before-send.js.map +1 -0
- package/dist/lib/posthog/capture-gate.cjs +322 -0
- package/dist/lib/posthog/capture-gate.cjs.map +1 -0
- package/dist/lib/posthog/capture-gate.js +322 -0
- package/dist/lib/posthog/capture-gate.js.map +1 -0
- package/dist/lib/posthog/wrap-posthog-client.cjs +163 -0
- package/dist/lib/posthog/wrap-posthog-client.cjs.map +1 -0
- package/dist/lib/posthog/wrap-posthog-client.js +163 -0
- package/dist/lib/posthog/wrap-posthog-client.js.map +1 -0
- package/dist/lib/utils.cjs +12 -0
- package/dist/lib/utils.cjs.map +1 -0
- package/dist/lib/utils.js +9 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/node_modules/@assistant-ui/react-langchain/dist/converter.cjs +77 -0
- package/dist/node_modules/@assistant-ui/react-langchain/dist/converter.cjs.map +1 -0
- package/dist/node_modules/@assistant-ui/react-langchain/dist/converter.js +77 -0
- package/dist/node_modules/@assistant-ui/react-langchain/dist/converter.js.map +1 -0
- package/dist/node_modules/@assistant-ui/react-langgraph/dist/convertLangChainMessages.cjs +181 -0
- package/dist/node_modules/@assistant-ui/react-langgraph/dist/convertLangChainMessages.cjs.map +1 -0
- package/dist/node_modules/@assistant-ui/react-langgraph/dist/convertLangChainMessages.js +181 -0
- package/dist/node_modules/@assistant-ui/react-langgraph/dist/convertLangChainMessages.js.map +1 -0
- package/dist/packages/agent-runtime/src/asset-attachment.cjs +19 -0
- package/dist/packages/agent-runtime/src/asset-attachment.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/asset-attachment.js +19 -0
- package/dist/packages/agent-runtime/src/asset-attachment.js.map +1 -0
- package/dist/packages/agent-runtime/src/auth-denial.cjs +28 -0
- package/dist/packages/agent-runtime/src/auth-denial.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/auth-denial.js +28 -0
- package/dist/packages/agent-runtime/src/auth-denial.js.map +1 -0
- package/dist/packages/agent-runtime/src/client-tool-bridge.cjs +270 -0
- package/dist/packages/agent-runtime/src/client-tool-bridge.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/client-tool-bridge.js +270 -0
- package/dist/packages/agent-runtime/src/client-tool-bridge.js.map +1 -0
- package/dist/packages/agent-runtime/src/client-tools.cjs +137 -0
- package/dist/packages/agent-runtime/src/client-tools.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/client-tools.js +137 -0
- package/dist/packages/agent-runtime/src/client-tools.js.map +1 -0
- package/dist/packages/agent-runtime/src/conversation-index.cjs +80 -0
- package/dist/packages/agent-runtime/src/conversation-index.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/conversation-index.js +80 -0
- package/dist/packages/agent-runtime/src/conversation-index.js.map +1 -0
- package/dist/packages/agent-runtime/src/conversation-list.cjs +86 -0
- package/dist/packages/agent-runtime/src/conversation-list.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/conversation-list.js +86 -0
- package/dist/packages/agent-runtime/src/conversation-list.js.map +1 -0
- package/dist/packages/agent-runtime/src/deep-agent-transport-recipe.cjs +55 -0
- package/dist/packages/agent-runtime/src/deep-agent-transport-recipe.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/deep-agent-transport-recipe.js +55 -0
- package/dist/packages/agent-runtime/src/deep-agent-transport-recipe.js.map +1 -0
- package/dist/packages/agent-runtime/src/edit-command.cjs +89 -0
- package/dist/packages/agent-runtime/src/edit-command.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/edit-command.js +89 -0
- package/dist/packages/agent-runtime/src/edit-command.js.map +1 -0
- package/dist/packages/agent-runtime/src/errors.cjs +95 -0
- package/dist/packages/agent-runtime/src/errors.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/errors.js +95 -0
- package/dist/packages/agent-runtime/src/errors.js.map +1 -0
- package/dist/packages/agent-runtime/src/generated/runconfig-contract.cjs +236 -0
- package/dist/packages/agent-runtime/src/generated/runconfig-contract.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/generated/runconfig-contract.js +236 -0
- package/dist/packages/agent-runtime/src/generated/runconfig-contract.js.map +1 -0
- package/dist/packages/agent-runtime/src/interrupts.cjs +117 -0
- package/dist/packages/agent-runtime/src/interrupts.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/interrupts.js +117 -0
- package/dist/packages/agent-runtime/src/interrupts.js.map +1 -0
- package/dist/packages/agent-runtime/src/message-author.cjs +31 -0
- package/dist/packages/agent-runtime/src/message-author.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/message-author.js +31 -0
- package/dist/packages/agent-runtime/src/message-author.js.map +1 -0
- package/dist/packages/agent-runtime/src/message-window.cjs +85 -0
- package/dist/packages/agent-runtime/src/message-window.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/message-window.js +85 -0
- package/dist/packages/agent-runtime/src/message-window.js.map +1 -0
- package/dist/packages/agent-runtime/src/messages.cjs +433 -0
- package/dist/packages/agent-runtime/src/messages.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/messages.js +433 -0
- package/dist/packages/agent-runtime/src/messages.js.map +1 -0
- package/dist/packages/agent-runtime/src/model-context.cjs +13 -0
- package/dist/packages/agent-runtime/src/model-context.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/model-context.js +13 -0
- package/dist/packages/agent-runtime/src/model-context.js.map +1 -0
- package/dist/packages/agent-runtime/src/optimistic-content.cjs +17 -0
- package/dist/packages/agent-runtime/src/optimistic-content.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/optimistic-content.js +17 -0
- package/dist/packages/agent-runtime/src/optimistic-content.js.map +1 -0
- package/dist/packages/agent-runtime/src/protocol.cjs +33 -0
- package/dist/packages/agent-runtime/src/protocol.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/protocol.js +33 -0
- package/dist/packages/agent-runtime/src/protocol.js.map +1 -0
- package/dist/packages/agent-runtime/src/queue.cjs +67 -0
- package/dist/packages/agent-runtime/src/queue.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/queue.js +67 -0
- package/dist/packages/agent-runtime/src/queue.js.map +1 -0
- package/dist/packages/agent-runtime/src/quota-safe-local-storage-session.cjs +47 -0
- package/dist/packages/agent-runtime/src/quota-safe-local-storage-session.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/quota-safe-local-storage-session.js +47 -0
- package/dist/packages/agent-runtime/src/quota-safe-local-storage-session.js.map +1 -0
- package/dist/packages/agent-runtime/src/runtime-messages.cjs +187 -0
- package/dist/packages/agent-runtime/src/runtime-messages.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/runtime-messages.js +187 -0
- package/dist/packages/agent-runtime/src/runtime-messages.js.map +1 -0
- package/dist/packages/agent-runtime/src/send-recovery.cjs +128 -0
- package/dist/packages/agent-runtime/src/send-recovery.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/send-recovery.js +128 -0
- package/dist/packages/agent-runtime/src/send-recovery.js.map +1 -0
- package/dist/packages/agent-runtime/src/statewire-attach-observer.cjs +249 -0
- package/dist/packages/agent-runtime/src/statewire-attach-observer.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/statewire-attach-observer.js +249 -0
- package/dist/packages/agent-runtime/src/statewire-attach-observer.js.map +1 -0
- package/dist/packages/agent-runtime/src/statewire-state.cjs +16 -0
- package/dist/packages/agent-runtime/src/statewire-state.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/statewire-state.js +16 -0
- package/dist/packages/agent-runtime/src/statewire-state.js.map +1 -0
- package/dist/packages/agent-runtime/src/statewire-suspended.cjs +41 -0
- package/dist/packages/agent-runtime/src/statewire-suspended.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/statewire-suspended.js +41 -0
- package/dist/packages/agent-runtime/src/statewire-suspended.js.map +1 -0
- package/dist/packages/agent-runtime/src/statewire-transport.cjs +6 -0
- package/dist/packages/agent-runtime/src/statewire-transport.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/statewire-transport.js +6 -0
- package/dist/packages/agent-runtime/src/statewire-transport.js.map +1 -0
- package/dist/packages/agent-runtime/src/streaming-markdown.cjs +214 -0
- package/dist/packages/agent-runtime/src/streaming-markdown.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/streaming-markdown.js +214 -0
- package/dist/packages/agent-runtime/src/streaming-markdown.js.map +1 -0
- package/dist/packages/agent-runtime/src/thread-extras.cjs +38 -0
- package/dist/packages/agent-runtime/src/thread-extras.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/thread-extras.js +38 -0
- package/dist/packages/agent-runtime/src/thread-extras.js.map +1 -0
- package/dist/packages/agent-runtime/src/thread-snapshot-cache.cjs +90 -0
- package/dist/packages/agent-runtime/src/thread-snapshot-cache.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/thread-snapshot-cache.js +90 -0
- package/dist/packages/agent-runtime/src/thread-snapshot-cache.js.map +1 -0
- package/dist/packages/agent-runtime/src/thread-status.cjs +49 -0
- package/dist/packages/agent-runtime/src/thread-status.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/thread-status.js +49 -0
- package/dist/packages/agent-runtime/src/thread-status.js.map +1 -0
- package/dist/packages/agent-runtime/src/tool-metadata.cjs +1802 -0
- package/dist/packages/agent-runtime/src/tool-metadata.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/tool-metadata.js +1802 -0
- package/dist/packages/agent-runtime/src/tool-metadata.js.map +1 -0
- package/dist/packages/agent-runtime/src/tool-outputs.cjs +46 -0
- package/dist/packages/agent-runtime/src/tool-outputs.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/tool-outputs.js +46 -0
- package/dist/packages/agent-runtime/src/tool-outputs.js.map +1 -0
- package/dist/packages/agent-runtime/src/tool-result.cjs +151 -0
- package/dist/packages/agent-runtime/src/tool-result.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/tool-result.js +151 -0
- package/dist/packages/agent-runtime/src/tool-result.js.map +1 -0
- package/dist/packages/agent-runtime/src/use-conversation-list.cjs +139 -0
- package/dist/packages/agent-runtime/src/use-conversation-list.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/use-conversation-list.js +139 -0
- package/dist/packages/agent-runtime/src/use-conversation-list.js.map +1 -0
- package/dist/packages/agent-runtime/src/use-deep-agent-edit-submit.cjs +28 -0
- package/dist/packages/agent-runtime/src/use-deep-agent-edit-submit.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/use-deep-agent-edit-submit.js +28 -0
- package/dist/packages/agent-runtime/src/use-deep-agent-edit-submit.js.map +1 -0
- package/dist/packages/agent-runtime/src/use-deep-agent-runtime.cjs +138 -0
- package/dist/packages/agent-runtime/src/use-deep-agent-runtime.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/use-deep-agent-runtime.js +138 -0
- package/dist/packages/agent-runtime/src/use-deep-agent-runtime.js.map +1 -0
- package/dist/packages/agent-runtime/src/use-deep-agent-thread.cjs +387 -0
- package/dist/packages/agent-runtime/src/use-deep-agent-thread.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/use-deep-agent-thread.js +387 -0
- package/dist/packages/agent-runtime/src/use-deep-agent-thread.js.map +1 -0
- package/dist/packages/agent-runtime/src/use-deep-agent-window-sync.cjs +133 -0
- package/dist/packages/agent-runtime/src/use-deep-agent-window-sync.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/use-deep-agent-window-sync.js +133 -0
- package/dist/packages/agent-runtime/src/use-deep-agent-window-sync.js.map +1 -0
- package/dist/packages/agent-runtime/src/voice-presentation.cjs +37 -0
- package/dist/packages/agent-runtime/src/voice-presentation.cjs.map +1 -0
- package/dist/packages/agent-runtime/src/voice-presentation.js +37 -0
- package/dist/packages/agent-runtime/src/voice-presentation.js.map +1 -0
- package/dist/packages/react/package.json.cjs +9 -0
- package/dist/packages/react/package.json.cjs.map +1 -0
- package/dist/packages/react/package.json.js +9 -0
- package/dist/packages/react/package.json.js.map +1 -0
- package/dist/{AthenaContext-B1QMhIP-.cjs → provider/AthenaContext.cjs} +5 -4
- package/dist/provider/AthenaContext.cjs.map +1 -0
- package/dist/{AthenaContext-MOslgOmE.js → provider/AthenaContext.js} +3 -3
- package/dist/provider/AthenaContext.js.map +1 -0
- package/dist/provider/AthenaProvider.cjs +403 -0
- package/dist/provider/AthenaProvider.cjs.map +1 -0
- package/dist/provider/AthenaProvider.d.ts +4 -2
- package/dist/provider/AthenaProvider.js +403 -0
- package/dist/provider/AthenaProvider.js.map +1 -0
- package/dist/provider/PostHogProvider.cjs +81 -0
- package/dist/provider/PostHogProvider.cjs.map +1 -0
- package/dist/provider/PostHogProvider.js +59 -0
- package/dist/provider/PostHogProvider.js.map +1 -0
- package/dist/provider/config.d.ts +17 -9
- package/dist/provider/statewire-lifecycle-context.cjs +10 -0
- package/dist/provider/statewire-lifecycle-context.cjs.map +1 -0
- package/dist/provider/statewire-lifecycle-context.js +10 -0
- package/dist/provider/statewire-lifecycle-context.js.map +1 -0
- package/dist/provider/statewire-window-context.cjs +10 -0
- package/dist/provider/statewire-window-context.cjs.map +1 -0
- package/dist/provider/statewire-window-context.d.ts +12 -0
- package/dist/provider/statewire-window-context.js +10 -0
- package/dist/provider/statewire-window-context.js.map +1 -0
- package/dist/runtime/auth.cjs +309 -0
- package/dist/runtime/auth.cjs.map +1 -0
- package/dist/runtime/auth.d.ts +19 -18
- package/dist/runtime/auth.js +309 -0
- package/dist/runtime/auth.js.map +1 -0
- package/dist/runtime/statewire-auth-headers.cjs +18 -0
- package/dist/runtime/statewire-auth-headers.cjs.map +1 -0
- package/dist/runtime/statewire-auth-headers.d.ts +38 -0
- package/dist/runtime/statewire-auth-headers.js +18 -0
- package/dist/runtime/statewire-auth-headers.js.map +1 -0
- package/dist/runtime/statewire-lifecycle.cjs +67 -0
- package/dist/runtime/statewire-lifecycle.cjs.map +1 -0
- package/dist/runtime/statewire-lifecycle.d.ts +25 -0
- package/dist/runtime/statewire-lifecycle.js +67 -0
- package/dist/runtime/statewire-lifecycle.js.map +1 -0
- package/dist/runtime/statewire-run-config.cjs +68 -0
- package/dist/runtime/statewire-run-config.cjs.map +1 -0
- package/dist/runtime/statewire-run-config.js +68 -0
- package/dist/runtime/statewire-run-config.js.map +1 -0
- package/dist/runtime/statewire-session-key.cjs +11 -0
- package/dist/runtime/statewire-session-key.cjs.map +1 -0
- package/dist/runtime/statewire-session-key.d.ts +13 -0
- package/dist/runtime/statewire-session-key.js +11 -0
- package/dist/runtime/statewire-session-key.js.map +1 -0
- package/dist/runtime/useAthenaStatewireRuntime.cjs +179 -0
- package/dist/runtime/useAthenaStatewireRuntime.cjs.map +1 -0
- package/dist/runtime/useAthenaStatewireRuntime.d.ts +36 -5
- package/dist/runtime/useAthenaStatewireRuntime.js +180 -0
- package/dist/runtime/useAthenaStatewireRuntime.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/theme/index.cjs +182 -0
- package/dist/theme/index.cjs.map +1 -0
- package/dist/theme/index.js +182 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/threads/ThreadList.cjs +55 -0
- package/dist/threads/ThreadList.cjs.map +1 -0
- package/dist/threads/ThreadList.js +55 -0
- package/dist/threads/ThreadList.js.map +1 -0
- package/dist/threads/api.cjs +208 -0
- package/dist/threads/api.cjs.map +1 -0
- package/dist/threads/api.js +208 -0
- package/dist/threads/api.js.map +1 -0
- package/dist/threads/conversation-list-fetcher.cjs +70 -0
- package/dist/threads/conversation-list-fetcher.cjs.map +1 -0
- package/dist/threads/conversation-list-fetcher.js +70 -0
- package/dist/threads/conversation-list-fetcher.js.map +1 -0
- package/dist/threads/mint-thread-id.cjs +7 -0
- package/dist/threads/mint-thread-id.cjs.map +1 -0
- package/dist/threads/mint-thread-id.d.ts +8 -0
- package/dist/threads/mint-thread-id.js +7 -0
- package/dist/threads/mint-thread-id.js.map +1 -0
- package/dist/threads/statewire-thread-list.cjs +231 -0
- package/dist/threads/statewire-thread-list.cjs.map +1 -0
- package/dist/threads/statewire-thread-list.d.ts +20 -4
- package/dist/threads/statewire-thread-list.js +231 -0
- package/dist/threads/statewire-thread-list.js.map +1 -0
- package/dist/threads/thread-id-context.cjs +22 -0
- package/dist/threads/thread-id-context.cjs.map +1 -0
- package/dist/threads/thread-id-context.d.ts +9 -0
- package/dist/threads/thread-id-context.js +22 -0
- package/dist/threads/thread-id-context.js.map +1 -0
- package/dist/threads/title.cjs +95 -0
- package/dist/threads/title.cjs.map +1 -0
- package/dist/threads/title.js +95 -0
- package/dist/threads/title.js.map +1 -0
- package/dist/threads/use-rest-conversation-history.cjs +79 -0
- package/dist/threads/use-rest-conversation-history.cjs.map +1 -0
- package/dist/threads/use-rest-conversation-history.js +79 -0
- package/dist/threads/use-rest-conversation-history.js.map +1 -0
- package/dist/threads/use-statewire-conversation-history.cjs +243 -0
- package/dist/threads/use-statewire-conversation-history.cjs.map +1 -0
- package/dist/threads/use-statewire-conversation-history.js +243 -0
- package/dist/threads/use-statewire-conversation-history.js.map +1 -0
- package/dist/threads/useAthenaThreadManager.cjs +24 -0
- package/dist/threads/useAthenaThreadManager.cjs.map +1 -0
- package/dist/threads/useAthenaThreadManager.js +24 -0
- package/dist/threads/useAthenaThreadManager.js.map +1 -0
- package/dist/toolkits/index.cjs +279 -0
- package/dist/toolkits/index.cjs.map +1 -0
- package/dist/toolkits/index.js +279 -0
- package/dist/toolkits/index.js.map +1 -0
- package/dist/tools/NestedPtcMessages.cjs +46 -0
- package/dist/tools/NestedPtcMessages.cjs.map +1 -0
- package/dist/tools/NestedPtcMessages.js +46 -0
- package/dist/tools/NestedPtcMessages.js.map +1 -0
- package/dist/tools/append-document-tool-ui.cjs +145 -0
- package/dist/tools/append-document-tool-ui.cjs.map +1 -0
- package/dist/tools/append-document-tool-ui.js +145 -0
- package/dist/tools/append-document-tool-ui.js.map +1 -0
- package/dist/tools/asset-utils.cjs +16 -0
- package/dist/tools/asset-utils.cjs.map +1 -0
- package/dist/tools/asset-utils.js +16 -0
- package/dist/tools/asset-utils.js.map +1 -0
- package/dist/tools/auto-open-tools.cjs +121 -0
- package/dist/tools/auto-open-tools.cjs.map +1 -0
- package/dist/tools/auto-open-tools.js +121 -0
- package/dist/tools/auto-open-tools.js.map +1 -0
- package/dist/tools/file-tool-uis.cjs +108 -0
- package/dist/tools/file-tool-uis.cjs.map +1 -0
- package/dist/tools/file-tool-uis.js +108 -0
- package/dist/tools/file-tool-uis.js.map +1 -0
- package/dist/tools/index.cjs +56 -0
- package/dist/tools/index.cjs.map +1 -0
- package/dist/tools/index.d.ts +15 -0
- package/dist/tools/index.js +56 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/misc-tool-uis.cjs +54 -0
- package/dist/tools/misc-tool-uis.cjs.map +1 -0
- package/dist/tools/misc-tool-uis.d.ts +2 -0
- package/dist/tools/misc-tool-uis.js +54 -0
- package/dist/tools/misc-tool-uis.js.map +1 -0
- package/dist/tools/primitives.cjs +166 -0
- package/dist/tools/primitives.cjs.map +1 -0
- package/dist/tools/primitives.d.ts +41 -0
- package/dist/tools/primitives.js +166 -0
- package/dist/tools/primitives.js.map +1 -0
- package/dist/tools/read-asset-tool-ui.cjs +284 -0
- package/dist/tools/read-asset-tool-ui.cjs.map +1 -0
- package/dist/tools/read-asset-tool-ui.js +284 -0
- package/dist/tools/read-asset-tool-ui.js.map +1 -0
- package/dist/tools/todo-plan-store.cjs +88 -0
- package/dist/tools/todo-plan-store.cjs.map +1 -0
- package/dist/tools/todo-plan-store.js +88 -0
- package/dist/tools/todo-plan-store.js.map +1 -0
- package/dist/tools/tool-fallback.cjs +667 -0
- package/dist/tools/tool-fallback.cjs.map +1 -0
- package/dist/tools/tool-fallback.d.ts +78 -6
- package/dist/tools/tool-fallback.js +667 -0
- package/dist/tools/tool-fallback.js.map +1 -0
- package/dist/tools/tool-icons.cjs +61 -0
- package/dist/tools/tool-icons.cjs.map +1 -0
- package/dist/tools/tool-icons.d.ts +10 -0
- package/dist/tools/tool-icons.js +61 -0
- package/dist/tools/tool-icons.js.map +1 -0
- package/dist/tools/tool-uis.cjs +3049 -0
- package/dist/tools/tool-uis.cjs.map +1 -0
- package/dist/tools/tool-uis.d.ts +1 -23
- package/dist/tools/tool-uis.js +3049 -0
- package/dist/tools/tool-uis.js.map +1 -0
- package/dist/tools/voice-update-tool-ui.cjs +89 -0
- package/dist/tools/voice-update-tool-ui.cjs.map +1 -0
- package/dist/tools/voice-update-tool-ui.d.ts +27 -0
- package/dist/tools/voice-update-tool-ui.js +89 -0
- package/dist/tools/voice-update-tool-ui.js.map +1 -0
- package/dist/tools/write-todos-tool-ui.cjs +270 -0
- package/dist/tools/write-todos-tool-ui.cjs.map +1 -0
- package/dist/tools/write-todos-tool-ui.js +270 -0
- package/dist/tools/write-todos-tool-ui.js.map +1 -0
- package/dist/ui/button.cjs +57 -0
- package/dist/ui/button.cjs.map +1 -0
- package/dist/ui/button.js +57 -0
- package/dist/ui/button.js.map +1 -0
- package/dist/ui/collapsible.cjs +17 -0
- package/dist/ui/collapsible.cjs.map +1 -0
- package/dist/ui/collapsible.js +17 -0
- package/dist/ui/collapsible.js.map +1 -0
- package/dist/ui/tooltip.cjs +48 -0
- package/dist/ui/tooltip.cjs.map +1 -0
- package/dist/ui/tooltip.js +48 -0
- package/dist/ui/tooltip.js.map +1 -0
- package/dist/version.cjs +6 -0
- package/dist/version.cjs.map +1 -0
- package/dist/version.js +6 -0
- package/dist/version.js.map +1 -0
- package/package.json +35 -19
- package/dist/AthenaAuthContext-B3AwLA5Z.cjs.map +0 -1
- package/dist/AthenaAuthContext-DQsdayH2.js.map +0 -1
- package/dist/AthenaContext-B1QMhIP-.cjs.map +0 -1
- package/dist/AthenaContext-MOslgOmE.js.map +0 -1
- package/dist/auth.cjs.map +0 -1
- package/dist/auth.js.map +0 -1
- package/dist/chat/ComposerEditorContext.d.ts +0 -36
- package/dist/chat/super-grouping/tool-status-labels.d.ts +0 -1
- package/dist/chat/tiptap-composer.d.ts +0 -7
- package/dist/chat-ui.cjs +0 -2667
- package/dist/chat-ui.cjs.map +0 -1
- package/dist/chat-ui.js +0 -2668
- package/dist/chat-ui.js.map +0 -1
- package/dist/collab.cjs.map +0 -1
- package/dist/collab.js.map +0 -1
- package/dist/mentions/composer-keybinds.d.ts +0 -5
- package/dist/mentions/mention-extension.d.ts +0 -6
- package/dist/mentions/mention-icons.d.ts +0 -4
- package/dist/mentions/mention-node-view.d.ts +0 -2
- package/dist/mentions/mention-suggestion-list.d.ts +0 -14
- package/dist/mentions/mention-suggestion-popup.d.ts +0 -15
- package/dist/mentions/mention-suggestions-extension.d.ts +0 -11
- package/dist/mentions/mention-types.d.ts +0 -21
- package/dist/mentions/mention-utils.d.ts +0 -23
- package/dist/mentions/use-mention-suggestions.d.ts +0 -29
- package/dist/use-rest-conversation-history-Bs5qn5G3.js +0 -37322
- package/dist/use-rest-conversation-history-Bs5qn5G3.js.map +0 -1
- package/dist/use-rest-conversation-history-Dm0rdQgT.cjs +0 -37358
- package/dist/use-rest-conversation-history-Dm0rdQgT.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-deep-agent-window-sync.cjs","sources":["../../../../../agent-runtime/src/use-deep-agent-window-sync.ts"],"sourcesContent":["import { useStatewireSendCommand, useStatewireState } from '@assistant-ui/react-statewire';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { DEEP_AGENT_MESSAGES_WINDOW_STATE_KEY } from './generated/runconfig-contract';\nimport {\n buildHistoryLoadCommand,\n buildToolOutputCommand,\n type DeepAgentMessagesWindow,\n type HistoryLoadResult,\n readDeepAgentMessagesWindow,\n readHistoryLoadResult,\n readToolOutputResult,\n readTruncatedToolOutputArtifact,\n} from './message-window';\nimport type { DeepAgentToolOutputStore } from './tool-outputs';\n\n/**\n * Pages of older history chained per approach to the top. A renderer lowers\n * its near-top level once prepended content has pushed the first message out\n * of its band; this bounds the case where it cannot (no viewport to scroll,\n * a list too short to overflow) so a 2,000-message thread never streams whole.\n */\nexport const DEEP_AGENT_MAX_CHAINED_HISTORY_LOADS = 3;\n\n/** The converted thread messages the tool-output half scans (web and native `ThreadMessage` both satisfy it). */\nexport interface DeepAgentWindowSyncMessage {\n readonly id: string;\n readonly content: readonly { readonly type: string; readonly artifact?: unknown }[];\n}\n\n/** One `history/load` round trip, for the host's telemetry. */\nexport interface DeepAgentHistoryLoadEvent {\n beforeIndex: number;\n limit: number;\n /** The host's answer, or `null` when it was not a history-load result. */\n result: HistoryLoadResult | null;\n durationMs: number;\n}\n\nexport interface UseDeepAgentWindowSyncOptions {\n /**\n * The converted thread messages — read by the host through its platform\n * `useAuiState((s) => s.thread.messages)`, so this hook imports neither\n * `@assistant-ui/react` nor `@assistant-ui/react-native`.\n */\n messages: readonly DeepAgentWindowSyncMessage[];\n /**\n * Full tool outputs fetched back for cut tool messages; the same store the\n * thread converts with (`useDeepAgentThread({ toolOutputs })`). Omitted, the\n * tool-output half is inert (a surface that never shows a cut output whole).\n */\n toolOutputs?: DeepAgentToolOutputStore | undefined;\n /**\n * The renderer's report that the top of the LOADED history is near — a\n * level, not an edge: while it holds and older messages exist, pages load\n * one after another (bounded by `maxChainedLoads` per approach). Omitted for\n * hosts with only a manual affordance (`loadOlder`).\n */\n nearTop?: boolean;\n /** Bumped on every rise of `nearTop` (and every explicit request), so the chain bound is per approach. */\n nearTopEpoch?: number;\n /**\n * Whether a message's content is mounted right now, so lazy fetches (cut\n * tool outputs) target what the user can see rather than the whole loaded\n * history. Omitted: every message counts as mounted (the flat renderers).\n */\n isMessageMounted?: ((messageId: string) => boolean) | undefined;\n maxChainedLoads?: number;\n /** A `history/load` settled (telemetry). */\n onHistoryLoad?: ((event: DeepAgentHistoryLoadEvent) => void) | undefined;\n /** A read command failed; the sync itself recovers (the pending marks are released). */\n onError?: ((error: unknown, command: 'history/load' | 'history/tool_output') => void) | undefined;\n now?: () => number;\n}\n\nexport interface DeepAgentWindowSyncState {\n /** The lane, or `null` on a wire that is not windowed (both halves are inert). */\n window: DeepAgentMessagesWindow | null;\n /** Messages older than the loaded window the server still holds. */\n olderCount: number;\n /** A page of older history is in flight. */\n loading: boolean;\n /** Ask for the next page of older history now (an edge row's button, a keypress). A no-op on a wire that is not windowed or at the beginning. */\n loadOlder: () => void;\n}\n\n/** The raw lane, selected without derivation (selectors compare by identity). */\nfunction selectMessagesWindowLane(state: unknown): unknown {\n return typeof state === 'object' && state !== null\n ? (state as Record<string, unknown>)[DEEP_AGENT_MESSAGES_WINDOW_STATE_KEY]\n : undefined;\n}\n\n/** The `messagesWindow` lane of the nearest statewire thread, or `null` when the wire is not windowed. */\nexport function useDeepAgentMessagesWindow(): DeepAgentMessagesWindow | null {\n const lane = useStatewireState(selectMessagesWindowLane);\n return useMemo(\n () => readDeepAgentMessagesWindow({ [DEEP_AGENT_MESSAGES_WINDOW_STATE_KEY]: lane }),\n [lane]\n );\n}\n\nconst everyMessageMounted = (): boolean => true;\nconst defaultNow = (): number => Date.now();\n\n/**\n * The client half of the windowed wire, shared by every surface that declares\n * a message window (`useDeepAgentThread({ messageWindow })`) — mounted once\n * per runtime, inside its aui provider.\n *\n * - **Older history.** While the host renderer reports the top of the loaded\n * history near (`nearTop`) and the `messagesWindow` lane says older\n * messages exist, this sends `history/load` for the next page — the host\n * prepends it as ops for this client alone — chaining at most\n * `maxChainedLoads` pages per approach; `loadOlder` asks for one page on\n * demand (an edge row's button). Never two loads in flight.\n * - **Cut tool outputs.** Tool cards whose output the wire carried cut\n * (`artifact._athena_content_truncated`) get it fetched whole through\n * `history/tool_output` once their message is mounted; the converter puts\n * it back (`toolOutputs`), so the card re-renders complete. An output the\n * host replaced since (the marker's `chars` changed) is fetched again.\n *\n * On a thread whose wire is not windowed (no lane) both halves are inert.\n */\nexport function useDeepAgentWindowSync({\n messages,\n toolOutputs,\n nearTop = false,\n nearTopEpoch = 0,\n isMessageMounted = everyMessageMounted,\n maxChainedLoads = DEEP_AGENT_MAX_CHAINED_HISTORY_LOADS,\n onHistoryLoad,\n onError,\n now = defaultNow,\n}: UseDeepAgentWindowSyncOptions): DeepAgentWindowSyncState {\n const sendCommand = useStatewireSendCommand();\n const window = useDeepAgentMessagesWindow();\n const [loading, setLoading] = useState(false);\n const [requests, setRequests] = useState(0);\n // Bumped when a page settled AFTER its ops moved the lane (the host's\n // order: prepend, then answer), so the chain re-evaluates against the moved\n // window instead of waiting for another signal.\n const [settledLoads, setSettledLoads] = useState(0);\n const servedRequestsRef = useRef(0);\n const inflightRef = useRef<number | null>(null);\n const chainRef = useRef({ epoch: 0, loads: 0 });\n const aliveRef = useRef(true);\n const windowRef = useRef(window);\n windowRef.current = window;\n // Outputs already asked for and answered by this mount — fetched, refused,\n // or failed — by the `chars` they were asked for. The converter re-runs on\n // every wire change, and the store is a bounded LRU: without this memory a\n // refused read would leave on every pass, and once a transcript holds more\n // cut outputs than the store retains, each fetch would evict a still-loaded\n // output and the next pass would fetch it again, forever. An evicted output\n // renders its cut text (the REST display limit) rather than re-entering the\n // loop; a marker whose `chars` moved (the host replaced the output) is asked\n // for again.\n const answeredRef = useRef(new Map<string, number>());\n const onHistoryLoadRef = useRef(onHistoryLoad);\n onHistoryLoadRef.current = onHistoryLoad;\n const onErrorRef = useRef(onError);\n onErrorRef.current = onError;\n const nowRef = useRef(now);\n nowRef.current = now;\n useEffect(() => {\n aliveRef.current = true;\n return () => {\n aliveRef.current = false;\n };\n }, []);\n\n useEffect(() => {\n if (window === null || window.start === 0 || inflightRef.current !== null) return;\n const requested = requests !== servedRequestsRef.current;\n if (requested) {\n // An explicit ask re-arms the chain for this approach.\n servedRequestsRef.current = requests;\n chainRef.current = { epoch: nearTopEpoch, loads: 1 };\n } else {\n if (!nearTop) return;\n if (chainRef.current.epoch !== nearTopEpoch) {\n chainRef.current = { epoch: nearTopEpoch, loads: 0 };\n }\n if (chainRef.current.loads >= maxChainedLoads) return;\n chainRef.current.loads += 1;\n }\n const command = buildHistoryLoadCommand({ window });\n if (command === null) return;\n inflightRef.current = command.beforeIndex;\n setLoading(true);\n const startedAt = nowRef.current();\n Promise.resolve(sendCommand(command))\n .then((payload) => {\n onHistoryLoadRef.current?.({\n beforeIndex: command.beforeIndex,\n limit: command.limit,\n result: readHistoryLoadResult(payload),\n durationMs: Math.max(0, Math.round(nowRef.current() - startedAt)),\n });\n })\n .catch((error: unknown) => {\n onErrorRef.current?.(error, 'history/load');\n })\n .finally(() => {\n inflightRef.current = null;\n if (!aliveRef.current) return;\n setLoading(false);\n if (windowRef.current?.start !== command.beforeIndex) {\n setSettledLoads((count) => count + 1);\n }\n });\n }, [nearTop, nearTopEpoch, requests, settledLoads, window, sendCommand, maxChainedLoads]);\n\n useEffect(() => {\n if (window === null || toolOutputs === undefined) return;\n for (const message of messages) {\n if (!isMessageMounted(message.id)) continue;\n for (const part of message.content) {\n if (part.type !== 'tool-call') continue;\n const marker = readTruncatedToolOutputArtifact(part.artifact);\n if (marker === null || toolOutputs.isPending(marker.messageId)) continue;\n // Fetched for this very length already; a different length means the\n // host replaced the output under the same id since.\n if (toolOutputs.entry(marker.messageId)?.chars === marker.chars) continue;\n if (answeredRef.current.get(marker.messageId) === marker.chars) continue;\n const { messageId, chars } = marker;\n toolOutputs.markPending(messageId);\n Promise.resolve(sendCommand(buildToolOutputCommand({ messageId })))\n .then((payload) => {\n answeredRef.current.set(messageId, chars);\n const result = readToolOutputResult(payload);\n if (result === null) {\n toolOutputs.clearPending(messageId);\n return;\n }\n toolOutputs.set(result.messageId, { content: result.content, chars });\n })\n .catch((error: unknown) => {\n answeredRef.current.set(messageId, chars);\n toolOutputs.clearPending(messageId);\n onErrorRef.current?.(error, 'history/tool_output');\n });\n }\n }\n }, [messages, isMessageMounted, window, sendCommand, toolOutputs]);\n\n const loadOlder = useCallback(() => {\n setRequests((count) => count + 1);\n }, []);\n\n return { window, olderCount: window?.start ?? 0, loading, loadOlder };\n}\n"],"names":["DEEP_AGENT_MESSAGES_WINDOW_STATE_KEY","useStatewireState","useMemo","readDeepAgentMessagesWindow","useStatewireSendCommand","useState","useRef","useEffect","buildHistoryLoadCommand","readHistoryLoadResult","readTruncatedToolOutputArtifact","buildToolOutputCommand","readToolOutputResult","_a","useCallback"],"mappings":"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"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { useStatewireSendCommand, useStatewireState } from "@assistant-ui/react-statewire";
|
|
2
|
+
import { useState, useRef, useEffect, useCallback, useMemo } from "react";
|
|
3
|
+
import { DEEP_AGENT_MESSAGES_WINDOW_STATE_KEY } from "./generated/runconfig-contract.js";
|
|
4
|
+
import { buildHistoryLoadCommand, readHistoryLoadResult, readTruncatedToolOutputArtifact, buildToolOutputCommand, readToolOutputResult, readDeepAgentMessagesWindow } from "./message-window.js";
|
|
5
|
+
const DEEP_AGENT_MAX_CHAINED_HISTORY_LOADS = 3;
|
|
6
|
+
function selectMessagesWindowLane(state) {
|
|
7
|
+
return typeof state === "object" && state !== null ? state[DEEP_AGENT_MESSAGES_WINDOW_STATE_KEY] : void 0;
|
|
8
|
+
}
|
|
9
|
+
function useDeepAgentMessagesWindow() {
|
|
10
|
+
const lane = useStatewireState(selectMessagesWindowLane);
|
|
11
|
+
return useMemo(
|
|
12
|
+
() => readDeepAgentMessagesWindow({ [DEEP_AGENT_MESSAGES_WINDOW_STATE_KEY]: lane }),
|
|
13
|
+
[lane]
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
const everyMessageMounted = () => true;
|
|
17
|
+
const defaultNow = () => Date.now();
|
|
18
|
+
function useDeepAgentWindowSync({
|
|
19
|
+
messages,
|
|
20
|
+
toolOutputs,
|
|
21
|
+
nearTop = false,
|
|
22
|
+
nearTopEpoch = 0,
|
|
23
|
+
isMessageMounted = everyMessageMounted,
|
|
24
|
+
maxChainedLoads = DEEP_AGENT_MAX_CHAINED_HISTORY_LOADS,
|
|
25
|
+
onHistoryLoad,
|
|
26
|
+
onError,
|
|
27
|
+
now = defaultNow
|
|
28
|
+
}) {
|
|
29
|
+
const sendCommand = useStatewireSendCommand();
|
|
30
|
+
const window = useDeepAgentMessagesWindow();
|
|
31
|
+
const [loading, setLoading] = useState(false);
|
|
32
|
+
const [requests, setRequests] = useState(0);
|
|
33
|
+
const [settledLoads, setSettledLoads] = useState(0);
|
|
34
|
+
const servedRequestsRef = useRef(0);
|
|
35
|
+
const inflightRef = useRef(null);
|
|
36
|
+
const chainRef = useRef({ epoch: 0, loads: 0 });
|
|
37
|
+
const aliveRef = useRef(true);
|
|
38
|
+
const windowRef = useRef(window);
|
|
39
|
+
windowRef.current = window;
|
|
40
|
+
const answeredRef = useRef(/* @__PURE__ */ new Map());
|
|
41
|
+
const onHistoryLoadRef = useRef(onHistoryLoad);
|
|
42
|
+
onHistoryLoadRef.current = onHistoryLoad;
|
|
43
|
+
const onErrorRef = useRef(onError);
|
|
44
|
+
onErrorRef.current = onError;
|
|
45
|
+
const nowRef = useRef(now);
|
|
46
|
+
nowRef.current = now;
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
aliveRef.current = true;
|
|
49
|
+
return () => {
|
|
50
|
+
aliveRef.current = false;
|
|
51
|
+
};
|
|
52
|
+
}, []);
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (window === null || window.start === 0 || inflightRef.current !== null) return;
|
|
55
|
+
const requested = requests !== servedRequestsRef.current;
|
|
56
|
+
if (requested) {
|
|
57
|
+
servedRequestsRef.current = requests;
|
|
58
|
+
chainRef.current = { epoch: nearTopEpoch, loads: 1 };
|
|
59
|
+
} else {
|
|
60
|
+
if (!nearTop) return;
|
|
61
|
+
if (chainRef.current.epoch !== nearTopEpoch) {
|
|
62
|
+
chainRef.current = { epoch: nearTopEpoch, loads: 0 };
|
|
63
|
+
}
|
|
64
|
+
if (chainRef.current.loads >= maxChainedLoads) return;
|
|
65
|
+
chainRef.current.loads += 1;
|
|
66
|
+
}
|
|
67
|
+
const command = buildHistoryLoadCommand({ window });
|
|
68
|
+
if (command === null) return;
|
|
69
|
+
inflightRef.current = command.beforeIndex;
|
|
70
|
+
setLoading(true);
|
|
71
|
+
const startedAt = nowRef.current();
|
|
72
|
+
Promise.resolve(sendCommand(command)).then((payload) => {
|
|
73
|
+
var _a;
|
|
74
|
+
(_a = onHistoryLoadRef.current) == null ? void 0 : _a.call(onHistoryLoadRef, {
|
|
75
|
+
beforeIndex: command.beforeIndex,
|
|
76
|
+
limit: command.limit,
|
|
77
|
+
result: readHistoryLoadResult(payload),
|
|
78
|
+
durationMs: Math.max(0, Math.round(nowRef.current() - startedAt))
|
|
79
|
+
});
|
|
80
|
+
}).catch((error) => {
|
|
81
|
+
var _a;
|
|
82
|
+
(_a = onErrorRef.current) == null ? void 0 : _a.call(onErrorRef, error, "history/load");
|
|
83
|
+
}).finally(() => {
|
|
84
|
+
var _a;
|
|
85
|
+
inflightRef.current = null;
|
|
86
|
+
if (!aliveRef.current) return;
|
|
87
|
+
setLoading(false);
|
|
88
|
+
if (((_a = windowRef.current) == null ? void 0 : _a.start) !== command.beforeIndex) {
|
|
89
|
+
setSettledLoads((count) => count + 1);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}, [nearTop, nearTopEpoch, requests, settledLoads, window, sendCommand, maxChainedLoads]);
|
|
93
|
+
useEffect(() => {
|
|
94
|
+
var _a;
|
|
95
|
+
if (window === null || toolOutputs === void 0) return;
|
|
96
|
+
for (const message of messages) {
|
|
97
|
+
if (!isMessageMounted(message.id)) continue;
|
|
98
|
+
for (const part of message.content) {
|
|
99
|
+
if (part.type !== "tool-call") continue;
|
|
100
|
+
const marker = readTruncatedToolOutputArtifact(part.artifact);
|
|
101
|
+
if (marker === null || toolOutputs.isPending(marker.messageId)) continue;
|
|
102
|
+
if (((_a = toolOutputs.entry(marker.messageId)) == null ? void 0 : _a.chars) === marker.chars) continue;
|
|
103
|
+
if (answeredRef.current.get(marker.messageId) === marker.chars) continue;
|
|
104
|
+
const { messageId, chars } = marker;
|
|
105
|
+
toolOutputs.markPending(messageId);
|
|
106
|
+
Promise.resolve(sendCommand(buildToolOutputCommand({ messageId }))).then((payload) => {
|
|
107
|
+
answeredRef.current.set(messageId, chars);
|
|
108
|
+
const result = readToolOutputResult(payload);
|
|
109
|
+
if (result === null) {
|
|
110
|
+
toolOutputs.clearPending(messageId);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
toolOutputs.set(result.messageId, { content: result.content, chars });
|
|
114
|
+
}).catch((error) => {
|
|
115
|
+
var _a2;
|
|
116
|
+
answeredRef.current.set(messageId, chars);
|
|
117
|
+
toolOutputs.clearPending(messageId);
|
|
118
|
+
(_a2 = onErrorRef.current) == null ? void 0 : _a2.call(onErrorRef, error, "history/tool_output");
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}, [messages, isMessageMounted, window, sendCommand, toolOutputs]);
|
|
123
|
+
const loadOlder = useCallback(() => {
|
|
124
|
+
setRequests((count) => count + 1);
|
|
125
|
+
}, []);
|
|
126
|
+
return { window, olderCount: (window == null ? void 0 : window.start) ?? 0, loading, loadOlder };
|
|
127
|
+
}
|
|
128
|
+
export {
|
|
129
|
+
DEEP_AGENT_MAX_CHAINED_HISTORY_LOADS,
|
|
130
|
+
useDeepAgentMessagesWindow,
|
|
131
|
+
useDeepAgentWindowSync
|
|
132
|
+
};
|
|
133
|
+
//# sourceMappingURL=use-deep-agent-window-sync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-deep-agent-window-sync.js","sources":["../../../../../agent-runtime/src/use-deep-agent-window-sync.ts"],"sourcesContent":["import { useStatewireSendCommand, useStatewireState } from '@assistant-ui/react-statewire';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { DEEP_AGENT_MESSAGES_WINDOW_STATE_KEY } from './generated/runconfig-contract';\nimport {\n buildHistoryLoadCommand,\n buildToolOutputCommand,\n type DeepAgentMessagesWindow,\n type HistoryLoadResult,\n readDeepAgentMessagesWindow,\n readHistoryLoadResult,\n readToolOutputResult,\n readTruncatedToolOutputArtifact,\n} from './message-window';\nimport type { DeepAgentToolOutputStore } from './tool-outputs';\n\n/**\n * Pages of older history chained per approach to the top. A renderer lowers\n * its near-top level once prepended content has pushed the first message out\n * of its band; this bounds the case where it cannot (no viewport to scroll,\n * a list too short to overflow) so a 2,000-message thread never streams whole.\n */\nexport const DEEP_AGENT_MAX_CHAINED_HISTORY_LOADS = 3;\n\n/** The converted thread messages the tool-output half scans (web and native `ThreadMessage` both satisfy it). */\nexport interface DeepAgentWindowSyncMessage {\n readonly id: string;\n readonly content: readonly { readonly type: string; readonly artifact?: unknown }[];\n}\n\n/** One `history/load` round trip, for the host's telemetry. */\nexport interface DeepAgentHistoryLoadEvent {\n beforeIndex: number;\n limit: number;\n /** The host's answer, or `null` when it was not a history-load result. */\n result: HistoryLoadResult | null;\n durationMs: number;\n}\n\nexport interface UseDeepAgentWindowSyncOptions {\n /**\n * The converted thread messages — read by the host through its platform\n * `useAuiState((s) => s.thread.messages)`, so this hook imports neither\n * `@assistant-ui/react` nor `@assistant-ui/react-native`.\n */\n messages: readonly DeepAgentWindowSyncMessage[];\n /**\n * Full tool outputs fetched back for cut tool messages; the same store the\n * thread converts with (`useDeepAgentThread({ toolOutputs })`). Omitted, the\n * tool-output half is inert (a surface that never shows a cut output whole).\n */\n toolOutputs?: DeepAgentToolOutputStore | undefined;\n /**\n * The renderer's report that the top of the LOADED history is near — a\n * level, not an edge: while it holds and older messages exist, pages load\n * one after another (bounded by `maxChainedLoads` per approach). Omitted for\n * hosts with only a manual affordance (`loadOlder`).\n */\n nearTop?: boolean;\n /** Bumped on every rise of `nearTop` (and every explicit request), so the chain bound is per approach. */\n nearTopEpoch?: number;\n /**\n * Whether a message's content is mounted right now, so lazy fetches (cut\n * tool outputs) target what the user can see rather than the whole loaded\n * history. Omitted: every message counts as mounted (the flat renderers).\n */\n isMessageMounted?: ((messageId: string) => boolean) | undefined;\n maxChainedLoads?: number;\n /** A `history/load` settled (telemetry). */\n onHistoryLoad?: ((event: DeepAgentHistoryLoadEvent) => void) | undefined;\n /** A read command failed; the sync itself recovers (the pending marks are released). */\n onError?: ((error: unknown, command: 'history/load' | 'history/tool_output') => void) | undefined;\n now?: () => number;\n}\n\nexport interface DeepAgentWindowSyncState {\n /** The lane, or `null` on a wire that is not windowed (both halves are inert). */\n window: DeepAgentMessagesWindow | null;\n /** Messages older than the loaded window the server still holds. */\n olderCount: number;\n /** A page of older history is in flight. */\n loading: boolean;\n /** Ask for the next page of older history now (an edge row's button, a keypress). A no-op on a wire that is not windowed or at the beginning. */\n loadOlder: () => void;\n}\n\n/** The raw lane, selected without derivation (selectors compare by identity). */\nfunction selectMessagesWindowLane(state: unknown): unknown {\n return typeof state === 'object' && state !== null\n ? (state as Record<string, unknown>)[DEEP_AGENT_MESSAGES_WINDOW_STATE_KEY]\n : undefined;\n}\n\n/** The `messagesWindow` lane of the nearest statewire thread, or `null` when the wire is not windowed. */\nexport function useDeepAgentMessagesWindow(): DeepAgentMessagesWindow | null {\n const lane = useStatewireState(selectMessagesWindowLane);\n return useMemo(\n () => readDeepAgentMessagesWindow({ [DEEP_AGENT_MESSAGES_WINDOW_STATE_KEY]: lane }),\n [lane]\n );\n}\n\nconst everyMessageMounted = (): boolean => true;\nconst defaultNow = (): number => Date.now();\n\n/**\n * The client half of the windowed wire, shared by every surface that declares\n * a message window (`useDeepAgentThread({ messageWindow })`) — mounted once\n * per runtime, inside its aui provider.\n *\n * - **Older history.** While the host renderer reports the top of the loaded\n * history near (`nearTop`) and the `messagesWindow` lane says older\n * messages exist, this sends `history/load` for the next page — the host\n * prepends it as ops for this client alone — chaining at most\n * `maxChainedLoads` pages per approach; `loadOlder` asks for one page on\n * demand (an edge row's button). Never two loads in flight.\n * - **Cut tool outputs.** Tool cards whose output the wire carried cut\n * (`artifact._athena_content_truncated`) get it fetched whole through\n * `history/tool_output` once their message is mounted; the converter puts\n * it back (`toolOutputs`), so the card re-renders complete. An output the\n * host replaced since (the marker's `chars` changed) is fetched again.\n *\n * On a thread whose wire is not windowed (no lane) both halves are inert.\n */\nexport function useDeepAgentWindowSync({\n messages,\n toolOutputs,\n nearTop = false,\n nearTopEpoch = 0,\n isMessageMounted = everyMessageMounted,\n maxChainedLoads = DEEP_AGENT_MAX_CHAINED_HISTORY_LOADS,\n onHistoryLoad,\n onError,\n now = defaultNow,\n}: UseDeepAgentWindowSyncOptions): DeepAgentWindowSyncState {\n const sendCommand = useStatewireSendCommand();\n const window = useDeepAgentMessagesWindow();\n const [loading, setLoading] = useState(false);\n const [requests, setRequests] = useState(0);\n // Bumped when a page settled AFTER its ops moved the lane (the host's\n // order: prepend, then answer), so the chain re-evaluates against the moved\n // window instead of waiting for another signal.\n const [settledLoads, setSettledLoads] = useState(0);\n const servedRequestsRef = useRef(0);\n const inflightRef = useRef<number | null>(null);\n const chainRef = useRef({ epoch: 0, loads: 0 });\n const aliveRef = useRef(true);\n const windowRef = useRef(window);\n windowRef.current = window;\n // Outputs already asked for and answered by this mount — fetched, refused,\n // or failed — by the `chars` they were asked for. The converter re-runs on\n // every wire change, and the store is a bounded LRU: without this memory a\n // refused read would leave on every pass, and once a transcript holds more\n // cut outputs than the store retains, each fetch would evict a still-loaded\n // output and the next pass would fetch it again, forever. An evicted output\n // renders its cut text (the REST display limit) rather than re-entering the\n // loop; a marker whose `chars` moved (the host replaced the output) is asked\n // for again.\n const answeredRef = useRef(new Map<string, number>());\n const onHistoryLoadRef = useRef(onHistoryLoad);\n onHistoryLoadRef.current = onHistoryLoad;\n const onErrorRef = useRef(onError);\n onErrorRef.current = onError;\n const nowRef = useRef(now);\n nowRef.current = now;\n useEffect(() => {\n aliveRef.current = true;\n return () => {\n aliveRef.current = false;\n };\n }, []);\n\n useEffect(() => {\n if (window === null || window.start === 0 || inflightRef.current !== null) return;\n const requested = requests !== servedRequestsRef.current;\n if (requested) {\n // An explicit ask re-arms the chain for this approach.\n servedRequestsRef.current = requests;\n chainRef.current = { epoch: nearTopEpoch, loads: 1 };\n } else {\n if (!nearTop) return;\n if (chainRef.current.epoch !== nearTopEpoch) {\n chainRef.current = { epoch: nearTopEpoch, loads: 0 };\n }\n if (chainRef.current.loads >= maxChainedLoads) return;\n chainRef.current.loads += 1;\n }\n const command = buildHistoryLoadCommand({ window });\n if (command === null) return;\n inflightRef.current = command.beforeIndex;\n setLoading(true);\n const startedAt = nowRef.current();\n Promise.resolve(sendCommand(command))\n .then((payload) => {\n onHistoryLoadRef.current?.({\n beforeIndex: command.beforeIndex,\n limit: command.limit,\n result: readHistoryLoadResult(payload),\n durationMs: Math.max(0, Math.round(nowRef.current() - startedAt)),\n });\n })\n .catch((error: unknown) => {\n onErrorRef.current?.(error, 'history/load');\n })\n .finally(() => {\n inflightRef.current = null;\n if (!aliveRef.current) return;\n setLoading(false);\n if (windowRef.current?.start !== command.beforeIndex) {\n setSettledLoads((count) => count + 1);\n }\n });\n }, [nearTop, nearTopEpoch, requests, settledLoads, window, sendCommand, maxChainedLoads]);\n\n useEffect(() => {\n if (window === null || toolOutputs === undefined) return;\n for (const message of messages) {\n if (!isMessageMounted(message.id)) continue;\n for (const part of message.content) {\n if (part.type !== 'tool-call') continue;\n const marker = readTruncatedToolOutputArtifact(part.artifact);\n if (marker === null || toolOutputs.isPending(marker.messageId)) continue;\n // Fetched for this very length already; a different length means the\n // host replaced the output under the same id since.\n if (toolOutputs.entry(marker.messageId)?.chars === marker.chars) continue;\n if (answeredRef.current.get(marker.messageId) === marker.chars) continue;\n const { messageId, chars } = marker;\n toolOutputs.markPending(messageId);\n Promise.resolve(sendCommand(buildToolOutputCommand({ messageId })))\n .then((payload) => {\n answeredRef.current.set(messageId, chars);\n const result = readToolOutputResult(payload);\n if (result === null) {\n toolOutputs.clearPending(messageId);\n return;\n }\n toolOutputs.set(result.messageId, { content: result.content, chars });\n })\n .catch((error: unknown) => {\n answeredRef.current.set(messageId, chars);\n toolOutputs.clearPending(messageId);\n onErrorRef.current?.(error, 'history/tool_output');\n });\n }\n }\n }, [messages, isMessageMounted, window, sendCommand, toolOutputs]);\n\n const loadOlder = useCallback(() => {\n setRequests((count) => count + 1);\n }, []);\n\n return { window, olderCount: window?.start ?? 0, loading, loadOlder };\n}\n"],"names":["_a"],"mappings":"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"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const VOICE_SOURCE_DELEGATION = "voice_delegation";
|
|
4
|
+
const VOICE_DELEGATION_ID_PREFIX = "voicetask_";
|
|
5
|
+
const VOICE_UPDATE_TOOL_NAME = "send_voice_update";
|
|
6
|
+
function isVoiceDelegationMessage({ messageId, custom }) {
|
|
7
|
+
return (custom == null ? void 0 : custom.source) === VOICE_SOURCE_DELEGATION || typeof messageId === "string" && messageId.startsWith(VOICE_DELEGATION_ID_PREFIX);
|
|
8
|
+
}
|
|
9
|
+
function describeVoiceUpdateToolCall({
|
|
10
|
+
args,
|
|
11
|
+
result
|
|
12
|
+
}) {
|
|
13
|
+
const text = typeof (args == null ? void 0 : args.text) === "string" ? args.text.trim() : "";
|
|
14
|
+
const spoken = (args == null ? void 0 : args.mode) === "speak";
|
|
15
|
+
if (typeof result !== "string" || result.trim() === "") {
|
|
16
|
+
return { spoken, text, delivered: null };
|
|
17
|
+
}
|
|
18
|
+
const outcome = result.toLowerCase();
|
|
19
|
+
const failed = outcome.includes("could not be delivered") || outcome.includes("was not delivered") || outcome.includes("rejected the update") || outcome.includes("has ended") || outcome.includes("not configured") || outcome.includes("no voice session");
|
|
20
|
+
return { spoken, text, delivered: !failed };
|
|
21
|
+
}
|
|
22
|
+
function voiceUpdateStatusLabel(call, status) {
|
|
23
|
+
if (status === "running" || call.delivered === null && status !== "incomplete") {
|
|
24
|
+
return call.spoken ? "Saying to you…" : "Noting progress…";
|
|
25
|
+
}
|
|
26
|
+
if (call.delivered === false || status === "incomplete") {
|
|
27
|
+
return call.spoken ? "Could not say this to you" : "Progress note not delivered";
|
|
28
|
+
}
|
|
29
|
+
return call.spoken ? "Said aloud" : "Progress noted silently";
|
|
30
|
+
}
|
|
31
|
+
exports.VOICE_DELEGATION_ID_PREFIX = VOICE_DELEGATION_ID_PREFIX;
|
|
32
|
+
exports.VOICE_SOURCE_DELEGATION = VOICE_SOURCE_DELEGATION;
|
|
33
|
+
exports.VOICE_UPDATE_TOOL_NAME = VOICE_UPDATE_TOOL_NAME;
|
|
34
|
+
exports.describeVoiceUpdateToolCall = describeVoiceUpdateToolCall;
|
|
35
|
+
exports.isVoiceDelegationMessage = isVoiceDelegationMessage;
|
|
36
|
+
exports.voiceUpdateStatusLabel = voiceUpdateStatusLabel;
|
|
37
|
+
//# sourceMappingURL=voice-presentation.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voice-presentation.cjs","sources":["../../../../../agent-runtime/src/voice-presentation.ts"],"sourcesContent":["/**\n * How voice-mode transcript entries present, shared by every chat surface\n * (Olympus, the Chrome side panel, the mobile app) so a spoken turn, a\n * delegation the live voice model handed off, and an interim spoken update\n * read the same everywhere. The wire contract is the deep-agent host's\n * `additional_kwargs.metadata` (exposed as `message.metadata.custom`):\n *\n * - `source: \"voice\"` — a spoken turn; `voice_live: true` while it is still\n * being heard or spoken (the ephemeral entry the durable row replaces);\n * - `source: \"text\"` — a message typed into the live conversation;\n * - `source: \"voice_delegation\"` (id prefix `voicetask_`) — the unit of work\n * the live voice model delegated to the thread.\n */\n\n/** `metadata.custom.source` of a spoken turn. */\nexport const VOICE_SOURCE_SPOKEN = 'voice';\n/** `metadata.custom.source` of a message typed into the live conversation. */\nexport const VOICE_SOURCE_TYPED = 'text';\n/** `metadata.custom.source` of a voice delegation's anchor message. */\nexport const VOICE_SOURCE_DELEGATION = 'voice_delegation';\n/** Id prefix of a voice delegation's anchor message (the working signal on\n * hosts that drop the command's metadata). */\nexport const VOICE_DELEGATION_ID_PREFIX = 'voicetask_';\n/** `metadata.custom` flag on a spoken turn still in flight. */\nexport const VOICE_LIVE_KEY = 'voice_live';\n\n/** The delegated run's interim-update tool (agora `send_voice_update`). */\nexport const VOICE_UPDATE_TOOL_NAME = 'send_voice_update';\n\n/** Trailing hint on the live-session strip, worded once for every surface. */\nexport const VOICE_LIVE_TYPED_HINT = 'typed messages go to the voice conversation';\n\n/**\n * The one-time disclosure every surface shows when voice mode is first\n * turned on: the audio path has no zero-data-retention guarantee yet, which\n * users must know before speaking.\n */\nexport const VOICE_MODE_EXPERIMENTAL_NOTICE =\n \"Voice mode is experimental and doesn't currently have zero data retention\";\n\nexport interface VoiceMessageMarker {\n /** The thread message id; a host may not have assigned one yet. */\n messageId: string | undefined;\n /** The thread message's `metadata.custom`, when any. */\n custom: Record<string, unknown> | undefined;\n}\n\n/** Whether a thread message is a voice delegation's anchor (the ask the live\n * voice model handed to the thread), by source or by id prefix. */\nexport function isVoiceDelegationMessage({ messageId, custom }: VoiceMessageMarker): boolean {\n return (\n custom?.source === VOICE_SOURCE_DELEGATION ||\n (typeof messageId === 'string' && messageId.startsWith(VOICE_DELEGATION_ID_PREFIX))\n );\n}\n\nexport interface VoiceProvenance {\n /** Chip copy: \"Listening\", \"Speaking\", \"Spoken\", or \"Delegated from voice\". */\n readonly label: string;\n /** True while the turn is still being heard or spoken. */\n readonly live: boolean;\n}\n\n// These values are read directly by useAuiState/useSyncExternalStore selectors.\n// Equal presentation must retain its identity, even when a transport replaces\n// the message metadata. Fresh objects here cause React's update-depth crash.\nconst SPOKEN_PROVENANCE: VoiceProvenance = Object.freeze({\n label: 'Spoken',\n live: false,\n});\nconst LISTENING_PROVENANCE: VoiceProvenance = Object.freeze({\n label: 'Listening',\n live: true,\n});\nconst SPEAKING_PROVENANCE: VoiceProvenance = Object.freeze({\n label: 'Speaking',\n live: true,\n});\nconst DELEGATED_PROVENANCE: VoiceProvenance = Object.freeze({\n label: 'Delegated from voice',\n live: false,\n});\n\n/**\n * The provenance chip for a message, or `null` for ordinary chat messages so\n * the chip is free to mount on every row. A spoken turn still in flight reads\n * as what is happening (\"Listening\" for the user, \"Speaking\" for the\n * assistant) rather than as a finished \"Spoken\" turn; a typed-in-voice turn\n * is a normal message and gets no chip. Results are immutable and stable for\n * equal presentation, so all surfaces can use this function as a selector.\n */\nexport function voiceProvenanceLabel({\n messageId,\n custom,\n role,\n}: VoiceMessageMarker & { role: 'user' | 'assistant' | string }): VoiceProvenance | null {\n const source = custom?.source;\n if (source === VOICE_SOURCE_SPOKEN) {\n if (custom?.[VOICE_LIVE_KEY] === true) {\n return role === 'user' ? LISTENING_PROVENANCE : SPEAKING_PROVENANCE;\n }\n return SPOKEN_PROVENANCE;\n }\n if (isVoiceDelegationMessage({ messageId, custom })) {\n return DELEGATED_PROVENANCE;\n }\n return null;\n}\n\nexport interface VoiceUpdateToolCall {\n /** `mode: \"speak\"` — read aloud to the user; otherwise a silent progress note. */\n spoken: boolean;\n /** The update's words. */\n text: string;\n /** Whether the live session took it; `null` while the call is still running. */\n delivered: boolean | null;\n}\n\n/**\n * What a `send_voice_update` tool call did, from its arguments and the tool's\n * teaching-text result (agora returns prose, not JSON, so the run can read it).\n */\nexport function describeVoiceUpdateToolCall({\n args,\n result,\n}: {\n args: Record<string, unknown> | undefined;\n result: unknown;\n}): VoiceUpdateToolCall {\n const text = typeof args?.text === 'string' ? args.text.trim() : '';\n const spoken = args?.mode === 'speak';\n if (typeof result !== 'string' || result.trim() === '') {\n return { spoken, text, delivered: null };\n }\n const outcome = result.toLowerCase();\n const failed =\n outcome.includes('could not be delivered') ||\n outcome.includes('was not delivered') ||\n outcome.includes('rejected the update') ||\n outcome.includes('has ended') ||\n outcome.includes('not configured') ||\n outcome.includes('no voice session');\n return { spoken, text, delivered: !failed };\n}\n\n/** The card's status line for a voice update in a given tool-call state. */\nexport function voiceUpdateStatusLabel(\n call: VoiceUpdateToolCall,\n status: 'running' | 'complete' | 'incomplete' | 'requires-action' | undefined\n): string {\n if (status === 'running' || (call.delivered === null && status !== 'incomplete')) {\n return call.spoken ? 'Saying to you…' : 'Noting progress…';\n }\n if (call.delivered === false || status === 'incomplete') {\n return call.spoken ? 'Could not say this to you' : 'Progress note not delivered';\n }\n return call.spoken ? 'Said aloud' : 'Progress noted silently';\n}\n"],"names":[],"mappings":";;AAmBO,MAAM,0BAA0B;AAGhC,MAAM,6BAA6B;AAKnC,MAAM,yBAAyB;AAsB/B,SAAS,yBAAyB,EAAE,WAAW,UAAuC;AAC3F,UACE,iCAAQ,YAAW,2BAClB,OAAO,cAAc,YAAY,UAAU,WAAW,0BAA0B;AAErF;AAoEO,SAAS,4BAA4B;AAAA,EAC1C;AAAA,EACA;AACF,GAGwB;AACtB,QAAM,OAAO,QAAO,6BAAM,UAAS,WAAW,KAAK,KAAK,SAAS;AACjE,QAAM,UAAS,6BAAM,UAAS;AAC9B,MAAI,OAAO,WAAW,YAAY,OAAO,KAAA,MAAW,IAAI;AACtD,WAAO,EAAE,QAAQ,MAAM,WAAW,KAAA;AAAA,EACpC;AACA,QAAM,UAAU,OAAO,YAAA;AACvB,QAAM,SACJ,QAAQ,SAAS,wBAAwB,KACzC,QAAQ,SAAS,mBAAmB,KACpC,QAAQ,SAAS,qBAAqB,KACtC,QAAQ,SAAS,WAAW,KAC5B,QAAQ,SAAS,gBAAgB,KACjC,QAAQ,SAAS,kBAAkB;AACrC,SAAO,EAAE,QAAQ,MAAM,WAAW,CAAC,OAAA;AACrC;AAGO,SAAS,uBACd,MACA,QACQ;AACR,MAAI,WAAW,aAAc,KAAK,cAAc,QAAQ,WAAW,cAAe;AAChF,WAAO,KAAK,SAAS,mBAAmB;AAAA,EAC1C;AACA,MAAI,KAAK,cAAc,SAAS,WAAW,cAAc;AACvD,WAAO,KAAK,SAAS,8BAA8B;AAAA,EACrD;AACA,SAAO,KAAK,SAAS,eAAe;AACtC;;;;;;;"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const VOICE_SOURCE_DELEGATION = "voice_delegation";
|
|
2
|
+
const VOICE_DELEGATION_ID_PREFIX = "voicetask_";
|
|
3
|
+
const VOICE_UPDATE_TOOL_NAME = "send_voice_update";
|
|
4
|
+
function isVoiceDelegationMessage({ messageId, custom }) {
|
|
5
|
+
return (custom == null ? void 0 : custom.source) === VOICE_SOURCE_DELEGATION || typeof messageId === "string" && messageId.startsWith(VOICE_DELEGATION_ID_PREFIX);
|
|
6
|
+
}
|
|
7
|
+
function describeVoiceUpdateToolCall({
|
|
8
|
+
args,
|
|
9
|
+
result
|
|
10
|
+
}) {
|
|
11
|
+
const text = typeof (args == null ? void 0 : args.text) === "string" ? args.text.trim() : "";
|
|
12
|
+
const spoken = (args == null ? void 0 : args.mode) === "speak";
|
|
13
|
+
if (typeof result !== "string" || result.trim() === "") {
|
|
14
|
+
return { spoken, text, delivered: null };
|
|
15
|
+
}
|
|
16
|
+
const outcome = result.toLowerCase();
|
|
17
|
+
const failed = outcome.includes("could not be delivered") || outcome.includes("was not delivered") || outcome.includes("rejected the update") || outcome.includes("has ended") || outcome.includes("not configured") || outcome.includes("no voice session");
|
|
18
|
+
return { spoken, text, delivered: !failed };
|
|
19
|
+
}
|
|
20
|
+
function voiceUpdateStatusLabel(call, status) {
|
|
21
|
+
if (status === "running" || call.delivered === null && status !== "incomplete") {
|
|
22
|
+
return call.spoken ? "Saying to you…" : "Noting progress…";
|
|
23
|
+
}
|
|
24
|
+
if (call.delivered === false || status === "incomplete") {
|
|
25
|
+
return call.spoken ? "Could not say this to you" : "Progress note not delivered";
|
|
26
|
+
}
|
|
27
|
+
return call.spoken ? "Said aloud" : "Progress noted silently";
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
VOICE_DELEGATION_ID_PREFIX,
|
|
31
|
+
VOICE_SOURCE_DELEGATION,
|
|
32
|
+
VOICE_UPDATE_TOOL_NAME,
|
|
33
|
+
describeVoiceUpdateToolCall,
|
|
34
|
+
isVoiceDelegationMessage,
|
|
35
|
+
voiceUpdateStatusLabel
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=voice-presentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voice-presentation.js","sources":["../../../../../agent-runtime/src/voice-presentation.ts"],"sourcesContent":["/**\n * How voice-mode transcript entries present, shared by every chat surface\n * (Olympus, the Chrome side panel, the mobile app) so a spoken turn, a\n * delegation the live voice model handed off, and an interim spoken update\n * read the same everywhere. The wire contract is the deep-agent host's\n * `additional_kwargs.metadata` (exposed as `message.metadata.custom`):\n *\n * - `source: \"voice\"` — a spoken turn; `voice_live: true` while it is still\n * being heard or spoken (the ephemeral entry the durable row replaces);\n * - `source: \"text\"` — a message typed into the live conversation;\n * - `source: \"voice_delegation\"` (id prefix `voicetask_`) — the unit of work\n * the live voice model delegated to the thread.\n */\n\n/** `metadata.custom.source` of a spoken turn. */\nexport const VOICE_SOURCE_SPOKEN = 'voice';\n/** `metadata.custom.source` of a message typed into the live conversation. */\nexport const VOICE_SOURCE_TYPED = 'text';\n/** `metadata.custom.source` of a voice delegation's anchor message. */\nexport const VOICE_SOURCE_DELEGATION = 'voice_delegation';\n/** Id prefix of a voice delegation's anchor message (the working signal on\n * hosts that drop the command's metadata). */\nexport const VOICE_DELEGATION_ID_PREFIX = 'voicetask_';\n/** `metadata.custom` flag on a spoken turn still in flight. */\nexport const VOICE_LIVE_KEY = 'voice_live';\n\n/** The delegated run's interim-update tool (agora `send_voice_update`). */\nexport const VOICE_UPDATE_TOOL_NAME = 'send_voice_update';\n\n/** Trailing hint on the live-session strip, worded once for every surface. */\nexport const VOICE_LIVE_TYPED_HINT = 'typed messages go to the voice conversation';\n\n/**\n * The one-time disclosure every surface shows when voice mode is first\n * turned on: the audio path has no zero-data-retention guarantee yet, which\n * users must know before speaking.\n */\nexport const VOICE_MODE_EXPERIMENTAL_NOTICE =\n \"Voice mode is experimental and doesn't currently have zero data retention\";\n\nexport interface VoiceMessageMarker {\n /** The thread message id; a host may not have assigned one yet. */\n messageId: string | undefined;\n /** The thread message's `metadata.custom`, when any. */\n custom: Record<string, unknown> | undefined;\n}\n\n/** Whether a thread message is a voice delegation's anchor (the ask the live\n * voice model handed to the thread), by source or by id prefix. */\nexport function isVoiceDelegationMessage({ messageId, custom }: VoiceMessageMarker): boolean {\n return (\n custom?.source === VOICE_SOURCE_DELEGATION ||\n (typeof messageId === 'string' && messageId.startsWith(VOICE_DELEGATION_ID_PREFIX))\n );\n}\n\nexport interface VoiceProvenance {\n /** Chip copy: \"Listening\", \"Speaking\", \"Spoken\", or \"Delegated from voice\". */\n readonly label: string;\n /** True while the turn is still being heard or spoken. */\n readonly live: boolean;\n}\n\n// These values are read directly by useAuiState/useSyncExternalStore selectors.\n// Equal presentation must retain its identity, even when a transport replaces\n// the message metadata. Fresh objects here cause React's update-depth crash.\nconst SPOKEN_PROVENANCE: VoiceProvenance = Object.freeze({\n label: 'Spoken',\n live: false,\n});\nconst LISTENING_PROVENANCE: VoiceProvenance = Object.freeze({\n label: 'Listening',\n live: true,\n});\nconst SPEAKING_PROVENANCE: VoiceProvenance = Object.freeze({\n label: 'Speaking',\n live: true,\n});\nconst DELEGATED_PROVENANCE: VoiceProvenance = Object.freeze({\n label: 'Delegated from voice',\n live: false,\n});\n\n/**\n * The provenance chip for a message, or `null` for ordinary chat messages so\n * the chip is free to mount on every row. A spoken turn still in flight reads\n * as what is happening (\"Listening\" for the user, \"Speaking\" for the\n * assistant) rather than as a finished \"Spoken\" turn; a typed-in-voice turn\n * is a normal message and gets no chip. Results are immutable and stable for\n * equal presentation, so all surfaces can use this function as a selector.\n */\nexport function voiceProvenanceLabel({\n messageId,\n custom,\n role,\n}: VoiceMessageMarker & { role: 'user' | 'assistant' | string }): VoiceProvenance | null {\n const source = custom?.source;\n if (source === VOICE_SOURCE_SPOKEN) {\n if (custom?.[VOICE_LIVE_KEY] === true) {\n return role === 'user' ? LISTENING_PROVENANCE : SPEAKING_PROVENANCE;\n }\n return SPOKEN_PROVENANCE;\n }\n if (isVoiceDelegationMessage({ messageId, custom })) {\n return DELEGATED_PROVENANCE;\n }\n return null;\n}\n\nexport interface VoiceUpdateToolCall {\n /** `mode: \"speak\"` — read aloud to the user; otherwise a silent progress note. */\n spoken: boolean;\n /** The update's words. */\n text: string;\n /** Whether the live session took it; `null` while the call is still running. */\n delivered: boolean | null;\n}\n\n/**\n * What a `send_voice_update` tool call did, from its arguments and the tool's\n * teaching-text result (agora returns prose, not JSON, so the run can read it).\n */\nexport function describeVoiceUpdateToolCall({\n args,\n result,\n}: {\n args: Record<string, unknown> | undefined;\n result: unknown;\n}): VoiceUpdateToolCall {\n const text = typeof args?.text === 'string' ? args.text.trim() : '';\n const spoken = args?.mode === 'speak';\n if (typeof result !== 'string' || result.trim() === '') {\n return { spoken, text, delivered: null };\n }\n const outcome = result.toLowerCase();\n const failed =\n outcome.includes('could not be delivered') ||\n outcome.includes('was not delivered') ||\n outcome.includes('rejected the update') ||\n outcome.includes('has ended') ||\n outcome.includes('not configured') ||\n outcome.includes('no voice session');\n return { spoken, text, delivered: !failed };\n}\n\n/** The card's status line for a voice update in a given tool-call state. */\nexport function voiceUpdateStatusLabel(\n call: VoiceUpdateToolCall,\n status: 'running' | 'complete' | 'incomplete' | 'requires-action' | undefined\n): string {\n if (status === 'running' || (call.delivered === null && status !== 'incomplete')) {\n return call.spoken ? 'Saying to you…' : 'Noting progress…';\n }\n if (call.delivered === false || status === 'incomplete') {\n return call.spoken ? 'Could not say this to you' : 'Progress note not delivered';\n }\n return call.spoken ? 'Said aloud' : 'Progress noted silently';\n}\n"],"names":[],"mappings":"AAmBO,MAAM,0BAA0B;AAGhC,MAAM,6BAA6B;AAKnC,MAAM,yBAAyB;AAsB/B,SAAS,yBAAyB,EAAE,WAAW,UAAuC;AAC3F,UACE,iCAAQ,YAAW,2BAClB,OAAO,cAAc,YAAY,UAAU,WAAW,0BAA0B;AAErF;AAoEO,SAAS,4BAA4B;AAAA,EAC1C;AAAA,EACA;AACF,GAGwB;AACtB,QAAM,OAAO,QAAO,6BAAM,UAAS,WAAW,KAAK,KAAK,SAAS;AACjE,QAAM,UAAS,6BAAM,UAAS;AAC9B,MAAI,OAAO,WAAW,YAAY,OAAO,KAAA,MAAW,IAAI;AACtD,WAAO,EAAE,QAAQ,MAAM,WAAW,KAAA;AAAA,EACpC;AACA,QAAM,UAAU,OAAO,YAAA;AACvB,QAAM,SACJ,QAAQ,SAAS,wBAAwB,KACzC,QAAQ,SAAS,mBAAmB,KACpC,QAAQ,SAAS,qBAAqB,KACtC,QAAQ,SAAS,WAAW,KAC5B,QAAQ,SAAS,gBAAgB,KACjC,QAAQ,SAAS,kBAAkB;AACrC,SAAO,EAAE,QAAQ,MAAM,WAAW,CAAC,OAAA;AACrC;AAGO,SAAS,uBACd,MACA,QACQ;AACR,MAAI,WAAW,aAAc,KAAK,cAAc,QAAQ,WAAW,cAAe;AAChF,WAAO,KAAK,SAAS,mBAAmB;AAAA,EAC1C;AACA,MAAI,KAAK,cAAc,SAAS,WAAW,cAAc;AACvD,WAAO,KAAK,SAAS,8BAA8B;AAAA,EACrD;AACA,SAAO,KAAK,SAAS,eAAe;AACtC;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const version = "0.20.0";
|
|
4
|
+
const packageJson = {
|
|
5
|
+
version
|
|
6
|
+
};
|
|
7
|
+
exports.default = packageJson;
|
|
8
|
+
exports.version = version;
|
|
9
|
+
//# sourceMappingURL=package.json.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.json.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
const
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const react = require("react");
|
|
4
|
+
const AthenaContext = react.createContext(null);
|
|
4
5
|
function useAthenaConfig() {
|
|
5
|
-
const ctx =
|
|
6
|
+
const ctx = react.useContext(AthenaContext);
|
|
6
7
|
if (!ctx) {
|
|
7
8
|
throw new Error("[AthenaSDK] useAthenaConfig must be used within <AthenaProvider>");
|
|
8
9
|
}
|
|
@@ -10,4 +11,4 @@ function useAthenaConfig() {
|
|
|
10
11
|
}
|
|
11
12
|
exports.AthenaContext = AthenaContext;
|
|
12
13
|
exports.useAthenaConfig = useAthenaConfig;
|
|
13
|
-
//# sourceMappingURL=AthenaContext
|
|
14
|
+
//# sourceMappingURL=AthenaContext.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AthenaContext.cjs","sources":["../../src/provider/AthenaContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\nimport type { AthenaProviderConfig } from './config';\nimport type { AthenaCitationLinkOptions, AthenaLinkClickOptions } from './citation-links';\n\nexport interface AthenaConfig extends Pick<AthenaProviderConfig, 'apiKey' | 'token'> {\n backendUrl: string;\n appUrl: string;\n enabledToolkits: string[];\n linkClicks?: AthenaLinkClickOptions;\n citationLinks?: AthenaCitationLinkOptions;\n}\n\nexport const AthenaContext = createContext<AthenaConfig | null>(null);\n\nexport function useAthenaConfig(): AthenaConfig {\n const ctx = useContext(AthenaContext);\n if (!ctx) {\n throw new Error('[AthenaSDK] useAthenaConfig must be used within <AthenaProvider>');\n }\n return ctx;\n}\n"],"names":["createContext","useContext"],"mappings":";;;AAYO,MAAM,gBAAgBA,MAAAA,cAAmC,IAAI;AAE7D,SAAS,kBAAgC;AAC9C,QAAM,MAAMC,MAAAA,WAAW,aAAa;AACpC,MAAI,CAAC,KAAK;AACR,UAAM,IAAI,MAAM,kEAAkE;AAAA,EACpF;AACA,SAAO;AACT;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AthenaContext.js","sources":["../../src/provider/AthenaContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\nimport type { AthenaProviderConfig } from './config';\nimport type { AthenaCitationLinkOptions, AthenaLinkClickOptions } from './citation-links';\n\nexport interface AthenaConfig extends Pick<AthenaProviderConfig, 'apiKey' | 'token'> {\n backendUrl: string;\n appUrl: string;\n enabledToolkits: string[];\n linkClicks?: AthenaLinkClickOptions;\n citationLinks?: AthenaCitationLinkOptions;\n}\n\nexport const AthenaContext = createContext<AthenaConfig | null>(null);\n\nexport function useAthenaConfig(): AthenaConfig {\n const ctx = useContext(AthenaContext);\n if (!ctx) {\n throw new Error('[AthenaSDK] useAthenaConfig must be used within <AthenaProvider>');\n }\n return ctx;\n}\n"],"names":[],"mappings":";AAYO,MAAM,gBAAgB,cAAmC,IAAI;AAE7D,SAAS,kBAAgC;AAC9C,QAAM,MAAM,WAAW,aAAa;AACpC,MAAI,CAAC,KAAK;AACR,UAAM,IAAI,MAAM,kEAAkE;AAAA,EACpF;AACA,SAAO;AACT;"}
|