@athenaintel/react 0.42.1 → 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.
Files changed (96) hide show
  1. package/README.md +36 -7
  2. package/dist/agent-runtime/src/index.d.ts +2 -2
  3. package/dist/agent-runtime/src/messages.cjs +38 -7
  4. package/dist/agent-runtime/src/messages.cjs.map +1 -1
  5. package/dist/agent-runtime/src/messages.d.ts +26 -8
  6. package/dist/agent-runtime/src/messages.js +38 -7
  7. package/dist/agent-runtime/src/messages.js.map +1 -1
  8. package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs +10 -0
  9. package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs.map +1 -1
  10. package/dist/agent-runtime/src/quota-safe-local-storage-session.d.ts +7 -0
  11. package/dist/agent-runtime/src/quota-safe-local-storage-session.js +10 -0
  12. package/dist/agent-runtime/src/quota-safe-local-storage-session.js.map +1 -1
  13. package/dist/agent-runtime/src/session-lane-scope.cjs +25 -0
  14. package/dist/agent-runtime/src/session-lane-scope.cjs.map +1 -0
  15. package/dist/agent-runtime/src/session-lane-scope.d.ts +59 -0
  16. package/dist/agent-runtime/src/session-lane-scope.js +25 -0
  17. package/dist/agent-runtime/src/session-lane-scope.js.map +1 -0
  18. package/dist/agent-runtime/src/subagent-transcripts.cjs +2 -2
  19. package/dist/agent-runtime/src/subagent-transcripts.cjs.map +1 -1
  20. package/dist/agent-runtime/src/subagent-transcripts.d.ts +2 -2
  21. package/dist/agent-runtime/src/subagent-transcripts.js +3 -3
  22. package/dist/agent-runtime/src/subagent-transcripts.js.map +1 -1
  23. package/dist/agent-runtime/src/tool-names.cjs +4 -0
  24. package/dist/agent-runtime/src/tool-names.cjs.map +1 -1
  25. package/dist/agent-runtime/src/tool-names.d.ts +7 -0
  26. package/dist/agent-runtime/src/tool-names.js +4 -0
  27. package/dist/agent-runtime/src/tool-names.js.map +1 -1
  28. package/dist/agent-runtime/src/use-deep-agent-runtime.cjs +18 -1
  29. package/dist/agent-runtime/src/use-deep-agent-runtime.cjs.map +1 -1
  30. package/dist/agent-runtime/src/use-deep-agent-runtime.d.ts +19 -10
  31. package/dist/agent-runtime/src/use-deep-agent-runtime.js +19 -2
  32. package/dist/agent-runtime/src/use-deep-agent-runtime.js.map +1 -1
  33. package/dist/agent-runtime/src/use-deep-agent-thread.cjs +28 -10
  34. package/dist/agent-runtime/src/use-deep-agent-thread.cjs.map +1 -1
  35. package/dist/agent-runtime/src/use-deep-agent-thread.d.ts +35 -3
  36. package/dist/agent-runtime/src/use-deep-agent-thread.js +28 -10
  37. package/dist/agent-runtime/src/use-deep-agent-thread.js.map +1 -1
  38. package/dist/agent-runtime/src/use-deep-agent-voice.cjs +20 -0
  39. package/dist/agent-runtime/src/use-deep-agent-voice.cjs.map +1 -1
  40. package/dist/agent-runtime/src/use-deep-agent-voice.js +20 -0
  41. package/dist/agent-runtime/src/use-deep-agent-voice.js.map +1 -1
  42. package/dist/agent-runtime/src/voice-presentation.cjs +2 -0
  43. package/dist/agent-runtime/src/voice-presentation.cjs.map +1 -1
  44. package/dist/agent-runtime/src/voice-presentation.js +2 -0
  45. package/dist/agent-runtime/src/voice-presentation.js.map +1 -1
  46. package/dist/catalog/runtime-catalog.js +1 -1
  47. package/dist/chat/AthenaChat.cjs +125 -103
  48. package/dist/chat/AthenaChat.cjs.map +1 -1
  49. package/dist/chat/AthenaChat.d.ts +9 -0
  50. package/dist/chat/AthenaChat.js +126 -104
  51. package/dist/chat/AthenaChat.js.map +1 -1
  52. package/dist/chat/chat-voice-controls.cjs +128 -0
  53. package/dist/chat/chat-voice-controls.cjs.map +1 -0
  54. package/dist/chat/chat-voice-controls.d.ts +19 -0
  55. package/dist/chat/chat-voice-controls.js +128 -0
  56. package/dist/chat/chat-voice-controls.js.map +1 -0
  57. package/dist/chat/use-statewire-approval-request.js +1 -1
  58. package/dist/chat-ui/composer/tiptap-composer.cjs +42 -22
  59. package/dist/chat-ui/composer/tiptap-composer.cjs.map +1 -1
  60. package/dist/chat-ui/composer/tiptap-composer.d.ts +1 -0
  61. package/dist/chat-ui/composer/tiptap-composer.js +43 -23
  62. package/dist/chat-ui/composer/tiptap-composer.js.map +1 -1
  63. package/dist/chat-ui/mentions/suggestions/data/api-client.cjs +2 -1
  64. package/dist/chat-ui/mentions/suggestions/data/api-client.cjs.map +1 -1
  65. package/dist/chat-ui/mentions/suggestions/data/api-client.d.ts +3 -1
  66. package/dist/chat-ui/mentions/suggestions/data/api-client.js +2 -1
  67. package/dist/chat-ui/mentions/suggestions/data/api-client.js.map +1 -1
  68. package/dist/chat-ui/mentions/use-account-workspace-id.cjs +29 -51
  69. package/dist/chat-ui/mentions/use-account-workspace-id.cjs.map +1 -1
  70. package/dist/chat-ui/mentions/use-account-workspace-id.d.ts +2 -2
  71. package/dist/chat-ui/mentions/use-account-workspace-id.js +30 -52
  72. package/dist/chat-ui/mentions/use-account-workspace-id.js.map +1 -1
  73. package/dist/chat-ui/thread/composer-send-or-stop.cjs +2 -1
  74. package/dist/chat-ui/thread/composer-send-or-stop.cjs.map +1 -1
  75. package/dist/chat-ui/thread/composer-send-or-stop.d.ts +2 -0
  76. package/dist/chat-ui/thread/composer-send-or-stop.js +2 -1
  77. package/dist/chat-ui/thread/composer-send-or-stop.js.map +1 -1
  78. package/dist/diagnostics/athena-diagnostics.cjs.map +1 -1
  79. package/dist/diagnostics/athena-diagnostics.d.ts +1 -1
  80. package/dist/diagnostics/athena-diagnostics.js.map +1 -1
  81. package/dist/index.d.ts +1 -1
  82. package/dist/react/package.json.cjs +1 -1
  83. package/dist/react/package.json.js +1 -1
  84. package/dist/runtime/statewire-session-key.cjs.map +1 -1
  85. package/dist/runtime/statewire-session-key.d.ts +8 -5
  86. package/dist/runtime/statewire-session-key.js.map +1 -1
  87. package/dist/runtime/useAthenaStatewireRuntime.cjs +5 -2
  88. package/dist/runtime/useAthenaStatewireRuntime.cjs.map +1 -1
  89. package/dist/runtime/useAthenaStatewireRuntime.js +5 -2
  90. package/dist/runtime/useAthenaStatewireRuntime.js.map +1 -1
  91. package/dist/voice/use-chat-voice-enabled.cjs +43 -0
  92. package/dist/voice/use-chat-voice-enabled.cjs.map +1 -0
  93. package/dist/voice/use-chat-voice-enabled.d.ts +9 -0
  94. package/dist/voice/use-chat-voice-enabled.js +43 -0
  95. package/dist/voice/use-chat-voice-enabled.js.map +1 -0
  96. package/package.json +4 -8
