@athenaintel/react 0.28.0 → 0.30.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 +418 -10
- package/dist/agent-runtime/src/asset-attachment.cjs.map +1 -0
- package/dist/agent-runtime/src/asset-attachment.js.map +1 -0
- package/dist/agent-runtime/src/auth-denial.cjs.map +1 -0
- package/dist/agent-runtime/src/auth-denial.js.map +1 -0
- package/dist/agent-runtime/src/client-tool-bridge.cjs.map +1 -0
- package/dist/agent-runtime/src/client-tool-bridge.js.map +1 -0
- package/dist/agent-runtime/src/client-tools.cjs.map +1 -0
- package/dist/agent-runtime/src/client-tools.js.map +1 -0
- package/dist/agent-runtime/src/composer-markdown.cjs +124 -0
- package/dist/agent-runtime/src/composer-markdown.cjs.map +1 -0
- package/dist/agent-runtime/src/composer-markdown.js +124 -0
- package/dist/agent-runtime/src/composer-markdown.js.map +1 -0
- package/dist/agent-runtime/src/conversation-index.cjs.map +1 -0
- package/dist/agent-runtime/src/conversation-index.js.map +1 -0
- package/dist/{packages/agent-runtime → agent-runtime}/src/conversation-list.cjs +36 -0
- package/dist/agent-runtime/src/conversation-list.cjs.map +1 -0
- package/dist/{packages/agent-runtime → agent-runtime}/src/conversation-list.js +36 -0
- package/dist/agent-runtime/src/conversation-list.js.map +1 -0
- package/dist/{packages/agent-runtime → agent-runtime}/src/deep-agent-transport-recipe.cjs +5 -3
- package/dist/agent-runtime/src/deep-agent-transport-recipe.cjs.map +1 -0
- package/dist/{packages/agent-runtime → agent-runtime}/src/deep-agent-transport-recipe.js +6 -4
- package/dist/agent-runtime/src/deep-agent-transport-recipe.js.map +1 -0
- package/dist/agent-runtime/src/edit-command.cjs.map +1 -0
- package/dist/agent-runtime/src/edit-command.js.map +1 -0
- package/dist/{packages/agent-runtime → agent-runtime}/src/errors.cjs +23 -0
- package/dist/agent-runtime/src/errors.cjs.map +1 -0
- package/dist/{packages/agent-runtime → agent-runtime}/src/errors.js +23 -0
- package/dist/agent-runtime/src/errors.js.map +1 -0
- package/dist/agent-runtime/src/execute-output.cjs +41 -0
- package/dist/agent-runtime/src/execute-output.cjs.map +1 -0
- package/dist/agent-runtime/src/execute-output.js +41 -0
- package/dist/agent-runtime/src/execute-output.js.map +1 -0
- package/dist/{packages/agent-runtime → agent-runtime}/src/generated/runconfig-contract.cjs +12 -2
- package/dist/agent-runtime/src/generated/runconfig-contract.cjs.map +1 -0
- package/dist/{packages/agent-runtime → agent-runtime}/src/generated/runconfig-contract.js +12 -2
- package/dist/agent-runtime/src/generated/runconfig-contract.js.map +1 -0
- package/dist/agent-runtime/src/github-wake-event.cjs.map +1 -0
- package/dist/agent-runtime/src/github-wake-event.js.map +1 -0
- package/dist/{packages/agent-runtime → agent-runtime}/src/interrupts.cjs +24 -1
- package/dist/agent-runtime/src/interrupts.cjs.map +1 -0
- package/dist/{packages/agent-runtime → agent-runtime}/src/interrupts.js +24 -1
- package/dist/agent-runtime/src/interrupts.js.map +1 -0
- package/dist/agent-runtime/src/message-author.cjs.map +1 -0
- package/dist/agent-runtime/src/message-author.js.map +1 -0
- package/dist/agent-runtime/src/message-window.cjs.map +1 -0
- package/dist/agent-runtime/src/message-window.js.map +1 -0
- package/dist/{packages/agent-runtime → agent-runtime}/src/messages.cjs +8 -4
- package/dist/agent-runtime/src/messages.cjs.map +1 -0
- package/dist/{packages/agent-runtime → agent-runtime}/src/messages.js +6 -2
- package/dist/agent-runtime/src/messages.js.map +1 -0
- package/dist/agent-runtime/src/model-context.cjs.map +1 -0
- package/dist/agent-runtime/src/model-context.js.map +1 -0
- package/dist/agent-runtime/src/optimistic-content.cjs.map +1 -0
- package/dist/agent-runtime/src/optimistic-content.js.map +1 -0
- package/dist/agent-runtime/src/protocol.cjs.map +1 -0
- package/dist/agent-runtime/src/protocol.js.map +1 -0
- package/dist/{packages/agent-runtime → agent-runtime}/src/queue.cjs +23 -2
- package/dist/agent-runtime/src/queue.cjs.map +1 -0
- package/dist/{packages/agent-runtime → agent-runtime}/src/queue.js +23 -2
- package/dist/agent-runtime/src/queue.js.map +1 -0
- package/dist/{packages/agent-runtime → agent-runtime}/src/quota-safe-local-storage-session.cjs +23 -13
- package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs.map +1 -0
- package/dist/{packages/agent-runtime → agent-runtime}/src/quota-safe-local-storage-session.js +24 -14
- package/dist/agent-runtime/src/quota-safe-local-storage-session.js.map +1 -0
- package/dist/agent-runtime/src/runtime-messages.cjs.map +1 -0
- package/dist/agent-runtime/src/runtime-messages.js.map +1 -0
- package/dist/agent-runtime/src/screen-point.cjs.map +1 -0
- package/dist/agent-runtime/src/screen-point.js.map +1 -0
- package/dist/agent-runtime/src/send-recovery.cjs.map +1 -0
- package/dist/agent-runtime/src/send-recovery.js.map +1 -0
- package/dist/agent-runtime/src/statewire-attach-observer.cjs.map +1 -0
- package/dist/agent-runtime/src/statewire-attach-observer.js.map +1 -0
- package/dist/{packages/agent-runtime → agent-runtime}/src/statewire-state.cjs +8 -0
- package/dist/agent-runtime/src/statewire-state.cjs.map +1 -0
- package/dist/{packages/agent-runtime → agent-runtime}/src/statewire-state.js +8 -0
- package/dist/agent-runtime/src/statewire-state.js.map +1 -0
- package/dist/{packages/agent-runtime → agent-runtime}/src/statewire-suspended.cjs +4 -0
- package/dist/agent-runtime/src/statewire-suspended.cjs.map +1 -0
- package/dist/{packages/agent-runtime → agent-runtime}/src/statewire-suspended.js +4 -0
- package/dist/agent-runtime/src/statewire-suspended.js.map +1 -0
- package/dist/agent-runtime/src/statewire-transport.cjs +43 -0
- package/dist/agent-runtime/src/statewire-transport.cjs.map +1 -0
- package/dist/agent-runtime/src/statewire-transport.js +43 -0
- package/dist/agent-runtime/src/statewire-transport.js.map +1 -0
- package/dist/agent-runtime/src/streaming-markdown.cjs.map +1 -0
- package/dist/agent-runtime/src/streaming-markdown.js.map +1 -0
- package/dist/agent-runtime/src/subscription-wake-event.cjs +252 -0
- package/dist/agent-runtime/src/subscription-wake-event.cjs.map +1 -0
- package/dist/agent-runtime/src/subscription-wake-event.js +252 -0
- package/dist/agent-runtime/src/subscription-wake-event.js.map +1 -0
- package/dist/agent-runtime/src/thread-extras.cjs.map +1 -0
- package/dist/agent-runtime/src/thread-extras.js.map +1 -0
- package/dist/agent-runtime/src/thread-snapshot-cache.cjs.map +1 -0
- package/dist/agent-runtime/src/thread-snapshot-cache.js.map +1 -0
- package/dist/agent-runtime/src/thread-status.cjs.map +1 -0
- package/dist/agent-runtime/src/thread-status.js.map +1 -0
- package/dist/{packages/agent-runtime → agent-runtime}/src/tool-metadata.cjs +365 -3
- package/dist/agent-runtime/src/tool-metadata.cjs.map +1 -0
- package/dist/{packages/agent-runtime → agent-runtime}/src/tool-metadata.js +365 -3
- package/dist/agent-runtime/src/tool-metadata.js.map +1 -0
- package/dist/agent-runtime/src/tool-names.cjs +5 -0
- package/dist/agent-runtime/src/tool-names.cjs.map +1 -0
- package/dist/agent-runtime/src/tool-names.js +5 -0
- package/dist/agent-runtime/src/tool-names.js.map +1 -0
- package/dist/agent-runtime/src/tool-outputs.cjs.map +1 -0
- package/dist/agent-runtime/src/tool-outputs.js.map +1 -0
- package/dist/agent-runtime/src/tool-result.cjs.map +1 -0
- package/dist/agent-runtime/src/tool-result.js.map +1 -0
- package/dist/{packages/agent-runtime → agent-runtime}/src/use-conversation-list.cjs +33 -22
- package/dist/agent-runtime/src/use-conversation-list.cjs.map +1 -0
- package/dist/{packages/agent-runtime → agent-runtime}/src/use-conversation-list.js +34 -23
- package/dist/agent-runtime/src/use-conversation-list.js.map +1 -0
- package/dist/agent-runtime/src/use-deep-agent-config.cjs.map +1 -0
- package/dist/agent-runtime/src/use-deep-agent-config.js.map +1 -0
- package/dist/{packages/agent-runtime → agent-runtime}/src/use-deep-agent-edit-submit.cjs +2 -0
- package/dist/agent-runtime/src/use-deep-agent-edit-submit.cjs.map +1 -0
- package/dist/{packages/agent-runtime → agent-runtime}/src/use-deep-agent-edit-submit.js +2 -0
- package/dist/agent-runtime/src/use-deep-agent-edit-submit.js.map +1 -0
- package/dist/agent-runtime/src/use-deep-agent-runtime.cjs.map +1 -0
- package/dist/agent-runtime/src/use-deep-agent-runtime.js.map +1 -0
- package/dist/{packages/agent-runtime → agent-runtime}/src/use-deep-agent-thread.cjs +1 -0
- package/dist/agent-runtime/src/use-deep-agent-thread.cjs.map +1 -0
- package/dist/{packages/agent-runtime → agent-runtime}/src/use-deep-agent-thread.js +2 -1
- package/dist/agent-runtime/src/use-deep-agent-thread.js.map +1 -0
- package/dist/agent-runtime/src/use-deep-agent-window-sync.cjs.map +1 -0
- package/dist/agent-runtime/src/use-deep-agent-window-sync.js.map +1 -0
- package/dist/agent-runtime/src/use-historical-edit-attachments.cjs +52 -0
- package/dist/agent-runtime/src/use-historical-edit-attachments.cjs.map +1 -0
- package/dist/agent-runtime/src/use-historical-edit-attachments.js +52 -0
- package/dist/agent-runtime/src/use-historical-edit-attachments.js.map +1 -0
- package/dist/{packages/agent-runtime → agent-runtime}/src/voice-presentation.cjs +14 -0
- package/dist/agent-runtime/src/voice-presentation.cjs.map +1 -0
- package/dist/{packages/agent-runtime → agent-runtime}/src/voice-presentation.js +14 -0
- package/dist/agent-runtime/src/voice-presentation.js.map +1 -0
- package/dist/agent-runtime/src/voice-turn-grouping.cjs.map +1 -0
- package/dist/agent-runtime/src/voice-turn-grouping.js.map +1 -0
- package/dist/assets/AthenaAssetEmbed.cjs +8 -2
- package/dist/assets/AthenaAssetEmbed.cjs.map +1 -1
- package/dist/assets/AthenaAssetEmbed.d.ts +8 -0
- package/dist/assets/AthenaAssetEmbed.js +8 -2
- package/dist/assets/AthenaAssetEmbed.js.map +1 -1
- package/dist/assets/AthenaLayout.cjs +97 -31
- package/dist/assets/AthenaLayout.cjs.map +1 -1
- package/dist/assets/AthenaLayout.d.ts +13 -0
- package/dist/assets/AthenaLayout.js +98 -32
- package/dist/assets/AthenaLayout.js.map +1 -1
- package/dist/assets/asset-embed-messages.cjs.map +1 -1
- package/dist/assets/asset-embed-messages.d.ts +6 -0
- package/dist/assets/asset-embed-messages.js.map +1 -1
- package/dist/assets/asset-panel-store.cjs +68 -32
- package/dist/assets/asset-panel-store.cjs.map +1 -1
- package/dist/assets/asset-panel-store.d.ts +47 -1
- package/dist/assets/asset-panel-store.js +68 -32
- package/dist/assets/asset-panel-store.js.map +1 -1
- package/dist/assets/use-asset-embed.cjs +29 -8
- package/dist/assets/use-asset-embed.cjs.map +1 -1
- package/dist/assets/use-asset-embed.d.ts +7 -0
- package/dist/assets/use-asset-embed.js +29 -8
- package/dist/assets/use-asset-embed.js.map +1 -1
- package/dist/catalog/chat-pickers.cjs +152 -0
- package/dist/catalog/chat-pickers.cjs.map +1 -0
- package/dist/catalog/chat-pickers.d.ts +22 -0
- package/dist/catalog/chat-pickers.js +152 -0
- package/dist/catalog/chat-pickers.js.map +1 -0
- package/dist/catalog/runtime-catalog.cjs +181 -0
- package/dist/catalog/runtime-catalog.cjs.map +1 -0
- package/dist/catalog/runtime-catalog.d.ts +100 -0
- package/dist/catalog/runtime-catalog.js +181 -0
- package/dist/catalog/runtime-catalog.js.map +1 -0
- package/dist/chat/AthenaChat.cjs +86 -46
- package/dist/chat/AthenaChat.cjs.map +1 -1
- package/dist/chat/AthenaChat.d.ts +21 -4
- package/dist/chat/AthenaChat.js +88 -48
- package/dist/chat/AthenaChat.js.map +1 -1
- package/dist/chat/StatewireApprovalCard.cjs +38 -37
- package/dist/chat/StatewireApprovalCard.cjs.map +1 -1
- package/dist/chat/StatewireApprovalCard.d.ts +2 -0
- package/dist/chat/StatewireApprovalCard.js +39 -38
- package/dist/chat/StatewireApprovalCard.js.map +1 -1
- package/dist/chat/StatewireClientToolBridge.cjs +2 -2
- package/dist/chat/StatewireClientToolBridge.js +2 -2
- package/dist/chat/StatewireQueuedMessages.cjs +15 -12
- package/dist/chat/StatewireQueuedMessages.cjs.map +1 -1
- package/dist/chat/StatewireQueuedMessages.d.ts +22 -2
- package/dist/chat/StatewireQueuedMessages.js +15 -12
- package/dist/chat/StatewireQueuedMessages.js.map +1 -1
- package/dist/chat/StatewireRunRefusalNotice.cjs +48 -0
- package/dist/chat/StatewireRunRefusalNotice.cjs.map +1 -0
- package/dist/chat/StatewireRunRefusalNotice.d.ts +25 -0
- package/dist/chat/StatewireRunRefusalNotice.js +48 -0
- package/dist/chat/StatewireRunRefusalNotice.js.map +1 -0
- package/dist/chat/WaitingOnYouBanner.cjs +2 -2
- package/dist/chat/WaitingOnYouBanner.js +2 -2
- package/dist/chat/athena-citation-links.cjs +19 -15
- package/dist/chat/athena-citation-links.cjs.map +1 -1
- package/dist/chat/athena-citation-links.js +19 -15
- package/dist/chat/athena-citation-links.js.map +1 -1
- package/dist/chat/run-activity.cjs +9 -1
- package/dist/chat/run-activity.cjs.map +1 -1
- package/dist/chat/run-activity.d.ts +6 -0
- package/dist/chat/run-activity.js +10 -2
- package/dist/chat/run-activity.js.map +1 -1
- package/dist/chat/statewire-banners.cjs +30 -1
- package/dist/chat/statewire-banners.cjs.map +1 -1
- package/dist/chat/statewire-banners.d.ts +20 -1
- package/dist/chat/statewire-banners.js +32 -3
- package/dist/chat/statewire-banners.js.map +1 -1
- package/dist/chat/statewire-client-tools.cjs +1 -1
- package/dist/chat/statewire-client-tools.js +1 -1
- package/dist/chat/super-grouping/CollapsibleGroup.cjs +1 -1
- package/dist/chat/super-grouping/CollapsibleGroup.cjs.map +1 -1
- package/dist/chat/super-grouping/CollapsibleGroup.js +1 -1
- package/dist/chat/super-grouping/CollapsibleGroup.js.map +1 -1
- package/dist/chat/super-grouping/SuperGroupingCard.cjs +7 -5
- package/dist/chat/super-grouping/SuperGroupingCard.cjs.map +1 -1
- package/dist/chat/super-grouping/SuperGroupingCard.d.ts +8 -2
- package/dist/chat/super-grouping/SuperGroupingCard.js +7 -5
- package/dist/chat/super-grouping/SuperGroupingCard.js.map +1 -1
- package/dist/chat/super-grouping/SuperGroupingTranscript.cjs +350 -0
- package/dist/chat/super-grouping/SuperGroupingTranscript.cjs.map +1 -0
- package/dist/chat/super-grouping/SuperGroupingTranscript.d.ts +31 -0
- package/dist/chat/super-grouping/SuperGroupingTranscript.js +350 -0
- package/dist/chat/super-grouping/SuperGroupingTranscript.js.map +1 -0
- package/dist/chat/super-grouping/ToolTimeline.cjs +13 -2
- package/dist/chat/super-grouping/ToolTimeline.cjs.map +1 -1
- package/dist/chat/super-grouping/ToolTimeline.d.ts +10 -3
- package/dist/chat/super-grouping/ToolTimeline.js +13 -2
- package/dist/chat/super-grouping/ToolTimeline.js.map +1 -1
- package/dist/chat/super-grouping/activity-timeline.cjs +51 -26
- package/dist/chat/super-grouping/activity-timeline.cjs.map +1 -1
- package/dist/chat/super-grouping/activity-timeline.d.ts +40 -8
- package/dist/chat/super-grouping/activity-timeline.js +52 -27
- package/dist/chat/super-grouping/activity-timeline.js.map +1 -1
- package/dist/chat/super-grouping/index.cjs +12 -0
- package/dist/chat/super-grouping/index.cjs.map +1 -1
- package/dist/chat/super-grouping/index.d.ts +7 -2
- package/dist/chat/super-grouping/index.js +14 -2
- package/dist/chat/super-grouping/index.js.map +1 -1
- package/dist/chat/super-grouping/timeline-step.cjs +14 -5
- package/dist/chat/super-grouping/timeline-step.cjs.map +1 -1
- package/dist/chat/super-grouping/timeline-step.d.ts +10 -1
- package/dist/chat/super-grouping/timeline-step.js +15 -6
- package/dist/chat/super-grouping/timeline-step.js.map +1 -1
- package/dist/chat/super-grouping/turn-segments.cjs +82 -0
- package/dist/chat/super-grouping/turn-segments.cjs.map +1 -0
- package/dist/chat/super-grouping/turn-segments.d.ts +69 -0
- package/dist/chat/super-grouping/turn-segments.js +82 -0
- package/dist/chat/super-grouping/turn-segments.js.map +1 -0
- package/dist/chat/super-grouping/turn-timing.cjs +110 -0
- package/dist/chat/super-grouping/turn-timing.cjs.map +1 -0
- package/dist/chat/super-grouping/turn-timing.d.ts +52 -0
- package/dist/chat/super-grouping/turn-timing.js +110 -0
- package/dist/chat/super-grouping/turn-timing.js.map +1 -0
- package/dist/chat/tiptap-text.cjs +1 -1
- package/dist/chat/tiptap-text.js +1 -1
- package/dist/chat/use-athena-run-live.cjs +1 -1
- package/dist/chat/use-athena-run-live.js +1 -1
- package/dist/chat/use-statewire-approval-request.cjs +73 -4
- package/dist/chat/use-statewire-approval-request.cjs.map +1 -1
- package/dist/chat/use-statewire-approval-request.js +74 -5
- package/dist/chat/use-statewire-approval-request.js.map +1 -1
- package/dist/chat-ui/composer/composer-message.cjs +284 -0
- package/dist/chat-ui/composer/composer-message.cjs.map +1 -0
- package/dist/chat-ui/composer/composer-message.d.ts +152 -0
- package/dist/chat-ui/composer/composer-message.js +284 -0
- package/dist/chat-ui/composer/composer-message.js.map +1 -0
- package/dist/chat-ui/composer/tiptap-composer.cjs +57 -11
- package/dist/chat-ui/composer/tiptap-composer.cjs.map +1 -1
- package/dist/chat-ui/composer/tiptap-composer.d.ts +34 -6
- package/dist/chat-ui/composer/tiptap-composer.js +57 -11
- package/dist/chat-ui/composer/tiptap-composer.js.map +1 -1
- package/dist/chat-ui/index.cjs +4 -1
- package/dist/chat-ui/index.cjs.map +1 -1
- package/dist/chat-ui/index.d.ts +3 -2
- package/dist/chat-ui/index.js +5 -2
- package/dist/chat-ui/index.js.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.cjs +3 -2
- package/dist/chat-ui/mentions/mention-chip.cjs.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.js +4 -3
- package/dist/chat-ui/mentions/mention-chip.js.map +1 -1
- package/dist/chat-ui/mentions/mention-extension.cjs +8 -2
- package/dist/chat-ui/mentions/mention-extension.cjs.map +1 -1
- package/dist/chat-ui/mentions/mention-extension.js +8 -2
- package/dist/chat-ui/mentions/mention-extension.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-popup.cjs +3 -1
- package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-popup.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-popup.js +3 -1
- package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-popup.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs +65 -19
- package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/sources/index.d.ts +15 -0
- package/dist/chat-ui/mentions/suggestions/data/sources/index.js +67 -21
- package/dist/chat-ui/mentions/suggestions/data/sources/index.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.cjs +4 -2
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.d.ts +2 -1
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.js +5 -3
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.js.map +1 -1
- package/dist/chat-ui/messages/message-components.cjs +30 -10
- package/dist/chat-ui/messages/message-components.cjs.map +1 -1
- package/dist/chat-ui/messages/message-components.d.ts +21 -1
- package/dist/chat-ui/messages/message-components.js +30 -10
- package/dist/chat-ui/messages/message-components.js.map +1 -1
- package/dist/chat-ui/messages/runtime-message.cjs +1 -1
- package/dist/chat-ui/messages/runtime-message.js +1 -1
- package/dist/chat-ui/messages/statewire-continue-run.cjs +5 -5
- package/dist/chat-ui/messages/statewire-continue-run.js +5 -5
- package/dist/chat-ui/messages/user-edit-composer.cjs +1 -1
- package/dist/chat-ui/messages/user-edit-composer.js +1 -1
- package/dist/chat-ui/messages/wake-marker.cjs +39 -4
- package/dist/chat-ui/messages/wake-marker.cjs.map +1 -1
- package/dist/chat-ui/messages/wake-marker.d.ts +16 -5
- package/dist/chat-ui/messages/wake-marker.js +40 -5
- package/dist/chat-ui/messages/wake-marker.js.map +1 -1
- package/dist/chat-ui/rich-text/chat-message-body.cjs +12 -8
- package/dist/chat-ui/rich-text/chat-message-body.cjs.map +1 -1
- package/dist/chat-ui/rich-text/chat-message-body.d.ts +6 -1
- package/dist/chat-ui/rich-text/chat-message-body.js +13 -9
- package/dist/chat-ui/rich-text/chat-message-body.js.map +1 -1
- package/dist/chat-ui/rich-text/chat-text-schema.cjs +64 -6
- package/dist/chat-ui/rich-text/chat-text-schema.cjs.map +1 -1
- package/dist/chat-ui/rich-text/chat-text-schema.d.ts +5 -0
- package/dist/chat-ui/rich-text/chat-text-schema.js +66 -8
- package/dist/chat-ui/rich-text/chat-text-schema.js.map +1 -1
- package/dist/chat-ui/statewire.cjs +1 -1
- package/dist/chat-ui/statewire.d.ts +1 -1
- package/dist/chat-ui/statewire.js +1 -1
- package/dist/chat-ui/thread/statewire-history-edge.cjs +2 -2
- package/dist/chat-ui/thread/statewire-history-edge.js +2 -2
- package/dist/collab/client.cjs +218 -13
- package/dist/collab/client.cjs.map +1 -1
- package/dist/collab/client.d.ts +105 -2
- package/dist/collab/client.js +221 -17
- package/dist/collab/client.js.map +1 -1
- package/dist/collab/index.cjs +2 -0
- package/dist/collab/index.cjs.map +1 -1
- package/dist/collab/index.d.ts +1 -1
- package/dist/collab/index.js +3 -1
- package/dist/composer/AttachmentContext.cjs +38 -12
- package/dist/composer/AttachmentContext.cjs.map +1 -1
- package/dist/composer/AttachmentContext.d.ts +22 -1
- package/dist/composer/AttachmentContext.js +40 -14
- package/dist/composer/AttachmentContext.js.map +1 -1
- package/dist/composer/QuoteContext.cjs +80 -28
- package/dist/composer/QuoteContext.cjs.map +1 -1
- package/dist/composer/QuoteContext.d.ts +35 -6
- package/dist/composer/QuoteContext.js +82 -30
- package/dist/composer/QuoteContext.js.map +1 -1
- package/dist/composer/build-composed-message.cjs +27 -0
- package/dist/composer/build-composed-message.cjs.map +1 -1
- package/dist/composer/build-composed-message.d.ts +21 -0
- package/dist/composer/build-composed-message.js +28 -1
- package/dist/composer/build-composed-message.js.map +1 -1
- package/dist/composer/composer-handoff.cjs +13 -1
- package/dist/composer/composer-handoff.cjs.map +1 -1
- package/dist/composer/composer-handoff.d.ts +12 -0
- package/dist/composer/composer-handoff.js +15 -3
- package/dist/composer/composer-handoff.js.map +1 -1
- package/dist/composer/index.d.ts +6 -3
- package/dist/composer/useReadComposerDraft.cjs +16 -0
- package/dist/composer/useReadComposerDraft.cjs.map +1 -0
- package/dist/composer/useReadComposerDraft.d.ts +6 -0
- package/dist/composer/useReadComposerDraft.js +16 -0
- package/dist/composer/useReadComposerDraft.js.map +1 -0
- package/dist/diagnostics/errors.cjs +6 -0
- package/dist/diagnostics/errors.cjs.map +1 -1
- package/dist/diagnostics/errors.d.ts +6 -0
- package/dist/diagnostics/errors.js +6 -0
- package/dist/diagnostics/errors.js.map +1 -1
- package/dist/index.cjs +159 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +53 -12
- package/dist/index.js +166 -14
- package/dist/index.js.map +1 -1
- package/dist/lib/owner-document.cjs +32 -0
- package/dist/lib/owner-document.cjs.map +1 -0
- package/dist/lib/owner-document.d.ts +17 -0
- package/dist/lib/owner-document.js +32 -0
- package/dist/lib/owner-document.js.map +1 -0
- package/dist/lib/portal-surface.cjs +55 -0
- package/dist/lib/portal-surface.cjs.map +1 -0
- package/dist/lib/portal-surface.d.ts +37 -0
- package/dist/lib/portal-surface.js +55 -0
- package/dist/lib/portal-surface.js.map +1 -0
- package/dist/lib/use-athena-rest-query.cjs +34 -0
- package/dist/lib/use-athena-rest-query.cjs.map +1 -0
- package/dist/lib/use-athena-rest-query.d.ts +31 -0
- package/dist/lib/use-athena-rest-query.js +34 -0
- package/dist/lib/use-athena-rest-query.js.map +1 -0
- package/dist/provider/AthenaProvider.cjs +36 -6
- package/dist/provider/AthenaProvider.cjs.map +1 -1
- package/dist/provider/AthenaProvider.d.ts +20 -1
- package/dist/provider/AthenaProvider.js +38 -8
- package/dist/provider/AthenaProvider.js.map +1 -1
- package/dist/provider/citation-links.d.ts +10 -2
- package/dist/{packages/react → react}/package.json.cjs +1 -1
- package/dist/{packages/react → react}/package.json.js +1 -1
- package/dist/runtime/statewire-lifecycle.cjs +15 -3
- package/dist/runtime/statewire-lifecycle.cjs.map +1 -1
- package/dist/runtime/statewire-lifecycle.d.ts +6 -0
- package/dist/runtime/statewire-lifecycle.js +15 -3
- package/dist/runtime/statewire-lifecycle.js.map +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.cjs +11 -7
- package/dist/runtime/useAthenaStatewireRuntime.cjs.map +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.js +11 -7
- package/dist/runtime/useAthenaStatewireRuntime.js.map +1 -1
- package/dist/search/useAthenaRepoSearch.cjs +5 -13
- package/dist/search/useAthenaRepoSearch.cjs.map +1 -1
- package/dist/search/useAthenaRepoSearch.d.ts +3 -3
- package/dist/search/useAthenaRepoSearch.js +6 -14
- package/dist/search/useAthenaRepoSearch.js.map +1 -1
- package/dist/sheet-range/a1.cjs +162 -0
- package/dist/sheet-range/a1.cjs.map +1 -0
- package/dist/sheet-range/a1.d.ts +91 -0
- package/dist/sheet-range/a1.js +162 -0
- package/dist/sheet-range/a1.js.map +1 -0
- package/dist/sheet-range/index.cjs +22 -0
- package/dist/sheet-range/index.cjs.map +1 -0
- package/dist/sheet-range/index.d.ts +12 -0
- package/dist/sheet-range/index.js +22 -0
- package/dist/sheet-range/index.js.map +1 -0
- package/dist/sheet-range/range-preview-table.cjs +75 -0
- package/dist/sheet-range/range-preview-table.cjs.map +1 -0
- package/dist/sheet-range/range-preview-table.d.ts +20 -0
- package/dist/sheet-range/range-preview-table.js +75 -0
- package/dist/sheet-range/range-preview-table.js.map +1 -0
- package/dist/sheet-range/range-preview.cjs +116 -0
- package/dist/sheet-range/range-preview.cjs.map +1 -0
- package/dist/sheet-range/range-preview.d.ts +67 -0
- package/dist/sheet-range/range-preview.js +116 -0
- package/dist/sheet-range/range-preview.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/threads/Inbox.cjs +289 -0
- package/dist/threads/Inbox.cjs.map +1 -0
- package/dist/threads/Inbox.d.ts +46 -0
- package/dist/threads/Inbox.js +289 -0
- package/dist/threads/Inbox.js.map +1 -0
- package/dist/threads/SessionList.cjs +51 -126
- package/dist/threads/SessionList.cjs.map +1 -1
- package/dist/threads/SessionList.d.ts +26 -1
- package/dist/threads/SessionList.js +45 -120
- package/dist/threads/SessionList.js.map +1 -1
- package/dist/threads/SessionsPage.cjs +753 -0
- package/dist/threads/SessionsPage.cjs.map +1 -0
- package/dist/threads/SessionsPage.d.ts +35 -0
- package/dist/threads/SessionsPage.js +753 -0
- package/dist/threads/SessionsPage.js.map +1 -0
- package/dist/threads/api.cjs +21 -1
- package/dist/threads/api.cjs.map +1 -1
- package/dist/threads/api.d.ts +59 -0
- package/dist/threads/api.js +21 -1
- package/dist/threads/api.js.map +1 -1
- package/dist/threads/conversation-list-fetcher.cjs +9 -2
- package/dist/threads/conversation-list-fetcher.cjs.map +1 -1
- package/dist/threads/conversation-list-fetcher.d.ts +14 -1
- package/dist/threads/conversation-list-fetcher.js +9 -2
- package/dist/threads/conversation-list-fetcher.js.map +1 -1
- package/dist/threads/index.d.ts +2 -1
- package/dist/threads/pull-request-display.cjs +25 -0
- package/dist/threads/pull-request-display.cjs.map +1 -0
- package/dist/threads/pull-request-display.d.ts +15 -0
- package/dist/threads/pull-request-display.js +25 -0
- package/dist/threads/pull-request-display.js.map +1 -0
- package/dist/threads/session-list-model.cjs +16 -2
- package/dist/threads/session-list-model.cjs.map +1 -1
- package/dist/threads/session-list-model.d.ts +10 -0
- package/dist/threads/session-list-model.js +16 -2
- package/dist/threads/session-list-model.js.map +1 -1
- package/dist/threads/session-row-parts.cjs +152 -0
- package/dist/threads/session-row-parts.cjs.map +1 -0
- package/dist/threads/session-row-parts.d.ts +50 -0
- package/dist/threads/session-row-parts.js +152 -0
- package/dist/threads/session-row-parts.js.map +1 -0
- package/dist/threads/sessions-page-model.cjs +305 -0
- package/dist/threads/sessions-page-model.cjs.map +1 -0
- package/dist/threads/sessions-page-model.d.ts +86 -0
- package/dist/threads/sessions-page-model.js +305 -0
- package/dist/threads/sessions-page-model.js.map +1 -0
- package/dist/threads/sessions-page-storage.cjs +93 -0
- package/dist/threads/sessions-page-storage.cjs.map +1 -0
- package/dist/threads/sessions-page-storage.d.ts +23 -0
- package/dist/threads/sessions-page-storage.js +93 -0
- package/dist/threads/sessions-page-storage.js.map +1 -0
- package/dist/threads/sessions-query.cjs +235 -0
- package/dist/threads/sessions-query.cjs.map +1 -0
- package/dist/threads/sessions-query.d.ts +119 -0
- package/dist/threads/sessions-query.js +235 -0
- package/dist/threads/sessions-query.js.map +1 -0
- package/dist/threads/statewire-thread-list.cjs +133 -40
- package/dist/threads/statewire-thread-list.cjs.map +1 -1
- package/dist/threads/statewire-thread-list.d.ts +83 -2
- package/dist/threads/statewire-thread-list.js +134 -41
- package/dist/threads/statewire-thread-list.js.map +1 -1
- package/dist/threads/use-athena-sessions.cjs +198 -0
- package/dist/threads/use-athena-sessions.cjs.map +1 -0
- package/dist/threads/use-athena-sessions.d.ts +81 -0
- package/dist/threads/use-athena-sessions.js +198 -0
- package/dist/threads/use-athena-sessions.js.map +1 -0
- package/dist/threads/use-rest-conversation-history.cjs +1 -1
- package/dist/threads/use-rest-conversation-history.js +1 -1
- package/dist/threads/use-statewire-conversation-history.cjs +1 -1
- package/dist/threads/use-statewire-conversation-history.d.ts +3 -0
- package/dist/threads/use-statewire-conversation-history.js +1 -1
- package/dist/threads/use-thread-read-state.cjs +73 -0
- package/dist/threads/use-thread-read-state.cjs.map +1 -0
- package/dist/threads/use-thread-read-state.d.ts +51 -0
- package/dist/threads/use-thread-read-state.js +73 -0
- package/dist/threads/use-thread-read-state.js.map +1 -0
- package/dist/tiptap-markdown-table/src/markdown-table-serializer.cjs.map +1 -0
- package/dist/tiptap-markdown-table/src/markdown-table-serializer.js.map +1 -0
- package/dist/tools/auto-open-tools.cjs +2 -0
- package/dist/tools/auto-open-tools.cjs.map +1 -1
- package/dist/tools/auto-open-tools.js +2 -0
- package/dist/tools/auto-open-tools.js.map +1 -1
- package/dist/tools/file-tool-uis.cjs +18 -43
- package/dist/tools/file-tool-uis.cjs.map +1 -1
- package/dist/tools/file-tool-uis.d.ts +1 -2
- package/dist/tools/file-tool-uis.js +18 -42
- package/dist/tools/file-tool-uis.js.map +1 -1
- package/dist/tools/index.cjs +6 -2
- package/dist/tools/index.cjs.map +1 -1
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.js +6 -2
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/misc-tool-uis.cjs +2 -2
- package/dist/tools/misc-tool-uis.js +2 -2
- package/dist/tools/primitives.cjs +1 -1
- package/dist/tools/primitives.js +1 -1
- package/dist/tools/read-asset-tool-ui.cjs +21 -70
- package/dist/tools/read-asset-tool-ui.cjs.map +1 -1
- package/dist/tools/read-asset-tool-ui.js +21 -70
- package/dist/tools/read-asset-tool-ui.js.map +1 -1
- package/dist/tools/step-text.cjs +21 -0
- package/dist/tools/step-text.cjs.map +1 -0
- package/dist/tools/step-text.d.ts +10 -0
- package/dist/tools/step-text.js +21 -0
- package/dist/tools/step-text.js.map +1 -0
- package/dist/tools/tool-fallback.cjs +24 -5
- package/dist/tools/tool-fallback.cjs.map +1 -1
- package/dist/tools/tool-fallback.d.ts +3 -1
- package/dist/tools/tool-fallback.js +24 -5
- package/dist/tools/tool-fallback.js.map +1 -1
- package/dist/tools/tool-summary.cjs +661 -0
- package/dist/tools/tool-summary.cjs.map +1 -0
- package/dist/tools/tool-summary.d.ts +99 -0
- package/dist/tools/tool-summary.js +661 -0
- package/dist/tools/tool-summary.js.map +1 -0
- package/dist/tools/tool-uis.cjs +39 -97
- package/dist/tools/tool-uis.cjs.map +1 -1
- package/dist/tools/tool-uis.js +39 -97
- package/dist/tools/tool-uis.js.map +1 -1
- package/dist/tools/voice-update-tool-ui.cjs +1 -1
- package/dist/tools/voice-update-tool-ui.js +1 -1
- package/dist/tools/write-todos-tool-ui.cjs +3 -2
- package/dist/tools/write-todos-tool-ui.cjs.map +1 -1
- package/dist/tools/write-todos-tool-ui.d.ts +5 -0
- package/dist/tools/write-todos-tool-ui.js +5 -4
- package/dist/tools/write-todos-tool-ui.js.map +1 -1
- package/dist/ui/popover.cjs +6 -6
- package/dist/ui/popover.cjs.map +1 -1
- package/dist/ui/popover.js +6 -6
- package/dist/ui/popover.js.map +1 -1
- package/dist/ui/tooltip.cjs +16 -2
- package/dist/ui/tooltip.cjs.map +1 -1
- package/dist/ui/tooltip.d.ts +1 -1
- package/dist/ui/tooltip.js +16 -2
- package/dist/ui/tooltip.js.map +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.js +1 -1
- package/dist/voice/use-athena-voice-session.cjs.map +1 -1
- package/dist/voice/use-athena-voice-session.d.ts +3 -3
- package/dist/voice/use-athena-voice-session.js.map +1 -1
- package/dist/workbench/SessionWorkbench.cjs +378 -0
- package/dist/workbench/SessionWorkbench.cjs.map +1 -0
- package/dist/workbench/SessionWorkbench.d.ts +30 -0
- package/dist/workbench/SessionWorkbench.js +378 -0
- package/dist/workbench/SessionWorkbench.js.map +1 -0
- package/dist/workbench/session-workbench-context.cjs +26 -0
- package/dist/workbench/session-workbench-context.cjs.map +1 -0
- package/dist/workbench/session-workbench-context.d.ts +55 -0
- package/dist/workbench/session-workbench-context.js +26 -0
- package/dist/workbench/session-workbench-context.js.map +1 -0
- package/dist/workbench/session-workbench-model.cjs +288 -0
- package/dist/workbench/session-workbench-model.cjs.map +1 -0
- package/dist/workbench/session-workbench-model.d.ts +168 -0
- package/dist/workbench/session-workbench-model.js +288 -0
- package/dist/workbench/session-workbench-model.js.map +1 -0
- package/dist/workbench/session-workbench-panes.cjs +580 -0
- package/dist/workbench/session-workbench-panes.cjs.map +1 -0
- package/dist/workbench/session-workbench-panes.d.ts +16 -0
- package/dist/workbench/session-workbench-panes.js +580 -0
- package/dist/workbench/session-workbench-panes.js.map +1 -0
- package/dist/workbench/session-workspace-api.cjs +157 -0
- package/dist/workbench/session-workspace-api.cjs.map +1 -0
- package/dist/workbench/session-workspace-api.d.ts +70 -0
- package/dist/workbench/session-workspace-api.js +157 -0
- package/dist/workbench/session-workspace-api.js.map +1 -0
- package/dist/workbench/use-session-workspace.cjs +100 -0
- package/dist/workbench/use-session-workspace.cjs.map +1 -0
- package/dist/workbench/use-session-workspace.d.ts +45 -0
- package/dist/workbench/use-session-workspace.js +100 -0
- package/dist/workbench/use-session-workspace.js.map +1 -0
- package/dist/workbench/workbench-layout-context.cjs +10 -0
- package/dist/workbench/workbench-layout-context.cjs.map +1 -0
- package/dist/workbench/workbench-layout-context.d.ts +17 -0
- package/dist/workbench/workbench-layout-context.js +10 -0
- package/dist/workbench/workbench-layout-context.js.map +1 -0
- package/package.json +20 -9
- package/dist/node_modules/@assistant-ui/react-langchain/dist/converter.cjs +0 -77
- package/dist/node_modules/@assistant-ui/react-langchain/dist/converter.cjs.map +0 -1
- package/dist/node_modules/@assistant-ui/react-langchain/dist/converter.js +0 -77
- package/dist/node_modules/@assistant-ui/react-langchain/dist/converter.js.map +0 -1
- package/dist/node_modules/@assistant-ui/react-langgraph/dist/convertLangChainMessages.cjs +0 -181
- package/dist/node_modules/@assistant-ui/react-langgraph/dist/convertLangChainMessages.cjs.map +0 -1
- package/dist/node_modules/@assistant-ui/react-langgraph/dist/convertLangChainMessages.js +0 -181
- package/dist/node_modules/@assistant-ui/react-langgraph/dist/convertLangChainMessages.js.map +0 -1
- package/dist/packages/agent-runtime/src/asset-attachment.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/asset-attachment.js.map +0 -1
- package/dist/packages/agent-runtime/src/auth-denial.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/auth-denial.js.map +0 -1
- package/dist/packages/agent-runtime/src/client-tool-bridge.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/client-tool-bridge.js.map +0 -1
- package/dist/packages/agent-runtime/src/client-tools.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/client-tools.js.map +0 -1
- package/dist/packages/agent-runtime/src/conversation-index.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/conversation-index.js.map +0 -1
- package/dist/packages/agent-runtime/src/conversation-list.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/conversation-list.js.map +0 -1
- package/dist/packages/agent-runtime/src/deep-agent-transport-recipe.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/deep-agent-transport-recipe.js.map +0 -1
- package/dist/packages/agent-runtime/src/edit-command.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/edit-command.js.map +0 -1
- package/dist/packages/agent-runtime/src/errors.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/errors.js.map +0 -1
- package/dist/packages/agent-runtime/src/generated/runconfig-contract.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/generated/runconfig-contract.js.map +0 -1
- package/dist/packages/agent-runtime/src/github-wake-event.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/github-wake-event.js.map +0 -1
- package/dist/packages/agent-runtime/src/interrupts.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/interrupts.js.map +0 -1
- package/dist/packages/agent-runtime/src/message-author.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/message-author.js.map +0 -1
- package/dist/packages/agent-runtime/src/message-window.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/message-window.js.map +0 -1
- package/dist/packages/agent-runtime/src/messages.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/messages.js.map +0 -1
- package/dist/packages/agent-runtime/src/model-context.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/model-context.js.map +0 -1
- package/dist/packages/agent-runtime/src/optimistic-content.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/optimistic-content.js.map +0 -1
- package/dist/packages/agent-runtime/src/protocol.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/protocol.js.map +0 -1
- package/dist/packages/agent-runtime/src/queue.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/queue.js.map +0 -1
- package/dist/packages/agent-runtime/src/quota-safe-local-storage-session.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/quota-safe-local-storage-session.js.map +0 -1
- package/dist/packages/agent-runtime/src/runtime-messages.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/runtime-messages.js.map +0 -1
- package/dist/packages/agent-runtime/src/screen-point.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/screen-point.js.map +0 -1
- package/dist/packages/agent-runtime/src/send-recovery.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/send-recovery.js.map +0 -1
- package/dist/packages/agent-runtime/src/statewire-attach-observer.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/statewire-attach-observer.js.map +0 -1
- package/dist/packages/agent-runtime/src/statewire-state.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/statewire-state.js.map +0 -1
- package/dist/packages/agent-runtime/src/statewire-suspended.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/statewire-suspended.js.map +0 -1
- package/dist/packages/agent-runtime/src/statewire-transport.cjs +0 -11
- package/dist/packages/agent-runtime/src/statewire-transport.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/statewire-transport.js +0 -11
- package/dist/packages/agent-runtime/src/statewire-transport.js.map +0 -1
- package/dist/packages/agent-runtime/src/streaming-markdown.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/streaming-markdown.js.map +0 -1
- package/dist/packages/agent-runtime/src/thread-extras.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/thread-extras.js.map +0 -1
- package/dist/packages/agent-runtime/src/thread-snapshot-cache.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/thread-snapshot-cache.js.map +0 -1
- package/dist/packages/agent-runtime/src/thread-status.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/thread-status.js.map +0 -1
- package/dist/packages/agent-runtime/src/tool-metadata.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/tool-metadata.js.map +0 -1
- package/dist/packages/agent-runtime/src/tool-outputs.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/tool-outputs.js.map +0 -1
- package/dist/packages/agent-runtime/src/tool-result.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/tool-result.js.map +0 -1
- package/dist/packages/agent-runtime/src/use-conversation-list.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/use-conversation-list.js.map +0 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-config.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-config.js.map +0 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-edit-submit.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-edit-submit.js.map +0 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-runtime.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-runtime.js.map +0 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-thread.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-thread.js.map +0 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-window-sync.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/use-deep-agent-window-sync.js.map +0 -1
- package/dist/packages/agent-runtime/src/voice-presentation.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/voice-presentation.js.map +0 -1
- package/dist/packages/agent-runtime/src/voice-turn-grouping.cjs.map +0 -1
- package/dist/packages/agent-runtime/src/voice-turn-grouping.js.map +0 -1
- package/dist/packages/tiptap-markdown-table/src/markdown-table-serializer.cjs.map +0 -1
- package/dist/packages/tiptap-markdown-table/src/markdown-table-serializer.js.map +0 -1
- /package/dist/{packages/agent-runtime → agent-runtime}/src/asset-attachment.cjs +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/asset-attachment.js +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/auth-denial.cjs +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/auth-denial.js +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/client-tool-bridge.cjs +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/client-tool-bridge.js +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/client-tools.cjs +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/client-tools.js +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/conversation-index.cjs +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/conversation-index.js +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/edit-command.cjs +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/edit-command.js +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/github-wake-event.cjs +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/github-wake-event.js +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/message-author.cjs +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/message-author.js +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/message-window.cjs +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/message-window.js +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/model-context.cjs +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/model-context.js +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/optimistic-content.cjs +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/optimistic-content.js +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/protocol.cjs +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/protocol.js +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/runtime-messages.cjs +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/runtime-messages.js +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/screen-point.cjs +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/screen-point.js +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/send-recovery.cjs +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/send-recovery.js +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/statewire-attach-observer.cjs +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/statewire-attach-observer.js +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/streaming-markdown.cjs +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/streaming-markdown.js +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/thread-extras.cjs +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/thread-extras.js +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/thread-snapshot-cache.cjs +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/thread-snapshot-cache.js +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/thread-status.cjs +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/thread-status.js +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/tool-outputs.cjs +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/tool-outputs.js +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/tool-result.cjs +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/tool-result.js +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/use-deep-agent-config.cjs +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/use-deep-agent-config.js +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/use-deep-agent-runtime.cjs +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/use-deep-agent-runtime.js +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/use-deep-agent-window-sync.cjs +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/use-deep-agent-window-sync.js +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/voice-turn-grouping.cjs +0 -0
- /package/dist/{packages/agent-runtime → agent-runtime}/src/voice-turn-grouping.js +0 -0
- /package/dist/{packages/react → react}/package.json.cjs.map +0 -0
- /package/dist/{packages/react → react}/package.json.js.map +0 -0
- /package/dist/{packages/tiptap-markdown-table → tiptap-markdown-table}/src/markdown-table-serializer.cjs +0 -0
- /package/dist/{packages/tiptap-markdown-table → tiptap-markdown-table}/src/markdown-table-serializer.js +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext, useMemo } from "react";
|
|
3
|
+
const OwnerDocumentContext = createContext(null);
|
|
4
|
+
function OwnerDocumentProvider({ document: doc, children }) {
|
|
5
|
+
return /* @__PURE__ */ jsx(OwnerDocumentContext.Provider, { value: doc, children });
|
|
6
|
+
}
|
|
7
|
+
function useOwnerDocument() {
|
|
8
|
+
const provided = useContext(OwnerDocumentContext);
|
|
9
|
+
if (provided) return provided;
|
|
10
|
+
return typeof document !== "undefined" ? document : null;
|
|
11
|
+
}
|
|
12
|
+
function useIsInPopoutDocument() {
|
|
13
|
+
const provided = useContext(OwnerDocumentContext);
|
|
14
|
+
return provided !== null && typeof document !== "undefined" && provided !== document;
|
|
15
|
+
}
|
|
16
|
+
function usePortalContainer() {
|
|
17
|
+
const provided = useContext(OwnerDocumentContext);
|
|
18
|
+
return useMemo(() => {
|
|
19
|
+
var _a;
|
|
20
|
+
if (!provided) return void 0;
|
|
21
|
+
if (typeof document !== "undefined" && provided === document) return void 0;
|
|
22
|
+
if ((_a = provided.defaultView) == null ? void 0 : _a.closed) return void 0;
|
|
23
|
+
return provided.body;
|
|
24
|
+
}, [provided]);
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
OwnerDocumentProvider,
|
|
28
|
+
useIsInPopoutDocument,
|
|
29
|
+
useOwnerDocument,
|
|
30
|
+
usePortalContainer
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=owner-document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"owner-document.js","sources":["../../src/lib/owner-document.tsx"],"sourcesContent":["'use client';\n\nimport { createContext, type ReactNode, useContext, useMemo } from 'react';\n\n/**\n * Which browser document a component is rendered into.\n *\n * A host pops a pane out by portaling it into a second browser window (Olympus's\n * Spaces popouts, a desktop shell's pop-out windows): the React tree keeps\n * running in the main window while its DOM lives in the popout's document.\n * Anything that reaches for the global `document` then talks to the wrong\n * window — most visibly Radix/shadcn portals, which mount menus, dialogs and\n * tooltips into the MAIN window's body while their trigger sits in the popout.\n *\n * `OwnerDocumentProvider` is mounted by the host around every popped-out\n * subtree (Olympus's Spaces popout frame wraps every tab and the popout\n * window's own layout chrome). The SDK's own portaled UI (popover, tooltip,\n * the composer's mention menu) and the host's portals read the same context.\n * In the main window nothing is provided and the hooks fall back to the\n * globals, with `usePortalContainer()` returning `undefined` so every library\n * keeps its default container.\n */\nconst OwnerDocumentContext = createContext<Document | null>(null);\n\nexport interface OwnerDocumentProviderProps {\n /** The document hosting this subtree; `null` for the main window. */\n document: Document | null;\n children: ReactNode;\n}\n\nexport function OwnerDocumentProvider({ document: doc, children }: OwnerDocumentProviderProps) {\n return <OwnerDocumentContext.Provider value={doc}>{children}</OwnerDocumentContext.Provider>;\n}\n\n/** The document this subtree renders into, or the global document when not in a popout. */\nexport function useOwnerDocument(): Document | null {\n const provided = useContext(OwnerDocumentContext);\n if (provided) return provided;\n return typeof document !== 'undefined' ? document : null;\n}\n\n/** `true` when the subtree is hosted by a popout window rather than the main document. */\nexport function useIsInPopoutDocument(): boolean {\n const provided = useContext(OwnerDocumentContext);\n return provided !== null && typeof document !== 'undefined' && provided !== document;\n}\n\n/**\n * The `container` to hand a portal so it opens in the window its trigger is\n * in: the popout's `body`, or `undefined` in the main window so the library\n * default applies. Guards against a since-closed popout window.\n */\nexport function usePortalContainer(): HTMLElement | undefined {\n const provided = useContext(OwnerDocumentContext);\n return useMemo(() => {\n if (!provided) return undefined;\n if (typeof document !== 'undefined' && provided === document) return undefined;\n if (provided.defaultView?.closed) return undefined;\n return provided.body;\n }, [provided]);\n}\n"],"names":[],"mappings":";;AAsBA,MAAM,uBAAuB,cAA+B,IAAI;AAQzD,SAAS,sBAAsB,EAAE,UAAU,KAAK,YAAwC;AAC7F,6BAAQ,qBAAqB,UAArB,EAA8B,OAAO,KAAM,UAAS;AAC9D;AAGO,SAAS,mBAAoC;AAClD,QAAM,WAAW,WAAW,oBAAoB;AAChD,MAAI,SAAU,QAAO;AACrB,SAAO,OAAO,aAAa,cAAc,WAAW;AACtD;AAGO,SAAS,wBAAiC;AAC/C,QAAM,WAAW,WAAW,oBAAoB;AAChD,SAAO,aAAa,QAAQ,OAAO,aAAa,eAAe,aAAa;AAC9E;AAOO,SAAS,qBAA8C;AAC5D,QAAM,WAAW,WAAW,oBAAoB;AAChD,SAAO,QAAQ,MAAM;;AACnB,QAAI,CAAC,SAAU,QAAO;AACtB,QAAI,OAAO,aAAa,eAAe,aAAa,SAAU,QAAO;AACrE,SAAI,cAAS,gBAAT,mBAAsB,OAAQ,QAAO;AACzC,WAAO,SAAS;AAAA,EAClB,GAAG,CAAC,QAAQ,CAAC;AACf;"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const cnfast = require("cnfast");
|
|
4
|
+
const SURFACES = {
|
|
5
|
+
popover: [
|
|
6
|
+
{ property: "display", value: "block", utility: "block" },
|
|
7
|
+
{ property: "backgroundColor", value: "var(--popover)", utility: "bg-popover" },
|
|
8
|
+
{ property: "color", value: "var(--popover-foreground)", utility: "text-popover-foreground" },
|
|
9
|
+
{ property: "borderColor", value: "var(--border)", utility: "border-border" }
|
|
10
|
+
],
|
|
11
|
+
tooltip: [
|
|
12
|
+
{ property: "display", value: "block", utility: "block" },
|
|
13
|
+
{ property: "backgroundColor", value: "var(--foreground)", utility: "bg-foreground" },
|
|
14
|
+
{ property: "color", value: "var(--background)", utility: "text-background" }
|
|
15
|
+
]
|
|
16
|
+
};
|
|
17
|
+
function utilityOf(token) {
|
|
18
|
+
let depth = 0;
|
|
19
|
+
let start = 0;
|
|
20
|
+
for (let index = 0; index < token.length; index += 1) {
|
|
21
|
+
const char = token[index];
|
|
22
|
+
if (char === "[" || char === "(") depth += 1;
|
|
23
|
+
else if (char === "]" || char === ")") depth -= 1;
|
|
24
|
+
else if (char === ":" && depth === 0) start = index + 1;
|
|
25
|
+
}
|
|
26
|
+
return token.slice(start).replace(/^!|!$/g, "");
|
|
27
|
+
}
|
|
28
|
+
function callerSets(className, utility) {
|
|
29
|
+
if (!className) return false;
|
|
30
|
+
return className.split(/\s+/).some((token) => {
|
|
31
|
+
const base = utilityOf(token);
|
|
32
|
+
if (!base || base === utility) return false;
|
|
33
|
+
return !cnfast.cn(utility, base).split(" ").includes(utility) || !cnfast.cn(base, utility).split(" ").includes(base);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function portalSurfaceStyle({
|
|
37
|
+
surface,
|
|
38
|
+
className,
|
|
39
|
+
themeStyle,
|
|
40
|
+
style
|
|
41
|
+
}) {
|
|
42
|
+
const defaults = {};
|
|
43
|
+
for (const { property, value, utility } of SURFACES[surface]) {
|
|
44
|
+
if (!callerSets(className, utility)) defaults[property] = value;
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
...defaults,
|
|
48
|
+
// The wrapper's `.athena-themed` sets the theme's face; a portal root sets it here.
|
|
49
|
+
...themeStyle ? { fontFamily: "var(--font-family, inherit)" } : {},
|
|
50
|
+
...themeStyle,
|
|
51
|
+
...style
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
exports.portalSurfaceStyle = portalSurfaceStyle;
|
|
55
|
+
//# sourceMappingURL=portal-surface.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portal-surface.cjs","sources":["../../src/lib/portal-surface.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport { cn } from './utils';\n\n/** The look of a portaled root: a popover-like panel, or a tooltip. */\nexport type PortalSurface = 'popover' | 'tooltip';\n\n/** An inline default, with the utility class of the root's own class list it stands in for. */\ninterface SurfaceDefault {\n property: 'display' | 'backgroundColor' | 'color' | 'borderColor';\n value: string;\n utility: string;\n}\n\nconst SURFACES: Record<PortalSurface, readonly SurfaceDefault[]> = {\n popover: [\n { property: 'display', value: 'block', utility: 'block' },\n { property: 'backgroundColor', value: 'var(--popover)', utility: 'bg-popover' },\n { property: 'color', value: 'var(--popover-foreground)', utility: 'text-popover-foreground' },\n { property: 'borderColor', value: 'var(--border)', utility: 'border-border' },\n ],\n tooltip: [\n { property: 'display', value: 'block', utility: 'block' },\n { property: 'backgroundColor', value: 'var(--foreground)', utility: 'bg-foreground' },\n { property: 'color', value: 'var(--background)', utility: 'text-background' },\n ],\n};\n\n/** A class without its variants (`hover:`, `dark:`, `data-[state=open]:`) and `!` marks. */\nfunction utilityOf(token: string): string {\n let depth = 0;\n let start = 0;\n for (let index = 0; index < token.length; index += 1) {\n const char = token[index];\n if (char === '[' || char === '(') depth += 1;\n else if (char === ']' || char === ')') depth -= 1;\n else if (char === ':' && depth === 0) start = index + 1;\n }\n return token.slice(start).replace(/^!|!$/g, '');\n}\n\n/**\n * Whether the caller's classes set what `utility` sets, at any variant: a class\n * `cn` would let replace it, or that it would replace (`border-x-red-500`\n * against `border-border`). `cn` already resolves the class list this way.\n */\nfunction callerSets(className: string | undefined, utility: string): boolean {\n if (!className) return false;\n return className.split(/\\s+/).some((token) => {\n const base = utilityOf(token);\n if (!base || base === utility) return false;\n return !cn(utility, base).split(' ').includes(utility) || !cn(base, utility).split(' ').includes(base);\n });\n}\n\n/**\n * The inline style of SDK content portaled outside the provider wrapper —\n * tooltips, popovers, the composer's pickers — so it draws its own box and\n * colours in any host.\n *\n * Portaled content renders under the host's `document.body`, inside the host's\n * stylesheet, carrying the SDK's scope classes for its tokens. Stylesheet rules\n * alone cannot be trusted there:\n *\n * - `.athena-sdk` (the tokens) is `display: contents`, its role on the\n * provider wrapper, and `.athena-themed` is too, unlayered — content without\n * a box draws no background, padding or radius.\n * - A host whose Tailwind theme writes the same utilities against tokens of\n * another format (`bg-popover` as `hsl(var(--popover))`, shadcn's HSL\n * channels; Athena's own desktop app) emits them unlayered, beating the\n * SDK's layered utilities, and `hsl()` of the SDK's full colours is invalid:\n * a transparent menu over the page.\n *\n * An inline style beats every stylesheet rule, and its `var(--…)` references\n * resolve against the root's own tokens: the scope class's defaults, a host's\n * overrides of them, and the theme's variables in `themeStyle`. Because it\n * beats the caller's classes too, a property the caller's `className` sets\n * (`bg-red-600`, `hover:text-white`, `flex`) is left to the classes, as\n * before; `style` overrides any of them.\n */\nexport function portalSurfaceStyle({\n surface,\n className,\n themeStyle,\n style,\n}: {\n surface: PortalSurface;\n /** The caller's classes on the root. */\n className?: string;\n /** The provider theme's CSS variables (`useAthenaThemeStyle`), when a theme is set. */\n themeStyle?: CSSProperties | Record<string, string> | null;\n /** The caller's own style, applied last. */\n style?: CSSProperties;\n}): CSSProperties {\n const defaults: CSSProperties = {};\n for (const { property, value, utility } of SURFACES[surface]) {\n if (!callerSets(className, utility)) defaults[property] = value;\n }\n return {\n ...defaults,\n // The wrapper's `.athena-themed` sets the theme's face; a portal root sets it here.\n ...(themeStyle ? { fontFamily: 'var(--font-family, inherit)' } : {}),\n ...(themeStyle as CSSProperties | undefined),\n ...style,\n };\n}\n"],"names":["cn"],"mappings":";;;AAaA,MAAM,WAA6D;AAAA,EACjE,SAAS;AAAA,IACP,EAAE,UAAU,WAAW,OAAO,SAAS,SAAS,QAAA;AAAA,IAChD,EAAE,UAAU,mBAAmB,OAAO,kBAAkB,SAAS,aAAA;AAAA,IACjE,EAAE,UAAU,SAAS,OAAO,6BAA6B,SAAS,0BAAA;AAAA,IAClE,EAAE,UAAU,eAAe,OAAO,iBAAiB,SAAS,gBAAA;AAAA,EAAgB;AAAA,EAE9E,SAAS;AAAA,IACP,EAAE,UAAU,WAAW,OAAO,SAAS,SAAS,QAAA;AAAA,IAChD,EAAE,UAAU,mBAAmB,OAAO,qBAAqB,SAAS,gBAAA;AAAA,IACpE,EAAE,UAAU,SAAS,OAAO,qBAAqB,SAAS,kBAAA;AAAA,EAAkB;AAEhF;AAGA,SAAS,UAAU,OAAuB;AACxC,MAAI,QAAQ;AACZ,MAAI,QAAQ;AACZ,WAAS,QAAQ,GAAG,QAAQ,MAAM,QAAQ,SAAS,GAAG;AACpD,UAAM,OAAO,MAAM,KAAK;AACxB,QAAI,SAAS,OAAO,SAAS,IAAK,UAAS;AAAA,aAClC,SAAS,OAAO,SAAS,IAAK,UAAS;AAAA,aACvC,SAAS,OAAO,UAAU,WAAW,QAAQ;AAAA,EACxD;AACA,SAAO,MAAM,MAAM,KAAK,EAAE,QAAQ,UAAU,EAAE;AAChD;AAOA,SAAS,WAAW,WAA+B,SAA0B;AAC3E,MAAI,CAAC,UAAW,QAAO;AACvB,SAAO,UAAU,MAAM,KAAK,EAAE,KAAK,CAAC,UAAU;AAC5C,UAAM,OAAO,UAAU,KAAK;AAC5B,QAAI,CAAC,QAAQ,SAAS,QAAS,QAAO;AACtC,WAAO,CAACA,OAAAA,GAAG,SAAS,IAAI,EAAE,MAAM,GAAG,EAAE,SAAS,OAAO,KAAK,CAACA,OAAAA,GAAG,MAAM,OAAO,EAAE,MAAM,GAAG,EAAE,SAAS,IAAI;AAAA,EACvG,CAAC;AACH;AA2BO,SAAS,mBAAmB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAQkB;AAChB,QAAM,WAA0B,CAAA;AAChC,aAAW,EAAE,UAAU,OAAO,aAAa,SAAS,OAAO,GAAG;AAC5D,QAAI,CAAC,WAAW,WAAW,OAAO,EAAG,UAAS,QAAQ,IAAI;AAAA,EAC5D;AACA,SAAO;AAAA,IACL,GAAG;AAAA;AAAA,IAEH,GAAI,aAAa,EAAE,YAAY,8BAAA,IAAkC,CAAA;AAAA,IACjE,GAAI;AAAA,IACJ,GAAG;AAAA,EAAA;AAEP;;"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
/** The look of a portaled root: a popover-like panel, or a tooltip. */
|
|
3
|
+
export type PortalSurface = 'popover' | 'tooltip';
|
|
4
|
+
/**
|
|
5
|
+
* The inline style of SDK content portaled outside the provider wrapper —
|
|
6
|
+
* tooltips, popovers, the composer's pickers — so it draws its own box and
|
|
7
|
+
* colours in any host.
|
|
8
|
+
*
|
|
9
|
+
* Portaled content renders under the host's `document.body`, inside the host's
|
|
10
|
+
* stylesheet, carrying the SDK's scope classes for its tokens. Stylesheet rules
|
|
11
|
+
* alone cannot be trusted there:
|
|
12
|
+
*
|
|
13
|
+
* - `.athena-sdk` (the tokens) is `display: contents`, its role on the
|
|
14
|
+
* provider wrapper, and `.athena-themed` is too, unlayered — content without
|
|
15
|
+
* a box draws no background, padding or radius.
|
|
16
|
+
* - A host whose Tailwind theme writes the same utilities against tokens of
|
|
17
|
+
* another format (`bg-popover` as `hsl(var(--popover))`, shadcn's HSL
|
|
18
|
+
* channels; Athena's own desktop app) emits them unlayered, beating the
|
|
19
|
+
* SDK's layered utilities, and `hsl()` of the SDK's full colours is invalid:
|
|
20
|
+
* a transparent menu over the page.
|
|
21
|
+
*
|
|
22
|
+
* An inline style beats every stylesheet rule, and its `var(--…)` references
|
|
23
|
+
* resolve against the root's own tokens: the scope class's defaults, a host's
|
|
24
|
+
* overrides of them, and the theme's variables in `themeStyle`. Because it
|
|
25
|
+
* beats the caller's classes too, a property the caller's `className` sets
|
|
26
|
+
* (`bg-red-600`, `hover:text-white`, `flex`) is left to the classes, as
|
|
27
|
+
* before; `style` overrides any of them.
|
|
28
|
+
*/
|
|
29
|
+
export declare function portalSurfaceStyle({ surface, className, themeStyle, style, }: {
|
|
30
|
+
surface: PortalSurface;
|
|
31
|
+
/** The caller's classes on the root. */
|
|
32
|
+
className?: string;
|
|
33
|
+
/** The provider theme's CSS variables (`useAthenaThemeStyle`), when a theme is set. */
|
|
34
|
+
themeStyle?: CSSProperties | Record<string, string> | null;
|
|
35
|
+
/** The caller's own style, applied last. */
|
|
36
|
+
style?: CSSProperties;
|
|
37
|
+
}): CSSProperties;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { cn } from "cnfast";
|
|
2
|
+
const SURFACES = {
|
|
3
|
+
popover: [
|
|
4
|
+
{ property: "display", value: "block", utility: "block" },
|
|
5
|
+
{ property: "backgroundColor", value: "var(--popover)", utility: "bg-popover" },
|
|
6
|
+
{ property: "color", value: "var(--popover-foreground)", utility: "text-popover-foreground" },
|
|
7
|
+
{ property: "borderColor", value: "var(--border)", utility: "border-border" }
|
|
8
|
+
],
|
|
9
|
+
tooltip: [
|
|
10
|
+
{ property: "display", value: "block", utility: "block" },
|
|
11
|
+
{ property: "backgroundColor", value: "var(--foreground)", utility: "bg-foreground" },
|
|
12
|
+
{ property: "color", value: "var(--background)", utility: "text-background" }
|
|
13
|
+
]
|
|
14
|
+
};
|
|
15
|
+
function utilityOf(token) {
|
|
16
|
+
let depth = 0;
|
|
17
|
+
let start = 0;
|
|
18
|
+
for (let index = 0; index < token.length; index += 1) {
|
|
19
|
+
const char = token[index];
|
|
20
|
+
if (char === "[" || char === "(") depth += 1;
|
|
21
|
+
else if (char === "]" || char === ")") depth -= 1;
|
|
22
|
+
else if (char === ":" && depth === 0) start = index + 1;
|
|
23
|
+
}
|
|
24
|
+
return token.slice(start).replace(/^!|!$/g, "");
|
|
25
|
+
}
|
|
26
|
+
function callerSets(className, utility) {
|
|
27
|
+
if (!className) return false;
|
|
28
|
+
return className.split(/\s+/).some((token) => {
|
|
29
|
+
const base = utilityOf(token);
|
|
30
|
+
if (!base || base === utility) return false;
|
|
31
|
+
return !cn(utility, base).split(" ").includes(utility) || !cn(base, utility).split(" ").includes(base);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function portalSurfaceStyle({
|
|
35
|
+
surface,
|
|
36
|
+
className,
|
|
37
|
+
themeStyle,
|
|
38
|
+
style
|
|
39
|
+
}) {
|
|
40
|
+
const defaults = {};
|
|
41
|
+
for (const { property, value, utility } of SURFACES[surface]) {
|
|
42
|
+
if (!callerSets(className, utility)) defaults[property] = value;
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
...defaults,
|
|
46
|
+
// The wrapper's `.athena-themed` sets the theme's face; a portal root sets it here.
|
|
47
|
+
...themeStyle ? { fontFamily: "var(--font-family, inherit)" } : {},
|
|
48
|
+
...themeStyle,
|
|
49
|
+
...style
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
portalSurfaceStyle
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=portal-surface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portal-surface.js","sources":["../../src/lib/portal-surface.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport { cn } from './utils';\n\n/** The look of a portaled root: a popover-like panel, or a tooltip. */\nexport type PortalSurface = 'popover' | 'tooltip';\n\n/** An inline default, with the utility class of the root's own class list it stands in for. */\ninterface SurfaceDefault {\n property: 'display' | 'backgroundColor' | 'color' | 'borderColor';\n value: string;\n utility: string;\n}\n\nconst SURFACES: Record<PortalSurface, readonly SurfaceDefault[]> = {\n popover: [\n { property: 'display', value: 'block', utility: 'block' },\n { property: 'backgroundColor', value: 'var(--popover)', utility: 'bg-popover' },\n { property: 'color', value: 'var(--popover-foreground)', utility: 'text-popover-foreground' },\n { property: 'borderColor', value: 'var(--border)', utility: 'border-border' },\n ],\n tooltip: [\n { property: 'display', value: 'block', utility: 'block' },\n { property: 'backgroundColor', value: 'var(--foreground)', utility: 'bg-foreground' },\n { property: 'color', value: 'var(--background)', utility: 'text-background' },\n ],\n};\n\n/** A class without its variants (`hover:`, `dark:`, `data-[state=open]:`) and `!` marks. */\nfunction utilityOf(token: string): string {\n let depth = 0;\n let start = 0;\n for (let index = 0; index < token.length; index += 1) {\n const char = token[index];\n if (char === '[' || char === '(') depth += 1;\n else if (char === ']' || char === ')') depth -= 1;\n else if (char === ':' && depth === 0) start = index + 1;\n }\n return token.slice(start).replace(/^!|!$/g, '');\n}\n\n/**\n * Whether the caller's classes set what `utility` sets, at any variant: a class\n * `cn` would let replace it, or that it would replace (`border-x-red-500`\n * against `border-border`). `cn` already resolves the class list this way.\n */\nfunction callerSets(className: string | undefined, utility: string): boolean {\n if (!className) return false;\n return className.split(/\\s+/).some((token) => {\n const base = utilityOf(token);\n if (!base || base === utility) return false;\n return !cn(utility, base).split(' ').includes(utility) || !cn(base, utility).split(' ').includes(base);\n });\n}\n\n/**\n * The inline style of SDK content portaled outside the provider wrapper —\n * tooltips, popovers, the composer's pickers — so it draws its own box and\n * colours in any host.\n *\n * Portaled content renders under the host's `document.body`, inside the host's\n * stylesheet, carrying the SDK's scope classes for its tokens. Stylesheet rules\n * alone cannot be trusted there:\n *\n * - `.athena-sdk` (the tokens) is `display: contents`, its role on the\n * provider wrapper, and `.athena-themed` is too, unlayered — content without\n * a box draws no background, padding or radius.\n * - A host whose Tailwind theme writes the same utilities against tokens of\n * another format (`bg-popover` as `hsl(var(--popover))`, shadcn's HSL\n * channels; Athena's own desktop app) emits them unlayered, beating the\n * SDK's layered utilities, and `hsl()` of the SDK's full colours is invalid:\n * a transparent menu over the page.\n *\n * An inline style beats every stylesheet rule, and its `var(--…)` references\n * resolve against the root's own tokens: the scope class's defaults, a host's\n * overrides of them, and the theme's variables in `themeStyle`. Because it\n * beats the caller's classes too, a property the caller's `className` sets\n * (`bg-red-600`, `hover:text-white`, `flex`) is left to the classes, as\n * before; `style` overrides any of them.\n */\nexport function portalSurfaceStyle({\n surface,\n className,\n themeStyle,\n style,\n}: {\n surface: PortalSurface;\n /** The caller's classes on the root. */\n className?: string;\n /** The provider theme's CSS variables (`useAthenaThemeStyle`), when a theme is set. */\n themeStyle?: CSSProperties | Record<string, string> | null;\n /** The caller's own style, applied last. */\n style?: CSSProperties;\n}): CSSProperties {\n const defaults: CSSProperties = {};\n for (const { property, value, utility } of SURFACES[surface]) {\n if (!callerSets(className, utility)) defaults[property] = value;\n }\n return {\n ...defaults,\n // The wrapper's `.athena-themed` sets the theme's face; a portal root sets it here.\n ...(themeStyle ? { fontFamily: 'var(--font-family, inherit)' } : {}),\n ...(themeStyle as CSSProperties | undefined),\n ...style,\n };\n}\n"],"names":[],"mappings":";AAaA,MAAM,WAA6D;AAAA,EACjE,SAAS;AAAA,IACP,EAAE,UAAU,WAAW,OAAO,SAAS,SAAS,QAAA;AAAA,IAChD,EAAE,UAAU,mBAAmB,OAAO,kBAAkB,SAAS,aAAA;AAAA,IACjE,EAAE,UAAU,SAAS,OAAO,6BAA6B,SAAS,0BAAA;AAAA,IAClE,EAAE,UAAU,eAAe,OAAO,iBAAiB,SAAS,gBAAA;AAAA,EAAgB;AAAA,EAE9E,SAAS;AAAA,IACP,EAAE,UAAU,WAAW,OAAO,SAAS,SAAS,QAAA;AAAA,IAChD,EAAE,UAAU,mBAAmB,OAAO,qBAAqB,SAAS,gBAAA;AAAA,IACpE,EAAE,UAAU,SAAS,OAAO,qBAAqB,SAAS,kBAAA;AAAA,EAAkB;AAEhF;AAGA,SAAS,UAAU,OAAuB;AACxC,MAAI,QAAQ;AACZ,MAAI,QAAQ;AACZ,WAAS,QAAQ,GAAG,QAAQ,MAAM,QAAQ,SAAS,GAAG;AACpD,UAAM,OAAO,MAAM,KAAK;AACxB,QAAI,SAAS,OAAO,SAAS,IAAK,UAAS;AAAA,aAClC,SAAS,OAAO,SAAS,IAAK,UAAS;AAAA,aACvC,SAAS,OAAO,UAAU,WAAW,QAAQ;AAAA,EACxD;AACA,SAAO,MAAM,MAAM,KAAK,EAAE,QAAQ,UAAU,EAAE;AAChD;AAOA,SAAS,WAAW,WAA+B,SAA0B;AAC3E,MAAI,CAAC,UAAW,QAAO;AACvB,SAAO,UAAU,MAAM,KAAK,EAAE,KAAK,CAAC,UAAU;AAC5C,UAAM,OAAO,UAAU,KAAK;AAC5B,QAAI,CAAC,QAAQ,SAAS,QAAS,QAAO;AACtC,WAAO,CAAC,GAAG,SAAS,IAAI,EAAE,MAAM,GAAG,EAAE,SAAS,OAAO,KAAK,CAAC,GAAG,MAAM,OAAO,EAAE,MAAM,GAAG,EAAE,SAAS,IAAI;AAAA,EACvG,CAAC;AACH;AA2BO,SAAS,mBAAmB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAQkB;AAChB,QAAM,WAA0B,CAAA;AAChC,aAAW,EAAE,UAAU,OAAO,aAAa,SAAS,OAAO,GAAG;AAC5D,QAAI,CAAC,WAAW,WAAW,OAAO,EAAG,UAAS,QAAQ,IAAI;AAAA,EAC5D;AACA,SAAO;AAAA,IACL,GAAG;AAAA;AAAA,IAEH,GAAI,aAAa,EAAE,YAAY,8BAAA,IAAkC,CAAA;AAAA,IACjE,GAAI;AAAA,IACJ,GAAG;AAAA,EAAA;AAEP;"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const reactQuery = require("@tanstack/react-query");
|
|
4
|
+
const react = require("react");
|
|
5
|
+
const AthenaAuthContext = require("../auth/AthenaAuthContext.cjs");
|
|
6
|
+
function useAthenaQueryClient() {
|
|
7
|
+
const contextClient = react.useContext(reactQuery.QueryClientContext);
|
|
8
|
+
const fallbackRef = react.useRef(null);
|
|
9
|
+
if (contextClient) return contextClient;
|
|
10
|
+
fallbackRef.current ?? (fallbackRef.current = new reactQuery.QueryClient());
|
|
11
|
+
return fallbackRef.current;
|
|
12
|
+
}
|
|
13
|
+
function fnv1a(text) {
|
|
14
|
+
let hash = 2166136261;
|
|
15
|
+
for (let index = 0; index < text.length; index += 1) {
|
|
16
|
+
hash ^= text.charCodeAt(index);
|
|
17
|
+
hash = Math.imul(hash, 16777619);
|
|
18
|
+
}
|
|
19
|
+
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
20
|
+
}
|
|
21
|
+
function credentialFingerprint(auth) {
|
|
22
|
+
return fnv1a(
|
|
23
|
+
[auth.apiKey ?? "", auth.token ?? "", auth.getToken === void 0 ? "0" : "1"].join("\0")
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
function useAthenaQueryIdentity(auth) {
|
|
27
|
+
var _a, _b;
|
|
28
|
+
const principal = ((_b = (_a = react.useContext(AthenaAuthContext.AthenaAuthContext)) == null ? void 0 : _a.user) == null ? void 0 : _b.userId) ?? "";
|
|
29
|
+
return [principal, credentialFingerprint(auth)];
|
|
30
|
+
}
|
|
31
|
+
exports.credentialFingerprint = credentialFingerprint;
|
|
32
|
+
exports.useAthenaQueryClient = useAthenaQueryClient;
|
|
33
|
+
exports.useAthenaQueryIdentity = useAthenaQueryIdentity;
|
|
34
|
+
//# sourceMappingURL=use-athena-rest-query.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-athena-rest-query.cjs","sources":["../../src/lib/use-athena-rest-query.ts"],"sourcesContent":["/**\n * The two pieces every SDK hook that reads an Agora REST route through\n * TanStack Query needs: a `QueryClient` under any `<AthenaProvider>`, and a\n * query-key component naming who the read is made as — without ever putting\n * the credential itself in a key.\n */\nimport { QueryClient, QueryClientContext } from '@tanstack/react-query';\nimport { useContext, useRef } from 'react';\nimport { AthenaAuthContext } from '../auth/AthenaAuthContext';\nimport type { StatewireAuthSource } from '../runtime/statewire-auth-headers';\n\n/**\n * The host's `QueryClient` when one is in context (`enableThreadList` mounts\n * the SDK's own), else a client scoped to the calling hook's component.\n */\nexport function useAthenaQueryClient(): QueryClient {\n const contextClient = useContext(QueryClientContext);\n const fallbackRef = useRef<QueryClient | null>(null);\n if (contextClient) return contextClient;\n fallbackRef.current ??= new QueryClient();\n return fallbackRef.current;\n}\n\n/** 32-bit FNV-1a of `text`, as hex. */\nfunction fnv1a(text: string): string {\n let hash = 0x811c9dc5;\n for (let index = 0; index < text.length; index += 1) {\n hash ^= text.charCodeAt(index);\n hash = Math.imul(hash, 0x01000193);\n }\n return (hash >>> 0).toString(16).padStart(8, '0');\n}\n\n/**\n * A short, one-way fingerprint of the credential a request presents (the API\n * key, the token the host holds, whether a live `getToken` resolves it). It is\n * the same for every hook and every mount that reads with the same\n * credential, and different once the credential changes, so a cache entry\n * written with one credential is never read with another — while the key\n * itself carries 32 bits of hash, never the secret.\n */\nexport function credentialFingerprint(auth: StatewireAuthSource): string {\n return fnv1a(\n [auth.apiKey ?? '', auth.token ?? '', auth.getToken === undefined ? '0' : '1'].join('\\u0000'),\n );\n}\n\n/**\n * Who a query reads as, for its key: the signed-in principal (`''` when the\n * provider knows none) and the credential fingerprint. The principal covers\n * an identity switch the credential cannot show — a stable `getToken`, or a\n * same-origin cookie; the fingerprint covers a swapped API key or token. Both\n * are stable across mounts, so a pane mounted after a switch never reads the\n * previous account's cached answer.\n */\nexport function useAthenaQueryIdentity(auth: StatewireAuthSource): readonly [string, string] {\n const principal = useContext(AthenaAuthContext)?.user?.userId ?? '';\n return [principal, credentialFingerprint(auth)];\n}\n"],"names":["useContext","QueryClientContext","useRef","QueryClient","AthenaAuthContext"],"mappings":";;;;;AAeO,SAAS,uBAAoC;AAClD,QAAM,gBAAgBA,MAAAA,WAAWC,6BAAkB;AACnD,QAAM,cAAcC,MAAAA,OAA2B,IAAI;AACnD,MAAI,cAAe,QAAO;AAC1B,cAAY,YAAZ,YAAY,UAAY,IAAIC,uBAAA;AAC5B,SAAO,YAAY;AACrB;AAGA,SAAS,MAAM,MAAsB;AACnC,MAAI,OAAO;AACX,WAAS,QAAQ,GAAG,QAAQ,KAAK,QAAQ,SAAS,GAAG;AACnD,YAAQ,KAAK,WAAW,KAAK;AAC7B,WAAO,KAAK,KAAK,MAAM,QAAU;AAAA,EACnC;AACA,UAAQ,SAAS,GAAG,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG;AAClD;AAUO,SAAS,sBAAsB,MAAmC;AACvE,SAAO;AAAA,IACL,CAAC,KAAK,UAAU,IAAI,KAAK,SAAS,IAAI,KAAK,aAAa,SAAY,MAAM,GAAG,EAAE,KAAK,IAAQ;AAAA,EAAA;AAEhG;AAUO,SAAS,uBAAuB,MAAsD;;AAC3F,QAAM,cAAYH,iBAAAA,WAAWI,kBAAAA,iBAAiB,MAA5BJ,mBAA+B,SAA/BA,mBAAqC,WAAU;AACjE,SAAO,CAAC,WAAW,sBAAsB,IAAI,CAAC;AAChD;;;;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The two pieces every SDK hook that reads an Agora REST route through
|
|
3
|
+
* TanStack Query needs: a `QueryClient` under any `<AthenaProvider>`, and a
|
|
4
|
+
* query-key component naming who the read is made as — without ever putting
|
|
5
|
+
* the credential itself in a key.
|
|
6
|
+
*/
|
|
7
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
8
|
+
import type { StatewireAuthSource } from '../runtime/statewire-auth-headers';
|
|
9
|
+
/**
|
|
10
|
+
* The host's `QueryClient` when one is in context (`enableThreadList` mounts
|
|
11
|
+
* the SDK's own), else a client scoped to the calling hook's component.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useAthenaQueryClient(): QueryClient;
|
|
14
|
+
/**
|
|
15
|
+
* A short, one-way fingerprint of the credential a request presents (the API
|
|
16
|
+
* key, the token the host holds, whether a live `getToken` resolves it). It is
|
|
17
|
+
* the same for every hook and every mount that reads with the same
|
|
18
|
+
* credential, and different once the credential changes, so a cache entry
|
|
19
|
+
* written with one credential is never read with another — while the key
|
|
20
|
+
* itself carries 32 bits of hash, never the secret.
|
|
21
|
+
*/
|
|
22
|
+
export declare function credentialFingerprint(auth: StatewireAuthSource): string;
|
|
23
|
+
/**
|
|
24
|
+
* Who a query reads as, for its key: the signed-in principal (`''` when the
|
|
25
|
+
* provider knows none) and the credential fingerprint. The principal covers
|
|
26
|
+
* an identity switch the credential cannot show — a stable `getToken`, or a
|
|
27
|
+
* same-origin cookie; the fingerprint covers a swapped API key or token. Both
|
|
28
|
+
* are stable across mounts, so a pane mounted after a switch never reads the
|
|
29
|
+
* previous account's cached answer.
|
|
30
|
+
*/
|
|
31
|
+
export declare function useAthenaQueryIdentity(auth: StatewireAuthSource): readonly [string, string];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { QueryClientContext, QueryClient } from "@tanstack/react-query";
|
|
2
|
+
import { useContext, useRef } from "react";
|
|
3
|
+
import { AthenaAuthContext } from "../auth/AthenaAuthContext.js";
|
|
4
|
+
function useAthenaQueryClient() {
|
|
5
|
+
const contextClient = useContext(QueryClientContext);
|
|
6
|
+
const fallbackRef = useRef(null);
|
|
7
|
+
if (contextClient) return contextClient;
|
|
8
|
+
fallbackRef.current ?? (fallbackRef.current = new QueryClient());
|
|
9
|
+
return fallbackRef.current;
|
|
10
|
+
}
|
|
11
|
+
function fnv1a(text) {
|
|
12
|
+
let hash = 2166136261;
|
|
13
|
+
for (let index = 0; index < text.length; index += 1) {
|
|
14
|
+
hash ^= text.charCodeAt(index);
|
|
15
|
+
hash = Math.imul(hash, 16777619);
|
|
16
|
+
}
|
|
17
|
+
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
18
|
+
}
|
|
19
|
+
function credentialFingerprint(auth) {
|
|
20
|
+
return fnv1a(
|
|
21
|
+
[auth.apiKey ?? "", auth.token ?? "", auth.getToken === void 0 ? "0" : "1"].join("\0")
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
function useAthenaQueryIdentity(auth) {
|
|
25
|
+
var _a, _b;
|
|
26
|
+
const principal = ((_b = (_a = useContext(AthenaAuthContext)) == null ? void 0 : _a.user) == null ? void 0 : _b.userId) ?? "";
|
|
27
|
+
return [principal, credentialFingerprint(auth)];
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
credentialFingerprint,
|
|
31
|
+
useAthenaQueryClient,
|
|
32
|
+
useAthenaQueryIdentity
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=use-athena-rest-query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-athena-rest-query.js","sources":["../../src/lib/use-athena-rest-query.ts"],"sourcesContent":["/**\n * The two pieces every SDK hook that reads an Agora REST route through\n * TanStack Query needs: a `QueryClient` under any `<AthenaProvider>`, and a\n * query-key component naming who the read is made as — without ever putting\n * the credential itself in a key.\n */\nimport { QueryClient, QueryClientContext } from '@tanstack/react-query';\nimport { useContext, useRef } from 'react';\nimport { AthenaAuthContext } from '../auth/AthenaAuthContext';\nimport type { StatewireAuthSource } from '../runtime/statewire-auth-headers';\n\n/**\n * The host's `QueryClient` when one is in context (`enableThreadList` mounts\n * the SDK's own), else a client scoped to the calling hook's component.\n */\nexport function useAthenaQueryClient(): QueryClient {\n const contextClient = useContext(QueryClientContext);\n const fallbackRef = useRef<QueryClient | null>(null);\n if (contextClient) return contextClient;\n fallbackRef.current ??= new QueryClient();\n return fallbackRef.current;\n}\n\n/** 32-bit FNV-1a of `text`, as hex. */\nfunction fnv1a(text: string): string {\n let hash = 0x811c9dc5;\n for (let index = 0; index < text.length; index += 1) {\n hash ^= text.charCodeAt(index);\n hash = Math.imul(hash, 0x01000193);\n }\n return (hash >>> 0).toString(16).padStart(8, '0');\n}\n\n/**\n * A short, one-way fingerprint of the credential a request presents (the API\n * key, the token the host holds, whether a live `getToken` resolves it). It is\n * the same for every hook and every mount that reads with the same\n * credential, and different once the credential changes, so a cache entry\n * written with one credential is never read with another — while the key\n * itself carries 32 bits of hash, never the secret.\n */\nexport function credentialFingerprint(auth: StatewireAuthSource): string {\n return fnv1a(\n [auth.apiKey ?? '', auth.token ?? '', auth.getToken === undefined ? '0' : '1'].join('\\u0000'),\n );\n}\n\n/**\n * Who a query reads as, for its key: the signed-in principal (`''` when the\n * provider knows none) and the credential fingerprint. The principal covers\n * an identity switch the credential cannot show — a stable `getToken`, or a\n * same-origin cookie; the fingerprint covers a swapped API key or token. Both\n * are stable across mounts, so a pane mounted after a switch never reads the\n * previous account's cached answer.\n */\nexport function useAthenaQueryIdentity(auth: StatewireAuthSource): readonly [string, string] {\n const principal = useContext(AthenaAuthContext)?.user?.userId ?? '';\n return [principal, credentialFingerprint(auth)];\n}\n"],"names":[],"mappings":";;;AAeO,SAAS,uBAAoC;AAClD,QAAM,gBAAgB,WAAW,kBAAkB;AACnD,QAAM,cAAc,OAA2B,IAAI;AACnD,MAAI,cAAe,QAAO;AAC1B,cAAY,YAAZ,YAAY,UAAY,IAAI,YAAA;AAC5B,SAAO,YAAY;AACrB;AAGA,SAAS,MAAM,MAAsB;AACnC,MAAI,OAAO;AACX,WAAS,QAAQ,GAAG,QAAQ,KAAK,QAAQ,SAAS,GAAG;AACnD,YAAQ,KAAK,WAAW,KAAK;AAC7B,WAAO,KAAK,KAAK,MAAM,QAAU;AAAA,EACnC;AACA,UAAQ,SAAS,GAAG,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG;AAClD;AAUO,SAAS,sBAAsB,MAAmC;AACvE,SAAO;AAAA,IACL,CAAC,KAAK,UAAU,IAAI,KAAK,SAAS,IAAI,KAAK,aAAa,SAAY,MAAM,GAAG,EAAE,KAAK,IAAQ;AAAA,EAAA;AAEhG;AAUO,SAAS,uBAAuB,MAAsD;;AAC3F,QAAM,cAAY,sBAAW,iBAAiB,MAA5B,mBAA+B,SAA/B,mBAAqC,WAAU;AACjE,SAAO,CAAC,WAAW,sBAAsB,IAAI,CAAC;AAChD;"}
|
|
@@ -30,9 +30,9 @@ const assetPanelStore = require("../assets/asset-panel-store.cjs");
|
|
|
30
30
|
const index = require("../theme/index.cjs");
|
|
31
31
|
const themeStyleContext = require("./theme-style-context.cjs");
|
|
32
32
|
const PostHogProvider = require("./PostHogProvider.cjs");
|
|
33
|
-
const threadSnapshotCache = require("../
|
|
34
|
-
const toolOutputs = require("../
|
|
35
|
-
const threadStatus = require("../
|
|
33
|
+
const threadSnapshotCache = require("../agent-runtime/src/thread-snapshot-cache.cjs");
|
|
34
|
+
const toolOutputs = require("../agent-runtime/src/tool-outputs.cjs");
|
|
35
|
+
const threadStatus = require("../agent-runtime/src/thread-status.cjs");
|
|
36
36
|
const resolveTokenOverride = ({
|
|
37
37
|
config,
|
|
38
38
|
token
|
|
@@ -184,6 +184,7 @@ function AthenaStatewireStandalone({
|
|
|
184
184
|
backendUrl,
|
|
185
185
|
appUrl,
|
|
186
186
|
threadId: threadIdProp,
|
|
187
|
+
threadIsNew = false,
|
|
187
188
|
threadList,
|
|
188
189
|
linkClicks,
|
|
189
190
|
citationLinks,
|
|
@@ -194,7 +195,7 @@ function AthenaStatewireStandalone({
|
|
|
194
195
|
generatedIdRef.current = mintThreadId.mintThreadId();
|
|
195
196
|
}
|
|
196
197
|
const threadId = threadIdProp ?? generatedIdRef.current;
|
|
197
|
-
const isNewChat = (threadList == null ? void 0 : threadList.isNewChat) ?? !threadIdProp;
|
|
198
|
+
const isNewChat = (threadList == null ? void 0 : threadList.isNewChat) ?? (!threadIdProp || threadIsNew);
|
|
198
199
|
const [published, setPublished] = react.useState(null);
|
|
199
200
|
const clientTools = useAthenaStatewireRuntime.useStatewireClientTools(runtimeProps.frontendTools);
|
|
200
201
|
const clientToolNamesKey = clientTools.map((tool) => tool.definition.name).join(",");
|
|
@@ -257,6 +258,7 @@ function AthenaStatewireWithThreadList({
|
|
|
257
258
|
getToken,
|
|
258
259
|
initialThreadId,
|
|
259
260
|
includePullRequests,
|
|
261
|
+
additionalListAppIds,
|
|
260
262
|
...standaloneProps
|
|
261
263
|
}) {
|
|
262
264
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -268,6 +270,7 @@ function AthenaStatewireWithThreadList({
|
|
|
268
270
|
token,
|
|
269
271
|
getToken,
|
|
270
272
|
appId,
|
|
273
|
+
additionalListAppIds,
|
|
271
274
|
initialThreadId,
|
|
272
275
|
includePullRequests,
|
|
273
276
|
snapshotCache: standaloneProps.snapshotCache,
|
|
@@ -338,11 +341,14 @@ function AthenaProvider({
|
|
|
338
341
|
systemPrompt,
|
|
339
342
|
appId,
|
|
340
343
|
threadId: threadIdProp,
|
|
344
|
+
threadIsNew,
|
|
341
345
|
enableThreadList = false,
|
|
342
346
|
threadListIncludePullRequests = true,
|
|
347
|
+
threadListAdditionalAppIds,
|
|
343
348
|
theme,
|
|
344
349
|
linkClicks,
|
|
345
350
|
citationLinks,
|
|
351
|
+
onOpenAsset,
|
|
346
352
|
posthog: posthogProp,
|
|
347
353
|
debug,
|
|
348
354
|
onDiagnostic,
|
|
@@ -367,6 +373,16 @@ function AthenaProvider({
|
|
|
367
373
|
}
|
|
368
374
|
});
|
|
369
375
|
}, []);
|
|
376
|
+
const onOpenAssetRef = react.useRef(onOpenAsset);
|
|
377
|
+
onOpenAssetRef.current = onOpenAsset;
|
|
378
|
+
const opensAssets = onOpenAsset !== void 0;
|
|
379
|
+
react.useEffect(() => {
|
|
380
|
+
if (!opensAssets) return;
|
|
381
|
+
return assetPanelStore.useAssetPanelStore.getState().registerAssetOpener((request) => {
|
|
382
|
+
const open = onOpenAssetRef.current;
|
|
383
|
+
return open ? open(request) : false;
|
|
384
|
+
});
|
|
385
|
+
}, [opensAssets]);
|
|
370
386
|
const debugKey = JSON.stringify(athenaDiagnostics.debugPropToDiagnosticsConfig(debug));
|
|
371
387
|
react.useEffect(() => {
|
|
372
388
|
athenaDiagnostics.athenaDiagnostics.configure(athenaDiagnostics.debugPropToDiagnosticsConfig(debug));
|
|
@@ -480,15 +496,29 @@ function AthenaProvider({
|
|
|
480
496
|
linkClicks,
|
|
481
497
|
citationLinks
|
|
482
498
|
};
|
|
483
|
-
const inner = enableThreadList ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
499
|
+
const inner = /* @__PURE__ */ jsxRuntime.jsx(react$1.AuiProvider, { extends: null, config: react$1.AuiConfig({}), children: enableThreadList ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
484
500
|
AthenaStatewireWithThreadList,
|
|
485
501
|
{
|
|
486
502
|
...statewireProps,
|
|
487
503
|
initialThreadId: threadIdProp,
|
|
488
504
|
includePullRequests: threadListIncludePullRequests,
|
|
505
|
+
additionalListAppIds: threadListAdditionalAppIds,
|
|
489
506
|
children
|
|
490
507
|
}
|
|
491
|
-
) :
|
|
508
|
+
) : (
|
|
509
|
+
// A provider without a thread list is its own chat: one nested under a thread-list
|
|
510
|
+
// provider (a host showing several chats side by side) must not read that list as its
|
|
511
|
+
// own, or its banners and composer would follow the other chat's thread.
|
|
512
|
+
/* @__PURE__ */ jsxRuntime.jsx(statewireThreadList.AthenaStatewireThreadListContext.Provider, { value: null, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
513
|
+
AthenaStatewireStandalone,
|
|
514
|
+
{
|
|
515
|
+
...statewireProps,
|
|
516
|
+
threadId: threadIdProp,
|
|
517
|
+
threadIsNew,
|
|
518
|
+
children
|
|
519
|
+
}
|
|
520
|
+
) })
|
|
521
|
+
) });
|
|
492
522
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
493
523
|
"div",
|
|
494
524
|
{
|