@athenaintel/react 0.19.0 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (987) hide show
  1. package/README.md +171 -11
  2. package/dist/assets/AssetPanel.cjs +277 -0
  3. package/dist/assets/AssetPanel.cjs.map +1 -0
  4. package/dist/assets/AssetPanel.js +277 -0
  5. package/dist/assets/AssetPanel.js.map +1 -0
  6. package/dist/assets/AthenaAssetEmbed.cjs +151 -0
  7. package/dist/assets/AthenaAssetEmbed.cjs.map +1 -0
  8. package/dist/assets/AthenaAssetEmbed.js +151 -0
  9. package/dist/assets/AthenaAssetEmbed.js.map +1 -0
  10. package/dist/assets/AthenaLayout.cjs +69 -0
  11. package/dist/assets/AthenaLayout.cjs.map +1 -0
  12. package/dist/assets/AthenaLayout.js +69 -0
  13. package/dist/assets/AthenaLayout.js.map +1 -0
  14. package/dist/assets/asset-embed-messages.cjs +39 -0
  15. package/dist/assets/asset-embed-messages.cjs.map +1 -0
  16. package/dist/assets/asset-embed-messages.js +39 -0
  17. package/dist/assets/asset-embed-messages.js.map +1 -0
  18. package/dist/assets/asset-panel-store.cjs +124 -0
  19. package/dist/assets/asset-panel-store.cjs.map +1 -0
  20. package/dist/assets/asset-panel-store.js +124 -0
  21. package/dist/assets/asset-panel-store.js.map +1 -0
  22. package/dist/assets/asset-panel-url.cjs +40 -0
  23. package/dist/assets/asset-panel-url.cjs.map +1 -0
  24. package/dist/assets/asset-panel-url.js +40 -0
  25. package/dist/assets/asset-panel-url.js.map +1 -0
  26. package/dist/assets/use-asset-embed.cjs +370 -0
  27. package/dist/assets/use-asset-embed.cjs.map +1 -0
  28. package/dist/assets/use-asset-embed.js +370 -0
  29. package/dist/assets/use-asset-embed.js.map +1 -0
  30. package/dist/{AthenaAuthContext-B3AwLA5Z.cjs → auth/AthenaAuthContext.cjs} +5 -4
  31. package/dist/auth/AthenaAuthContext.cjs.map +1 -0
  32. package/dist/{AthenaAuthContext-DQsdayH2.js → auth/AthenaAuthContext.js} +3 -3
  33. package/dist/auth/AthenaAuthContext.js.map +1 -0
  34. package/dist/auth/AthenaAuthProvider.cjs +141 -0
  35. package/dist/auth/AthenaAuthProvider.cjs.map +1 -0
  36. package/dist/auth/AthenaAuthProvider.js +141 -0
  37. package/dist/auth/AthenaAuthProvider.js.map +1 -0
  38. package/dist/{auth.cjs → auth/AthenaSSOProvider.cjs} +14 -151
  39. package/dist/auth/AthenaSSOProvider.cjs.map +1 -0
  40. package/dist/{auth.js → auth/AthenaSSOProvider.js} +4 -142
  41. package/dist/auth/AthenaSSOProvider.js.map +1 -0
  42. package/dist/auth/index.cjs +10 -0
  43. package/dist/auth/index.cjs.map +1 -0
  44. package/dist/auth/index.js +10 -0
  45. package/dist/auth/index.js.map +1 -0
  46. package/dist/chat/AthenaChat.cjs +753 -0
  47. package/dist/chat/AthenaChat.cjs.map +1 -0
  48. package/dist/chat/AthenaChat.d.ts +3 -2
  49. package/dist/chat/AthenaChat.js +753 -0
  50. package/dist/chat/AthenaChat.js.map +1 -0
  51. package/dist/chat/AthenaChatErrorBoundary.cjs +53 -0
  52. package/dist/chat/AthenaChatErrorBoundary.cjs.map +1 -0
  53. package/dist/chat/AthenaChatErrorBoundary.js +53 -0
  54. package/dist/chat/AthenaChatErrorBoundary.js.map +1 -0
  55. package/dist/chat/StatewireApprovalCard.cjs +189 -0
  56. package/dist/chat/StatewireApprovalCard.cjs.map +1 -0
  57. package/dist/chat/StatewireApprovalCard.d.ts +14 -0
  58. package/dist/chat/StatewireApprovalCard.js +189 -0
  59. package/dist/chat/StatewireApprovalCard.js.map +1 -0
  60. package/dist/chat/StatewireClientToolBridge.cjs +51 -0
  61. package/dist/chat/StatewireClientToolBridge.cjs.map +1 -0
  62. package/dist/chat/StatewireClientToolBridge.js +51 -0
  63. package/dist/chat/StatewireClientToolBridge.js.map +1 -0
  64. package/dist/chat/StatewireQueuedMessages.cjs +433 -0
  65. package/dist/chat/StatewireQueuedMessages.cjs.map +1 -0
  66. package/dist/chat/StatewireQueuedMessages.d.ts +3 -4
  67. package/dist/chat/StatewireQueuedMessages.js +433 -0
  68. package/dist/chat/StatewireQueuedMessages.js.map +1 -0
  69. package/dist/chat/athena-citation-links.cjs +342 -0
  70. package/dist/chat/athena-citation-links.cjs.map +1 -0
  71. package/dist/chat/athena-citation-links.js +342 -0
  72. package/dist/chat/athena-citation-links.js.map +1 -0
  73. package/dist/chat/run-activity.cjs +28 -0
  74. package/dist/chat/run-activity.cjs.map +1 -0
  75. package/dist/chat/run-activity.js +28 -0
  76. package/dist/chat/run-activity.js.map +1 -0
  77. package/dist/chat/statewire-banners.cjs +83 -0
  78. package/dist/chat/statewire-banners.cjs.map +1 -0
  79. package/dist/chat/statewire-banners.js +83 -0
  80. package/dist/chat/statewire-banners.js.map +1 -0
  81. package/dist/chat/statewire-client-tools.cjs +74 -0
  82. package/dist/chat/statewire-client-tools.cjs.map +1 -0
  83. package/dist/chat/statewire-client-tools.js +74 -0
  84. package/dist/chat/statewire-client-tools.js.map +1 -0
  85. package/dist/chat/super-grouping/CollapsibleGroup.cjs +158 -0
  86. package/dist/chat/super-grouping/CollapsibleGroup.cjs.map +1 -0
  87. package/dist/chat/super-grouping/CollapsibleGroup.js +158 -0
  88. package/dist/chat/super-grouping/CollapsibleGroup.js.map +1 -0
  89. package/dist/chat/super-grouping/SuperGroupingCard.cjs +243 -0
  90. package/dist/chat/super-grouping/SuperGroupingCard.cjs.map +1 -0
  91. package/dist/chat/super-grouping/SuperGroupingCard.d.ts +14 -7
  92. package/dist/chat/super-grouping/SuperGroupingCard.js +243 -0
  93. package/dist/chat/super-grouping/SuperGroupingCard.js.map +1 -0
  94. package/dist/chat/super-grouping/ToolTimeline.cjs +131 -0
  95. package/dist/chat/super-grouping/ToolTimeline.cjs.map +1 -0
  96. package/dist/chat/super-grouping/ToolTimeline.d.ts +16 -0
  97. package/dist/chat/super-grouping/ToolTimeline.js +131 -0
  98. package/dist/chat/super-grouping/ToolTimeline.js.map +1 -0
  99. package/dist/chat/super-grouping/activity-timeline.cjs +157 -0
  100. package/dist/chat/super-grouping/activity-timeline.cjs.map +1 -0
  101. package/dist/chat/super-grouping/activity-timeline.d.ts +6 -3
  102. package/dist/chat/super-grouping/activity-timeline.js +157 -0
  103. package/dist/chat/super-grouping/activity-timeline.js.map +1 -0
  104. package/dist/chat/super-grouping/grouping-function.cjs +55 -0
  105. package/dist/chat/super-grouping/grouping-function.cjs.map +1 -0
  106. package/dist/chat/super-grouping/grouping-function.js +55 -0
  107. package/dist/chat/super-grouping/grouping-function.js.map +1 -0
  108. package/dist/chat/super-grouping/index.cjs +26 -0
  109. package/dist/chat/super-grouping/index.cjs.map +1 -0
  110. package/dist/chat/super-grouping/index.js +26 -0
  111. package/dist/chat/super-grouping/index.js.map +1 -0
  112. package/dist/chat/super-grouping/timeline-step.cjs +65 -0
  113. package/dist/chat/super-grouping/timeline-step.cjs.map +1 -0
  114. package/dist/chat/super-grouping/timeline-step.d.ts +17 -0
  115. package/dist/chat/super-grouping/timeline-step.js +65 -0
  116. package/dist/chat/super-grouping/timeline-step.js.map +1 -0
  117. package/dist/chat/super-grouping/toolkit-map.cjs +96 -0
  118. package/dist/chat/super-grouping/toolkit-map.cjs.map +1 -0
  119. package/dist/chat/super-grouping/toolkit-map.js +96 -0
  120. package/dist/chat/super-grouping/toolkit-map.js.map +1 -0
  121. package/dist/chat/tiptap-text.cjs +101 -0
  122. package/dist/chat/tiptap-text.cjs.map +1 -0
  123. package/dist/chat/tiptap-text.js +101 -0
  124. package/dist/chat/tiptap-text.js.map +1 -0
  125. package/dist/chat/tooltip-icon-button.cjs +32 -0
  126. package/dist/chat/tooltip-icon-button.cjs.map +1 -0
  127. package/dist/chat/tooltip-icon-button.js +32 -0
  128. package/dist/chat/tooltip-icon-button.js.map +1 -0
  129. package/dist/chat/use-athena-run-live.cjs +24 -0
  130. package/dist/chat/use-athena-run-live.cjs.map +1 -0
  131. package/dist/chat/use-athena-run-live.d.ts +10 -0
  132. package/dist/chat/use-athena-run-live.js +24 -0
  133. package/dist/chat/use-athena-run-live.js.map +1 -0
  134. package/dist/chat/use-statewire-approval-request.cjs +51 -0
  135. package/dist/chat/use-statewire-approval-request.cjs.map +1 -0
  136. package/dist/chat/use-statewire-approval-request.d.ts +12 -2
  137. package/dist/chat/use-statewire-approval-request.js +51 -0
  138. package/dist/chat/use-statewire-approval-request.js.map +1 -0
  139. package/dist/chat-ui/auth/sign-in-card.cjs +128 -0
  140. package/dist/chat-ui/auth/sign-in-card.cjs.map +1 -0
  141. package/dist/chat-ui/auth/sign-in-card.js +128 -0
  142. package/dist/chat-ui/auth/sign-in-card.js.map +1 -0
  143. package/dist/chat-ui/composer/composer-action.cjs +11 -0
  144. package/dist/chat-ui/composer/composer-action.cjs.map +1 -0
  145. package/dist/chat-ui/composer/composer-action.d.ts +5 -8
  146. package/dist/chat-ui/composer/composer-action.js +11 -0
  147. package/dist/chat-ui/composer/composer-action.js.map +1 -0
  148. package/dist/chat-ui/composer/pending-attachment-uploads.cjs +25 -0
  149. package/dist/chat-ui/composer/pending-attachment-uploads.cjs.map +1 -0
  150. package/dist/chat-ui/composer/pending-attachment-uploads.js +25 -0
  151. package/dist/chat-ui/composer/pending-attachment-uploads.js.map +1 -0
  152. package/dist/chat-ui/composer/tiptap-composer.cjs +549 -0
  153. package/dist/chat-ui/composer/tiptap-composer.cjs.map +1 -0
  154. package/dist/chat-ui/composer/tiptap-composer.d.ts +44 -7
  155. package/dist/chat-ui/composer/tiptap-composer.js +549 -0
  156. package/dist/chat-ui/composer/tiptap-composer.js.map +1 -0
  157. package/dist/chat-ui/header/chat-header.cjs +33 -0
  158. package/dist/chat-ui/header/chat-header.cjs.map +1 -0
  159. package/dist/chat-ui/header/chat-header.js +33 -0
  160. package/dist/chat-ui/header/chat-header.js.map +1 -0
  161. package/dist/chat-ui/header/conversation-history-panel.cjs +369 -0
  162. package/dist/chat-ui/header/conversation-history-panel.cjs.map +1 -0
  163. package/dist/chat-ui/header/conversation-history-panel.js +369 -0
  164. package/dist/chat-ui/header/conversation-history-panel.js.map +1 -0
  165. package/dist/chat-ui/index.cjs +140 -0
  166. package/dist/chat-ui/index.cjs.map +1 -0
  167. package/dist/chat-ui/index.d.ts +4 -3
  168. package/dist/chat-ui/index.js +140 -0
  169. package/dist/chat-ui/index.js.map +1 -0
  170. package/dist/chat-ui/lib/asset-urls.cjs +18 -0
  171. package/dist/chat-ui/lib/asset-urls.cjs.map +1 -0
  172. package/dist/chat-ui/lib/asset-urls.js +18 -0
  173. package/dist/chat-ui/lib/asset-urls.js.map +1 -0
  174. package/dist/chat-ui/mentions/mention-chip.cjs +253 -0
  175. package/dist/chat-ui/mentions/mention-chip.cjs.map +1 -0
  176. package/dist/chat-ui/mentions/mention-chip.d.ts +11 -0
  177. package/dist/chat-ui/mentions/mention-chip.js +253 -0
  178. package/dist/chat-ui/mentions/mention-chip.js.map +1 -0
  179. package/dist/chat-ui/mentions/mention-extension.cjs +196 -0
  180. package/dist/chat-ui/mentions/mention-extension.cjs.map +1 -0
  181. package/dist/chat-ui/mentions/mention-extension.d.ts +26 -2
  182. package/dist/chat-ui/mentions/mention-extension.js +196 -0
  183. package/dist/chat-ui/mentions/mention-extension.js.map +1 -0
  184. package/dist/chat-ui/mentions/suggestions/components/get-scope-name.cjs +35 -0
  185. package/dist/chat-ui/mentions/suggestions/components/get-scope-name.cjs.map +1 -0
  186. package/dist/chat-ui/mentions/suggestions/components/get-scope-name.js +35 -0
  187. package/dist/chat-ui/mentions/suggestions/components/get-scope-name.js.map +1 -0
  188. package/dist/chat-ui/mentions/suggestions/components/mention-icon.cjs +95 -0
  189. package/dist/chat-ui/mentions/suggestions/components/mention-icon.cjs.map +1 -0
  190. package/dist/chat-ui/mentions/suggestions/components/mention-icon.d.ts +5 -0
  191. package/dist/chat-ui/mentions/suggestions/components/mention-icon.js +95 -0
  192. package/dist/chat-ui/mentions/suggestions/components/mention-icon.js.map +1 -0
  193. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.cjs +116 -0
  194. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.cjs.map +1 -0
  195. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.js +116 -0
  196. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.js.map +1 -0
  197. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-popup.cjs +31 -0
  198. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-popup.cjs.map +1 -0
  199. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-popup.js +31 -0
  200. package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-popup.js.map +1 -0
  201. package/dist/chat-ui/mentions/suggestions/components/menu-breadcrumbs.cjs +27 -0
  202. package/dist/chat-ui/mentions/suggestions/components/menu-breadcrumbs.cjs.map +1 -0
  203. package/dist/chat-ui/mentions/suggestions/components/menu-breadcrumbs.js +27 -0
  204. package/dist/chat-ui/mentions/suggestions/components/menu-breadcrumbs.js.map +1 -0
  205. package/dist/chat-ui/mentions/suggestions/components/menu-item.cjs +65 -0
  206. package/dist/chat-ui/mentions/suggestions/components/menu-item.cjs.map +1 -0
  207. package/dist/chat-ui/mentions/suggestions/components/menu-item.d.ts +2 -2
  208. package/dist/chat-ui/mentions/suggestions/components/menu-item.js +65 -0
  209. package/dist/chat-ui/mentions/suggestions/components/menu-item.js.map +1 -0
  210. package/dist/chat-ui/mentions/suggestions/components/menu-list.cjs +63 -0
  211. package/dist/chat-ui/mentions/suggestions/components/menu-list.cjs.map +1 -0
  212. package/dist/chat-ui/mentions/suggestions/components/menu-list.d.ts +2 -2
  213. package/dist/chat-ui/mentions/suggestions/components/menu-list.js +63 -0
  214. package/dist/chat-ui/mentions/suggestions/components/menu-list.js.map +1 -0
  215. package/dist/chat-ui/mentions/suggestions/components/menu-skeleton.cjs +11 -0
  216. package/dist/chat-ui/mentions/suggestions/components/menu-skeleton.cjs.map +1 -0
  217. package/dist/chat-ui/mentions/suggestions/components/menu-skeleton.js +11 -0
  218. package/dist/chat-ui/mentions/suggestions/components/menu-skeleton.js.map +1 -0
  219. package/dist/chat-ui/mentions/suggestions/components/menu-summary.cjs +33 -0
  220. package/dist/chat-ui/mentions/suggestions/components/menu-summary.cjs.map +1 -0
  221. package/dist/chat-ui/mentions/suggestions/components/menu-summary.js +33 -0
  222. package/dist/chat-ui/mentions/suggestions/components/menu-summary.js.map +1 -0
  223. package/dist/chat-ui/mentions/suggestions/components/use-keyboard-navigation.cjs +58 -0
  224. package/dist/chat-ui/mentions/suggestions/components/use-keyboard-navigation.cjs.map +1 -0
  225. package/dist/chat-ui/mentions/suggestions/components/use-keyboard-navigation.js +58 -0
  226. package/dist/chat-ui/mentions/suggestions/components/use-keyboard-navigation.js.map +1 -0
  227. package/dist/chat-ui/mentions/suggestions/components/use-menu-navigation.cjs +81 -0
  228. package/dist/chat-ui/mentions/suggestions/components/use-menu-navigation.cjs.map +1 -0
  229. package/dist/chat-ui/mentions/suggestions/components/use-menu-navigation.js +81 -0
  230. package/dist/chat-ui/mentions/suggestions/components/use-menu-navigation.js.map +1 -0
  231. package/dist/chat-ui/mentions/suggestions/components/utils.cjs +18 -0
  232. package/dist/chat-ui/mentions/suggestions/components/utils.cjs.map +1 -0
  233. package/dist/chat-ui/mentions/suggestions/components/utils.js +18 -0
  234. package/dist/chat-ui/mentions/suggestions/components/utils.js.map +1 -0
  235. package/dist/chat-ui/mentions/suggestions/data/api-client.cjs +124 -0
  236. package/dist/chat-ui/mentions/suggestions/data/api-client.cjs.map +1 -0
  237. package/dist/chat-ui/mentions/suggestions/data/api-client.d.ts +13 -2
  238. package/dist/chat-ui/mentions/suggestions/data/api-client.js +124 -0
  239. package/dist/chat-ui/mentions/suggestions/data/api-client.js.map +1 -0
  240. package/dist/chat-ui/mentions/suggestions/data/item-cache.cjs +37 -0
  241. package/dist/chat-ui/mentions/suggestions/data/item-cache.cjs.map +1 -0
  242. package/dist/chat-ui/mentions/suggestions/data/item-cache.js +37 -0
  243. package/dist/chat-ui/mentions/suggestions/data/item-cache.js.map +1 -0
  244. package/dist/chat-ui/mentions/suggestions/data/orchestrator.cjs +134 -0
  245. package/dist/chat-ui/mentions/suggestions/data/orchestrator.cjs.map +1 -0
  246. package/dist/chat-ui/mentions/suggestions/data/orchestrator.js +134 -0
  247. package/dist/chat-ui/mentions/suggestions/data/orchestrator.js.map +1 -0
  248. package/dist/chat-ui/mentions/suggestions/data/scope-registry.cjs +91 -0
  249. package/dist/chat-ui/mentions/suggestions/data/scope-registry.cjs.map +1 -0
  250. package/dist/chat-ui/mentions/suggestions/data/scope-registry.js +91 -0
  251. package/dist/chat-ui/mentions/suggestions/data/scope-registry.js.map +1 -0
  252. package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.cjs +137 -0
  253. package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.cjs.map +1 -0
  254. package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.js +137 -0
  255. package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.js.map +1 -0
  256. package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs +375 -0
  257. package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs.map +1 -0
  258. package/dist/chat-ui/mentions/suggestions/data/sources/index.d.ts +16 -1
  259. package/dist/chat-ui/mentions/suggestions/data/sources/index.js +375 -0
  260. package/dist/chat-ui/mentions/suggestions/data/sources/index.js.map +1 -0
  261. package/dist/chat-ui/mentions/suggestions/data/types.cjs +9 -0
  262. package/dist/chat-ui/mentions/suggestions/data/types.cjs.map +1 -0
  263. package/dist/chat-ui/mentions/suggestions/data/types.d.ts +14 -0
  264. package/dist/chat-ui/mentions/suggestions/data/types.js +9 -0
  265. package/dist/chat-ui/mentions/suggestions/data/types.js.map +1 -0
  266. package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.cjs +173 -0
  267. package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.cjs.map +1 -0
  268. package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.d.ts +14 -4
  269. package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.js +173 -0
  270. package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.js.map +1 -0
  271. package/dist/chat-ui/mentions/suggestions/data/use-menu-items.cjs +45 -0
  272. package/dist/chat-ui/mentions/suggestions/data/use-menu-items.cjs.map +1 -0
  273. package/dist/chat-ui/mentions/suggestions/data/use-menu-items.js +45 -0
  274. package/dist/chat-ui/mentions/suggestions/data/use-menu-items.js.map +1 -0
  275. package/dist/chat-ui/mentions/suggestions/data/utils/filter-items.cjs +43 -0
  276. package/dist/chat-ui/mentions/suggestions/data/utils/filter-items.cjs.map +1 -0
  277. package/dist/chat-ui/mentions/suggestions/data/utils/filter-items.js +43 -0
  278. package/dist/chat-ui/mentions/suggestions/data/utils/filter-items.js.map +1 -0
  279. package/dist/chat-ui/mentions/suggestions/data/utils/match-query.cjs +14 -0
  280. package/dist/chat-ui/mentions/suggestions/data/utils/match-query.cjs.map +1 -0
  281. package/dist/chat-ui/mentions/suggestions/data/utils/match-query.js +14 -0
  282. package/dist/chat-ui/mentions/suggestions/data/utils/match-query.js.map +1 -0
  283. package/dist/chat-ui/mentions/suggestions/data/utils/score-match.cjs +48 -0
  284. package/dist/chat-ui/mentions/suggestions/data/utils/score-match.cjs.map +1 -0
  285. package/dist/chat-ui/mentions/suggestions/data/utils/score-match.js +48 -0
  286. package/dist/chat-ui/mentions/suggestions/data/utils/score-match.js.map +1 -0
  287. package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.cjs +71 -0
  288. package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.cjs.map +1 -0
  289. package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.js +71 -0
  290. package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.js.map +1 -0
  291. package/dist/chat-ui/messages/continue-pill.cjs +54 -0
  292. package/dist/chat-ui/messages/continue-pill.cjs.map +1 -0
  293. package/dist/chat-ui/messages/continue-pill.js +54 -0
  294. package/dist/chat-ui/messages/continue-pill.js.map +1 -0
  295. package/dist/chat-ui/messages/message-actions-config.cjs +12 -0
  296. package/dist/chat-ui/messages/message-actions-config.cjs.map +1 -0
  297. package/dist/chat-ui/messages/message-actions-config.js +12 -0
  298. package/dist/chat-ui/messages/message-actions-config.js.map +1 -0
  299. package/dist/chat-ui/messages/message-components.cjs +320 -0
  300. package/dist/chat-ui/messages/message-components.cjs.map +1 -0
  301. package/dist/chat-ui/messages/message-components.d.ts +1 -1
  302. package/dist/chat-ui/messages/message-components.js +320 -0
  303. package/dist/chat-ui/messages/message-components.js.map +1 -0
  304. package/dist/chat-ui/messages/running-indicator.cjs +49 -0
  305. package/dist/chat-ui/messages/running-indicator.cjs.map +1 -0
  306. package/dist/chat-ui/messages/running-indicator.js +49 -0
  307. package/dist/chat-ui/messages/running-indicator.js.map +1 -0
  308. package/dist/chat-ui/messages/runtime-message.cjs +66 -0
  309. package/dist/chat-ui/messages/runtime-message.cjs.map +1 -0
  310. package/dist/chat-ui/messages/runtime-message.js +66 -0
  311. package/dist/chat-ui/messages/runtime-message.js.map +1 -0
  312. package/dist/{statewire-continue-run-nE9VCKUh.cjs → chat-ui/messages/statewire-continue-run.cjs} +61 -23
  313. package/dist/chat-ui/messages/statewire-continue-run.cjs.map +1 -0
  314. package/dist/chat-ui/messages/statewire-continue-run.d.ts +19 -5
  315. package/dist/{statewire-continue-run-D34gS7_1.js → chat-ui/messages/statewire-continue-run.js} +51 -14
  316. package/dist/chat-ui/messages/statewire-continue-run.js.map +1 -0
  317. package/dist/chat-ui/messages/user-edit-composer.cjs +62 -0
  318. package/dist/chat-ui/messages/user-edit-composer.cjs.map +1 -0
  319. package/dist/chat-ui/messages/user-edit-composer.js +62 -0
  320. package/dist/chat-ui/messages/user-edit-composer.js.map +1 -0
  321. package/dist/chat-ui/messages/voice-delegation-card.cjs +51 -0
  322. package/dist/chat-ui/messages/voice-delegation-card.cjs.map +1 -0
  323. package/dist/chat-ui/messages/voice-delegation-card.d.ts +26 -0
  324. package/dist/chat-ui/messages/voice-delegation-card.js +51 -0
  325. package/dist/chat-ui/messages/voice-delegation-card.js.map +1 -0
  326. package/dist/chat-ui/rich-text/chat-message-body.cjs +76 -0
  327. package/dist/chat-ui/rich-text/chat-message-body.cjs.map +1 -0
  328. package/dist/chat-ui/rich-text/chat-message-body.d.ts +5 -0
  329. package/dist/chat-ui/rich-text/chat-message-body.js +76 -0
  330. package/dist/chat-ui/rich-text/chat-message-body.js.map +1 -0
  331. package/dist/chat-ui/rich-text/chat-node-views.cjs +51 -0
  332. package/dist/chat-ui/rich-text/chat-node-views.cjs.map +1 -0
  333. package/dist/chat-ui/rich-text/chat-node-views.d.ts +13 -0
  334. package/dist/chat-ui/rich-text/chat-node-views.js +51 -0
  335. package/dist/chat-ui/rich-text/chat-node-views.js.map +1 -0
  336. package/dist/chat-ui/rich-text/chat-text-schema.cjs +70 -0
  337. package/dist/chat-ui/rich-text/chat-text-schema.cjs.map +1 -0
  338. package/dist/chat-ui/rich-text/chat-text-schema.d.ts +7 -0
  339. package/dist/chat-ui/rich-text/chat-text-schema.js +70 -0
  340. package/dist/chat-ui/rich-text/chat-text-schema.js.map +1 -0
  341. package/dist/chat-ui/rich-text/dom-output-spec.cjs +83 -0
  342. package/dist/chat-ui/rich-text/dom-output-spec.cjs.map +1 -0
  343. package/dist/chat-ui/rich-text/dom-output-spec.d.ts +11 -0
  344. package/dist/chat-ui/rich-text/dom-output-spec.js +83 -0
  345. package/dist/chat-ui/rich-text/dom-output-spec.js.map +1 -0
  346. package/dist/chat-ui/statewire.cjs +40 -0
  347. package/dist/chat-ui/statewire.cjs.map +1 -0
  348. package/dist/chat-ui/statewire.js +40 -0
  349. package/dist/chat-ui/statewire.js.map +1 -0
  350. package/dist/chat-ui/thread/chat-composer-dock.cjs +37 -0
  351. package/dist/chat-ui/thread/chat-composer-dock.cjs.map +1 -0
  352. package/dist/chat-ui/thread/chat-composer-dock.js +37 -0
  353. package/dist/chat-ui/thread/chat-composer-dock.js.map +1 -0
  354. package/dist/chat-ui/thread/chat-thread-shell.cjs +102 -0
  355. package/dist/chat-ui/thread/chat-thread-shell.cjs.map +1 -0
  356. package/dist/chat-ui/thread/chat-thread-shell.js +102 -0
  357. package/dist/chat-ui/thread/chat-thread-shell.js.map +1 -0
  358. package/dist/chat-ui/thread/composer-send-or-stop.cjs +75 -0
  359. package/dist/chat-ui/thread/composer-send-or-stop.cjs.map +1 -0
  360. package/dist/chat-ui/thread/composer-send-or-stop.d.ts +0 -6
  361. package/dist/chat-ui/thread/composer-send-or-stop.js +75 -0
  362. package/dist/chat-ui/thread/composer-send-or-stop.js.map +1 -0
  363. package/dist/chat-ui/thread/statewire-history-edge.cjs +135 -0
  364. package/dist/chat-ui/thread/statewire-history-edge.cjs.map +1 -0
  365. package/dist/chat-ui/thread/statewire-history-edge.js +135 -0
  366. package/dist/chat-ui/thread/statewire-history-edge.js.map +1 -0
  367. package/dist/{collab.cjs → collab/client.cjs} +6 -166
  368. package/dist/collab/client.cjs.map +1 -0
  369. package/dist/{collab.js → collab/client.js} +5 -164
  370. package/dist/collab/client.js.map +1 -0
  371. package/dist/collab/close-policy.cjs +14 -0
  372. package/dist/collab/close-policy.cjs.map +1 -0
  373. package/dist/collab/close-policy.js +14 -0
  374. package/dist/collab/close-policy.js.map +1 -0
  375. package/dist/collab/index.cjs +17 -0
  376. package/dist/collab/index.cjs.map +1 -0
  377. package/dist/collab/index.js +17 -0
  378. package/dist/collab/index.js.map +1 -0
  379. package/dist/collab/mint.cjs +59 -0
  380. package/dist/collab/mint.cjs.map +1 -0
  381. package/dist/collab/mint.js +59 -0
  382. package/dist/collab/mint.js.map +1 -0
  383. package/dist/collab/react.cjs +58 -0
  384. package/dist/collab/react.cjs.map +1 -0
  385. package/dist/collab/react.js +58 -0
  386. package/dist/collab/react.js.map +1 -0
  387. package/dist/collab/shape.cjs +45 -0
  388. package/dist/collab/shape.cjs.map +1 -0
  389. package/dist/collab/shape.js +45 -0
  390. package/dist/collab/shape.js.map +1 -0
  391. package/dist/composer/AttachmentContext.cjs +40 -0
  392. package/dist/composer/AttachmentContext.cjs.map +1 -0
  393. package/dist/composer/AttachmentContext.js +40 -0
  394. package/dist/composer/AttachmentContext.js.map +1 -0
  395. package/dist/composer/ComposerAttachmentPreview.cjs +39 -0
  396. package/dist/composer/ComposerAttachmentPreview.cjs.map +1 -0
  397. package/dist/composer/ComposerAttachmentPreview.js +39 -0
  398. package/dist/composer/ComposerAttachmentPreview.js.map +1 -0
  399. package/dist/composer/ComposerDropZone.cjs +61 -0
  400. package/dist/composer/ComposerDropZone.cjs.map +1 -0
  401. package/dist/composer/ComposerDropZone.d.ts +1 -1
  402. package/dist/composer/ComposerDropZone.js +61 -0
  403. package/dist/composer/ComposerDropZone.js.map +1 -0
  404. package/dist/composer/ComposerQuotePreview.cjs +42 -0
  405. package/dist/composer/ComposerQuotePreview.cjs.map +1 -0
  406. package/dist/composer/ComposerQuotePreview.js +42 -0
  407. package/dist/composer/ComposerQuotePreview.js.map +1 -0
  408. package/dist/composer/FileUploadButton.cjs +65 -0
  409. package/dist/composer/FileUploadButton.cjs.map +1 -0
  410. package/dist/composer/FileUploadButton.d.ts +1 -1
  411. package/dist/composer/FileUploadButton.js +65 -0
  412. package/dist/composer/FileUploadButton.js.map +1 -0
  413. package/dist/composer/QuoteContext.cjs +68 -0
  414. package/dist/composer/QuoteContext.cjs.map +1 -0
  415. package/dist/composer/QuoteContext.js +68 -0
  416. package/dist/composer/QuoteContext.js.map +1 -0
  417. package/dist/composer/build-composed-message.cjs +25 -0
  418. package/dist/composer/build-composed-message.cjs.map +1 -0
  419. package/dist/composer/build-composed-message.js +25 -0
  420. package/dist/composer/build-composed-message.js.map +1 -0
  421. package/dist/composer/clipboard.cjs +62 -0
  422. package/dist/composer/clipboard.cjs.map +1 -0
  423. package/dist/composer/clipboard.d.ts +27 -3
  424. package/dist/composer/clipboard.js +62 -0
  425. package/dist/composer/clipboard.js.map +1 -0
  426. package/dist/composer/useAppendToComposer.cjs +21 -0
  427. package/dist/composer/useAppendToComposer.cjs.map +1 -0
  428. package/dist/composer/useAppendToComposer.js +21 -0
  429. package/dist/composer/useAppendToComposer.js.map +1 -0
  430. package/dist/composer/useAttachFiles.cjs +40 -0
  431. package/dist/composer/useAttachFiles.cjs.map +1 -0
  432. package/dist/composer/useAttachFiles.d.ts +24 -0
  433. package/dist/composer/useAttachFiles.js +40 -0
  434. package/dist/composer/useAttachFiles.js.map +1 -0
  435. package/dist/composer/useComposerAttachment.cjs +25 -0
  436. package/dist/composer/useComposerAttachment.cjs.map +1 -0
  437. package/dist/composer/useComposerAttachment.js +25 -0
  438. package/dist/composer/useComposerAttachment.js.map +1 -0
  439. package/dist/composer/useFileUpload.cjs +123 -0
  440. package/dist/composer/useFileUpload.cjs.map +1 -0
  441. package/dist/composer/useFileUpload.js +123 -0
  442. package/dist/composer/useFileUpload.js.map +1 -0
  443. package/dist/composer/useSendMessage.cjs +22 -0
  444. package/dist/composer/useSendMessage.cjs.map +1 -0
  445. package/dist/composer/useSendMessage.js +22 -0
  446. package/dist/composer/useSendMessage.js.map +1 -0
  447. package/dist/diagnostics/athena-diagnostics.cjs +329 -0
  448. package/dist/diagnostics/athena-diagnostics.cjs.map +1 -0
  449. package/dist/diagnostics/athena-diagnostics.js +329 -0
  450. package/dist/diagnostics/athena-diagnostics.js.map +1 -0
  451. package/dist/diagnostics/errors.cjs +89 -0
  452. package/dist/diagnostics/errors.cjs.map +1 -0
  453. package/dist/diagnostics/errors.js +89 -0
  454. package/dist/diagnostics/errors.js.map +1 -0
  455. package/dist/diagnostics/useAthenaDiagnostics.cjs +16 -0
  456. package/dist/diagnostics/useAthenaDiagnostics.cjs.map +1 -0
  457. package/dist/diagnostics/useAthenaDiagnostics.js +16 -0
  458. package/dist/diagnostics/useAthenaDiagnostics.js.map +1 -0
  459. package/dist/index.cjs +275 -27882
  460. package/dist/index.cjs.map +1 -1
  461. package/dist/index.d.ts +6 -4
  462. package/dist/index.js +162 -27759
  463. package/dist/index.js.map +1 -1
  464. package/dist/lib/athena-urls.cjs +194 -0
  465. package/dist/lib/athena-urls.cjs.map +1 -0
  466. package/dist/lib/athena-urls.d.ts +20 -5
  467. package/dist/lib/athena-urls.js +194 -0
  468. package/dist/lib/athena-urls.js.map +1 -0
  469. package/dist/lib/posthog/before-send.cjs +58 -0
  470. package/dist/lib/posthog/before-send.cjs.map +1 -0
  471. package/dist/lib/posthog/before-send.js +58 -0
  472. package/dist/lib/posthog/before-send.js.map +1 -0
  473. package/dist/lib/posthog/capture-gate.cjs +322 -0
  474. package/dist/lib/posthog/capture-gate.cjs.map +1 -0
  475. package/dist/lib/posthog/capture-gate.js +322 -0
  476. package/dist/lib/posthog/capture-gate.js.map +1 -0
  477. package/dist/lib/posthog/wrap-posthog-client.cjs +163 -0
  478. package/dist/lib/posthog/wrap-posthog-client.cjs.map +1 -0
  479. package/dist/lib/posthog/wrap-posthog-client.js +163 -0
  480. package/dist/lib/posthog/wrap-posthog-client.js.map +1 -0
  481. package/dist/lib/utils.cjs +12 -0
  482. package/dist/lib/utils.cjs.map +1 -0
  483. package/dist/lib/utils.js +9 -0
  484. package/dist/lib/utils.js.map +1 -0
  485. package/dist/node_modules/@assistant-ui/react-langchain/dist/converter.cjs +77 -0
  486. package/dist/node_modules/@assistant-ui/react-langchain/dist/converter.cjs.map +1 -0
  487. package/dist/node_modules/@assistant-ui/react-langchain/dist/converter.js +77 -0
  488. package/dist/node_modules/@assistant-ui/react-langchain/dist/converter.js.map +1 -0
  489. package/dist/node_modules/@assistant-ui/react-langgraph/dist/convertLangChainMessages.cjs +181 -0
  490. package/dist/node_modules/@assistant-ui/react-langgraph/dist/convertLangChainMessages.cjs.map +1 -0
  491. package/dist/node_modules/@assistant-ui/react-langgraph/dist/convertLangChainMessages.js +181 -0
  492. package/dist/node_modules/@assistant-ui/react-langgraph/dist/convertLangChainMessages.js.map +1 -0
  493. package/dist/node_modules/qrcode-generator/dist/qrcode.cjs +32 -0
  494. package/dist/node_modules/qrcode-generator/dist/qrcode.cjs.map +1 -0
  495. package/dist/node_modules/qrcode-generator/dist/qrcode.js +31 -0
  496. package/dist/node_modules/qrcode-generator/dist/qrcode.js.map +1 -0
  497. package/dist/node_modules/zod/v4/classic/errors.cjs +44 -0
  498. package/dist/node_modules/zod/v4/classic/errors.cjs.map +1 -0
  499. package/dist/node_modules/zod/v4/classic/errors.js +44 -0
  500. package/dist/node_modules/zod/v4/classic/errors.js.map +1 -0
  501. package/dist/node_modules/zod/v4/classic/iso.cjs +43 -0
  502. package/dist/node_modules/zod/v4/classic/iso.cjs.map +1 -0
  503. package/dist/node_modules/zod/v4/classic/iso.js +43 -0
  504. package/dist/node_modules/zod/v4/classic/iso.js.map +1 -0
  505. package/dist/node_modules/zod/v4/classic/parse.cjs +29 -0
  506. package/dist/node_modules/zod/v4/classic/parse.cjs.map +1 -0
  507. package/dist/node_modules/zod/v4/classic/parse.js +29 -0
  508. package/dist/node_modules/zod/v4/classic/parse.js.map +1 -0
  509. package/dist/node_modules/zod/v4/classic/schemas.cjs +871 -0
  510. package/dist/node_modules/zod/v4/classic/schemas.cjs.map +1 -0
  511. package/dist/node_modules/zod/v4/classic/schemas.js +871 -0
  512. package/dist/node_modules/zod/v4/classic/schemas.js.map +1 -0
  513. package/dist/node_modules/zod/v4/core/api.cjs +570 -0
  514. package/dist/node_modules/zod/v4/core/api.cjs.map +1 -0
  515. package/dist/node_modules/zod/v4/core/api.js +570 -0
  516. package/dist/node_modules/zod/v4/core/api.js.map +1 -0
  517. package/dist/node_modules/zod/v4/core/checks.cjs +411 -0
  518. package/dist/node_modules/zod/v4/core/checks.cjs.map +1 -0
  519. package/dist/node_modules/zod/v4/core/checks.js +411 -0
  520. package/dist/node_modules/zod/v4/core/checks.js.map +1 -0
  521. package/dist/node_modules/zod/v4/core/core.cjs +77 -0
  522. package/dist/node_modules/zod/v4/core/core.cjs.map +1 -0
  523. package/dist/node_modules/zod/v4/core/core.js +77 -0
  524. package/dist/node_modules/zod/v4/core/core.js.map +1 -0
  525. package/dist/node_modules/zod/v4/core/doc.cjs +38 -0
  526. package/dist/node_modules/zod/v4/core/doc.cjs.map +1 -0
  527. package/dist/node_modules/zod/v4/core/doc.js +38 -0
  528. package/dist/node_modules/zod/v4/core/doc.js.map +1 -0
  529. package/dist/node_modules/zod/v4/core/errors.cjs +76 -0
  530. package/dist/node_modules/zod/v4/core/errors.cjs.map +1 -0
  531. package/dist/node_modules/zod/v4/core/errors.js +76 -0
  532. package/dist/node_modules/zod/v4/core/errors.js.map +1 -0
  533. package/dist/node_modules/zod/v4/core/json-schema-processors.cjs +312 -0
  534. package/dist/node_modules/zod/v4/core/json-schema-processors.cjs.map +1 -0
  535. package/dist/node_modules/zod/v4/core/json-schema-processors.js +312 -0
  536. package/dist/node_modules/zod/v4/core/json-schema-processors.js.map +1 -0
  537. package/dist/node_modules/zod/v4/core/parse.cjs +96 -0
  538. package/dist/node_modules/zod/v4/core/parse.cjs.map +1 -0
  539. package/dist/node_modules/zod/v4/core/parse.js +96 -0
  540. package/dist/node_modules/zod/v4/core/parse.js.map +1 -0
  541. package/dist/node_modules/zod/v4/core/regexes.cjs +86 -0
  542. package/dist/node_modules/zod/v4/core/regexes.cjs.map +1 -0
  543. package/dist/node_modules/zod/v4/core/regexes.js +86 -0
  544. package/dist/node_modules/zod/v4/core/regexes.js.map +1 -0
  545. package/dist/node_modules/zod/v4/core/registries.cjs +52 -0
  546. package/dist/node_modules/zod/v4/core/registries.cjs.map +1 -0
  547. package/dist/node_modules/zod/v4/core/registries.js +52 -0
  548. package/dist/node_modules/zod/v4/core/registries.js.map +1 -0
  549. package/dist/node_modules/zod/v4/core/schemas.cjs +1412 -0
  550. package/dist/node_modules/zod/v4/core/schemas.cjs.map +1 -0
  551. package/dist/node_modules/zod/v4/core/schemas.js +1413 -0
  552. package/dist/node_modules/zod/v4/core/schemas.js.map +1 -0
  553. package/dist/node_modules/zod/v4/core/to-json-schema.cjs +370 -0
  554. package/dist/node_modules/zod/v4/core/to-json-schema.cjs.map +1 -0
  555. package/dist/node_modules/zod/v4/core/to-json-schema.js +370 -0
  556. package/dist/node_modules/zod/v4/core/to-json-schema.js.map +1 -0
  557. package/dist/node_modules/zod/v4/core/util.cjs +444 -0
  558. package/dist/node_modules/zod/v4/core/util.cjs.map +1 -0
  559. package/dist/node_modules/zod/v4/core/util.js +444 -0
  560. package/dist/node_modules/zod/v4/core/util.js.map +1 -0
  561. package/dist/node_modules/zod/v4/core/versions.cjs +9 -0
  562. package/dist/node_modules/zod/v4/core/versions.cjs.map +1 -0
  563. package/dist/node_modules/zod/v4/core/versions.js +9 -0
  564. package/dist/node_modules/zod/v4/core/versions.js.map +1 -0
  565. package/dist/packages/agent-runtime/src/asset-attachment.cjs +19 -0
  566. package/dist/packages/agent-runtime/src/asset-attachment.cjs.map +1 -0
  567. package/dist/packages/agent-runtime/src/asset-attachment.js +19 -0
  568. package/dist/packages/agent-runtime/src/asset-attachment.js.map +1 -0
  569. package/dist/packages/agent-runtime/src/auth-denial.cjs +28 -0
  570. package/dist/packages/agent-runtime/src/auth-denial.cjs.map +1 -0
  571. package/dist/packages/agent-runtime/src/auth-denial.js +28 -0
  572. package/dist/packages/agent-runtime/src/auth-denial.js.map +1 -0
  573. package/dist/packages/agent-runtime/src/client-tool-bridge.cjs +276 -0
  574. package/dist/packages/agent-runtime/src/client-tool-bridge.cjs.map +1 -0
  575. package/dist/packages/agent-runtime/src/client-tool-bridge.js +276 -0
  576. package/dist/packages/agent-runtime/src/client-tool-bridge.js.map +1 -0
  577. package/dist/packages/agent-runtime/src/client-tools.cjs +137 -0
  578. package/dist/packages/agent-runtime/src/client-tools.cjs.map +1 -0
  579. package/dist/packages/agent-runtime/src/client-tools.js +137 -0
  580. package/dist/packages/agent-runtime/src/client-tools.js.map +1 -0
  581. package/dist/packages/agent-runtime/src/conversation-index.cjs +80 -0
  582. package/dist/packages/agent-runtime/src/conversation-index.cjs.map +1 -0
  583. package/dist/packages/agent-runtime/src/conversation-index.js +80 -0
  584. package/dist/packages/agent-runtime/src/conversation-index.js.map +1 -0
  585. package/dist/packages/agent-runtime/src/conversation-list.cjs +90 -0
  586. package/dist/packages/agent-runtime/src/conversation-list.cjs.map +1 -0
  587. package/dist/packages/agent-runtime/src/conversation-list.js +90 -0
  588. package/dist/packages/agent-runtime/src/conversation-list.js.map +1 -0
  589. package/dist/packages/agent-runtime/src/deep-agent-transport-recipe.cjs +55 -0
  590. package/dist/packages/agent-runtime/src/deep-agent-transport-recipe.cjs.map +1 -0
  591. package/dist/packages/agent-runtime/src/deep-agent-transport-recipe.js +55 -0
  592. package/dist/packages/agent-runtime/src/deep-agent-transport-recipe.js.map +1 -0
  593. package/dist/packages/agent-runtime/src/edit-command.cjs +89 -0
  594. package/dist/packages/agent-runtime/src/edit-command.cjs.map +1 -0
  595. package/dist/packages/agent-runtime/src/edit-command.js +89 -0
  596. package/dist/packages/agent-runtime/src/edit-command.js.map +1 -0
  597. package/dist/packages/agent-runtime/src/errors.cjs +95 -0
  598. package/dist/packages/agent-runtime/src/errors.cjs.map +1 -0
  599. package/dist/packages/agent-runtime/src/errors.js +95 -0
  600. package/dist/packages/agent-runtime/src/errors.js.map +1 -0
  601. package/dist/packages/agent-runtime/src/generated/runconfig-contract.cjs +238 -0
  602. package/dist/packages/agent-runtime/src/generated/runconfig-contract.cjs.map +1 -0
  603. package/dist/packages/agent-runtime/src/generated/runconfig-contract.js +238 -0
  604. package/dist/packages/agent-runtime/src/generated/runconfig-contract.js.map +1 -0
  605. package/dist/packages/agent-runtime/src/interrupts.cjs +141 -0
  606. package/dist/packages/agent-runtime/src/interrupts.cjs.map +1 -0
  607. package/dist/packages/agent-runtime/src/interrupts.js +141 -0
  608. package/dist/packages/agent-runtime/src/interrupts.js.map +1 -0
  609. package/dist/packages/agent-runtime/src/message-author.cjs +31 -0
  610. package/dist/packages/agent-runtime/src/message-author.cjs.map +1 -0
  611. package/dist/packages/agent-runtime/src/message-author.js +31 -0
  612. package/dist/packages/agent-runtime/src/message-author.js.map +1 -0
  613. package/dist/packages/agent-runtime/src/message-window.cjs +85 -0
  614. package/dist/packages/agent-runtime/src/message-window.cjs.map +1 -0
  615. package/dist/packages/agent-runtime/src/message-window.js +85 -0
  616. package/dist/packages/agent-runtime/src/message-window.js.map +1 -0
  617. package/dist/packages/agent-runtime/src/messages.cjs +463 -0
  618. package/dist/packages/agent-runtime/src/messages.cjs.map +1 -0
  619. package/dist/packages/agent-runtime/src/messages.js +463 -0
  620. package/dist/packages/agent-runtime/src/messages.js.map +1 -0
  621. package/dist/packages/agent-runtime/src/model-context.cjs +13 -0
  622. package/dist/packages/agent-runtime/src/model-context.cjs.map +1 -0
  623. package/dist/packages/agent-runtime/src/model-context.js +13 -0
  624. package/dist/packages/agent-runtime/src/model-context.js.map +1 -0
  625. package/dist/packages/agent-runtime/src/optimistic-content.cjs +17 -0
  626. package/dist/packages/agent-runtime/src/optimistic-content.cjs.map +1 -0
  627. package/dist/packages/agent-runtime/src/optimistic-content.js +17 -0
  628. package/dist/packages/agent-runtime/src/optimistic-content.js.map +1 -0
  629. package/dist/packages/agent-runtime/src/protocol.cjs +31 -0
  630. package/dist/packages/agent-runtime/src/protocol.cjs.map +1 -0
  631. package/dist/packages/agent-runtime/src/protocol.js +31 -0
  632. package/dist/packages/agent-runtime/src/protocol.js.map +1 -0
  633. package/dist/packages/agent-runtime/src/queue.cjs +67 -0
  634. package/dist/packages/agent-runtime/src/queue.cjs.map +1 -0
  635. package/dist/packages/agent-runtime/src/queue.js +67 -0
  636. package/dist/packages/agent-runtime/src/queue.js.map +1 -0
  637. package/dist/packages/agent-runtime/src/quota-safe-local-storage-session.cjs +329 -0
  638. package/dist/packages/agent-runtime/src/quota-safe-local-storage-session.cjs.map +1 -0
  639. package/dist/packages/agent-runtime/src/quota-safe-local-storage-session.js +329 -0
  640. package/dist/packages/agent-runtime/src/quota-safe-local-storage-session.js.map +1 -0
  641. package/dist/packages/agent-runtime/src/runtime-messages.cjs +187 -0
  642. package/dist/packages/agent-runtime/src/runtime-messages.cjs.map +1 -0
  643. package/dist/packages/agent-runtime/src/runtime-messages.js +187 -0
  644. package/dist/packages/agent-runtime/src/runtime-messages.js.map +1 -0
  645. package/dist/packages/agent-runtime/src/screen-point.cjs +68 -0
  646. package/dist/packages/agent-runtime/src/screen-point.cjs.map +1 -0
  647. package/dist/packages/agent-runtime/src/screen-point.js +68 -0
  648. package/dist/packages/agent-runtime/src/screen-point.js.map +1 -0
  649. package/dist/packages/agent-runtime/src/send-recovery.cjs +128 -0
  650. package/dist/packages/agent-runtime/src/send-recovery.cjs.map +1 -0
  651. package/dist/packages/agent-runtime/src/send-recovery.js +128 -0
  652. package/dist/packages/agent-runtime/src/send-recovery.js.map +1 -0
  653. package/dist/packages/agent-runtime/src/statewire-attach-observer.cjs +249 -0
  654. package/dist/packages/agent-runtime/src/statewire-attach-observer.cjs.map +1 -0
  655. package/dist/packages/agent-runtime/src/statewire-attach-observer.js +249 -0
  656. package/dist/packages/agent-runtime/src/statewire-attach-observer.js.map +1 -0
  657. package/dist/packages/agent-runtime/src/statewire-state.cjs +16 -0
  658. package/dist/packages/agent-runtime/src/statewire-state.cjs.map +1 -0
  659. package/dist/packages/agent-runtime/src/statewire-state.js +16 -0
  660. package/dist/packages/agent-runtime/src/statewire-state.js.map +1 -0
  661. package/dist/packages/agent-runtime/src/statewire-suspended.cjs +41 -0
  662. package/dist/packages/agent-runtime/src/statewire-suspended.cjs.map +1 -0
  663. package/dist/packages/agent-runtime/src/statewire-suspended.js +41 -0
  664. package/dist/packages/agent-runtime/src/statewire-suspended.js.map +1 -0
  665. package/dist/packages/agent-runtime/src/statewire-transport.cjs +11 -0
  666. package/dist/packages/agent-runtime/src/statewire-transport.cjs.map +1 -0
  667. package/dist/packages/agent-runtime/src/statewire-transport.js +11 -0
  668. package/dist/packages/agent-runtime/src/statewire-transport.js.map +1 -0
  669. package/dist/packages/agent-runtime/src/streaming-markdown.cjs +214 -0
  670. package/dist/packages/agent-runtime/src/streaming-markdown.cjs.map +1 -0
  671. package/dist/packages/agent-runtime/src/streaming-markdown.js +214 -0
  672. package/dist/packages/agent-runtime/src/streaming-markdown.js.map +1 -0
  673. package/dist/packages/agent-runtime/src/thread-extras.cjs +38 -0
  674. package/dist/packages/agent-runtime/src/thread-extras.cjs.map +1 -0
  675. package/dist/packages/agent-runtime/src/thread-extras.js +38 -0
  676. package/dist/packages/agent-runtime/src/thread-extras.js.map +1 -0
  677. package/dist/packages/agent-runtime/src/thread-handoff.cjs +85 -0
  678. package/dist/packages/agent-runtime/src/thread-handoff.cjs.map +1 -0
  679. package/dist/packages/agent-runtime/src/thread-handoff.js +85 -0
  680. package/dist/packages/agent-runtime/src/thread-handoff.js.map +1 -0
  681. package/dist/packages/agent-runtime/src/thread-snapshot-cache.cjs +90 -0
  682. package/dist/packages/agent-runtime/src/thread-snapshot-cache.cjs.map +1 -0
  683. package/dist/packages/agent-runtime/src/thread-snapshot-cache.js +90 -0
  684. package/dist/packages/agent-runtime/src/thread-snapshot-cache.js.map +1 -0
  685. package/dist/packages/agent-runtime/src/thread-status.cjs +49 -0
  686. package/dist/packages/agent-runtime/src/thread-status.cjs.map +1 -0
  687. package/dist/packages/agent-runtime/src/thread-status.js +49 -0
  688. package/dist/packages/agent-runtime/src/thread-status.js.map +1 -0
  689. package/dist/packages/agent-runtime/src/tool-metadata.cjs +1794 -0
  690. package/dist/packages/agent-runtime/src/tool-metadata.cjs.map +1 -0
  691. package/dist/packages/agent-runtime/src/tool-metadata.js +1794 -0
  692. package/dist/packages/agent-runtime/src/tool-metadata.js.map +1 -0
  693. package/dist/packages/agent-runtime/src/tool-outputs.cjs +46 -0
  694. package/dist/packages/agent-runtime/src/tool-outputs.cjs.map +1 -0
  695. package/dist/packages/agent-runtime/src/tool-outputs.js +46 -0
  696. package/dist/packages/agent-runtime/src/tool-outputs.js.map +1 -0
  697. package/dist/packages/agent-runtime/src/tool-result.cjs +151 -0
  698. package/dist/packages/agent-runtime/src/tool-result.cjs.map +1 -0
  699. package/dist/packages/agent-runtime/src/tool-result.js +151 -0
  700. package/dist/packages/agent-runtime/src/tool-result.js.map +1 -0
  701. package/dist/packages/agent-runtime/src/use-conversation-list.cjs +139 -0
  702. package/dist/packages/agent-runtime/src/use-conversation-list.cjs.map +1 -0
  703. package/dist/packages/agent-runtime/src/use-conversation-list.js +139 -0
  704. package/dist/packages/agent-runtime/src/use-conversation-list.js.map +1 -0
  705. package/dist/packages/agent-runtime/src/use-deep-agent-config.cjs +14 -0
  706. package/dist/packages/agent-runtime/src/use-deep-agent-config.cjs.map +1 -0
  707. package/dist/packages/agent-runtime/src/use-deep-agent-config.js +14 -0
  708. package/dist/packages/agent-runtime/src/use-deep-agent-config.js.map +1 -0
  709. package/dist/packages/agent-runtime/src/use-deep-agent-edit-submit.cjs +44 -0
  710. package/dist/packages/agent-runtime/src/use-deep-agent-edit-submit.cjs.map +1 -0
  711. package/dist/packages/agent-runtime/src/use-deep-agent-edit-submit.js +44 -0
  712. package/dist/packages/agent-runtime/src/use-deep-agent-edit-submit.js.map +1 -0
  713. package/dist/packages/agent-runtime/src/use-deep-agent-runtime.cjs +148 -0
  714. package/dist/packages/agent-runtime/src/use-deep-agent-runtime.cjs.map +1 -0
  715. package/dist/packages/agent-runtime/src/use-deep-agent-runtime.js +148 -0
  716. package/dist/packages/agent-runtime/src/use-deep-agent-runtime.js.map +1 -0
  717. package/dist/packages/agent-runtime/src/use-deep-agent-thread.cjs +407 -0
  718. package/dist/packages/agent-runtime/src/use-deep-agent-thread.cjs.map +1 -0
  719. package/dist/packages/agent-runtime/src/use-deep-agent-thread.js +407 -0
  720. package/dist/packages/agent-runtime/src/use-deep-agent-thread.js.map +1 -0
  721. package/dist/packages/agent-runtime/src/use-deep-agent-window-sync.cjs +133 -0
  722. package/dist/packages/agent-runtime/src/use-deep-agent-window-sync.cjs.map +1 -0
  723. package/dist/packages/agent-runtime/src/use-deep-agent-window-sync.js +133 -0
  724. package/dist/packages/agent-runtime/src/use-deep-agent-window-sync.js.map +1 -0
  725. package/dist/packages/agent-runtime/src/voice-presentation.cjs +37 -0
  726. package/dist/packages/agent-runtime/src/voice-presentation.cjs.map +1 -0
  727. package/dist/packages/agent-runtime/src/voice-presentation.js +37 -0
  728. package/dist/packages/agent-runtime/src/voice-presentation.js.map +1 -0
  729. package/dist/packages/react/package.json.cjs +9 -0
  730. package/dist/packages/react/package.json.cjs.map +1 -0
  731. package/dist/packages/react/package.json.js +9 -0
  732. package/dist/packages/react/package.json.js.map +1 -0
  733. package/dist/{AthenaContext-B1QMhIP-.cjs → provider/AthenaContext.cjs} +5 -4
  734. package/dist/provider/AthenaContext.cjs.map +1 -0
  735. package/dist/{AthenaContext-MOslgOmE.js → provider/AthenaContext.js} +3 -3
  736. package/dist/provider/AthenaContext.js.map +1 -0
  737. package/dist/provider/AthenaProvider.cjs +404 -0
  738. package/dist/provider/AthenaProvider.cjs.map +1 -0
  739. package/dist/provider/AthenaProvider.js +404 -0
  740. package/dist/provider/AthenaProvider.js.map +1 -0
  741. package/dist/provider/PostHogProvider.cjs +81 -0
  742. package/dist/provider/PostHogProvider.cjs.map +1 -0
  743. package/dist/provider/PostHogProvider.js +59 -0
  744. package/dist/provider/PostHogProvider.js.map +1 -0
  745. package/dist/provider/config.d.ts +8 -7
  746. package/dist/provider/statewire-lifecycle-context.cjs +10 -0
  747. package/dist/provider/statewire-lifecycle-context.cjs.map +1 -0
  748. package/dist/provider/statewire-lifecycle-context.js +10 -0
  749. package/dist/provider/statewire-lifecycle-context.js.map +1 -0
  750. package/dist/provider/statewire-window-context.cjs +10 -0
  751. package/dist/provider/statewire-window-context.cjs.map +1 -0
  752. package/dist/provider/statewire-window-context.js +10 -0
  753. package/dist/provider/statewire-window-context.js.map +1 -0
  754. package/dist/runtime/auth.cjs +309 -0
  755. package/dist/runtime/auth.cjs.map +1 -0
  756. package/dist/runtime/auth.d.ts +19 -18
  757. package/dist/runtime/auth.js +309 -0
  758. package/dist/runtime/auth.js.map +1 -0
  759. package/dist/runtime/statewire-auth-headers.cjs +18 -0
  760. package/dist/runtime/statewire-auth-headers.cjs.map +1 -0
  761. package/dist/runtime/statewire-auth-headers.js +18 -0
  762. package/dist/runtime/statewire-auth-headers.js.map +1 -0
  763. package/dist/runtime/statewire-lifecycle.cjs +68 -0
  764. package/dist/runtime/statewire-lifecycle.cjs.map +1 -0
  765. package/dist/runtime/statewire-lifecycle.js +68 -0
  766. package/dist/runtime/statewire-lifecycle.js.map +1 -0
  767. package/dist/runtime/statewire-run-config.cjs +68 -0
  768. package/dist/runtime/statewire-run-config.cjs.map +1 -0
  769. package/dist/runtime/statewire-run-config.js +68 -0
  770. package/dist/runtime/statewire-run-config.js.map +1 -0
  771. package/dist/runtime/statewire-session-key.cjs +11 -0
  772. package/dist/runtime/statewire-session-key.cjs.map +1 -0
  773. package/dist/runtime/statewire-session-key.js +11 -0
  774. package/dist/runtime/statewire-session-key.js.map +1 -0
  775. package/dist/runtime/useAthenaStatewireRuntime.cjs +180 -0
  776. package/dist/runtime/useAthenaStatewireRuntime.cjs.map +1 -0
  777. package/dist/runtime/useAthenaStatewireRuntime.js +181 -0
  778. package/dist/runtime/useAthenaStatewireRuntime.js.map +1 -0
  779. package/dist/styles.css +1 -1
  780. package/dist/theme/index.cjs +182 -0
  781. package/dist/theme/index.cjs.map +1 -0
  782. package/dist/theme/index.js +182 -0
  783. package/dist/theme/index.js.map +1 -0
  784. package/dist/threads/ThreadList.cjs +55 -0
  785. package/dist/threads/ThreadList.cjs.map +1 -0
  786. package/dist/threads/ThreadList.js +55 -0
  787. package/dist/threads/ThreadList.js.map +1 -0
  788. package/dist/threads/api.cjs +208 -0
  789. package/dist/threads/api.cjs.map +1 -0
  790. package/dist/threads/api.js +208 -0
  791. package/dist/threads/api.js.map +1 -0
  792. package/dist/threads/conversation-list-fetcher.cjs +74 -0
  793. package/dist/threads/conversation-list-fetcher.cjs.map +1 -0
  794. package/dist/threads/conversation-list-fetcher.js +74 -0
  795. package/dist/threads/conversation-list-fetcher.js.map +1 -0
  796. package/dist/threads/mint-thread-id.cjs +7 -0
  797. package/dist/threads/mint-thread-id.cjs.map +1 -0
  798. package/dist/threads/mint-thread-id.js +7 -0
  799. package/dist/threads/mint-thread-id.js.map +1 -0
  800. package/dist/threads/statewire-thread-list.cjs +232 -0
  801. package/dist/threads/statewire-thread-list.cjs.map +1 -0
  802. package/dist/threads/statewire-thread-list.js +232 -0
  803. package/dist/threads/statewire-thread-list.js.map +1 -0
  804. package/dist/threads/thread-id-context.cjs +22 -0
  805. package/dist/threads/thread-id-context.cjs.map +1 -0
  806. package/dist/threads/thread-id-context.d.ts +9 -0
  807. package/dist/threads/thread-id-context.js +22 -0
  808. package/dist/threads/thread-id-context.js.map +1 -0
  809. package/dist/threads/title.cjs +95 -0
  810. package/dist/threads/title.cjs.map +1 -0
  811. package/dist/threads/title.js +95 -0
  812. package/dist/threads/title.js.map +1 -0
  813. package/dist/threads/use-rest-conversation-history.cjs +80 -0
  814. package/dist/threads/use-rest-conversation-history.cjs.map +1 -0
  815. package/dist/threads/use-rest-conversation-history.js +80 -0
  816. package/dist/threads/use-rest-conversation-history.js.map +1 -0
  817. package/dist/threads/use-statewire-conversation-history.cjs +244 -0
  818. package/dist/threads/use-statewire-conversation-history.cjs.map +1 -0
  819. package/dist/threads/use-statewire-conversation-history.d.ts +1 -0
  820. package/dist/threads/use-statewire-conversation-history.js +244 -0
  821. package/dist/threads/use-statewire-conversation-history.js.map +1 -0
  822. package/dist/threads/useAthenaThreadManager.cjs +24 -0
  823. package/dist/threads/useAthenaThreadManager.cjs.map +1 -0
  824. package/dist/threads/useAthenaThreadManager.js +24 -0
  825. package/dist/threads/useAthenaThreadManager.js.map +1 -0
  826. package/dist/toolkits/index.cjs +279 -0
  827. package/dist/toolkits/index.cjs.map +1 -0
  828. package/dist/toolkits/index.js +279 -0
  829. package/dist/toolkits/index.js.map +1 -0
  830. package/dist/tools/NestedPtcMessages.cjs +46 -0
  831. package/dist/tools/NestedPtcMessages.cjs.map +1 -0
  832. package/dist/tools/NestedPtcMessages.js +46 -0
  833. package/dist/tools/NestedPtcMessages.js.map +1 -0
  834. package/dist/tools/append-document-tool-ui.cjs +145 -0
  835. package/dist/tools/append-document-tool-ui.cjs.map +1 -0
  836. package/dist/tools/append-document-tool-ui.js +145 -0
  837. package/dist/tools/append-document-tool-ui.js.map +1 -0
  838. package/dist/tools/asset-utils.cjs +16 -0
  839. package/dist/tools/asset-utils.cjs.map +1 -0
  840. package/dist/tools/asset-utils.js +16 -0
  841. package/dist/tools/asset-utils.js.map +1 -0
  842. package/dist/tools/auto-open-tools.cjs +121 -0
  843. package/dist/tools/auto-open-tools.cjs.map +1 -0
  844. package/dist/tools/auto-open-tools.js +121 -0
  845. package/dist/tools/auto-open-tools.js.map +1 -0
  846. package/dist/tools/file-tool-uis.cjs +108 -0
  847. package/dist/tools/file-tool-uis.cjs.map +1 -0
  848. package/dist/tools/file-tool-uis.js +108 -0
  849. package/dist/tools/file-tool-uis.js.map +1 -0
  850. package/dist/tools/index.cjs +57 -0
  851. package/dist/tools/index.cjs.map +1 -0
  852. package/dist/tools/index.d.ts +1 -0
  853. package/dist/tools/index.js +57 -0
  854. package/dist/tools/index.js.map +1 -0
  855. package/dist/tools/misc-tool-uis.cjs +55 -0
  856. package/dist/tools/misc-tool-uis.cjs.map +1 -0
  857. package/dist/{misc-tool-uis-gAiQw0Yl.js → tools/misc-tool-uis.js} +18 -7
  858. package/dist/tools/misc-tool-uis.js.map +1 -0
  859. package/dist/tools/primitives.cjs +167 -0
  860. package/dist/tools/primitives.cjs.map +1 -0
  861. package/dist/tools/primitives.js +167 -0
  862. package/dist/tools/primitives.js.map +1 -0
  863. package/dist/tools/read-asset-tool-ui.cjs +284 -0
  864. package/dist/tools/read-asset-tool-ui.cjs.map +1 -0
  865. package/dist/tools/read-asset-tool-ui.js +284 -0
  866. package/dist/tools/read-asset-tool-ui.js.map +1 -0
  867. package/dist/tools/todo-plan-store.cjs +88 -0
  868. package/dist/tools/todo-plan-store.cjs.map +1 -0
  869. package/dist/tools/todo-plan-store.js +88 -0
  870. package/dist/tools/todo-plan-store.js.map +1 -0
  871. package/dist/tools/tool-fallback.cjs +668 -0
  872. package/dist/tools/tool-fallback.cjs.map +1 -0
  873. package/dist/tools/tool-fallback.js +668 -0
  874. package/dist/tools/tool-fallback.js.map +1 -0
  875. package/dist/tools/tool-icons.cjs +61 -0
  876. package/dist/tools/tool-icons.cjs.map +1 -0
  877. package/dist/tools/tool-icons.js +61 -0
  878. package/dist/tools/tool-icons.js.map +1 -0
  879. package/dist/tools/tool-uis.cjs +3049 -0
  880. package/dist/tools/tool-uis.cjs.map +1 -0
  881. package/dist/tools/tool-uis.js +3049 -0
  882. package/dist/tools/tool-uis.js.map +1 -0
  883. package/dist/tools/voice-update-tool-ui.cjs +90 -0
  884. package/dist/tools/voice-update-tool-ui.cjs.map +1 -0
  885. package/dist/tools/voice-update-tool-ui.d.ts +27 -0
  886. package/dist/tools/voice-update-tool-ui.js +90 -0
  887. package/dist/tools/voice-update-tool-ui.js.map +1 -0
  888. package/dist/tools/write-todos-tool-ui.cjs +270 -0
  889. package/dist/tools/write-todos-tool-ui.cjs.map +1 -0
  890. package/dist/tools/write-todos-tool-ui.js +270 -0
  891. package/dist/tools/write-todos-tool-ui.js.map +1 -0
  892. package/dist/ui/button.cjs +57 -0
  893. package/dist/ui/button.cjs.map +1 -0
  894. package/dist/ui/button.js +57 -0
  895. package/dist/ui/button.js.map +1 -0
  896. package/dist/ui/collapsible.cjs +17 -0
  897. package/dist/ui/collapsible.cjs.map +1 -0
  898. package/dist/ui/collapsible.js +17 -0
  899. package/dist/ui/collapsible.js.map +1 -0
  900. package/dist/ui/tooltip.cjs +48 -0
  901. package/dist/ui/tooltip.cjs.map +1 -0
  902. package/dist/ui/tooltip.js +48 -0
  903. package/dist/ui/tooltip.js.map +1 -0
  904. package/dist/version.cjs +6 -0
  905. package/dist/version.cjs.map +1 -0
  906. package/dist/version.js +6 -0
  907. package/dist/version.js.map +1 -0
  908. package/dist/voice/index.cjs +6 -0
  909. package/dist/voice/index.cjs.map +1 -0
  910. package/dist/voice/index.d.ts +2 -0
  911. package/dist/voice/index.js +6 -0
  912. package/dist/voice/index.js.map +1 -0
  913. package/dist/voice/use-athena-voice-session.cjs +315 -0
  914. package/dist/voice/use-athena-voice-session.cjs.map +1 -0
  915. package/dist/voice/use-athena-voice-session.d.ts +145 -0
  916. package/dist/voice/use-athena-voice-session.js +315 -0
  917. package/dist/voice/use-athena-voice-session.js.map +1 -0
  918. package/package.json +32 -20
  919. package/dist/AthenaAuthContext-B3AwLA5Z.cjs.map +0 -1
  920. package/dist/AthenaAuthContext-DQsdayH2.js.map +0 -1
  921. package/dist/AthenaContext-B1QMhIP-.cjs.map +0 -1
  922. package/dist/AthenaContext-MOslgOmE.js.map +0 -1
  923. package/dist/SuperGroupingCard-BsWbHyV_.js +0 -795
  924. package/dist/SuperGroupingCard-BsWbHyV_.js.map +0 -1
  925. package/dist/SuperGroupingCard-CRRFUgjN.cjs +0 -794
  926. package/dist/SuperGroupingCard-CRRFUgjN.cjs.map +0 -1
  927. package/dist/auth.cjs.map +0 -1
  928. package/dist/auth.js.map +0 -1
  929. package/dist/chat/ComposerEditorContext.d.ts +0 -36
  930. package/dist/chat/tiptap-composer.d.ts +0 -7
  931. package/dist/chat-ui-statewire.cjs +0 -25
  932. package/dist/chat-ui-statewire.cjs.map +0 -1
  933. package/dist/chat-ui-statewire.js +0 -25
  934. package/dist/chat-ui-statewire.js.map +0 -1
  935. package/dist/chat-ui.cjs +0 -2484
  936. package/dist/chat-ui.cjs.map +0 -1
  937. package/dist/chat-ui.js +0 -2486
  938. package/dist/chat-ui.js.map +0 -1
  939. package/dist/collab.cjs.map +0 -1
  940. package/dist/collab.js.map +0 -1
  941. package/dist/mentions/composer-keybinds.d.ts +0 -5
  942. package/dist/mentions/mention-extension.d.ts +0 -6
  943. package/dist/mentions/mention-icons.d.ts +0 -4
  944. package/dist/mentions/mention-node-view.d.ts +0 -2
  945. package/dist/mentions/mention-suggestion-list.d.ts +0 -14
  946. package/dist/mentions/mention-suggestion-popup.d.ts +0 -15
  947. package/dist/mentions/mention-suggestions-extension.d.ts +0 -11
  948. package/dist/mentions/mention-types.d.ts +0 -21
  949. package/dist/mentions/mention-utils.d.ts +0 -23
  950. package/dist/mentions/use-mention-suggestions.d.ts +0 -29
  951. package/dist/misc-tool-uis-B2e0Okkn.cjs +0 -43
  952. package/dist/misc-tool-uis-B2e0Okkn.cjs.map +0 -1
  953. package/dist/misc-tool-uis-gAiQw0Yl.js.map +0 -1
  954. package/dist/statewire-continue-run-D34gS7_1.js.map +0 -1
  955. package/dist/statewire-continue-run-nE9VCKUh.cjs.map +0 -1
  956. package/dist/statewire-history-edge-C8uyTEjX.cjs +0 -1711
  957. package/dist/statewire-history-edge-C8uyTEjX.cjs.map +0 -1
  958. package/dist/statewire-history-edge-CPohUKMt.js +0 -1712
  959. package/dist/statewire-history-edge-CPohUKMt.js.map +0 -1
  960. package/dist/super-grouping.cjs +0 -22
  961. package/dist/super-grouping.cjs.map +0 -1
  962. package/dist/super-grouping.js +0 -22
  963. package/dist/super-grouping.js.map +0 -1
  964. package/dist/tool-fallback-DkQ3DLkn.js +0 -4281
  965. package/dist/tool-fallback-DkQ3DLkn.js.map +0 -1
  966. package/dist/tool-fallback-kfhpJQZa.cjs +0 -4297
  967. package/dist/tool-fallback-kfhpJQZa.cjs.map +0 -1
  968. package/dist/tools.cjs +0 -41
  969. package/dist/tools.cjs.map +0 -1
  970. package/dist/tools.js +0 -41
  971. package/dist/tools.js.map +0 -1
  972. package/dist/trash-2-B5OaNAL7.cjs +0 -5096
  973. package/dist/trash-2-B5OaNAL7.cjs.map +0 -1
  974. package/dist/trash-2-CCwSURL-.js +0 -5081
  975. package/dist/trash-2-CCwSURL-.js.map +0 -1
  976. package/dist/use-rest-conversation-history-Cm8qMRxp.cjs +0 -32397
  977. package/dist/use-rest-conversation-history-Cm8qMRxp.cjs.map +0 -1
  978. package/dist/use-rest-conversation-history-veDZS-oL.js +0 -32361
  979. package/dist/use-rest-conversation-history-veDZS-oL.js.map +0 -1
  980. package/dist/wrench-BEf72cyP.cjs +0 -417
  981. package/dist/wrench-BEf72cyP.cjs.map +0 -1
  982. package/dist/wrench-CbrOlVYm.js +0 -418
  983. package/dist/wrench-CbrOlVYm.js.map +0 -1
  984. package/dist/x-Dfd2NzK0.cjs +0 -42
  985. package/dist/x-Dfd2NzK0.cjs.map +0 -1
  986. package/dist/x-_DntAa_a.js +0 -43
  987. package/dist/x-_DntAa_a.js.map +0 -1
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const buildOptimisticHumanContent = (parts) => {
4
+ const imageParts = parts.filter(
5
+ (part) => part.type === "image"
6
+ );
7
+ const text = parts.filter((part) => part.type === "text").map((part) => part.text).join("\n");
8
+ if (imageParts.length === 0) {
9
+ return text;
10
+ }
11
+ return [
12
+ { type: "text", text },
13
+ ...imageParts.map((part) => ({ type: "image_url", image_url: { url: part.image } }))
14
+ ];
15
+ };
16
+ exports.buildOptimisticHumanContent = buildOptimisticHumanContent;
17
+ //# sourceMappingURL=optimistic-content.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optimistic-content.cjs","sources":["../../../../../agent-runtime/src/optimistic-content.ts"],"sourcesContent":["import type { LangChainMessage } from '@assistant-ui/react-langgraph';\n\n/** Parts of a pending user message the optimistic bubble can render. */\nexport type OptimisticContentPart =\n | { type: 'text'; text: string }\n | { type: 'image'; image: string };\n\ntype HumanMessageContent = Extract<LangChainMessage, { type: 'human' }>['content'];\n\n/**\n * Content for the optimistic human bubble built from a pending send. Image\n * attachment parts become LangChain `image_url` blocks so the just-sent\n * message renders its images immediately instead of waiting for the backend\n * echo (which only carries images after server-side mention extraction).\n * Text-only sends keep the plain joined string.\n */\nexport const buildOptimisticHumanContent = (\n parts: readonly OptimisticContentPart[]\n): HumanMessageContent => {\n const imageParts = parts.filter(\n (part): part is Extract<OptimisticContentPart, { type: 'image' }> => part.type === 'image'\n );\n const text = parts\n .filter((part): part is Extract<OptimisticContentPart, { type: 'text' }> => part.type === 'text')\n .map((part) => part.text)\n .join('\\n');\n if (imageParts.length === 0) {\n return text;\n }\n return [\n { type: 'text' as const, text },\n ...imageParts.map((part) => ({ type: 'image_url' as const, image_url: { url: part.image } })),\n ];\n};\n"],"names":[],"mappings":";;AAgBO,MAAM,8BAA8B,CACzC,UACwB;AACxB,QAAM,aAAa,MAAM;AAAA,IACvB,CAAC,SAAoE,KAAK,SAAS;AAAA,EAAA;AAErF,QAAM,OAAO,MACV,OAAO,CAAC,SAAmE,KAAK,SAAS,MAAM,EAC/F,IAAI,CAAC,SAAS,KAAK,IAAI,EACvB,KAAK,IAAI;AACZ,MAAI,WAAW,WAAW,GAAG;AAC3B,WAAO;AAAA,EACT;AACA,SAAO;AAAA,IACL,EAAE,MAAM,QAAiB,KAAA;AAAA,IACzB,GAAG,WAAW,IAAI,CAAC,UAAU,EAAE,MAAM,aAAsB,WAAW,EAAE,KAAK,KAAK,MAAA,IAAU;AAAA,EAAA;AAEhG;;"}
@@ -0,0 +1,17 @@
1
+ const buildOptimisticHumanContent = (parts) => {
2
+ const imageParts = parts.filter(
3
+ (part) => part.type === "image"
4
+ );
5
+ const text = parts.filter((part) => part.type === "text").map((part) => part.text).join("\n");
6
+ if (imageParts.length === 0) {
7
+ return text;
8
+ }
9
+ return [
10
+ { type: "text", text },
11
+ ...imageParts.map((part) => ({ type: "image_url", image_url: { url: part.image } }))
12
+ ];
13
+ };
14
+ export {
15
+ buildOptimisticHumanContent
16
+ };
17
+ //# sourceMappingURL=optimistic-content.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optimistic-content.js","sources":["../../../../../agent-runtime/src/optimistic-content.ts"],"sourcesContent":["import type { LangChainMessage } from '@assistant-ui/react-langgraph';\n\n/** Parts of a pending user message the optimistic bubble can render. */\nexport type OptimisticContentPart =\n | { type: 'text'; text: string }\n | { type: 'image'; image: string };\n\ntype HumanMessageContent = Extract<LangChainMessage, { type: 'human' }>['content'];\n\n/**\n * Content for the optimistic human bubble built from a pending send. Image\n * attachment parts become LangChain `image_url` blocks so the just-sent\n * message renders its images immediately instead of waiting for the backend\n * echo (which only carries images after server-side mention extraction).\n * Text-only sends keep the plain joined string.\n */\nexport const buildOptimisticHumanContent = (\n parts: readonly OptimisticContentPart[]\n): HumanMessageContent => {\n const imageParts = parts.filter(\n (part): part is Extract<OptimisticContentPart, { type: 'image' }> => part.type === 'image'\n );\n const text = parts\n .filter((part): part is Extract<OptimisticContentPart, { type: 'text' }> => part.type === 'text')\n .map((part) => part.text)\n .join('\\n');\n if (imageParts.length === 0) {\n return text;\n }\n return [\n { type: 'text' as const, text },\n ...imageParts.map((part) => ({ type: 'image_url' as const, image_url: { url: part.image } })),\n ];\n};\n"],"names":[],"mappings":"AAgBO,MAAM,8BAA8B,CACzC,UACwB;AACxB,QAAM,aAAa,MAAM;AAAA,IACvB,CAAC,SAAoE,KAAK,SAAS;AAAA,EAAA;AAErF,QAAM,OAAO,MACV,OAAO,CAAC,SAAmE,KAAK,SAAS,MAAM,EAC/F,IAAI,CAAC,SAAS,KAAK,IAAI,EACvB,KAAK,IAAI;AACZ,MAAI,WAAW,WAAW,GAAG;AAC3B,WAAO;AAAA,EACT;AACA,SAAO;AAAA,IACL,EAAE,MAAM,QAAiB,KAAA;AAAA,IACzB,GAAG,WAAW,IAAI,CAAC,UAAU,EAAE,MAAM,aAAsB,WAAW,EAAE,KAAK,KAAK,MAAA,IAAU;AAAA,EAAA;AAEhG;"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const runconfigContract = require("./generated/runconfig-contract.cjs");
4
+ const isContractVersion = (value) => typeof value === "number" && Number.isInteger(value) && value >= 1;
5
+ function readDeepAgentProtocol(state) {
6
+ if (typeof state !== "object" || state === null) return null;
7
+ const lane = state[runconfigContract.DEEP_AGENT_PROTOCOL_STATE_KEY];
8
+ if (typeof lane !== "object" || lane === null) return null;
9
+ const { version } = lane;
10
+ if (!isContractVersion(version)) return null;
11
+ return { version };
12
+ }
13
+ function projectDeepAgentProtocol(state) {
14
+ const lane = readDeepAgentProtocol(state);
15
+ if (lane === null) return null;
16
+ return {
17
+ protocolVersion: lane.version,
18
+ clientVersion: runconfigContract.DEEP_AGENT_PROTOCOL_VERSION
19
+ };
20
+ }
21
+ function withDeclaredProtocolVersion(headers) {
22
+ if (runconfigContract.DEEP_AGENT_PROTOCOL_VERSION_HEADER in headers) return headers;
23
+ return {
24
+ ...headers,
25
+ [runconfigContract.DEEP_AGENT_PROTOCOL_VERSION_HEADER]: String(runconfigContract.DEEP_AGENT_PROTOCOL_VERSION)
26
+ };
27
+ }
28
+ exports.projectDeepAgentProtocol = projectDeepAgentProtocol;
29
+ exports.readDeepAgentProtocol = readDeepAgentProtocol;
30
+ exports.withDeclaredProtocolVersion = withDeclaredProtocolVersion;
31
+ //# sourceMappingURL=protocol.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.cjs","sources":["../../../../../agent-runtime/src/protocol.ts"],"sourcesContent":["import {\n DEEP_AGENT_PROTOCOL_STATE_KEY,\n DEEP_AGENT_PROTOCOL_VERSION,\n DEEP_AGENT_PROTOCOL_VERSION_HEADER,\n} from './generated/runconfig-contract';\n\n/**\n * Wire-contract version declaration between the deep-agent statewire host and\n * this client build (the client half of agora's\n * `agora/graphs/athena_deep_agent/protocol_version.py`; upstream ask\n * assistant-ui/statewire #31506 would make this a library concern).\n *\n * - Declaration: {@link withDeclaredProtocolVersion} stamps the version this\n * build speaks (`DEEP_AGENT_PROTOCOL_VERSION`, generated from the Python\n * source of truth) onto the attach headers — they ride the first WS frame's\n * mandatory `headers` field / the SSE request headers, so no statewire\n * change is needed. The host records it for attach telemetry and\n * per-version behaviour selection only.\n * - Advertisement: the host publishes its own `version` under the `protocol`\n * state key in every attach snapshot; {@link readDeepAgentProtocol} /\n * {@link projectDeepAgentProtocol} read it.\n *\n * There is no minimum client version: the host refuses no command for the\n * version its client declared (or for declaring none), so nothing here\n * compares versions or gates a send. Hosts still publish a `minClientVersion`\n * key (the constant 1) for installed clients whose lane reader required it;\n * this reader ignores it.\n *\n * Skew-tolerant on both sides: an old server advertises nothing (project\n * `null`, gate nothing), and a malformed lane reads as absent — the\n * declaration must never brick a client that could otherwise talk.\n */\nexport interface DeepAgentWireProtocol {\n /** The wire-contract version the server speaks. */\n version: number;\n}\n\n/** The advertised-lane projection a host surface reads. */\nexport interface DeepAgentProtocolStatus {\n /** Server-advertised current contract version. */\n protocolVersion: number;\n /** The contract version THIS client build declares. */\n clientVersion: number;\n}\n\nconst isContractVersion = (value: unknown): value is number =>\n typeof value === 'number' && Number.isInteger(value) && value >= 1;\n\n/**\n * The server-advertised version lane off a raw statewire state, or `null`\n * while it is unreadable — pre-attach, a pre-negotiation server's snapshot\n * (no lane), or a malformed lane (tolerated as absent, never thrown on).\n */\nexport function readDeepAgentProtocol(state: unknown): DeepAgentWireProtocol | null {\n if (typeof state !== 'object' || state === null) return null;\n const lane = (state as Record<string, unknown>)[DEEP_AGENT_PROTOCOL_STATE_KEY];\n if (typeof lane !== 'object' || lane === null) return null;\n const { version } = lane as Record<string, unknown>;\n if (!isContractVersion(version)) return null;\n return { version };\n}\n\n/**\n * Project the advertised version for a host surface, or `null` while the\n * server has not advertised (see {@link readDeepAgentProtocol}). Pure and\n * selector-safe, mirroring `readSessionPersisted`.\n */\nexport function projectDeepAgentProtocol(state: unknown): DeepAgentProtocolStatus | null {\n const lane = readDeepAgentProtocol(state);\n if (lane === null) return null;\n return {\n protocolVersion: lane.version,\n clientVersion: DEEP_AGENT_PROTOCOL_VERSION,\n };\n}\n\n/**\n * Attach headers with this build's contract version declared. Applied by\n * `useDeepAgentThread` to every resolved header set, so all surfaces declare\n * without per-host wiring; an explicit entry (tests, forced overrides) wins.\n */\nexport function withDeclaredProtocolVersion(\n headers: Record<string, string>\n): Record<string, string> {\n if (DEEP_AGENT_PROTOCOL_VERSION_HEADER in headers) return headers;\n return {\n ...headers,\n [DEEP_AGENT_PROTOCOL_VERSION_HEADER]: String(DEEP_AGENT_PROTOCOL_VERSION),\n };\n}\n"],"names":["DEEP_AGENT_PROTOCOL_STATE_KEY","DEEP_AGENT_PROTOCOL_VERSION","DEEP_AGENT_PROTOCOL_VERSION_HEADER"],"mappings":";;;AA6CA,MAAM,oBAAoB,CAAC,UACzB,OAAO,UAAU,YAAY,OAAO,UAAU,KAAK,KAAK,SAAS;AAO5D,SAAS,sBAAsB,OAA8C;AAClF,MAAI,OAAO,UAAU,YAAY,UAAU,KAAM,QAAO;AACxD,QAAM,OAAQ,MAAkCA,+CAA6B;AAC7E,MAAI,OAAO,SAAS,YAAY,SAAS,KAAM,QAAO;AACtD,QAAM,EAAE,YAAY;AACpB,MAAI,CAAC,kBAAkB,OAAO,EAAG,QAAO;AACxC,SAAO,EAAE,QAAA;AACX;AAOO,SAAS,yBAAyB,OAAgD;AACvF,QAAM,OAAO,sBAAsB,KAAK;AACxC,MAAI,SAAS,KAAM,QAAO;AAC1B,SAAO;AAAA,IACL,iBAAiB,KAAK;AAAA,IACtB,eAAeC,kBAAAA;AAAAA,EAAA;AAEnB;AAOO,SAAS,4BACd,SACwB;AACxB,MAAIC,kBAAAA,sCAAsC,QAAS,QAAO;AAC1D,SAAO;AAAA,IACL,GAAG;AAAA,IACH,CAACA,kBAAAA,kCAAkC,GAAG,OAAOD,kBAAAA,2BAA2B;AAAA,EAAA;AAE5E;;;;"}
@@ -0,0 +1,31 @@
1
+ import { DEEP_AGENT_PROTOCOL_VERSION, DEEP_AGENT_PROTOCOL_STATE_KEY, DEEP_AGENT_PROTOCOL_VERSION_HEADER } from "./generated/runconfig-contract.js";
2
+ const isContractVersion = (value) => typeof value === "number" && Number.isInteger(value) && value >= 1;
3
+ function readDeepAgentProtocol(state) {
4
+ if (typeof state !== "object" || state === null) return null;
5
+ const lane = state[DEEP_AGENT_PROTOCOL_STATE_KEY];
6
+ if (typeof lane !== "object" || lane === null) return null;
7
+ const { version } = lane;
8
+ if (!isContractVersion(version)) return null;
9
+ return { version };
10
+ }
11
+ function projectDeepAgentProtocol(state) {
12
+ const lane = readDeepAgentProtocol(state);
13
+ if (lane === null) return null;
14
+ return {
15
+ protocolVersion: lane.version,
16
+ clientVersion: DEEP_AGENT_PROTOCOL_VERSION
17
+ };
18
+ }
19
+ function withDeclaredProtocolVersion(headers) {
20
+ if (DEEP_AGENT_PROTOCOL_VERSION_HEADER in headers) return headers;
21
+ return {
22
+ ...headers,
23
+ [DEEP_AGENT_PROTOCOL_VERSION_HEADER]: String(DEEP_AGENT_PROTOCOL_VERSION)
24
+ };
25
+ }
26
+ export {
27
+ projectDeepAgentProtocol,
28
+ readDeepAgentProtocol,
29
+ withDeclaredProtocolVersion
30
+ };
31
+ //# sourceMappingURL=protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.js","sources":["../../../../../agent-runtime/src/protocol.ts"],"sourcesContent":["import {\n DEEP_AGENT_PROTOCOL_STATE_KEY,\n DEEP_AGENT_PROTOCOL_VERSION,\n DEEP_AGENT_PROTOCOL_VERSION_HEADER,\n} from './generated/runconfig-contract';\n\n/**\n * Wire-contract version declaration between the deep-agent statewire host and\n * this client build (the client half of agora's\n * `agora/graphs/athena_deep_agent/protocol_version.py`; upstream ask\n * assistant-ui/statewire #31506 would make this a library concern).\n *\n * - Declaration: {@link withDeclaredProtocolVersion} stamps the version this\n * build speaks (`DEEP_AGENT_PROTOCOL_VERSION`, generated from the Python\n * source of truth) onto the attach headers — they ride the first WS frame's\n * mandatory `headers` field / the SSE request headers, so no statewire\n * change is needed. The host records it for attach telemetry and\n * per-version behaviour selection only.\n * - Advertisement: the host publishes its own `version` under the `protocol`\n * state key in every attach snapshot; {@link readDeepAgentProtocol} /\n * {@link projectDeepAgentProtocol} read it.\n *\n * There is no minimum client version: the host refuses no command for the\n * version its client declared (or for declaring none), so nothing here\n * compares versions or gates a send. Hosts still publish a `minClientVersion`\n * key (the constant 1) for installed clients whose lane reader required it;\n * this reader ignores it.\n *\n * Skew-tolerant on both sides: an old server advertises nothing (project\n * `null`, gate nothing), and a malformed lane reads as absent — the\n * declaration must never brick a client that could otherwise talk.\n */\nexport interface DeepAgentWireProtocol {\n /** The wire-contract version the server speaks. */\n version: number;\n}\n\n/** The advertised-lane projection a host surface reads. */\nexport interface DeepAgentProtocolStatus {\n /** Server-advertised current contract version. */\n protocolVersion: number;\n /** The contract version THIS client build declares. */\n clientVersion: number;\n}\n\nconst isContractVersion = (value: unknown): value is number =>\n typeof value === 'number' && Number.isInteger(value) && value >= 1;\n\n/**\n * The server-advertised version lane off a raw statewire state, or `null`\n * while it is unreadable — pre-attach, a pre-negotiation server's snapshot\n * (no lane), or a malformed lane (tolerated as absent, never thrown on).\n */\nexport function readDeepAgentProtocol(state: unknown): DeepAgentWireProtocol | null {\n if (typeof state !== 'object' || state === null) return null;\n const lane = (state as Record<string, unknown>)[DEEP_AGENT_PROTOCOL_STATE_KEY];\n if (typeof lane !== 'object' || lane === null) return null;\n const { version } = lane as Record<string, unknown>;\n if (!isContractVersion(version)) return null;\n return { version };\n}\n\n/**\n * Project the advertised version for a host surface, or `null` while the\n * server has not advertised (see {@link readDeepAgentProtocol}). Pure and\n * selector-safe, mirroring `readSessionPersisted`.\n */\nexport function projectDeepAgentProtocol(state: unknown): DeepAgentProtocolStatus | null {\n const lane = readDeepAgentProtocol(state);\n if (lane === null) return null;\n return {\n protocolVersion: lane.version,\n clientVersion: DEEP_AGENT_PROTOCOL_VERSION,\n };\n}\n\n/**\n * Attach headers with this build's contract version declared. Applied by\n * `useDeepAgentThread` to every resolved header set, so all surfaces declare\n * without per-host wiring; an explicit entry (tests, forced overrides) wins.\n */\nexport function withDeclaredProtocolVersion(\n headers: Record<string, string>\n): Record<string, string> {\n if (DEEP_AGENT_PROTOCOL_VERSION_HEADER in headers) return headers;\n return {\n ...headers,\n [DEEP_AGENT_PROTOCOL_VERSION_HEADER]: String(DEEP_AGENT_PROTOCOL_VERSION),\n };\n}\n"],"names":[],"mappings":";AA6CA,MAAM,oBAAoB,CAAC,UACzB,OAAO,UAAU,YAAY,OAAO,UAAU,KAAK,KAAK,SAAS;AAO5D,SAAS,sBAAsB,OAA8C;AAClF,MAAI,OAAO,UAAU,YAAY,UAAU,KAAM,QAAO;AACxD,QAAM,OAAQ,MAAkC,6BAA6B;AAC7E,MAAI,OAAO,SAAS,YAAY,SAAS,KAAM,QAAO;AACtD,QAAM,EAAE,YAAY;AACpB,MAAI,CAAC,kBAAkB,OAAO,EAAG,QAAO;AACxC,SAAO,EAAE,QAAA;AACX;AAOO,SAAS,yBAAyB,OAAgD;AACvF,QAAM,OAAO,sBAAsB,KAAK;AACxC,MAAI,SAAS,KAAM,QAAO;AAC1B,SAAO;AAAA,IACL,iBAAiB,KAAK;AAAA,IACtB,eAAe;AAAA,EAAA;AAEnB;AAOO,SAAS,4BACd,SACwB;AACxB,MAAI,sCAAsC,QAAS,QAAO;AAC1D,SAAO;AAAA,IACL,GAAG;AAAA,IACH,CAAC,kCAAkC,GAAG,OAAO,2BAA2B;AAAA,EAAA;AAE5E;"}
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const messages = require("./messages.cjs");
4
+ function queueEntryText(parts) {
5
+ return parts.flatMap(
6
+ (part) => part.type === "text" && typeof part.text === "string" ? [part.text] : []
7
+ ).join("\n\n");
8
+ }
9
+ function isQueueEntryUnsettled(entry) {
10
+ return entry.meta === void 0;
11
+ }
12
+ function readPrioritizedQueueIds(raw) {
13
+ return Array.isArray(raw) ? raw.filter((id) => typeof id === "string") : [];
14
+ }
15
+ function queueLaneFlags(status) {
16
+ return {
17
+ isRunning: status === "running",
18
+ isContinuable: status === "stopped" || status === "error"
19
+ };
20
+ }
21
+ function buildStatewireQueueRows(options) {
22
+ const { queue, steerQueue, isContinuable } = options;
23
+ return [
24
+ ...isContinuable ? steerQueue.map((item) => ({ item, lane: "steer" })) : [],
25
+ ...queue.map((item) => ({ item, lane: "queue" }))
26
+ ];
27
+ }
28
+ function showQueueRowSendNow(options) {
29
+ const { lane, index, isRunning, isContinuable } = options;
30
+ return lane === "queue" && (isContinuable || isRunning && index === 0);
31
+ }
32
+ function buildQueueEditCommand(options) {
33
+ const { item, lane, runId, text } = options;
34
+ if (!text.trim() || text === queueEntryText(item.parts) || runId === null) {
35
+ return null;
36
+ }
37
+ const message = {
38
+ id: item.id,
39
+ role: "user",
40
+ parts: [{ type: "text", text }, ...item.parts.filter((part) => part.type !== "text")],
41
+ ...item.metadata === void 0 ? {} : { metadata: item.metadata }
42
+ };
43
+ return lane === "steer" ? { type: "run/steer", runId, message } : { type: "run/enqueue", runId, message };
44
+ }
45
+ const QUEUE_AUTO_CONTINUE_DELAY_MS = 2e3;
46
+ function userStopBlocksQueueAutoContinue(options) {
47
+ return options.marker === messages.ATHENA_RUN_MARKER_CANCELLED && !messages.isServerUpdateStopSource(options.source);
48
+ }
49
+ function describeQueueSendFailure(failure) {
50
+ const message = "message" in failure && failure.message !== void 0 ? `: ${failure.message}` : "";
51
+ return `${failure.fate} (${failure.cause})${message}`;
52
+ }
53
+ function isFailedSendEntryRace(error) {
54
+ return error instanceof Error && error.message.startsWith("statewire: unknown failed");
55
+ }
56
+ exports.QUEUE_AUTO_CONTINUE_DELAY_MS = QUEUE_AUTO_CONTINUE_DELAY_MS;
57
+ exports.buildQueueEditCommand = buildQueueEditCommand;
58
+ exports.buildStatewireQueueRows = buildStatewireQueueRows;
59
+ exports.describeQueueSendFailure = describeQueueSendFailure;
60
+ exports.isFailedSendEntryRace = isFailedSendEntryRace;
61
+ exports.isQueueEntryUnsettled = isQueueEntryUnsettled;
62
+ exports.queueEntryText = queueEntryText;
63
+ exports.queueLaneFlags = queueLaneFlags;
64
+ exports.readPrioritizedQueueIds = readPrioritizedQueueIds;
65
+ exports.showQueueRowSendNow = showQueueRowSendNow;
66
+ exports.userStopBlocksQueueAutoContinue = userStopBlocksQueueAutoContinue;
67
+ //# sourceMappingURL=queue.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue.cjs","sources":["../../../../../agent-runtime/src/queue.ts"],"sourcesContent":["/**\n * Derivations for the server-owned statewire queue and steer lanes, shared by\n * every queued-messages tray (Olympus, the React SDK, the Chrome extension).\n *\n * The queue is SERVER-owned: statewire surfaces it on the runs projection.\n * \"Send now\" moves an item into the steer lane (`run/steer` — the host stops\n * the run and dispatches it once the run settles; on a stopped/errored thread\n * the same move dispatches immediately as a stop-/error-continue run) and\n * remove issues `run/dequeue`. While the thread rests stopped/errored,\n * stranded steer-lane entries list ahead of the queue — they dispatch first,\n * as one batch, so they carry Remove but no per-row Send now.\n *\n * Pure helpers only: the host component reads `useStatewireRuns()` and\n * `useDeepAgentThreadStatus()` itself (both mockable per surface) and passes\n * the values in.\n */\n\nimport type { StatewireThread } from '@assistant-ui/react-statewire';\nimport { ATHENA_RUN_MARKER_CANCELLED, isServerUpdateStopSource } from './messages';\nimport type { DeepAgentThreadStatus } from './thread-status';\n\n/** The text content of a queued entry (non-text parts render as fallbacks). */\nexport function queueEntryText(\n parts: readonly { type: string; text?: string }[],\n): string {\n return parts\n .flatMap((part) =>\n part.type === 'text' && typeof part.text === 'string' ? [part.text] : [],\n )\n .join('\\n\\n');\n}\n\n/**\n * Whether a lane entry is still awaiting its send's settle: the host stamps\n * `meta` on every entry it admits (`_op_meta` — submitter and contextSync\n * snapshot), so a meta-less entry is this client's own optimistic fold. The\n * send is still in flight and can still be refused (billing gate, auth,\n * reconnect), which the tray must not render as an accepted queue position.\n */\nexport function isQueueEntryUnsettled(entry: StatewireThread.RunsQueueEntry): boolean {\n return entry.meta === undefined;\n}\n\n/**\n * The ids of queued entries the user prioritized (⚡ — `run/prioritize`), as\n * the host records them in its durable `prioritizedQueueIds` state. A\n * prioritized entry heads the queue lane and the live run ends at its next\n * model-call boundary to deliver it, so trays render these rows lit and offer\n * \"Remove priority\" instead of \"Prioritize\". Tolerates the key being absent\n * (a thread that never prioritized, a pre-feature host) and ignores anything\n * that is not a string id.\n */\nexport function readPrioritizedQueueIds(raw: unknown): readonly string[] {\n return Array.isArray(raw)\n ? raw.filter((id): id is string => typeof id === 'string')\n : [];\n}\n\nexport interface QueueLaneFlags {\n isRunning: boolean;\n /** A stopped/errored thread can continue with its queued work. */\n isContinuable: boolean;\n}\n\n/** The thread-status split every queue tray keys its affordances on. */\nexport function queueLaneFlags(status: DeepAgentThreadStatus): QueueLaneFlags {\n return {\n isRunning: status === 'running',\n isContinuable: status === 'stopped' || status === 'error',\n };\n}\n\nexport interface StatewireQueueRow {\n item: StatewireThread.RunsQueueEntry;\n lane: 'queue' | 'steer';\n}\n\n/**\n * The rows a queue tray renders, in dispatch order: stranded steer-lane\n * entries first (only while the thread rests continuable — during a run they\n * already render in the message list), then the queue lane.\n */\nexport function buildStatewireQueueRows(options: {\n queue: readonly StatewireThread.RunsQueueEntry[];\n steerQueue: readonly StatewireThread.RunsQueueEntry[];\n isContinuable: boolean;\n}): StatewireQueueRow[] {\n const { queue, steerQueue, isContinuable } = options;\n return [\n ...(isContinuable\n ? steerQueue.map((item) => ({ item, lane: 'steer' as const }))\n : []),\n ...queue.map((item) => ({ item, lane: 'queue' as const })),\n ];\n}\n\n/**\n * Whether a row offers \"Send now\": queue-lane rows only (steer entries already\n * dispatch first), every row while the thread rests continuable, and only the\n * head row while a run is live (later rows would jump the queue order).\n */\nexport function showQueueRowSendNow(options: {\n lane: 'queue' | 'steer';\n index: number;\n isRunning: boolean;\n isContinuable: boolean;\n}): boolean {\n const { lane, index, isRunning, isContinuable } = options;\n return lane === 'queue' && (isContinuable || (isRunning && index === 0));\n}\n\nexport type QueueEditCommand =\n | { type: 'run/steer'; runId: string; message: StatewireThread.UserMessage }\n | { type: 'run/enqueue'; runId: string; message: StatewireThread.UserMessage };\n\n/**\n * Re-send a queued entry under its own id on its own lane with edited text:\n * the host replaces the queued message's content in place, leaving its queue\n * position and lane untouched (a same-id send never dispatches). The built-in\n * queue client has no update command, so this goes straight to the runs\n * protocol. Returns `null` when there is nothing to send — blank or unchanged\n * text, or no live run entry to address.\n */\nexport function buildQueueEditCommand(options: {\n item: StatewireThread.RunsQueueEntry;\n lane: 'queue' | 'steer';\n runId: string | null;\n text: string;\n}): QueueEditCommand | null {\n const { item, lane, runId, text } = options;\n if (!text.trim() || text === queueEntryText(item.parts) || runId === null) {\n return null;\n }\n const message: StatewireThread.UserMessage = {\n id: item.id,\n role: 'user',\n parts: [{ type: 'text', text }, ...item.parts.filter((part) => part.type !== 'text')],\n ...(item.metadata === undefined ? {} : { metadata: item.metadata }),\n };\n return lane === 'steer'\n ? { type: 'run/steer', runId, message }\n : { type: 'run/enqueue', runId, message };\n}\n\n/**\n * Grace between observing a stranded settle and auto-promoting the queue\n * head — long enough for the host's own settle bookkeeping (or a status flap\n * during reconnect) to resolve first, short enough to read as \"it just\n * continued\" rather than \"it hung\".\n */\nexport const QUEUE_AUTO_CONTINUE_DELAY_MS = 2_000;\n\n/** Whether the last cancellation marker records a user or client stop. */\nexport function userStopBlocksQueueAutoContinue(options: {\n marker: string | undefined;\n source: string | undefined;\n}): boolean {\n return (\n options.marker === ATHENA_RUN_MARKER_CANCELLED && !isServerUpdateStopSource(options.source)\n );\n}\n\n/** `fate (cause)[: message]` — the detail a failed-send row carries. */\nexport function describeQueueSendFailure(\n failure: StatewireThread.RunsFailedEntry['sendFailure'],\n): string {\n const message =\n 'message' in failure && failure.message !== undefined ? `: ${failure.message}` : '';\n return `${failure.fate} (${failure.cause})${message}`;\n}\n\n/**\n * Whether a `retryFailed` / `discardFailed` throw is the covered drop race:\n * statewire drops a failed entry on its own as soon as a canonical update\n * shows the message landed, and acting on a just-dropped entry throws. Both\n * the session record (\"unknown failed command\") and the adapter's projection\n * (\"unknown failed entry\") use this prefix. Nothing is lost in that race — the\n * message already made it and the row is about to disappear — so a tray\n * swallows it (keeping telemetry) instead of crashing the click handler.\n */\nexport function isFailedSendEntryRace(error: unknown): boolean {\n return error instanceof Error && error.message.startsWith('statewire: unknown failed');\n}\n"],"names":["ATHENA_RUN_MARKER_CANCELLED","isServerUpdateStopSource"],"mappings":";;;AAsBO,SAAS,eACd,OACQ;AACR,SAAO,MACJ;AAAA,IAAQ,CAAC,SACR,KAAK,SAAS,UAAU,OAAO,KAAK,SAAS,WAAW,CAAC,KAAK,IAAI,IAAI,CAAA;AAAA,EAAC,EAExE,KAAK,MAAM;AAChB;AASO,SAAS,sBAAsB,OAAgD;AACpF,SAAO,MAAM,SAAS;AACxB;AAWO,SAAS,wBAAwB,KAAiC;AACvE,SAAO,MAAM,QAAQ,GAAG,IACpB,IAAI,OAAO,CAAC,OAAqB,OAAO,OAAO,QAAQ,IACvD,CAAA;AACN;AASO,SAAS,eAAe,QAA+C;AAC5E,SAAO;AAAA,IACL,WAAW,WAAW;AAAA,IACtB,eAAe,WAAW,aAAa,WAAW;AAAA,EAAA;AAEtD;AAYO,SAAS,wBAAwB,SAIhB;AACtB,QAAM,EAAE,OAAO,YAAY,cAAA,IAAkB;AAC7C,SAAO;AAAA,IACL,GAAI,gBACA,WAAW,IAAI,CAAC,UAAU,EAAE,MAAM,MAAM,UAAmB,IAC3D,CAAA;AAAA,IACJ,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,MAAM,MAAM,UAAmB;AAAA,EAAA;AAE7D;AAOO,SAAS,oBAAoB,SAKxB;AACV,QAAM,EAAE,MAAM,OAAO,WAAW,kBAAkB;AAClD,SAAO,SAAS,YAAY,iBAAkB,aAAa,UAAU;AACvE;AAcO,SAAS,sBAAsB,SAKV;AAC1B,QAAM,EAAE,MAAM,MAAM,OAAO,SAAS;AACpC,MAAI,CAAC,KAAK,KAAA,KAAU,SAAS,eAAe,KAAK,KAAK,KAAK,UAAU,MAAM;AACzE,WAAO;AAAA,EACT;AACA,QAAM,UAAuC;AAAA,IAC3C,IAAI,KAAK;AAAA,IACT,MAAM;AAAA,IACN,OAAO,CAAC,EAAE,MAAM,QAAQ,QAAQ,GAAG,KAAK,MAAM,OAAO,CAAC,SAAS,KAAK,SAAS,MAAM,CAAC;AAAA,IACpF,GAAI,KAAK,aAAa,SAAY,CAAA,IAAK,EAAE,UAAU,KAAK,SAAA;AAAA,EAAS;AAEnE,SAAO,SAAS,UACZ,EAAE,MAAM,aAAa,OAAO,QAAA,IAC5B,EAAE,MAAM,eAAe,OAAO,QAAA;AACpC;AAQO,MAAM,+BAA+B;AAGrC,SAAS,gCAAgC,SAGpC;AACV,SACE,QAAQ,WAAWA,SAAAA,+BAA+B,CAACC,SAAAA,yBAAyB,QAAQ,MAAM;AAE9F;AAGO,SAAS,yBACd,SACQ;AACR,QAAM,UACJ,aAAa,WAAW,QAAQ,YAAY,SAAY,KAAK,QAAQ,OAAO,KAAK;AACnF,SAAO,GAAG,QAAQ,IAAI,KAAK,QAAQ,KAAK,IAAI,OAAO;AACrD;AAWO,SAAS,sBAAsB,OAAyB;AAC7D,SAAO,iBAAiB,SAAS,MAAM,QAAQ,WAAW,2BAA2B;AACvF;;;;;;;;;;;;"}
@@ -0,0 +1,67 @@
1
+ import { ATHENA_RUN_MARKER_CANCELLED, isServerUpdateStopSource } from "./messages.js";
2
+ function queueEntryText(parts) {
3
+ return parts.flatMap(
4
+ (part) => part.type === "text" && typeof part.text === "string" ? [part.text] : []
5
+ ).join("\n\n");
6
+ }
7
+ function isQueueEntryUnsettled(entry) {
8
+ return entry.meta === void 0;
9
+ }
10
+ function readPrioritizedQueueIds(raw) {
11
+ return Array.isArray(raw) ? raw.filter((id) => typeof id === "string") : [];
12
+ }
13
+ function queueLaneFlags(status) {
14
+ return {
15
+ isRunning: status === "running",
16
+ isContinuable: status === "stopped" || status === "error"
17
+ };
18
+ }
19
+ function buildStatewireQueueRows(options) {
20
+ const { queue, steerQueue, isContinuable } = options;
21
+ return [
22
+ ...isContinuable ? steerQueue.map((item) => ({ item, lane: "steer" })) : [],
23
+ ...queue.map((item) => ({ item, lane: "queue" }))
24
+ ];
25
+ }
26
+ function showQueueRowSendNow(options) {
27
+ const { lane, index, isRunning, isContinuable } = options;
28
+ return lane === "queue" && (isContinuable || isRunning && index === 0);
29
+ }
30
+ function buildQueueEditCommand(options) {
31
+ const { item, lane, runId, text } = options;
32
+ if (!text.trim() || text === queueEntryText(item.parts) || runId === null) {
33
+ return null;
34
+ }
35
+ const message = {
36
+ id: item.id,
37
+ role: "user",
38
+ parts: [{ type: "text", text }, ...item.parts.filter((part) => part.type !== "text")],
39
+ ...item.metadata === void 0 ? {} : { metadata: item.metadata }
40
+ };
41
+ return lane === "steer" ? { type: "run/steer", runId, message } : { type: "run/enqueue", runId, message };
42
+ }
43
+ const QUEUE_AUTO_CONTINUE_DELAY_MS = 2e3;
44
+ function userStopBlocksQueueAutoContinue(options) {
45
+ return options.marker === ATHENA_RUN_MARKER_CANCELLED && !isServerUpdateStopSource(options.source);
46
+ }
47
+ function describeQueueSendFailure(failure) {
48
+ const message = "message" in failure && failure.message !== void 0 ? `: ${failure.message}` : "";
49
+ return `${failure.fate} (${failure.cause})${message}`;
50
+ }
51
+ function isFailedSendEntryRace(error) {
52
+ return error instanceof Error && error.message.startsWith("statewire: unknown failed");
53
+ }
54
+ export {
55
+ QUEUE_AUTO_CONTINUE_DELAY_MS,
56
+ buildQueueEditCommand,
57
+ buildStatewireQueueRows,
58
+ describeQueueSendFailure,
59
+ isFailedSendEntryRace,
60
+ isQueueEntryUnsettled,
61
+ queueEntryText,
62
+ queueLaneFlags,
63
+ readPrioritizedQueueIds,
64
+ showQueueRowSendNow,
65
+ userStopBlocksQueueAutoContinue
66
+ };
67
+ //# sourceMappingURL=queue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue.js","sources":["../../../../../agent-runtime/src/queue.ts"],"sourcesContent":["/**\n * Derivations for the server-owned statewire queue and steer lanes, shared by\n * every queued-messages tray (Olympus, the React SDK, the Chrome extension).\n *\n * The queue is SERVER-owned: statewire surfaces it on the runs projection.\n * \"Send now\" moves an item into the steer lane (`run/steer` — the host stops\n * the run and dispatches it once the run settles; on a stopped/errored thread\n * the same move dispatches immediately as a stop-/error-continue run) and\n * remove issues `run/dequeue`. While the thread rests stopped/errored,\n * stranded steer-lane entries list ahead of the queue — they dispatch first,\n * as one batch, so they carry Remove but no per-row Send now.\n *\n * Pure helpers only: the host component reads `useStatewireRuns()` and\n * `useDeepAgentThreadStatus()` itself (both mockable per surface) and passes\n * the values in.\n */\n\nimport type { StatewireThread } from '@assistant-ui/react-statewire';\nimport { ATHENA_RUN_MARKER_CANCELLED, isServerUpdateStopSource } from './messages';\nimport type { DeepAgentThreadStatus } from './thread-status';\n\n/** The text content of a queued entry (non-text parts render as fallbacks). */\nexport function queueEntryText(\n parts: readonly { type: string; text?: string }[],\n): string {\n return parts\n .flatMap((part) =>\n part.type === 'text' && typeof part.text === 'string' ? [part.text] : [],\n )\n .join('\\n\\n');\n}\n\n/**\n * Whether a lane entry is still awaiting its send's settle: the host stamps\n * `meta` on every entry it admits (`_op_meta` — submitter and contextSync\n * snapshot), so a meta-less entry is this client's own optimistic fold. The\n * send is still in flight and can still be refused (billing gate, auth,\n * reconnect), which the tray must not render as an accepted queue position.\n */\nexport function isQueueEntryUnsettled(entry: StatewireThread.RunsQueueEntry): boolean {\n return entry.meta === undefined;\n}\n\n/**\n * The ids of queued entries the user prioritized (⚡ — `run/prioritize`), as\n * the host records them in its durable `prioritizedQueueIds` state. A\n * prioritized entry heads the queue lane and the live run ends at its next\n * model-call boundary to deliver it, so trays render these rows lit and offer\n * \"Remove priority\" instead of \"Prioritize\". Tolerates the key being absent\n * (a thread that never prioritized, a pre-feature host) and ignores anything\n * that is not a string id.\n */\nexport function readPrioritizedQueueIds(raw: unknown): readonly string[] {\n return Array.isArray(raw)\n ? raw.filter((id): id is string => typeof id === 'string')\n : [];\n}\n\nexport interface QueueLaneFlags {\n isRunning: boolean;\n /** A stopped/errored thread can continue with its queued work. */\n isContinuable: boolean;\n}\n\n/** The thread-status split every queue tray keys its affordances on. */\nexport function queueLaneFlags(status: DeepAgentThreadStatus): QueueLaneFlags {\n return {\n isRunning: status === 'running',\n isContinuable: status === 'stopped' || status === 'error',\n };\n}\n\nexport interface StatewireQueueRow {\n item: StatewireThread.RunsQueueEntry;\n lane: 'queue' | 'steer';\n}\n\n/**\n * The rows a queue tray renders, in dispatch order: stranded steer-lane\n * entries first (only while the thread rests continuable — during a run they\n * already render in the message list), then the queue lane.\n */\nexport function buildStatewireQueueRows(options: {\n queue: readonly StatewireThread.RunsQueueEntry[];\n steerQueue: readonly StatewireThread.RunsQueueEntry[];\n isContinuable: boolean;\n}): StatewireQueueRow[] {\n const { queue, steerQueue, isContinuable } = options;\n return [\n ...(isContinuable\n ? steerQueue.map((item) => ({ item, lane: 'steer' as const }))\n : []),\n ...queue.map((item) => ({ item, lane: 'queue' as const })),\n ];\n}\n\n/**\n * Whether a row offers \"Send now\": queue-lane rows only (steer entries already\n * dispatch first), every row while the thread rests continuable, and only the\n * head row while a run is live (later rows would jump the queue order).\n */\nexport function showQueueRowSendNow(options: {\n lane: 'queue' | 'steer';\n index: number;\n isRunning: boolean;\n isContinuable: boolean;\n}): boolean {\n const { lane, index, isRunning, isContinuable } = options;\n return lane === 'queue' && (isContinuable || (isRunning && index === 0));\n}\n\nexport type QueueEditCommand =\n | { type: 'run/steer'; runId: string; message: StatewireThread.UserMessage }\n | { type: 'run/enqueue'; runId: string; message: StatewireThread.UserMessage };\n\n/**\n * Re-send a queued entry under its own id on its own lane with edited text:\n * the host replaces the queued message's content in place, leaving its queue\n * position and lane untouched (a same-id send never dispatches). The built-in\n * queue client has no update command, so this goes straight to the runs\n * protocol. Returns `null` when there is nothing to send — blank or unchanged\n * text, or no live run entry to address.\n */\nexport function buildQueueEditCommand(options: {\n item: StatewireThread.RunsQueueEntry;\n lane: 'queue' | 'steer';\n runId: string | null;\n text: string;\n}): QueueEditCommand | null {\n const { item, lane, runId, text } = options;\n if (!text.trim() || text === queueEntryText(item.parts) || runId === null) {\n return null;\n }\n const message: StatewireThread.UserMessage = {\n id: item.id,\n role: 'user',\n parts: [{ type: 'text', text }, ...item.parts.filter((part) => part.type !== 'text')],\n ...(item.metadata === undefined ? {} : { metadata: item.metadata }),\n };\n return lane === 'steer'\n ? { type: 'run/steer', runId, message }\n : { type: 'run/enqueue', runId, message };\n}\n\n/**\n * Grace between observing a stranded settle and auto-promoting the queue\n * head — long enough for the host's own settle bookkeeping (or a status flap\n * during reconnect) to resolve first, short enough to read as \"it just\n * continued\" rather than \"it hung\".\n */\nexport const QUEUE_AUTO_CONTINUE_DELAY_MS = 2_000;\n\n/** Whether the last cancellation marker records a user or client stop. */\nexport function userStopBlocksQueueAutoContinue(options: {\n marker: string | undefined;\n source: string | undefined;\n}): boolean {\n return (\n options.marker === ATHENA_RUN_MARKER_CANCELLED && !isServerUpdateStopSource(options.source)\n );\n}\n\n/** `fate (cause)[: message]` — the detail a failed-send row carries. */\nexport function describeQueueSendFailure(\n failure: StatewireThread.RunsFailedEntry['sendFailure'],\n): string {\n const message =\n 'message' in failure && failure.message !== undefined ? `: ${failure.message}` : '';\n return `${failure.fate} (${failure.cause})${message}`;\n}\n\n/**\n * Whether a `retryFailed` / `discardFailed` throw is the covered drop race:\n * statewire drops a failed entry on its own as soon as a canonical update\n * shows the message landed, and acting on a just-dropped entry throws. Both\n * the session record (\"unknown failed command\") and the adapter's projection\n * (\"unknown failed entry\") use this prefix. Nothing is lost in that race — the\n * message already made it and the row is about to disappear — so a tray\n * swallows it (keeping telemetry) instead of crashing the click handler.\n */\nexport function isFailedSendEntryRace(error: unknown): boolean {\n return error instanceof Error && error.message.startsWith('statewire: unknown failed');\n}\n"],"names":[],"mappings":";AAsBO,SAAS,eACd,OACQ;AACR,SAAO,MACJ;AAAA,IAAQ,CAAC,SACR,KAAK,SAAS,UAAU,OAAO,KAAK,SAAS,WAAW,CAAC,KAAK,IAAI,IAAI,CAAA;AAAA,EAAC,EAExE,KAAK,MAAM;AAChB;AASO,SAAS,sBAAsB,OAAgD;AACpF,SAAO,MAAM,SAAS;AACxB;AAWO,SAAS,wBAAwB,KAAiC;AACvE,SAAO,MAAM,QAAQ,GAAG,IACpB,IAAI,OAAO,CAAC,OAAqB,OAAO,OAAO,QAAQ,IACvD,CAAA;AACN;AASO,SAAS,eAAe,QAA+C;AAC5E,SAAO;AAAA,IACL,WAAW,WAAW;AAAA,IACtB,eAAe,WAAW,aAAa,WAAW;AAAA,EAAA;AAEtD;AAYO,SAAS,wBAAwB,SAIhB;AACtB,QAAM,EAAE,OAAO,YAAY,cAAA,IAAkB;AAC7C,SAAO;AAAA,IACL,GAAI,gBACA,WAAW,IAAI,CAAC,UAAU,EAAE,MAAM,MAAM,UAAmB,IAC3D,CAAA;AAAA,IACJ,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,MAAM,MAAM,UAAmB;AAAA,EAAA;AAE7D;AAOO,SAAS,oBAAoB,SAKxB;AACV,QAAM,EAAE,MAAM,OAAO,WAAW,kBAAkB;AAClD,SAAO,SAAS,YAAY,iBAAkB,aAAa,UAAU;AACvE;AAcO,SAAS,sBAAsB,SAKV;AAC1B,QAAM,EAAE,MAAM,MAAM,OAAO,SAAS;AACpC,MAAI,CAAC,KAAK,KAAA,KAAU,SAAS,eAAe,KAAK,KAAK,KAAK,UAAU,MAAM;AACzE,WAAO;AAAA,EACT;AACA,QAAM,UAAuC;AAAA,IAC3C,IAAI,KAAK;AAAA,IACT,MAAM;AAAA,IACN,OAAO,CAAC,EAAE,MAAM,QAAQ,QAAQ,GAAG,KAAK,MAAM,OAAO,CAAC,SAAS,KAAK,SAAS,MAAM,CAAC;AAAA,IACpF,GAAI,KAAK,aAAa,SAAY,CAAA,IAAK,EAAE,UAAU,KAAK,SAAA;AAAA,EAAS;AAEnE,SAAO,SAAS,UACZ,EAAE,MAAM,aAAa,OAAO,QAAA,IAC5B,EAAE,MAAM,eAAe,OAAO,QAAA;AACpC;AAQO,MAAM,+BAA+B;AAGrC,SAAS,gCAAgC,SAGpC;AACV,SACE,QAAQ,WAAW,+BAA+B,CAAC,yBAAyB,QAAQ,MAAM;AAE9F;AAGO,SAAS,yBACd,SACQ;AACR,QAAM,UACJ,aAAa,WAAW,QAAQ,YAAY,SAAY,KAAK,QAAQ,OAAO,KAAK;AACnF,SAAO,GAAG,QAAQ,IAAI,KAAK,QAAQ,KAAK,IAAI,OAAO;AACrD;AAWO,SAAS,sBAAsB,OAAyB;AAC7D,SAAO,iBAAiB,SAAS,MAAM,QAAQ,WAAW,2BAA2B;AACvF;"}
@@ -0,0 +1,329 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const tap = require("@assistant-ui/tap");
4
+ const storage = require("statewire/storage");
5
+ const react = require("react");
6
+ const SESSION_PREFIX = "aui:statewire-session:";
7
+ const SESSION_LOCK_PREFIX = "aui:statewire-session-lock:";
8
+ const SESSION_ACTIVE_PREFIX = "aui:statewire-session-active:";
9
+ const LEGACY_PROTOCOL = { name: "athena", version: "2026-09-07" };
10
+ const DAY_MS = 24 * 60 * 60 * 1e3;
11
+ const READABLE_STORAGE_VERSIONS = /* @__PURE__ */ new Set([1, 2]);
12
+ const browserGlobals = globalThis;
13
+ function readPersistedFailedSendStamps(sessionKey) {
14
+ const storage2 = browserGlobals.localStorage;
15
+ if (!storage2) return null;
16
+ let record;
17
+ try {
18
+ const raw = storage2.getItem(SESSION_PREFIX + sessionKey);
19
+ record = raw === null ? null : JSON.parse(raw);
20
+ } catch {
21
+ return null;
22
+ }
23
+ return readFailedSendStampsFromRecord(record);
24
+ }
25
+ function readFailedSendStampsFromRecord(record) {
26
+ var _a, _b, _c;
27
+ if (!record || typeof record !== "object") return null;
28
+ const stamps = /* @__PURE__ */ new Map();
29
+ if (!Array.isArray(record.failed)) return stamps;
30
+ for (const entry of record.failed) {
31
+ const failed = entry;
32
+ const messageId = (_c = (_b = (_a = failed == null ? void 0 : failed.params) == null ? void 0 : _a[0]) == null ? void 0 : _b.message) == null ? void 0 : _c.id;
33
+ if (typeof messageId === "string" && typeof (failed == null ? void 0 : failed.ts) === "number") {
34
+ stamps.set(messageId, failed.ts);
35
+ }
36
+ }
37
+ return stamps;
38
+ }
39
+ function isStorageQuotaError(error) {
40
+ if (typeof error !== "object" || error === null) return false;
41
+ const { name, code, message } = error;
42
+ return name === "QuotaExceededError" || name === "NS_ERROR_DOM_QUOTA_REACHED" || code === 22 || code === 1014 || typeof message === "string" && /exceeded the quota|quotaexceedederror|ns_error_dom_quota_reached/i.test(
43
+ message
44
+ );
45
+ }
46
+ function asStatewireQuotaError(error) {
47
+ if (error instanceof Error && error.name === "QuotaExceededError")
48
+ return error;
49
+ const normalized = new Error(
50
+ error instanceof Error ? error.message : "storage quota exceeded"
51
+ );
52
+ normalized.name = "QuotaExceededError";
53
+ return normalized;
54
+ }
55
+ function unreadableRecord(raw) {
56
+ let parsed;
57
+ try {
58
+ parsed = JSON.parse(raw);
59
+ } catch (error) {
60
+ return error instanceof Error ? error : new Error("stored session record is not JSON");
61
+ }
62
+ if (typeof parsed !== "object" || parsed === null) {
63
+ return new Error("stored session record is not an object");
64
+ }
65
+ const version = parsed.statewireStorageVersion;
66
+ if (version !== void 0 && !READABLE_STORAGE_VERSIONS.has(version)) {
67
+ return new Error(
68
+ `stored session record uses storage version ${String(version)}`
69
+ );
70
+ }
71
+ return void 0;
72
+ }
73
+ function browserBackend({
74
+ storage: storage2,
75
+ locks
76
+ }) {
77
+ return {
78
+ getItem: (key) => storage2.getItem(key),
79
+ setItem: (key, value) => storage2.setItem(key, value),
80
+ removeItem: (key) => storage2.removeItem(key),
81
+ getAllKeys: () => Array.from(
82
+ { length: storage2.length },
83
+ (_, index) => storage2.key(index)
84
+ ).filter((key) => key !== null),
85
+ withUnused: async (key, action) => {
86
+ await locks.request(
87
+ SESSION_ACTIVE_PREFIX + key,
88
+ { ifAvailable: true },
89
+ async (active) => {
90
+ if (active === null) return;
91
+ await locks.request(
92
+ SESSION_LOCK_PREFIX + key.slice(SESSION_PREFIX.length),
93
+ { ifAvailable: true },
94
+ async (lock) => {
95
+ if (lock === null) return;
96
+ await action();
97
+ }
98
+ );
99
+ }
100
+ );
101
+ }
102
+ };
103
+ }
104
+ function quotaTolerantBackend({
105
+ inner,
106
+ onDegraded
107
+ }) {
108
+ const quotaSurfaced = /* @__PURE__ */ new Set();
109
+ const overlay = /* @__PURE__ */ new Map();
110
+ const shielded = /* @__PURE__ */ new Set();
111
+ const checked = /* @__PURE__ */ new Map();
112
+ const readable = (key, raw) => {
113
+ const previous = checked.get(key);
114
+ if (previous !== void 0 && previous.raw === raw) return previous.verdict;
115
+ const verdict = unreadableRecord(raw);
116
+ checked.set(key, { raw, verdict });
117
+ return verdict;
118
+ };
119
+ return {
120
+ getItem: (key) => {
121
+ const shadowed = overlay.get(key);
122
+ if (shadowed !== void 0) return shadowed;
123
+ if (shielded.has(key)) return null;
124
+ let raw;
125
+ try {
126
+ raw = inner.getItem(key);
127
+ } catch (error) {
128
+ shielded.add(key);
129
+ onDegraded({ operation: "getItem", key, error });
130
+ return null;
131
+ }
132
+ if (raw === null) return null;
133
+ const unreadable = readable(key, raw);
134
+ if (unreadable === void 0) return raw;
135
+ shielded.add(key);
136
+ onDegraded({ operation: "record", key, error: unreadable });
137
+ return null;
138
+ },
139
+ setItem: (key, value) => {
140
+ if (shielded.has(key)) {
141
+ overlay.set(key, value);
142
+ return;
143
+ }
144
+ try {
145
+ inner.setItem(key, value);
146
+ overlay.delete(key);
147
+ quotaSurfaced.delete(key);
148
+ } catch (error) {
149
+ if (isStorageQuotaError(error) && !quotaSurfaced.has(key)) {
150
+ quotaSurfaced.add(key);
151
+ throw asStatewireQuotaError(error);
152
+ }
153
+ overlay.set(key, value);
154
+ onDegraded({ operation: "setItem", key, error });
155
+ }
156
+ },
157
+ removeItem: (key) => {
158
+ overlay.delete(key);
159
+ if (shielded.has(key)) return;
160
+ try {
161
+ inner.removeItem(key);
162
+ } catch (error) {
163
+ onDegraded({ operation: "removeItem", key, error });
164
+ }
165
+ },
166
+ getAllKeys: () => {
167
+ const keys = new Set(overlay.keys());
168
+ try {
169
+ for (const key of inner.getAllKeys()) keys.add(key);
170
+ } catch (error) {
171
+ onDegraded({ operation: "getAllKeys", key: "", error });
172
+ }
173
+ return [...keys];
174
+ },
175
+ withUnused: async (key, action) => {
176
+ try {
177
+ await inner.withUnused(key, action);
178
+ } catch (error) {
179
+ onDegraded({ operation: "withUnused", key, error });
180
+ }
181
+ }
182
+ };
183
+ }
184
+ const sharedBackends = /* @__PURE__ */ new WeakMap();
185
+ function sharedBackend({
186
+ storage: storage2,
187
+ locks
188
+ }) {
189
+ let shared = sharedBackends.get(storage2);
190
+ if (shared === void 0) {
191
+ const listeners = /* @__PURE__ */ new Set();
192
+ shared = {
193
+ listeners,
194
+ backend: quotaTolerantBackend({
195
+ inner: browserBackend({ storage: storage2, locks }),
196
+ onDegraded: (degradation) => {
197
+ for (const listener of listeners) listener(degradation);
198
+ }
199
+ })
200
+ };
201
+ sharedBackends.set(storage2, shared);
202
+ }
203
+ return shared;
204
+ }
205
+ const useQuotaSafeLocalStorageSession = ({
206
+ threadId,
207
+ key = (id) => id,
208
+ ttl = 7 * DAY_MS,
209
+ max = 50,
210
+ onStorageDegraded
211
+ }) => {
212
+ var _a;
213
+ const storage$1 = browserGlobals.localStorage;
214
+ const locks = (_a = browserGlobals.navigator) == null ? void 0 : _a.locks;
215
+ if (!storage$1)
216
+ throw new Error(
217
+ "statewire: QuotaSafeLocalStorageSession requires localStorage"
218
+ );
219
+ if (!locks)
220
+ throw new Error(
221
+ "statewire: QuotaSafeLocalStorageSession requires the Web Locks API (navigator.locks)"
222
+ );
223
+ const sessionKey = key(threadId);
224
+ const storageKey = SESSION_PREFIX + sessionKey;
225
+ const lockName = SESSION_LOCK_PREFIX + sessionKey;
226
+ const latestOnDegraded = react.useRef(onStorageDegraded);
227
+ latestOnDegraded.current = onStorageDegraded;
228
+ const reportDegradation = react.useMemo(() => {
229
+ const reported = /* @__PURE__ */ new Set();
230
+ return (degradation) => {
231
+ const handler = latestOnDegraded.current;
232
+ if (handler) {
233
+ try {
234
+ handler(degradation);
235
+ } catch {
236
+ }
237
+ return;
238
+ }
239
+ const dedupeKey = `${degradation.operation}:${degradation.key}`;
240
+ if (reported.has(dedupeKey)) return;
241
+ reported.add(dedupeKey);
242
+ console.warn(
243
+ `[statewire] session storage degraded to memory only (${degradation.operation} ${degradation.key})`,
244
+ degradation.error
245
+ );
246
+ };
247
+ }, []);
248
+ const shared = sharedBackend({ storage: storage$1, locks });
249
+ shared.listeners.add(reportDegradation);
250
+ react.useEffect(() => {
251
+ shared.listeners.add(reportDegradation);
252
+ return () => {
253
+ shared.listeners.delete(reportDegradation);
254
+ };
255
+ }, [shared, reportDegradation]);
256
+ react.useEffect(() => {
257
+ let release;
258
+ let disposed = false;
259
+ Promise.resolve(
260
+ locks.request(
261
+ SESSION_ACTIVE_PREFIX + storageKey,
262
+ { mode: "shared" },
263
+ () => {
264
+ if (disposed) return;
265
+ return new Promise((resolve) => {
266
+ release = resolve;
267
+ });
268
+ }
269
+ )
270
+ ).catch(
271
+ (error) => reportDegradation({ operation: "lock", key: storageKey, error })
272
+ );
273
+ return () => {
274
+ disposed = true;
275
+ release == null ? void 0 : release();
276
+ };
277
+ }, [locks, storageKey, reportDegradation]);
278
+ const sessionStorage = tap.useResource(
279
+ storage.KeyValueSessionStorage({
280
+ backend: shared.backend,
281
+ key: sessionKey,
282
+ namespace: SESSION_PREFIX,
283
+ legacyProtocol: LEGACY_PROTOCOL,
284
+ retention: { maxAgeMs: ttl, maxEntries: max },
285
+ // A failure statewire raises itself (a structurally invalid stored
286
+ // record) still stops the session; it is at least reported the same way.
287
+ onError: (error) => reportDegradation({ operation: "session", key: storageKey, error })
288
+ })
289
+ );
290
+ return react.useMemo(
291
+ () => ({
292
+ ...sessionStorage,
293
+ lock: async (fn) => {
294
+ let granted = false;
295
+ try {
296
+ return await locks.request(lockName, async () => {
297
+ granted = true;
298
+ return fn();
299
+ });
300
+ } catch (error) {
301
+ if (granted) throw error;
302
+ reportDegradation({ operation: "lock", key: storageKey, error });
303
+ return fn();
304
+ }
305
+ },
306
+ subscribe: (listener) => {
307
+ var _a2;
308
+ const onStorage = (event) => {
309
+ if (event.key === storageKey) listener();
310
+ };
311
+ (_a2 = browserGlobals.addEventListener) == null ? void 0 : _a2.call(browserGlobals, "storage", onStorage);
312
+ return () => {
313
+ var _a3;
314
+ return (_a3 = browserGlobals.removeEventListener) == null ? void 0 : _a3.call(browserGlobals, "storage", onStorage);
315
+ };
316
+ }
317
+ }),
318
+ [sessionStorage, locks, storageKey, lockName, reportDegradation]
319
+ );
320
+ };
321
+ const QuotaSafeLocalStorageSession = tap.resource(
322
+ useQuotaSafeLocalStorageSession
323
+ );
324
+ exports.QuotaSafeLocalStorageSession = QuotaSafeLocalStorageSession;
325
+ exports.isStorageQuotaError = isStorageQuotaError;
326
+ exports.quotaTolerantBackend = quotaTolerantBackend;
327
+ exports.readFailedSendStampsFromRecord = readFailedSendStampsFromRecord;
328
+ exports.readPersistedFailedSendStamps = readPersistedFailedSendStamps;
329
+ //# sourceMappingURL=quota-safe-local-storage-session.cjs.map