package/README.md CHANGED
@@ -245,11 +245,14 @@ A `getToken` resolver is called with `{ force: true }` right after the sync
245
245
  host refuses a credential, so a caching getter must mint a fresh token then;
246
246
  the persisted command lane is scoped to the signed-in user as well as the
247
247
  host, so a shared browser never resends one user's pending sends under the
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.
248
+ next user's token. That holds while the chat stays mounted too: when the
249
+ signed-in user changes under it, the chat reconnects on the new user's lane as
250
+ a new client, and what the previous user had not yet delivered waits under
251
+ their name for their next sign-in. While a sign-in provider above the chat is
252
+ still loading who is signed in (`AthenaAuthContext` with `isLoading: true` and
253
+ no `user` yet), the chat does not connect and stores nothing: it connects
254
+ once, under the signed-in user, when they are known, and sends made meanwhile
255
+ wait for that.
253
256
 
254
257
  What the statewire transport wires up in `AthenaChat`:
255
258
 
@@ -737,12 +740,32 @@ registry entries (`SESSION_WORKBENCH_TASKS_PANE`, …), the data hooks
737
740
  (`deriveShellRows`, `filterShellRows`, `deriveTaskSteps`, `taskProgress`,
738
741
  `workspaceComputers`) are exported for hosts composing their own.
