@athenaintel/react 0.43.0 → 0.50.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 +258 -8
- 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/call-recap.cjs +319 -0
- package/dist/agent-runtime/src/call-recap.cjs.map +1 -0
- package/dist/agent-runtime/src/call-recap.d.ts +142 -0
- package/dist/agent-runtime/src/call-recap.js +319 -0
- package/dist/agent-runtime/src/call-recap.js.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-store.cjs +1 -0
- package/dist/agent-runtime/src/chat-outbox-store.cjs.map +1 -1
- package/dist/agent-runtime/src/chat-outbox-store.d.ts +7 -0
- package/dist/agent-runtime/src/chat-outbox-store.js +1 -0
- package/dist/agent-runtime/src/chat-outbox-store.js.map +1 -1
- package/dist/agent-runtime/src/chat-outbox.cjs +46 -5
- package/dist/agent-runtime/src/chat-outbox.cjs.map +1 -1
- package/dist/agent-runtime/src/chat-outbox.d.ts +29 -0
- package/dist/agent-runtime/src/chat-outbox.js +46 -5
- package/dist/agent-runtime/src/chat-outbox.js.map +1 -1
- 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-index.d.ts +7 -0
- package/dist/agent-runtime/src/conversation-index.js.map +1 -1
- package/dist/agent-runtime/src/conversation-list.cjs +2 -1
- package/dist/agent-runtime/src/conversation-list.cjs.map +1 -1
- package/dist/agent-runtime/src/conversation-list.d.ts +19 -3
- package/dist/agent-runtime/src/conversation-list.js +2 -1
- package/dist/agent-runtime/src/conversation-list.js.map +1 -1
- 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 +16 -9
- package/dist/agent-runtime/src/interrupts.cjs +71 -19
- package/dist/agent-runtime/src/interrupts.cjs.map +1 -1
- package/dist/agent-runtime/src/interrupts.d.ts +40 -3
- package/dist/agent-runtime/src/interrupts.js +56 -4
- 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/model-context.cjs +3 -2
- package/dist/agent-runtime/src/model-context.cjs.map +1 -1
- package/dist/agent-runtime/src/model-context.d.ts +6 -1
- package/dist/agent-runtime/src/model-context.js +3 -2
- package/dist/agent-runtime/src/model-context.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 +41 -0
- package/dist/agent-runtime/src/send-recovery.cjs +37 -3
- package/dist/agent-runtime/src/send-recovery.cjs.map +1 -1
- package/dist/agent-runtime/src/send-recovery.d.ts +19 -0
- package/dist/agent-runtime/src/send-recovery.js +37 -3
- package/dist/agent-runtime/src/send-recovery.js.map +1 -1
- 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 +868 -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 -25
- 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 -25
- 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 +14 -13
- package/dist/agent-runtime/src/use-conversation-list.cjs.map +1 -1
- package/dist/agent-runtime/src/use-conversation-list.d.ts +6 -0
- package/dist/agent-runtime/src/use-conversation-list.js +3 -2
- package/dist/agent-runtime/src/use-conversation-list.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs +45 -20
- 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 +10 -3
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js +27 -2
- 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 +40 -22
- package/dist/agent-runtime/src/use-deep-agent-runtime.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-runtime.d.ts +17 -0
- package/dist/agent-runtime/src/use-deep-agent-runtime.js +24 -6
- package/dist/agent-runtime/src/use-deep-agent-runtime.js.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 +588 -130
- package/dist/agent-runtime/src/use-deep-agent-voice.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-voice.d.ts +162 -10
- package/dist/agent-runtime/src/use-deep-agent-voice.js +529 -71
- 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 +34 -26
- package/dist/agent-runtime/src/voice-earcon.cjs +139 -0
- package/dist/agent-runtime/src/voice-earcon.cjs.map +1 -0
- package/dist/agent-runtime/src/voice-earcon.d.ts +38 -0
- package/dist/agent-runtime/src/voice-earcon.js +139 -0
- package/dist/agent-runtime/src/voice-earcon.js.map +1 -0
- 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 +63 -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-presentation.cjs +2 -0
- package/dist/agent-runtime/src/voice-presentation.cjs.map +1 -1
- package/dist/agent-runtime/src/voice-presentation.js +2 -0
- package/dist/agent-runtime/src/voice-presentation.js.map +1 -1
- 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 +18 -5
- 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 +23 -6
- 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 +166 -37
- package/dist/chat/StatewireApprovalCard.cjs.map +1 -1
- package/dist/chat/StatewireApprovalCard.d.ts +91 -2
- package/dist/chat/StatewireApprovalCard.js +156 -27
- 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 +81 -69
- package/dist/chat/StatewireQueuedMessages.cjs.map +1 -1
- package/dist/chat/StatewireQueuedMessages.d.ts +25 -13
- package/dist/chat/StatewireQueuedMessages.js +73 -61
- package/dist/chat/StatewireQueuedMessages.js.map +1 -1
- package/dist/chat/WaitingOnYouBanner.cjs +9 -5
- package/dist/chat/WaitingOnYouBanner.cjs.map +1 -1
- package/dist/chat/WaitingOnYouBanner.js +7 -3
- package/dist/chat/WaitingOnYouBanner.js.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 +96 -29
- package/dist/chat/chat-voice-controls.cjs.map +1 -1
- package/dist/chat/chat-voice-controls.d.ts +42 -3
- package/dist/chat/chat-voice-controls.js +92 -25
- 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 +52 -36
- package/dist/chat/super-grouping/SuperGroupingCard.cjs.map +1 -1
- package/dist/chat/super-grouping/SuperGroupingCard.d.ts +19 -4
- package/dist/chat/super-grouping/SuperGroupingCard.js +29 -13
- 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 +73 -40
- package/dist/chat/super-grouping/ToolTimeline.cjs.map +1 -1
- package/dist/chat/super-grouping/ToolTimeline.d.ts +10 -2
- package/dist/chat/super-grouping/ToolTimeline.js +69 -36
- 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 +5 -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/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 +21 -0
- package/dist/chat-ui/index.cjs.map +1 -1
- package/dist/chat-ui/index.d.ts +8 -1
- package/dist/chat-ui/index.js +21 -0
- package/dist/chat-ui/index.js.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.cjs +4 -4
- package/dist/chat-ui/mentions/mention-chip.cjs.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 +3 -3
- package/dist/chat-ui/mentions/use-mention-asset.cjs.map +1 -1
- 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/from-the-call-card.cjs +124 -0
- package/dist/chat-ui/messages/from-the-call-card.cjs.map +1 -0
- package/dist/chat-ui/messages/from-the-call-card.d.ts +17 -0
- package/dist/chat-ui/messages/from-the-call-card.js +124 -0
- package/dist/chat-ui/messages/from-the-call-card.js.map +1 -0
- 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 +3 -2
- package/dist/chat-ui/rich-text/chat-link.cjs.map +1 -1
- package/dist/chat-ui/rich-text/chat-link.d.ts +4 -0
- package/dist/chat-ui/rich-text/chat-link.js +4 -3
- package/dist/chat-ui/rich-text/chat-link.js.map +1 -1
- package/dist/chat-ui/rich-text/chat-message-body.cjs +9 -8
- package/dist/chat-ui/rich-text/chat-message-body.cjs.map +1 -1
- package/dist/chat-ui/rich-text/chat-message-body.d.ts +12 -0
- package/dist/chat-ui/rich-text/chat-message-body.js +2 -1
- package/dist/chat-ui/rich-text/chat-message-body.js.map +1 -1
- package/dist/chat-ui/rich-text/chat-node-views.cjs +6 -6
- package/dist/chat-ui/rich-text/chat-node-views.cjs.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 +45 -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 +37 -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 +52 -3
- package/dist/collab/client.cjs.map +1 -1
- package/dist/collab/client.d.ts +27 -0
- package/dist/collab/client.js +52 -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/index.d.ts +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 +27 -8
- package/dist/composer/useReadComposerDraft.cjs.map +1 -1
- package/dist/composer/useReadComposerDraft.d.ts +23 -1
- package/dist/composer/useReadComposerDraft.js +27 -8
- package/dist/composer/useReadComposerDraft.js.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 +29 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +18 -4
- package/dist/index.js +30 -3
- 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/unconfirmed-update-attributions.cjs +190 -0
- package/dist/keryx-http/src/unconfirmed-update-attributions.cjs.map +1 -0
- package/dist/keryx-http/src/unconfirmed-update-attributions.d.ts +132 -0
- package/dist/keryx-http/src/unconfirmed-update-attributions.js +190 -0
- package/dist/keryx-http/src/unconfirmed-update-attributions.js.map +1 -0
- package/dist/keryx-http/src/update-attributions.cjs +141 -0
- package/dist/keryx-http/src/update-attributions.cjs.map +1 -0
- package/dist/keryx-http/src/update-attributions.d.ts +107 -0
- package/dist/keryx-http/src/update-attributions.js +141 -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 +120 -79
- package/dist/provider/AthenaProvider.cjs.map +1 -1
- package/dist/provider/AthenaProvider.d.ts +11 -1
- package/dist/provider/AthenaProvider.js +44 -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/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/api.cjs.map +1 -1
- package/dist/threads/api.d.ts +15 -0
- package/dist/threads/api.js.map +1 -1
- package/dist/threads/conversation-list-fetcher.cjs +13 -5
- package/dist/threads/conversation-list-fetcher.cjs.map +1 -1
- package/dist/threads/conversation-list-fetcher.d.ts +4 -1
- package/dist/threads/conversation-list-fetcher.js +13 -5
- package/dist/threads/conversation-list-fetcher.js.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 +79 -57
- package/dist/threads/statewire-thread-list.cjs.map +1 -1
- package/dist/threads/statewire-thread-list.d.ts +20 -8
- package/dist/threads/statewire-thread-list.js +28 -6
- 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 +37 -15
- package/dist/threads/use-athena-sessions.cjs.map +1 -1
- package/dist/threads/use-athena-sessions.d.ts +10 -5
- package/dist/threads/use-athena-sessions.js +28 -6
- package/dist/threads/use-athena-sessions.js.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-rest-conversation-history.d.ts +1 -0
- 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-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
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const require$$0 = require("react");
|
|
5
|
+
const ToolPartPlacementContext = require$$0.createContext(null);
|
|
6
|
+
function ToolPartPlacementProvider({
|
|
7
|
+
value,
|
|
8
|
+
children
|
|
9
|
+
}) {
|
|
10
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ToolPartPlacementContext.Provider, { value, children });
|
|
11
|
+
}
|
|
12
|
+
function useToolPartPlacement() {
|
|
13
|
+
return require$$0.useContext(ToolPartPlacementContext);
|
|
14
|
+
}
|
|
15
|
+
exports.ToolPartPlacementProvider = ToolPartPlacementProvider;
|
|
16
|
+
exports.useToolPartPlacement = useToolPartPlacement;
|
|
17
|
+
//# sourceMappingURL=tool-part-placement.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-part-placement.cjs","sources":["../../../src/chat/super-grouping/tool-part-placement.tsx"],"sourcesContent":["'use client';\n\nimport { createContext, type ReactNode, useContext } from 'react';\n\n/**\n * Where `SuperGroupingCard` renders a tool call's UI outside its details\n * panel: as the call's own row in the step list the card opens to (`'step'`,\n * the host's `isStepRowTool`), or in the slot below the header that stays on\n * screen with the card closed (`'inline'`, the host's `isInlineTool`). One\n * call can render in both, so its tool UI reads the placement to draw the part\n * that belongs there (Olympus: a code run's row in the steps, the subagents it\n * dispatched below the header).\n */\nexport type ToolPartPlacement = 'step' | 'inline';\n\nconst ToolPartPlacementContext = createContext<ToolPartPlacement | null>(null);\n\n/**\n * The placement of the tool UIs below it. `null` ends one: the card's details\n * panel, and content a tool UI opens that lays its own tool calls out (a\n * transcript drawer opened from a subagent card in the inline slot).\n */\nexport function ToolPartPlacementProvider({\n value,\n children,\n}: {\n value: ToolPartPlacement | null;\n children: ReactNode;\n}) {\n return <ToolPartPlacementContext.Provider value={value}>{children}</ToolPartPlacementContext.Provider>;\n}\n\n/** Where the card renders the calling tool UI; `null` anywhere else (its details panel, an ungrouped thread). */\nexport function useToolPartPlacement(): ToolPartPlacement | null {\n return useContext(ToolPartPlacementContext);\n}\n"],"names":["createContext","jsx","useContext"],"mappings":";;;;AAeA,MAAM,2BAA2BA,WAAAA,cAAwC,IAAI;AAOtE,SAAS,0BAA0B;AAAA,EACxC;AAAA,EACA;AACF,GAGG;AACD,SAAOC,2BAAAA,IAAC,yBAAyB,UAAzB,EAAkC,OAAe,SAAA,CAAS;AACpE;AAGO,SAAS,uBAAiD;AAC/D,SAAOC,WAAAA,WAAW,wBAAwB;AAC5C;;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Where `SuperGroupingCard` renders a tool call's UI outside its details
|
|
4
|
+
* panel: as the call's own row in the step list the card opens to (`'step'`,
|
|
5
|
+
* the host's `isStepRowTool`), or in the slot below the header that stays on
|
|
6
|
+
* screen with the card closed (`'inline'`, the host's `isInlineTool`). One
|
|
7
|
+
* call can render in both, so its tool UI reads the placement to draw the part
|
|
8
|
+
* that belongs there (Olympus: a code run's row in the steps, the subagents it
|
|
9
|
+
* dispatched below the header).
|
|
10
|
+
*/
|
|
11
|
+
export type ToolPartPlacement = 'step' | 'inline';
|
|
12
|
+
/**
|
|
13
|
+
* The placement of the tool UIs below it. `null` ends one: the card's details
|
|
14
|
+
* panel, and content a tool UI opens that lays its own tool calls out (a
|
|
15
|
+
* transcript drawer opened from a subagent card in the inline slot).
|
|
16
|
+
*/
|
|
17
|
+
export declare function ToolPartPlacementProvider({ value, children, }: {
|
|
18
|
+
value: ToolPartPlacement | null;
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
}): import("react").JSX.Element;
|
|
21
|
+
/** Where the card renders the calling tool UI; `null` anywhere else (its details panel, an ungrouped thread). */
|
|
22
|
+
export declare function useToolPartPlacement(): ToolPartPlacement | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useContext, createContext } from "react";
|
|
3
|
+
const ToolPartPlacementContext = createContext(null);
|
|
4
|
+
function ToolPartPlacementProvider({
|
|
5
|
+
value,
|
|
6
|
+
children
|
|
7
|
+
}) {
|
|
8
|
+
return /* @__PURE__ */ jsx(ToolPartPlacementContext.Provider, { value, children });
|
|
9
|
+
}
|
|
10
|
+
function useToolPartPlacement() {
|
|
11
|
+
return useContext(ToolPartPlacementContext);
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
ToolPartPlacementProvider,
|
|
15
|
+
useToolPartPlacement
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=tool-part-placement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-part-placement.js","sources":["../../../src/chat/super-grouping/tool-part-placement.tsx"],"sourcesContent":["'use client';\n\nimport { createContext, type ReactNode, useContext } from 'react';\n\n/**\n * Where `SuperGroupingCard` renders a tool call's UI outside its details\n * panel: as the call's own row in the step list the card opens to (`'step'`,\n * the host's `isStepRowTool`), or in the slot below the header that stays on\n * screen with the card closed (`'inline'`, the host's `isInlineTool`). One\n * call can render in both, so its tool UI reads the placement to draw the part\n * that belongs there (Olympus: a code run's row in the steps, the subagents it\n * dispatched below the header).\n */\nexport type ToolPartPlacement = 'step' | 'inline';\n\nconst ToolPartPlacementContext = createContext<ToolPartPlacement | null>(null);\n\n/**\n * The placement of the tool UIs below it. `null` ends one: the card's details\n * panel, and content a tool UI opens that lays its own tool calls out (a\n * transcript drawer opened from a subagent card in the inline slot).\n */\nexport function ToolPartPlacementProvider({\n value,\n children,\n}: {\n value: ToolPartPlacement | null;\n children: ReactNode;\n}) {\n return <ToolPartPlacementContext.Provider value={value}>{children}</ToolPartPlacementContext.Provider>;\n}\n\n/** Where the card renders the calling tool UI; `null` anywhere else (its details panel, an ungrouped thread). */\nexport function useToolPartPlacement(): ToolPartPlacement | null {\n return useContext(ToolPartPlacementContext);\n}\n"],"names":[],"mappings":";;AAeA,MAAM,2BAA2B,cAAwC,IAAI;AAOtE,SAAS,0BAA0B;AAAA,EACxC;AAAA,EACA;AACF,GAGG;AACD,SAAO,oBAAC,yBAAyB,UAAzB,EAAkC,OAAe,SAAA,CAAS;AACpE;AAGO,SAAS,uBAAiD;AAC/D,SAAO,WAAW,wBAAwB;AAC5C;"}
|
|
@@ -8,13 +8,13 @@ const ThreadScrollToBottom = () => /* @__PURE__ */ jsxRuntime.jsx(
|
|
|
8
8
|
"div",
|
|
9
9
|
{
|
|
10
10
|
"data-slot": "thread-scroll-to-bottom-anchor",
|
|
11
|
-
className: "aui-thread-scroll-to-bottom-anchor pointer-events-none
|
|
11
|
+
className: "aui-thread-scroll-to-bottom-anchor pointer-events-none absolute inset-x-0 top-0 h-0",
|
|
12
12
|
children: /* @__PURE__ */ jsxRuntime.jsx(react.ThreadPrimitive.ScrollToBottom, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
13
13
|
tooltipIconButton.TooltipIconButton,
|
|
14
14
|
{
|
|
15
15
|
tooltip: "Scroll to bottom",
|
|
16
16
|
variant: "outline",
|
|
17
|
-
className: "aui-thread-scroll-to-bottom pointer-events-auto absolute -top-
|
|
17
|
+
className: "aui-thread-scroll-to-bottom pointer-events-auto absolute -top-10 left-1/2 z-10 size-8 -translate-x-1/2 rounded-full bg-background shadow-sm disabled:invisible dark:bg-background dark:hover:bg-accent",
|
|
18
18
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowDownIcon, { className: "size-4" })
|
|
19
19
|
}
|
|
20
20
|
) })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thread-scroll-to-bottom.cjs","sources":["../../src/chat/thread-scroll-to-bottom.tsx"],"sourcesContent":["import { ThreadPrimitive } from \"@assistant-ui/react\";\nimport { ArrowDownIcon } from \"lucide-react\";\nimport type { FC } from \"react\";\nimport { TooltipIconButton } from \"./tooltip-icon-button\";\n\n/**\n * The scroll-to-bottom pill,
|
|
1
|
+
{"version":3,"file":"thread-scroll-to-bottom.cjs","sources":["../../src/chat/thread-scroll-to-bottom.tsx"],"sourcesContent":["import { ThreadPrimitive } from \"@assistant-ui/react\";\nimport { ArrowDownIcon } from \"lucide-react\";\nimport type { FC } from \"react\";\nimport { TooltipIconButton } from \"./tooltip-icon-button\";\n\n/**\n * The scroll-to-bottom pill, where Athena on the web's Spaces places it\n * (`olympus/src/components/assistant-ui/thread.tsx`): centred on the column,\n * just above the thread viewport's footer. So it covers nothing the footer\n * holds (queued messages, banners, the composer), and stays out of the\n * trailing corner where the reader's own (right-aligned) messages end, whose\n * bubble it drew over there. `ThreadPrimitive.ScrollToBottom` disables it\n * while the viewport is at the bottom, and `disabled:invisible` hides it then,\n * so it appears only once the reader has scrolled up. Mount it in the footer\n * (the thread shell's `scrollToBottom`): its anchor is laid out against the\n * footer's top edge and takes no room among the footer's rows.\n */\nexport const ThreadScrollToBottom: FC = () => (\n <div\n data-slot=\"thread-scroll-to-bottom-anchor\"\n className=\"aui-thread-scroll-to-bottom-anchor pointer-events-none absolute inset-x-0 top-0 h-0\"\n >\n <ThreadPrimitive.ScrollToBottom asChild>\n <TooltipIconButton\n tooltip=\"Scroll to bottom\"\n variant=\"outline\"\n className=\"aui-thread-scroll-to-bottom pointer-events-auto absolute -top-10 left-1/2 z-10 size-8 -translate-x-1/2 rounded-full bg-background shadow-sm disabled:invisible dark:bg-background dark:hover:bg-accent\"\n >\n <ArrowDownIcon className=\"size-4\" />\n </TooltipIconButton>\n </ThreadPrimitive.ScrollToBottom>\n </div>\n);\n"],"names":["jsx","ThreadPrimitive","TooltipIconButton","ArrowDownIcon"],"mappings":";;;;;;AAiBO,MAAM,uBAA2B,MACtCA,2BAAAA;AAAAA,EAAC;AAAA,EAAA;AAAA,IACC,aAAU;AAAA,IACV,WAAU;AAAA,IAEV,UAAAA,2BAAAA,IAACC,sBAAgB,gBAAhB,EAA+B,SAAO,MACrC,UAAAD,2BAAAA;AAAAA,MAACE,kBAAAA;AAAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,SAAQ;AAAA,QACR,WAAU;AAAA,QAEV,UAAAF,2BAAAA,IAACG,YAAAA,eAAA,EAAc,WAAU,SAAA,CAAS;AAAA,MAAA;AAAA,IAAA,EACpC,CACF;AAAA,EAAA;AACF;;"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import type { FC } from "react";
|
|
2
2
|
/**
|
|
3
|
-
* The scroll-to-bottom pill,
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
3
|
+
* The scroll-to-bottom pill, where Athena on the web's Spaces places it
|
|
4
|
+
* (`olympus/src/components/assistant-ui/thread.tsx`): centred on the column,
|
|
5
|
+
* just above the thread viewport's footer. So it covers nothing the footer
|
|
6
|
+
* holds (queued messages, banners, the composer), and stays out of the
|
|
7
|
+
* trailing corner where the reader's own (right-aligned) messages end, whose
|
|
8
|
+
* bubble it drew over there. `ThreadPrimitive.ScrollToBottom` disables it
|
|
9
|
+
* while the viewport is at the bottom, and `disabled:invisible` hides it then,
|
|
10
|
+
* so it appears only once the reader has scrolled up. Mount it in the footer
|
|
11
|
+
* (the thread shell's `scrollToBottom`): its anchor is laid out against the
|
|
12
|
+
* footer's top edge and takes no room among the footer's rows.
|
|
10
13
|
*/
|
|
11
14
|
export declare const ThreadScrollToBottom: FC;
|
|
@@ -6,13 +6,13 @@ const ThreadScrollToBottom = () => /* @__PURE__ */ jsx(
|
|
|
6
6
|
"div",
|
|
7
7
|
{
|
|
8
8
|
"data-slot": "thread-scroll-to-bottom-anchor",
|
|
9
|
-
className: "aui-thread-scroll-to-bottom-anchor pointer-events-none
|
|
9
|
+
className: "aui-thread-scroll-to-bottom-anchor pointer-events-none absolute inset-x-0 top-0 h-0",
|
|
10
10
|
children: /* @__PURE__ */ jsx(ThreadPrimitive.ScrollToBottom, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
11
11
|
TooltipIconButton,
|
|
12
12
|
{
|
|
13
13
|
tooltip: "Scroll to bottom",
|
|
14
14
|
variant: "outline",
|
|
15
|
-
className: "aui-thread-scroll-to-bottom pointer-events-auto absolute -top-
|
|
15
|
+
className: "aui-thread-scroll-to-bottom pointer-events-auto absolute -top-10 left-1/2 z-10 size-8 -translate-x-1/2 rounded-full bg-background shadow-sm disabled:invisible dark:bg-background dark:hover:bg-accent",
|
|
16
16
|
children: /* @__PURE__ */ jsx(ArrowDownIcon, { className: "size-4" })
|
|
17
17
|
}
|
|
18
18
|
) })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thread-scroll-to-bottom.js","sources":["../../src/chat/thread-scroll-to-bottom.tsx"],"sourcesContent":["import { ThreadPrimitive } from \"@assistant-ui/react\";\nimport { ArrowDownIcon } from \"lucide-react\";\nimport type { FC } from \"react\";\nimport { TooltipIconButton } from \"./tooltip-icon-button\";\n\n/**\n * The scroll-to-bottom pill,
|
|
1
|
+
{"version":3,"file":"thread-scroll-to-bottom.js","sources":["../../src/chat/thread-scroll-to-bottom.tsx"],"sourcesContent":["import { ThreadPrimitive } from \"@assistant-ui/react\";\nimport { ArrowDownIcon } from \"lucide-react\";\nimport type { FC } from \"react\";\nimport { TooltipIconButton } from \"./tooltip-icon-button\";\n\n/**\n * The scroll-to-bottom pill, where Athena on the web's Spaces places it\n * (`olympus/src/components/assistant-ui/thread.tsx`): centred on the column,\n * just above the thread viewport's footer. So it covers nothing the footer\n * holds (queued messages, banners, the composer), and stays out of the\n * trailing corner where the reader's own (right-aligned) messages end, whose\n * bubble it drew over there. `ThreadPrimitive.ScrollToBottom` disables it\n * while the viewport is at the bottom, and `disabled:invisible` hides it then,\n * so it appears only once the reader has scrolled up. Mount it in the footer\n * (the thread shell's `scrollToBottom`): its anchor is laid out against the\n * footer's top edge and takes no room among the footer's rows.\n */\nexport const ThreadScrollToBottom: FC = () => (\n <div\n data-slot=\"thread-scroll-to-bottom-anchor\"\n className=\"aui-thread-scroll-to-bottom-anchor pointer-events-none absolute inset-x-0 top-0 h-0\"\n >\n <ThreadPrimitive.ScrollToBottom asChild>\n <TooltipIconButton\n tooltip=\"Scroll to bottom\"\n variant=\"outline\"\n className=\"aui-thread-scroll-to-bottom pointer-events-auto absolute -top-10 left-1/2 z-10 size-8 -translate-x-1/2 rounded-full bg-background shadow-sm disabled:invisible dark:bg-background dark:hover:bg-accent\"\n >\n <ArrowDownIcon className=\"size-4\" />\n </TooltipIconButton>\n </ThreadPrimitive.ScrollToBottom>\n </div>\n);\n"],"names":[],"mappings":";;;;AAiBO,MAAM,uBAA2B,MACtC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,aAAU;AAAA,IACV,WAAU;AAAA,IAEV,UAAA,oBAAC,gBAAgB,gBAAhB,EAA+B,SAAO,MACrC,UAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,SAAQ;AAAA,QACR,WAAU;AAAA,QAEV,UAAA,oBAAC,eAAA,EAAc,WAAU,SAAA,CAAS;AAAA,MAAA;AAAA,IAAA,EACpC,CACF;AAAA,EAAA;AACF;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const
|
|
4
|
+
const require$$0 = require("react");
|
|
5
5
|
const radixUi = require("radix-ui");
|
|
6
6
|
const tooltip = require("../ui/tooltip.cjs");
|
|
7
7
|
const button = require("../ui/button.cjs");
|
|
8
8
|
const cnfast = require("cnfast");
|
|
9
|
-
const TooltipIconButton =
|
|
9
|
+
const TooltipIconButton = require$$0.forwardRef(
|
|
10
10
|
({ children, tooltip: tooltip$1, side = "bottom", className, ...rest }, ref) => {
|
|
11
11
|
return /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Tooltip, { children: [
|
|
12
12
|
/* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip-icon-button.cjs","sources":["../../src/chat/tooltip-icon-button.tsx"],"sourcesContent":["\"use client\";\n\nimport { ComponentPropsWithRef, forwardRef } from \"react\";\nimport { Slot } from \"radix-ui\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"../ui/tooltip\";\nimport { Button } from \"../ui/button\";\nimport { cn } from \"../lib/utils\";\n\nexport type TooltipIconButtonProps = ComponentPropsWithRef<typeof Button> & {\n tooltip: string;\n side?: \"top\" | \"bottom\" | \"left\" | \"right\";\n};\n\nexport const TooltipIconButton = forwardRef<HTMLButtonElement, TooltipIconButtonProps>(\n ({ children, tooltip, side = \"bottom\", className, ...rest }, ref) => {\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n {...rest}\n className={cn(\"aui-button-icon size-6 p-1\", className)}\n ref={ref}\n >\n <Slot.Slottable>{children}</Slot.Slottable>\n <span className=\"aui-sr-only sr-only\">{tooltip}</span>\n </Button>\n </TooltipTrigger>\n <TooltipContent side={side}>{tooltip}</TooltipContent>\n </Tooltip>\n );\n }\n);\n\nTooltipIconButton.displayName = \"TooltipIconButton\";\n"],"names":["forwardRef","tooltip","Tooltip","jsx","TooltipTrigger","jsxs","Button","cn","Slot","TooltipContent"],"mappings":";;;;;;;;AAaO,MAAM,oBAAoBA,
|
|
1
|
+
{"version":3,"file":"tooltip-icon-button.cjs","sources":["../../src/chat/tooltip-icon-button.tsx"],"sourcesContent":["\"use client\";\n\nimport { ComponentPropsWithRef, forwardRef } from \"react\";\nimport { Slot } from \"radix-ui\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"../ui/tooltip\";\nimport { Button } from \"../ui/button\";\nimport { cn } from \"../lib/utils\";\n\nexport type TooltipIconButtonProps = ComponentPropsWithRef<typeof Button> & {\n tooltip: string;\n side?: \"top\" | \"bottom\" | \"left\" | \"right\";\n};\n\nexport const TooltipIconButton = forwardRef<HTMLButtonElement, TooltipIconButtonProps>(\n ({ children, tooltip, side = \"bottom\", className, ...rest }, ref) => {\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n {...rest}\n className={cn(\"aui-button-icon size-6 p-1\", className)}\n ref={ref}\n >\n <Slot.Slottable>{children}</Slot.Slottable>\n <span className=\"aui-sr-only sr-only\">{tooltip}</span>\n </Button>\n </TooltipTrigger>\n <TooltipContent side={side}>{tooltip}</TooltipContent>\n </Tooltip>\n );\n }\n);\n\nTooltipIconButton.displayName = \"TooltipIconButton\";\n"],"names":["forwardRef","tooltip","Tooltip","jsx","TooltipTrigger","jsxs","Button","cn","Slot","TooltipContent"],"mappings":";;;;;;;;AAaO,MAAM,oBAAoBA,WAAAA;AAAAA,EAC/B,CAAC,EAAE,UAAA,SAAUC,WAAS,OAAO,UAAU,WAAW,GAAG,KAAA,GAAQ,QAAQ;AACnE,2CACGC,iBAAA,EACC,UAAA;AAAA,MAAAC,2BAAAA,IAACC,QAAAA,gBAAA,EAAe,SAAO,MACrB,UAAAC,2BAAAA;AAAAA,QAACC,OAAAA;AAAAA,QAAA;AAAA,UACC,SAAQ;AAAA,UACR,MAAK;AAAA,UACJ,GAAG;AAAA,UACJ,WAAWC,OAAAA,GAAG,8BAA8B,SAAS;AAAA,UACrD;AAAA,UAEA,UAAA;AAAA,YAAAJ,2BAAAA,IAACK,QAAAA,KAAK,WAAL,EAAgB,SAAA,CAAS;AAAA,YAC1BL,2BAAAA,IAAC,QAAA,EAAK,WAAU,uBAAuB,UAAAF,UAAA,CAAQ;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA,GAEnD;AAAA,MACAE,2BAAAA,IAACM,QAAAA,gBAAA,EAAe,MAAa,UAAAR,UAAA,CAAQ;AAAA,IAAA,GACvC;AAAA,EAEJ;AACF;AAEA,kBAAkB,cAAc;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const reactStatewire = require("@assistant-ui/react-statewire");
|
|
4
|
+
const statewireState = require("../agent-runtime/src/statewire-state.cjs");
|
|
5
|
+
function useAthenaVoiceLive() {
|
|
6
|
+
return reactStatewire.useStatewireState(
|
|
7
|
+
(s) => statewireState.isDeepAgentStateHydrated(s) && (statewireState.readDeepAgentStreamValues(s).voice ?? null) !== null
|
|
8
|
+
);
|
|
9
|
+
}
|
|
10
|
+
exports.useAthenaVoiceLive = useAthenaVoiceLive;
|
|
11
|
+
//# sourceMappingURL=use-athena-voice-live.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-athena-voice-live.cjs","sources":["../../src/chat/use-athena-voice-live.ts"],"sourcesContent":["import { useStatewireState } from '@assistant-ui/react-statewire';\nimport { isDeepAgentStateHydrated, readDeepAgentStreamValues } from '@athenaintel/agent-runtime';\n\n/**\n * Whether a voice session is live on this thread (any client's: the host\n * replicates `state.voice` while one is connected, and clears it when it\n * ends). Read from the thread's replicated state rather than from the\n * composer's voice controller, so a transcript component, a tool UI or a\n * `components` override can follow it without reaching into the composer.\n *\n * Scope: like `useAthenaRunLive`, call it from a component rendered inside\n * `AthenaChat`. Before the attach snapshot hydrates it reads `false`.\n */\nexport function useAthenaVoiceLive(): boolean {\n return useStatewireState(\n (s) => isDeepAgentStateHydrated(s) && (readDeepAgentStreamValues(s).voice ?? null) !== null,\n );\n}\n"],"names":["useStatewireState","isDeepAgentStateHydrated","readDeepAgentStreamValues"],"mappings":";;;;AAaO,SAAS,qBAA8B;AAC5C,SAAOA,eAAAA;AAAAA,IACL,CAAC,MAAMC,eAAAA,yBAAyB,CAAC,MAAMC,eAAAA,0BAA0B,CAAC,EAAE,SAAS,UAAU;AAAA,EAAA;AAE3F;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a voice session is live on this thread (any client's: the host
|
|
3
|
+
* replicates `state.voice` while one is connected, and clears it when it
|
|
4
|
+
* ends). Read from the thread's replicated state rather than from the
|
|
5
|
+
* composer's voice controller, so a transcript component, a tool UI or a
|
|
6
|
+
* `components` override can follow it without reaching into the composer.
|
|
7
|
+
*
|
|
8
|
+
* Scope: like `useAthenaRunLive`, call it from a component rendered inside
|
|
9
|
+
* `AthenaChat`. Before the attach snapshot hydrates it reads `false`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useAthenaVoiceLive(): boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useStatewireState } from "@assistant-ui/react-statewire";
|
|
2
|
+
import { isDeepAgentStateHydrated, readDeepAgentStreamValues } from "../agent-runtime/src/statewire-state.js";
|
|
3
|
+
function useAthenaVoiceLive() {
|
|
4
|
+
return useStatewireState(
|
|
5
|
+
(s) => isDeepAgentStateHydrated(s) && (readDeepAgentStreamValues(s).voice ?? null) !== null
|
|
6
|
+
);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
useAthenaVoiceLive
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=use-athena-voice-live.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-athena-voice-live.js","sources":["../../src/chat/use-athena-voice-live.ts"],"sourcesContent":["import { useStatewireState } from '@assistant-ui/react-statewire';\nimport { isDeepAgentStateHydrated, readDeepAgentStreamValues } from '@athenaintel/agent-runtime';\n\n/**\n * Whether a voice session is live on this thread (any client's: the host\n * replicates `state.voice` while one is connected, and clears it when it\n * ends). Read from the thread's replicated state rather than from the\n * composer's voice controller, so a transcript component, a tool UI or a\n * `components` override can follow it without reaching into the composer.\n *\n * Scope: like `useAthenaRunLive`, call it from a component rendered inside\n * `AthenaChat`. Before the attach snapshot hydrates it reads `false`.\n */\nexport function useAthenaVoiceLive(): boolean {\n return useStatewireState(\n (s) => isDeepAgentStateHydrated(s) && (readDeepAgentStreamValues(s).voice ?? null) !== null,\n );\n}\n"],"names":[],"mappings":";;AAaO,SAAS,qBAA8B;AAC5C,SAAO;AAAA,IACL,CAAC,MAAM,yBAAyB,CAAC,MAAM,0BAA0B,CAAC,EAAE,SAAS,UAAU;AAAA,EAAA;AAE3F;"}
|
|
@@ -1,7 +1,8 @@
|
|
|
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
|
+
const deviceOperation = require("./device-operation.cjs");
|
|
5
6
|
const useAthenaRunLive = require("./use-athena-run-live.cjs");
|
|
6
7
|
const interrupts = require("../agent-runtime/src/interrupts.cjs");
|
|
7
8
|
const NO_QUEUED_LANE_DECISIONS = Object.freeze({});
|
|
@@ -52,31 +53,32 @@ function useStatewireApprovalRequest(options = {}) {
|
|
|
52
53
|
onResumeRetry
|
|
53
54
|
} = options;
|
|
54
55
|
const sendCommand = reactStatewire.useStatewireSendCommand();
|
|
56
|
+
const readDeviceOperation = deviceOperation.useDeviceOperationReader();
|
|
55
57
|
const request = (_a = reactStatewire.useStatewireRuns().inputRequests) == null ? void 0 : _a.find(interruptPredicate);
|
|
56
58
|
const requestId = request == null ? void 0 : request.id;
|
|
57
59
|
const abandoned = reactStatewire.useStatewireState(interrupts.readAbandonedInputRequests);
|
|
58
60
|
const abandonedInterrupt = interrupts.findAbandonedInterrupt(abandoned);
|
|
59
61
|
const hitl = interrupts.asHitlApproval(request == null ? void 0 : request.payload);
|
|
60
|
-
const actionRequests =
|
|
62
|
+
const actionRequests = require$$0.useMemo(() => interrupts.pendingActionRequests(hitl), [hitl]);
|
|
61
63
|
const isRunning = useAthenaRunLive.useAthenaRunLive();
|
|
62
64
|
const mirror = reactStatewire.useStatewireState(interrupts.readInterruptMirror);
|
|
63
65
|
const mirrorHitl = request === void 0 && isRunning ? interrupts.asHitlApproval(interrupts.interruptMirrorPayload(mirror)) : null;
|
|
64
|
-
const mirrorActionRequests =
|
|
65
|
-
const lastRequestIdRef =
|
|
66
|
+
const mirrorActionRequests = require$$0.useMemo(() => interrupts.pendingActionRequests(mirrorHitl), [mirrorHitl]);
|
|
67
|
+
const lastRequestIdRef = require$$0.useRef(void 0);
|
|
66
68
|
if (requestId !== void 0) lastRequestIdRef.current = requestId;
|
|
67
|
-
|
|
69
|
+
require$$0.useSyncExternalStore(subscribeAnswered, readAnsweredVersion, readAnsweredVersion);
|
|
68
70
|
const answeredLanes = lastRequestIdRef.current === void 0 ? void 0 : answeredRequests.get(lastRequestIdRef.current);
|
|
69
71
|
const mirrorCleared = interrupts.interruptMirrorPayload(mirror) === void 0;
|
|
70
|
-
|
|
72
|
+
require$$0.useEffect(() => {
|
|
71
73
|
if (requestId === void 0) return;
|
|
72
74
|
return () => {
|
|
73
75
|
if (lastRequestIdRef.current !== requestId) forgetAnswered(requestId);
|
|
74
76
|
};
|
|
75
77
|
}, [requestId]);
|
|
76
|
-
|
|
78
|
+
require$$0.useEffect(() => {
|
|
77
79
|
if (mirrorCleared && lastRequestIdRef.current !== void 0) forgetAnswered(lastRequestIdRef.current);
|
|
78
80
|
}, [mirrorCleared]);
|
|
79
|
-
|
|
81
|
+
require$$0.useEffect(
|
|
80
82
|
() => () => {
|
|
81
83
|
if (lastRequestIdRef.current !== void 0) forgetAnswered(lastRequestIdRef.current);
|
|
82
84
|
},
|
|
@@ -93,26 +95,56 @@ function useStatewireApprovalRequest(options = {}) {
|
|
|
93
95
|
onResumeRetry,
|
|
94
96
|
// The dispatch promise is handed to the lock: a refusal releases it and
|
|
95
97
|
// reaches `onResumeRejected`.
|
|
96
|
-
sendResume: (id, value) =>
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
sendResume: (id, value, extras) => {
|
|
99
|
+
const deviceOperation$1 = deviceOperation.deviceOperationStamp(readDeviceOperation);
|
|
100
|
+
if (deviceOperation$1 !== void 0) {
|
|
101
|
+
return sendCommand({
|
|
102
|
+
type: "run/input",
|
|
103
|
+
requestId: id,
|
|
104
|
+
response: { type: "resume", value },
|
|
105
|
+
...(extras == null ? void 0 : extras.decisionCheck) ? { decisionCheck: extras.decisionCheck } : {},
|
|
106
|
+
deviceOperation: deviceOperation$1
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return sendCommand(
|
|
110
|
+
(extras == null ? void 0 : extras.decisionCheck) ? {
|
|
111
|
+
type: "run/input",
|
|
112
|
+
requestId: id,
|
|
113
|
+
response: { type: "resume", value },
|
|
114
|
+
decisionCheck: extras.decisionCheck
|
|
115
|
+
} : {
|
|
116
|
+
type: "run/input",
|
|
117
|
+
requestId: id,
|
|
118
|
+
response: { type: "resume", value }
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
}
|
|
101
122
|
});
|
|
102
|
-
const resume =
|
|
103
|
-
(value) => {
|
|
123
|
+
const resume = require$$0.useCallback(
|
|
124
|
+
(value, extras) => {
|
|
104
125
|
if (requestId !== void 0) {
|
|
105
126
|
recordAnswered(requestId, answeredLaneIds(value, actionRequests));
|
|
106
127
|
}
|
|
107
|
-
return resumeLocked(value);
|
|
128
|
+
return resumeLocked(value, extras);
|
|
108
129
|
},
|
|
109
130
|
[requestId, actionRequests, resumeLocked]
|
|
110
131
|
);
|
|
111
|
-
const sendLaneDecisions =
|
|
112
|
-
(lanes) =>
|
|
113
|
-
|
|
132
|
+
const sendLaneDecisions = require$$0.useCallback(
|
|
133
|
+
(lanes, extras) => {
|
|
134
|
+
if (requestId !== void 0) {
|
|
135
|
+
return resume({ lane_decisions: lanes }, extras);
|
|
136
|
+
}
|
|
137
|
+
const deviceOperation$1 = deviceOperation.deviceOperationStamp(readDeviceOperation);
|
|
138
|
+
return sendCommand({
|
|
139
|
+
type: "run/lane-input",
|
|
140
|
+
laneDecisions: lanes,
|
|
141
|
+
...(extras == null ? void 0 : extras.decisionCheck) ? { decisionCheck: extras.decisionCheck } : {},
|
|
142
|
+
...deviceOperation$1 !== void 0 ? { deviceOperation: deviceOperation$1 } : {}
|
|
143
|
+
});
|
|
144
|
+
},
|
|
145
|
+
[requestId, resume, sendCommand, readDeviceOperation]
|
|
114
146
|
);
|
|
115
|
-
const replayQueuedLanes =
|
|
147
|
+
const replayQueuedLanes = require$$0.useCallback(
|
|
116
148
|
(id) => sendCommand({ type: "run/lane-replay", requestId: id }),
|
|
117
149
|
[sendCommand]
|
|
118
150
|
);
|
|
@@ -148,21 +180,21 @@ function useStatewireApprovalWait() {
|
|
|
148
180
|
queuedLaneDecisions
|
|
149
181
|
});
|
|
150
182
|
const key = [...ids].sort().join(TOOL_CALL_ID_SEPARATOR);
|
|
151
|
-
return
|
|
183
|
+
return require$$0.useMemo(
|
|
152
184
|
() => key === "" && !runParked ? NOTHING_WAITS : { toolCallIds: toolCallIdSet(key), runParked },
|
|
153
185
|
[key, runParked]
|
|
154
186
|
);
|
|
155
187
|
}
|
|
156
|
-
const StatewireApprovalWaitContext =
|
|
188
|
+
const StatewireApprovalWaitContext = require$$0.createContext(NOTHING_WAITS);
|
|
157
189
|
function StatewireApprovalWaitProvider({ children }) {
|
|
158
|
-
return
|
|
190
|
+
return require$$0.createElement(
|
|
159
191
|
StatewireApprovalWaitContext.Provider,
|
|
160
192
|
{ value: useStatewireApprovalWait() },
|
|
161
193
|
children
|
|
162
194
|
);
|
|
163
195
|
}
|
|
164
196
|
function useApprovalWaitInScope() {
|
|
165
|
-
return
|
|
197
|
+
return require$$0.useContext(StatewireApprovalWaitContext);
|
|
166
198
|
}
|
|
167
199
|
exports.StatewireApprovalWaitProvider = StatewireApprovalWaitProvider;
|
|
168
200
|
exports.useApprovalWaitInScope = useApprovalWaitInScope;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-statewire-approval-request.cjs","sources":["../../src/chat/use-statewire-approval-request.ts"],"sourcesContent":["import type { StatewireThread } from '@assistant-ui/react-statewire';\nimport {\n useStatewireRuns,\n useStatewireSendCommand,\n useStatewireState,\n} from '@assistant-ui/react-statewire';\nimport {\n type AbandonedInputRequest,\n asHitlApproval,\n findAbandonedInterrupt,\n HITL_PENDING_RESUME_GRACE_MS,\n type HitlApprovalPayload,\n interruptMirrorPayload,\n isApprovalCardInterrupt,\n laneInterruptIds,\n type PendingActionRequest,\n pendingActionRequests,\n readAbandonedInputRequests,\n readInterruptMirror,\n readQueuedLaneDecisions,\n toolCallIdsAwaitingApproval,\n useApprovalResumeLock,\n} from '@athenaintel/agent-runtime';\nimport {\n createContext,\n createElement,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useSyncExternalStore,\n} from 'react';\nimport { useAthenaRunLive } from './use-athena-run-live';\n\ndeclare module '@assistant-ui/core' {\n namespace Assistant {\n interface Commands {\n /**\n * Decide per-dispatch subagent lanes while the parent run is still\n * streaming (`DeepAgentThread.run_lane_input`). Keys are the lanes'\n * langgraph interrupt ids; the host matches them against the lanes its\n * mirrored interrupt currently parks, answers at once when the run is\n * already parked, and otherwise holds them until it parks — stale or\n * unknown ids are ignored, never carried to a later interrupt.\n */\n runLaneInput: {\n readonly type: 'run/lane-input';\n readonly laneDecisions: Readonly<Record<string, StatewireThread.InputResponse>>;\n };\n /**\n * Re-send the lane decisions the host still holds queued as their\n * approver's resume of the parked request (`DeepAgentThread.run_lane_replay`).\n * The host resumes under the meta the approver's `run/lane-input`\n * recorded and refuses any other caller — every attached client reads\n * the same queue, and only the one that queued it may turn it into a\n * resume. Carries no decisions: the host replays what it recorded.\n */\n runLaneReplay: {\n readonly type: 'run/lane-replay';\n readonly requestId: string;\n };\n }\n }\n}\n\nconst NO_QUEUED_LANE_DECISIONS: Readonly<Record<string, unknown>> = Object.freeze({});\nconst NO_ACTION_REQUESTS: PendingActionRequest[] = [];\n\n/**\n * Lane ids of the parked requests this client resumed, keyed by request id\n * and shared by every hook instance on the page (approval card,\n * waiting-on-you banner, host editors) so all of them treat a lingering\n * mirror the same way. Request ids are unique per parked interrupt, so an\n * instance only ever consults the record of the request it saw parked: two\n * chats mounted side by side cannot suppress or clear each other's. A record\n * is retired once the host drops that request's mirror (the resume run\n * started), the surface sees a different request park, or it unmounts.\n */\nconst answeredRequests = new Map<string, readonly string[]>();\nconst answeredListeners = new Set<() => void>();\nlet answeredVersion = 0;\nfunction notifyAnswered(): void {\n answeredVersion += 1;\n for (const listener of answeredListeners) listener();\n}\nfunction recordAnswered(requestId: string, laneIds: readonly string[]): void {\n answeredRequests.set(requestId, laneIds);\n notifyAnswered();\n}\nfunction forgetAnswered(requestId: string): void {\n if (answeredRequests.delete(requestId)) notifyAnswered();\n}\nfunction subscribeAnswered(listener: () => void): () => void {\n answeredListeners.add(listener);\n return () => {\n answeredListeners.delete(listener);\n };\n}\nconst readAnsweredVersion = (): number => answeredVersion;\n\n/**\n * The lanes a resume of the parked request settles: every lane of the request\n * (a resume answers the whole park — lanes already queued through\n * `run/lane-input` ride along) plus any lane named in the `lane_decisions` map.\n */\nfunction answeredLaneIds(value: unknown, actionRequests: readonly PendingActionRequest[]): string[] {\n const ids = laneInterruptIds(actionRequests) ?? [];\n if (typeof value === 'object' && value !== null && 'lane_decisions' in value) {\n const lanes = (value as { lane_decisions: unknown }).lane_decisions;\n if (typeof lanes === 'object' && lanes !== null) {\n for (const id of Object.keys(lanes)) if (!ids.includes(id)) ids.push(id);\n }\n }\n return ids;\n}\n\n/**\n * Whether the host's mirror still shows an interrupt this client already\n * answered. After `run/input` the host drops the parked request at once but\n * keeps `__interrupt__` until the resume run starts and clears it (seconds on\n * a cold checkpoint); without this check the card would re-offer the SAME\n * approval from the mirror, buttons live, and then fold it away again.\n */\nfunction mirrorAlreadyAnswered(\n answeredLanes: readonly string[] | undefined,\n liveActionRequests: readonly PendingActionRequest[],\n): boolean {\n if (answeredLanes === undefined) return false;\n const ids = laneInterruptIds(liveActionRequests);\n if (ids === null) return false;\n return ids.every((id) => answeredLanes.includes(id));\n}\n\n/** Selects which pending interrupt an approval surface answers. */\nexport type StatewireInterruptPredicate = (\n request: StatewireThread.InputRequestState,\n) => request is StatewireThread.CustomInputRequest;\n\nexport interface UseStatewireApprovalRequestOptions {\n /**\n * Which pending interrupt to answer. Defaults to `isApprovalCardInterrupt`\n * (client-tool parks excluded — the client-tool bridge owns those, and a\n * generic resume would corrupt the parked tool call).\n */\n interruptPredicate?: StatewireInterruptPredicate;\n /**\n * How long a sent decision keeps the actions locked when no resume run ever\n * starts. Defaults to {@link HITL_PENDING_RESUME_GRACE_MS}.\n */\n pendingResumeGraceMs?: number;\n /**\n * The host refused the `run/input` (or the transport lost it): the\n * optimistic fold rolls back, the request is on screen again with its\n * actions re-enabled, and this is the surface's one chance to say why.\n */\n onResumeRejected?: (error: unknown, requestId: string) => void;\n /** See {@link UseApprovalResumeLockOptions.onResumeRetry}. */\n onResumeRetry?: (error: unknown, requestId: string, attempt: number) => void;\n}\n\nexport interface StatewireApprovalRequest<TValue> {\n /** The pending interrupt this surface answers, if any. */\n request: StatewireThread.CustomInputRequest | undefined;\n requestId: string | undefined;\n /** The payload narrowed to the Athena HITL approval shape, or `null`. */\n hitl: HitlApprovalPayload | null;\n /** Every gated call the approval covers, in decision order (empty for non-HITL parks). */\n actionRequests: PendingActionRequest[];\n /** An interrupt a non-resume dispatch dropped — the \"approval was cancelled\" notice. */\n abandonedInterrupt: AbandonedInputRequest | undefined;\n /**\n * The mirrored interrupt's HITL payload while the run is still live and no\n * input request is answerable: per-dispatch `task` lanes parked on their\n * gates while sibling lanes stream. `null` once the run parks (the same\n * lanes are then `hitl` / `actionRequests`) and when nothing is parked.\n */\n liveHitl: HitlApprovalPayload | null;\n /** Every gated call `liveHitl` covers (empty when it is `null`). */\n liveActionRequests: PendingActionRequest[];\n /**\n * The decisions the host already holds from a `run/lane-input`, keyed by\n * langgraph interrupt id, to be answered when the run parks — a queued lane\n * reads as decided on every attached client, not just the one that sent it.\n */\n queuedLaneDecisions: Readonly<Record<string, unknown>>;\n /** True after a resume until the request identity changes (or recovery fires). */\n pending: boolean;\n /**\n * Answer the request with `{ type: 'run/input', requestId, response: { type: 'resume', value } }`.\n * Returns the dispatch promise (settles when the host accepts, rejects when\n * it refuses), or `undefined` when the lock dropped the send.\n */\n resume: (value: TValue) => Promise<unknown> | undefined;\n /**\n * Decide per-dispatch lanes by langgraph interrupt id. With a pending\n * request this is the native `lane_decisions` resume through the lock;\n * without one (the run is still streaming siblings) it is `run/lane-input`,\n * which the host queues and answers on the park. Returns the dispatch\n * promise, or `undefined` when the lock dropped a resume.\n */\n sendLaneDecisions: (\n lanes: Readonly<Record<string, StatewireThread.InputResponse>>,\n ) => Promise<unknown> | undefined;\n /**\n * Ask the host to resume the parked `requestId` with the lane decisions it\n * still holds queued, as their approver (`run/lane-replay`). For the card\n * that queued them, after the host's own answerer has stayed silent past\n * its budget; the host refuses every other caller. Settles when the host\n * accepts, rejects when it refuses.\n */\n replayQueuedLanes: (requestId: string) => Promise<unknown>;\n}\n\n/**\n * The headless half of every statewire approval surface: selects the pending\n * interrupt from the runs projection, narrows its payload, reads the\n * host-published abandoned interrupts, and wires the shared optimistic resume\n * lock to the thread's `run/input` command. `StatewireApprovalCard` renders\n * over it; hosts with their own decision UI (per-lane subagent cards) build\n * on it directly so the selection and lock semantics cannot drift.\n *\n * Requires a statewire aui scope (throws outside one, like every\n * `useStatewire*` hook) — gate the mount with `hasStatewireThreadExtras`.\n */\nexport function useStatewireApprovalRequest<\n TValue extends StatewireThread.InputResponse = Record<string, string>,\n>(options: UseStatewireApprovalRequestOptions = {}): StatewireApprovalRequest<TValue> {\n const {\n interruptPredicate = isApprovalCardInterrupt,\n pendingResumeGraceMs = HITL_PENDING_RESUME_GRACE_MS,\n onResumeRejected,\n onResumeRetry,\n } = options;\n const sendCommand = useStatewireSendCommand();\n // The runs projection is memoized by the lib, so this derivation is\n // reference-stable between state updates.\n const request = useStatewireRuns().inputRequests?.find(interruptPredicate);\n const requestId = request?.id;\n\n // The host publishes the interrupts a non-resume dispatch dropped. Select\n // the raw array reference (pre-stream-safe) and derive inline; a `.find`\n // selector would return a fresh object every update.\n const abandoned = useStatewireState(readAbandonedInputRequests);\n const abandonedInterrupt = findAbandonedInterrupt(abandoned);\n\n const hitl = asHitlApproval(request?.payload);\n const actionRequests = useMemo(() => pendingActionRequests(hitl), [hitl]);\n\n const isRunning = useAthenaRunLive();\n // The host mirrors the interrupt into state as soon as a lane parks — while\n // the run manager still reports `running` (siblings streaming) and has no\n // request to answer. Raw reference selectors; derive inline.\n const mirror = useStatewireState(readInterruptMirror);\n const mirrorHitl =\n request === undefined && isRunning ? asHitlApproval(interruptMirrorPayload(mirror)) : null;\n const mirrorActionRequests = useMemo(() => pendingActionRequests(mirrorHitl), [mirrorHitl]);\n\n // The request this surface last saw parked: the only record it may read\n // or retire (the mirror it watches is the one that request's resume clears).\n const lastRequestIdRef = useRef<string>(undefined);\n if (requestId !== undefined) lastRequestIdRef.current = requestId;\n useSyncExternalStore(subscribeAnswered, readAnsweredVersion, readAnsweredVersion);\n const answeredLanes =\n lastRequestIdRef.current === undefined ? undefined : answeredRequests.get(lastRequestIdRef.current);\n const mirrorCleared = interruptMirrorPayload(mirror) === undefined;\n useEffect(() => {\n if (requestId === undefined) return;\n return () => {\n // A different request parks next (or this one unparks for good): the\n // record of this one is stale once it is not the one on screen.\n if (lastRequestIdRef.current !== requestId) forgetAnswered(requestId);\n };\n }, [requestId]);\n useEffect(() => {\n if (mirrorCleared && lastRequestIdRef.current !== undefined) forgetAnswered(lastRequestIdRef.current);\n }, [mirrorCleared]);\n useEffect(\n () => () => {\n if (lastRequestIdRef.current !== undefined) forgetAnswered(lastRequestIdRef.current);\n },\n [],\n );\n const liveHitl = mirrorAlreadyAnswered(answeredLanes, mirrorActionRequests) ? null : mirrorHitl;\n const liveActionRequests = liveHitl === mirrorHitl ? mirrorActionRequests : NO_ACTION_REQUESTS;\n const queuedLaneDecisions =\n useStatewireState(readQueuedLaneDecisions) ?? NO_QUEUED_LANE_DECISIONS;\n\n const { pending, resume: resumeLocked } = useApprovalResumeLock<TValue>({\n requestId,\n isRunning,\n pendingResumeGraceMs,\n onResumeRejected,\n onResumeRetry,\n // The dispatch promise is handed to the lock: a refusal releases it and\n // reaches `onResumeRejected`.\n sendResume: (id, value) =>\n sendCommand({\n type: 'run/input',\n requestId: id,\n response: { type: 'resume', value },\n }),\n });\n\n const resume = useCallback(\n (value: TValue) => {\n if (requestId !== undefined) {\n recordAnswered(requestId, answeredLaneIds(value, actionRequests));\n }\n return resumeLocked(value);\n },\n [requestId, actionRequests, resumeLocked],\n );\n\n const sendLaneDecisions = useCallback(\n (lanes: Readonly<Record<string, StatewireThread.InputResponse>>) =>\n requestId !== undefined\n ? resume({ lane_decisions: lanes } as unknown as TValue)\n : sendCommand({ type: 'run/lane-input', laneDecisions: lanes }),\n [requestId, resume, sendCommand],\n );\n\n const replayQueuedLanes = useCallback(\n (id: string) => sendCommand({ type: 'run/lane-replay', requestId: id }),\n [sendCommand],\n );\n\n return {\n request,\n requestId,\n hitl,\n actionRequests,\n liveHitl,\n liveActionRequests,\n queuedLaneDecisions,\n abandonedInterrupt,\n pending,\n resume,\n sendLaneDecisions,\n replayQueuedLanes,\n };\n}\n\n/**\n * What the run waits on a person's approval for: the one read every surface\n * that shows a parked step makes (the SDK chat's turns and subagent cards,\n * Olympus's lane cards and step lists), so they all agree with the approval\n * card. The join from an approval to the calls, lanes and steps it gates is\n * agent-runtime's (`toolCallIdsAwaitingApproval`, `subagentAwaitingApproval`,\n * `useTurnToolCallsAwaitingApproval`). Read-only: nothing here sends a command.\n */\nexport interface StatewireApprovalWait {\n /**\n * The gated calls still waiting on a decision, by `tool_call_id`: a step\n * holding one waits for approval, and so does a subagent lane whose own\n * dispatch, or a call it made, is one. Keeps its identity while its ids are\n * unchanged.\n */\n toolCallIds: ReadonlySet<string>;\n /**\n * The run is parked on a request a person answers (an approval, a\n * question): nothing runs until someone answers it, so no step's silence is\n * a stall.\n */\n runParked: boolean;\n}\n\nconst NO_WAITING_TOOL_CALL_IDS: ReadonlySet<string> = new Set();\n\n/** Nothing waits on a person. */\nconst NOTHING_WAITS: StatewireApprovalWait = {\n toolCallIds: NO_WAITING_TOOL_CALL_IDS,\n runParked: false,\n};\n\n/** Joins call ids into one selector value; an id never holds it. */\nconst TOOL_CALL_ID_SEPARATOR = '\\n';\n\nfunction toolCallIdSet(key: string): ReadonlySet<string> {\n return key === '' ? NO_WAITING_TOOL_CALL_IDS : new Set(key.split(TOOL_CALL_ID_SEPARATOR));\n}\n\n/**\n * The run's approval wait: the gated calls of the approval on screen (the\n * parked request's, else the host's mirror of a lane parked while its\n * siblings still stream) that nobody has answered, less the lanes whose\n * decision the host already holds (`queuedLaneDecisions`: a lane decided live\n * waits for the run to park, not for anyone), and whether the run is parked.\n * It clears the moment the approval is answered.\n *\n * Requires a statewire aui scope (throws outside one), like\n * {@link useStatewireApprovalRequest}.\n */\nexport function useStatewireApprovalWait(): StatewireApprovalWait {\n const { requestId, actionRequests, liveActionRequests, queuedLaneDecisions } =\n useStatewireApprovalRequest();\n const runParked = requestId !== undefined;\n const ids = toolCallIdsAwaitingApproval({\n actionRequests: runParked ? actionRequests : liveActionRequests,\n queuedLaneDecisions,\n });\n // A fresh set per state update: key it, so a reader re-renders only when the ids change.\n const key = [...ids].sort().join(TOOL_CALL_ID_SEPARATOR);\n return useMemo(\n () => (key === '' && !runParked ? NOTHING_WAITS : { toolCallIds: toolCallIdSet(key), runParked }),\n [key, runParked],\n );\n}\n\nconst StatewireApprovalWaitContext = createContext<StatewireApprovalWait>(NOTHING_WAITS);\n\n/**\n * Reads the run's approval wait once for everything below it: `AthenaChat`'s\n * turns and subagent cards. Needs a statewire aui scope.\n */\nexport function StatewireApprovalWaitProvider({ children }: { children?: ReactNode }) {\n return createElement(\n StatewireApprovalWaitContext.Provider,\n { value: useStatewireApprovalWait() },\n children,\n );\n}\n\n/**\n * The nearest {@link StatewireApprovalWaitProvider}'s wait. Without one (a\n * host's own thread), nothing waits, as before the SDK read it.\n */\nexport function useApprovalWaitInScope(): StatewireApprovalWait {\n return useContext(StatewireApprovalWaitContext);\n}\n"],"names":["laneInterruptIds","isApprovalCardInterrupt","HITL_PENDING_RESUME_GRACE_MS","useStatewireSendCommand","useStatewireRuns","useStatewireState","readAbandonedInputRequests","findAbandonedInterrupt","asHitlApproval","useMemo","pendingActionRequests","useAthenaRunLive","readInterruptMirror","interruptMirrorPayload","useRef","useSyncExternalStore","useEffect","readQueuedLaneDecisions","useApprovalResumeLock","useCallback","toolCallIdsAwaitingApproval","createContext","createElement","useContext"],"mappings":";;;;;;AAmEA,MAAM,2BAA8D,OAAO,OAAO,EAAE;AACpF,MAAM,qBAA6C,CAAA;AAYnD,MAAM,uCAAuB,IAAA;AAC7B,MAAM,wCAAwB,IAAA;AAC9B,IAAI,kBAAkB;AACtB,SAAS,iBAAuB;AAC9B,qBAAmB;AACnB,aAAW,YAAY,kBAAmB,UAAA;AAC5C;AACA,SAAS,eAAe,WAAmB,SAAkC;AAC3E,mBAAiB,IAAI,WAAW,OAAO;AACvC,iBAAA;AACF;AACA,SAAS,eAAe,WAAyB;AAC/C,MAAI,iBAAiB,OAAO,SAAS,EAAG,gBAAA;AAC1C;AACA,SAAS,kBAAkB,UAAkC;AAC3D,oBAAkB,IAAI,QAAQ;AAC9B,SAAO,MAAM;AACX,sBAAkB,OAAO,QAAQ;AAAA,EACnC;AACF;AACA,MAAM,sBAAsB,MAAc;AAO1C,SAAS,gBAAgB,OAAgB,gBAA2D;AAClG,QAAM,MAAMA,WAAAA,iBAAiB,cAAc,KAAK,CAAA;AAChD,MAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,oBAAoB,OAAO;AAC5E,UAAM,QAAS,MAAsC;AACrD,QAAI,OAAO,UAAU,YAAY,UAAU,MAAM;AAC/C,iBAAW,MAAM,OAAO,KAAK,KAAK,EAAG,KAAI,CAAC,IAAI,SAAS,EAAE,EAAG,KAAI,KAAK,EAAE;AAAA,IACzE;AAAA,EACF;AACA,SAAO;AACT;AASA,SAAS,sBACP,eACA,oBACS;AACT,MAAI,kBAAkB,OAAW,QAAO;AACxC,QAAM,MAAMA,WAAAA,iBAAiB,kBAAkB;AAC/C,MAAI,QAAQ,KAAM,QAAO;AACzB,SAAO,IAAI,MAAM,CAAC,OAAO,cAAc,SAAS,EAAE,CAAC;AACrD;AA6FO,SAAS,4BAEd,UAA8C,IAAsC;;AACpF,QAAM;AAAA,IACJ,qBAAqBC,WAAAA;AAAAA,IACrB,uBAAuBC,WAAAA;AAAAA,IACvB;AAAA,IACA;AAAA,EAAA,IACE;AACJ,QAAM,cAAcC,eAAAA,wBAAA;AAGpB,QAAM,WAAUC,oBAAAA,iBAAA,EAAmB,kBAAnBA,mBAAkC,KAAK;AACvD,QAAM,YAAY,mCAAS;AAK3B,QAAM,YAAYC,eAAAA,kBAAkBC,qCAA0B;AAC9D,QAAM,qBAAqBC,WAAAA,uBAAuB,SAAS;AAE3D,QAAM,OAAOC,WAAAA,eAAe,mCAAS,OAAO;AAC5C,QAAM,iBAAiBC,MAAAA,QAAQ,MAAMC,WAAAA,sBAAsB,IAAI,GAAG,CAAC,IAAI,CAAC;AAExE,QAAM,YAAYC,iBAAAA,iBAAA;AAIlB,QAAM,SAASN,eAAAA,kBAAkBO,8BAAmB;AACpD,QAAM,aACJ,YAAY,UAAa,YAAYJ,WAAAA,eAAeK,WAAAA,uBAAuB,MAAM,CAAC,IAAI;AACxF,QAAM,uBAAuBJ,MAAAA,QAAQ,MAAMC,WAAAA,sBAAsB,UAAU,GAAG,CAAC,UAAU,CAAC;AAI1F,QAAM,mBAAmBI,MAAAA,OAAe,MAAS;AACjD,MAAI,cAAc,OAAW,kBAAiB,UAAU;AACxDC,6BAAqB,mBAAmB,qBAAqB,mBAAmB;AAChF,QAAM,gBACJ,iBAAiB,YAAY,SAAY,SAAY,iBAAiB,IAAI,iBAAiB,OAAO;AACpG,QAAM,gBAAgBF,WAAAA,uBAAuB,MAAM,MAAM;AACzDG,QAAAA,UAAU,MAAM;AACd,QAAI,cAAc,OAAW;AAC7B,WAAO,MAAM;AAGX,UAAI,iBAAiB,YAAY,UAAW,gBAAe,SAAS;AAAA,IACtE;AAAA,EACF,GAAG,CAAC,SAAS,CAAC;AACdA,QAAAA,UAAU,MAAM;AACd,QAAI,iBAAiB,iBAAiB,YAAY,OAAW,gBAAe,iBAAiB,OAAO;AAAA,EACtG,GAAG,CAAC,aAAa,CAAC;AAClBA,QAAAA;AAAAA,IACE,MAAM,MAAM;AACV,UAAI,iBAAiB,YAAY,OAAW,gBAAe,iBAAiB,OAAO;AAAA,IACrF;AAAA,IACA,CAAA;AAAA,EAAC;AAEH,QAAM,WAAW,sBAAsB,eAAe,oBAAoB,IAAI,OAAO;AACrF,QAAM,qBAAqB,aAAa,aAAa,uBAAuB;AAC5E,QAAM,sBACJX,eAAAA,kBAAkBY,WAAAA,uBAAuB,KAAK;AAEhD,QAAM,EAAE,SAAS,QAAQ,aAAA,IAAiBC,WAAAA,sBAA8B;AAAA,IACtE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAAA,IAGA,YAAY,CAAC,IAAI,UACf,YAAY;AAAA,MACV,MAAM;AAAA,MACN,WAAW;AAAA,MACX,UAAU,EAAE,MAAM,UAAU,MAAA;AAAA,IAAM,CACnC;AAAA,EAAA,CACJ;AAED,QAAM,SAASC,MAAAA;AAAAA,IACb,CAAC,UAAkB;AACjB,UAAI,cAAc,QAAW;AAC3B,uBAAe,WAAW,gBAAgB,OAAO,cAAc,CAAC;AAAA,MAClE;AACA,aAAO,aAAa,KAAK;AAAA,IAC3B;AAAA,IACA,CAAC,WAAW,gBAAgB,YAAY;AAAA,EAAA;AAG1C,QAAM,oBAAoBA,MAAAA;AAAAA,IACxB,CAAC,UACC,cAAc,SACV,OAAO,EAAE,gBAAgB,MAAA,CAA4B,IACrD,YAAY,EAAE,MAAM,kBAAkB,eAAe,OAAO;AAAA,IAClE,CAAC,WAAW,QAAQ,WAAW;AAAA,EAAA;AAGjC,QAAM,oBAAoBA,MAAAA;AAAAA,IACxB,CAAC,OAAe,YAAY,EAAE,MAAM,mBAAmB,WAAW,IAAI;AAAA,IACtE,CAAC,WAAW;AAAA,EAAA;AAGd,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAEJ;AA0BA,MAAM,+CAAoD,IAAA;AAG1D,MAAM,gBAAuC;AAAA,EAC3C,aAAa;AAAA,EACb,WAAW;AACb;AAGA,MAAM,yBAAyB;AAE/B,SAAS,cAAc,KAAkC;AACvD,SAAO,QAAQ,KAAK,2BAA2B,IAAI,IAAI,IAAI,MAAM,sBAAsB,CAAC;AAC1F;AAaO,SAAS,2BAAkD;AAChE,QAAM,EAAE,WAAW,gBAAgB,oBAAoB,oBAAA,IACrD,4BAAA;AACF,QAAM,YAAY,cAAc;AAChC,QAAM,MAAMC,WAAAA,4BAA4B;AAAA,IACtC,gBAAgB,YAAY,iBAAiB;AAAA,IAC7C;AAAA,EAAA,CACD;AAED,QAAM,MAAM,CAAC,GAAG,GAAG,EAAE,KAAA,EAAO,KAAK,sBAAsB;AACvD,SAAOX,MAAAA;AAAAA,IACL,MAAO,QAAQ,MAAM,CAAC,YAAY,gBAAgB,EAAE,aAAa,cAAc,GAAG,GAAG,UAAA;AAAA,IACrF,CAAC,KAAK,SAAS;AAAA,EAAA;AAEnB;AAEA,MAAM,+BAA+BY,MAAAA,cAAqC,aAAa;AAMhF,SAAS,8BAA8B,EAAE,YAAsC;AACpF,SAAOC,MAAAA;AAAAA,IACL,6BAA6B;AAAA,IAC7B,EAAE,OAAO,2BAAyB;AAAA,IAClC;AAAA,EAAA;AAEJ;AAMO,SAAS,yBAAgD;AAC9D,SAAOC,MAAAA,WAAW,4BAA4B;AAChD;;;;;"}
|
|
1
|
+
{"version":3,"file":"use-statewire-approval-request.cjs","sources":["../../src/chat/use-statewire-approval-request.ts"],"sourcesContent":["import type { StatewireThread } from '@assistant-ui/react-statewire';\nimport {\n useStatewireRuns,\n useStatewireSendCommand,\n useStatewireState,\n} from '@assistant-ui/react-statewire';\nimport {\n type AbandonedInputRequest,\n asHitlApproval,\n findAbandonedInterrupt,\n HITL_PENDING_RESUME_GRACE_MS,\n type HitlApprovalPayload,\n interruptMirrorPayload,\n isApprovalCardInterrupt,\n laneInterruptIds,\n type PendingActionRequest,\n pendingActionRequests,\n readAbandonedInputRequests,\n readInterruptMirror,\n readQueuedLaneDecisions,\n type ResumeExtras,\n toolCallIdsAwaitingApproval,\n useApprovalResumeLock,\n} from '@athenaintel/agent-runtime';\nimport {\n createContext,\n createElement,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useSyncExternalStore,\n} from 'react';\nimport { deviceOperationStamp, useDeviceOperationReader } from './device-operation';\nimport { useAthenaRunLive } from './use-athena-run-live';\n\ndeclare module '@assistant-ui/core' {\n namespace Assistant {\n interface Commands {\n /**\n * Decide per-dispatch subagent lanes while the parent run is still\n * streaming (`DeepAgentThread.run_lane_input`). Keys are the lanes'\n * langgraph interrupt ids; the host matches them against the lanes its\n * mirrored interrupt currently parks, answers at once when the run is\n * already parked, and otherwise holds them until it parks — stale or\n * unknown ids are ignored, never carried to a later interrupt.\n */\n runLaneInput: {\n readonly type: 'run/lane-input';\n readonly laneDecisions: Readonly<Record<string, StatewireThread.InputResponse>>;\n /** The passkey decision check covering these lanes (identity 0b.9). */\n readonly decisionCheck?: string;\n /** The device an agent was operating as these were sent (identity v7, D11). */\n readonly deviceOperation?: string;\n };\n /**\n * `run/input` sent while the host's device runs an agent's action\n * (`DeviceOperationProvider`, identity v7 D11): agora refuses it when it\n * approves anything, and reads a reject as before.\n */\n runInputFromOperatedDevice: {\n readonly type: 'run/input';\n readonly requestId: string;\n readonly response: StatewireThread.InputResponse;\n readonly decisionCheck?: string;\n readonly deviceOperation: string;\n };\n /**\n * `run/input` carrying the passkey decision check a person minted for\n * exactly this answer (identity 0b.9). The run manager reads only\n * `requestId` and `response`; the host classifies and spends the check\n * once the answer is recorded.\n */\n runInputWithDecisionCheck: {\n readonly type: 'run/input';\n readonly requestId: string;\n readonly response: StatewireThread.InputResponse;\n readonly decisionCheck: string;\n };\n /**\n * Re-send the lane decisions the host still holds queued as their\n * approver's resume of the parked request (`DeepAgentThread.run_lane_replay`).\n * The host resumes under the meta the approver's `run/lane-input`\n * recorded and refuses any other caller — every attached client reads\n * the same queue, and only the one that queued it may turn it into a\n * resume. Carries no decisions: the host replays what it recorded.\n */\n runLaneReplay: {\n readonly type: 'run/lane-replay';\n readonly requestId: string;\n };\n }\n }\n}\n\nconst NO_QUEUED_LANE_DECISIONS: Readonly<Record<string, unknown>> = Object.freeze({});\nconst NO_ACTION_REQUESTS: PendingActionRequest[] = [];\n\n/**\n * Lane ids of the parked requests this client resumed, keyed by request id\n * and shared by every hook instance on the page (approval card,\n * waiting-on-you banner, host editors) so all of them treat a lingering\n * mirror the same way. Request ids are unique per parked interrupt, so an\n * instance only ever consults the record of the request it saw parked: two\n * chats mounted side by side cannot suppress or clear each other's. A record\n * is retired once the host drops that request's mirror (the resume run\n * started), the surface sees a different request park, or it unmounts.\n */\nconst answeredRequests = new Map<string, readonly string[]>();\nconst answeredListeners = new Set<() => void>();\nlet answeredVersion = 0;\nfunction notifyAnswered(): void {\n answeredVersion += 1;\n for (const listener of answeredListeners) listener();\n}\nfunction recordAnswered(requestId: string, laneIds: readonly string[]): void {\n answeredRequests.set(requestId, laneIds);\n notifyAnswered();\n}\nfunction forgetAnswered(requestId: string): void {\n if (answeredRequests.delete(requestId)) notifyAnswered();\n}\nfunction subscribeAnswered(listener: () => void): () => void {\n answeredListeners.add(listener);\n return () => {\n answeredListeners.delete(listener);\n };\n}\nconst readAnsweredVersion = (): number => answeredVersion;\n\n/**\n * The lanes a resume of the parked request settles: every lane of the request\n * (a resume answers the whole park — lanes already queued through\n * `run/lane-input` ride along) plus any lane named in the `lane_decisions` map.\n */\nfunction answeredLaneIds(value: unknown, actionRequests: readonly PendingActionRequest[]): string[] {\n const ids = laneInterruptIds(actionRequests) ?? [];\n if (typeof value === 'object' && value !== null && 'lane_decisions' in value) {\n const lanes = (value as { lane_decisions: unknown }).lane_decisions;\n if (typeof lanes === 'object' && lanes !== null) {\n for (const id of Object.keys(lanes)) if (!ids.includes(id)) ids.push(id);\n }\n }\n return ids;\n}\n\n/**\n * Whether the host's mirror still shows an interrupt this client already\n * answered. After `run/input` the host drops the parked request at once but\n * keeps `__interrupt__` until the resume run starts and clears it (seconds on\n * a cold checkpoint); without this check the card would re-offer the SAME\n * approval from the mirror, buttons live, and then fold it away again.\n */\nfunction mirrorAlreadyAnswered(\n answeredLanes: readonly string[] | undefined,\n liveActionRequests: readonly PendingActionRequest[],\n): boolean {\n if (answeredLanes === undefined) return false;\n const ids = laneInterruptIds(liveActionRequests);\n if (ids === null) return false;\n return ids.every((id) => answeredLanes.includes(id));\n}\n\n/** Selects which pending interrupt an approval surface answers. */\nexport type StatewireInterruptPredicate = (\n request: StatewireThread.InputRequestState,\n) => request is StatewireThread.CustomInputRequest;\n\nexport interface UseStatewireApprovalRequestOptions {\n /**\n * Which pending interrupt to answer. Defaults to `isApprovalCardInterrupt`\n * (client-tool parks excluded — the client-tool bridge owns those, and a\n * generic resume would corrupt the parked tool call).\n */\n interruptPredicate?: StatewireInterruptPredicate;\n /**\n * How long a sent decision keeps the actions locked when no resume run ever\n * starts. Defaults to {@link HITL_PENDING_RESUME_GRACE_MS}.\n */\n pendingResumeGraceMs?: number;\n /**\n * The host refused the `run/input` (or the transport lost it): the\n * optimistic fold rolls back, the request is on screen again with its\n * actions re-enabled, and this is the surface's one chance to say why.\n */\n onResumeRejected?: (error: unknown, requestId: string) => void;\n /** See {@link UseApprovalResumeLockOptions.onResumeRetry}. */\n onResumeRetry?: (error: unknown, requestId: string, attempt: number) => void;\n}\n\nexport interface StatewireApprovalRequest<TValue> {\n /** The pending interrupt this surface answers, if any. */\n request: StatewireThread.CustomInputRequest | undefined;\n requestId: string | undefined;\n /** The payload narrowed to the Athena HITL approval shape, or `null`. */\n hitl: HitlApprovalPayload | null;\n /** Every gated call the approval covers, in decision order (empty for non-HITL parks). */\n actionRequests: PendingActionRequest[];\n /** An interrupt a non-resume dispatch dropped — the \"approval was cancelled\" notice. */\n abandonedInterrupt: AbandonedInputRequest | undefined;\n /**\n * The mirrored interrupt's HITL payload while the run is still live and no\n * input request is answerable: per-dispatch `task` lanes parked on their\n * gates while sibling lanes stream. `null` once the run parks (the same\n * lanes are then `hitl` / `actionRequests`) and when nothing is parked.\n */\n liveHitl: HitlApprovalPayload | null;\n /** Every gated call `liveHitl` covers (empty when it is `null`). */\n liveActionRequests: PendingActionRequest[];\n /**\n * The decisions the host already holds from a `run/lane-input`, keyed by\n * langgraph interrupt id, to be answered when the run parks — a queued lane\n * reads as decided on every attached client, not just the one that sent it.\n */\n queuedLaneDecisions: Readonly<Record<string, unknown>>;\n /** True after a resume until the request identity changes (or recovery fires). */\n pending: boolean;\n /**\n * Answer the request with `{ type: 'run/input', requestId, response: { type: 'resume', value } }`,\n * plus `decisionCheck` when `extras` carries one.\n * Returns the dispatch promise (settles when the host accepts, rejects when\n * it refuses), or `undefined` when the lock dropped the send.\n */\n resume: (value: TValue, extras?: ResumeExtras) => Promise<unknown> | undefined;\n /**\n * Decide per-dispatch lanes by langgraph interrupt id. With a pending\n * request this is the native `lane_decisions` resume through the lock;\n * without one (the run is still streaming siblings) it is `run/lane-input`,\n * which the host queues and answers on the park. Returns the dispatch\n * promise, or `undefined` when the lock dropped a resume.\n */\n sendLaneDecisions: (\n lanes: Readonly<Record<string, StatewireThread.InputResponse>>,\n extras?: ResumeExtras,\n ) => Promise<unknown> | undefined;\n /**\n * Ask the host to resume the parked `requestId` with the lane decisions it\n * still holds queued, as their approver (`run/lane-replay`). For the card\n * that queued them, after the host's own answerer has stayed silent past\n * its budget; the host refuses every other caller. Settles when the host\n * accepts, rejects when it refuses.\n */\n replayQueuedLanes: (requestId: string) => Promise<unknown>;\n}\n\n/**\n * The headless half of every statewire approval surface: selects the pending\n * interrupt from the runs projection, narrows its payload, reads the\n * host-published abandoned interrupts, and wires the shared optimistic resume\n * lock to the thread's `run/input` command. `StatewireApprovalCard` renders\n * over it; hosts with their own decision UI (per-lane subagent cards) build\n * on it directly so the selection and lock semantics cannot drift.\n *\n * Requires a statewire aui scope (throws outside one, like every\n * `useStatewire*` hook) — gate the mount with `hasStatewireThreadExtras`.\n */\nexport function useStatewireApprovalRequest<\n TValue extends StatewireThread.InputResponse = Record<string, string>,\n>(options: UseStatewireApprovalRequestOptions = {}): StatewireApprovalRequest<TValue> {\n const {\n interruptPredicate = isApprovalCardInterrupt,\n pendingResumeGraceMs = HITL_PENDING_RESUME_GRACE_MS,\n onResumeRejected,\n onResumeRetry,\n } = options;\n const sendCommand = useStatewireSendCommand();\n // Read at each send: the host's device may be operated by an agent now and\n // not a second later (identity v7, D11).\n const readDeviceOperation = useDeviceOperationReader();\n // The runs projection is memoized by the lib, so this derivation is\n // reference-stable between state updates.\n const request = useStatewireRuns().inputRequests?.find(interruptPredicate);\n const requestId = request?.id;\n\n // The host publishes the interrupts a non-resume dispatch dropped. Select\n // the raw array reference (pre-stream-safe) and derive inline; a `.find`\n // selector would return a fresh object every update.\n const abandoned = useStatewireState(readAbandonedInputRequests);\n const abandonedInterrupt = findAbandonedInterrupt(abandoned);\n\n const hitl = asHitlApproval(request?.payload);\n const actionRequests = useMemo(() => pendingActionRequests(hitl), [hitl]);\n\n const isRunning = useAthenaRunLive();\n // The host mirrors the interrupt into state as soon as a lane parks — while\n // the run manager still reports `running` (siblings streaming) and has no\n // request to answer. Raw reference selectors; derive inline.\n const mirror = useStatewireState(readInterruptMirror);\n const mirrorHitl =\n request === undefined && isRunning ? asHitlApproval(interruptMirrorPayload(mirror)) : null;\n const mirrorActionRequests = useMemo(() => pendingActionRequests(mirrorHitl), [mirrorHitl]);\n\n // The request this surface last saw parked: the only record it may read\n // or retire (the mirror it watches is the one that request's resume clears).\n const lastRequestIdRef = useRef<string>(undefined);\n if (requestId !== undefined) lastRequestIdRef.current = requestId;\n useSyncExternalStore(subscribeAnswered, readAnsweredVersion, readAnsweredVersion);\n const answeredLanes =\n lastRequestIdRef.current === undefined ? undefined : answeredRequests.get(lastRequestIdRef.current);\n const mirrorCleared = interruptMirrorPayload(mirror) === undefined;\n useEffect(() => {\n if (requestId === undefined) return;\n return () => {\n // A different request parks next (or this one unparks for good): the\n // record of this one is stale once it is not the one on screen.\n if (lastRequestIdRef.current !== requestId) forgetAnswered(requestId);\n };\n }, [requestId]);\n useEffect(() => {\n if (mirrorCleared && lastRequestIdRef.current !== undefined) forgetAnswered(lastRequestIdRef.current);\n }, [mirrorCleared]);\n useEffect(\n () => () => {\n if (lastRequestIdRef.current !== undefined) forgetAnswered(lastRequestIdRef.current);\n },\n [],\n );\n const liveHitl = mirrorAlreadyAnswered(answeredLanes, mirrorActionRequests) ? null : mirrorHitl;\n const liveActionRequests = liveHitl === mirrorHitl ? mirrorActionRequests : NO_ACTION_REQUESTS;\n const queuedLaneDecisions =\n useStatewireState(readQueuedLaneDecisions) ?? NO_QUEUED_LANE_DECISIONS;\n\n const { pending, resume: resumeLocked } = useApprovalResumeLock<TValue>({\n requestId,\n isRunning,\n pendingResumeGraceMs,\n onResumeRejected,\n onResumeRetry,\n // The dispatch promise is handed to the lock: a refusal releases it and\n // reaches `onResumeRejected`.\n sendResume: (id, value, extras) => {\n const deviceOperation = deviceOperationStamp(readDeviceOperation);\n if (deviceOperation !== undefined) {\n return sendCommand({\n type: 'run/input',\n requestId: id,\n response: { type: 'resume', value },\n ...(extras?.decisionCheck ? { decisionCheck: extras.decisionCheck } : {}),\n deviceOperation,\n });\n }\n return sendCommand(\n extras?.decisionCheck\n ? {\n type: 'run/input',\n requestId: id,\n response: { type: 'resume', value },\n decisionCheck: extras.decisionCheck,\n }\n : {\n type: 'run/input',\n requestId: id,\n response: { type: 'resume', value },\n },\n );\n },\n });\n\n const resume = useCallback(\n (value: TValue, extras?: ResumeExtras) => {\n if (requestId !== undefined) {\n recordAnswered(requestId, answeredLaneIds(value, actionRequests));\n }\n return resumeLocked(value, extras);\n },\n [requestId, actionRequests, resumeLocked],\n );\n\n const sendLaneDecisions = useCallback(\n (lanes: Readonly<Record<string, StatewireThread.InputResponse>>, extras?: ResumeExtras) => {\n if (requestId !== undefined) {\n return resume({ lane_decisions: lanes } as unknown as TValue, extras);\n }\n const deviceOperation = deviceOperationStamp(readDeviceOperation);\n return sendCommand({\n type: 'run/lane-input',\n laneDecisions: lanes,\n ...(extras?.decisionCheck ? { decisionCheck: extras.decisionCheck } : {}),\n ...(deviceOperation !== undefined ? { deviceOperation } : {}),\n });\n },\n [requestId, resume, sendCommand, readDeviceOperation],\n );\n\n const replayQueuedLanes = useCallback(\n (id: string) => sendCommand({ type: 'run/lane-replay', requestId: id }),\n [sendCommand],\n );\n\n return {\n request,\n requestId,\n hitl,\n actionRequests,\n liveHitl,\n liveActionRequests,\n queuedLaneDecisions,\n abandonedInterrupt,\n pending,\n resume,\n sendLaneDecisions,\n replayQueuedLanes,\n };\n}\n\n/**\n * What the run waits on a person's approval for: the one read every surface\n * that shows a parked step makes (the SDK chat's turns and subagent cards,\n * Olympus's lane cards and step lists), so they all agree with the approval\n * card. The join from an approval to the calls, lanes and steps it gates is\n * agent-runtime's (`toolCallIdsAwaitingApproval`, `subagentAwaitingApproval`,\n * `useTurnToolCallsAwaitingApproval`). Read-only: nothing here sends a command.\n */\nexport interface StatewireApprovalWait {\n /**\n * The gated calls still waiting on a decision, by `tool_call_id`: a step\n * holding one waits for approval, and so does a subagent lane whose own\n * dispatch, or a call it made, is one. Keeps its identity while its ids are\n * unchanged.\n */\n toolCallIds: ReadonlySet<string>;\n /**\n * The run is parked on a request a person answers (an approval, a\n * question): nothing runs until someone answers it, so no step's silence is\n * a stall.\n */\n runParked: boolean;\n}\n\nconst NO_WAITING_TOOL_CALL_IDS: ReadonlySet<string> = new Set();\n\n/** Nothing waits on a person. */\nconst NOTHING_WAITS: StatewireApprovalWait = {\n toolCallIds: NO_WAITING_TOOL_CALL_IDS,\n runParked: false,\n};\n\n/** Joins call ids into one selector value; an id never holds it. */\nconst TOOL_CALL_ID_SEPARATOR = '\\n';\n\nfunction toolCallIdSet(key: string): ReadonlySet<string> {\n return key === '' ? NO_WAITING_TOOL_CALL_IDS : new Set(key.split(TOOL_CALL_ID_SEPARATOR));\n}\n\n/**\n * The run's approval wait: the gated calls of the approval on screen (the\n * parked request's, else the host's mirror of a lane parked while its\n * siblings still stream) that nobody has answered, less the lanes whose\n * decision the host already holds (`queuedLaneDecisions`: a lane decided live\n * waits for the run to park, not for anyone), and whether the run is parked.\n * It clears the moment the approval is answered.\n *\n * Requires a statewire aui scope (throws outside one), like\n * {@link useStatewireApprovalRequest}.\n */\nexport function useStatewireApprovalWait(): StatewireApprovalWait {\n const { requestId, actionRequests, liveActionRequests, queuedLaneDecisions } =\n useStatewireApprovalRequest();\n const runParked = requestId !== undefined;\n const ids = toolCallIdsAwaitingApproval({\n actionRequests: runParked ? actionRequests : liveActionRequests,\n queuedLaneDecisions,\n });\n // A fresh set per state update: key it, so a reader re-renders only when the ids change.\n const key = [...ids].sort().join(TOOL_CALL_ID_SEPARATOR);\n return useMemo(\n () => (key === '' && !runParked ? NOTHING_WAITS : { toolCallIds: toolCallIdSet(key), runParked }),\n [key, runParked],\n );\n}\n\nconst StatewireApprovalWaitContext = createContext<StatewireApprovalWait>(NOTHING_WAITS);\n\n/**\n * Reads the run's approval wait once for everything below it: `AthenaChat`'s\n * turns and subagent cards. Needs a statewire aui scope.\n */\nexport function StatewireApprovalWaitProvider({ children }: { children?: ReactNode }) {\n return createElement(\n StatewireApprovalWaitContext.Provider,\n { value: useStatewireApprovalWait() },\n children,\n );\n}\n\n/**\n * The nearest {@link StatewireApprovalWaitProvider}'s wait. Without one (a\n * host's own thread), nothing waits, as before the SDK read it.\n */\nexport function useApprovalWaitInScope(): StatewireApprovalWait {\n return useContext(StatewireApprovalWaitContext);\n}\n"],"names":["laneInterruptIds","isApprovalCardInterrupt","HITL_PENDING_RESUME_GRACE_MS","useStatewireSendCommand","useDeviceOperationReader","useStatewireRuns","useStatewireState","readAbandonedInputRequests","findAbandonedInterrupt","asHitlApproval","useMemo","pendingActionRequests","useAthenaRunLive","readInterruptMirror","interruptMirrorPayload","useRef","useSyncExternalStore","useEffect","readQueuedLaneDecisions","useApprovalResumeLock","deviceOperation","deviceOperationStamp","useCallback","toolCallIdsAwaitingApproval","createContext","createElement","useContext"],"mappings":"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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { StatewireThread } from '@assistant-ui/react-statewire';
|
|
2
|
-
import { type AbandonedInputRequest, type HitlApprovalPayload, type PendingActionRequest } from '../agent-runtime/src/index';
|
|
2
|
+
import { type AbandonedInputRequest, type HitlApprovalPayload, type PendingActionRequest, type ResumeExtras } from '../agent-runtime/src/index';
|
|
3
3
|
import { type ReactNode } from 'react';
|
|
4
4
|
declare module '@assistant-ui/core' {
|
|
5
5
|
namespace Assistant {
|
|
@@ -15,6 +15,34 @@ declare module '@assistant-ui/core' {
|
|
|
15
15
|
runLaneInput: {
|
|
16
16
|
readonly type: 'run/lane-input';
|
|
17
17
|
readonly laneDecisions: Readonly<Record<string, StatewireThread.InputResponse>>;
|
|
18
|
+
/** The passkey decision check covering these lanes (identity 0b.9). */
|
|
19
|
+
readonly decisionCheck?: string;
|
|
20
|
+
/** The device an agent was operating as these were sent (identity v7, D11). */
|
|
21
|
+
readonly deviceOperation?: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* `run/input` sent while the host's device runs an agent's action
|
|
25
|
+
* (`DeviceOperationProvider`, identity v7 D11): agora refuses it when it
|
|
26
|
+
* approves anything, and reads a reject as before.
|
|
27
|
+
*/
|
|
28
|
+
runInputFromOperatedDevice: {
|
|
29
|
+
readonly type: 'run/input';
|
|
30
|
+
readonly requestId: string;
|
|
31
|
+
readonly response: StatewireThread.InputResponse;
|
|
32
|
+
readonly decisionCheck?: string;
|
|
33
|
+
readonly deviceOperation: string;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* `run/input` carrying the passkey decision check a person minted for
|
|
37
|
+
* exactly this answer (identity 0b.9). The run manager reads only
|
|
38
|
+
* `requestId` and `response`; the host classifies and spends the check
|
|
39
|
+
* once the answer is recorded.
|
|
40
|
+
*/
|
|
41
|
+
runInputWithDecisionCheck: {
|
|
42
|
+
readonly type: 'run/input';
|
|
43
|
+
readonly requestId: string;
|
|
44
|
+
readonly response: StatewireThread.InputResponse;
|
|
45
|
+
readonly decisionCheck: string;
|
|
18
46
|
};
|
|
19
47
|
/**
|
|
20
48
|
* Re-send the lane decisions the host still holds queued as their
|
|
@@ -82,11 +110,12 @@ export interface StatewireApprovalRequest<TValue> {
|
|
|
82
110
|
/** True after a resume until the request identity changes (or recovery fires). */
|
|
83
111
|
pending: boolean;
|
|
84
112
|
/**
|
|
85
|
-
* Answer the request with `{ type: 'run/input', requestId, response: { type: 'resume', value } }
|
|
113
|
+
* Answer the request with `{ type: 'run/input', requestId, response: { type: 'resume', value } }`,
|
|
114
|
+
* plus `decisionCheck` when `extras` carries one.
|
|
86
115
|
* Returns the dispatch promise (settles when the host accepts, rejects when
|
|
87
116
|
* it refuses), or `undefined` when the lock dropped the send.
|
|
88
117
|
*/
|
|
89
|
-
resume: (value: TValue) => Promise<unknown> | undefined;
|
|
118
|
+
resume: (value: TValue, extras?: ResumeExtras) => Promise<unknown> | undefined;
|
|
90
119
|
/**
|
|
91
120
|
* Decide per-dispatch lanes by langgraph interrupt id. With a pending
|
|
92
121
|
* request this is the native `lane_decisions` resume through the lock;
|
|
@@ -94,7 +123,7 @@ export interface StatewireApprovalRequest<TValue> {
|
|
|
94
123
|
* which the host queues and answers on the park. Returns the dispatch
|
|
95
124
|
* promise, or `undefined` when the lock dropped a resume.
|
|
96
125
|
*/
|
|
97
|
-
sendLaneDecisions: (lanes: Readonly<Record<string, StatewireThread.InputResponse
|
|
126
|
+
sendLaneDecisions: (lanes: Readonly<Record<string, StatewireThread.InputResponse>>, extras?: ResumeExtras) => Promise<unknown> | undefined;
|
|
98
127
|
/**
|
|
99
128
|
* Ask the host to resume the parked `requestId` with the lane decisions it
|
|
100
129
|
* still holds queued, as their approver (`run/lane-replay`). For the card
|