@athenaintel/react 0.41.2 → 0.42.1
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 +108 -9
- package/dist/agent-runtime/src/asset-attachment.d.ts +98 -0
- package/dist/agent-runtime/src/athena-asset-drag.d.ts +32 -0
- package/dist/agent-runtime/src/auth-denial.d.ts +29 -0
- package/dist/agent-runtime/src/chat-outbox-attachments.cjs +41 -0
- package/dist/agent-runtime/src/chat-outbox-attachments.cjs.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-attachments.d.ts +38 -0
- package/dist/agent-runtime/src/chat-outbox-attachments.js +41 -0
- package/dist/agent-runtime/src/chat-outbox-attachments.js.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-signals.cjs +63 -0
- package/dist/agent-runtime/src/chat-outbox-signals.cjs.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-signals.d.ts +12 -0
- package/dist/agent-runtime/src/chat-outbox-signals.js +63 -0
- package/dist/agent-runtime/src/chat-outbox-signals.js.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-store.cjs +509 -0
- package/dist/agent-runtime/src/chat-outbox-store.cjs.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-store.d.ts +203 -0
- package/dist/agent-runtime/src/chat-outbox-store.js +509 -0
- package/dist/agent-runtime/src/chat-outbox-store.js.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-thread.cjs +136 -0
- package/dist/agent-runtime/src/chat-outbox-thread.cjs.map +1 -0
- package/dist/agent-runtime/src/chat-outbox-thread.d.ts +118 -0
- package/dist/agent-runtime/src/chat-outbox-thread.js +136 -0
- package/dist/agent-runtime/src/chat-outbox-thread.js.map +1 -0
- package/dist/agent-runtime/src/chat-outbox.cjs +696 -0
- package/dist/agent-runtime/src/chat-outbox.cjs.map +1 -0
- package/dist/agent-runtime/src/chat-outbox.d.ts +285 -0
- package/dist/agent-runtime/src/chat-outbox.js +696 -0
- package/dist/agent-runtime/src/chat-outbox.js.map +1 -0
- package/dist/agent-runtime/src/chat-socket-reachability.d.ts +45 -0
- package/dist/agent-runtime/src/client-tool-bridge.d.ts +152 -0
- package/dist/agent-runtime/src/client-tools.d.ts +133 -0
- package/dist/agent-runtime/src/composer-markdown.cjs +10 -0
- package/dist/agent-runtime/src/composer-markdown.cjs.map +1 -1
- package/dist/agent-runtime/src/composer-markdown.d.ts +108 -0
- package/dist/agent-runtime/src/composer-markdown.js +10 -0
- package/dist/agent-runtime/src/composer-markdown.js.map +1 -1
- package/dist/agent-runtime/src/config-mutations.d.ts +51 -0
- package/dist/agent-runtime/src/conversation-index.d.ts +110 -0
- package/dist/agent-runtime/src/conversation-list.d.ts +343 -0
- package/dist/agent-runtime/src/deep-agent-transport-recipe.cjs +3 -2
- package/dist/agent-runtime/src/deep-agent-transport-recipe.cjs.map +1 -1
- package/dist/agent-runtime/src/deep-agent-transport-recipe.d.ts +166 -0
- package/dist/agent-runtime/src/deep-agent-transport-recipe.js +3 -2
- package/dist/agent-runtime/src/deep-agent-transport-recipe.js.map +1 -1
- package/dist/agent-runtime/src/desktop-handoff.d.ts +139 -0
- package/dist/agent-runtime/src/durable-thread-snapshot-cache.cjs +158 -0
- package/dist/agent-runtime/src/durable-thread-snapshot-cache.cjs.map +1 -0
- package/dist/agent-runtime/src/durable-thread-snapshot-cache.d.ts +60 -0
- package/dist/agent-runtime/src/durable-thread-snapshot-cache.js +158 -0
- package/dist/agent-runtime/src/durable-thread-snapshot-cache.js.map +1 -0
- package/dist/agent-runtime/src/edit-command.d.ts +156 -0
- package/dist/agent-runtime/src/errors.d.ts +174 -0
- package/dist/agent-runtime/src/execute-output.d.ts +31 -0
- package/dist/agent-runtime/src/generated/runconfig-contract.cjs +16 -2
- package/dist/agent-runtime/src/generated/runconfig-contract.cjs.map +1 -1
- package/dist/agent-runtime/src/generated/runconfig-contract.d.ts +202 -0
- package/dist/agent-runtime/src/generated/runconfig-contract.js +16 -2
- package/dist/agent-runtime/src/generated/runconfig-contract.js.map +1 -1
- package/dist/agent-runtime/src/github-wake-event.d.ts +77 -0
- package/dist/agent-runtime/src/index.d.ts +74 -0
- package/dist/agent-runtime/src/interrupts.cjs +17 -0
- package/dist/agent-runtime/src/interrupts.cjs.map +1 -1
- package/dist/agent-runtime/src/interrupts.d.ts +348 -0
- package/dist/agent-runtime/src/interrupts.js +17 -0
- package/dist/agent-runtime/src/interrupts.js.map +1 -1
- package/dist/agent-runtime/src/lane-follow.d.ts +121 -0
- package/dist/agent-runtime/src/lane-history.cjs +209 -0
- package/dist/agent-runtime/src/lane-history.cjs.map +1 -0
- package/dist/agent-runtime/src/lane-history.d.ts +175 -0
- package/dist/agent-runtime/src/lane-history.js +209 -0
- package/dist/agent-runtime/src/lane-history.js.map +1 -0
- package/dist/agent-runtime/src/lane-images.d.ts +184 -0
- package/dist/agent-runtime/src/message-author.d.ts +43 -0
- package/dist/agent-runtime/src/message-text.cjs +15 -0
- package/dist/agent-runtime/src/message-text.cjs.map +1 -0
- package/dist/agent-runtime/src/message-text.d.ts +47 -0
- package/dist/agent-runtime/src/message-text.js +15 -0
- package/dist/agent-runtime/src/message-text.js.map +1 -0
- package/dist/agent-runtime/src/message-window.cjs +15 -1
- package/dist/agent-runtime/src/message-window.cjs.map +1 -1
- package/dist/agent-runtime/src/message-window.d.ts +159 -0
- package/dist/agent-runtime/src/message-window.js +16 -2
- package/dist/agent-runtime/src/message-window.js.map +1 -1
- package/dist/agent-runtime/src/messages.cjs +88 -4
- package/dist/agent-runtime/src/messages.cjs.map +1 -1
- package/dist/agent-runtime/src/messages.d.ts +603 -0
- package/dist/agent-runtime/src/messages.js +88 -4
- package/dist/agent-runtime/src/messages.js.map +1 -1
- package/dist/agent-runtime/src/model-context.d.ts +22 -0
- package/dist/agent-runtime/src/offline-status.d.ts +157 -0
- package/dist/agent-runtime/src/optimistic-content.d.ts +21 -0
- package/dist/agent-runtime/src/protocol.cjs +12 -4
- package/dist/agent-runtime/src/protocol.cjs.map +1 -1
- package/dist/agent-runtime/src/protocol.d.ts +119 -0
- package/dist/agent-runtime/src/protocol.js +13 -5
- package/dist/agent-runtime/src/protocol.js.map +1 -1
- package/dist/agent-runtime/src/ptc-subcalls.d.ts +51 -0
- package/dist/agent-runtime/src/queue.d.ts +138 -0
- package/dist/agent-runtime/src/quota-safe-local-storage-session.d.ts +154 -0
- package/dist/agent-runtime/src/running-tool-placeholder.cjs +11 -0
- package/dist/agent-runtime/src/running-tool-placeholder.cjs.map +1 -0
- package/dist/agent-runtime/src/running-tool-placeholder.d.ts +25 -0
- package/dist/agent-runtime/src/running-tool-placeholder.js +11 -0
- package/dist/agent-runtime/src/running-tool-placeholder.js.map +1 -0
- package/dist/agent-runtime/src/runtime-messages.d.ts +104 -0
- package/dist/agent-runtime/src/screen-point.d.ts +151 -0
- package/dist/agent-runtime/src/sealed-idb.cjs +112 -0
- package/dist/agent-runtime/src/sealed-idb.cjs.map +1 -0
- package/dist/agent-runtime/src/sealed-idb.d.ts +106 -0
- package/dist/agent-runtime/src/sealed-idb.js +112 -0
- package/dist/agent-runtime/src/sealed-idb.js.map +1 -0
- package/dist/agent-runtime/src/send-recovery.d.ts +40 -0
- package/dist/agent-runtime/src/statewire-attach-observer.d.ts +194 -0
- package/dist/agent-runtime/src/statewire-diagnostics.d.ts +74 -0
- package/dist/agent-runtime/src/statewire-state.d.ts +29 -0
- package/dist/agent-runtime/src/statewire-suspended.cjs.map +1 -1
- package/dist/agent-runtime/src/statewire-suspended.d.ts +27 -0
- package/dist/agent-runtime/src/statewire-suspended.js.map +1 -1
- package/dist/agent-runtime/src/statewire-transport.d.ts +40 -0
- package/dist/agent-runtime/src/streaming-markdown.d.ts +46 -0
- package/dist/agent-runtime/src/subagent-transcripts.cjs +209 -0
- package/dist/agent-runtime/src/subagent-transcripts.cjs.map +1 -0
- package/dist/agent-runtime/src/subagent-transcripts.d.ts +71 -0
- package/dist/agent-runtime/src/subagent-transcripts.js +209 -0
- package/dist/agent-runtime/src/subagent-transcripts.js.map +1 -0
- package/dist/agent-runtime/src/subagents.cjs +253 -0
- package/dist/agent-runtime/src/subagents.cjs.map +1 -0
- package/dist/agent-runtime/src/subagents.d.ts +311 -0
- package/dist/agent-runtime/src/subagents.js +253 -0
- package/dist/agent-runtime/src/subagents.js.map +1 -0
- package/dist/agent-runtime/src/subscription-wake-event.d.ts +111 -0
- package/dist/agent-runtime/src/thread-extras.d.ts +43 -0
- package/dist/agent-runtime/src/thread-handoff.d.ts +364 -0
- package/dist/agent-runtime/src/thread-prewarm-controller.d.ts +76 -0
- package/dist/agent-runtime/src/thread-prewarm.d.ts +118 -0
- package/dist/agent-runtime/src/thread-snapshot-cache.d.ts +99 -0
- package/dist/agent-runtime/src/thread-snapshot-mirror.cjs +329 -0
- package/dist/agent-runtime/src/thread-snapshot-mirror.cjs.map +1 -0
- package/dist/agent-runtime/src/thread-snapshot-mirror.d.ts +101 -0
- package/dist/agent-runtime/src/thread-snapshot-mirror.js +329 -0
- package/dist/agent-runtime/src/thread-snapshot-mirror.js.map +1 -0
- package/dist/agent-runtime/src/thread-status.d.ts +53 -0
- package/dist/agent-runtime/src/tool-metadata.d.ts +146 -0
- package/dist/agent-runtime/src/tool-names.cjs +67 -0
- package/dist/agent-runtime/src/tool-names.cjs.map +1 -1
- package/dist/agent-runtime/src/tool-names.d.ts +60 -0
- package/dist/agent-runtime/src/tool-names.js +68 -1
- package/dist/agent-runtime/src/tool-names.js.map +1 -1
- package/dist/agent-runtime/src/tool-outputs.d.ts +35 -0
- package/dist/agent-runtime/src/tool-result.cjs +1 -0
- package/dist/agent-runtime/src/tool-result.cjs.map +1 -1
- package/dist/agent-runtime/src/tool-result.d.ts +126 -0
- package/dist/agent-runtime/src/tool-result.js +1 -0
- package/dist/agent-runtime/src/tool-result.js.map +1 -1
- package/dist/agent-runtime/src/types.d.ts +159 -0
- package/dist/agent-runtime/src/use-conversation-list.d.ts +76 -0
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs +136 -0
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.cjs.map +1 -0
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.d.ts +64 -0
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js +136 -0
- package/dist/agent-runtime/src/use-deep-agent-chat-outbox.js.map +1 -0
- package/dist/agent-runtime/src/use-deep-agent-config.d.ts +169 -0
- package/dist/agent-runtime/src/use-deep-agent-edit-submit.cjs +13 -0
- package/dist/agent-runtime/src/use-deep-agent-edit-submit.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-edit-submit.d.ts +22 -0
- package/dist/agent-runtime/src/use-deep-agent-edit-submit.js +13 -0
- package/dist/agent-runtime/src/use-deep-agent-edit-submit.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-runtime.cjs +20 -2
- package/dist/agent-runtime/src/use-deep-agent-runtime.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-runtime.d.ts +168 -0
- package/dist/agent-runtime/src/use-deep-agent-runtime.js +20 -2
- package/dist/agent-runtime/src/use-deep-agent-runtime.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-thread.cjs +12 -4
- package/dist/agent-runtime/src/use-deep-agent-thread.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-thread.d.ts +320 -0
- package/dist/agent-runtime/src/use-deep-agent-thread.js +12 -4
- package/dist/agent-runtime/src/use-deep-agent-thread.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-voice.cjs +999 -0
- package/dist/agent-runtime/src/use-deep-agent-voice.cjs.map +1 -0
- package/dist/agent-runtime/src/use-deep-agent-voice.d.ts +409 -0
- package/dist/agent-runtime/src/use-deep-agent-voice.js +999 -0
- package/dist/agent-runtime/src/use-deep-agent-voice.js.map +1 -0
- package/dist/agent-runtime/src/use-deep-agent-window-sync.d.ts +102 -0
- package/dist/agent-runtime/src/use-historical-edit-attachments.d.ts +2 -0
- package/dist/agent-runtime/src/use-thread-handoff-flow.d.ts +84 -0
- package/dist/agent-runtime/src/voice-presentation.d.ts +80 -0
- package/dist/agent-runtime/src/voice-turn-grouping.d.ts +28 -0
- package/dist/agent-runtime/src/voice-wire-types.d.ts +15 -0
- package/dist/agent-runtime/src/withdrawn-turns.d.ts +97 -0
- package/dist/chat/AthenaChat.cjs +77 -6
- package/dist/chat/AthenaChat.cjs.map +1 -1
- package/dist/chat/AthenaChat.js +78 -7
- package/dist/chat/AthenaChat.js.map +1 -1
- package/dist/chat/StatewireApprovalCard.d.ts +1 -1
- package/dist/chat/StatewireClientToolBridge.d.ts +1 -1
- package/dist/chat/StatewireQueuedMessages.cjs +11 -4
- package/dist/chat/StatewireQueuedMessages.cjs.map +1 -1
- package/dist/chat/StatewireQueuedMessages.d.ts +1 -1
- package/dist/chat/StatewireQueuedMessages.js +11 -4
- package/dist/chat/StatewireQueuedMessages.js.map +1 -1
- package/dist/chat/chat-outbox-rows.cjs +223 -0
- package/dist/chat/chat-outbox-rows.cjs.map +1 -0
- package/dist/chat/chat-outbox-rows.d.ts +29 -0
- package/dist/chat/chat-outbox-rows.js +223 -0
- package/dist/chat/chat-outbox-rows.js.map +1 -0
- package/dist/chat/statewire-approval.d.ts +1 -1
- package/dist/chat/statewire-client-tools.d.ts +1 -1
- package/dist/chat/super-grouping/SuperGroupingCard.cjs +3 -1
- package/dist/chat/super-grouping/SuperGroupingCard.cjs.map +1 -1
- package/dist/chat/super-grouping/SuperGroupingCard.d.ts +7 -1
- package/dist/chat/super-grouping/SuperGroupingCard.js +3 -1
- package/dist/chat/super-grouping/SuperGroupingCard.js.map +1 -1
- package/dist/chat/super-grouping/SuperGroupingTranscript.cjs +7 -2
- package/dist/chat/super-grouping/SuperGroupingTranscript.cjs.map +1 -1
- package/dist/chat/super-grouping/SuperGroupingTranscript.d.ts +2 -2
- package/dist/chat/super-grouping/SuperGroupingTranscript.js +7 -2
- package/dist/chat/super-grouping/SuperGroupingTranscript.js.map +1 -1
- package/dist/chat/super-grouping/activity-timeline.cjs +19 -11
- package/dist/chat/super-grouping/activity-timeline.cjs.map +1 -1
- package/dist/chat/super-grouping/activity-timeline.d.ts +25 -9
- package/dist/chat/super-grouping/activity-timeline.js +19 -11
- package/dist/chat/super-grouping/activity-timeline.js.map +1 -1
- package/dist/chat/use-statewire-approval-request.cjs +36 -0
- package/dist/chat/use-statewire-approval-request.cjs.map +1 -1
- package/dist/chat/use-statewire-approval-request.d.ts +49 -1
- package/dist/chat/use-statewire-approval-request.js +39 -3
- package/dist/chat/use-statewire-approval-request.js.map +1 -1
- package/dist/chat-ui/composer/tiptap-composer.cjs +102 -3
- package/dist/chat-ui/composer/tiptap-composer.cjs.map +1 -1
- package/dist/chat-ui/composer/tiptap-composer.d.ts +32 -1
- package/dist/chat-ui/composer/tiptap-composer.js +103 -4
- package/dist/chat-ui/composer/tiptap-composer.js.map +1 -1
- package/dist/chat-ui/header/conversation-history-panel.d.ts +1 -1
- package/dist/chat-ui/index.d.ts +1 -1
- package/dist/chat-ui/messages/message-components.cjs +15 -0
- package/dist/chat-ui/messages/message-components.cjs.map +1 -1
- package/dist/chat-ui/messages/message-components.js +15 -0
- package/dist/chat-ui/messages/message-components.js.map +1 -1
- package/dist/chat-ui/messages/runtime-message.d.ts +1 -1
- package/dist/chat-ui/messages/statewire-continue-run.d.ts +1 -1
- package/dist/chat-ui/messages/user-edit-composer.cjs +15 -2
- package/dist/chat-ui/messages/user-edit-composer.cjs.map +1 -1
- package/dist/chat-ui/messages/user-edit-composer.d.ts +4 -2
- package/dist/chat-ui/messages/user-edit-composer.js +15 -2
- package/dist/chat-ui/messages/user-edit-composer.js.map +1 -1
- package/dist/chat-ui/messages/wake-marker.d.ts +1 -1
- package/dist/chat-ui/rich-text/chat-text-schema.cjs +1 -0
- package/dist/chat-ui/rich-text/chat-text-schema.cjs.map +1 -1
- package/dist/chat-ui/rich-text/chat-text-schema.d.ts +3 -0
- package/dist/chat-ui/rich-text/chat-text-schema.js +1 -0
- package/dist/chat-ui/rich-text/chat-text-schema.js.map +1 -1
- package/dist/chat-ui/statewire.cjs +1 -0
- package/dist/chat-ui/statewire.cjs.map +1 -1
- package/dist/chat-ui/statewire.d.ts +2 -2
- package/dist/chat-ui/statewire.js +2 -1
- package/dist/chat-ui/thread/statewire-history-edge.d.ts +1 -1
- package/dist/composer/AttachmentContext.cjs +8 -4
- package/dist/composer/AttachmentContext.cjs.map +1 -1
- package/dist/composer/AttachmentContext.d.ts +7 -0
- package/dist/composer/AttachmentContext.js +8 -4
- package/dist/composer/AttachmentContext.js.map +1 -1
- package/dist/composer/build-composed-message.cjs +34 -0
- package/dist/composer/build-composed-message.cjs.map +1 -1
- package/dist/composer/build-composed-message.d.ts +20 -0
- package/dist/composer/build-composed-message.js +35 -1
- package/dist/composer/build-composed-message.js.map +1 -1
- package/dist/composer/composer-handoff.cjs +39 -2
- package/dist/composer/composer-handoff.cjs.map +1 -1
- package/dist/composer/composer-handoff.d.ts +28 -3
- package/dist/composer/composer-handoff.js +39 -2
- package/dist/composer/composer-handoff.js.map +1 -1
- package/dist/composer/useAttachFiles.cjs +15 -2
- package/dist/composer/useAttachFiles.cjs.map +1 -1
- package/dist/composer/useAttachFiles.d.ts +11 -0
- package/dist/composer/useAttachFiles.js +15 -2
- package/dist/composer/useAttachFiles.js.map +1 -1
- package/dist/composer/useSendMessage.cjs.map +1 -1
- package/dist/composer/useSendMessage.d.ts +4 -3
- package/dist/composer/useSendMessage.js.map +1 -1
- package/dist/diagnostics/athena-diagnostics.cjs.map +1 -1
- package/dist/diagnostics/athena-diagnostics.d.ts +3 -1
- package/dist/diagnostics/athena-diagnostics.js.map +1 -1
- package/dist/index.cjs +18 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +15 -6
- package/dist/index.js +19 -1
- package/dist/index.js.map +1 -1
- package/dist/offline/chat-outbox.cjs +57 -0
- package/dist/offline/chat-outbox.cjs.map +1 -0
- package/dist/offline/chat-outbox.d.ts +80 -0
- package/dist/offline/chat-outbox.js +57 -0
- package/dist/offline/chat-outbox.js.map +1 -0
- package/dist/offline/offline-history.cjs +77 -0
- package/dist/offline/offline-history.cjs.map +1 -0
- package/dist/offline/offline-history.d.ts +60 -0
- package/dist/offline/offline-history.js +77 -0
- package/dist/offline/offline-history.js.map +1 -0
- package/dist/provider/AthenaProvider.cjs +206 -9
- package/dist/provider/AthenaProvider.cjs.map +1 -1
- package/dist/provider/AthenaProvider.d.ts +22 -1
- package/dist/provider/AthenaProvider.js +207 -10
- package/dist/provider/AthenaProvider.js.map +1 -1
- package/dist/provider/statewire-window-context.d.ts +1 -1
- package/dist/react/package.json.cjs +1 -1
- package/dist/react/package.json.js +1 -1
- package/dist/references/src/anchors/file-line-range.d.ts +58 -0
- package/dist/references/src/anchors/format.d.ts +21 -0
- package/dist/references/src/anchors/message-anchors.d.ts +71 -0
- package/dist/references/src/anchors/parse.d.ts +8 -0
- package/dist/references/src/anchors/registry-contract.d.ts +24 -0
- package/dist/references/src/anchors/registry.d.ts +19 -0
- package/dist/references/src/anchors/schemas.d.ts +194 -0
- package/dist/references/src/anchors/serialize.d.ts +8 -0
- package/dist/references/src/anchors/time.d.ts +78 -0
- package/dist/references/src/anchors/types.d.ts +474 -0
- package/dist/references/src/asset-bounds.d.ts +27 -0
- package/dist/references/src/asset-links.d.ts +23 -0
- package/dist/references/src/asset-reference.d.ts +16 -0
- package/dist/references/src/formats/format-catalog.d.ts +79 -0
- package/dist/references/src/formats/markdown/parse-reference-markdown.d.ts +28 -0
- package/dist/references/src/formats/markdown/reference-display-name.d.ts +6 -0
- package/dist/references/src/formats/object/asset-object.d.ts +9 -0
- package/dist/references/src/formats/object/callable-object.d.ts +6 -0
- package/dist/references/src/formats/object/decode-reference-object-payload.d.ts +3 -0
- package/dist/references/src/formats/object/external-url-object.d.ts +9 -0
- package/dist/references/src/formats/object/group-object.d.ts +9 -0
- package/dist/references/src/formats/object/navigation-object.d.ts +9 -0
- package/dist/references/src/formats/object/parse-reference-object.d.ts +11 -0
- package/dist/references/src/formats/object/person-object.d.ts +9 -0
- package/dist/references/src/formats/uri/asset-mention-uri.d.ts +9 -0
- package/dist/references/src/formats/uri/asset-spaces-url.d.ts +9 -0
- package/dist/references/src/formats/uri/callable-mention-uris.d.ts +9 -0
- package/dist/references/src/formats/uri/detect-uri-wire.d.ts +9 -0
- package/dist/references/src/formats/uri/group-mention-uri.d.ts +12 -0
- package/dist/references/src/formats/uri/navigation-spaces-url.d.ts +14 -0
- package/dist/references/src/formats/uri/parse-reference-uri.d.ts +20 -0
- package/dist/references/src/formats/uri/person-mention-uri.d.ts +9 -0
- package/dist/references/src/formats/uri/template-placeholder.d.ts +12 -0
- package/dist/references/src/index.d.ts +47 -0
- package/dist/references/src/legacy/index.d.ts +14 -0
- package/dist/references/src/legacy/pre-reference-asset-url.d.ts +57 -0
- package/dist/references/src/legacy/pre-reference-citation-bridge.d.ts +22 -0
- package/dist/references/src/legacy/pre-reference-citation.d.ts +138 -0
- package/dist/references/src/legacy/pre-reference-external-url.d.ts +31 -0
- package/dist/references/src/legacy/pre-reference-format.d.ts +8 -0
- package/dist/references/src/legacy/pre-reference-mention.d.ts +27 -0
- package/dist/references/src/legacy/pre-reference-object.d.ts +8 -0
- package/dist/references/src/legacy/pre-reference-uri.d.ts +12 -0
- package/dist/references/src/legacy.d.ts +2 -0
- package/dist/references/src/mention-href-patterns.d.ts +19 -0
- package/dist/references/src/mention-node/index.d.ts +5 -0
- package/dist/references/src/mention-node/mention-node.d.ts +31 -0
- package/dist/references/src/mention-node/resolve-node-attrs.d.ts +27 -0
- package/dist/references/src/parse-reference.d.ts +23 -0
- package/dist/references/src/schemas.d.ts +463 -0
- package/dist/references/src/serialize-reference.d.ts +50 -0
- package/dist/references/src/sheet-name.d.ts +10 -0
- package/dist/references/src/tool-option-schemas.d.ts +597 -0
- package/dist/references/src/types.d.ts +125 -0
- package/dist/references/src/version-ref.d.ts +30 -0
- package/dist/runtime/statewire-lifecycle.d.ts +1 -1
- package/dist/runtime/statewire-model-lane.d.ts +1 -1
- package/dist/runtime/statewire-server-lane-context.d.ts +1 -1
- package/dist/runtime/statewire-session-key.cjs +7 -0
- package/dist/runtime/statewire-session-key.cjs.map +1 -1
- package/dist/runtime/statewire-session-key.d.ts +16 -0
- package/dist/runtime/statewire-session-key.js +8 -1
- package/dist/runtime/statewire-session-key.js.map +1 -1
- package/dist/runtime/statewire-session-lane.cjs +48 -0
- package/dist/runtime/statewire-session-lane.cjs.map +1 -0
- package/dist/runtime/statewire-session-lane.d.ts +29 -0
- package/dist/runtime/statewire-session-lane.js +48 -0
- package/dist/runtime/statewire-session-lane.js.map +1 -0
- package/dist/runtime/statewire-thread-config-lane.d.ts +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.cjs +16 -5
- package/dist/runtime/useAthenaStatewireRuntime.cjs.map +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.d.ts +15 -1
- package/dist/runtime/useAthenaStatewireRuntime.js +17 -6
- package/dist/runtime/useAthenaStatewireRuntime.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/threads/api.d.ts +1 -1
- package/dist/threads/conversation-list-fetcher.d.ts +1 -1
- package/dist/threads/index-triggered-refresh.cjs +164 -0
- package/dist/threads/index-triggered-refresh.cjs.map +1 -0
- package/dist/threads/index-triggered-refresh.d.ts +70 -0
- package/dist/threads/index-triggered-refresh.js +164 -0
- package/dist/threads/index-triggered-refresh.js.map +1 -0
- package/dist/threads/offline-session-list.cjs +75 -0
- package/dist/threads/offline-session-list.cjs.map +1 -0
- package/dist/threads/offline-session-list.d.ts +27 -0
- package/dist/threads/offline-session-list.js +75 -0
- package/dist/threads/offline-session-list.js.map +1 -0
- package/dist/threads/pull-request-display.d.ts +1 -1
- package/dist/threads/session-list-model.d.ts +1 -1
- package/dist/threads/session-list-tab-share.cjs +150 -0
- package/dist/threads/session-list-tab-share.cjs.map +1 -0
- package/dist/threads/session-list-tab-share.d.ts +73 -0
- package/dist/threads/session-list-tab-share.js +150 -0
- package/dist/threads/session-list-tab-share.js.map +1 -0
- package/dist/threads/session-row-parts.d.ts +1 -1
- package/dist/threads/sessions-query.d.ts +1 -1
- package/dist/threads/statewire-thread-list.cjs +105 -20
- package/dist/threads/statewire-thread-list.cjs.map +1 -1
- package/dist/threads/statewire-thread-list.d.ts +31 -3
- package/dist/threads/statewire-thread-list.js +107 -22
- package/dist/threads/statewire-thread-list.js.map +1 -1
- package/dist/threads/thread-prefetcher.d.ts +1 -1
- package/dist/threads/use-athena-session-attention.d.ts +1 -1
- package/dist/threads/use-athena-sessions.cjs +32 -22
- package/dist/threads/use-athena-sessions.cjs.map +1 -1
- package/dist/threads/use-athena-sessions.js +33 -23
- package/dist/threads/use-athena-sessions.js.map +1 -1
- package/dist/threads/use-rest-conversation-history.d.ts +1 -1
- package/dist/threads/use-statewire-conversation-history.d.ts +5 -5
- package/dist/tiptap-markdown-table/src/markdown-table-serializer.d.ts +56 -0
- package/dist/tools/NestedPtcMessages.cjs +14 -9
- package/dist/tools/NestedPtcMessages.cjs.map +1 -1
- package/dist/tools/NestedPtcMessages.d.ts +9 -0
- package/dist/tools/NestedPtcMessages.js +6 -1
- package/dist/tools/NestedPtcMessages.js.map +1 -1
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/primitives.d.ts +1 -1
- package/dist/tools/subagent-task-tool-ui.cjs +494 -0
- package/dist/tools/subagent-task-tool-ui.cjs.map +1 -0
- package/dist/tools/subagent-task-tool-ui.d.ts +109 -0
- package/dist/tools/subagent-task-tool-ui.js +494 -0
- package/dist/tools/subagent-task-tool-ui.js.map +1 -0
- package/dist/tools/tool-fallback.d.ts +1 -1
- package/dist/tools/tool-icons.d.ts +1 -1
- package/dist/tools/tool-summary.d.ts +1 -1
- package/dist/tools/tool-uis.cjs +4 -0
- package/dist/tools/tool-uis.cjs.map +1 -1
- package/dist/tools/tool-uis.js +4 -0
- package/dist/tools/tool-uis.js.map +1 -1
- package/dist/voice/chat.cjs +6 -0
- package/dist/voice/chat.cjs.map +1 -0
- package/dist/voice/chat.d.ts +2 -0
- package/dist/voice/chat.js +6 -0
- package/dist/voice/chat.js.map +1 -0
- package/dist/voice/livekit-join.cjs +119 -0
- package/dist/voice/livekit-join.cjs.map +1 -0
- package/dist/voice/livekit-join.d.ts +8 -0
- package/dist/voice/livekit-join.js +119 -0
- package/dist/voice/livekit-join.js.map +1 -0
- package/dist/voice/livekit.cjs +32 -0
- package/dist/voice/livekit.cjs.map +1 -0
- package/dist/voice/livekit.d.ts +80 -0
- package/dist/voice/livekit.js +32 -0
- package/dist/voice/livekit.js.map +1 -0
- package/package.json +20 -10
package/README.md
CHANGED
|
@@ -23,8 +23,11 @@ requires a compatible backend. Publication is temporarily withheld until product
|
|
|
23
23
|
and authorization tests pass and a compatible backend rollback release is
|
|
24
24
|
retained. The publish workflow requires a manual
|
|
25
25
|
`PRODUCTION_NATIVE_CONTEXT_AND_ROLLBACK_QUALIFIED` acknowledgement; dry runs
|
|
26
|
-
remain available.
|
|
27
|
-
|
|
26
|
+
remain available. Once a release is on npm, the computer starters
|
|
27
|
+
(`docker/athena-app`, `docker/default-vite`, `docker/kpmg-audit`) move to it
|
|
28
|
+
with `scripts/computer-starter-lockfiles.ts --react <version>`; their
|
|
29
|
+
`bunfig.toml` exempts only `@athenaintel/react` from the image's four-day
|
|
30
|
+
release-age gate. The qualification steps and gate removal condition are
|
|
28
31
|
in the [coordinated release runbook](../../docs/runbooks/coordinated-client-releases.md#public-native-context-publication-gate).
|
|
29
32
|
|
|
30
33
|
The SDK pins its assistant-ui runtime (`@assistant-ui/tap`, `store`, `core`,
|
|
@@ -60,7 +63,14 @@ export default defineConfig({
|
|
|
60
63
|
});
|
|
61
64
|
```
|
|
62
65
|
|
|
63
|
-
Then bump to the release you want
|
|
66
|
+
Then bump to the release you want. One exception comes first: if your app
|
|
67
|
+
depends on an assistant-ui package itself (say `@assistant-ui/react`, for
|
|
68
|
+
components of its own) and the new SDK pins the same assistant-ui stack as the
|
|
69
|
+
old one (compare the two versions' `dependencies`), keep `bun.lock`. Run only
|
|
70
|
+
the `bun add` line below and skip deleting anything. A from-scratch resolve
|
|
71
|
+
there can take newer `core` / `store` / `tap` patches through that package's
|
|
72
|
+
caret ranges, beside the SDK's exact pins; `resolve.dedupe` above still mounts
|
|
73
|
+
one instance at runtime. Otherwise, re-resolve from scratch.
|
|
64
74
|
Lockfile-preserving commands do not do it — `bun update` and
|
|
65
75
|
`bun install --force` keep the nested lockfile entries, and `bun remove` +
|
|
66
76
|
`bun add` (or deleting only `bun.lock`) rewrites the lockfile but bun leaves
|
|
@@ -235,7 +245,11 @@ A `getToken` resolver is called with `{ force: true }` right after the sync
|
|
|
235
245
|
host refuses a credential, so a caching getter must mint a fresh token then;
|
|
236
246
|
the persisted command lane is scoped to the signed-in user as well as the
|
|
237
247
|
host, so a shared browser never resends one user's pending sends under the
|
|
238
|
-
next user's token.
|
|
248
|
+
next user's token. While a sign-in provider above the chat is still loading
|
|
249
|
+
who is signed in (`AthenaAuthContext` with `isLoading: true` and no `user`
|
|
250
|
+
yet), the chat does not connect and stores nothing: it connects once, under
|
|
251
|
+
the signed-in user, when they are known, and sends made meanwhile wait for
|
|
252
|
+
that.
|
|
239
253
|
|
|
240
254
|
What the statewire transport wires up in `AthenaChat`:
|
|
241
255
|
|
|
@@ -276,8 +290,9 @@ What the statewire transport wires up in `AthenaChat`:
|
|
|
276
290
|
`SuperGroupingCard`, `SuperGroupingFinalText`, `CollapsibleGroup`, the
|
|
277
291
|
activity-timeline derivation, and the tool-based grouping function — with
|
|
278
292
|
slots for the host's text/tool renderers and controls (`renderHeaderActions`,
|
|
279
|
-
`renderRunningMeta`, `summaryDetails`, `waitingTools`, `
|
|
280
|
-
Olympus and the Chrome extension mount one card instead
|
|
293
|
+
`renderRunningMeta`, `summaryDetails`, `waitingTools`, `waitingToolCallIds`,
|
|
294
|
+
`expansionKey`), so Olympus and the Chrome extension mount one card instead
|
|
295
|
+
of copies.
|
|
281
296
|
- **In-repo hosts consume the package, not the source.** `@athenaintel/react`
|
|
282
297
|
is a workspace dependency of Olympus, the Chrome extension, and the Office
|
|
283
298
|
add-in, resolved through this package's `exports` to the built `dist/` (the
|
|
@@ -722,6 +737,44 @@ registry entries (`SESSION_WORKBENCH_TASKS_PANE`, …), the data hooks
|
|
|
722
737
|
(`deriveShellRows`, `filterShellRows`, `deriveTaskSteps`, `taskProgress`,
|
|
723
738
|
`workspaceComputers`) are exported for hosts composing their own.
|
|
724
739
|
|
|
740
|
+
## Chat voice media (`@athenaintel/react/voice/livekit`)
|
|
741
|
+
|
|
742
|
+
Hosts using the shared agent runtime can use the SDK's browser LiveKit adapter
|
|
743
|
+
for chat voice. The runtime owns the voice commands and transcript; the adapter
|
|
744
|
+
joins the authorized room, publishes the microphone and plays the agent audio.
|
|
745
|
+
Install the optional `livekit-client` peer before starting a session.
|
|
746
|
+
|
|
747
|
+
```tsx
|
|
748
|
+
import { useMemo, useRef } from 'react';
|
|
749
|
+
import { useAthenaChatVoice } from '@athenaintel/react/voice/chat';
|
|
750
|
+
import { createDeepAgentVoiceLiveKitAdapter } from '@athenaintel/react/voice/livekit';
|
|
751
|
+
|
|
752
|
+
function ChatVoice() {
|
|
753
|
+
const audioRef = useRef<HTMLAudioElement>(null);
|
|
754
|
+
const livekit = useMemo(
|
|
755
|
+
() => createDeepAgentVoiceLiveKitAdapter({ audioElement: () => audioRef.current }),
|
|
756
|
+
[],
|
|
757
|
+
);
|
|
758
|
+
const voice = useAthenaChatVoice({ transport: 'livekit', livekit });
|
|
759
|
+
const active = voice.phase === 'connecting' || voice.phase === 'live';
|
|
760
|
+
return <>
|
|
761
|
+
<audio ref={audioRef} autoPlay />
|
|
762
|
+
<button disabled={active} onClick={() => void voice.start()}>Start voice</button>
|
|
763
|
+
<button disabled={!active} onClick={voice.end}>End voice</button>
|
|
764
|
+
</>;
|
|
765
|
+
}
|
|
766
|
+
```
|
|
767
|
+
|
|
768
|
+
Use this inside the thread's runtime provider and start voice from a user
|
|
769
|
+
action. Importing the adapter leaves LiveKit unloaded until a room joins. The
|
|
770
|
+
default room releases the microphone device on mute and enables browser echo
|
|
771
|
+
cancellation, noise suppression and gain control. A host can supply its own
|
|
772
|
+
`roomFactory` when it needs a platform-specific room policy.
|
|
773
|
+
The SDK's shared runtime supplies cancellation: Stop or unmount releases a pending
|
|
774
|
+
join, ignores late audio and cleans up a microphone request that finishes
|
|
775
|
+
after the attempt ended. The host still applies its voice permission and
|
|
776
|
+
deployment gates before issuing room credentials.
|
|
777
|
+
|
|
725
778
|
## Voice Sessions (`@athenaintel/react/voice`)
|
|
726
779
|
|
|
727
780
|
`useAthenaVoiceSession` runs a real-time voice conversation with an Athena
|
|
@@ -807,6 +860,49 @@ Both use the same bearer / API key as session creation. The full recipe
|
|
|
807
860
|
template skill `voice-session-guide.md`. `createAthenaVoiceSession` is also
|
|
808
861
|
exported if you hold the bridge state yourself.
|
|
809
862
|
|
|
863
|
+
## What's new in 0.42.1
|
|
864
|
+
|
|
865
|
+
**A chat that mounts before your sign-in provider knows who is signed in no longer resends old commands, and no longer loses what was sent meanwhile.** The chat keeps each conversation's unconfirmed commands in this browser under the signed-in user, so a reload can resend them. A sign-in provider of your own that renders the chat while it is still loading (`AthenaAuthContext` with `isLoading: true`) put the conversation under an anonymous key first. When the user loaded, the conversation moved to their key and took the anonymous record's client id and command numbers with it, and the anonymous record stayed behind with the same id. Every later page load read that record first and resent its commands below the numbers Athena had already taken, so Athena refused them as expired. A message sent before the user loaded went into a conversation that could not keep it.
|
|
866
|
+
|
|
867
|
+
While the sign-in provider is loading and names no user yet, the chat now waits: it does not connect and stores nothing, and it connects once, under the signed-in user, as soon as they are known. A provider that refreshes while still naming its user keeps that user's conversation as it is. A message sent meanwhile (Enter in the composer, a dictated send, a suggestion, `useSendMessage`) waits and goes out then, and `useComposerReady()` reads `false` until then. `AthenaAuthProvider` and `AthenaSSOProvider` render the chat only once someone is signed in, so apps that use them are unaffected. Nothing to change in your app.
|
|
868
|
+
|
|
869
|
+
## What's new in 0.42.0
|
|
870
|
+
|
|
871
|
+
**Subagent cards.** When the agent delegates work to a subagent (a `task` call), `AthenaChat` shows the delegation as a card in the conversation, outside the turn's collapsed steps: what the subagent was asked to do, where it is (Queued, Running, Done, Failed, Stopped), how many tool calls it has made, how long it has run, and while it runs, the step it took last ("Read `routes.ts`"). A finished subagent shows the start of its report, and a failed one the start of why it failed; the card opens to the whole text, steps or none. Open the card to follow its steps live: they render read-only with the chat's own tool cards, and a delegation inside a subagent's steps shows as one row. The card is `SubagentTaskToolUI`, registered as `task` in `TOOL_UI_REGISTRY`, so an app that spreads the registry into `toolUIs` gets it too.
|
|
872
|
+
|
|
873
|
+
**Load earlier steps.** Athena sends a running subagent's card with only its newest steps. An open card says how many it shows ("Showing the latest 8 of 42 steps.") and "Load earlier steps" reads the rest, a page at a time, over the conversation's own connection (the read-only `history/lane` command, sent only when asked). Pass `subagentLaneHistory` to `AthenaProvider` when every `task` call your chat shows renders in this card (`AthenaChat` with the registry's `task`): the provider then tells Athena that its chat pages subagent steps (deep-agent protocol 2), so a finished subagent's card also arrives with only its newest steps and a long fan-out loads lighter. It is off by default, so finished subagents arrive whole until you opt in. Against an Athena that cannot page a running subagent, the card says instead that the earlier steps arrive when the subagent finishes.
|
|
874
|
+
|
|
875
|
+
**A subagent waiting for approval says so.** When a gated tool a subagent calls (or the delegation itself) waits on a person's approval, its card reads "Waiting for approval" and names what it waits on ("Needs approval to run `delete` …", or "Needs approval to start") instead of live activity, with no clock running. The turn's step for it reads "Waiting for your input", not running, so the turn header says "Waiting for you" and never "Nothing new". `AthenaChat` reads the run's approval once, the one the approval card shows, and passes the waiting steps to the collapsed view (`waitingToolCallIds`, 0.41.7). It only reads: the approval card is still what answers. For a chat of your own, `useStatewireApprovalWait()` returns the gated calls still waiting (`toolCallIds`) and whether the run is parked (`runParked`), and `useTurnToolCallsAwaitingApproval(toolCallIds)` the steps of the turn in scope they make wait, for `SuperGroupingCard` / `SuperGroupingTranscript`.
|
|
876
|
+
|
|
877
|
+
**If you render `task` yourself.** A `task` tool UI you pass in `toolUIs` keeps its place in the turn, and the SDK adds no subagent steps under it. Leave `subagentLaneHistory` off (the default) and finished subagents keep arriving whole, so a UI that reads every step off the card (`artifact.subgraph_state.messages`) still sees them all; a running subagent's card carries only its newest steps, as before. A chat of your own on `useAthenaStatewireRuntime` likewise declares the default contract unless you pass `subagentLaneHistory: true`. Each `task` tool-call part now carries its subagent's steps as `messages`, assistant-ui's nested-thread channel (`MessagePartPrimitive.Messages`, `thread.tasks`); `NestedPtcMessages` leaves them to the subagent card.
|
|
878
|
+
|
|
879
|
+
## What's new in 0.41.7
|
|
880
|
+
|
|
881
|
+
**A step that is still running no longer reads as done when its turn stops streaming.** A long-running tool's step (a `task` subagent, Studio or Python execution, deep research) holds the backend's running placeholder until its real result arrives. When a run parks on an approval raised inside a subagent, nothing streams, so the turn's status reads complete, and the collapsed view checked the subagent's step off as done. A step whose only result is the running placeholder now reads as running whatever the turn's status says (`buildActivityTimeline`, `getActivityToolState`), and so does the card that holds it (`resolveActivityPhase`), which keeps its live tool details mounted.
|
|
882
|
+
|
|
883
|
+
**Hosts can name the steps a run is parked on.** `SuperGroupingCard` and `SuperGroupingTranscript` take `waitingToolCallIds` (and `buildActivityTimeline` the same option): the ids of the tool calls the run waits on a person for. Each one still without its real result reads "Waiting for your input", and the card reads "Waiting for you". Olympus passes the `task` call whose subagent is parked on an approval. Keep the set's identity stable while its ids do not change. Nothing to change in your app.
|
|
884
|
+
|
|
885
|
+
## What's new in 0.41.6
|
|
886
|
+
|
|
887
|
+
**A new session reaches the sidebar even when the first refresh is refused.** When the conversation index tells the list about a session it does not show yet, the list refreshes. That refresh used to run once per session: if it was refused (a rate limit, a network error, a deploy restart), the session stayed out of the sidebar until a reload. A refused refresh is now tried again, after 10 s and then 20 s, at most three times, so a session the list legitimately never shows (another app, a search) cannot loop. The same applies to `useAthenaSessions` lists (`SessionsPage`, `Inbox`).
|
|
888
|
+
|
|
889
|
+
**Fewer session-list reads per session change.** A session starting or changing used to make every open tab re-read each of its lists at once. Now:
|
|
890
|
+
|
|
891
|
+
- the refreshes one burst of index pushes calls for are gathered into one (about 0.75 s, at most 3 s), and none is sent while that list is already being read;
|
|
892
|
+
- tabs of the same user and workspace share what they read over a `BroadcastChannel`. One tab claims a list and reads it, and the others take its page instead of reading it themselves. A background tab waits a little longer, so the visible tab is usually the one that reads. If the shared page never arrives, each tab reads for itself after 5 s.
|
|
893
|
+
|
|
894
|
+
Without `BroadcastChannel`, or before the signed-in user and workspace are known, each tab reads for itself, as before. Nothing to change in your app.
|
|
895
|
+
|
|
896
|
+
## What's new in 0.41.4
|
|
897
|
+
|
|
898
|
+
**Text typed after a link stays plain.** Tiptap's Link is inclusive whenever autolink is on, so in the composer a space and the words typed after a pasted (or autolinked) URL joined the link and were sent as part of it. The chat link mark is no longer inclusive: the URL keeps its link and whatever is typed at its end is ordinary text.
|
|
899
|
+
|
|
900
|
+
## What's new in 0.41.3
|
|
901
|
+
|
|
902
|
+
**A pinned session stays in the sidebar.** The session list reads the newest 50 sessions, and its Pinned group was built from that page alone, so a session pinned long ago left the sidebar once 50 newer sessions existed (on staging, four pinned sessions became three when two new sessions started). The provider now also reads the viewer's pinned sessions on their own (`favorites_only`, under the same app scope and search, every page of them up to 500) and adds the ones the page does not list to the Pinned group. Unpinning such a session takes it out of the sidebar, since it is not one of the newest. Nothing to change in your app.
|
|
903
|
+
|
|
904
|
+
**"Completed with issues" means the turn ended on a problem.** A finished turn's collapsed card said "Completed with issues" when any tool call in it had failed, so a long run that opened its pull request after a few failed reads or commands read as a failure. It now says so only when the turn ended on a failed call (no later call completed) or held a call the person refused; otherwise it reads `Used N tools`. `getActivitySummary` follows the same rule.
|
|
905
|
+
|
|
810
906
|
## What's new in 0.41.2
|
|
811
907
|
|
|
812
908
|
**A session opened while its run is streaming shows, and keeps, its own model.** `useAthenaThreadModel()` could report `ready` with no model before the session's snapshot had arrived. On a session whose run was streaming, the connection reported `connected` before the attach snapshot applied, and the SDK took the placeholder the thread shows meanwhile, which holds no server config, as what the server sent. A picker seeded from it showed the agent's default model, and the provider then wrote that pick to the session (`config/patch {model: null}`), so the session lost its model for its next turns. `ready`, and every config write the provider decides, now wait for a state the server sent: the placeholder and a remembered snapshot never count, whenever the connection reports `connected`. The `statewire.attach` diagnostics span (time to the session's snapshot) now ends when that snapshot arrives, not when the thread first renders.
|
|
@@ -2045,6 +2141,8 @@ The transcript is `SuperGroupingTranscript` from `@athenaintel/react/super-group
|
|
|
2045
2141
|
|
|
2046
2142
|
Every step row and every thread tool card reads one summary registry, `summarizeToolCall({ toolName, args, result, status })` → `{ label, detail?, meta?, code? }` (also on `@athenaintel/react/tools`). It has rules for the deep agent's core tools (`execute`, the workspace file tools, `search_assets`, the computer and GitHub tools, web search and browse, `read_asset`, `write_todos`, `task`, and the UI Testing toolkit's `test_recording_start` / `_mark` / `_stop`); other tools read the shared display registry, and a tool neither knows falls back to a host catalog name (`resolveToolDisplayName`), else its sentence-cased name. A call that targets a machine or document by id (`sandbox_asset_id`, `computer_asset_id`) is named by its title when an earlier result in the turn carried one (`collectAssetTitles`); nothing is fetched.
|
|
2047
2143
|
|
|
2144
|
+
A delegation to a subagent (`task`) stays in the conversation, as an email draft or a UI test report does: the subagent card, with its state, tool calls, clock and newest step, and its steps behind its disclosure (see [What's new in 0.42.0](#whats-new-in-0420)).
|
|
2145
|
+
|
|
2048
2146
|
Every tool call it renders — the generic `ToolFallback`, the built-in tool UIs, nested sub-calls — shares one row anatomy: a status glyph (spinner / check / x / alert), the verb and its target on one line, a running call's elapsed seconds after three, a failed call tinted red, and a disclosure for the arguments and result.
|
|
2049
2147
|
|
|
2050
2148
|
That row is the `thread` appearance of `ToolFallback`. Hosts that render their own thread keep the boxed host card they render today (the default, `card`); to adopt the row, wrap the thread in the provider or set it per card:
|
|
@@ -2110,9 +2208,10 @@ function MeetingCard({ block }: { block: string }) {
|
|
|
2110
2208
|
|
|
2111
2209
|
Both hooks are safe to call at any time. A write made before the chat is
|
|
2112
2210
|
ready — with `enableThreadList`, while the list is still resolving the active
|
|
2113
|
-
thread,
|
|
2114
|
-
|
|
2115
|
-
|
|
2211
|
+
thread, while the thread's history is still loading, or while a sign-in
|
|
2212
|
+
provider above the chat is still loading who is signed in — waits in the
|
|
2213
|
+
provider and lands once the composer is ready, instead of being lost with the
|
|
2214
|
+
mount it was written into (the provider keys its statewire subtree by thread). Readiness
|
|
2116
2215
|
is not the socket: a never-started chat sits in `standby` until its first send
|
|
2117
2216
|
and still takes a prefill. Early writes keep their order (two early sends both
|
|
2118
2217
|
go out, first then second; adjacent plain appends fold into one draft), and
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { Attachment, AttachmentAdapter, CompleteAttachment, PendingAttachment } from '@assistant-ui/core';
|
|
2
|
+
/**
|
|
3
|
+
* Shared Athena asset-attachment choreography (issue #29088): upload the file
|
|
4
|
+
* as a normal Athena asset, insert its final mention into the host composer,
|
|
5
|
+
* and yield no assistant-ui attachment tile — the deep-agent backend resolves
|
|
6
|
+
* the mention (documents via read_asset, images inlined server-side), so no
|
|
7
|
+
* duplicate base64 part ever enters statewire. No preparation state rides the
|
|
8
|
+
* wire: readiness is local to the composer doing the attaching.
|
|
9
|
+
*/
|
|
10
|
+
export interface UploadedChatAsset {
|
|
11
|
+
id: string;
|
|
12
|
+
title: string;
|
|
13
|
+
assetType: string;
|
|
14
|
+
}
|
|
15
|
+
/** Composer mention-insertion hook. The source file stays local to the client
|
|
16
|
+
* and lets rich composers show a preview without putting image bytes on the
|
|
17
|
+
* statewire. The return value is awaited when it is a promise and otherwise
|
|
18
|
+
* ignored, so ordinary event-handler arrows fit. */
|
|
19
|
+
export type ChatAssetMentionHandler = (asset: UploadedChatAsset, sourceFile?: File) => unknown;
|
|
20
|
+
/**
|
|
21
|
+
* Register the composer's mention-insertion hook for one thread. The hook is
|
|
22
|
+
* the per-client seam — TipTap on web, the native editor bridge on mobile —
|
|
23
|
+
* and the identity-checked unregister keeps a stale composer from clobbering
|
|
24
|
+
* a newer registration.
|
|
25
|
+
*/
|
|
26
|
+
export declare function registerChatAssetMentionHandler(threadId: string, handler: ChatAssetMentionHandler): () => void;
|
|
27
|
+
export declare function getChatAssetMentionHandler(threadId: string): ChatAssetMentionHandler | undefined;
|
|
28
|
+
export interface ChatAssetUploadResponse {
|
|
29
|
+
success?: Array<{
|
|
30
|
+
id?: unknown;
|
|
31
|
+
title?: unknown;
|
|
32
|
+
file_name?: unknown;
|
|
33
|
+
athena_original_type?: unknown;
|
|
34
|
+
}>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Map agora's `/api/upload/` response to the mention payload. Title falls
|
|
38
|
+
* back `title → file_name → local file name`; the asset type falls back to
|
|
39
|
+
* the caller's sniffed default when the row carries none.
|
|
40
|
+
*/
|
|
41
|
+
export declare function uploadedChatAsset(args: {
|
|
42
|
+
body: ChatAssetUploadResponse;
|
|
43
|
+
fallbackTitle: string;
|
|
44
|
+
fallbackAssetType: string;
|
|
45
|
+
}): UploadedChatAsset;
|
|
46
|
+
/** The local default when the upload response carries no asset type. */
|
|
47
|
+
export declare function sniffAssetTypeForFile(file: {
|
|
48
|
+
type: string;
|
|
49
|
+
}): string;
|
|
50
|
+
export interface UploadChatAssetOptions {
|
|
51
|
+
/** Agora base URL (trailing slashes tolerated). */
|
|
52
|
+
baseUrl: string;
|
|
53
|
+
file: File;
|
|
54
|
+
/** Auth headers for the upload request. */
|
|
55
|
+
headers: () => Promise<Record<string, string>> | Record<string, string>;
|
|
56
|
+
/**
|
|
57
|
+
* Fresh headers for exactly one retry after a 401 (e.g. a force-renewed
|
|
58
|
+
* token). Omitted, a 401 fails like any other error status.
|
|
59
|
+
*/
|
|
60
|
+
retryHeadersOn401?: () => Promise<Record<string, string>> | Record<string, string>;
|
|
61
|
+
/** Upload timeout; the request aborts (and the add() rejects) past it. */
|
|
62
|
+
timeoutMs?: number;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Upload one file as an Athena asset through agora's `/api/upload/`.
|
|
66
|
+
* Cancellation and the timeout live inside the adapter path by construction:
|
|
67
|
+
* the abort signal rejects the `add()` generator, so the composer's send
|
|
68
|
+
* (which awaits adapter completion) can never race a hung upload.
|
|
69
|
+
*/
|
|
70
|
+
export declare function uploadChatAsset(options: UploadChatAssetOptions): Promise<UploadedChatAsset>;
|
|
71
|
+
export interface AthenaAssetAttachmentAdapterOptions {
|
|
72
|
+
threadId: string;
|
|
73
|
+
/** File-picker filter; defaults to images (the deep-agent mention path). */
|
|
74
|
+
accept?: string;
|
|
75
|
+
/** Platform upload transport; most hosts wrap {@link uploadChatAsset}. */
|
|
76
|
+
upload: (file: File) => Promise<UploadedChatAsset>;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* The shared mention-backed attachment adapter: `add()` requires the thread's
|
|
80
|
+
* registered composer hook up front (no upload cost when the composer is
|
|
81
|
+
* gone), uploads, then inserts the mention into the thread's CURRENT hook —
|
|
82
|
+
* a same-thread composer remount mid-upload still receives the mention, and
|
|
83
|
+
* the thread-keyed registry makes cross-thread insertion impossible by
|
|
84
|
+
* construction. A thread whose hook is gone after the upload rejects with a
|
|
85
|
+
* visible error (the conversation closed; the user must re-attach).
|
|
86
|
+
* `send()` throws by contract: mention-backed attachments are never message
|
|
87
|
+
* parts.
|
|
88
|
+
*/
|
|
89
|
+
export declare class AthenaAssetAttachmentAdapter implements AttachmentAdapter {
|
|
90
|
+
private readonly options;
|
|
91
|
+
readonly accept: string;
|
|
92
|
+
constructor(options: AthenaAssetAttachmentAdapterOptions);
|
|
93
|
+
add(args: {
|
|
94
|
+
file: File;
|
|
95
|
+
}): AsyncGenerator<PendingAttachment, void>;
|
|
96
|
+
remove(_attachment: Attachment): Promise<void>;
|
|
97
|
+
send(_attachment: PendingAttachment): Promise<CompleteAttachment>;
|
|
98
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { UploadedChatAsset } from "./asset-attachment";
|
|
2
|
+
/**
|
|
3
|
+
* Cross-surface drag payload for an Athena asset. Olympus sets it when a
|
|
4
|
+
* Spaces tab or sidebar row starts a native drag so a composer in another
|
|
5
|
+
* document (the Chrome extension side panel, an embedded SDK chat) can insert
|
|
6
|
+
* an asset mention instead of the drag's incidental text.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ATHENA_ASSET_DRAG_MIME = "application/x-athena-asset+json";
|
|
9
|
+
/** Olympus's FlexLayout tab drags carry the tab's asset id under this type. */
|
|
10
|
+
export declare const FLEXLAYOUT_TAB_DRAG_MIME = "application/x-flexlayout-tab";
|
|
11
|
+
/** The `text/plain` value FlexLayout writes on every tab drag. */
|
|
12
|
+
export declare const FLEXLAYOUT_DRAG_TEXT_SENTINEL = "--flexlayout--";
|
|
13
|
+
/** The `DataTransfer` surface read here (agent-runtime has no DOM lib). */
|
|
14
|
+
interface DragData {
|
|
15
|
+
getData(format: string): string;
|
|
16
|
+
}
|
|
17
|
+
export declare function serializeAthenaAssetDrag(asset: UploadedChatAsset): string;
|
|
18
|
+
/** Whether a drag carries an Athena asset — readable during `dragover`. */
|
|
19
|
+
export declare function isAthenaAssetDrag(types: Iterable<string>): boolean;
|
|
20
|
+
export type AthenaAssetDrop = {
|
|
21
|
+
kind: "asset";
|
|
22
|
+
asset: UploadedChatAsset;
|
|
23
|
+
}
|
|
24
|
+
/** An Athena asset drag whose metadata did not travel — swallow it rather
|
|
25
|
+
* than let the editor paste the sentinel text. */
|
|
26
|
+
| {
|
|
27
|
+
kind: "unresolved";
|
|
28
|
+
assetId: string | null;
|
|
29
|
+
} | null;
|
|
30
|
+
/** Reads an Athena asset from a drop, or `null` when the drop is not one. */
|
|
31
|
+
export declare function readAthenaAssetDrop(dataTransfer: DragData): AthenaAssetDrop;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { DeepAgentConnectionState } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* How many consecutive `unauthorized` attach denials park the transport.
|
|
4
|
+
*
|
|
5
|
+
* The client's reconnect backoff reaches its 30s ceiling around the eighth
|
|
6
|
+
* attempt, so eight denials ≈ one minute of the server actively refusing the
|
|
7
|
+
* credential. Transient auth blips (a tab waking with a stale token that
|
|
8
|
+
* refreshes on the next attempt) recover in one or two attempts and never
|
|
9
|
+
* park; a credential the server keeps refusing (revoked access, no workspace)
|
|
10
|
+
* would otherwise retry every 30s indefinitely — the prod "attach denied"
|
|
11
|
+
* loops ran for hours per tab.
|
|
12
|
+
*/
|
|
13
|
+
export declare const AUTH_DENIAL_PARK_THRESHOLD = 8;
|
|
14
|
+
export interface AuthDenialTrackerState {
|
|
15
|
+
/** Reconnect attempt number of the last counted denial (dedupes converter re-runs). */
|
|
16
|
+
lastAttempt: number | null;
|
|
17
|
+
/** Consecutive `unauthorized` denials observed on this attach. */
|
|
18
|
+
consecutive: number;
|
|
19
|
+
/** The denial's host-supplied message, kept for the parked connection state. */
|
|
20
|
+
message: string | undefined;
|
|
21
|
+
}
|
|
22
|
+
export declare const initialAuthDenialTrackerState: () => AuthDenialTrackerState;
|
|
23
|
+
/** Count distinct unauthorized retries, preserving the streak during each dial. */
|
|
24
|
+
export declare function observeAuthDenial(state: AuthDenialTrackerState, connection: DeepAgentConnectionState, { threshold }?: {
|
|
25
|
+
threshold?: number;
|
|
26
|
+
}): {
|
|
27
|
+
state: AuthDenialTrackerState;
|
|
28
|
+
park: boolean;
|
|
29
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
function chatOutboxAttachmentPath(assetId) {
|
|
4
|
+
return `/api/v0/assets/${encodeURIComponent(assetId)}`;
|
|
5
|
+
}
|
|
6
|
+
function isRecord(value) {
|
|
7
|
+
return typeof value === "object" && value !== null;
|
|
8
|
+
}
|
|
9
|
+
async function verdictOf(response) {
|
|
10
|
+
if (response.status === 403 || response.status === 404) return "refused";
|
|
11
|
+
if (response.status < 200 || response.status >= 300) return "unknown";
|
|
12
|
+
let body;
|
|
13
|
+
try {
|
|
14
|
+
body = await response.json();
|
|
15
|
+
} catch {
|
|
16
|
+
return "unknown";
|
|
17
|
+
}
|
|
18
|
+
if (!isRecord(body)) return "unknown";
|
|
19
|
+
return body.is_archived === true ? "refused" : "ok";
|
|
20
|
+
}
|
|
21
|
+
function createChatOutboxAttachmentCheck({
|
|
22
|
+
readAsset
|
|
23
|
+
}) {
|
|
24
|
+
return async (attachments) => {
|
|
25
|
+
let unknown = false;
|
|
26
|
+
for (const assetId of new Set(attachments.map((attachment) => attachment.assetId))) {
|
|
27
|
+
let verdict;
|
|
28
|
+
try {
|
|
29
|
+
verdict = await verdictOf(await readAsset(assetId));
|
|
30
|
+
} catch {
|
|
31
|
+
verdict = "unknown";
|
|
32
|
+
}
|
|
33
|
+
if (verdict === "refused") return "refused";
|
|
34
|
+
if (verdict === "unknown") unknown = true;
|
|
35
|
+
}
|
|
36
|
+
return unknown ? "unknown" : "ok";
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
exports.chatOutboxAttachmentPath = chatOutboxAttachmentPath;
|
|
40
|
+
exports.createChatOutboxAttachmentCheck = createChatOutboxAttachmentCheck;
|
|
41
|
+
//# sourceMappingURL=chat-outbox-attachments.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-outbox-attachments.cjs","sources":["../../../../agent-runtime/src/chat-outbox-attachments.ts"],"sourcesContent":["import type { ChatOutboxAttachment } from \"./chat-outbox-store\";\n\n/**\n * Whether a waiting message's attachments can still be opened, asked of Athena right before the\n * message goes (`chat-outbox.ts`). A held message carries only files that had finished uploading\n * before Athena went out of reach, but one may be deleted, or stop being shared with the person,\n * while it waits: the message must not go with a reference Athena no longer lets them open.\n *\n * Each file is read through agora's permission-checked `GET /api/v0/assets/{id}`\n * (`get_asset_access_context_or_http`: `get_asset_with_permission_check` in the asset's workspace)\n * as the signed-in person. Nothing here grants anything: the run reads every attachment through\n * the same gates again when it uses it.\n */\n\n/** What Athena answered about a waiting message's attachments. */\nexport type ChatOutboxAttachmentVerdict =\n /** Every one is still there and still the person's to open. */\n | \"ok\"\n /** At least one is gone (deleted, or in the trash) or no longer the person's to open. */\n | \"refused\"\n /** Athena could not say: a read failed, timed out, or its credential was refused. */\n | \"unknown\";\n\n/** Asks Athena about a waiting message's attachments. */\nexport type ChatOutboxAttachmentCheck = (\n attachments: readonly ChatOutboxAttachment[],\n) => Promise<ChatOutboxAttachmentVerdict>;\n\n/** agora's permission-checked read of one asset, relative to its API base. */\nexport function chatOutboxAttachmentPath(assetId: string): string {\n return `/api/v0/assets/${encodeURIComponent(assetId)}`;\n}\n\n/** As much of a `fetch` response as the check reads. */\nexport interface ChatOutboxAssetReadResponse {\n status: number;\n json(): Promise<unknown>;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null;\n}\n\nasync function verdictOf(response: ChatOutboxAssetReadResponse): Promise<ChatOutboxAttachmentVerdict> {\n // 404: the asset is gone (or never was); 403: it is no longer the person's to open.\n if (response.status === 403 || response.status === 404) return \"refused\";\n if (response.status < 200 || response.status >= 300) return \"unknown\";\n // A body that does not read (cut off, or not agora's JSON) never says whether the file is in\n // the trash: that is no answer.\n let body: unknown;\n try {\n body = await response.json();\n } catch {\n return \"unknown\";\n }\n if (!isRecord(body)) return \"unknown\";\n // An archived asset is in the trash: deleted, as far as a message is concerned.\n return body.is_archived === true ? \"refused\" : \"ok\";\n}\n\n/**\n * The check a host hands its chat outbox: each attachment read once, in turn, through `readAsset`\n * (`GET {agora}{chatOutboxAttachmentPath(id)}` with the person's credential, renewed once on a\n * refused token where the host can, under the host's own request timeout). `refused` as soon as\n * one is refused; `unknown` when none was refused but one could not be read; else `ok`.\n */\nexport function createChatOutboxAttachmentCheck({\n readAsset,\n}: {\n readAsset: (assetId: string) => Promise<ChatOutboxAssetReadResponse>;\n}): ChatOutboxAttachmentCheck {\n return async (attachments) => {\n let unknown = false;\n for (const assetId of new Set(attachments.map((attachment) => attachment.assetId))) {\n let verdict: ChatOutboxAttachmentVerdict;\n try {\n verdict = await verdictOf(await readAsset(assetId));\n } catch {\n verdict = \"unknown\";\n }\n if (verdict === \"refused\") return \"refused\";\n if (verdict === \"unknown\") unknown = true;\n }\n return unknown ? \"unknown\" : \"ok\";\n };\n}\n"],"names":[],"mappings":";;AA6BO,SAAS,yBAAyB,SAAyB;AAChE,SAAO,kBAAkB,mBAAmB,OAAO,CAAC;AACtD;AAQA,SAAS,SAAS,OAAkD;AAClE,SAAO,OAAO,UAAU,YAAY,UAAU;AAChD;AAEA,eAAe,UAAU,UAA6E;AAEpG,MAAI,SAAS,WAAW,OAAO,SAAS,WAAW,IAAK,QAAO;AAC/D,MAAI,SAAS,SAAS,OAAO,SAAS,UAAU,IAAK,QAAO;AAG5D,MAAI;AACJ,MAAI;AACF,WAAO,MAAM,SAAS,KAAA;AAAA,EACxB,QAAQ;AACN,WAAO;AAAA,EACT;AACA,MAAI,CAAC,SAAS,IAAI,EAAG,QAAO;AAE5B,SAAO,KAAK,gBAAgB,OAAO,YAAY;AACjD;AAQO,SAAS,gCAAgC;AAAA,EAC9C;AACF,GAE8B;AAC5B,SAAO,OAAO,gBAAgB;AAC5B,QAAI,UAAU;AACd,eAAW,WAAW,IAAI,IAAI,YAAY,IAAI,CAAC,eAAe,WAAW,OAAO,CAAC,GAAG;AAClF,UAAI;AACJ,UAAI;AACF,kBAAU,MAAM,UAAU,MAAM,UAAU,OAAO,CAAC;AAAA,MACpD,QAAQ;AACN,kBAAU;AAAA,MACZ;AACA,UAAI,YAAY,UAAW,QAAO;AAClC,UAAI,YAAY,UAAW,WAAU;AAAA,IACvC;AACA,WAAO,UAAU,YAAY;AAAA,EAC/B;AACF;;;"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ChatOutboxAttachment } from "./chat-outbox-store";
|
|
2
|
+
/**
|
|
3
|
+
* Whether a waiting message's attachments can still be opened, asked of Athena right before the
|
|
4
|
+
* message goes (`chat-outbox.ts`). A held message carries only files that had finished uploading
|
|
5
|
+
* before Athena went out of reach, but one may be deleted, or stop being shared with the person,
|
|
6
|
+
* while it waits: the message must not go with a reference Athena no longer lets them open.
|
|
7
|
+
*
|
|
8
|
+
* Each file is read through agora's permission-checked `GET /api/v0/assets/{id}`
|
|
9
|
+
* (`get_asset_access_context_or_http`: `get_asset_with_permission_check` in the asset's workspace)
|
|
10
|
+
* as the signed-in person. Nothing here grants anything: the run reads every attachment through
|
|
11
|
+
* the same gates again when it uses it.
|
|
12
|
+
*/
|
|
13
|
+
/** What Athena answered about a waiting message's attachments. */
|
|
14
|
+
export type ChatOutboxAttachmentVerdict =
|
|
15
|
+
/** Every one is still there and still the person's to open. */
|
|
16
|
+
"ok"
|
|
17
|
+
/** At least one is gone (deleted, or in the trash) or no longer the person's to open. */
|
|
18
|
+
| "refused"
|
|
19
|
+
/** Athena could not say: a read failed, timed out, or its credential was refused. */
|
|
20
|
+
| "unknown";
|
|
21
|
+
/** Asks Athena about a waiting message's attachments. */
|
|
22
|
+
export type ChatOutboxAttachmentCheck = (attachments: readonly ChatOutboxAttachment[]) => Promise<ChatOutboxAttachmentVerdict>;
|
|
23
|
+
/** agora's permission-checked read of one asset, relative to its API base. */
|
|
24
|
+
export declare function chatOutboxAttachmentPath(assetId: string): string;
|
|
25
|
+
/** As much of a `fetch` response as the check reads. */
|
|
26
|
+
export interface ChatOutboxAssetReadResponse {
|
|
27
|
+
status: number;
|
|
28
|
+
json(): Promise<unknown>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The check a host hands its chat outbox: each attachment read once, in turn, through `readAsset`
|
|
32
|
+
* (`GET {agora}{chatOutboxAttachmentPath(id)}` with the person's credential, renewed once on a
|
|
33
|
+
* refused token where the host can, under the host's own request timeout). `refused` as soon as
|
|
34
|
+
* one is refused; `unknown` when none was refused but one could not be read; else `ok`.
|
|
35
|
+
*/
|
|
36
|
+
export declare function createChatOutboxAttachmentCheck({ readAsset, }: {
|
|
37
|
+
readAsset: (assetId: string) => Promise<ChatOutboxAssetReadResponse>;
|
|
38
|
+
}): ChatOutboxAttachmentCheck;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
function chatOutboxAttachmentPath(assetId) {
|
|
2
|
+
return `/api/v0/assets/${encodeURIComponent(assetId)}`;
|
|
3
|
+
}
|
|
4
|
+
function isRecord(value) {
|
|
5
|
+
return typeof value === "object" && value !== null;
|
|
6
|
+
}
|
|
7
|
+
async function verdictOf(response) {
|
|
8
|
+
if (response.status === 403 || response.status === 404) return "refused";
|
|
9
|
+
if (response.status < 200 || response.status >= 300) return "unknown";
|
|
10
|
+
let body;
|
|
11
|
+
try {
|
|
12
|
+
body = await response.json();
|
|
13
|
+
} catch {
|
|
14
|
+
return "unknown";
|
|
15
|
+
}
|
|
16
|
+
if (!isRecord(body)) return "unknown";
|
|
17
|
+
return body.is_archived === true ? "refused" : "ok";
|
|
18
|
+
}
|
|
19
|
+
function createChatOutboxAttachmentCheck({
|
|
20
|
+
readAsset
|
|
21
|
+
}) {
|
|
22
|
+
return async (attachments) => {
|
|
23
|
+
let unknown = false;
|
|
24
|
+
for (const assetId of new Set(attachments.map((attachment) => attachment.assetId))) {
|
|
25
|
+
let verdict;
|
|
26
|
+
try {
|
|
27
|
+
verdict = await verdictOf(await readAsset(assetId));
|
|
28
|
+
} catch {
|
|
29
|
+
verdict = "unknown";
|
|
30
|
+
}
|
|
31
|
+
if (verdict === "refused") return "refused";
|
|
32
|
+
if (verdict === "unknown") unknown = true;
|
|
33
|
+
}
|
|
34
|
+
return unknown ? "unknown" : "ok";
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
chatOutboxAttachmentPath,
|
|
39
|
+
createChatOutboxAttachmentCheck
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=chat-outbox-attachments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-outbox-attachments.js","sources":["../../../../agent-runtime/src/chat-outbox-attachments.ts"],"sourcesContent":["import type { ChatOutboxAttachment } from \"./chat-outbox-store\";\n\n/**\n * Whether a waiting message's attachments can still be opened, asked of Athena right before the\n * message goes (`chat-outbox.ts`). A held message carries only files that had finished uploading\n * before Athena went out of reach, but one may be deleted, or stop being shared with the person,\n * while it waits: the message must not go with a reference Athena no longer lets them open.\n *\n * Each file is read through agora's permission-checked `GET /api/v0/assets/{id}`\n * (`get_asset_access_context_or_http`: `get_asset_with_permission_check` in the asset's workspace)\n * as the signed-in person. Nothing here grants anything: the run reads every attachment through\n * the same gates again when it uses it.\n */\n\n/** What Athena answered about a waiting message's attachments. */\nexport type ChatOutboxAttachmentVerdict =\n /** Every one is still there and still the person's to open. */\n | \"ok\"\n /** At least one is gone (deleted, or in the trash) or no longer the person's to open. */\n | \"refused\"\n /** Athena could not say: a read failed, timed out, or its credential was refused. */\n | \"unknown\";\n\n/** Asks Athena about a waiting message's attachments. */\nexport type ChatOutboxAttachmentCheck = (\n attachments: readonly ChatOutboxAttachment[],\n) => Promise<ChatOutboxAttachmentVerdict>;\n\n/** agora's permission-checked read of one asset, relative to its API base. */\nexport function chatOutboxAttachmentPath(assetId: string): string {\n return `/api/v0/assets/${encodeURIComponent(assetId)}`;\n}\n\n/** As much of a `fetch` response as the check reads. */\nexport interface ChatOutboxAssetReadResponse {\n status: number;\n json(): Promise<unknown>;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null;\n}\n\nasync function verdictOf(response: ChatOutboxAssetReadResponse): Promise<ChatOutboxAttachmentVerdict> {\n // 404: the asset is gone (or never was); 403: it is no longer the person's to open.\n if (response.status === 403 || response.status === 404) return \"refused\";\n if (response.status < 200 || response.status >= 300) return \"unknown\";\n // A body that does not read (cut off, or not agora's JSON) never says whether the file is in\n // the trash: that is no answer.\n let body: unknown;\n try {\n body = await response.json();\n } catch {\n return \"unknown\";\n }\n if (!isRecord(body)) return \"unknown\";\n // An archived asset is in the trash: deleted, as far as a message is concerned.\n return body.is_archived === true ? \"refused\" : \"ok\";\n}\n\n/**\n * The check a host hands its chat outbox: each attachment read once, in turn, through `readAsset`\n * (`GET {agora}{chatOutboxAttachmentPath(id)}` with the person's credential, renewed once on a\n * refused token where the host can, under the host's own request timeout). `refused` as soon as\n * one is refused; `unknown` when none was refused but one could not be read; else `ok`.\n */\nexport function createChatOutboxAttachmentCheck({\n readAsset,\n}: {\n readAsset: (assetId: string) => Promise<ChatOutboxAssetReadResponse>;\n}): ChatOutboxAttachmentCheck {\n return async (attachments) => {\n let unknown = false;\n for (const assetId of new Set(attachments.map((attachment) => attachment.assetId))) {\n let verdict: ChatOutboxAttachmentVerdict;\n try {\n verdict = await verdictOf(await readAsset(assetId));\n } catch {\n verdict = \"unknown\";\n }\n if (verdict === \"refused\") return \"refused\";\n if (verdict === \"unknown\") unknown = true;\n }\n return unknown ? \"unknown\" : \"ok\";\n };\n}\n"],"names":[],"mappings":"AA6BO,SAAS,yBAAyB,SAAyB;AAChE,SAAO,kBAAkB,mBAAmB,OAAO,CAAC;AACtD;AAQA,SAAS,SAAS,OAAkD;AAClE,SAAO,OAAO,UAAU,YAAY,UAAU;AAChD;AAEA,eAAe,UAAU,UAA6E;AAEpG,MAAI,SAAS,WAAW,OAAO,SAAS,WAAW,IAAK,QAAO;AAC/D,MAAI,SAAS,SAAS,OAAO,SAAS,UAAU,IAAK,QAAO;AAG5D,MAAI;AACJ,MAAI;AACF,WAAO,MAAM,SAAS,KAAA;AAAA,EACxB,QAAQ;AACN,WAAO;AAAA,EACT;AACA,MAAI,CAAC,SAAS,IAAI,EAAG,QAAO;AAE5B,SAAO,KAAK,gBAAgB,OAAO,YAAY;AACjD;AAQO,SAAS,gCAAgC;AAAA,EAC9C;AACF,GAE8B;AAC5B,SAAO,OAAO,gBAAgB;AAC5B,QAAI,UAAU;AACd,eAAW,WAAW,IAAI,IAAI,YAAY,IAAI,CAAC,eAAe,WAAW,OAAO,CAAC,GAAG;AAClF,UAAI;AACJ,UAAI;AACF,kBAAU,MAAM,UAAU,MAAM,UAAU,OAAO,CAAC;AAAA,MACpD,QAAQ;AACN,kBAAU;AAAA,MACZ;AACA,UAAI,YAAY,UAAW,QAAO;AAClC,UAAI,YAAY,UAAW,WAAU;AAAA,IACvC;AACA,WAAO,UAAU,YAAY;AAAA,EAC/B;AACF;"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const host = globalThis;
|
|
4
|
+
function subscribeTo(targets, events, listener) {
|
|
5
|
+
const bound = targets.filter((target) => target !== void 0);
|
|
6
|
+
for (const target of bound) for (const event of events) target.addEventListener(event, listener);
|
|
7
|
+
return () => {
|
|
8
|
+
for (const target of bound) for (const event of events) target.removeEventListener(event, listener);
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
function browserOnlineSignal() {
|
|
12
|
+
return {
|
|
13
|
+
get: () => {
|
|
14
|
+
var _a;
|
|
15
|
+
return ((_a = host.navigator) == null ? void 0 : _a.onLine) !== false;
|
|
16
|
+
},
|
|
17
|
+
subscribe: (listener) => subscribeTo([typeof host.addEventListener === "function" ? host : void 0], ["online", "offline"], listener)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function documentVisibleSignal() {
|
|
21
|
+
return {
|
|
22
|
+
get: () => {
|
|
23
|
+
var _a;
|
|
24
|
+
return ((_a = host.document) == null ? void 0 : _a.visibilityState) !== "hidden";
|
|
25
|
+
},
|
|
26
|
+
subscribe: (listener) => subscribeTo([host.document], ["visibilitychange"], listener)
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function windowInFrontSignal() {
|
|
30
|
+
const windowTarget = typeof host.addEventListener === "function" ? host : void 0;
|
|
31
|
+
return {
|
|
32
|
+
get: () => {
|
|
33
|
+
const document = host.document;
|
|
34
|
+
if (!document) return true;
|
|
35
|
+
if (document.visibilityState === "hidden") return false;
|
|
36
|
+
return typeof document.hasFocus === "function" ? document.hasFocus() : true;
|
|
37
|
+
},
|
|
38
|
+
subscribe: (listener) => {
|
|
39
|
+
const stopDocument = subscribeTo([host.document], ["visibilitychange"], listener);
|
|
40
|
+
const stopWindow = subscribeTo([windowTarget], ["focus", "blur"], listener);
|
|
41
|
+
return () => {
|
|
42
|
+
stopDocument();
|
|
43
|
+
stopWindow();
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function allChatOutboxSignals(...signals) {
|
|
49
|
+
return {
|
|
50
|
+
get: () => signals.every((signal) => signal.get()),
|
|
51
|
+
subscribe: (listener) => {
|
|
52
|
+
const stops = signals.map((signal) => signal.subscribe(listener));
|
|
53
|
+
return () => {
|
|
54
|
+
for (const stop of stops) stop();
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
exports.allChatOutboxSignals = allChatOutboxSignals;
|
|
60
|
+
exports.browserOnlineSignal = browserOnlineSignal;
|
|
61
|
+
exports.documentVisibleSignal = documentVisibleSignal;
|
|
62
|
+
exports.windowInFrontSignal = windowInFrontSignal;
|
|
63
|
+
//# sourceMappingURL=chat-outbox-signals.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-outbox-signals.cjs","sources":["../../../../agent-runtime/src/chat-outbox-signals.ts"],"sourcesContent":["import type { ChatOutboxSignal } from \"./chat-outbox\";\n\n/**\n * Default signals for the chat outbox on browser hosts. A host with its own reachability model\n * (Olympus's `athena-reachability`, the mobile app's `connectivity`) passes that instead: \"online\"\n * means the device is online AND agora answers, which the browser alone cannot tell.\n *\n * This package compiles without the DOM lib, so the browser globals are described structurally.\n */\n\ntype EventTargetLike = {\n addEventListener(type: string, listener: () => void): void;\n removeEventListener(type: string, listener: () => void): void;\n};\n\ntype BrowserHost = EventTargetLike & {\n navigator?: { onLine?: boolean };\n document?: EventTargetLike & { visibilityState?: string; hasFocus?: () => boolean };\n};\n\nconst host = globalThis as unknown as Partial<BrowserHost>;\n\nfunction subscribeTo(\n targets: readonly (EventTargetLike | undefined)[],\n events: readonly string[],\n listener: () => void,\n): () => void {\n const bound = targets.filter((target): target is EventTargetLike => target !== undefined);\n for (const target of bound) for (const event of events) target.addEventListener(event, listener);\n return () => {\n for (const target of bound) for (const event of events) target.removeEventListener(event, listener);\n };\n}\n\n/** The browser's own word on the network (`navigator.onLine`); true where there is no browser. */\nexport function browserOnlineSignal(): ChatOutboxSignal {\n return {\n get: () => host.navigator?.onLine !== false,\n subscribe: (listener) =>\n subscribeTo([typeof host.addEventListener === \"function\" ? (host as EventTargetLike) : undefined], [\"online\", \"offline\"], listener),\n };\n}\n\n/** A tab in front: the document is visible (a hidden tab never sends). */\nexport function documentVisibleSignal(): ChatOutboxSignal {\n return {\n get: () => host.document?.visibilityState !== \"hidden\",\n subscribe: (listener) => subscribeTo([host.document], [\"visibilitychange\"], listener),\n };\n}\n\n/**\n * A desktop window in front: visible and focused. An unfocused or minimized window waits until the\n * person comes back to it.\n */\nexport function windowInFrontSignal(): ChatOutboxSignal {\n const windowTarget = typeof host.addEventListener === \"function\" ? (host as EventTargetLike) : undefined;\n return {\n get: () => {\n const document = host.document;\n if (!document) return true;\n if (document.visibilityState === \"hidden\") return false;\n return typeof document.hasFocus === \"function\" ? document.hasFocus() : true;\n },\n subscribe: (listener) => {\n const stopDocument = subscribeTo([host.document], [\"visibilitychange\"], listener);\n const stopWindow = subscribeTo([windowTarget], [\"focus\", \"blur\"], listener);\n return () => {\n stopDocument();\n stopWindow();\n };\n },\n };\n}\n\n/** Both signals at once (e.g. a host's reachability AND the browser being online). */\nexport function allChatOutboxSignals(...signals: readonly ChatOutboxSignal[]): ChatOutboxSignal {\n return {\n get: () => signals.every((signal) => signal.get()),\n subscribe: (listener) => {\n const stops = signals.map((signal) => signal.subscribe(listener));\n return () => {\n for (const stop of stops) stop();\n };\n },\n };\n}\n"],"names":[],"mappings":";;AAoBA,MAAM,OAAO;AAEb,SAAS,YACP,SACA,QACA,UACY;AACZ,QAAM,QAAQ,QAAQ,OAAO,CAAC,WAAsC,WAAW,MAAS;AACxF,aAAW,UAAU,MAAO,YAAW,SAAS,OAAQ,QAAO,iBAAiB,OAAO,QAAQ;AAC/F,SAAO,MAAM;AACX,eAAW,UAAU,MAAO,YAAW,SAAS,OAAQ,QAAO,oBAAoB,OAAO,QAAQ;AAAA,EACpG;AACF;AAGO,SAAS,sBAAwC;AACtD,SAAO;AAAA,IACL,KAAK,MAAA;;AAAM,yBAAK,cAAL,mBAAgB,YAAW;AAAA;AAAA,IACtC,WAAW,CAAC,aACV,YAAY,CAAC,OAAO,KAAK,qBAAqB,aAAc,OAA2B,MAAS,GAAG,CAAC,UAAU,SAAS,GAAG,QAAQ;AAAA,EAAA;AAExI;AAGO,SAAS,wBAA0C;AACxD,SAAO;AAAA,IACL,KAAK,MAAA;;AAAM,yBAAK,aAAL,mBAAe,qBAAoB;AAAA;AAAA,IAC9C,WAAW,CAAC,aAAa,YAAY,CAAC,KAAK,QAAQ,GAAG,CAAC,kBAAkB,GAAG,QAAQ;AAAA,EAAA;AAExF;AAMO,SAAS,sBAAwC;AACtD,QAAM,eAAe,OAAO,KAAK,qBAAqB,aAAc,OAA2B;AAC/F,SAAO;AAAA,IACL,KAAK,MAAM;AACT,YAAM,WAAW,KAAK;AACtB,UAAI,CAAC,SAAU,QAAO;AACtB,UAAI,SAAS,oBAAoB,SAAU,QAAO;AAClD,aAAO,OAAO,SAAS,aAAa,aAAa,SAAS,aAAa;AAAA,IACzE;AAAA,IACA,WAAW,CAAC,aAAa;AACvB,YAAM,eAAe,YAAY,CAAC,KAAK,QAAQ,GAAG,CAAC,kBAAkB,GAAG,QAAQ;AAChF,YAAM,aAAa,YAAY,CAAC,YAAY,GAAG,CAAC,SAAS,MAAM,GAAG,QAAQ;AAC1E,aAAO,MAAM;AACX,qBAAA;AACA,mBAAA;AAAA,MACF;AAAA,IACF;AAAA,EAAA;AAEJ;AAGO,SAAS,wBAAwB,SAAwD;AAC9F,SAAO;AAAA,IACL,KAAK,MAAM,QAAQ,MAAM,CAAC,WAAW,OAAO,KAAK;AAAA,IACjD,WAAW,CAAC,aAAa;AACvB,YAAM,QAAQ,QAAQ,IAAI,CAAC,WAAW,OAAO,UAAU,QAAQ,CAAC;AAChE,aAAO,MAAM;AACX,mBAAW,QAAQ,MAAO,MAAA;AAAA,MAC5B;AAAA,IACF;AAAA,EAAA;AAEJ;;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ChatOutboxSignal } from "./chat-outbox";
|
|
2
|
+
/** The browser's own word on the network (`navigator.onLine`); true where there is no browser. */
|
|
3
|
+
export declare function browserOnlineSignal(): ChatOutboxSignal;
|
|
4
|
+
/** A tab in front: the document is visible (a hidden tab never sends). */
|
|
5
|
+
export declare function documentVisibleSignal(): ChatOutboxSignal;
|
|
6
|
+
/**
|
|
7
|
+
* A desktop window in front: visible and focused. An unfocused or minimized window waits until the
|
|
8
|
+
* person comes back to it.
|
|
9
|
+
*/
|
|
10
|
+
export declare function windowInFrontSignal(): ChatOutboxSignal;
|
|
11
|
+
/** Both signals at once (e.g. a host's reachability AND the browser being online). */
|
|
12
|
+
export declare function allChatOutboxSignals(...signals: readonly ChatOutboxSignal[]): ChatOutboxSignal;
|