739
742
 
743
+ ## Chat voice in AthenaChat
744
+
745
+ `AthenaChat` includes realtime voice alongside dictation where the deployment
746
+ and workspace enable it. Start with the headphones button; during a call it
747
+ mutes or unmutes the microphone, and the voice strip ends the call. Plain typed
748
+ messages join the live conversation. Attachments and quotes keep their normal
749
+ run queue, and a refused voice text send falls back to that queue.
750
+
751
+ The composer owns one shared voice controller and lazy LiveKit adapter. A
752
+ pending connection can be cancelled, and unmount, a changed account/environment,
753
+ or revoked voice access releases the microphone. Dictation and realtime voice
754
+ cannot capture together. Model, agent, mode and toolkit changes sync through the
755
+ same model context for the next delegated task.
756
+
757
+ Use `<AthenaChat voice={false} />` to omit realtime voice in a host that cannot
758
+ support it, or `voice={{ model: 'gemini-3.8-live' }}` to request a host-offered
759
+ voice model. A custom `livekit` adapter and `onDiagnostic` observer are accepted
760
+ in the same options. `readOnly` chats expose no voice controls. This UI uses the
761
+ server's voice access decision; it cannot override workspace or deployment policy.
762
+
740
763
  ## Chat voice media (`@athenaintel/react/voice/livekit`)
741
764
 
742
765
  Hosts using the shared agent runtime can use the SDK's browser LiveKit adapter
743
766
  for chat voice. The runtime owns the voice commands and transcript; the adapter
744
767
  joins the authorized room, publishes the microphone and plays the agent audio.
745
- Install the optional `livekit-client` peer before starting a session.
768
+ The SDK includes `livekit-client` at the shared runtime version; its media code loads only when a session starts.
746
769
 
747
770
  ```tsx
748
771
  import { useMemo, useRef } from 'react';
@@ -784,7 +807,7 @@ agent audio, live/interim transcript turns, reconnects, StrictMode-safe
784
807
  teardown — so an app is a `start()` button and a transcript list.
785
808
 
786
809
  ```bash
787
- bun add @athenaintel/react livekit-client # optional peer dep, only needed for voice
810
+ bun add @athenaintel/react
788
811
  ```
789
812
 
790
813
  ```tsx
@@ -860,6 +883,12 @@ Both use the same bearer / API key as session creation. The full recipe
860
883
  template skill `voice-session-guide.md`. `createAthenaVoiceSession` is also
861
884
  exported if you hold the bridge state yourself.
862
885
 
886
+ ## What's new in 0.42.2
887
+
888
+ **A message one signed-in user queued is never sent as the next user who signs in to the same chat.** The chat keeps each conversation's unconfirmed commands in this browser under the signed-in user, so a reload can resend them. When the signed-in user changed while the chat stayed mounted (a sign-in provider of your own that signs a signed-out person in, or `AthenaSSOProvider` with `revalidateOnWindowFocus` picking up another account), the conversation moved to the new user's key and took the previous user's client id, command numbers and unsent commands with it. A message the previous user sent while offline, or that had not yet reached Athena, could then go out on the new user's connection, as the new user. With the chat connected at the time, the reverse happened: the new user's messages went out on the connection the previous user had opened, and Athena ran them as the previous user.
889
+
890
+ The chat now treats a change of signed-in user as a new conversation session. It reconnects on the new user's own key as a new client, and loads the conversation again as that user instead of showing the previous user's copy of it. Nothing the previous user queued goes with it. What they had not yet delivered stays under their key in this browser: it goes out, as them, when they sign in to the chat again, and the usual 7-day retention removes it otherwise. A token refresh for the same user changes nothing. 0.42.1 and earlier carry the previous user's pending commands over to the next user. Nothing to change in your app.
891
+
863
892
  ## What's new in 0.42.1
864
893
 
865
894
  **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.
