@athenaintel/react 0.41.3 → 0.42.2
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 +132 -10
- 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.d.ts +60 -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 +123 -8
- package/dist/agent-runtime/src/messages.cjs.map +1 -1
- package/dist/agent-runtime/src/messages.d.ts +621 -0
- package/dist/agent-runtime/src/messages.js +123 -8
- 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.cjs +10 -0
- package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs.map +1 -1
- package/dist/agent-runtime/src/quota-safe-local-storage-session.d.ts +161 -0
- package/dist/agent-runtime/src/quota-safe-local-storage-session.js +10 -0
- package/dist/agent-runtime/src/quota-safe-local-storage-session.js.map +1 -1
- 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/session-lane-scope.cjs +25 -0
- package/dist/agent-runtime/src/session-lane-scope.cjs.map +1 -0
- package/dist/agent-runtime/src/session-lane-scope.d.ts +59 -0
- package/dist/agent-runtime/src/session-lane-scope.js +25 -0
- package/dist/agent-runtime/src/session-lane-scope.js.map +1 -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 +46 -117
- package/dist/agent-runtime/src/thread-snapshot-mirror.cjs.map +1 -1
- package/dist/agent-runtime/src/thread-snapshot-mirror.d.ts +101 -0
- package/dist/agent-runtime/src/thread-snapshot-mirror.js +17 -88
- package/dist/agent-runtime/src/thread-snapshot-mirror.js.map +1 -1
- 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 +71 -0
- package/dist/agent-runtime/src/tool-names.cjs.map +1 -1
- package/dist/agent-runtime/src/tool-names.d.ts +67 -0
- package/dist/agent-runtime/src/tool-names.js +72 -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 +37 -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 +177 -0
- package/dist/agent-runtime/src/use-deep-agent-runtime.js +38 -3
- package/dist/agent-runtime/src/use-deep-agent-runtime.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-thread.cjs +39 -13
- package/dist/agent-runtime/src/use-deep-agent-thread.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-thread.d.ts +352 -0
- package/dist/agent-runtime/src/use-deep-agent-thread.js +39 -13
- package/dist/agent-runtime/src/use-deep-agent-thread.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-voice.cjs +1019 -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 +1019 -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.cjs +2 -0
- package/dist/agent-runtime/src/voice-presentation.cjs.map +1 -1
- package/dist/agent-runtime/src/voice-presentation.d.ts +80 -0
- 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-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/catalog/runtime-catalog.js +1 -1
- package/dist/chat/AthenaChat.cjs +192 -103
- package/dist/chat/AthenaChat.cjs.map +1 -1
- package/dist/chat/AthenaChat.d.ts +9 -0
- package/dist/chat/AthenaChat.js +194 -105
- 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/chat-voice-controls.cjs +128 -0
- package/dist/chat/chat-voice-controls.cjs.map +1 -0
- package/dist/chat/chat-voice-controls.d.ts +19 -0
- package/dist/chat/chat-voice-controls.js +128 -0
- package/dist/chat/chat-voice-controls.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 +15 -8
- package/dist/chat/super-grouping/activity-timeline.cjs.map +1 -1
- package/dist/chat/super-grouping/activity-timeline.d.ts +18 -8
- package/dist/chat/super-grouping/activity-timeline.js +15 -8
- 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 +133 -14
- package/dist/chat-ui/composer/tiptap-composer.cjs.map +1 -1
- package/dist/chat-ui/composer/tiptap-composer.d.ts +33 -1
- package/dist/chat-ui/composer/tiptap-composer.js +135 -16
- 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/mentions/suggestions/data/api-client.cjs +2 -1
- package/dist/chat-ui/mentions/suggestions/data/api-client.cjs.map +1 -1
- package/dist/chat-ui/mentions/suggestions/data/api-client.d.ts +3 -1
- package/dist/chat-ui/mentions/suggestions/data/api-client.js +2 -1
- package/dist/chat-ui/mentions/suggestions/data/api-client.js.map +1 -1
- package/dist/chat-ui/mentions/use-account-workspace-id.cjs +29 -51
- package/dist/chat-ui/mentions/use-account-workspace-id.cjs.map +1 -1
- package/dist/chat-ui/mentions/use-account-workspace-id.d.ts +2 -2
- package/dist/chat-ui/mentions/use-account-workspace-id.js +30 -52
- package/dist/chat-ui/mentions/use-account-workspace-id.js.map +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/composer-send-or-stop.cjs +2 -1
- package/dist/chat-ui/thread/composer-send-or-stop.cjs.map +1 -1
- package/dist/chat-ui/thread/composer-send-or-stop.d.ts +2 -0
- package/dist/chat-ui/thread/composer-send-or-stop.js +2 -1
- package/dist/chat-ui/thread/composer-send-or-stop.js.map +1 -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 +13 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +14 -7
- package/dist/index.js +14 -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.d.ts +1 -1
- package/dist/provider/AthenaProvider.cjs +162 -8
- package/dist/provider/AthenaProvider.cjs.map +1 -1
- package/dist/provider/AthenaProvider.d.ts +15 -1
- package/dist/provider/AthenaProvider.js +163 -9
- 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 +19 -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 +19 -5
- package/dist/runtime/useAthenaStatewireRuntime.cjs.map +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.d.ts +15 -1
- package/dist/runtime/useAthenaStatewireRuntime.js +20 -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.d.ts +1 -1
- 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 +42 -16
- package/dist/threads/statewire-thread-list.cjs.map +1 -1
- package/dist/threads/statewire-thread-list.d.ts +11 -2
- package/dist/threads/statewire-thread-list.js +43 -17
- 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/dist/voice/use-chat-voice-enabled.cjs +43 -0
- package/dist/voice/use-chat-voice-enabled.cjs.map +1 -0
- package/dist/voice/use-chat-voice-enabled.d.ts +9 -0
- package/dist/voice/use-chat-voice-enabled.js +43 -0
- package/dist/voice/use-chat-voice-enabled.js.map +1 -0
- package/package.json +22 -16
|
@@ -0,0 +1,621 @@
|
|
|
1
|
+
import { getExternalStoreMessages, type ThreadMessage, type ThreadStep } from '@assistant-ui/core';
|
|
2
|
+
import { type useExternalMessageConverter } from '@assistant-ui/core/react';
|
|
3
|
+
import { type LangChainMessage } from '@assistant-ui/react-langgraph';
|
|
4
|
+
import { type DeepAgentMessageAuthor } from './message-author';
|
|
5
|
+
import type { DeepAgentToolOutputStore } from './tool-outputs';
|
|
6
|
+
import type { DeepAgentWithdrawnTurns } from './withdrawn-turns';
|
|
7
|
+
import type { DeepAgentLaneProjection, DeepAgentStreamValues, LangGraphState } from './types';
|
|
8
|
+
/**
|
|
9
|
+
* A model call's token use as assistant-ui's native step usage, read off the
|
|
10
|
+
* LangChain message's `usage_metadata` with the session ledger's rule (agora
|
|
11
|
+
* `normalize_usage_metadata`, as `lane_usage.usage_counts` reads it; both are
|
|
12
|
+
* held to the same shapes): `inputTokens` counts the whole input, the prompt
|
|
13
|
+
* cache's reads and writes included, added in when the adapter left them out
|
|
14
|
+
* (the legacy Bedrock adapter) or the totals prove it did. `undefined` for a
|
|
15
|
+
* message that reports no usage.
|
|
16
|
+
*/
|
|
17
|
+
export declare function nativeStepUsage(message: LangChainMessage): ThreadStep['usage'];
|
|
18
|
+
/**
|
|
19
|
+
* The shipped `convertLangChainMessages` with assistant-ui's native step and
|
|
20
|
+
* timing metadata filled in for an AI message: `metadata.steps` holds its model
|
|
21
|
+
* call with its token use ({@link nativeStepUsage}), and a turn's final message
|
|
22
|
+
* carries the turn's `metadata.timing` ({@link nativeTurnTiming}). assistant-ui
|
|
23
|
+
* joins a turn's messages by concatenating their steps (`joinExternalMessages`),
|
|
24
|
+
* so a converted turn lists every model call it made. Any other message converts
|
|
25
|
+
* as the shipped converter has it.
|
|
26
|
+
*/
|
|
27
|
+
export declare const convertDeepAgentLangChainMessage: useExternalMessageConverter.Callback<LangChainMessage>;
|
|
28
|
+
/**
|
|
29
|
+
* {@link convertDeepAgentLangChainMessage} minus quiet tools: an ai message
|
|
30
|
+
* drops their calls and their tool results convert to nothing. The source
|
|
31
|
+
* message is never mutated, so the transcript, exports and the API still carry
|
|
32
|
+
* the call; only the conversation view leaves it out.
|
|
33
|
+
*/
|
|
34
|
+
export declare const convertDeepAgentMessage: useExternalMessageConverter.Callback<LangChainMessage>;
|
|
35
|
+
/**
|
|
36
|
+
* Native message converter for the deep-agent runtime.
|
|
37
|
+
*
|
|
38
|
+
* This is the entire "conversion" layer: assistant-ui's shipped
|
|
39
|
+
* `convertLangChainMessages` (from `@assistant-ui/react-langgraph`) wired
|
|
40
|
+
* through `createMessageConverter`, with the native step and timing metadata
|
|
41
|
+
* the shipped converter leaves out ({@link convertDeepAgentLangChainMessage})
|
|
42
|
+
* and quiet tools left out ({@link convertDeepAgentMessage}). No bespoke
|
|
43
|
+
* per-message mapping — the agora `athena_deep_agent` graph streams standard
|
|
44
|
+
* LangChain messages via `append_langgraph_event`, and the shipped converter
|
|
45
|
+
* renders them.
|
|
46
|
+
*/
|
|
47
|
+
export declare const messageConverter: {
|
|
48
|
+
useThreadMessages: ({ messages, isRunning, joinStrategy, metadata, }: {
|
|
49
|
+
messages: LangChainMessage[];
|
|
50
|
+
isRunning: boolean;
|
|
51
|
+
joinStrategy?: import("@assistant-ui/core/store").JoinStrategy | undefined;
|
|
52
|
+
metadata?: useExternalMessageConverter.Metadata;
|
|
53
|
+
}) => ThreadMessage[];
|
|
54
|
+
toThreadMessages: (messages: LangChainMessage[], isRunning?: boolean, metadata?: useExternalMessageConverter.Metadata) => ThreadMessage[];
|
|
55
|
+
toOriginalMessages: (input: import("@assistant-ui/core").ThreadRuntimeState | ThreadMessage | ThreadMessage["content"][number]) => unknown[];
|
|
56
|
+
toOriginalMessage: (input: import("@assistant-ui/core").ThreadRuntimeState | ThreadMessage | ThreadMessage["content"][number]) => {};
|
|
57
|
+
useOriginalMessage: () => {};
|
|
58
|
+
useOriginalMessages: () => unknown[];
|
|
59
|
+
};
|
|
60
|
+
export interface DeepAgentMessageConversionOptions {
|
|
61
|
+
/**
|
|
62
|
+
* Render quiet tool calls (`QUIET_TOOL_NAMES`) like any other tool. Off by
|
|
63
|
+
* default: every client hides them unless it says the viewer may see them.
|
|
64
|
+
*/
|
|
65
|
+
showQuietTools?: boolean;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* `message` with every tool call whose result is still the backend's
|
|
69
|
+
* running-tool placeholder (see {@link isRunningToolPlaceholderArtifact})
|
|
70
|
+
* marked `isPreliminary`: the result is interim, and the call has not settled.
|
|
71
|
+
*
|
|
72
|
+
* The shipped converter joins a placeholder ToolMessage into its call like any
|
|
73
|
+
* result, which would read as a finished call on every surface: assistant-ui
|
|
74
|
+
* gives a part with a result the `complete` status (cards draw "done", and a
|
|
75
|
+
* tool's completion side effects fire with the interim payload), and a tool's
|
|
76
|
+
* `streamCall` reader resolves with it. A preliminary part instead takes its
|
|
77
|
+
* message's status (`running` while the run is) and the reader waits for the
|
|
78
|
+
* real result, while the card still reads the interim one (progress, a deep
|
|
79
|
+
* research id, a streaming description). The real ToolMessage carries no
|
|
80
|
+
* marker, so its part is plain again. Turns without a placeholder pass through
|
|
81
|
+
* by identity.
|
|
82
|
+
*/
|
|
83
|
+
export declare function markPreliminaryToolResults(message: ThreadMessage): ThreadMessage;
|
|
84
|
+
/**
|
|
85
|
+
* What a thread's conversion memory does: one pass's messages in, the pass's
|
|
86
|
+
* rows out. {@link DeepAgentMessageConversionCache} is the shared one; a host
|
|
87
|
+
* can build on it (`createSubagentTranscriptConversionCache`).
|
|
88
|
+
*/
|
|
89
|
+
export interface DeepAgentConversionMemory {
|
|
90
|
+
convert(messages: LangChainMessage[], isRunning: boolean): ThreadMessage[];
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* One thread's conversion memory: converting through it maps every source
|
|
94
|
+
* message that is unchanged since the previous pass to the IDENTICAL
|
|
95
|
+
* `ThreadMessage`, so a streamed token rebuilds only the turn it lands in
|
|
96
|
+
* instead of every message in the transcript (and every per-message
|
|
97
|
+
* subscriber, memo and tool card below it).
|
|
98
|
+
*
|
|
99
|
+
* Create one per attached thread and drop it with the attach: entries are
|
|
100
|
+
* keyed by source message identity (WeakMaps, so they die with the wire state
|
|
101
|
+
* that holds them), and a fresh cache per attach keeps one thread's converted
|
|
102
|
+
* messages from ever being served for another.
|
|
103
|
+
*/
|
|
104
|
+
export declare class DeepAgentMessageConversionCache implements DeepAgentConversionMemory {
|
|
105
|
+
private readonly cache;
|
|
106
|
+
/**
|
|
107
|
+
* Every cached entry is rebuilt when the metadata object changes identity,
|
|
108
|
+
* so it is created once per cache and never per pass. The tool-args
|
|
109
|
+
* key-order memory keeps a finished tool call's `argsText` in the order its
|
|
110
|
+
* arguments streamed in (assistant-ui's own LangGraph runtime passes the
|
|
111
|
+
* same).
|
|
112
|
+
*/
|
|
113
|
+
private readonly metadata;
|
|
114
|
+
private previous;
|
|
115
|
+
/** `convertExternalMessages`' own rows for the previous pass, before parts were kept. */
|
|
116
|
+
private previousConverted;
|
|
117
|
+
private readonly callback;
|
|
118
|
+
constructor({ showQuietTools }?: DeepAgentMessageConversionOptions);
|
|
119
|
+
/**
|
|
120
|
+
* Convert one pass's LangChain messages. Returns the previous pass's array
|
|
121
|
+
* itself when every converted message is unchanged, so a packet that moved
|
|
122
|
+
* no message re-renders no message; a re-converted turn keeps the row key
|
|
123
|
+
* of the row it continues (see {@link deepAgentRowKey}) and the previous
|
|
124
|
+
* pass's part objects for the parts that did not change
|
|
125
|
+
* (see {@link keepUnchangedParts}).
|
|
126
|
+
*/
|
|
127
|
+
convert(messages: LangChainMessage[], isRunning: boolean): ThreadMessage[];
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* The key a deep-agent thread message renders under in a message list: its
|
|
131
|
+
* id, except for a turn that grew at its head.
|
|
132
|
+
*
|
|
133
|
+
* assistant-ui joins an agent run's consecutive messages into one turn whose
|
|
134
|
+
* id is its first message's, so a page of older history that folds into the
|
|
135
|
+
* first loaded turn (a long run's earlier steps) gives that turn a new id on
|
|
136
|
+
* every page. The conversion cache keeps such a turn under the key of the row
|
|
137
|
+
* it continues, so a list keyed by it keeps the turn's row, and the row's own
|
|
138
|
+
* state, while the page lands. What is mounted inside the row stays mounted
|
|
139
|
+
* only if the parts render under keys that survive the fold too: assistant-ui
|
|
140
|
+
* keys a toolkit group by its first part, which the fold changes when its
|
|
141
|
+
* steps join that group (`GroupedMessageParts` in `@athenaintel/react` carries
|
|
142
|
+
* the keys over). `message.id` stays the message's id: metadata, links and
|
|
143
|
+
* anchors read it.
|
|
144
|
+
*
|
|
145
|
+
* Takes a converted message or the message state assistant-ui publishes for
|
|
146
|
+
* it, which copies the key. A message from another runtime, or one converted
|
|
147
|
+
* without a conversion cache, renders under its id.
|
|
148
|
+
*/
|
|
149
|
+
export declare function deepAgentRowKey(message: {
|
|
150
|
+
readonly id: string;
|
|
151
|
+
}): string;
|
|
152
|
+
/** A conversion cache for one attached thread (see {@link DeepAgentMessageConversionCache}). */
|
|
153
|
+
export declare function createDeepAgentMessageConversionCache(options?: DeepAgentMessageConversionOptions): DeepAgentMessageConversionCache;
|
|
154
|
+
/**
|
|
155
|
+
* `metadata.custom` flag marking a bubble that is a projection of a run-lane
|
|
156
|
+
* entry — a message the server holds and has NOT dispatched yet.
|
|
157
|
+
*
|
|
158
|
+
* The lane is server-owned and replicated to every client on the thread, so
|
|
159
|
+
* an item queued on one surface projects onto all of them. Surfaces without a
|
|
160
|
+
* queue panel must therefore be able to tell a queued projection apart from a
|
|
161
|
+
* submitted turn, or a message another device queued renders as if this device
|
|
162
|
+
* had already sent it.
|
|
163
|
+
*
|
|
164
|
+
* `convertLangChainMessages` exposes `additional_kwargs.metadata` (and nothing
|
|
165
|
+
* else) as the thread message's `metadata.custom`.
|
|
166
|
+
*/
|
|
167
|
+
export declare const ATHENA_QUEUED_LANE_KEY = "athena_queued_lane";
|
|
168
|
+
/**
|
|
169
|
+
* Whether a thread message's `metadata.custom` marks it as an undispatched
|
|
170
|
+
* lane projection. Returns a primitive, so it is safe to use directly as a
|
|
171
|
+
* `useAuiState` selector.
|
|
172
|
+
*/
|
|
173
|
+
export declare function isQueuedLaneMessage(custom: Record<string, unknown> | undefined): boolean;
|
|
174
|
+
export interface DeepAgentMaterializeOptions {
|
|
175
|
+
/** The viewer, stamped onto this client's own not-yet-acknowledged sends. */
|
|
176
|
+
selfAuthor?: DeepAgentMessageAuthor | null;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Materialize fold for the statewire path: makes the server's dispatch record
|
|
180
|
+
* concrete in the LangGraph state itself, so direct state reads see dispatched
|
|
181
|
+
* messages and the lib's post-converter dispatch merge stays off.
|
|
182
|
+
*/
|
|
183
|
+
export declare const createDeepAgentMaterialize: ({ selfAuthor }?: DeepAgentMaterializeOptions) => (draft: DeepAgentStreamValues) => void;
|
|
184
|
+
/** The materialize fold without a viewer identity (surfaces that pass none). */
|
|
185
|
+
export declare const deepAgentMaterialize: (draft: DeepAgentStreamValues) => void;
|
|
186
|
+
/**
|
|
187
|
+
* Project run lanes into human messages for the converter tail, so a queued or
|
|
188
|
+
* steered item stays visible below the pending-assistant placeholder until its
|
|
189
|
+
* dispatch. Surfaces with a queue panel project only the steer lane
|
|
190
|
+
* (`'steer-only'`); surfaces without one project both lanes (`'both'`).
|
|
191
|
+
*
|
|
192
|
+
* Every projected entry carries {@link ATHENA_QUEUED_LANE_KEY} so a surface
|
|
193
|
+
* without a queue panel can render it as queued rather than as a submitted
|
|
194
|
+
* turn.
|
|
195
|
+
*/
|
|
196
|
+
export declare const laneTailMessages: (state: unknown, laneProjection?: DeepAgentLaneProjection, selfAuthor?: DeepAgentMessageAuthor | null) => LangChainMessage[];
|
|
197
|
+
/** Stable id for the derived running-assistant placeholder. */
|
|
198
|
+
export declare const PENDING_ASSISTANT_MESSAGE_ID = "__athena_deep_agent_pending_assistant__";
|
|
199
|
+
/**
|
|
200
|
+
* Append an empty assistant turn while a run is in flight and the visible
|
|
201
|
+
* history does not already end in one, so the thread shows its "Thinking…"
|
|
202
|
+
* status line from the moment a message is submitted.
|
|
203
|
+
*
|
|
204
|
+
* Mirrors `hasUpcomingMessage` in assistant-ui's legacy external-store runtime,
|
|
205
|
+
* which synthesized this placeholder itself. `StatewireThread` renders the
|
|
206
|
+
* converter's message list verbatim, so the placeholder has to come from here —
|
|
207
|
+
* derived from the replicated run status on every render (never written into
|
|
208
|
+
* transport state) so it cannot outlive the run, and carrying a stable id so
|
|
209
|
+
* the streaming bubble's identity does not churn when the real assistant
|
|
210
|
+
* message arrives.
|
|
211
|
+
*
|
|
212
|
+
* `tool` messages convert into assistant turns too, so a mid-run tool result
|
|
213
|
+
* must not produce a second placeholder row.
|
|
214
|
+
*/
|
|
215
|
+
export declare function withPendingAssistantMessage(messages: LangChainMessage[], isRunning: boolean): LangChainMessage[];
|
|
216
|
+
/**
|
|
217
|
+
* Surface a run failure the base-correct way: stamp `status: { type:'incomplete',
|
|
218
|
+
* reason:'error', error }` onto the assistant turn so `<Thread/>` renders it via
|
|
219
|
+
* `ErrorPrimitive`. This is the core runtime's model (see `useLanggraphRuntime`
|
|
220
|
+
* `onError`) — NOT a fabricated `⚠️ The run failed` assistant text message, and
|
|
221
|
+
* NOT a magic-string contract shared with the agora backend.
|
|
222
|
+
*
|
|
223
|
+
* Stamps a trailing assistant message; if the visible history does not already
|
|
224
|
+
* end with an assistant turn, appends a synthetic empty assistant turn with a
|
|
225
|
+
* STABLE id so it never churns across renders. A `null` error is a no-op. The
|
|
226
|
+
* shipped `convertLangChainMessages` converter passes `message.status` through.
|
|
227
|
+
*/
|
|
228
|
+
export declare function applyRunErrorStatus(messages: LangChainMessage[], errorMessage: string | null): LangChainMessage[];
|
|
229
|
+
/**
|
|
230
|
+
* `additional_kwargs` flag the backend stamps on run-lifecycle marker messages
|
|
231
|
+
* (agora `athena_deep_agent/run_markers.py`) — e.g. the "⏹️ Run stopped by
|
|
232
|
+
* user." message persisted when a run is cancelled.
|
|
233
|
+
*/
|
|
234
|
+
export declare const ATHENA_RUN_MARKER_KEY = "athena_run_marker";
|
|
235
|
+
/** The {@link ATHENA_RUN_MARKER_KEY} value for a user-cancelled run. */
|
|
236
|
+
export declare const ATHENA_RUN_MARKER_CANCELLED = "cancelled";
|
|
237
|
+
/**
|
|
238
|
+
* `additional_kwargs` key carrying the stop source behind a cancellation
|
|
239
|
+
* marker (agora `stop_signals.py`: `user_stop`, `send_now`, `transport_cancel`,
|
|
240
|
+
* `unattributed`).
|
|
241
|
+
*/
|
|
242
|
+
export declare const ATHENA_RUN_MARKER_SOURCE_KEY = "athena_run_marker_source";
|
|
243
|
+
/** The stop source for a "Send now" promotion pre-empting the live run. */
|
|
244
|
+
export declare const ATHENA_STOP_SOURCE_SEND_NOW = "send_now";
|
|
245
|
+
/**
|
|
246
|
+
* The stop source for a spoken follow-up that redirected a voice-delegated
|
|
247
|
+
* run through the steer lane: the user spoke, they never pressed Stop, so it
|
|
248
|
+
* renders as a redirect rather than as "Conversation stopped".
|
|
249
|
+
*/
|
|
250
|
+
export declare const ATHENA_STOP_SOURCE_VOICE_STEER = "voice_steer";
|
|
251
|
+
/** The stop source for a pod-drain pause (server update), not a user stop. */
|
|
252
|
+
export declare const ATHENA_STOP_SOURCE_POD_DRAIN = "pod_drain";
|
|
253
|
+
/**
|
|
254
|
+
* The {@link ATHENA_RUN_MARKER_SOURCE_KEY} value for a run whose hosting
|
|
255
|
+
* instance closed under it (a server update that reached its eviction
|
|
256
|
+
* deadline mid-step, or a placement lost to a lease lapse). Same family as a
|
|
257
|
+
* pod drain: nobody stopped the run, the backend resumes it automatically.
|
|
258
|
+
*/
|
|
259
|
+
export declare const ATHENA_STOP_SOURCE_INSTANCE_CLOSED = "instance_closed";
|
|
260
|
+
/**
|
|
261
|
+
* Whether a cancellation marker's source names the infrastructure — a pod
|
|
262
|
+
* drain or a closed instance — rather than a person or a client action. These
|
|
263
|
+
* endings read as a pause while the server resumes the run.
|
|
264
|
+
*/
|
|
265
|
+
export declare function isServerUpdateStopSource(source: string | undefined): boolean;
|
|
266
|
+
/**
|
|
267
|
+
* The {@link ATHENA_RUN_MARKER_KEY} value for a failed run (graph error,
|
|
268
|
+
* including the `GraphRecursionError` "tool call limit was reached" case).
|
|
269
|
+
* The marker message's text content carries the user-facing failure copy.
|
|
270
|
+
*/
|
|
271
|
+
export declare const ATHENA_RUN_MARKER_FAILED = "failed";
|
|
272
|
+
/**
|
|
273
|
+
* `additional_kwargs` key carrying the canonical reason a run ended (agora
|
|
274
|
+
* `athena_deep_agent/termination.py`): `user_stop`, `recursion_limit`,
|
|
275
|
+
* `duplicate_call_guard`, `step_budget`, `ended_after_tools`, `model_refusal`,
|
|
276
|
+
* `completed`, …
|
|
277
|
+
* Stamped on run-lifecycle markers and on handoff messages.
|
|
278
|
+
*/
|
|
279
|
+
export declare const ATHENA_TERMINATION_REASON_KEY = "athena_termination_reason";
|
|
280
|
+
/**
|
|
281
|
+
* `additional_kwargs` flag on the closing message the runtime's **handoff
|
|
282
|
+
* turn** wrote (one tools-disabled model call made when a guard or the step
|
|
283
|
+
* budget ends the run). The message text is the agent's closing summary; the
|
|
284
|
+
* flag lets clients frame it as a runtime ending rather than a normal reply.
|
|
285
|
+
*/
|
|
286
|
+
export declare const ATHENA_HANDOFF_KEY = "athena_handoff";
|
|
287
|
+
/**
|
|
288
|
+
* Read a run-lifecycle marker out of a thread message's **bound source
|
|
289
|
+
* messages**, bypassing the converter's metadata join entirely.
|
|
290
|
+
*
|
|
291
|
+
* Why this exists: assistant-ui chunks consecutive assistant/tool messages
|
|
292
|
+
* into ONE `ThreadMessage`, and the upstream join copies `metadata.custom`
|
|
293
|
+
* only from the FIRST assistant message of the chunk
|
|
294
|
+
* (`external-message-converter.ts`: the merge sits inside
|
|
295
|
+
* `if (assistantMessage.content.length === 0)`). A failure marker appended
|
|
296
|
+
* after the assistant's own turn is therefore never the first message in its
|
|
297
|
+
* chunk, so `message.metadata.custom.athena_run_marker` is silently dropped
|
|
298
|
+
* and the whole-message gate can't fire.
|
|
299
|
+
*
|
|
300
|
+
* `getExternalStoreMessages` returns the raw LangChain messages bound to the
|
|
301
|
+
* joined thread message, so the marker is found wherever it sits in the chunk.
|
|
302
|
+
* Returns the marker value plus its text content (the user-facing copy).
|
|
303
|
+
*/
|
|
304
|
+
export interface RunMarkerInfo {
|
|
305
|
+
marker: string;
|
|
306
|
+
/** The stop source stamped by the backend, when the marker carries one. */
|
|
307
|
+
source: string | undefined;
|
|
308
|
+
/** The marker message's text — the user-facing copy. */
|
|
309
|
+
text: string | undefined;
|
|
310
|
+
/**
|
|
311
|
+
* True when the marker is the ONLY source message behind this thread message,
|
|
312
|
+
* i.e. it owns the whole row (a cancelled run drops its partial turn, so its
|
|
313
|
+
* marker stands alone).
|
|
314
|
+
*
|
|
315
|
+
* False when the chunk also holds the assistant's own work. Replacing the row
|
|
316
|
+
* in that case would hide completed prose and tool cards — the marker must be
|
|
317
|
+
* styled in place instead.
|
|
318
|
+
*/
|
|
319
|
+
isSoleSourceMessage: boolean;
|
|
320
|
+
}
|
|
321
|
+
export declare function readRunMarkerFromSourceMessages(message: Parameters<typeof getExternalStoreMessages>[0] & {
|
|
322
|
+
metadata?: {
|
|
323
|
+
custom?: Record<string, unknown> | undefined;
|
|
324
|
+
} | undefined;
|
|
325
|
+
content?: unknown;
|
|
326
|
+
}): RunMarkerInfo | undefined;
|
|
327
|
+
/**
|
|
328
|
+
* The marker value when the marker is the SOLE source message behind a thread
|
|
329
|
+
* message (it owns the whole row), else `undefined`.
|
|
330
|
+
*
|
|
331
|
+
* Returns a primitive so it is safe to use directly as a `useAuiState`
|
|
332
|
+
* selector: `readRunMarkerFromSourceMessages` builds a fresh object on every
|
|
333
|
+
* call, and selector snapshots are compared with `Object.is` — returning that
|
|
334
|
+
* object from a selector makes `getSnapshot` unstable and loops the render.
|
|
335
|
+
*/
|
|
336
|
+
export declare function readSoleRunMarker(message: Parameters<typeof readRunMarkerFromSourceMessages>[0]): string | undefined;
|
|
337
|
+
/**
|
|
338
|
+
* Whether a run marker renders nothing: a `send_now` promotion cancels the
|
|
339
|
+
* live run as plumbing, not as a user-visible stop, so its cancellation
|
|
340
|
+
* marker stays in the data for provenance but paints no divider.
|
|
341
|
+
*/
|
|
342
|
+
export declare function isSilentRunMarker(found: RunMarkerInfo): boolean;
|
|
343
|
+
/**
|
|
344
|
+
* Whether a cancellation marker records a server-update pause — a cooperative
|
|
345
|
+
* pod drain, or the hosting instance closing under the run — rather than a
|
|
346
|
+
* stop the user asked for. Rendered with distinct "paused by a server update"
|
|
347
|
+
* copy instead of the "Conversation stopped" pill; the backend resumes the run.
|
|
348
|
+
*/
|
|
349
|
+
export declare function isDrainRunMarker(found: RunMarkerInfo): boolean;
|
|
350
|
+
/**
|
|
351
|
+
* Surface the backend's top-level `additional_kwargs.athena_run_marker` flag
|
|
352
|
+
* where the shipped converter can see it.
|
|
353
|
+
*
|
|
354
|
+
* `convertLangChainMessages` exposes ONLY `additional_kwargs.metadata` as the
|
|
355
|
+
* thread message's `metadata.custom`; every other `additional_kwargs` key is
|
|
356
|
+
* dropped. Marker messages persisted before the backend mirrored the flag into
|
|
357
|
+
* `metadata` carry it top-level only, so this lift keeps those threads styling
|
|
358
|
+
* correctly. Non-marker messages pass through with their identity unchanged,
|
|
359
|
+
* and already-mirrored markers are left as-is (idempotent).
|
|
360
|
+
*/
|
|
361
|
+
export declare function liftRunMarkerIntoMetadata(message: LangChainMessage): LangChainMessage;
|
|
362
|
+
/**
|
|
363
|
+
* Mirror the termination reason and handoff flag into the converter's metadata
|
|
364
|
+
* channel. The backend dual-writes both (top-level + `metadata`), so this lift
|
|
365
|
+
* is the back-compat path for messages persisted before the mirror existed and
|
|
366
|
+
* for any emitter that only stamps the top-level key. Idempotent; identity for
|
|
367
|
+
* messages without the keys.
|
|
368
|
+
*/
|
|
369
|
+
export declare function liftTerminationIntoMetadata(message: LangChainMessage): LangChainMessage;
|
|
370
|
+
/**
|
|
371
|
+
* `additional_kwargs` key (and `metadata` mirror) carrying a failure marker's
|
|
372
|
+
* structured error records (agora `athena_deep_agent/run_markers.py`
|
|
373
|
+
* `failure_error_records`): `[{ error, provider?, message? }]`, where `error`
|
|
374
|
+
* is the client code a surface branches on — `context_length_exceeded`,
|
|
375
|
+
* `transient_api_error` (with `provider: 'azure_foundry' |
|
|
376
|
+
* 'external_model_provider'`), `content_filter`, `request_too_large`, … — the
|
|
377
|
+
* same shape the legacy agent node emitted.
|
|
378
|
+
*/
|
|
379
|
+
export declare const ATHENA_ERRORS_KEY = "errors";
|
|
380
|
+
/**
|
|
381
|
+
* Mirror a failure marker's structured `errors` records into the converter's
|
|
382
|
+
* metadata channel. The backend dual-writes them (top-level + `metadata`), so
|
|
383
|
+
* this lift is the back-compat path for messages that carry only the top-level
|
|
384
|
+
* key (an emitter that never mirrored, or a record persisted before the mirror
|
|
385
|
+
* existed). Records already present in the metadata channel win; no-ops are
|
|
386
|
+
* identity.
|
|
387
|
+
*/
|
|
388
|
+
export declare function liftErrorsIntoMetadata(message: LangChainMessage): LangChainMessage;
|
|
389
|
+
/**
|
|
390
|
+
* Read a failure's structured `errors` records out of a thread message's
|
|
391
|
+
* **bound source messages**, bypassing the converter's metadata join.
|
|
392
|
+
*
|
|
393
|
+
* Same reason as {@link readRunMarkerFromSourceMessages}: assistant-ui chunks
|
|
394
|
+
* consecutive assistant/tool messages into ONE `ThreadMessage` and copies
|
|
395
|
+
* `metadata.custom` only from the FIRST assistant message of the chunk. The
|
|
396
|
+
* failure marker that carries the records is appended after the assistant's
|
|
397
|
+
* own turn, so `message.metadata.custom.errors` is silently dropped whenever
|
|
398
|
+
* the run produced anything before failing. The bound sources are walked from
|
|
399
|
+
* the tail (the terminal failure wins); the joined metadata is the fallback
|
|
400
|
+
* for surfaces whose messages carry no bound sources. Returns the raw records
|
|
401
|
+
* (callers validate the shape) or `undefined`.
|
|
402
|
+
*/
|
|
403
|
+
export declare function readMessageErrorsFromSourceMessages(message: Parameters<typeof getExternalStoreMessages>[0] & {
|
|
404
|
+
metadata?: {
|
|
405
|
+
custom?: Record<string, unknown> | undefined;
|
|
406
|
+
} | undefined;
|
|
407
|
+
}): unknown[] | undefined;
|
|
408
|
+
/**
|
|
409
|
+
* Mirror the producing model into the converter's metadata channel. Wire AI
|
|
410
|
+
* messages are full LangChain dumps whose `response_metadata` reports the model
|
|
411
|
+
* that generated them (`model_name` / `model`), but the shipped converter maps
|
|
412
|
+
* only `additional_kwargs.metadata` into `metadata.custom` — so without this
|
|
413
|
+
* lift a surface can only show the CURRENT run config's model, mislabeling
|
|
414
|
+
* earlier messages after a mid-thread model switch. A model already present in
|
|
415
|
+
* the metadata channel (backend-stamped provenance) wins; no-ops are identity.
|
|
416
|
+
*/
|
|
417
|
+
export declare function liftModelIntoMetadata(message: LangChainMessage): LangChainMessage;
|
|
418
|
+
/**
|
|
419
|
+
* Mirror a per-message conversation-stats snapshot into the converter's
|
|
420
|
+
* metadata channel. Backends stamp the snapshot at the legacy location —
|
|
421
|
+
* top-level `additional_kwargs.conversation_stats` (the deep-agent stats
|
|
422
|
+
* middleware and the legacy agent node both write it there) — but the shipped
|
|
423
|
+
* converter maps only `additional_kwargs.metadata` into `metadata.custom`, so
|
|
424
|
+
* without this lift the model badge can never show a message's OWN context and
|
|
425
|
+
* falls back to thread-level live numbers. A snapshot already present in the
|
|
426
|
+
* metadata channel wins; no-ops are identity.
|
|
427
|
+
*/
|
|
428
|
+
export declare function liftConversationStatsIntoMetadata(message: LangChainMessage): LangChainMessage;
|
|
429
|
+
/**
|
|
430
|
+
* Mirror the compaction boundary flag into the converter's metadata channel.
|
|
431
|
+
* A manual `/compact` persists its summary as a human message tagged with
|
|
432
|
+
* top-level `additional_kwargs.compaction_start` (plus `_created_at` for the
|
|
433
|
+
* divider timestamp) — the same location the legacy runtime used — but the
|
|
434
|
+
* shipped converter maps only `additional_kwargs.metadata` into
|
|
435
|
+
* `metadata.custom`, so without this lift the transcript's
|
|
436
|
+
* "Previous conversation summarized" divider can never render. A flag already
|
|
437
|
+
* present in the metadata channel wins; no-ops are identity.
|
|
438
|
+
*/
|
|
439
|
+
export declare function liftCompactionBoundaryIntoMetadata(message: LangChainMessage): LangChainMessage;
|
|
440
|
+
/**
|
|
441
|
+
* Mirror the handoff summary flag into the converter's metadata channel.
|
|
442
|
+
* Handoff summaries are persisted as human messages tagged with top-level
|
|
443
|
+
* `additional_kwargs.handoff_summary` (plus `_created_at`) — the same location
|
|
444
|
+
* the backend uses for message metadata — but the shipped converter maps only
|
|
445
|
+
* `additional_kwargs.metadata` into `metadata.custom`, so without this lift
|
|
446
|
+
* the summary would render as a normal user bubble. A flag already present in
|
|
447
|
+
* the metadata channel wins; no-ops are identity.
|
|
448
|
+
*/
|
|
449
|
+
export declare function liftHandoffSummaryIntoMetadata(message: LangChainMessage): LangChainMessage;
|
|
450
|
+
/**
|
|
451
|
+
* Mirror an AOP run's provenance into the converter's metadata channel. The
|
|
452
|
+
* backend stamps the kicking-off user message with top-level
|
|
453
|
+
* `additional_kwargs.aop_source` (agora `events/helpers.py`
|
|
454
|
+
* `_build_aop_source_metadata`), which the legacy converter surfaced as
|
|
455
|
+
* `metadata.custom.aop_source` — where the "AOP · <title>" badge reads it. The
|
|
456
|
+
* shipped `convertLangChainMessages` maps only `additional_kwargs.metadata`
|
|
457
|
+
* into `metadata.custom`, so without this lift an AOP run's conversation never
|
|
458
|
+
* shows which AOP asset kicked it off. Provenance already present in the
|
|
459
|
+
* metadata channel wins; no-ops are identity.
|
|
460
|
+
*/
|
|
461
|
+
export declare function liftAopSourceIntoMetadata(message: LangChainMessage): LangChainMessage;
|
|
462
|
+
export declare function liftBranchIntoMetadata(message: LangChainMessage): LangChainMessage;
|
|
463
|
+
/**
|
|
464
|
+
* Mirror a ToolMessage's user-set `additional_kwargs` into
|
|
465
|
+
* `artifact._tool_message_metadata` — the location `useToolCallMetadata` reads
|
|
466
|
+
* persisted per-tool-call metadata from (`email_sent_at`, draft edits,
|
|
467
|
+
* `calendar_event_created_at`, …).
|
|
468
|
+
*
|
|
469
|
+
* The `setMessageMetadata` mutation persists those keys onto the ToolMessage's
|
|
470
|
+
* `additional_kwargs` in the checkpoint, and the legacy converter lifted them
|
|
471
|
+
* into the artifact. The shipped `convertLangChainMessages` forwards only
|
|
472
|
+
* `artifact` and drops `additional_kwargs` for tool messages, so without this
|
|
473
|
+
* lift the metadata survives in the checkpoint but never reaches a tool card
|
|
474
|
+
* after a reload. Kwargs values win over same-key artifact entries (the kwargs
|
|
475
|
+
* are the durable write target); messages with no user-set kwargs pass through
|
|
476
|
+
* by identity.
|
|
477
|
+
*/
|
|
478
|
+
export declare function liftToolMessageMetadataIntoArtifact(message: LangChainMessage): LangChainMessage;
|
|
479
|
+
/**
|
|
480
|
+
* Lift a windowed wire's tool-output truncation marker into the tool-call
|
|
481
|
+
* part's `artifact` (`_athena_content_truncated: { chars, messageId }`).
|
|
482
|
+
*
|
|
483
|
+
* The host cuts long plain-text tool outputs on a windowed wire and stamps
|
|
484
|
+
* `athena_content_truncated` on the wire message; the shipped converter joins
|
|
485
|
+
* a ToolMessage into its assistant turn's tool-call part and keeps only
|
|
486
|
+
* `artifact` and the result, so without this lift no tool card could tell the
|
|
487
|
+
* output is cut nor which message to ask `history/tool_output` for. Messages
|
|
488
|
+
* without the marker pass through by identity.
|
|
489
|
+
*/
|
|
490
|
+
export declare function liftTruncatedToolOutputIntoArtifact(message: LangChainMessage): LangChainMessage;
|
|
491
|
+
/**
|
|
492
|
+
* A content list's bare-string entries as typed text parts.
|
|
493
|
+
*
|
|
494
|
+
* LangChain content is `string | (string | ContentBlock)[]`, and a model with
|
|
495
|
+
* no tools bound streams exactly that mix: `langchain_anthropic` coerces text
|
|
496
|
+
* deltas to plain strings when no tools are bound, yet a thinking block still
|
|
497
|
+
* arrives as a list block, so the merged reply is `["", {thinking}, "text"]`
|
|
498
|
+
* (the side-question lane's bare model). The shipped converter maps only typed
|
|
499
|
+
* blocks and drops the strings, leaving the reasoning with no answer. Empty
|
|
500
|
+
* strings are dropped; messages with no string entries pass through by
|
|
501
|
+
* identity.
|
|
502
|
+
*/
|
|
503
|
+
export declare function normalizeStringContentParts(message: LangChainMessage): LangChainMessage;
|
|
504
|
+
/**
|
|
505
|
+
* A cut tool message with its full output put back, when the store holds one
|
|
506
|
+
* fetched for this very output (`history/tool_output` answered for the same
|
|
507
|
+
* `chars` the wire's marker reports); the marker leaves with the cut.
|
|
508
|
+
* Messages that are whole, whose output has not been fetched, or whose fetched
|
|
509
|
+
* output belongs to a length the host has since replaced, pass through by
|
|
510
|
+
* identity — the loader sees the mismatch and fetches again.
|
|
511
|
+
*/
|
|
512
|
+
export declare function substituteToolOutput(message: LangChainMessage, toolOutputs: DeepAgentToolOutputStore): LangChainMessage;
|
|
513
|
+
/**
|
|
514
|
+
* Internal orchestration messages are useful in a trace export but must never
|
|
515
|
+
* become conversation bubbles. Agora stores the flag in `additional_kwargs`;
|
|
516
|
+
* live converter state can expose the same value under `metadata.custom`.
|
|
517
|
+
*/
|
|
518
|
+
export declare function isMessageHiddenFromFrontend(message: unknown): boolean;
|
|
519
|
+
/**
|
|
520
|
+
* Whether `convertLangChainMessages` can map this message at all.
|
|
521
|
+
*
|
|
522
|
+
* An unmappable entry converts to `undefined`, which assistant-ui's
|
|
523
|
+
* `convertExternalMessages` wraps as `outputs: [undefined]` and then reads
|
|
524
|
+
* `output.role` off — throwing `Cannot read property 'role' of undefined` and
|
|
525
|
+
* taking the entire thread down instead of dropping one message.
|
|
526
|
+
*/
|
|
527
|
+
export declare function isConvertibleChatMessage(message: unknown): boolean;
|
|
528
|
+
/**
|
|
529
|
+
* The one message pipeline every deep-agent surface renders through:
|
|
530
|
+
*
|
|
531
|
+
* 1. drop messages the shipped converter cannot map (`RemoveMessage` etc. —
|
|
532
|
+
* an unmappable entry would crash the whole thread) and internal
|
|
533
|
+
* orchestration messages flagged hidden-from-frontend;
|
|
534
|
+
* 1a. turn bare-string entries of a content list into typed text parts (see
|
|
535
|
+
* {@link normalizeStringContentParts}) so a tool-less model's answer next
|
|
536
|
+
* to its thinking block is not dropped by the converter;
|
|
537
|
+
* 2. lift run-lifecycle markers into the converter's `metadata` channel
|
|
538
|
+
* (see {@link liftRunMarkerIntoMetadata}) so the cancellation row styles as
|
|
539
|
+
* a status divider instead of a plain assistant bubble, and the termination
|
|
540
|
+
* reason + handoff flag alongside them (see
|
|
541
|
+
* {@link liftTerminationIntoMetadata}) so every surface can render a
|
|
542
|
+
* runtime ending (see `runtime-messages.ts`);
|
|
543
|
+
* 3. lift each AI message's producing model into the same channel
|
|
544
|
+
* (see {@link liftModelIntoMetadata}) so model badges reflect the model that
|
|
545
|
+
* actually generated the message, not the currently configured one;
|
|
546
|
+
* 4. lift each AI message's per-message conversation-stats snapshot into the
|
|
547
|
+
* same channel (see {@link liftConversationStatsIntoMetadata}) so the model
|
|
548
|
+
* badge's hover card shows that message's own context usage;
|
|
549
|
+
* 5. lift the compaction boundary flag on `/compact` summary messages into the
|
|
550
|
+
* same channel (see {@link liftCompactionBoundaryIntoMetadata}) so the
|
|
551
|
+
* transcript renders its "Previous conversation summarized" divider;
|
|
552
|
+
* 6. lift the handoff summary flag on carried-over context messages into the
|
|
553
|
+
* same channel (see {@link liftHandoffSummaryIntoMetadata}) so the
|
|
554
|
+
* transcript keeps the summary behind its context panel;
|
|
555
|
+
* 7. lift an AOP run's provenance on its kicking-off user message into the
|
|
556
|
+
* same channel (see {@link liftAopSourceIntoMetadata}) so the message
|
|
557
|
+
* renders its "AOP · <title>" origin badge;
|
|
558
|
+
* 8. lift each ToolMessage's user-set `additional_kwargs` into
|
|
559
|
+
* `artifact._tool_message_metadata` (see
|
|
560
|
+
* {@link liftToolMessageMetadataIntoArtifact}) so persisted per-tool-call
|
|
561
|
+
* metadata reaches tool cards after a reload;
|
|
562
|
+
* 9. lift a windowed wire's tool-output truncation marker into the tool-call
|
|
563
|
+
* part's `artifact` (see {@link liftTruncatedToolOutputIntoArtifact}) so a
|
|
564
|
+
* tool card can fetch the whole output — after first putting back any
|
|
565
|
+
* output already fetched (see {@link substituteToolOutput});
|
|
566
|
+
* 10. lift the host's per-message branch stamp into the same channel
|
|
567
|
+
* (see {@link liftBranchIntoMetadata}) so the branch picker renders each
|
|
568
|
+
* message's edit fan-out.
|
|
569
|
+
*
|
|
570
|
+
* Identity-stable per source: an unchanged source message maps to the
|
|
571
|
+
* IDENTICAL lifted object across passes (see {@link liftedMessageCache}).
|
|
572
|
+
*/
|
|
573
|
+
export declare function sanitizeLangChainMessages(messages: readonly LangChainMessage[], { toolOutputs }?: {
|
|
574
|
+
toolOutputs?: DeepAgentToolOutputStore;
|
|
575
|
+
}): LangChainMessage[];
|
|
576
|
+
/** Type guard for the runtime state — an object carrying a `messages` array. */
|
|
577
|
+
export declare function isLangGraphState(value: unknown): value is LangGraphState;
|
|
578
|
+
export interface ConvertDeepAgentStateOptions extends DeepAgentMessageConversionOptions {
|
|
579
|
+
laneProjection?: DeepAgentLaneProjection;
|
|
580
|
+
/**
|
|
581
|
+
* The viewer, as the backend would stamp them: the author of this client's
|
|
582
|
+
* own not-yet-acknowledged lane entries (see {@link laneEntryAuthor}).
|
|
583
|
+
*/
|
|
584
|
+
selfAuthor?: DeepAgentMessageAuthor | null;
|
|
585
|
+
/**
|
|
586
|
+
* Full tool outputs fetched back for a windowed wire's cut tool messages
|
|
587
|
+
* (see {@link substituteToolOutput}); omitted on surfaces that never
|
|
588
|
+
* declare a window.
|
|
589
|
+
*/
|
|
590
|
+
toolOutputs?: DeepAgentToolOutputStore;
|
|
591
|
+
/**
|
|
592
|
+
* User turns this client took back ahead of the wire (see
|
|
593
|
+
* {@link DeepAgentWithdrawnTurns}): omitted from the transcript, together
|
|
594
|
+
* with the pending-assistant placeholder a withdrawn tail would earn.
|
|
595
|
+
*/
|
|
596
|
+
withdrawnTurns?: DeepAgentWithdrawnTurns;
|
|
597
|
+
/**
|
|
598
|
+
* The attached thread's conversion memory (see
|
|
599
|
+
* {@link createDeepAgentMessageConversionCache}): unchanged messages keep
|
|
600
|
+
* their converted identity across passes. Without one every pass converts
|
|
601
|
+
* the whole transcript from scratch. A cache keeps the `showQuietTools` it
|
|
602
|
+
* was created with; the option here applies only without one.
|
|
603
|
+
*/
|
|
604
|
+
conversionCache?: DeepAgentConversionMemory;
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* Map server state → assistant-ui thread messages.
|
|
608
|
+
*
|
|
609
|
+
* `state.messages` is the authoritative LangChain history streamed by the
|
|
610
|
+
* backend. The replicated run status (`runs[0].status`) drives the
|
|
611
|
+
* pending-assistant placeholder and the running status. Lane entries render at
|
|
612
|
+
* the tail, after the placeholder, while the run is live (the run is still
|
|
613
|
+
* working the history above them); once the thread rests stopped/errored they
|
|
614
|
+
* are omitted (surfaces with a queue panel list them there instead).
|
|
615
|
+
* Consecutive spoken user turns collapse into one user message (see
|
|
616
|
+
* {@link groupSpokenUserTurns}) before conversion.
|
|
617
|
+
*/
|
|
618
|
+
export declare function convertDeepAgentState(state: unknown, { laneProjection, selfAuthor, toolOutputs, withdrawnTurns, conversionCache, showQuietTools, }?: ConvertDeepAgentStateOptions): {
|
|
619
|
+
messages: ThreadMessage[];
|
|
620
|
+
isRunning: boolean;
|
|
621
|
+
};
|