@athenaintel/react 0.42.2 → 0.48.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 +225 -3
- package/dist/agent-runtime/src/answer-label.cjs +137 -0
- package/dist/agent-runtime/src/answer-label.cjs.map +1 -0
- package/dist/agent-runtime/src/answer-label.d.ts +104 -0
- package/dist/agent-runtime/src/answer-label.js +137 -0
- package/dist/agent-runtime/src/answer-label.js.map +1 -0
- package/dist/agent-runtime/src/answer-rows.cjs +180 -0
- package/dist/agent-runtime/src/answer-rows.cjs.map +1 -0
- package/dist/agent-runtime/src/answer-rows.d.ts +86 -0
- package/dist/agent-runtime/src/answer-rows.js +180 -0
- package/dist/agent-runtime/src/answer-rows.js.map +1 -0
- package/dist/agent-runtime/src/client-tool-bridge.cjs +15 -15
- package/dist/agent-runtime/src/client-tool-bridge.cjs.map +1 -1
- package/dist/agent-runtime/src/conversation-index.cjs +8 -8
- package/dist/agent-runtime/src/conversation-index.cjs.map +1 -1
- package/dist/agent-runtime/src/conversation-list-groups.d.ts +74 -0
- package/dist/agent-runtime/src/decision-checks.cjs +207 -0
- package/dist/agent-runtime/src/decision-checks.cjs.map +1 -0
- package/dist/agent-runtime/src/decision-checks.d.ts +142 -0
- package/dist/agent-runtime/src/decision-checks.js +207 -0
- package/dist/agent-runtime/src/decision-checks.js.map +1 -0
- package/dist/agent-runtime/src/desktop-handoff.d.ts +12 -0
- package/dist/agent-runtime/src/errors.cjs +18 -0
- package/dist/agent-runtime/src/errors.cjs.map +1 -1
- package/dist/agent-runtime/src/errors.d.ts +7 -0
- package/dist/agent-runtime/src/errors.js +18 -0
- package/dist/agent-runtime/src/errors.js.map +1 -1
- package/dist/agent-runtime/src/generated/runconfig-contract.cjs +12 -0
- package/dist/agent-runtime/src/generated/runconfig-contract.cjs.map +1 -1
- package/dist/agent-runtime/src/generated/runconfig-contract.d.ts +6 -6
- package/dist/agent-runtime/src/generated/runconfig-contract.js +12 -0
- package/dist/agent-runtime/src/generated/runconfig-contract.js.map +1 -1
- package/dist/agent-runtime/src/handoff-arrival.cjs +60 -0
- package/dist/agent-runtime/src/handoff-arrival.cjs.map +1 -0
- package/dist/agent-runtime/src/handoff-arrival.d.ts +46 -0
- package/dist/agent-runtime/src/handoff-arrival.js +60 -0
- package/dist/agent-runtime/src/handoff-arrival.js.map +1 -0
- package/dist/agent-runtime/src/index.d.ts +15 -8
- package/dist/agent-runtime/src/interrupts.cjs +43 -18
- package/dist/agent-runtime/src/interrupts.cjs.map +1 -1
- package/dist/agent-runtime/src/interrupts.d.ts +19 -2
- package/dist/agent-runtime/src/interrupts.js +28 -3
- package/dist/agent-runtime/src/interrupts.js.map +1 -1
- package/dist/agent-runtime/src/lane-history.cjs +8 -8
- package/dist/agent-runtime/src/lane-history.cjs.map +1 -1
- package/dist/agent-runtime/src/messages.cjs +43 -8
- package/dist/agent-runtime/src/messages.cjs.map +1 -1
- package/dist/agent-runtime/src/messages.d.ts +25 -3
- package/dist/agent-runtime/src/messages.js +43 -8
- package/dist/agent-runtime/src/messages.js.map +1 -1
- package/dist/agent-runtime/src/offline-status.cjs +36 -0
- package/dist/agent-runtime/src/offline-status.cjs.map +1 -0
- package/dist/agent-runtime/src/offline-status.d.ts +118 -3
- package/dist/agent-runtime/src/offline-status.js +36 -0
- package/dist/agent-runtime/src/offline-status.js.map +1 -0
- package/dist/agent-runtime/src/queue.cjs +0 -9
- package/dist/agent-runtime/src/queue.cjs.map +1 -1
- package/dist/agent-runtime/src/queue.js +0 -9
- package/dist/agent-runtime/src/queue.js.map +1 -1
- package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs +9 -9
- package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs.map +1 -1
- package/dist/agent-runtime/src/runtime-catalog.cjs +42 -0
- package/dist/agent-runtime/src/runtime-catalog.cjs.map +1 -0
- package/dist/agent-runtime/src/runtime-catalog.d.ts +35 -0
- package/dist/agent-runtime/src/runtime-catalog.js +42 -0
- package/dist/agent-runtime/src/runtime-catalog.js.map +1 -0
- package/dist/agent-runtime/src/runtime-messages.cjs.map +1 -1
- package/dist/agent-runtime/src/runtime-messages.d.ts +1 -1
- package/dist/agent-runtime/src/runtime-messages.js.map +1 -1
- package/dist/agent-runtime/src/runtime.d.ts +40 -0
- package/dist/agent-runtime/src/statewire-suspended.cjs +3 -3
- package/dist/agent-runtime/src/statewire-suspended.cjs.map +1 -1
- package/dist/agent-runtime/src/subagents.cjs +32 -2
- package/dist/agent-runtime/src/subagents.cjs.map +1 -1
- package/dist/agent-runtime/src/subagents.d.ts +9 -0
- package/dist/agent-runtime/src/subagents.js +30 -0
- package/dist/agent-runtime/src/subagents.js.map +1 -1
- package/dist/agent-runtime/src/thread-driver.cjs +67 -0
- package/dist/agent-runtime/src/thread-driver.cjs.map +1 -0
- package/dist/agent-runtime/src/thread-driver.d.ts +49 -0
- package/dist/agent-runtime/src/thread-driver.js +67 -0
- package/dist/agent-runtime/src/thread-driver.js.map +1 -0
- package/dist/agent-runtime/src/thread-handoff-flow-machine.d.ts +172 -0
- package/dist/agent-runtime/src/thread-handoff-protocol.d.ts +756 -0
- package/dist/agent-runtime/src/thread-handoff-qr.d.ts +11 -0
- package/dist/agent-runtime/src/thread-handoff.d.ts +3 -364
- package/dist/agent-runtime/src/thread-status.cjs +3 -3
- package/dist/agent-runtime/src/thread-status.cjs.map +1 -1
- package/dist/agent-runtime/src/tool-metadata.cjs +210 -33
- package/dist/agent-runtime/src/tool-metadata.cjs.map +1 -1
- package/dist/agent-runtime/src/tool-metadata.d.ts +12 -0
- package/dist/agent-runtime/src/tool-metadata.js +210 -33
- package/dist/agent-runtime/src/tool-metadata.js.map +1 -1
- package/dist/agent-runtime/src/tool-names.cjs +2 -0
- package/dist/agent-runtime/src/tool-names.cjs.map +1 -1
- package/dist/agent-runtime/src/tool-names.d.ts +2 -0
- package/dist/agent-runtime/src/tool-names.js +2 -0
- package/dist/agent-runtime/src/tool-names.js.map +1 -1
- package/dist/agent-runtime/src/types.d.ts +10 -2
- package/dist/agent-runtime/src/use-conversation-list.cjs +11 -11
- package/dist/agent-runtime/src/use-conversation-list.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs +24 -19
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.d.ts +2 -1
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js +6 -1
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-config.cjs +14 -14
- package/dist/agent-runtime/src/use-deep-agent-config.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-edit-submit.cjs +6 -6
- package/dist/agent-runtime/src/use-deep-agent-edit-submit.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-runtime.cjs +16 -16
- package/dist/agent-runtime/src/use-deep-agent-runtime.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-thread.cjs +45 -45
- package/dist/agent-runtime/src/use-deep-agent-thread.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-voice.cjs +572 -134
- package/dist/agent-runtime/src/use-deep-agent-voice.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-voice.d.ts +137 -10
- package/dist/agent-runtime/src/use-deep-agent-voice.js +514 -76
- package/dist/agent-runtime/src/use-deep-agent-voice.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-window-sync.cjs +26 -26
- package/dist/agent-runtime/src/use-deep-agent-window-sync.cjs.map +1 -1
- package/dist/agent-runtime/src/use-historical-edit-attachments.cjs +4 -4
- package/dist/agent-runtime/src/use-historical-edit-attachments.cjs.map +1 -1
- package/dist/agent-runtime/src/use-thread-handoff-flow.d.ts +28 -26
- package/dist/agent-runtime/src/voice-media.cjs +117 -0
- package/dist/agent-runtime/src/voice-media.cjs.map +1 -0
- package/dist/agent-runtime/src/voice-media.d.ts +49 -0
- package/dist/agent-runtime/src/voice-media.js +117 -0
- package/dist/agent-runtime/src/voice-media.js.map +1 -0
- package/dist/agent-runtime/src/voice-wire-types.d.ts +32 -0
- package/dist/assets/AssetPanel.cjs +11 -11
- package/dist/assets/AssetPanel.cjs.map +1 -1
- package/dist/assets/AthenaAssetEmbed.cjs +11 -9
- package/dist/assets/AthenaAssetEmbed.cjs.map +1 -1
- package/dist/assets/AthenaAssetEmbed.d.ts +7 -0
- package/dist/assets/AthenaAssetEmbed.js +4 -2
- package/dist/assets/AthenaAssetEmbed.js.map +1 -1
- package/dist/assets/AthenaLayout.cjs +16 -16
- package/dist/assets/AthenaLayout.cjs.map +1 -1
- package/dist/assets/use-asset-content.cjs +4 -4
- package/dist/assets/use-asset-content.cjs.map +1 -1
- package/dist/assets/use-asset-embed.cjs +14 -7
- package/dist/assets/use-asset-embed.cjs.map +1 -1
- package/dist/assets/use-asset-embed.d.ts +11 -1
- package/dist/assets/use-asset-embed.js +10 -3
- package/dist/assets/use-asset-embed.js.map +1 -1
- package/dist/auth/AthenaAuthContext.cjs +3 -3
- package/dist/auth/AthenaAuthContext.cjs.map +1 -1
- package/dist/auth/AthenaAuthProvider.cjs +8 -8
- package/dist/auth/AthenaAuthProvider.cjs.map +1 -1
- package/dist/auth/AthenaCredentialSourceContext.cjs +5 -5
- package/dist/auth/AthenaCredentialSourceContext.cjs.map +1 -1
- package/dist/auth/AthenaSSOProvider.cjs +14 -14
- package/dist/auth/AthenaSSOProvider.cjs.map +1 -1
- package/dist/auth/credential-source.cjs +26 -13
- package/dist/auth/credential-source.cjs.map +1 -1
- package/dist/auth/credential-source.d.ts +8 -0
- package/dist/auth/credential-source.js +26 -13
- package/dist/auth/credential-source.js.map +1 -1
- package/dist/catalog/agent-model-options.cjs +25 -17
- package/dist/catalog/agent-model-options.cjs.map +1 -1
- package/dist/catalog/agent-model-options.d.ts +38 -5
- package/dist/catalog/agent-model-options.js +25 -17
- package/dist/catalog/agent-model-options.js.map +1 -1
- package/dist/catalog/channel-refusal.cjs +36 -0
- package/dist/catalog/channel-refusal.cjs.map +1 -0
- package/dist/catalog/channel-refusal.d.ts +29 -0
- package/dist/catalog/channel-refusal.js +36 -0
- package/dist/catalog/channel-refusal.js.map +1 -0
- package/dist/catalog/chat-pickers.cjs +60 -24
- package/dist/catalog/chat-pickers.cjs.map +1 -1
- package/dist/catalog/chat-pickers.d.ts +12 -2
- package/dist/catalog/chat-pickers.js +56 -20
- package/dist/catalog/chat-pickers.js.map +1 -1
- package/dist/catalog/runtime-catalog.cjs +89 -23
- package/dist/catalog/runtime-catalog.cjs.map +1 -1
- package/dist/catalog/runtime-catalog.d.ts +8 -2
- package/dist/catalog/runtime-catalog.js +83 -17
- package/dist/catalog/runtime-catalog.js.map +1 -1
- package/dist/catalog/use-athena-chat-mode.cjs +12 -12
- package/dist/catalog/use-athena-chat-mode.cjs.map +1 -1
- package/dist/chat/AthenaChat.cjs +155 -67
- package/dist/chat/AthenaChat.cjs.map +1 -1
- package/dist/chat/AthenaChat.d.ts +42 -2
- package/dist/chat/AthenaChat.js +106 -18
- package/dist/chat/AthenaChat.js.map +1 -1
- package/dist/chat/AthenaChatErrorBoundary.cjs +3 -3
- package/dist/chat/AthenaChatErrorBoundary.cjs.map +1 -1
- package/dist/chat/DrivingOnChip.cjs +23 -0
- package/dist/chat/DrivingOnChip.cjs.map +1 -0
- package/dist/chat/DrivingOnChip.d.ts +17 -0
- package/dist/chat/DrivingOnChip.js +23 -0
- package/dist/chat/DrivingOnChip.js.map +1 -0
- package/dist/chat/StatewireApprovalCard.cjs +125 -31
- package/dist/chat/StatewireApprovalCard.cjs.map +1 -1
- package/dist/chat/StatewireApprovalCard.d.ts +73 -1
- package/dist/chat/StatewireApprovalCard.js +115 -21
- package/dist/chat/StatewireApprovalCard.js.map +1 -1
- package/dist/chat/StatewireClientToolBridge.cjs +2 -2
- package/dist/chat/StatewireClientToolBridge.cjs.map +1 -1
- package/dist/chat/StatewireQueuedMessages.cjs +25 -63
- package/dist/chat/StatewireQueuedMessages.cjs.map +1 -1
- package/dist/chat/StatewireQueuedMessages.d.ts +11 -13
- package/dist/chat/StatewireQueuedMessages.js +16 -54
- package/dist/chat/StatewireQueuedMessages.js.map +1 -1
- package/dist/chat/WaitingOnYouBanner.cjs +3 -3
- package/dist/chat/WaitingOnYouBanner.cjs.map +1 -1
- package/dist/chat/athena-chat-welcome.cjs +2 -2
- package/dist/chat/athena-chat-welcome.cjs.map +1 -1
- package/dist/chat/athena-citation-links.cjs +5 -5
- package/dist/chat/athena-citation-links.cjs.map +1 -1
- package/dist/chat/athena-composer-controls.cjs +26 -16
- package/dist/chat/athena-composer-controls.cjs.map +1 -1
- package/dist/chat/athena-composer-controls.d.ts +6 -0
- package/dist/chat/athena-composer-controls.js +26 -16
- package/dist/chat/athena-composer-controls.js.map +1 -1
- package/dist/chat/athena-turn-end-status.cjs +42 -0
- package/dist/chat/athena-turn-end-status.cjs.map +1 -0
- package/dist/chat/athena-turn-end-status.d.ts +24 -0
- package/dist/chat/athena-turn-end-status.js +42 -0
- package/dist/chat/athena-turn-end-status.js.map +1 -0
- package/dist/chat/browser-decision-check.cjs +131 -0
- package/dist/chat/browser-decision-check.cjs.map +1 -0
- package/dist/chat/browser-decision-check.d.ts +61 -0
- package/dist/chat/browser-decision-check.js +131 -0
- package/dist/chat/browser-decision-check.js.map +1 -0
- package/dist/chat/chat-outbox-rows.cjs +3 -3
- package/dist/chat/chat-outbox-rows.cjs.map +1 -1
- package/dist/chat/chat-voice-controls.cjs +93 -28
- package/dist/chat/chat-voice-controls.cjs.map +1 -1
- package/dist/chat/chat-voice-controls.d.ts +36 -2
- package/dist/chat/chat-voice-controls.js +89 -24
- package/dist/chat/chat-voice-controls.js.map +1 -1
- package/dist/chat/composer-keyboard-hint.cjs +5 -5
- package/dist/chat/composer-keyboard-hint.cjs.map +1 -1
- package/dist/chat/device-operation.cjs +29 -0
- package/dist/chat/device-operation.cjs.map +1 -0
- package/dist/chat/device-operation.d.ts +34 -0
- package/dist/chat/device-operation.js +29 -0
- package/dist/chat/device-operation.js.map +1 -0
- package/dist/chat/super-grouping/CollapsibleGroup.cjs +14 -14
- package/dist/chat/super-grouping/CollapsibleGroup.cjs.map +1 -1
- package/dist/chat/super-grouping/GroupedMessageParts.cjs +4 -4
- package/dist/chat/super-grouping/GroupedMessageParts.cjs.map +1 -1
- package/dist/chat/super-grouping/SuperGroupingCard.cjs +60 -38
- package/dist/chat/super-grouping/SuperGroupingCard.cjs.map +1 -1
- package/dist/chat/super-grouping/SuperGroupingCard.d.ts +24 -4
- package/dist/chat/super-grouping/SuperGroupingCard.js +37 -15
- package/dist/chat/super-grouping/SuperGroupingCard.js.map +1 -1
- package/dist/chat/super-grouping/SuperGroupingTranscript.cjs +32 -32
- package/dist/chat/super-grouping/SuperGroupingTranscript.cjs.map +1 -1
- package/dist/chat/super-grouping/SuperGroupingTranscript.js +3 -3
- package/dist/chat/super-grouping/SuperGroupingTranscript.js.map +1 -1
- package/dist/chat/super-grouping/ToolTimeline.cjs +97 -37
- package/dist/chat/super-grouping/ToolTimeline.cjs.map +1 -1
- package/dist/chat/super-grouping/ToolTimeline.d.ts +14 -2
- package/dist/chat/super-grouping/ToolTimeline.js +94 -34
- package/dist/chat/super-grouping/ToolTimeline.js.map +1 -1
- package/dist/chat/super-grouping/activity-timeline.cjs +47 -12
- package/dist/chat/super-grouping/activity-timeline.cjs.map +1 -1
- package/dist/chat/super-grouping/activity-timeline.d.ts +21 -0
- package/dist/chat/super-grouping/activity-timeline.js +47 -12
- package/dist/chat/super-grouping/activity-timeline.js.map +1 -1
- package/dist/chat/super-grouping/grouping-function.cjs +4 -0
- package/dist/chat/super-grouping/grouping-function.cjs.map +1 -1
- package/dist/chat/super-grouping/grouping-function.d.ts +7 -0
- package/dist/chat/super-grouping/grouping-function.js +5 -1
- package/dist/chat/super-grouping/grouping-function.js.map +1 -1
- package/dist/chat/super-grouping/index.cjs +6 -0
- package/dist/chat/super-grouping/index.cjs.map +1 -1
- package/dist/chat/super-grouping/index.d.ts +6 -2
- package/dist/chat/super-grouping/index.js +7 -1
- package/dist/chat/super-grouping/index.js.map +1 -1
- package/dist/chat/super-grouping/timeline-step.cjs +61 -2
- package/dist/chat/super-grouping/timeline-step.cjs.map +1 -1
- package/dist/chat/super-grouping/timeline-step.d.ts +13 -1
- package/dist/chat/super-grouping/timeline-step.js +61 -2
- package/dist/chat/super-grouping/timeline-step.js.map +1 -1
- package/dist/chat/super-grouping/tool-part-placement.cjs +17 -0
- package/dist/chat/super-grouping/tool-part-placement.cjs.map +1 -0
- package/dist/chat/super-grouping/tool-part-placement.d.ts +22 -0
- package/dist/chat/super-grouping/tool-part-placement.js +17 -0
- package/dist/chat/super-grouping/tool-part-placement.js.map +1 -0
- package/dist/chat/thread-scroll-to-bottom.cjs +2 -2
- package/dist/chat/thread-scroll-to-bottom.cjs.map +1 -1
- package/dist/chat/thread-scroll-to-bottom.d.ts +10 -7
- package/dist/chat/thread-scroll-to-bottom.js +2 -2
- package/dist/chat/thread-scroll-to-bottom.js.map +1 -1
- package/dist/chat/tooltip-icon-button.cjs +2 -2
- package/dist/chat/tooltip-icon-button.cjs.map +1 -1
- package/dist/chat/use-athena-voice-live.cjs +11 -0
- package/dist/chat/use-athena-voice-live.cjs.map +1 -0
- package/dist/chat/use-athena-voice-live.d.ts +11 -0
- package/dist/chat/use-athena-voice-live.js +11 -0
- package/dist/chat/use-athena-voice-live.js.map +1 -0
- package/dist/chat/use-statewire-approval-request.cjs +56 -24
- package/dist/chat/use-statewire-approval-request.cjs.map +1 -1
- package/dist/chat/use-statewire-approval-request.d.ts +33 -4
- package/dist/chat/use-statewire-approval-request.js +41 -9
- package/dist/chat/use-statewire-approval-request.js.map +1 -1
- package/dist/chat-ui/auth/sign-in-card.cjs +2 -2
- package/dist/chat-ui/auth/sign-in-card.cjs.map +1 -1
- package/dist/chat-ui/composer/tiptap-composer.cjs +138 -107
- package/dist/chat-ui/composer/tiptap-composer.cjs.map +1 -1
- package/dist/chat-ui/composer/tiptap-composer.d.ts +20 -4
- package/dist/chat-ui/composer/tiptap-composer.js +85 -54
- package/dist/chat-ui/composer/tiptap-composer.js.map +1 -1
- package/dist/chat-ui/header/conversation-history-panel.cjs +49 -23
- package/dist/chat-ui/header/conversation-history-panel.cjs.map +1 -1
- package/dist/chat-ui/header/conversation-history-panel.d.ts +12 -1
- package/dist/chat-ui/header/conversation-history-panel.js +38 -12
- package/dist/chat-ui/header/conversation-history-panel.js.map +1 -1
- package/dist/chat-ui/index.cjs +18 -0
- package/dist/chat-ui/index.cjs.map +1 -1
- package/dist/chat-ui/index.d.ts +7 -1
- package/dist/chat-ui/index.js +18 -0
- package/dist/chat-ui/index.js.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.cjs +147 -38
- package/dist/chat-ui/mentions/mention-chip.cjs.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.d.ts +17 -1
- package/dist/chat-ui/mentions/mention-chip.js +146 -37
- package/dist/chat-ui/mentions/mention-chip.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.cjs +10 -9
- package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.js +3 -2
- package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-popup.cjs +2 -2
- package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-popup.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/menu-list.cjs +29 -6
- package/dist/chat-ui/mentions/suggestions/components/menu-list.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/menu-list.d.ts +7 -1
- package/dist/chat-ui/mentions/suggestions/components/menu-list.js +25 -2
- package/dist/chat-ui/mentions/suggestions/components/menu-list.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/use-keyboard-navigation.cjs +2 -2
- package/dist/chat-ui/mentions/suggestions/components/use-keyboard-navigation.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/use-menu-navigation.cjs +2 -2
- package/dist/chat-ui/mentions/suggestions/components/use-menu-navigation.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/api-client.cjs +3 -3
- package/dist/chat-ui/mentions/suggestions/data/api-client.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/orchestrator.cjs +56 -2
- package/dist/chat-ui/mentions/suggestions/data/orchestrator.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/orchestrator.d.ts +12 -0
- package/dist/chat-ui/mentions/suggestions/data/orchestrator.js +56 -2
- package/dist/chat-ui/mentions/suggestions/data/orchestrator.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs +24 -3
- package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/sources/index.d.ts +7 -0
- package/dist/chat-ui/mentions/suggestions/data/sources/index.js +24 -3
- package/dist/chat-ui/mentions/suggestions/data/sources/index.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.cjs +35 -13
- 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 +15 -1
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.js +28 -6
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/use-menu-items.cjs +9 -6
- package/dist/chat-ui/mentions/suggestions/data/use-menu-items.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/use-menu-items.d.ts +3 -0
- package/dist/chat-ui/mentions/suggestions/data/use-menu-items.js +5 -2
- package/dist/chat-ui/mentions/suggestions/data/use-menu-items.js.map +1 -1
- package/dist/chat-ui/mentions/use-account-workspace-id.cjs +45 -10
- package/dist/chat-ui/mentions/use-account-workspace-id.cjs.map +1 -1
- package/dist/chat-ui/mentions/use-account-workspace-id.d.ts +24 -1
- package/dist/chat-ui/mentions/use-account-workspace-id.js +46 -11
- package/dist/chat-ui/mentions/use-account-workspace-id.js.map +1 -1
- package/dist/chat-ui/mentions/use-member-avatar.cjs +4 -4
- package/dist/chat-ui/mentions/use-member-avatar.cjs.map +1 -1
- package/dist/chat-ui/mentions/use-mention-asset.cjs +140 -0
- package/dist/chat-ui/mentions/use-mention-asset.cjs.map +1 -0
- package/dist/chat-ui/mentions/use-mention-asset.d.ts +16 -0
- package/dist/chat-ui/mentions/use-mention-asset.js +140 -0
- package/dist/chat-ui/mentions/use-mention-asset.js.map +1 -0
- package/dist/chat-ui/messages/answer-label.cjs +42 -0
- package/dist/chat-ui/messages/answer-label.cjs.map +1 -0
- package/dist/chat-ui/messages/answer-label.d.ts +33 -0
- package/dist/chat-ui/messages/answer-label.js +42 -0
- package/dist/chat-ui/messages/answer-label.js.map +1 -0
- package/dist/chat-ui/messages/arrival-animation.cjs +13 -0
- package/dist/chat-ui/messages/arrival-animation.cjs.map +1 -0
- package/dist/chat-ui/messages/arrival-animation.d.ts +14 -0
- package/dist/chat-ui/messages/arrival-animation.js +13 -0
- package/dist/chat-ui/messages/arrival-animation.js.map +1 -0
- package/dist/chat-ui/messages/continue-pill.cjs +5 -5
- package/dist/chat-ui/messages/continue-pill.cjs.map +1 -1
- package/dist/chat-ui/messages/handoff-arrival-divider.cjs +44 -0
- package/dist/chat-ui/messages/handoff-arrival-divider.cjs.map +1 -0
- package/dist/chat-ui/messages/handoff-arrival-divider.d.ts +17 -0
- package/dist/chat-ui/messages/handoff-arrival-divider.js +44 -0
- package/dist/chat-ui/messages/handoff-arrival-divider.js.map +1 -0
- package/dist/chat-ui/messages/message-actions-config.cjs +3 -3
- package/dist/chat-ui/messages/message-actions-config.cjs.map +1 -1
- package/dist/chat-ui/messages/message-components.cjs +8 -4
- package/dist/chat-ui/messages/message-components.cjs.map +1 -1
- package/dist/chat-ui/messages/message-components.js +5 -1
- package/dist/chat-ui/messages/message-components.js.map +1 -1
- package/dist/chat-ui/messages/message-images.cjs +66 -0
- package/dist/chat-ui/messages/message-images.cjs.map +1 -0
- package/dist/chat-ui/messages/message-images.d.ts +16 -0
- package/dist/chat-ui/messages/message-images.js +66 -0
- package/dist/chat-ui/messages/message-images.js.map +1 -0
- package/dist/chat-ui/messages/user-edit-composer.cjs +2 -2
- package/dist/chat-ui/messages/user-edit-composer.cjs.map +1 -1
- package/dist/chat-ui/messages/wake-marker.cjs +3 -3
- package/dist/chat-ui/messages/wake-marker.cjs.map +1 -1
- package/dist/chat-ui/rich-text/chat-link.cjs +7 -6
- package/dist/chat-ui/rich-text/chat-link.cjs.map +1 -1
- package/dist/chat-ui/rich-text/chat-link.d.ts +2 -3
- package/dist/chat-ui/rich-text/chat-link.js +6 -5
- package/dist/chat-ui/rich-text/chat-link.js.map +1 -1
- package/dist/chat-ui/rich-text/chat-message-body.cjs +8 -8
- package/dist/chat-ui/rich-text/chat-message-body.cjs.map +1 -1
- package/dist/chat-ui/rich-text/chat-node-views.cjs +7 -6
- package/dist/chat-ui/rich-text/chat-node-views.cjs.map +1 -1
- package/dist/chat-ui/rich-text/chat-node-views.js +1 -0
- package/dist/chat-ui/rich-text/chat-node-views.js.map +1 -1
- package/dist/chat-ui/rich-text/dom-output-spec.cjs +2 -2
- package/dist/chat-ui/rich-text/dom-output-spec.cjs.map +1 -1
- package/dist/chat-ui/statewire.cjs +3 -0
- package/dist/chat-ui/statewire.cjs.map +1 -1
- package/dist/chat-ui/statewire.d.ts +2 -1
- package/dist/chat-ui/statewire.js +3 -0
- package/dist/chat-ui/statewire.js.map +1 -1
- package/dist/chat-ui/thread/chat-thread-shell.cjs +43 -14
- package/dist/chat-ui/thread/chat-thread-shell.cjs.map +1 -1
- package/dist/chat-ui/thread/chat-thread-shell.d.ts +16 -2
- package/dist/chat-ui/thread/chat-thread-shell.js +35 -6
- package/dist/chat-ui/thread/chat-thread-shell.js.map +1 -1
- package/dist/chat-ui/thread/composer-send-or-stop.cjs +30 -20
- package/dist/chat-ui/thread/composer-send-or-stop.cjs.map +1 -1
- package/dist/chat-ui/thread/composer-send-or-stop.d.ts +8 -0
- package/dist/chat-ui/thread/composer-send-or-stop.js +29 -19
- package/dist/chat-ui/thread/composer-send-or-stop.js.map +1 -1
- package/dist/chat-ui/thread/statewire-history-edge.cjs +20 -21
- package/dist/chat-ui/thread/statewire-history-edge.cjs.map +1 -1
- package/dist/chat-ui/thread/statewire-history-edge.js +3 -4
- package/dist/chat-ui/thread/statewire-history-edge.js.map +1 -1
- package/dist/chat-ui/thread/thread-loading-overlay.cjs +5 -5
- package/dist/chat-ui/thread/thread-loading-overlay.cjs.map +1 -1
- package/dist/collab/client.cjs +40 -3
- package/dist/collab/client.cjs.map +1 -1
- package/dist/collab/client.d.ts +25 -0
- package/dist/collab/client.js +40 -3
- package/dist/collab/client.js.map +1 -1
- package/dist/collab/document-status.cjs +150 -0
- package/dist/collab/document-status.cjs.map +1 -0
- package/dist/collab/document-status.d.ts +68 -0
- package/dist/collab/document-status.js +150 -0
- package/dist/collab/document-status.js.map +1 -0
- package/dist/collab/index.cjs +7 -0
- package/dist/collab/index.cjs.map +1 -1
- package/dist/collab/index.d.ts +6 -1
- package/dist/collab/index.js +7 -0
- package/dist/collab/index.js.map +1 -1
- package/dist/collab/presence-react.cjs +11 -11
- package/dist/collab/presence-react.cjs.map +1 -1
- package/dist/collab/react.cjs +6 -6
- package/dist/collab/react.cjs.map +1 -1
- package/dist/composer/AttachmentContext.cjs +24 -11
- package/dist/composer/AttachmentContext.cjs.map +1 -1
- package/dist/composer/AttachmentContext.js +18 -5
- package/dist/composer/AttachmentContext.js.map +1 -1
- package/dist/composer/ComposerAttachmentPreview.cjs +78 -23
- package/dist/composer/ComposerAttachmentPreview.cjs.map +1 -1
- package/dist/composer/ComposerAttachmentPreview.d.ts +5 -3
- package/dist/composer/ComposerAttachmentPreview.js +79 -24
- package/dist/composer/ComposerAttachmentPreview.js.map +1 -1
- package/dist/composer/ComposerDropZone.cjs +7 -7
- package/dist/composer/ComposerDropZone.cjs.map +1 -1
- package/dist/composer/FileUploadButton.cjs +37 -22
- package/dist/composer/FileUploadButton.cjs.map +1 -1
- package/dist/composer/FileUploadButton.d.ts +6 -0
- package/dist/composer/FileUploadButton.js +34 -19
- package/dist/composer/FileUploadButton.js.map +1 -1
- package/dist/composer/QuoteContext.cjs +8 -8
- package/dist/composer/QuoteContext.cjs.map +1 -1
- package/dist/composer/composer-handoff.cjs +4 -4
- package/dist/composer/composer-handoff.cjs.map +1 -1
- package/dist/composer/useAppendToComposer.cjs +4 -4
- package/dist/composer/useAppendToComposer.cjs.map +1 -1
- package/dist/composer/useAttachFiles.cjs +23 -6
- package/dist/composer/useAttachFiles.cjs.map +1 -1
- package/dist/composer/useAttachFiles.d.ts +15 -7
- package/dist/composer/useAttachFiles.js +22 -5
- package/dist/composer/useAttachFiles.js.map +1 -1
- package/dist/composer/useComposerAttachment.cjs +4 -4
- package/dist/composer/useComposerAttachment.cjs.map +1 -1
- package/dist/composer/useFileUpload.cjs +21 -16
- package/dist/composer/useFileUpload.cjs.map +1 -1
- package/dist/composer/useFileUpload.d.ts +12 -0
- package/dist/composer/useFileUpload.js +12 -7
- package/dist/composer/useFileUpload.js.map +1 -1
- package/dist/composer/useReadComposerDraft.cjs +2 -2
- package/dist/composer/useReadComposerDraft.cjs.map +1 -1
- package/dist/composer/useSendMessage.cjs +4 -4
- package/dist/composer/useSendMessage.cjs.map +1 -1
- package/dist/diagnostics/useAthenaDiagnostics.cjs +4 -4
- package/dist/diagnostics/useAthenaDiagnostics.cjs.map +1 -1
- package/dist/dictation/audio-level-history.cjs +3 -3
- package/dist/dictation/audio-level-history.cjs.map +1 -1
- package/dist/dictation/dictation-controls.cjs +24 -20
- package/dist/dictation/dictation-controls.cjs.map +1 -1
- package/dist/dictation/dictation-controls.d.ts +6 -1
- package/dist/dictation/dictation-controls.js +24 -20
- package/dist/dictation/dictation-controls.js.map +1 -1
- package/dist/dictation/use-athena-dictation-engine.cjs +3 -3
- package/dist/dictation/use-athena-dictation-engine.cjs.map +1 -1
- package/dist/dictation/use-dictation.cjs +22 -22
- package/dist/dictation/use-dictation.cjs.map +1 -1
- package/dist/index.cjs +26 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +15 -3
- package/dist/index.js +26 -2
- package/dist/index.js.map +1 -1
- package/dist/keryx-http/src/receive-only-socket.cjs +40 -0
- package/dist/keryx-http/src/receive-only-socket.cjs.map +1 -0
- package/dist/keryx-http/src/receive-only-socket.d.ts +27 -0
- package/dist/keryx-http/src/receive-only-socket.js +40 -0
- package/dist/keryx-http/src/receive-only-socket.js.map +1 -0
- package/dist/keryx-http/src/update-attributions.cjs +111 -0
- package/dist/keryx-http/src/update-attributions.cjs.map +1 -0
- package/dist/keryx-http/src/update-attributions.d.ts +75 -0
- package/dist/keryx-http/src/update-attributions.js +111 -0
- package/dist/keryx-http/src/update-attributions.js.map +1 -0
- package/dist/lib/owner-document.cjs +6 -6
- package/dist/lib/owner-document.cjs.map +1 -1
- package/dist/lib/use-athena-rest-query.cjs +4 -4
- package/dist/lib/use-athena-rest-query.cjs.map +1 -1
- package/dist/lib/use-document-active.cjs +4 -4
- package/dist/lib/use-document-active.cjs.map +1 -1
- package/dist/lib/use-prefers-reduced-motion.cjs +2 -2
- package/dist/lib/use-prefers-reduced-motion.cjs.map +1 -1
- package/dist/offline/offline-history.cjs +7 -7
- package/dist/offline/offline-history.cjs.map +1 -1
- package/dist/provider/AthenaContext.cjs +3 -3
- package/dist/provider/AthenaContext.cjs.map +1 -1
- package/dist/provider/AthenaProvider.cjs +116 -79
- package/dist/provider/AthenaProvider.cjs.map +1 -1
- package/dist/provider/AthenaProvider.js +40 -3
- package/dist/provider/AthenaProvider.js.map +1 -1
- package/dist/provider/PostHogProvider.cjs +2 -2
- package/dist/provider/PostHogProvider.cjs.map +1 -1
- package/dist/provider/agent-selection-context.cjs +2 -2
- package/dist/provider/agent-selection-context.cjs.map +1 -1
- package/dist/provider/chat-mode-context.cjs +2 -2
- package/dist/provider/chat-mode-context.cjs.map +1 -1
- package/dist/provider/session-persistence-context.cjs +10 -0
- package/dist/provider/session-persistence-context.cjs.map +1 -0
- package/dist/provider/session-persistence-context.d.ts +15 -0
- package/dist/provider/session-persistence-context.js +10 -0
- package/dist/provider/session-persistence-context.js.map +1 -0
- package/dist/provider/statewire-history-context.cjs +4 -4
- package/dist/provider/statewire-history-context.cjs.map +1 -1
- package/dist/provider/statewire-lifecycle-context.cjs +3 -3
- package/dist/provider/statewire-lifecycle-context.cjs.map +1 -1
- package/dist/provider/statewire-window-context.cjs +3 -3
- package/dist/provider/statewire-window-context.cjs.map +1 -1
- package/dist/provider/theme-style-context.cjs +3 -3
- package/dist/provider/theme-style-context.cjs.map +1 -1
- package/dist/react/package.json.cjs +1 -1
- package/dist/react/package.json.js +1 -1
- package/dist/references/src/tool-option-schemas.d.ts +0 -34
- package/dist/runtime/StatewireThreadConfigLaneSync.cjs +10 -10
- package/dist/runtime/StatewireThreadConfigLaneSync.cjs.map +1 -1
- package/dist/runtime/auth-refusal-restart.cjs +7 -7
- package/dist/runtime/auth-refusal-restart.cjs.map +1 -1
- package/dist/runtime/auth.cjs +13 -13
- package/dist/runtime/auth.cjs.map +1 -1
- package/dist/runtime/statewire-lifecycle.cjs +1 -0
- package/dist/runtime/statewire-lifecycle.cjs.map +1 -1
- package/dist/runtime/statewire-lifecycle.d.ts +3 -1
- package/dist/runtime/statewire-lifecycle.js +2 -1
- package/dist/runtime/statewire-lifecycle.js.map +1 -1
- package/dist/runtime/statewire-server-lane-context.cjs +2 -2
- package/dist/runtime/statewire-server-lane-context.cjs.map +1 -1
- package/dist/runtime/statewire-session-lane.cjs +4 -4
- package/dist/runtime/statewire-session-lane.cjs.map +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.cjs +10 -8
- package/dist/runtime/useAthenaStatewireRuntime.cjs.map +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.d.ts +2 -0
- package/dist/runtime/useAthenaStatewireRuntime.js +2 -0
- package/dist/runtime/useAthenaStatewireRuntime.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/threads/Inbox.cjs +8 -8
- package/dist/threads/Inbox.cjs.map +1 -1
- package/dist/threads/SessionList.cjs +9 -9
- package/dist/threads/SessionList.cjs.map +1 -1
- package/dist/threads/SessionsPage.cjs +11 -11
- package/dist/threads/SessionsPage.cjs.map +1 -1
- package/dist/threads/index-triggered-refresh.cjs +10 -10
- package/dist/threads/index-triggered-refresh.cjs.map +1 -1
- package/dist/threads/mark-viewed-thread-read.cjs +12 -12
- package/dist/threads/mark-viewed-thread-read.cjs.map +1 -1
- package/dist/threads/offline-session-list.cjs +3 -3
- package/dist/threads/offline-session-list.cjs.map +1 -1
- package/dist/threads/session-list-tab-share.cjs +5 -5
- package/dist/threads/session-list-tab-share.cjs.map +1 -1
- package/dist/threads/statewire-thread-list.cjs +55 -51
- package/dist/threads/statewire-thread-list.cjs.map +1 -1
- package/dist/threads/statewire-thread-list.js +6 -2
- package/dist/threads/statewire-thread-list.js.map +1 -1
- package/dist/threads/thread-id-context.cjs +5 -5
- package/dist/threads/thread-id-context.cjs.map +1 -1
- package/dist/threads/use-athena-session-attention.cjs +2 -2
- package/dist/threads/use-athena-session-attention.cjs.map +1 -1
- package/dist/threads/use-athena-sessions.cjs +10 -10
- package/dist/threads/use-athena-sessions.cjs.map +1 -1
- package/dist/threads/use-athena-thread-model.cjs +3 -3
- package/dist/threads/use-athena-thread-model.cjs.map +1 -1
- package/dist/threads/use-rest-conversation-history.cjs +3 -3
- package/dist/threads/use-rest-conversation-history.cjs.map +1 -1
- package/dist/threads/use-statewire-conversation-history.cjs +8 -8
- package/dist/threads/use-statewire-conversation-history.cjs.map +1 -1
- package/dist/threads/use-thread-archive.cjs +9 -9
- package/dist/threads/use-thread-archive.cjs.map +1 -1
- package/dist/threads/use-thread-favorite.cjs +2 -2
- package/dist/threads/use-thread-favorite.cjs.map +1 -1
- package/dist/threads/use-thread-field-override.cjs +20 -20
- package/dist/threads/use-thread-field-override.cjs.map +1 -1
- package/dist/threads/use-thread-read-state.cjs +4 -4
- package/dist/threads/use-thread-read-state.cjs.map +1 -1
- package/dist/threads/use-thread-rename.cjs +2 -2
- package/dist/threads/use-thread-rename.cjs.map +1 -1
- package/dist/threads/useAthenaThreadManager.cjs +2 -2
- package/dist/threads/useAthenaThreadManager.cjs.map +1 -1
- package/dist/tools/NestedPtcMessages.cjs +6 -6
- package/dist/tools/NestedPtcMessages.cjs.map +1 -1
- package/dist/tools/append-document-tool-ui.cjs +7 -7
- package/dist/tools/append-document-tool-ui.cjs.map +1 -1
- package/dist/tools/file-tool-uis.cjs +2 -2
- package/dist/tools/file-tool-uis.cjs.map +1 -1
- package/dist/tools/misc-tool-uis.cjs +2 -2
- package/dist/tools/misc-tool-uis.cjs.map +1 -1
- package/dist/tools/primitives.cjs +6 -6
- package/dist/tools/primitives.cjs.map +1 -1
- package/dist/tools/read-asset-tool-ui.cjs +6 -6
- package/dist/tools/read-asset-tool-ui.cjs.map +1 -1
- package/dist/tools/subagent-task-tool-ui.cjs +21 -21
- package/dist/tools/subagent-task-tool-ui.cjs.map +1 -1
- package/dist/tools/test-recording-tool-uis.cjs +16 -16
- package/dist/tools/test-recording-tool-uis.cjs.map +1 -1
- package/dist/tools/todo-plan-store.cjs +4 -4
- package/dist/tools/todo-plan-store.cjs.map +1 -1
- package/dist/tools/tool-appearance.cjs +3 -3
- package/dist/tools/tool-appearance.cjs.map +1 -1
- package/dist/tools/tool-fallback.cjs +14 -14
- package/dist/tools/tool-fallback.cjs.map +1 -1
- package/dist/tools/tool-summary.cjs +0 -2
- package/dist/tools/tool-summary.cjs.map +1 -1
- package/dist/tools/tool-summary.js +0 -2
- package/dist/tools/tool-summary.js.map +1 -1
- package/dist/tools/tool-uis.cjs +74 -74
- package/dist/tools/tool-uis.cjs.map +1 -1
- package/dist/tools/use-elapsed-seconds.cjs +3 -3
- package/dist/tools/use-elapsed-seconds.cjs.map +1 -1
- package/dist/tools/write-todos-tool-ui.cjs +9 -9
- package/dist/tools/write-todos-tool-ui.cjs.map +1 -1
- package/dist/ui/image-viewer.cjs +382 -0
- package/dist/ui/image-viewer.cjs.map +1 -0
- package/dist/ui/image-viewer.d.ts +50 -0
- package/dist/ui/image-viewer.js +382 -0
- package/dist/ui/image-viewer.js.map +1 -0
- package/dist/voice/chat.cjs +6 -0
- package/dist/voice/chat.cjs.map +1 -1
- package/dist/voice/chat.d.ts +1 -1
- package/dist/voice/chat.js +8 -2
- package/dist/voice/livekit-join.cjs +52 -101
- package/dist/voice/livekit-join.cjs.map +1 -1
- package/dist/voice/livekit-join.d.ts +1 -6
- package/dist/voice/livekit-join.js +52 -101
- package/dist/voice/livekit-join.js.map +1 -1
- package/dist/voice/livekit.cjs.map +1 -1
- package/dist/voice/livekit.d.ts +11 -1
- package/dist/voice/livekit.js.map +1 -1
- package/dist/voice/use-athena-voice-session.cjs +34 -34
- package/dist/voice/use-athena-voice-session.cjs.map +1 -1
- package/dist/workbench/ComputerLiveDesktop.cjs +13 -13
- package/dist/workbench/ComputerLiveDesktop.cjs.map +1 -1
- package/dist/workbench/SessionWorkbench.cjs +22 -22
- package/dist/workbench/SessionWorkbench.cjs.map +1 -1
- package/dist/workbench/session-workbench-context.cjs +3 -3
- package/dist/workbench/session-workbench-context.cjs.map +1 -1
- package/dist/workbench/session-workbench-panes.cjs +8 -8
- package/dist/workbench/session-workbench-panes.cjs.map +1 -1
- package/dist/workbench/workbench-layout-context.cjs +3 -3
- package/dist/workbench/workbench-layout-context.cjs.map +1 -1
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statewire-history-context.cjs","sources":["../../src/provider/statewire-history-context.ts"],"sourcesContent":["import { createContext, useContext, useSyncExternalStore } from 'react';\n\n/**\n * Where the open thread's windowed history stands, as the chat's history edge\n * (`StatewireHistoryEdge`) knows it: whether the host holds older messages the\n * client has not loaded, and how to ask for the next page. The edge publishes\n * it; other surfaces of the same provider read it — the session workbench's\n * Shell pane, whose rows come from the loaded transcript, says its count is\n * partial and offers the earlier commands.\n */\nexport interface StatewireHistoryState {\n /** The thread the edge reported for; `null` while no edge is mounted. */\n threadId: string | null;\n /** The host holds messages older than the loaded window. */\n hasOlder: boolean;\n /** The next page can be asked for: older messages exist and the host's interest cap has room. */\n canLoadOlder: boolean;\n /** A page of older history is in flight. */\n loading: boolean;\n /** Ask for the next page (the edge row's own action); `null` while no edge is mounted. */\n loadOlder: (() => void) | null;\n}\n\nexport const NO_STATEWIRE_HISTORY: StatewireHistoryState = {\n threadId: null,\n hasOlder: false,\n canLoadOlder: false,\n loading: false,\n loadOlder: null,\n};\n\n/** A tiny external store: the edge writes, readers subscribe. */\nexport interface StatewireHistoryStore {\n get: () => StatewireHistoryState;\n set: (next: StatewireHistoryState) => void;\n subscribe: (listener: () => void) => () => void;\n}\n\nexport function createStatewireHistoryStore(): StatewireHistoryStore {\n let state = NO_STATEWIRE_HISTORY;\n const listeners = new Set<() => void>();\n return {\n get: () => state,\n set: (next) => {\n if (\n next.threadId === state.threadId &&\n next.hasOlder === state.hasOlder &&\n next.canLoadOlder === state.canLoadOlder &&\n next.loading === state.loading &&\n next.loadOlder === state.loadOlder\n ) {\n return;\n }\n state = next;\n for (const listener of listeners) listener();\n },\n subscribe: (listener) => {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n };\n}\n\n/** Provided by `AthenaProvider`, one store per provider. */\nexport const StatewireHistoryContext = createContext<StatewireHistoryStore | null>(null);\n\nconst subscribeToNothing = () => () => {};\nconst readNoHistory = () => NO_STATEWIRE_HISTORY;\n\n/**\n * The history state the edge reported for *threadId*, or `null` when none\n * did: no provider, no history edge mounted (a host that renders its own\n * transcript), or another thread's report.\n */\nexport function useStatewireHistory(threadId: string | null): StatewireHistoryState | null {\n const store = useContext(StatewireHistoryContext);\n const state = useSyncExternalStore(\n store?.subscribe ?? subscribeToNothing,\n store?.get ?? readNoHistory,\n store?.get ?? readNoHistory,\n );\n return threadId !== null && state.threadId === threadId ? state : null;\n}\n"],"names":["createContext","useContext","useSyncExternalStore"],"mappings":";;;AAuBO,MAAM,uBAA8C;AAAA,EACzD,UAAU;AAAA,EACV,UAAU;AAAA,EACV,cAAc;AAAA,EACd,SAAS;AAAA,EACT,WAAW;AACb;AASO,SAAS,8BAAqD;AACnE,MAAI,QAAQ;AACZ,QAAM,gCAAgB,IAAA;AACtB,SAAO;AAAA,IACL,KAAK,MAAM;AAAA,IACX,KAAK,CAAC,SAAS;AACb,UACE,KAAK,aAAa,MAAM,YACxB,KAAK,aAAa,MAAM,YACxB,KAAK,iBAAiB,MAAM,gBAC5B,KAAK,YAAY,MAAM,WACvB,KAAK,cAAc,MAAM,WACzB;AACA;AAAA,MACF;AACA,cAAQ;AACR,iBAAW,YAAY,UAAW,UAAA;AAAA,IACpC;AAAA,IACA,WAAW,CAAC,aAAa;AACvB,gBAAU,IAAI,QAAQ;AACtB,aAAO,MAAM;AACX,kBAAU,OAAO,QAAQ;AAAA,MAC3B;AAAA,IACF;AAAA,EAAA;AAEJ;AAGO,MAAM,0BAA0BA,
|
|
1
|
+
{"version":3,"file":"statewire-history-context.cjs","sources":["../../src/provider/statewire-history-context.ts"],"sourcesContent":["import { createContext, useContext, useSyncExternalStore } from 'react';\n\n/**\n * Where the open thread's windowed history stands, as the chat's history edge\n * (`StatewireHistoryEdge`) knows it: whether the host holds older messages the\n * client has not loaded, and how to ask for the next page. The edge publishes\n * it; other surfaces of the same provider read it — the session workbench's\n * Shell pane, whose rows come from the loaded transcript, says its count is\n * partial and offers the earlier commands.\n */\nexport interface StatewireHistoryState {\n /** The thread the edge reported for; `null` while no edge is mounted. */\n threadId: string | null;\n /** The host holds messages older than the loaded window. */\n hasOlder: boolean;\n /** The next page can be asked for: older messages exist and the host's interest cap has room. */\n canLoadOlder: boolean;\n /** A page of older history is in flight. */\n loading: boolean;\n /** Ask for the next page (the edge row's own action); `null` while no edge is mounted. */\n loadOlder: (() => void) | null;\n}\n\nexport const NO_STATEWIRE_HISTORY: StatewireHistoryState = {\n threadId: null,\n hasOlder: false,\n canLoadOlder: false,\n loading: false,\n loadOlder: null,\n};\n\n/** A tiny external store: the edge writes, readers subscribe. */\nexport interface StatewireHistoryStore {\n get: () => StatewireHistoryState;\n set: (next: StatewireHistoryState) => void;\n subscribe: (listener: () => void) => () => void;\n}\n\nexport function createStatewireHistoryStore(): StatewireHistoryStore {\n let state = NO_STATEWIRE_HISTORY;\n const listeners = new Set<() => void>();\n return {\n get: () => state,\n set: (next) => {\n if (\n next.threadId === state.threadId &&\n next.hasOlder === state.hasOlder &&\n next.canLoadOlder === state.canLoadOlder &&\n next.loading === state.loading &&\n next.loadOlder === state.loadOlder\n ) {\n return;\n }\n state = next;\n for (const listener of listeners) listener();\n },\n subscribe: (listener) => {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n };\n}\n\n/** Provided by `AthenaProvider`, one store per provider. */\nexport const StatewireHistoryContext = createContext<StatewireHistoryStore | null>(null);\n\nconst subscribeToNothing = () => () => {};\nconst readNoHistory = () => NO_STATEWIRE_HISTORY;\n\n/**\n * The history state the edge reported for *threadId*, or `null` when none\n * did: no provider, no history edge mounted (a host that renders its own\n * transcript), or another thread's report.\n */\nexport function useStatewireHistory(threadId: string | null): StatewireHistoryState | null {\n const store = useContext(StatewireHistoryContext);\n const state = useSyncExternalStore(\n store?.subscribe ?? subscribeToNothing,\n store?.get ?? readNoHistory,\n store?.get ?? readNoHistory,\n );\n return threadId !== null && state.threadId === threadId ? state : null;\n}\n"],"names":["createContext","useContext","useSyncExternalStore"],"mappings":";;;AAuBO,MAAM,uBAA8C;AAAA,EACzD,UAAU;AAAA,EACV,UAAU;AAAA,EACV,cAAc;AAAA,EACd,SAAS;AAAA,EACT,WAAW;AACb;AASO,SAAS,8BAAqD;AACnE,MAAI,QAAQ;AACZ,QAAM,gCAAgB,IAAA;AACtB,SAAO;AAAA,IACL,KAAK,MAAM;AAAA,IACX,KAAK,CAAC,SAAS;AACb,UACE,KAAK,aAAa,MAAM,YACxB,KAAK,aAAa,MAAM,YACxB,KAAK,iBAAiB,MAAM,gBAC5B,KAAK,YAAY,MAAM,WACvB,KAAK,cAAc,MAAM,WACzB;AACA;AAAA,MACF;AACA,cAAQ;AACR,iBAAW,YAAY,UAAW,UAAA;AAAA,IACpC;AAAA,IACA,WAAW,CAAC,aAAa;AACvB,gBAAU,IAAI,QAAQ;AACtB,aAAO,MAAM;AACX,kBAAU,OAAO,QAAQ;AAAA,MAC3B;AAAA,IACF;AAAA,EAAA;AAEJ;AAGO,MAAM,0BAA0BA,WAAAA,cAA4C,IAAI;AAEvF,MAAM,qBAAqB,MAAM,MAAM;AAAC;AACxC,MAAM,gBAAgB,MAAM;AAOrB,SAAS,oBAAoB,UAAuD;AACzF,QAAM,QAAQC,WAAAA,WAAW,uBAAuB;AAChD,QAAM,QAAQC,WAAAA;AAAAA,KACZ,+BAAO,cAAa;AAAA,KACpB,+BAAO,QAAO;AAAA,KACd,+BAAO,QAAO;AAAA,EAAA;AAEhB,SAAO,aAAa,QAAQ,MAAM,aAAa,WAAW,QAAQ;AACpE;;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
4
|
-
const AthenaStatewireLifecycleContext =
|
|
3
|
+
const require$$0 = require("react");
|
|
4
|
+
const AthenaStatewireLifecycleContext = require$$0.createContext(null);
|
|
5
5
|
function useAthenaStatewireLifecycle() {
|
|
6
|
-
return
|
|
6
|
+
return require$$0.useContext(AthenaStatewireLifecycleContext);
|
|
7
7
|
}
|
|
8
8
|
exports.AthenaStatewireLifecycleContext = AthenaStatewireLifecycleContext;
|
|
9
9
|
exports.useAthenaStatewireLifecycle = useAthenaStatewireLifecycle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statewire-lifecycle-context.cjs","sources":["../../src/provider/statewire-lifecycle-context.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\nimport type { AthenaStatewireLifecycleState } from '../runtime/statewire-lifecycle';\n\n/**\n * Statewire transport lifecycle (connection status, transport errors,\n * reconnect handle). Provided by `AthenaProvider`; `null` outside the\n * provider, so lifecycle-driven UI renders nothing there.\n */\nexport const AthenaStatewireLifecycleContext =\n createContext<AthenaStatewireLifecycleState | null>(null);\n\n/** Read the statewire lifecycle, or null outside `AthenaProvider`. */\nexport function useAthenaStatewireLifecycle(): AthenaStatewireLifecycleState | null {\n return useContext(AthenaStatewireLifecycleContext);\n}\n"],"names":["createContext","useContext"],"mappings":";;;AAQO,MAAM,kCACXA,
|
|
1
|
+
{"version":3,"file":"statewire-lifecycle-context.cjs","sources":["../../src/provider/statewire-lifecycle-context.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\nimport type { AthenaStatewireLifecycleState } from '../runtime/statewire-lifecycle';\n\n/**\n * Statewire transport lifecycle (connection status, transport errors,\n * reconnect handle). Provided by `AthenaProvider`; `null` outside the\n * provider, so lifecycle-driven UI renders nothing there.\n */\nexport const AthenaStatewireLifecycleContext =\n createContext<AthenaStatewireLifecycleState | null>(null);\n\n/** Read the statewire lifecycle, or null outside `AthenaProvider`. */\nexport function useAthenaStatewireLifecycle(): AthenaStatewireLifecycleState | null {\n return useContext(AthenaStatewireLifecycleContext);\n}\n"],"names":["createContext","useContext"],"mappings":";;;AAQO,MAAM,kCACXA,WAAAA,cAAoD,IAAI;AAGnD,SAAS,8BAAoE;AAClF,SAAOC,WAAAA,WAAW,+BAA+B;AACnD;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
4
|
-
const StatewireToolOutputsContext =
|
|
3
|
+
const require$$0 = require("react");
|
|
4
|
+
const StatewireToolOutputsContext = require$$0.createContext(null);
|
|
5
5
|
function useStatewireToolOutputs() {
|
|
6
|
-
return
|
|
6
|
+
return require$$0.useContext(StatewireToolOutputsContext);
|
|
7
7
|
}
|
|
8
8
|
exports.StatewireToolOutputsContext = StatewireToolOutputsContext;
|
|
9
9
|
exports.useStatewireToolOutputs = useStatewireToolOutputs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statewire-window-context.cjs","sources":["../../src/provider/statewire-window-context.tsx"],"sourcesContent":["import type { DeepAgentToolOutputStore } from '@athenaintel/agent-runtime';\nimport { createContext, useContext } from 'react';\n\n/**\n * The store of full tool outputs fetched back for a windowed wire's cut tool\n * messages — the SAME instance the thread converts with\n * (`useAthenaStatewireRuntime({ toolOutputs })`), so the edge row's lazy\n * fetch and the converter's substitution meet. Provided by `AthenaProvider`\n * (one per provider, cleared with the acting identity); hosts that mount the\n * runtime themselves pass the store to `StatewireHistoryEdge` directly.\n */\nexport const StatewireToolOutputsContext = createContext<DeepAgentToolOutputStore | null>(null);\n\n/** The provider's tool-output store, or `null` outside `AthenaProvider`. */\nexport function useStatewireToolOutputs(): DeepAgentToolOutputStore | null {\n return useContext(StatewireToolOutputsContext);\n}\n"],"names":["createContext","useContext"],"mappings":";;;AAWO,MAAM,8BAA8BA,
|
|
1
|
+
{"version":3,"file":"statewire-window-context.cjs","sources":["../../src/provider/statewire-window-context.tsx"],"sourcesContent":["import type { DeepAgentToolOutputStore } from '@athenaintel/agent-runtime';\nimport { createContext, useContext } from 'react';\n\n/**\n * The store of full tool outputs fetched back for a windowed wire's cut tool\n * messages — the SAME instance the thread converts with\n * (`useAthenaStatewireRuntime({ toolOutputs })`), so the edge row's lazy\n * fetch and the converter's substitution meet. Provided by `AthenaProvider`\n * (one per provider, cleared with the acting identity); hosts that mount the\n * runtime themselves pass the store to `StatewireHistoryEdge` directly.\n */\nexport const StatewireToolOutputsContext = createContext<DeepAgentToolOutputStore | null>(null);\n\n/** The provider's tool-output store, or `null` outside `AthenaProvider`. */\nexport function useStatewireToolOutputs(): DeepAgentToolOutputStore | null {\n return useContext(StatewireToolOutputsContext);\n}\n"],"names":["createContext","useContext"],"mappings":";;;AAWO,MAAM,8BAA8BA,WAAAA,cAA+C,IAAI;AAGvF,SAAS,0BAA2D;AACzE,SAAOC,WAAAA,WAAW,2BAA2B;AAC/C;;;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
4
|
-
const AthenaThemeStyleContext =
|
|
3
|
+
const require$$0 = require("react");
|
|
4
|
+
const AthenaThemeStyleContext = require$$0.createContext(
|
|
5
5
|
void 0
|
|
6
6
|
);
|
|
7
7
|
function useAthenaThemeStyle() {
|
|
8
|
-
return
|
|
8
|
+
return require$$0.useContext(AthenaThemeStyleContext);
|
|
9
9
|
}
|
|
10
10
|
exports.AthenaThemeStyleContext = AthenaThemeStyleContext;
|
|
11
11
|
exports.useAthenaThemeStyle = useAthenaThemeStyle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-style-context.cjs","sources":["../../src/provider/theme-style-context.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\n\n/**\n * The provider theme's CSS variables (`themeToStyleVars`), `undefined` without\n * a `theme`. SDK content portaled out of the provider's wrapper (a popover\n * under `document.body`) never inherits the variables the wrapper sets, so it\n * applies these itself to keep the host's palette.\n */\nexport const AthenaThemeStyleContext = createContext<Record<string, string> | undefined>(\n undefined,\n);\n\nexport function useAthenaThemeStyle(): Record<string, string> | undefined {\n return useContext(AthenaThemeStyleContext);\n}\n"],"names":["createContext","useContext"],"mappings":";;;AAQO,MAAM,0BAA0BA,
|
|
1
|
+
{"version":3,"file":"theme-style-context.cjs","sources":["../../src/provider/theme-style-context.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\n\n/**\n * The provider theme's CSS variables (`themeToStyleVars`), `undefined` without\n * a `theme`. SDK content portaled out of the provider's wrapper (a popover\n * under `document.body`) never inherits the variables the wrapper sets, so it\n * applies these itself to keep the host's palette.\n */\nexport const AthenaThemeStyleContext = createContext<Record<string, string> | undefined>(\n undefined,\n);\n\nexport function useAthenaThemeStyle(): Record<string, string> | undefined {\n return useContext(AthenaThemeStyleContext);\n}\n"],"names":["createContext","useContext"],"mappings":";;;AAQO,MAAM,0BAA0BA,WAAAA;AAAAA,EACrC;AACF;AAEO,SAAS,sBAA0D;AACxE,SAAOC,WAAAA,WAAW,uBAAuB;AAC3C;;;"}
|
|
@@ -97,23 +97,6 @@ export declare const GitHubToolkitOptionsSchema: z.ZodObject<{
|
|
|
97
97
|
env_vars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
98
98
|
}, z.core.$strict>;
|
|
99
99
|
export type GitHubToolkitOptions = z.infer<typeof GitHubToolkitOptionsSchema>;
|
|
100
|
-
export declare const PerplexitySearchOptionsSchema: z.ZodObject<{
|
|
101
|
-
model: z.ZodOptional<z.ZodEnum<{
|
|
102
|
-
sonar: "sonar";
|
|
103
|
-
"sonar-pro": "sonar-pro";
|
|
104
|
-
"sonar-reasoning": "sonar-reasoning";
|
|
105
|
-
}>>;
|
|
106
|
-
search_recency_filter: z.ZodOptional<z.ZodEnum<{
|
|
107
|
-
day: "day";
|
|
108
|
-
hour: "hour";
|
|
109
|
-
month: "month";
|
|
110
|
-
week: "week";
|
|
111
|
-
year: "year";
|
|
112
|
-
}>>;
|
|
113
|
-
search_domain_filter: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
114
|
-
max_results: z.ZodOptional<z.ZodNumber>;
|
|
115
|
-
}, z.core.$strict>;
|
|
116
|
-
export type PerplexitySearchOptions = z.infer<typeof PerplexitySearchOptionsSchema>;
|
|
117
100
|
export declare const SendSlackMessageOptionsSchema: z.ZodObject<{
|
|
118
101
|
channel_id: z.ZodOptional<z.ZodString>;
|
|
119
102
|
channel_name: z.ZodOptional<z.ZodString>;
|
|
@@ -352,22 +335,6 @@ export declare const TOOL_OPTION_SCHEMAS: {
|
|
|
352
335
|
secret_asset_id: z.ZodOptional<z.ZodString>;
|
|
353
336
|
env_vars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
354
337
|
}, z.core.$strict>;
|
|
355
|
-
readonly perplexity_search: z.ZodObject<{
|
|
356
|
-
model: z.ZodOptional<z.ZodEnum<{
|
|
357
|
-
sonar: "sonar";
|
|
358
|
-
"sonar-pro": "sonar-pro";
|
|
359
|
-
"sonar-reasoning": "sonar-reasoning";
|
|
360
|
-
}>>;
|
|
361
|
-
search_recency_filter: z.ZodOptional<z.ZodEnum<{
|
|
362
|
-
day: "day";
|
|
363
|
-
hour: "hour";
|
|
364
|
-
month: "month";
|
|
365
|
-
week: "week";
|
|
366
|
-
year: "year";
|
|
367
|
-
}>>;
|
|
368
|
-
search_domain_filter: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
369
|
-
max_results: z.ZodOptional<z.ZodNumber>;
|
|
370
|
-
}, z.core.$strict>;
|
|
371
338
|
readonly send_slack_message: z.ZodObject<{
|
|
372
339
|
channel_id: z.ZodOptional<z.ZodString>;
|
|
373
340
|
channel_name: z.ZodOptional<z.ZodString>;
|
|
@@ -517,7 +484,6 @@ export type ToolOptionsMap = {
|
|
|
517
484
|
python_toolkit: PythonToolkitOptions;
|
|
518
485
|
toolkit_python: PythonToolkitOptions;
|
|
519
486
|
github_toolkit: GitHubToolkitOptions;
|
|
520
|
-
perplexity_search: PerplexitySearchOptions;
|
|
521
487
|
send_slack_message: SendSlackMessageOptions;
|
|
522
488
|
read_slack_channel: ReadSlackChannelOptions;
|
|
523
489
|
track_website_changes: TrackWebChangesOptions;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const reactStatewire = require("@assistant-ui/react-statewire");
|
|
4
|
-
const
|
|
4
|
+
const require$$0 = require("react");
|
|
5
5
|
const athenaDiagnostics = require("../diagnostics/athena-diagnostics.cjs");
|
|
6
6
|
const statewireThreadConfigLane = require("./statewire-thread-config-lane.cjs");
|
|
7
7
|
const useDeepAgentConfig = require("../agent-runtime/src/use-deep-agent-config.cjs");
|
|
@@ -31,22 +31,22 @@ function StatewireThreadConfigLaneSync({
|
|
|
31
31
|
serverConfig: lane.config,
|
|
32
32
|
sendCommand
|
|
33
33
|
});
|
|
34
|
-
const seenRef =
|
|
35
|
-
const pendingRef =
|
|
36
|
-
const attemptsRef =
|
|
37
|
-
const closedRef =
|
|
38
|
-
const patchConfigRef =
|
|
34
|
+
const seenRef = require$$0.useRef(config);
|
|
35
|
+
const pendingRef = require$$0.useRef(/* @__PURE__ */ new Set());
|
|
36
|
+
const attemptsRef = require$$0.useRef(/* @__PURE__ */ new Map());
|
|
37
|
+
const closedRef = require$$0.useRef(false);
|
|
38
|
+
const patchConfigRef = require$$0.useRef(patchConfig);
|
|
39
39
|
patchConfigRef.current = patchConfig;
|
|
40
|
-
const [retryTick, setRetryTick] =
|
|
41
|
-
const retryTimerRef =
|
|
42
|
-
|
|
40
|
+
const [retryTick, setRetryTick] = require$$0.useState(0);
|
|
41
|
+
const retryTimerRef = require$$0.useRef(null);
|
|
42
|
+
require$$0.useEffect(
|
|
43
43
|
() => () => {
|
|
44
44
|
if (retryTimerRef.current !== null) clearTimeout(retryTimerRef.current);
|
|
45
45
|
},
|
|
46
46
|
[]
|
|
47
47
|
);
|
|
48
48
|
const landed = lane.landed;
|
|
49
|
-
|
|
49
|
+
require$$0.useEffect(() => {
|
|
50
50
|
const pending = pendingRef.current;
|
|
51
51
|
const attempts = attemptsRef.current;
|
|
52
52
|
for (const key of statewireThreadConfigLane.PROVIDER_THREAD_CONFIG_KEYS) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatewireThreadConfigLaneSync.cjs","sources":["../../src/runtime/StatewireThreadConfigLaneSync.tsx"],"sourcesContent":["import { useStatewireSendCommand } from '@assistant-ui/react-statewire';\nimport {\n type DeepAgentConfigControllerInputs,\n isConfigSyncUnavailableRejection,\n isConfigWriteForbiddenRejection,\n statewireTransportOutcome,\n useDeepAgentConfigController,\n} from '@athenaintel/agent-runtime';\nimport { useEffect, useRef, useState } from 'react';\nimport { athenaDiagnostics } from '../diagnostics/athena-diagnostics';\nimport type { AthenaStatewireServerLane } from './statewire-server-lane-context';\nimport {\n decideThreadConfigLanePatch,\n PROVIDER_THREAD_CONFIG_KEYS,\n type ProviderThreadConfig,\n type ProviderThreadConfigKey,\n type ProviderThreadConfigPatch,\n patchedThreadConfigKeys,\n sameThreadConfigValue,\n} from './statewire-thread-config-lane';\n\n/** Writes of one change, the first included, before the sync gives up on it. */\nconst MAX_PATCH_ATTEMPTS_PER_CHANGE = 3;\n\n/** Wait before re-writing a change the channel dropped: 1 s, then 4 s. */\nconst RETRY_BACKOFF_MS = [1_000, 4_000] as const;\n\n/**\n * What a `statewire.config` event says about a write: the thread, the model it\n * set (`null`: unset), and the other provider-owned keys it set\n * (`config_keys`), never their values (a system prompt is the host's text).\n */\nfunction configWriteData({\n threadId,\n patch,\n}: {\n threadId: string;\n patch: ProviderThreadConfigPatch;\n}): Record<string, unknown> {\n const otherKeys = patchedThreadConfigKeys(patch).filter((key) => key !== 'model');\n return {\n thread_id: threadId,\n ...(Object.hasOwn(patch, 'model') && { model: patch.model }),\n ...(otherKeys.length > 0 && { config_keys: otherKeys }),\n };\n}\n\n/**\n * Writes the provider-owned thread-config keys to the thread's server config\n * lane when the host changes the props that feed them during an attach:\n * `model`, `systemPrompt` (`system_prompt`), `tools` and `frontendTools`\n * (`enabled_tools`), `workbench` and `knowledgeBase` (`knowledge_base`).\n *\n * Once a thread has a lane (version > 0), agora composes every run from the\n * lane and drops the thread-config keys a send carries, so a model, prompt,\n * tool list or asset list changed after the thread's first turn would never\n * apply. A change of such a prop therefore becomes one `config/patch`\n * carrying exactly the changed keys, each with the value the send would carry\n * (`null` when the send carries none: the key is unset, so the collab agent's\n * own value, or the default, applies). An empty tool or asset list is `null`,\n * as the send omits it.\n *\n * Only a CHANGE is written. A prop's value when the attach starts is never\n * written, even when the lane holds another value: that value is another\n * client's (or an earlier session's) choice for this thread, and an SDK app's\n * global setting must not overwrite it just by opening the thread. Hosts that\n * want the picker to follow the thread read `useAthenaThreadModel`.\n *\n * Decisions read the lane the host itself sent on this attach (`lane`, from\n * the transport), never the rendered thread state: before the attach snapshot\n * lands that state is a placeholder without a lane, or a remembered snapshot\n * with an older one, and comparing a change against either would write over\n * the session's real config. A change made before the snapshot lands waits\n * for it.\n *\n * A version-0 thread needs no write: the next send carries the values and\n * agora's deferral seed persists them. A change stays pending until the lane\n * exists, so a lane an earlier send seeds with the previous values is\n * corrected when it lands. A refusal that can never succeed (a view-only\n * collaborator, a workspace without server config) stops the sync for the\n * attach and is reported on the diagnostics bus. A write the channel dropped\n * (a lost stream, the host's expired verdict) stays pending and is written\n * again after a backoff once the channel is live, at most\n * {@link MAX_PATCH_ATTEMPTS_PER_CHANGE} times per change.\n *\n * The writes go through the `config/*` command family, which agora gates on\n * EDIT on the thread's session asset (`_authorize_config_write`).\n *\n * Mounted under the runtime's `AuiProvider`, keyed by the thread, so each\n * attach starts with nothing pending.\n */\nexport function StatewireThreadConfigLaneSync({\n threadId,\n config,\n lane,\n channelLive,\n}: {\n threadId: string;\n /** The values this thread's sends carry, published with the thread (see the provider). */\n config: ProviderThreadConfig;\n lane: AthenaStatewireServerLane;\n /** Whether the channel can take a command now; writes wait for it. */\n channelLive: boolean;\n}): null {\n const send = useStatewireSendCommand();\n const sendCommand: DeepAgentConfigControllerInputs['sendCommand'] = (command) =>\n Promise.resolve(send(command));\n const { configVersion, custom, patchConfig } = useDeepAgentConfigController({\n serverConfig: lane.config,\n sendCommand,\n });\n\n const seenRef = useRef(config);\n const pendingRef = useRef(new Set<ProviderThreadConfigKey>());\n const attemptsRef = useRef(new Map<ProviderThreadConfigKey, number>());\n const closedRef = useRef(false);\n const patchConfigRef = useRef(patchConfig);\n patchConfigRef.current = patchConfig;\n // Bumped (after a backoff) to re-run the effect for a write the channel dropped.\n const [retryTick, setRetryTick] = useState(0);\n const retryTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n useEffect(\n () => () => {\n if (retryTimerRef.current !== null) clearTimeout(retryTimerRef.current);\n },\n [],\n );\n const landed = lane.landed;\n\n useEffect(() => {\n const pending = pendingRef.current;\n const attempts = attemptsRef.current;\n for (const key of PROVIDER_THREAD_CONFIG_KEYS) {\n if (sameThreadConfigValue(config[key], seenRef.current[key])) continue;\n pending.add(key);\n attempts.set(key, 0);\n }\n seenRef.current = config;\n if (pending.size === 0 || closedRef.current || !channelLive) return;\n const decision = decideThreadConfigLanePatch({\n desired: config,\n keys: pending,\n landed,\n configVersion,\n custom,\n });\n if (decision.kind === 'wait') return;\n pending.clear();\n if (decision.kind === 'done') return;\n\n const { patch } = decision;\n const patchKeys = patchedThreadConfigKeys(patch);\n for (const key of patchKeys) attempts.set(key, (attempts.get(key) ?? 0) + 1);\n const modelOnly = patchKeys.length === 1 && patchKeys[0] === 'model';\n patchConfigRef.current(patch).catch((error: unknown) => {\n const data = configWriteData({ threadId, patch });\n if (isConfigWriteForbiddenRejection(error) || isConfigSyncUnavailableRejection(error)) {\n closedRef.current = true;\n athenaDiagnostics.emit('statewire.config', {\n level: 'warn',\n data: {\n ...data,\n reason: isConfigWriteForbiddenRejection(error)\n ? 'config_write_forbidden'\n : 'config_sync_unavailable',\n },\n });\n return;\n }\n const outcome = statewireTransportOutcome(error);\n if (outcome !== null) {\n // Channel weather (a dropped stream, the host's expired verdict): keep\n // each change pending and write it again after a backoff, once the\n // channel is live, unless its prop has moved on or the attach is gone.\n athenaDiagnostics.emit('statewire.config', {\n level: 'debug',\n data: { ...data, outcome },\n });\n if (outcome === 'unmount') return;\n const retryKeys = patchKeys.filter(\n (key) =>\n sameThreadConfigValue(seenRef.current[key], patch[key] ?? null) &&\n (attempts.get(key) ?? 0) < MAX_PATCH_ATTEMPTS_PER_CHANGE,\n );\n if (retryKeys.length === 0) return;\n for (const key of retryKeys) pendingRef.current.add(key);\n const written = Math.max(...retryKeys.map((key) => attempts.get(key) ?? 1));\n const delay = RETRY_BACKOFF_MS[Math.min(written - 1, RETRY_BACKOFF_MS.length - 1)];\n retryTimerRef.current = setTimeout(() => {\n retryTimerRef.current = null;\n setRetryTick((tick) => tick + 1);\n }, delay);\n return;\n }\n athenaDiagnostics.error(\n 'statewire.config',\n error,\n modelOnly\n ? {\n code: 'statewire_rejected',\n message: 'The statewire host refused the model change',\n hint: 'Inspect error.detail: agora rejections carry a structured {code, message}. The thread keeps running with the model its server config holds.',\n }\n : {\n code: 'statewire_rejected',\n message: 'The statewire host refused the thread config change',\n hint: 'Inspect error.detail: agora rejections carry a structured {code, message}. The thread keeps running with the config its server config holds.',\n },\n data,\n );\n });\n }, [config, landed, configVersion, custom, channelLive, retryTick, threadId]);\n\n return null;\n}\n"],"names":["patchedThreadConfigKeys","useStatewireSendCommand","useDeepAgentConfigController","useRef","useState","useEffect","PROVIDER_THREAD_CONFIG_KEYS","sameThreadConfigValue","decideThreadConfigLanePatch","isConfigWriteForbiddenRejection","isConfigSyncUnavailableRejection","athenaDiagnostics","statewireTransportOutcome"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"StatewireThreadConfigLaneSync.cjs","sources":["../../src/runtime/StatewireThreadConfigLaneSync.tsx"],"sourcesContent":["import { useStatewireSendCommand } from '@assistant-ui/react-statewire';\nimport {\n type DeepAgentConfigControllerInputs,\n isConfigSyncUnavailableRejection,\n isConfigWriteForbiddenRejection,\n statewireTransportOutcome,\n useDeepAgentConfigController,\n} from '@athenaintel/agent-runtime';\nimport { useEffect, useRef, useState } from 'react';\nimport { athenaDiagnostics } from '../diagnostics/athena-diagnostics';\nimport type { AthenaStatewireServerLane } from './statewire-server-lane-context';\nimport {\n decideThreadConfigLanePatch,\n PROVIDER_THREAD_CONFIG_KEYS,\n type ProviderThreadConfig,\n type ProviderThreadConfigKey,\n type ProviderThreadConfigPatch,\n patchedThreadConfigKeys,\n sameThreadConfigValue,\n} from './statewire-thread-config-lane';\n\n/** Writes of one change, the first included, before the sync gives up on it. */\nconst MAX_PATCH_ATTEMPTS_PER_CHANGE = 3;\n\n/** Wait before re-writing a change the channel dropped: 1 s, then 4 s. */\nconst RETRY_BACKOFF_MS = [1_000, 4_000] as const;\n\n/**\n * What a `statewire.config` event says about a write: the thread, the model it\n * set (`null`: unset), and the other provider-owned keys it set\n * (`config_keys`), never their values (a system prompt is the host's text).\n */\nfunction configWriteData({\n threadId,\n patch,\n}: {\n threadId: string;\n patch: ProviderThreadConfigPatch;\n}): Record<string, unknown> {\n const otherKeys = patchedThreadConfigKeys(patch).filter((key) => key !== 'model');\n return {\n thread_id: threadId,\n ...(Object.hasOwn(patch, 'model') && { model: patch.model }),\n ...(otherKeys.length > 0 && { config_keys: otherKeys }),\n };\n}\n\n/**\n * Writes the provider-owned thread-config keys to the thread's server config\n * lane when the host changes the props that feed them during an attach:\n * `model`, `systemPrompt` (`system_prompt`), `tools` and `frontendTools`\n * (`enabled_tools`), `workbench` and `knowledgeBase` (`knowledge_base`).\n *\n * Once a thread has a lane (version > 0), agora composes every run from the\n * lane and drops the thread-config keys a send carries, so a model, prompt,\n * tool list or asset list changed after the thread's first turn would never\n * apply. A change of such a prop therefore becomes one `config/patch`\n * carrying exactly the changed keys, each with the value the send would carry\n * (`null` when the send carries none: the key is unset, so the collab agent's\n * own value, or the default, applies). An empty tool or asset list is `null`,\n * as the send omits it.\n *\n * Only a CHANGE is written. A prop's value when the attach starts is never\n * written, even when the lane holds another value: that value is another\n * client's (or an earlier session's) choice for this thread, and an SDK app's\n * global setting must not overwrite it just by opening the thread. Hosts that\n * want the picker to follow the thread read `useAthenaThreadModel`.\n *\n * Decisions read the lane the host itself sent on this attach (`lane`, from\n * the transport), never the rendered thread state: before the attach snapshot\n * lands that state is a placeholder without a lane, or a remembered snapshot\n * with an older one, and comparing a change against either would write over\n * the session's real config. A change made before the snapshot lands waits\n * for it.\n *\n * A version-0 thread needs no write: the next send carries the values and\n * agora's deferral seed persists them. A change stays pending until the lane\n * exists, so a lane an earlier send seeds with the previous values is\n * corrected when it lands. A refusal that can never succeed (a view-only\n * collaborator, a workspace without server config) stops the sync for the\n * attach and is reported on the diagnostics bus. A write the channel dropped\n * (a lost stream, the host's expired verdict) stays pending and is written\n * again after a backoff once the channel is live, at most\n * {@link MAX_PATCH_ATTEMPTS_PER_CHANGE} times per change.\n *\n * The writes go through the `config/*` command family, which agora gates on\n * EDIT on the thread's session asset (`_authorize_config_write`).\n *\n * Mounted under the runtime's `AuiProvider`, keyed by the thread, so each\n * attach starts with nothing pending.\n */\nexport function StatewireThreadConfigLaneSync({\n threadId,\n config,\n lane,\n channelLive,\n}: {\n threadId: string;\n /** The values this thread's sends carry, published with the thread (see the provider). */\n config: ProviderThreadConfig;\n lane: AthenaStatewireServerLane;\n /** Whether the channel can take a command now; writes wait for it. */\n channelLive: boolean;\n}): null {\n const send = useStatewireSendCommand();\n const sendCommand: DeepAgentConfigControllerInputs['sendCommand'] = (command) =>\n Promise.resolve(send(command));\n const { configVersion, custom, patchConfig } = useDeepAgentConfigController({\n serverConfig: lane.config,\n sendCommand,\n });\n\n const seenRef = useRef(config);\n const pendingRef = useRef(new Set<ProviderThreadConfigKey>());\n const attemptsRef = useRef(new Map<ProviderThreadConfigKey, number>());\n const closedRef = useRef(false);\n const patchConfigRef = useRef(patchConfig);\n patchConfigRef.current = patchConfig;\n // Bumped (after a backoff) to re-run the effect for a write the channel dropped.\n const [retryTick, setRetryTick] = useState(0);\n const retryTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n useEffect(\n () => () => {\n if (retryTimerRef.current !== null) clearTimeout(retryTimerRef.current);\n },\n [],\n );\n const landed = lane.landed;\n\n useEffect(() => {\n const pending = pendingRef.current;\n const attempts = attemptsRef.current;\n for (const key of PROVIDER_THREAD_CONFIG_KEYS) {\n if (sameThreadConfigValue(config[key], seenRef.current[key])) continue;\n pending.add(key);\n attempts.set(key, 0);\n }\n seenRef.current = config;\n if (pending.size === 0 || closedRef.current || !channelLive) return;\n const decision = decideThreadConfigLanePatch({\n desired: config,\n keys: pending,\n landed,\n configVersion,\n custom,\n });\n if (decision.kind === 'wait') return;\n pending.clear();\n if (decision.kind === 'done') return;\n\n const { patch } = decision;\n const patchKeys = patchedThreadConfigKeys(patch);\n for (const key of patchKeys) attempts.set(key, (attempts.get(key) ?? 0) + 1);\n const modelOnly = patchKeys.length === 1 && patchKeys[0] === 'model';\n patchConfigRef.current(patch).catch((error: unknown) => {\n const data = configWriteData({ threadId, patch });\n if (isConfigWriteForbiddenRejection(error) || isConfigSyncUnavailableRejection(error)) {\n closedRef.current = true;\n athenaDiagnostics.emit('statewire.config', {\n level: 'warn',\n data: {\n ...data,\n reason: isConfigWriteForbiddenRejection(error)\n ? 'config_write_forbidden'\n : 'config_sync_unavailable',\n },\n });\n return;\n }\n const outcome = statewireTransportOutcome(error);\n if (outcome !== null) {\n // Channel weather (a dropped stream, the host's expired verdict): keep\n // each change pending and write it again after a backoff, once the\n // channel is live, unless its prop has moved on or the attach is gone.\n athenaDiagnostics.emit('statewire.config', {\n level: 'debug',\n data: { ...data, outcome },\n });\n if (outcome === 'unmount') return;\n const retryKeys = patchKeys.filter(\n (key) =>\n sameThreadConfigValue(seenRef.current[key], patch[key] ?? null) &&\n (attempts.get(key) ?? 0) < MAX_PATCH_ATTEMPTS_PER_CHANGE,\n );\n if (retryKeys.length === 0) return;\n for (const key of retryKeys) pendingRef.current.add(key);\n const written = Math.max(...retryKeys.map((key) => attempts.get(key) ?? 1));\n const delay = RETRY_BACKOFF_MS[Math.min(written - 1, RETRY_BACKOFF_MS.length - 1)];\n retryTimerRef.current = setTimeout(() => {\n retryTimerRef.current = null;\n setRetryTick((tick) => tick + 1);\n }, delay);\n return;\n }\n athenaDiagnostics.error(\n 'statewire.config',\n error,\n modelOnly\n ? {\n code: 'statewire_rejected',\n message: 'The statewire host refused the model change',\n hint: 'Inspect error.detail: agora rejections carry a structured {code, message}. The thread keeps running with the model its server config holds.',\n }\n : {\n code: 'statewire_rejected',\n message: 'The statewire host refused the thread config change',\n hint: 'Inspect error.detail: agora rejections carry a structured {code, message}. The thread keeps running with the config its server config holds.',\n },\n data,\n );\n });\n }, [config, landed, configVersion, custom, channelLive, retryTick, threadId]);\n\n return null;\n}\n"],"names":["patchedThreadConfigKeys","useStatewireSendCommand","useDeepAgentConfigController","useRef","useState","useEffect","PROVIDER_THREAD_CONFIG_KEYS","sameThreadConfigValue","decideThreadConfigLanePatch","isConfigWriteForbiddenRejection","isConfigSyncUnavailableRejection","athenaDiagnostics","statewireTransportOutcome"],"mappings":"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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
3
|
+
const require$$0 = require("react");
|
|
4
4
|
const AthenaCredentialSourceContext = require("../auth/AthenaCredentialSourceContext.cjs");
|
|
5
5
|
function authRefusalVerdict(connection) {
|
|
6
6
|
if (!connection) return "unchanged";
|
|
@@ -18,14 +18,14 @@ function useRestartAfterAuthRefusal({
|
|
|
18
18
|
reconnect
|
|
19
19
|
}) {
|
|
20
20
|
const credentials = AthenaCredentialSourceContext.useAthenaCredentialSource();
|
|
21
|
-
const refusedRef =
|
|
22
|
-
const restartingRef =
|
|
23
|
-
const statusRef =
|
|
21
|
+
const refusedRef = require$$0.useRef(false);
|
|
22
|
+
const restartingRef = require$$0.useRef(false);
|
|
23
|
+
const statusRef = require$$0.useRef(connection == null ? void 0 : connection.status);
|
|
24
24
|
statusRef.current = connection == null ? void 0 : connection.status;
|
|
25
|
-
const reconnectRef =
|
|
25
|
+
const reconnectRef = require$$0.useRef(reconnect);
|
|
26
26
|
reconnectRef.current = reconnect;
|
|
27
27
|
const verdict = authRefusalVerdict(connection);
|
|
28
|
-
|
|
28
|
+
require$$0.useEffect(() => {
|
|
29
29
|
if (verdict === "refused") {
|
|
30
30
|
refusedRef.current = true;
|
|
31
31
|
restartingRef.current = false;
|
|
@@ -34,7 +34,7 @@ function useRestartAfterAuthRefusal({
|
|
|
34
34
|
restartingRef.current = false;
|
|
35
35
|
}
|
|
36
36
|
}, [verdict, connection]);
|
|
37
|
-
|
|
37
|
+
require$$0.useEffect(() => {
|
|
38
38
|
if (!credentials) return;
|
|
39
39
|
const restart = () => {
|
|
40
40
|
if (!refusedRef.current || restartingRef.current) return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-refusal-restart.cjs","sources":["../../src/runtime/auth-refusal-restart.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport { useAthenaCredentialSource } from '../auth/AthenaCredentialSourceContext';\n\n/** The slice of a statewire connection state this module reads. */\nexport type AuthRefusalConnection =\n | { status: 'stopped'; reason?: string }\n | { status: 'retrying'; cause?: string }\n | { status: string };\n\n/**\n * What a connection state says about credential refusal: `refused` when the\n * host refused the credential (a terminal `unauthorized` stop, or a retry\n * whose cause is `unauthorized`), `recovered` once it connects, `unchanged`\n * otherwise — including the parked `standby`, which follows a refusal and must\n * keep it on record.\n */\nexport function authRefusalVerdict(\n connection: AuthRefusalConnection | null | undefined,\n): 'refused' | 'recovered' | 'unchanged' {\n if (!connection) return 'unchanged';\n if (connection.status === 'connected') return 'recovered';\n if (connection.status === 'stopped') {\n return 'reason' in connection && connection.reason === 'unauthorized' ? 'refused' : 'unchanged';\n }\n if (connection.status === 'retrying') {\n return 'cause' in connection && connection.cause === 'unauthorized' ? 'refused' : 'unchanged';\n }\n return 'unchanged';\n}\n\n/**\n * Restart a connection the host stopped (or the runtime parked) for refusing\n * its credential, as soon as a new credential exists — instead of leaving the\n * \"Unauthorized\" state up until someone clicks retry or reloads.\n *\n * Two triggers, both only while a refusal is on record, the connection has\n * given up (stopped, or parked in standby) rather than still retrying on its\n * own — its own retry already renews the token — and no restart is under way:\n * the credential source reports a different token (a renewal, a sign-in\n * provider refresh), or the tab becomes visible / comes back online, which\n * forces a renewal first. Each refusal allows one restart per trigger, so a\n * credential the host keeps refusing never loops.\n */\nexport function useRestartAfterAuthRefusal({\n connection,\n reconnect,\n}: {\n connection: AuthRefusalConnection | null | undefined;\n reconnect: (() => void) | null | undefined;\n}): void {\n const credentials = useAthenaCredentialSource();\n const refusedRef = useRef(false);\n const restartingRef = useRef(false);\n const statusRef = useRef(connection?.status);\n statusRef.current = connection?.status;\n const reconnectRef = useRef(reconnect);\n reconnectRef.current = reconnect;\n\n const verdict = authRefusalVerdict(connection);\n useEffect(() => {\n if (verdict === 'refused') {\n refusedRef.current = true;\n restartingRef.current = false;\n } else if (verdict === 'recovered') {\n refusedRef.current = false;\n restartingRef.current = false;\n }\n }, [verdict, connection]);\n\n useEffect(() => {\n if (!credentials) return;\n const restart = () => {\n if (!refusedRef.current || restartingRef.current) return;\n if (statusRef.current === 'retrying' || statusRef.current === 'connecting') return;\n const reconnectNow = reconnectRef.current;\n if (!reconnectNow) return;\n restartingRef.current = true;\n reconnectNow();\n };\n const unsubscribe = credentials.subscribe(restart);\n if (typeof window === 'undefined' || typeof document === 'undefined') return unsubscribe;\n const renewThenRestart = () => {\n if (!refusedRef.current || restartingRef.current) return;\n if (statusRef.current === 'retrying' || statusRef.current === 'connecting') return;\n if (document.visibilityState === 'hidden') return;\n void credentials.getToken({ force: true }).then(restart, restart);\n };\n document.addEventListener('visibilitychange', renewThenRestart);\n window.addEventListener('online', renewThenRestart);\n return () => {\n unsubscribe();\n document.removeEventListener('visibilitychange', renewThenRestart);\n window.removeEventListener('online', renewThenRestart);\n };\n }, [credentials]);\n}\n"],"names":["useAthenaCredentialSource","useRef","useEffect"],"mappings":";;;;AAgBO,SAAS,mBACd,YACuC;AACvC,MAAI,CAAC,WAAY,QAAO;AACxB,MAAI,WAAW,WAAW,YAAa,QAAO;AAC9C,MAAI,WAAW,WAAW,WAAW;AACnC,WAAO,YAAY,cAAc,WAAW,WAAW,iBAAiB,YAAY;AAAA,EACtF;AACA,MAAI,WAAW,WAAW,YAAY;AACpC,WAAO,WAAW,cAAc,WAAW,UAAU,iBAAiB,YAAY;AAAA,EACpF;AACA,SAAO;AACT;AAeO,SAAS,2BAA2B;AAAA,EACzC;AAAA,EACA;AACF,GAGS;AACP,QAAM,cAAcA,8BAAAA,0BAAA;AACpB,QAAM,aAAaC,
|
|
1
|
+
{"version":3,"file":"auth-refusal-restart.cjs","sources":["../../src/runtime/auth-refusal-restart.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport { useAthenaCredentialSource } from '../auth/AthenaCredentialSourceContext';\n\n/** The slice of a statewire connection state this module reads. */\nexport type AuthRefusalConnection =\n | { status: 'stopped'; reason?: string }\n | { status: 'retrying'; cause?: string }\n | { status: string };\n\n/**\n * What a connection state says about credential refusal: `refused` when the\n * host refused the credential (a terminal `unauthorized` stop, or a retry\n * whose cause is `unauthorized`), `recovered` once it connects, `unchanged`\n * otherwise — including the parked `standby`, which follows a refusal and must\n * keep it on record.\n */\nexport function authRefusalVerdict(\n connection: AuthRefusalConnection | null | undefined,\n): 'refused' | 'recovered' | 'unchanged' {\n if (!connection) return 'unchanged';\n if (connection.status === 'connected') return 'recovered';\n if (connection.status === 'stopped') {\n return 'reason' in connection && connection.reason === 'unauthorized' ? 'refused' : 'unchanged';\n }\n if (connection.status === 'retrying') {\n return 'cause' in connection && connection.cause === 'unauthorized' ? 'refused' : 'unchanged';\n }\n return 'unchanged';\n}\n\n/**\n * Restart a connection the host stopped (or the runtime parked) for refusing\n * its credential, as soon as a new credential exists — instead of leaving the\n * \"Unauthorized\" state up until someone clicks retry or reloads.\n *\n * Two triggers, both only while a refusal is on record, the connection has\n * given up (stopped, or parked in standby) rather than still retrying on its\n * own — its own retry already renews the token — and no restart is under way:\n * the credential source reports a different token (a renewal, a sign-in\n * provider refresh), or the tab becomes visible / comes back online, which\n * forces a renewal first. Each refusal allows one restart per trigger, so a\n * credential the host keeps refusing never loops.\n */\nexport function useRestartAfterAuthRefusal({\n connection,\n reconnect,\n}: {\n connection: AuthRefusalConnection | null | undefined;\n reconnect: (() => void) | null | undefined;\n}): void {\n const credentials = useAthenaCredentialSource();\n const refusedRef = useRef(false);\n const restartingRef = useRef(false);\n const statusRef = useRef(connection?.status);\n statusRef.current = connection?.status;\n const reconnectRef = useRef(reconnect);\n reconnectRef.current = reconnect;\n\n const verdict = authRefusalVerdict(connection);\n useEffect(() => {\n if (verdict === 'refused') {\n refusedRef.current = true;\n restartingRef.current = false;\n } else if (verdict === 'recovered') {\n refusedRef.current = false;\n restartingRef.current = false;\n }\n }, [verdict, connection]);\n\n useEffect(() => {\n if (!credentials) return;\n const restart = () => {\n if (!refusedRef.current || restartingRef.current) return;\n if (statusRef.current === 'retrying' || statusRef.current === 'connecting') return;\n const reconnectNow = reconnectRef.current;\n if (!reconnectNow) return;\n restartingRef.current = true;\n reconnectNow();\n };\n const unsubscribe = credentials.subscribe(restart);\n if (typeof window === 'undefined' || typeof document === 'undefined') return unsubscribe;\n const renewThenRestart = () => {\n if (!refusedRef.current || restartingRef.current) return;\n if (statusRef.current === 'retrying' || statusRef.current === 'connecting') return;\n if (document.visibilityState === 'hidden') return;\n void credentials.getToken({ force: true }).then(restart, restart);\n };\n document.addEventListener('visibilitychange', renewThenRestart);\n window.addEventListener('online', renewThenRestart);\n return () => {\n unsubscribe();\n document.removeEventListener('visibilitychange', renewThenRestart);\n window.removeEventListener('online', renewThenRestart);\n };\n }, [credentials]);\n}\n"],"names":["useAthenaCredentialSource","useRef","useEffect"],"mappings":";;;;AAgBO,SAAS,mBACd,YACuC;AACvC,MAAI,CAAC,WAAY,QAAO;AACxB,MAAI,WAAW,WAAW,YAAa,QAAO;AAC9C,MAAI,WAAW,WAAW,WAAW;AACnC,WAAO,YAAY,cAAc,WAAW,WAAW,iBAAiB,YAAY;AAAA,EACtF;AACA,MAAI,WAAW,WAAW,YAAY;AACpC,WAAO,WAAW,cAAc,WAAW,UAAU,iBAAiB,YAAY;AAAA,EACpF;AACA,SAAO;AACT;AAeO,SAAS,2BAA2B;AAAA,EACzC;AAAA,EACA;AACF,GAGS;AACP,QAAM,cAAcA,8BAAAA,0BAAA;AACpB,QAAM,aAAaC,WAAAA,OAAO,KAAK;AAC/B,QAAM,gBAAgBA,WAAAA,OAAO,KAAK;AAClC,QAAM,YAAYA,WAAAA,OAAO,yCAAY,MAAM;AAC3C,YAAU,UAAU,yCAAY;AAChC,QAAM,eAAeA,WAAAA,OAAO,SAAS;AACrC,eAAa,UAAU;AAEvB,QAAM,UAAU,mBAAmB,UAAU;AAC7CC,aAAAA,UAAU,MAAM;AACd,QAAI,YAAY,WAAW;AACzB,iBAAW,UAAU;AACrB,oBAAc,UAAU;AAAA,IAC1B,WAAW,YAAY,aAAa;AAClC,iBAAW,UAAU;AACrB,oBAAc,UAAU;AAAA,IAC1B;AAAA,EACF,GAAG,CAAC,SAAS,UAAU,CAAC;AAExBA,aAAAA,UAAU,MAAM;AACd,QAAI,CAAC,YAAa;AAClB,UAAM,UAAU,MAAM;AACpB,UAAI,CAAC,WAAW,WAAW,cAAc,QAAS;AAClD,UAAI,UAAU,YAAY,cAAc,UAAU,YAAY,aAAc;AAC5E,YAAM,eAAe,aAAa;AAClC,UAAI,CAAC,aAAc;AACnB,oBAAc,UAAU;AACxB,mBAAA;AAAA,IACF;AACA,UAAM,cAAc,YAAY,UAAU,OAAO;AACjD,QAAI,OAAO,WAAW,eAAe,OAAO,aAAa,YAAa,QAAO;AAC7E,UAAM,mBAAmB,MAAM;AAC7B,UAAI,CAAC,WAAW,WAAW,cAAc,QAAS;AAClD,UAAI,UAAU,YAAY,cAAc,UAAU,YAAY,aAAc;AAC5E,UAAI,SAAS,oBAAoB,SAAU;AAC3C,WAAK,YAAY,SAAS,EAAE,OAAO,MAAM,EAAE,KAAK,SAAS,OAAO;AAAA,IAClE;AACA,aAAS,iBAAiB,oBAAoB,gBAAgB;AAC9D,WAAO,iBAAiB,UAAU,gBAAgB;AAClD,WAAO,MAAM;AACX,kBAAA;AACA,eAAS,oBAAoB,oBAAoB,gBAAgB;AACjE,aAAO,oBAAoB,UAAU,gBAAgB;AAAA,IACvD;AAAA,EACF,GAAG,CAAC,WAAW,CAAC;AAClB;;;"}
|
package/dist/runtime/auth.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
3
|
+
const require$$0 = require("react");
|
|
4
4
|
const athenaDiagnostics = require("../diagnostics/athena-diagnostics.cjs");
|
|
5
5
|
const errors = require("../diagnostics/errors.cjs");
|
|
6
6
|
const CUSTOMER_APP_HOST = /^.+\.(?:(?:[a-z0-9-]+-)?app(?:\.[a-z0-9-]+)*|computer(?:-[a-z0-9-]+)?\.stg|code-sandpack(?:\.[a-z0-9-]+)*)\.athenaintel\.com$/i;
|
|
@@ -204,7 +204,7 @@ function useParentBridge({
|
|
|
204
204
|
mintRetryPolicy = DEFAULT_MINT_RETRY_POLICY
|
|
205
205
|
} = {}) {
|
|
206
206
|
const isInIframe = typeof window !== "undefined" && window.parent !== window;
|
|
207
|
-
const runtimeTrustedOrigins =
|
|
207
|
+
const runtimeTrustedOrigins = require$$0.useMemo(() => {
|
|
208
208
|
const origins = /* @__PURE__ */ new Set();
|
|
209
209
|
if (typeof window !== "undefined") {
|
|
210
210
|
origins.add(window.location.origin);
|
|
@@ -217,22 +217,22 @@ function useParentBridge({
|
|
|
217
217
|
}
|
|
218
218
|
return [...origins];
|
|
219
219
|
}, [trustedOrigins]);
|
|
220
|
-
const [state, setState] =
|
|
220
|
+
const [state, setState] = require$$0.useState({
|
|
221
221
|
token: null,
|
|
222
222
|
...EMPTY_BRIDGE_URLS,
|
|
223
223
|
hostAnswered: false,
|
|
224
224
|
ready: false,
|
|
225
225
|
error: null
|
|
226
226
|
});
|
|
227
|
-
const mintRetryPolicyRef =
|
|
227
|
+
const mintRetryPolicyRef = require$$0.useRef(mintRetryPolicy);
|
|
228
228
|
mintRetryPolicyRef.current = mintRetryPolicy;
|
|
229
|
-
const readySignalSent =
|
|
230
|
-
const configReceived =
|
|
231
|
-
const parentUrlsRef =
|
|
232
|
-
const tokenRef =
|
|
229
|
+
const readySignalSent = require$$0.useRef(false);
|
|
230
|
+
const configReceived = require$$0.useRef(false);
|
|
231
|
+
const parentUrlsRef = require$$0.useRef(EMPTY_BRIDGE_URLS);
|
|
232
|
+
const tokenRef = require$$0.useRef(state.token);
|
|
233
233
|
tokenRef.current = state.token;
|
|
234
|
-
const renewerRef =
|
|
235
|
-
|
|
234
|
+
const renewerRef = require$$0.useRef(null);
|
|
235
|
+
require$$0.useEffect(() => {
|
|
236
236
|
if (!isInIframe) return;
|
|
237
237
|
const endBridgeSpan = athenaDiagnostics.athenaDiagnostics.span("auth.bridge", "auth.bridge.start", {
|
|
238
238
|
mode: "iframe"
|
|
@@ -324,7 +324,7 @@ function useParentBridge({
|
|
|
324
324
|
for (const resolve of [...tokenWaiters]) resolve(null);
|
|
325
325
|
};
|
|
326
326
|
}, [isInIframe, runtimeTrustedOrigins]);
|
|
327
|
-
|
|
327
|
+
require$$0.useEffect(() => {
|
|
328
328
|
if (isInIframe) return;
|
|
329
329
|
if (typeof window === "undefined") return;
|
|
330
330
|
let cancelled = false;
|
|
@@ -517,14 +517,14 @@ function useParentBridge({
|
|
|
517
517
|
renewerRef.current = null;
|
|
518
518
|
};
|
|
519
519
|
}, [isInIframe]);
|
|
520
|
-
const renewToken =
|
|
520
|
+
const renewToken = require$$0.useCallback(
|
|
521
521
|
(options) => {
|
|
522
522
|
var _a;
|
|
523
523
|
return ((_a = renewerRef.current) == null ? void 0 : _a.call(renewerRef, options)) ?? Promise.resolve(tokenRef.current);
|
|
524
524
|
},
|
|
525
525
|
[]
|
|
526
526
|
);
|
|
527
|
-
return
|
|
527
|
+
return require$$0.useMemo(() => ({ ...state, renewToken }), [state, renewToken]);
|
|
528
528
|
}
|
|
529
529
|
function useParentAuth() {
|
|
530
530
|
return useParentBridge().token;
|