@@ -14,7 +14,7 @@ export { type AbandonedInputRequest, type ApprovalResumeLock, asHitlApproval, ca
14
14
  export { buildQueueEditCommand, buildStatewireQueueRows, describeQueueSendFailure, isFailedSendEntryRace, isQueueEntryUnsettled, QUEUE_AUTO_CONTINUE_DELAY_MS, type QueueEditCommand, queueEntryText, queueLaneFlags, type QueueLaneFlags, readPrioritizedQueueIds, showQueueRowSendNow, showQueueRowSteer, type StatewireQueueRow, userStopBlocksQueueAutoContinue, } from "./queue";
15
15
  export { createDeepAgentSendRecovery, type DeepAgentSendRecovery, type DeepAgentSendRecoveryOptions, shouldAutoRetryFailedSend, } from "./send-recovery";
16
16
  export { hasStatewireThreadExtras, readStatewireFailedSendLane, requireStatewireFailedActions, type StatewireFailedActions, type StatewireFailedSendEntry, type StatewireFailedSendLane, } from "./thread-extras";
17
- export { applyRunErrorStatus, ATHENA_ERRORS_KEY, ATHENA_HANDOFF_KEY, ATHENA_QUEUED_LANE_KEY, ATHENA_RUN_MARKER_CANCELLED, ATHENA_RUN_MARKER_FAILED, ATHENA_RUN_MARKER_KEY, ATHENA_RUN_MARKER_SOURCE_KEY, ATHENA_STOP_SOURCE_INSTANCE_CLOSED, ATHENA_STOP_SOURCE_POD_DRAIN, ATHENA_STOP_SOURCE_SEND_NOW, ATHENA_STOP_SOURCE_VOICE_STEER, ATHENA_TERMINATION_REASON_KEY, convertDeepAgentLangChainMessage, convertDeepAgentState, type ConvertDeepAgentStateOptions, createDeepAgentMaterialize, createDeepAgentMessageConversionCache, type DeepAgentConversionMemory, deepAgentMaterialize, type DeepAgentMaterializeOptions, DeepAgentMessageConversionCache, deepAgentRowKey, isConvertibleChatMessage, isDrainRunMarker, isLangGraphState, isMessageHiddenFromFrontend, isQueuedLaneMessage, isServerUpdateStopSource, isSilentRunMarker, laneTailMessages, liftBranchIntoMetadata, liftCompactionBoundaryIntoMetadata, liftConversationStatsIntoMetadata, liftErrorsIntoMetadata, liftHandoffSummaryIntoMetadata, liftModelIntoMetadata, liftRunMarkerIntoMetadata, liftTerminationIntoMetadata, liftToolMessageMetadataIntoArtifact, liftTruncatedToolOutputIntoArtifact, markPreliminaryToolResults, messageConverter, nativeStepUsage, PENDING_ASSISTANT_MESSAGE_ID, readMessageErrorsFromSourceMessages, readRunMarkerFromSourceMessages, readSoleRunMarker, type RunMarkerInfo, sanitizeLangChainMessages, substituteToolOutput, withPendingAssistantMessage, } from "./messages";
17
+ export { applyRunErrorStatus, ATHENA_ERRORS_KEY, ATHENA_HANDOFF_KEY, ATHENA_QUEUED_LANE_KEY, ATHENA_RUN_MARKER_CANCELLED, ATHENA_RUN_MARKER_FAILED, ATHENA_RUN_MARKER_KEY, ATHENA_RUN_MARKER_SOURCE_KEY, ATHENA_STOP_SOURCE_INSTANCE_CLOSED, ATHENA_STOP_SOURCE_POD_DRAIN, ATHENA_STOP_SOURCE_SEND_NOW, ATHENA_STOP_SOURCE_VOICE_STEER, ATHENA_TERMINATION_REASON_KEY, convertDeepAgentLangChainMessage, convertDeepAgentState, type ConvertDeepAgentStateOptions, type DeepAgentMessageConversionOptions, createDeepAgentMaterialize, createDeepAgentMessageConversionCache, type DeepAgentConversionMemory, deepAgentMaterialize, type DeepAgentMaterializeOptions, DeepAgentMessageConversionCache, deepAgentRowKey, isConvertibleChatMessage, isDrainRunMarker, isLangGraphState, isMessageHiddenFromFrontend, isQueuedLaneMessage, isServerUpdateStopSource, isSilentRunMarker, laneTailMessages, liftBranchIntoMetadata, liftCompactionBoundaryIntoMetadata, liftConversationStatsIntoMetadata, liftErrorsIntoMetadata, liftHandoffSummaryIntoMetadata, liftModelIntoMetadata, liftRunMarkerIntoMetadata, liftTerminationIntoMetadata, liftToolMessageMetadataIntoArtifact, liftTruncatedToolOutputIntoArtifact, convertDeepAgentMessage, markPreliminaryToolResults, messageConverter, nativeStepUsage, PENDING_ASSISTANT_MESSAGE_ID, readMessageErrorsFromSourceMessages, readRunMarkerFromSourceMessages, readSoleRunMarker, type RunMarkerInfo, sanitizeLangChainMessages, substituteToolOutput, withPendingAssistantMessage, } from "./messages";
18
18
  export { ATHENA_TRUNCATED_TOOL_OUTPUT_ARTIFACT_KEY, buildHistoryMessageCommand, buildToolOutputCommand, clampMessageWindowSize, type DeepAgentInterestChainEntry, type DeepAgentInterestRequest, type DeepAgentInterestResolution, type DeepAgentMessageWindow, type DeepAgentMessageWindowDeclaration, headInterestRequest, type HistoryMessageCommand, type HistoryMessageResult, interestsCovered, pageInterestRequest, pageInterestRequests, readDeepAgentInterestDocument, readDeepAgentInterestResolution, readDeepAgentMessageWindow, readHistoryMessageResult, readToolOutputResult, readTruncatedToolContent, readTruncatedToolOutputArtifact, type ToolOutputCommand, type ToolOutputResult, type TruncatedToolContent, type TruncatedToolOutputArtifact, withDeclaredMessageWindow, } from "./message-window";
19
19
  export { buildHistoryLaneCommand, type DeepAgentLaneHistoryState, type DeepAgentLaneTarget, deepAgentLaneHistoryQueryKey, type HistoryLaneCommand, type HistoryLanePage, isWholeCardRefusal, mergeLaneHistory, readHistoryLanePage, useDeepAgentLaneHistory, } from "./lane-history";
20
20
  export { buildHistoryLaneImageCommand, type DeepAgentLaneImagesState, deepAgentLaneImageQueryKey, type HistoryLaneImageChunk, type HistoryLaneImageCommand, type InlineImage, type InlineImageChunk, type LaneImageRef, laneImageKey, omittedLaneImages, readChunkedInlineImage, readHistoryLaneImageChunk, readInlineImageChunk, readLaneImage, readLaneImageTile, showLaneImages, useDeepAgentLaneImages, } from "./lane-images";
@@ -34,7 +34,7 @@ export { type CompletedPtcParent, extractCompletedPtcParents, type PtcSubcall, p
34
34
  export { isRunningToolPlaceholder, isRunningToolPlaceholderArtifact, } from "./running-tool-placeholder";
35
35
  export { convertSubagentTranscript, createSubagentLaneConversion, createSubagentTranscriptConversionCache, type SubagentLaneConversion, withLaneReport, withRepeatedResult, } from "./subagent-transcripts";
36
36
  export { countSubagentStatuses, deriveEvalSubagents, finalizeOrphanedSubagents, isTerminalSubagentStatus, nestedMessagesFromArtifact, nestedTodosFromArtifact, ORPHANED_SUBAGENT_OUTPUT, ptcSubagentsFromArtifact, readLaneUsage, readTruncatedLane, type SubagentDiscoverySnapshot, type SubagentLaneSource, type SubagentStatus, type SubagentStatusCounts, type SubagentTokenUsage, subagentAwaitingApproval, subagentToolCallAwaitingApproval, type TaskSiblingGroup, type TokenCounts, type TruncatedLane, taskSiblingGroup, taskSubagentsOfThread, taskSubagentsOfTurn, transcriptStepUsage, turnToolCallsAwaitingApproval, useTurnToolCallsAwaitingApproval, } from "./subagents";
37
- export { ASYNC_TASK_TOOL_NAMES, CANCEL_ASYNC_TASK_TOOL_NAME, CHECK_ASYNC_TASK_TOOL_NAME, EDIT_FILE_TOOL_NAME, EVAL_TOOL_NAME, EXECUTE_PRESENTATION_CODE_TOOL_NAME, EXECUTE_SPREADSHEET_CODE_TOOL_NAME, EXECUTE_TOOL_NAME, EXECUTE_WORD_DOCUMENT_CODE_TOOL_NAME, type FileToolArgs, LIST_ASYNC_TASKS_TOOL_NAME, PTC_PARENT_TOOL_NAMES, RUN_PYTHON_CODE_TOOL_NAME, salientToolCallDetail, START_ASYNC_TASK_TOOL_NAME, TASK_TOOL_NAME, UPDATE_ASYNC_TASK_TOOL_NAME, WRITE_FILE_TOOL_NAME, } from "./tool-names";
37
+ export { ASYNC_TASK_TOOL_NAMES, CANCEL_ASYNC_TASK_TOOL_NAME, CHECK_ASYNC_TASK_TOOL_NAME, EDIT_FILE_TOOL_NAME, EVAL_TOOL_NAME, EXECUTE_PRESENTATION_CODE_TOOL_NAME, EXECUTE_SPREADSHEET_CODE_TOOL_NAME, EXECUTE_TOOL_NAME, EXECUTE_WORD_DOCUMENT_CODE_TOOL_NAME, type FileToolArgs, LIST_ASYNC_TASKS_TOOL_NAME, PTC_PARENT_TOOL_NAMES, QUIET_TOOL_NAMES, RUN_PYTHON_CODE_TOOL_NAME, salientToolCallDetail, START_ASYNC_TASK_TOOL_NAME, SUBMIT_FEEDBACK_TOOL_NAME, TASK_TOOL_NAME, UPDATE_ASYNC_TASK_TOOL_NAME, WRITE_FILE_TOOL_NAME, } from "./tool-names";
38
38
  export { buildOptimisticHumanContent, type OptimisticContentPart, } from "./optimistic-content";
39
39
  export { DEEP_AGENT_DEFAULT_CLIENT_PROTOCOL_VERSION, type DeepAgentProtocolDeclaration, type DeepAgentProtocolStatus, type DeepAgentWireProtocol, declaredDeepAgentProtocolVersion, isDeepAgentHostState, projectDeepAgentProtocol, readDeepAgentProtocol, withDeclaredProtocolVersion, } from "./protocol";
40
40
  export { AUTH_DENIAL_PARK_THRESHOLD, type AuthDenialTrackerState, initialAuthDenialTrackerState, observeAuthDenial, } from "./auth-denial";
@@ -14,6 +14,7 @@ const messageWindow = require("./message-window.cjs");
14
14
  const optimisticContent = require("./optimistic-content.cjs");
15
15
  const runningToolPlaceholder = require("./running-tool-placeholder.cjs");
16
16
  const statewireState = require("./statewire-state.cjs");
17
+ const toolNames = require("./tool-names.cjs");
17
18
  const voiceTurnGrouping = require("./voice-turn-grouping.cjs");
18
19
  const CACHE_EXCLUSIVE_ADAPTERS = /* @__PURE__ */ new Set([
19
20
  "amazon_bedrock",
@@ -79,7 +80,33 @@ const convertDeepAgentLangChainMessage = (message, metadata) => {
79
80
  }
80
81
  };
81
82
  };
82
- const messageConverter = react.createMessageConverter(convertDeepAgentLangChainMessage);
83
+ function withoutQuietToolCalls(message) {
84
+ const calls = message.tool_calls ?? [];
85
+ const quietIds = new Set(
86
+ calls.filter((call) => toolNames.QUIET_TOOL_NAMES.has(call.name)).map((call) => call.id)
87
+ );
88
+ const chunks = message.tool_call_chunks ?? [];
89
+ const quietChunk = (chunk) => toolNames.QUIET_TOOL_NAMES.has(chunk.name) || quietIds.has(chunk.id);
90
+ if (quietIds.size === 0 && !chunks.some(quietChunk)) return message;
91
+ return {
92
+ ...message,
93
+ ...message.tool_calls && {
94
+ tool_calls: calls.filter((call) => !quietIds.has(call.id))
95
+ },
96
+ ...message.tool_call_chunks && {
97
+ tool_call_chunks: chunks.filter((chunk) => !quietChunk(chunk))
98
+ }
99
+ };
100
+ }
101
+ const convertDeepAgentMessage = (message, metadata) => {
102
+ if (message.type === "tool" && toolNames.QUIET_TOOL_NAMES.has(message.name)) return [];
103
+ if (message.type === "ai") {
104
+ return convertDeepAgentLangChainMessage(withoutQuietToolCalls(message), metadata);
105
+ }
106
+ return convertDeepAgentLangChainMessage(message, metadata);
107
+ };
108
+ const messageConverter = react.createMessageConverter(convertDeepAgentMessage);
109
+ const messageConverterShowingQuietTools = react.createMessageConverter(convertDeepAgentLangChainMessage);
83
110
  const preliminaryMarkedTurns = /* @__PURE__ */ new WeakMap();
84
111
  function markPreliminaryToolResults(message) {
85
112
  if (message.role !== "assistant") return message;
@@ -97,7 +124,7 @@ function markPreliminaryToolResults(message) {
97
124
  return marked;
98
125
  }
99
126
  class DeepAgentMessageConversionCache {
100
- constructor() {
127
+ constructor({ showQuietTools = false } = {}) {
101
128
  __publicField(this, "cache", react.createExternalMessageConversionCache());
102
129
  /**
103
130
  * Every cached entry is rebuilt when the metadata object changes identity,
@@ -110,6 +137,8 @@ class DeepAgentMessageConversionCache {
110
137
  __publicField(this, "previous", null);
111
138
  /** `convertExternalMessages`' own rows for the previous pass, before parts were kept. */
112
139
  __publicField(this, "previousConverted", null);
140
+ __publicField(this, "callback");
141
+ this.callback = showQuietTools ? convertDeepAgentLangChainMessage : convertDeepAgentMessage;
113
142
  }
114
143
  /**
115
144
  * Convert one pass's LangChain messages. Returns the previous pass's array
@@ -122,7 +151,7 @@ class DeepAgentMessageConversionCache {
122
151
  convert(messages, isRunning) {
123
152
  const converted = react.convertExternalMessages(
124
153
  messages,
125
- convertDeepAgentLangChainMessage,
154
+ this.callback,
126
155
  isRunning,
127
156
  this.metadata,
128
157
  this.cache
@@ -241,8 +270,8 @@ function withUnchangedParts({
241
270
  });
242
271
  return kept === 0 ? message : { ...message, content };
243
272
  }
244
- function createDeepAgentMessageConversionCache() {
245
- return new DeepAgentMessageConversionCache();
273
+ function createDeepAgentMessageConversionCache(options = {}) {
274
+ return new DeepAgentMessageConversionCache(options);
246
275
  }
247
276
  function isSameMessageList(a, b) {
248
277
  return a.length === b.length && a.every((message, index) => message === b[index]);
@@ -694,7 +723,8 @@ function convertDeepAgentState(state, {
694
723
  selfAuthor = null,
695
724
  toolOutputs,
696
725
  withdrawnTurns,
697
- conversionCache
726
+ conversionCache,
727
+ showQuietTools = false
698
728
  } = {}) {
699
729
  var _a, _b;
700
730
  const values = statewireState.readDeepAgentStreamValues(state);
@@ -714,7 +744,7 @@ function convertDeepAgentState(state, {
714
744
  ...laneTail
715
745
  ];
716
746
  return {
717
- messages: conversionCache ? conversionCache.convert(sources, isRunning) : messageConverter.toThreadMessages(sources, isRunning).map(markPreliminaryToolResults),
747
+ messages: conversionCache ? conversionCache.convert(sources, isRunning) : (showQuietTools ? messageConverterShowingQuietTools : messageConverter).toThreadMessages(sources, isRunning).map(markPreliminaryToolResults),
718
748
  isRunning
719
749
  };
720
750
  }
@@ -732,6 +762,7 @@ exports.ATHENA_TERMINATION_REASON_KEY = ATHENA_TERMINATION_REASON_KEY;
732
762
  exports.DeepAgentMessageConversionCache = DeepAgentMessageConversionCache;
733
763
  exports.PENDING_ASSISTANT_MESSAGE_ID = PENDING_ASSISTANT_MESSAGE_ID;
734
764
  exports.convertDeepAgentLangChainMessage = convertDeepAgentLangChainMessage;
765
+ exports.convertDeepAgentMessage = convertDeepAgentMessage;
735
766
  exports.convertDeepAgentState = convertDeepAgentState;
736
767
  exports.createDeepAgentMaterialize = createDeepAgentMaterialize;
737
768
  exports.createDeepAgentMessageConversionCache = createDeepAgentMessageConversionCache;