@tambo-ai/react 0.75.0 → 1.0.0-rc.4

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 (613) hide show
  1. package/dist/hoc/with-tambo-interactable.d.ts.map +1 -1
  2. package/dist/hoc/with-tambo-interactable.js +13 -13
  3. package/dist/hoc/with-tambo-interactable.js.map +1 -1
  4. package/dist/hoc/with-tambo-interactable.test.js +3 -3
  5. package/dist/hoc/with-tambo-interactable.test.js.map +1 -1
  6. package/dist/index.d.ts +7 -25
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +7 -59
  9. package/dist/index.js.map +1 -1
  10. package/dist/mcp/mcp-hooks.js +5 -5
  11. package/dist/mcp/mcp-hooks.js.map +1 -1
  12. package/dist/model/component-metadata.d.ts +4 -4
  13. package/dist/model/component-metadata.js.map +1 -1
  14. package/dist/providers/tambo-client-provider.d.ts +6 -0
  15. package/dist/providers/tambo-client-provider.d.ts.map +1 -1
  16. package/dist/providers/tambo-client-provider.js +4 -2
  17. package/dist/providers/tambo-client-provider.js.map +1 -1
  18. package/dist/providers/tambo-interactable-provider.d.ts +1 -1
  19. package/dist/providers/tambo-interactables-additional-context-edge-cases.test.js +2 -10
  20. package/dist/providers/tambo-interactables-additional-context-edge-cases.test.js.map +1 -1
  21. package/dist/providers/tambo-interactables-additional-context.test.js +3 -19
  22. package/dist/providers/tambo-interactables-additional-context.test.js.map +1 -1
  23. package/dist/providers/tambo-mcp-token-provider.d.ts +8 -17
  24. package/dist/providers/tambo-mcp-token-provider.d.ts.map +1 -1
  25. package/dist/providers/tambo-mcp-token-provider.js +20 -97
  26. package/dist/providers/tambo-mcp-token-provider.js.map +1 -1
  27. package/dist/testing/tools.d.ts +3 -3
  28. package/dist/testing/tools.d.ts.map +1 -1
  29. package/dist/testing/tools.js.map +1 -1
  30. package/dist/util/registry-validators.js +1 -1
  31. package/dist/util/registry-validators.js.map +1 -1
  32. package/dist/v1/__tests__/v1-interactables.test.js +1 -1
  33. package/dist/v1/__tests__/v1-interactables.test.js.map +1 -1
  34. package/dist/v1/components/v1-component-renderer.d.ts +9 -9
  35. package/dist/v1/components/v1-component-renderer.d.ts.map +1 -1
  36. package/dist/v1/components/v1-component-renderer.js +13 -13
  37. package/dist/v1/components/v1-component-renderer.js.map +1 -1
  38. package/dist/v1/components/v1-component-renderer.test.js +15 -15
  39. package/dist/v1/components/v1-component-renderer.test.js.map +1 -1
  40. package/{esm/hooks/use-current-message.d.ts → dist/v1/hooks/use-tambo-current-message.d.ts} +30 -9
  41. package/dist/v1/hooks/use-tambo-current-message.d.ts.map +1 -0
  42. package/dist/{hooks/use-current-message.js → v1/hooks/use-tambo-current-message.js} +13 -8
  43. package/dist/v1/hooks/use-tambo-current-message.js.map +1 -0
  44. package/dist/v1/hooks/use-tambo-v1-auth-state.d.ts +5 -5
  45. package/dist/v1/hooks/use-tambo-v1-auth-state.d.ts.map +1 -1
  46. package/dist/v1/hooks/use-tambo-v1-auth-state.js +8 -8
  47. package/dist/v1/hooks/use-tambo-v1-auth-state.js.map +1 -1
  48. package/dist/v1/hooks/use-tambo-v1-auth-state.test.js +12 -12
  49. package/dist/v1/hooks/use-tambo-v1-auth-state.test.js.map +1 -1
  50. package/dist/v1/hooks/use-tambo-v1-component-state.d.ts +7 -6
  51. package/dist/v1/hooks/use-tambo-v1-component-state.d.ts.map +1 -1
  52. package/dist/v1/hooks/use-tambo-v1-component-state.js +50 -24
  53. package/dist/v1/hooks/use-tambo-v1-component-state.js.map +1 -1
  54. package/dist/v1/hooks/use-tambo-v1-component-state.test.js +60 -35
  55. package/dist/v1/hooks/use-tambo-v1-component-state.test.js.map +1 -1
  56. package/dist/v1/hooks/use-tambo-v1-messages.d.ts +9 -9
  57. package/dist/v1/hooks/use-tambo-v1-messages.d.ts.map +1 -1
  58. package/dist/v1/hooks/use-tambo-v1-messages.js +4 -4
  59. package/dist/v1/hooks/use-tambo-v1-messages.js.map +1 -1
  60. package/dist/v1/hooks/use-tambo-v1-messages.test.js +7 -7
  61. package/dist/v1/hooks/use-tambo-v1-messages.test.js.map +1 -1
  62. package/dist/v1/hooks/use-tambo-v1-send-message.d.ts +3 -3
  63. package/dist/v1/hooks/use-tambo-v1-send-message.d.ts.map +1 -1
  64. package/dist/v1/hooks/use-tambo-v1-send-message.js +20 -22
  65. package/dist/v1/hooks/use-tambo-v1-send-message.js.map +1 -1
  66. package/dist/v1/hooks/use-tambo-v1-send-message.test.js +51 -51
  67. package/dist/v1/hooks/use-tambo-v1-send-message.test.js.map +1 -1
  68. package/dist/v1/hooks/use-tambo-v1-stream-status.d.ts +5 -5
  69. package/dist/v1/hooks/use-tambo-v1-stream-status.d.ts.map +1 -1
  70. package/dist/v1/hooks/use-tambo-v1-stream-status.js +12 -14
  71. package/dist/v1/hooks/use-tambo-v1-stream-status.js.map +1 -1
  72. package/dist/v1/hooks/use-tambo-v1-stream-status.test.js +19 -19
  73. package/dist/v1/hooks/use-tambo-v1-stream-status.test.js.map +1 -1
  74. package/dist/v1/hooks/use-tambo-v1-suggestions.d.ts +7 -7
  75. package/dist/v1/hooks/use-tambo-v1-suggestions.d.ts.map +1 -1
  76. package/dist/v1/hooks/use-tambo-v1-suggestions.js +9 -9
  77. package/dist/v1/hooks/use-tambo-v1-suggestions.js.map +1 -1
  78. package/dist/v1/hooks/use-tambo-v1-suggestions.test.js +44 -44
  79. package/dist/v1/hooks/use-tambo-v1-suggestions.test.js.map +1 -1
  80. package/dist/v1/hooks/use-tambo-v1-thread-input.d.ts +3 -3
  81. package/dist/v1/hooks/use-tambo-v1-thread-input.d.ts.map +1 -1
  82. package/dist/v1/hooks/use-tambo-v1-thread-input.js +4 -4
  83. package/dist/v1/hooks/use-tambo-v1-thread-input.js.map +1 -1
  84. package/dist/v1/hooks/use-tambo-v1-thread-input.test.js +29 -29
  85. package/dist/v1/hooks/use-tambo-v1-thread-input.test.js.map +1 -1
  86. package/dist/v1/hooks/use-tambo-v1-thread-list.d.ts +4 -4
  87. package/dist/v1/hooks/use-tambo-v1-thread-list.d.ts.map +1 -1
  88. package/dist/v1/hooks/use-tambo-v1-thread-list.js +5 -5
  89. package/dist/v1/hooks/use-tambo-v1-thread-list.js.map +1 -1
  90. package/dist/v1/hooks/use-tambo-v1-thread-list.test.js +13 -17
  91. package/dist/v1/hooks/use-tambo-v1-thread-list.test.js.map +1 -1
  92. package/dist/v1/hooks/use-tambo-v1-thread.d.ts +3 -3
  93. package/dist/v1/hooks/use-tambo-v1-thread.d.ts.map +1 -1
  94. package/dist/v1/hooks/use-tambo-v1-thread.js +4 -4
  95. package/dist/v1/hooks/use-tambo-v1-thread.js.map +1 -1
  96. package/dist/v1/hooks/use-tambo-v1-thread.test.js +5 -5
  97. package/dist/v1/hooks/use-tambo-v1-thread.test.js.map +1 -1
  98. package/dist/v1/hooks/use-tambo-v1.d.ts +16 -7
  99. package/dist/v1/hooks/use-tambo-v1.d.ts.map +1 -1
  100. package/dist/v1/hooks/use-tambo-v1.js +41 -10
  101. package/dist/v1/hooks/use-tambo-v1.js.map +1 -1
  102. package/dist/v1/hooks/use-tambo-v1.test.js +176 -48
  103. package/dist/v1/hooks/use-tambo-v1.test.js.map +1 -1
  104. package/dist/v1/index.d.ts +31 -27
  105. package/dist/v1/index.d.ts.map +1 -1
  106. package/dist/v1/index.js +45 -35
  107. package/dist/v1/index.js.map +1 -1
  108. package/dist/v1/providers/tambo-v1-provider.d.ts +20 -20
  109. package/dist/v1/providers/tambo-v1-provider.d.ts.map +1 -1
  110. package/dist/v1/providers/tambo-v1-provider.js +32 -32
  111. package/dist/v1/providers/tambo-v1-provider.js.map +1 -1
  112. package/dist/v1/providers/tambo-v1-provider.test.js +22 -22
  113. package/dist/v1/providers/tambo-v1-provider.test.js.map +1 -1
  114. package/dist/v1/providers/tambo-v1-stream-context.d.ts +15 -15
  115. package/dist/v1/providers/tambo-v1-stream-context.d.ts.map +1 -1
  116. package/dist/v1/providers/tambo-v1-stream-context.js +17 -17
  117. package/dist/v1/providers/tambo-v1-stream-context.js.map +1 -1
  118. package/dist/v1/providers/tambo-v1-stream-context.test.js +9 -9
  119. package/dist/v1/providers/tambo-v1-stream-context.test.js.map +1 -1
  120. package/dist/v1/providers/tambo-v1-stub-provider.d.ts +9 -9
  121. package/dist/v1/providers/tambo-v1-stub-provider.d.ts.map +1 -1
  122. package/dist/v1/providers/tambo-v1-stub-provider.js +7 -7
  123. package/dist/v1/providers/tambo-v1-stub-provider.js.map +1 -1
  124. package/dist/v1/providers/tambo-v1-stub-provider.test.js +25 -25
  125. package/dist/v1/providers/tambo-v1-stub-provider.test.js.map +1 -1
  126. package/dist/v1/providers/tambo-v1-thread-input-provider.d.ts +9 -9
  127. package/dist/v1/providers/tambo-v1-thread-input-provider.d.ts.map +1 -1
  128. package/dist/v1/providers/tambo-v1-thread-input-provider.js +16 -16
  129. package/dist/v1/providers/tambo-v1-thread-input-provider.js.map +1 -1
  130. package/dist/v1/types/auth.d.ts +2 -2
  131. package/dist/v1/types/auth.d.ts.map +1 -1
  132. package/dist/v1/types/auth.js.map +1 -1
  133. package/dist/v1/types/component.d.ts +3 -3
  134. package/dist/v1/types/component.d.ts.map +1 -1
  135. package/dist/v1/types/component.js +2 -2
  136. package/dist/v1/types/component.js.map +1 -1
  137. package/dist/v1/types/event.d.ts +1 -1
  138. package/dist/v1/types/event.js +1 -1
  139. package/dist/v1/types/event.js.map +1 -1
  140. package/dist/v1/types/message.d.ts +17 -24
  141. package/dist/v1/types/message.d.ts.map +1 -1
  142. package/dist/v1/types/message.js +1 -1
  143. package/dist/v1/types/message.js.map +1 -1
  144. package/dist/v1/types/thread.d.ts +10 -8
  145. package/dist/v1/types/thread.d.ts.map +1 -1
  146. package/dist/v1/types/thread.js +1 -1
  147. package/dist/v1/types/thread.js.map +1 -1
  148. package/dist/v1/types/tool-choice.d.ts +1 -1
  149. package/dist/v1/types/tool-choice.js.map +1 -1
  150. package/dist/v1/utils/component-renderer.d.ts +11 -5
  151. package/dist/v1/utils/component-renderer.d.ts.map +1 -1
  152. package/dist/v1/utils/component-renderer.js +16 -7
  153. package/dist/v1/utils/component-renderer.js.map +1 -1
  154. package/dist/v1/utils/component-renderer.test.js +7 -7
  155. package/dist/v1/utils/component-renderer.test.js.map +1 -1
  156. package/dist/v1/utils/event-accumulator.d.ts +13 -13
  157. package/dist/v1/utils/event-accumulator.d.ts.map +1 -1
  158. package/dist/v1/utils/event-accumulator.js +26 -15
  159. package/dist/v1/utils/event-accumulator.js.map +1 -1
  160. package/dist/v1/utils/event-accumulator.test.js +54 -19
  161. package/dist/v1/utils/event-accumulator.test.js.map +1 -1
  162. package/dist/v1/utils/registry-conversion.d.ts +18 -18
  163. package/dist/v1/utils/registry-conversion.js +23 -23
  164. package/dist/v1/utils/registry-conversion.js.map +1 -1
  165. package/dist/v1/utils/stream-handler.d.ts +1 -1
  166. package/dist/v1/utils/stream-handler.js +1 -1
  167. package/dist/v1/utils/stream-handler.js.map +1 -1
  168. package/dist/v1/utils/thread-utils.d.ts +2 -2
  169. package/dist/v1/utils/thread-utils.d.ts.map +1 -1
  170. package/dist/v1/utils/thread-utils.js.map +1 -1
  171. package/dist/v1/utils/tool-call-tracker.d.ts +1 -1
  172. package/dist/v1/utils/tool-call-tracker.js +1 -1
  173. package/dist/v1/utils/tool-call-tracker.js.map +1 -1
  174. package/dist/v1/utils/tool-executor.d.ts +1 -1
  175. package/dist/v1/utils/tool-executor.js +2 -2
  176. package/dist/v1/utils/tool-executor.js.map +1 -1
  177. package/esm/hoc/with-tambo-interactable.d.ts.map +1 -1
  178. package/esm/hoc/with-tambo-interactable.js +13 -13
  179. package/esm/hoc/with-tambo-interactable.js.map +1 -1
  180. package/esm/hoc/with-tambo-interactable.test.js +1 -1
  181. package/esm/hoc/with-tambo-interactable.test.js.map +1 -1
  182. package/esm/index.d.ts +7 -25
  183. package/esm/index.d.ts.map +1 -1
  184. package/esm/index.js +7 -21
  185. package/esm/index.js.map +1 -1
  186. package/esm/mcp/mcp-hooks.js +1 -1
  187. package/esm/mcp/mcp-hooks.js.map +1 -1
  188. package/esm/model/component-metadata.d.ts +4 -4
  189. package/esm/model/component-metadata.js.map +1 -1
  190. package/esm/providers/tambo-client-provider.d.ts +6 -0
  191. package/esm/providers/tambo-client-provider.d.ts.map +1 -1
  192. package/esm/providers/tambo-client-provider.js +4 -2
  193. package/esm/providers/tambo-client-provider.js.map +1 -1
  194. package/esm/providers/tambo-interactable-provider.d.ts +1 -1
  195. package/esm/providers/tambo-interactables-additional-context-edge-cases.test.js +2 -10
  196. package/esm/providers/tambo-interactables-additional-context-edge-cases.test.js.map +1 -1
  197. package/esm/providers/tambo-interactables-additional-context.test.js +3 -19
  198. package/esm/providers/tambo-interactables-additional-context.test.js.map +1 -1
  199. package/esm/providers/tambo-mcp-token-provider.d.ts +8 -17
  200. package/esm/providers/tambo-mcp-token-provider.d.ts.map +1 -1
  201. package/esm/providers/tambo-mcp-token-provider.js +20 -97
  202. package/esm/providers/tambo-mcp-token-provider.js.map +1 -1
  203. package/esm/testing/tools.d.ts +3 -3
  204. package/esm/testing/tools.d.ts.map +1 -1
  205. package/esm/testing/tools.js.map +1 -1
  206. package/esm/util/registry-validators.js +1 -1
  207. package/esm/util/registry-validators.js.map +1 -1
  208. package/esm/v1/__tests__/v1-interactables.test.js +1 -1
  209. package/esm/v1/__tests__/v1-interactables.test.js.map +1 -1
  210. package/esm/v1/components/v1-component-renderer.d.ts +9 -9
  211. package/esm/v1/components/v1-component-renderer.d.ts.map +1 -1
  212. package/esm/v1/components/v1-component-renderer.js +12 -12
  213. package/esm/v1/components/v1-component-renderer.js.map +1 -1
  214. package/esm/v1/components/v1-component-renderer.test.js +16 -16
  215. package/esm/v1/components/v1-component-renderer.test.js.map +1 -1
  216. package/{dist/hooks/use-current-message.d.ts → esm/v1/hooks/use-tambo-current-message.d.ts} +30 -9
  217. package/esm/v1/hooks/use-tambo-current-message.d.ts.map +1 -0
  218. package/esm/{hooks/use-current-message.js → v1/hooks/use-tambo-current-message.js} +13 -8
  219. package/esm/v1/hooks/use-tambo-current-message.js.map +1 -0
  220. package/esm/v1/hooks/use-tambo-v1-auth-state.d.ts +5 -5
  221. package/esm/v1/hooks/use-tambo-v1-auth-state.d.ts.map +1 -1
  222. package/esm/v1/hooks/use-tambo-v1-auth-state.js +8 -8
  223. package/esm/v1/hooks/use-tambo-v1-auth-state.js.map +1 -1
  224. package/esm/v1/hooks/use-tambo-v1-auth-state.test.js +14 -14
  225. package/esm/v1/hooks/use-tambo-v1-auth-state.test.js.map +1 -1
  226. package/esm/v1/hooks/use-tambo-v1-component-state.d.ts +7 -6
  227. package/esm/v1/hooks/use-tambo-v1-component-state.d.ts.map +1 -1
  228. package/esm/v1/hooks/use-tambo-v1-component-state.js +50 -24
  229. package/esm/v1/hooks/use-tambo-v1-component-state.js.map +1 -1
  230. package/esm/v1/hooks/use-tambo-v1-component-state.test.js +62 -37
  231. package/esm/v1/hooks/use-tambo-v1-component-state.test.js.map +1 -1
  232. package/esm/v1/hooks/use-tambo-v1-messages.d.ts +9 -9
  233. package/esm/v1/hooks/use-tambo-v1-messages.d.ts.map +1 -1
  234. package/esm/v1/hooks/use-tambo-v1-messages.js +3 -3
  235. package/esm/v1/hooks/use-tambo-v1-messages.js.map +1 -1
  236. package/esm/v1/hooks/use-tambo-v1-messages.test.js +9 -9
  237. package/esm/v1/hooks/use-tambo-v1-messages.test.js.map +1 -1
  238. package/esm/v1/hooks/use-tambo-v1-send-message.d.ts +3 -3
  239. package/esm/v1/hooks/use-tambo-v1-send-message.d.ts.map +1 -1
  240. package/esm/v1/hooks/use-tambo-v1-send-message.js +21 -23
  241. package/esm/v1/hooks/use-tambo-v1-send-message.js.map +1 -1
  242. package/esm/v1/hooks/use-tambo-v1-send-message.test.js +54 -54
  243. package/esm/v1/hooks/use-tambo-v1-send-message.test.js.map +1 -1
  244. package/esm/v1/hooks/use-tambo-v1-stream-status.d.ts +5 -5
  245. package/esm/v1/hooks/use-tambo-v1-stream-status.d.ts.map +1 -1
  246. package/esm/v1/hooks/use-tambo-v1-stream-status.js +12 -14
  247. package/esm/v1/hooks/use-tambo-v1-stream-status.js.map +1 -1
  248. package/esm/v1/hooks/use-tambo-v1-stream-status.test.js +21 -21
  249. package/esm/v1/hooks/use-tambo-v1-stream-status.test.js.map +1 -1
  250. package/esm/v1/hooks/use-tambo-v1-suggestions.d.ts +7 -7
  251. package/esm/v1/hooks/use-tambo-v1-suggestions.d.ts.map +1 -1
  252. package/esm/v1/hooks/use-tambo-v1-suggestions.js +11 -11
  253. package/esm/v1/hooks/use-tambo-v1-suggestions.js.map +1 -1
  254. package/esm/v1/hooks/use-tambo-v1-suggestions.test.js +48 -48
  255. package/esm/v1/hooks/use-tambo-v1-suggestions.test.js.map +1 -1
  256. package/esm/v1/hooks/use-tambo-v1-thread-input.d.ts +3 -3
  257. package/esm/v1/hooks/use-tambo-v1-thread-input.d.ts.map +1 -1
  258. package/esm/v1/hooks/use-tambo-v1-thread-input.js +3 -3
  259. package/esm/v1/hooks/use-tambo-v1-thread-input.js.map +1 -1
  260. package/esm/v1/hooks/use-tambo-v1-thread-input.test.js +32 -32
  261. package/esm/v1/hooks/use-tambo-v1-thread-input.test.js.map +1 -1
  262. package/esm/v1/hooks/use-tambo-v1-thread-list.d.ts +4 -4
  263. package/esm/v1/hooks/use-tambo-v1-thread-list.d.ts.map +1 -1
  264. package/esm/v1/hooks/use-tambo-v1-thread-list.js +6 -6
  265. package/esm/v1/hooks/use-tambo-v1-thread-list.js.map +1 -1
  266. package/esm/v1/hooks/use-tambo-v1-thread-list.test.js +15 -19
  267. package/esm/v1/hooks/use-tambo-v1-thread-list.test.js.map +1 -1
  268. package/esm/v1/hooks/use-tambo-v1-thread.d.ts +3 -3
  269. package/esm/v1/hooks/use-tambo-v1-thread.d.ts.map +1 -1
  270. package/esm/v1/hooks/use-tambo-v1-thread.js +4 -4
  271. package/esm/v1/hooks/use-tambo-v1-thread.js.map +1 -1
  272. package/esm/v1/hooks/use-tambo-v1-thread.test.js +6 -6
  273. package/esm/v1/hooks/use-tambo-v1-thread.test.js.map +1 -1
  274. package/esm/v1/hooks/use-tambo-v1.d.ts +16 -7
  275. package/esm/v1/hooks/use-tambo-v1.d.ts.map +1 -1
  276. package/esm/v1/hooks/use-tambo-v1.js +43 -12
  277. package/esm/v1/hooks/use-tambo-v1.js.map +1 -1
  278. package/esm/v1/hooks/use-tambo-v1.test.js +178 -50
  279. package/esm/v1/hooks/use-tambo-v1.test.js.map +1 -1
  280. package/esm/v1/index.d.ts +31 -27
  281. package/esm/v1/index.d.ts.map +1 -1
  282. package/esm/v1/index.js +38 -33
  283. package/esm/v1/index.js.map +1 -1
  284. package/esm/v1/providers/tambo-v1-provider.d.ts +20 -20
  285. package/esm/v1/providers/tambo-v1-provider.d.ts.map +1 -1
  286. package/esm/v1/providers/tambo-v1-provider.js +32 -32
  287. package/esm/v1/providers/tambo-v1-provider.js.map +1 -1
  288. package/esm/v1/providers/tambo-v1-provider.test.js +23 -23
  289. package/esm/v1/providers/tambo-v1-provider.test.js.map +1 -1
  290. package/esm/v1/providers/tambo-v1-stream-context.d.ts +15 -15
  291. package/esm/v1/providers/tambo-v1-stream-context.d.ts.map +1 -1
  292. package/esm/v1/providers/tambo-v1-stream-context.js +17 -17
  293. package/esm/v1/providers/tambo-v1-stream-context.js.map +1 -1
  294. package/esm/v1/providers/tambo-v1-stream-context.test.js +10 -10
  295. package/esm/v1/providers/tambo-v1-stream-context.test.js.map +1 -1
  296. package/esm/v1/providers/tambo-v1-stub-provider.d.ts +9 -9
  297. package/esm/v1/providers/tambo-v1-stub-provider.d.ts.map +1 -1
  298. package/esm/v1/providers/tambo-v1-stub-provider.js +9 -9
  299. package/esm/v1/providers/tambo-v1-stub-provider.js.map +1 -1
  300. package/esm/v1/providers/tambo-v1-stub-provider.test.js +28 -28
  301. package/esm/v1/providers/tambo-v1-stub-provider.test.js.map +1 -1
  302. package/esm/v1/providers/tambo-v1-thread-input-provider.d.ts +9 -9
  303. package/esm/v1/providers/tambo-v1-thread-input-provider.d.ts.map +1 -1
  304. package/esm/v1/providers/tambo-v1-thread-input-provider.js +15 -15
  305. package/esm/v1/providers/tambo-v1-thread-input-provider.js.map +1 -1
  306. package/esm/v1/types/auth.d.ts +2 -2
  307. package/esm/v1/types/auth.d.ts.map +1 -1
  308. package/esm/v1/types/auth.js.map +1 -1
  309. package/esm/v1/types/component.d.ts +3 -3
  310. package/esm/v1/types/component.d.ts.map +1 -1
  311. package/esm/v1/types/component.js +2 -2
  312. package/esm/v1/types/component.js.map +1 -1
  313. package/esm/v1/types/event.d.ts +1 -1
  314. package/esm/v1/types/event.js +1 -1
  315. package/esm/v1/types/event.js.map +1 -1
  316. package/esm/v1/types/message.d.ts +17 -24
  317. package/esm/v1/types/message.d.ts.map +1 -1
  318. package/esm/v1/types/message.js +1 -1
  319. package/esm/v1/types/message.js.map +1 -1
  320. package/esm/v1/types/thread.d.ts +10 -8
  321. package/esm/v1/types/thread.d.ts.map +1 -1
  322. package/esm/v1/types/thread.js +1 -1
  323. package/esm/v1/types/thread.js.map +1 -1
  324. package/esm/v1/types/tool-choice.d.ts +1 -1
  325. package/esm/v1/types/tool-choice.js.map +1 -1
  326. package/esm/v1/utils/component-renderer.d.ts +11 -5
  327. package/esm/v1/utils/component-renderer.d.ts.map +1 -1
  328. package/esm/v1/utils/component-renderer.js +13 -5
  329. package/esm/v1/utils/component-renderer.js.map +1 -1
  330. package/esm/v1/utils/component-renderer.test.js +8 -8
  331. package/esm/v1/utils/component-renderer.test.js.map +1 -1
  332. package/esm/v1/utils/event-accumulator.d.ts +13 -13
  333. package/esm/v1/utils/event-accumulator.d.ts.map +1 -1
  334. package/esm/v1/utils/event-accumulator.js +26 -15
  335. package/esm/v1/utils/event-accumulator.js.map +1 -1
  336. package/esm/v1/utils/event-accumulator.test.js +54 -19
  337. package/esm/v1/utils/event-accumulator.test.js.map +1 -1
  338. package/esm/v1/utils/registry-conversion.d.ts +18 -18
  339. package/esm/v1/utils/registry-conversion.js +23 -23
  340. package/esm/v1/utils/registry-conversion.js.map +1 -1
  341. package/esm/v1/utils/stream-handler.d.ts +1 -1
  342. package/esm/v1/utils/stream-handler.js +1 -1
  343. package/esm/v1/utils/stream-handler.js.map +1 -1
  344. package/esm/v1/utils/thread-utils.d.ts +2 -2
  345. package/esm/v1/utils/thread-utils.d.ts.map +1 -1
  346. package/esm/v1/utils/thread-utils.js.map +1 -1
  347. package/esm/v1/utils/tool-call-tracker.d.ts +1 -1
  348. package/esm/v1/utils/tool-call-tracker.js +1 -1
  349. package/esm/v1/utils/tool-call-tracker.js.map +1 -1
  350. package/esm/v1/utils/tool-executor.d.ts +1 -1
  351. package/esm/v1/utils/tool-executor.js +2 -2
  352. package/esm/v1/utils/tool-executor.js.map +1 -1
  353. package/package.json +4 -9
  354. package/dist/hooks/index.d.ts +0 -9
  355. package/dist/hooks/index.d.ts.map +0 -1
  356. package/dist/hooks/index.js +0 -34
  357. package/dist/hooks/index.js.map +0 -1
  358. package/dist/hooks/use-component-state.d.ts +0 -30
  359. package/dist/hooks/use-component-state.d.ts.map +0 -1
  360. package/dist/hooks/use-component-state.js +0 -139
  361. package/dist/hooks/use-component-state.js.map +0 -1
  362. package/dist/hooks/use-component-state.test.d.ts +0 -2
  363. package/dist/hooks/use-component-state.test.d.ts.map +0 -1
  364. package/dist/hooks/use-component-state.test.js +0 -406
  365. package/dist/hooks/use-component-state.test.js.map +0 -1
  366. package/dist/hooks/use-current-message.d.ts.map +0 -1
  367. package/dist/hooks/use-current-message.js.map +0 -1
  368. package/dist/hooks/use-current-message.test.d.ts +0 -2
  369. package/dist/hooks/use-current-message.test.d.ts.map +0 -1
  370. package/dist/hooks/use-current-message.test.js +0 -269
  371. package/dist/hooks/use-current-message.test.js.map +0 -1
  372. package/dist/hooks/use-streaming-props.d.ts +0 -11
  373. package/dist/hooks/use-streaming-props.d.ts.map +0 -1
  374. package/dist/hooks/use-streaming-props.js +0 -37
  375. package/dist/hooks/use-streaming-props.js.map +0 -1
  376. package/dist/hooks/use-suggestions.d.ts +0 -46
  377. package/dist/hooks/use-suggestions.d.ts.map +0 -1
  378. package/dist/hooks/use-suggestions.js +0 -118
  379. package/dist/hooks/use-suggestions.js.map +0 -1
  380. package/dist/hooks/use-suggestions.test.d.ts +0 -2
  381. package/dist/hooks/use-suggestions.test.d.ts.map +0 -1
  382. package/dist/hooks/use-suggestions.test.js +0 -247
  383. package/dist/hooks/use-suggestions.test.js.map +0 -1
  384. package/dist/hooks/use-tambo-stream-status.d.ts +0 -90
  385. package/dist/hooks/use-tambo-stream-status.d.ts.map +0 -1
  386. package/dist/hooks/use-tambo-stream-status.js +0 -213
  387. package/dist/hooks/use-tambo-stream-status.js.map +0 -1
  388. package/dist/hooks/use-tambo-stream-status.test.d.ts +0 -2
  389. package/dist/hooks/use-tambo-stream-status.test.d.ts.map +0 -1
  390. package/dist/hooks/use-tambo-stream-status.test.js +0 -378
  391. package/dist/hooks/use-tambo-stream-status.test.js.map +0 -1
  392. package/dist/hooks/use-tambo-threads.d.ts +0 -158
  393. package/dist/hooks/use-tambo-threads.d.ts.map +0 -1
  394. package/dist/hooks/use-tambo-threads.js +0 -45
  395. package/dist/hooks/use-tambo-threads.js.map +0 -1
  396. package/dist/hooks/use-tambo-threads.test.d.ts +0 -2
  397. package/dist/hooks/use-tambo-threads.test.d.ts.map +0 -1
  398. package/dist/hooks/use-tambo-threads.test.js +0 -214
  399. package/dist/hooks/use-tambo-threads.test.js.map +0 -1
  400. package/dist/model/generate-component-response.d.ts +0 -37
  401. package/dist/model/generate-component-response.d.ts.map +0 -1
  402. package/dist/model/generate-component-response.js +0 -29
  403. package/dist/model/generate-component-response.js.map +0 -1
  404. package/dist/model/tambo-thread.d.ts +0 -15
  405. package/dist/model/tambo-thread.d.ts.map +0 -1
  406. package/dist/model/tambo-thread.js +0 -3
  407. package/dist/model/tambo-thread.js.map +0 -1
  408. package/dist/providers/__tests__/thread-input-resource-resolution.test.d.ts +0 -2
  409. package/dist/providers/__tests__/thread-input-resource-resolution.test.d.ts.map +0 -1
  410. package/dist/providers/__tests__/thread-input-resource-resolution.test.js +0 -592
  411. package/dist/providers/__tests__/thread-input-resource-resolution.test.js.map +0 -1
  412. package/dist/providers/index.d.ts +0 -13
  413. package/dist/providers/index.d.ts.map +0 -1
  414. package/dist/providers/index.js +0 -41
  415. package/dist/providers/index.js.map +0 -1
  416. package/dist/providers/tambo-component-provider.d.ts +0 -23
  417. package/dist/providers/tambo-component-provider.d.ts.map +0 -1
  418. package/dist/providers/tambo-component-provider.js +0 -88
  419. package/dist/providers/tambo-component-provider.js.map +0 -1
  420. package/dist/providers/tambo-prop-stream-provider/index.d.ts +0 -19
  421. package/dist/providers/tambo-prop-stream-provider/index.d.ts.map +0 -1
  422. package/dist/providers/tambo-prop-stream-provider/index.js +0 -43
  423. package/dist/providers/tambo-prop-stream-provider/index.js.map +0 -1
  424. package/dist/providers/tambo-prop-stream-provider/pending.d.ts +0 -12
  425. package/dist/providers/tambo-prop-stream-provider/pending.d.ts.map +0 -1
  426. package/dist/providers/tambo-prop-stream-provider/pending.js +0 -31
  427. package/dist/providers/tambo-prop-stream-provider/pending.js.map +0 -1
  428. package/dist/providers/tambo-prop-stream-provider/provider.d.ts +0 -17
  429. package/dist/providers/tambo-prop-stream-provider/provider.d.ts.map +0 -1
  430. package/dist/providers/tambo-prop-stream-provider/provider.js +0 -107
  431. package/dist/providers/tambo-prop-stream-provider/provider.js.map +0 -1
  432. package/dist/providers/tambo-prop-stream-provider/streaming.d.ts +0 -12
  433. package/dist/providers/tambo-prop-stream-provider/streaming.d.ts.map +0 -1
  434. package/dist/providers/tambo-prop-stream-provider/streaming.js +0 -28
  435. package/dist/providers/tambo-prop-stream-provider/streaming.js.map +0 -1
  436. package/dist/providers/tambo-prop-stream-provider/success.d.ts +0 -12
  437. package/dist/providers/tambo-prop-stream-provider/success.d.ts.map +0 -1
  438. package/dist/providers/tambo-prop-stream-provider/success.js +0 -28
  439. package/dist/providers/tambo-prop-stream-provider/success.js.map +0 -1
  440. package/dist/providers/tambo-prop-stream-provider/types.d.ts +0 -25
  441. package/dist/providers/tambo-prop-stream-provider/types.d.ts.map +0 -1
  442. package/dist/providers/tambo-prop-stream-provider/types.js +0 -6
  443. package/dist/providers/tambo-prop-stream-provider/types.js.map +0 -1
  444. package/dist/providers/tambo-prop-stream-provider.test.d.ts +0 -2
  445. package/dist/providers/tambo-prop-stream-provider.test.d.ts.map +0 -1
  446. package/dist/providers/tambo-prop-stream-provider.test.js +0 -275
  447. package/dist/providers/tambo-prop-stream-provider.test.js.map +0 -1
  448. package/dist/providers/tambo-provider.d.ts +0 -53
  449. package/dist/providers/tambo-provider.d.ts.map +0 -1
  450. package/dist/providers/tambo-provider.js +0 -133
  451. package/dist/providers/tambo-provider.js.map +0 -1
  452. package/dist/providers/tambo-stubs.d.ts +0 -89
  453. package/dist/providers/tambo-stubs.d.ts.map +0 -1
  454. package/dist/providers/tambo-stubs.js +0 -279
  455. package/dist/providers/tambo-stubs.js.map +0 -1
  456. package/dist/providers/tambo-stubs.test.d.ts +0 -2
  457. package/dist/providers/tambo-stubs.test.d.ts.map +0 -1
  458. package/dist/providers/tambo-stubs.test.js +0 -97
  459. package/dist/providers/tambo-stubs.test.js.map +0 -1
  460. package/dist/providers/tambo-thread-input-provider.d.ts +0 -65
  461. package/dist/providers/tambo-thread-input-provider.d.ts.map +0 -1
  462. package/dist/providers/tambo-thread-input-provider.js +0 -179
  463. package/dist/providers/tambo-thread-input-provider.js.map +0 -1
  464. package/dist/providers/tambo-thread-provider-initial-messages.test.d.ts +0 -2
  465. package/dist/providers/tambo-thread-provider-initial-messages.test.d.ts.map +0 -1
  466. package/dist/providers/tambo-thread-provider-initial-messages.test.js +0 -278
  467. package/dist/providers/tambo-thread-provider-initial-messages.test.js.map +0 -1
  468. package/dist/providers/tambo-thread-provider.d.ts +0 -126
  469. package/dist/providers/tambo-thread-provider.d.ts.map +0 -1
  470. package/dist/providers/tambo-thread-provider.js +0 -931
  471. package/dist/providers/tambo-thread-provider.js.map +0 -1
  472. package/dist/providers/tambo-thread-provider.test.d.ts +0 -2
  473. package/dist/providers/tambo-thread-provider.test.d.ts.map +0 -1
  474. package/dist/providers/tambo-thread-provider.test.js +0 -1591
  475. package/dist/providers/tambo-thread-provider.test.js.map +0 -1
  476. package/dist/util/generate-component.d.ts +0 -12
  477. package/dist/util/generate-component.d.ts.map +0 -1
  478. package/dist/util/generate-component.js +0 -58
  479. package/dist/util/generate-component.js.map +0 -1
  480. package/dist/util/generate-component.test.d.ts +0 -2
  481. package/dist/util/generate-component.test.d.ts.map +0 -1
  482. package/dist/util/generate-component.test.js +0 -340
  483. package/dist/util/generate-component.test.js.map +0 -1
  484. package/esm/hooks/index.d.ts +0 -9
  485. package/esm/hooks/index.d.ts.map +0 -1
  486. package/esm/hooks/index.js +0 -10
  487. package/esm/hooks/index.js.map +0 -1
  488. package/esm/hooks/use-component-state.d.ts +0 -30
  489. package/esm/hooks/use-component-state.d.ts.map +0 -1
  490. package/esm/hooks/use-component-state.js +0 -136
  491. package/esm/hooks/use-component-state.js.map +0 -1
  492. package/esm/hooks/use-component-state.test.d.ts +0 -2
  493. package/esm/hooks/use-component-state.test.d.ts.map +0 -1
  494. package/esm/hooks/use-component-state.test.js +0 -401
  495. package/esm/hooks/use-component-state.test.js.map +0 -1
  496. package/esm/hooks/use-current-message.d.ts.map +0 -1
  497. package/esm/hooks/use-current-message.js.map +0 -1
  498. package/esm/hooks/use-current-message.test.d.ts +0 -2
  499. package/esm/hooks/use-current-message.test.d.ts.map +0 -1
  500. package/esm/hooks/use-current-message.test.js +0 -264
  501. package/esm/hooks/use-current-message.test.js.map +0 -1
  502. package/esm/hooks/use-streaming-props.d.ts +0 -11
  503. package/esm/hooks/use-streaming-props.d.ts.map +0 -1
  504. package/esm/hooks/use-streaming-props.js +0 -34
  505. package/esm/hooks/use-streaming-props.js.map +0 -1
  506. package/esm/hooks/use-suggestions.d.ts +0 -46
  507. package/esm/hooks/use-suggestions.d.ts.map +0 -1
  508. package/esm/hooks/use-suggestions.js +0 -115
  509. package/esm/hooks/use-suggestions.js.map +0 -1
  510. package/esm/hooks/use-suggestions.test.d.ts +0 -2
  511. package/esm/hooks/use-suggestions.test.d.ts.map +0 -1
  512. package/esm/hooks/use-suggestions.test.js +0 -245
  513. package/esm/hooks/use-suggestions.test.js.map +0 -1
  514. package/esm/hooks/use-tambo-stream-status.d.ts +0 -90
  515. package/esm/hooks/use-tambo-stream-status.d.ts.map +0 -1
  516. package/esm/hooks/use-tambo-stream-status.js +0 -210
  517. package/esm/hooks/use-tambo-stream-status.js.map +0 -1
  518. package/esm/hooks/use-tambo-stream-status.test.d.ts +0 -2
  519. package/esm/hooks/use-tambo-stream-status.test.d.ts.map +0 -1
  520. package/esm/hooks/use-tambo-stream-status.test.js +0 -376
  521. package/esm/hooks/use-tambo-stream-status.test.js.map +0 -1
  522. package/esm/hooks/use-tambo-threads.d.ts +0 -158
  523. package/esm/hooks/use-tambo-threads.d.ts.map +0 -1
  524. package/esm/hooks/use-tambo-threads.js +0 -42
  525. package/esm/hooks/use-tambo-threads.js.map +0 -1
  526. package/esm/hooks/use-tambo-threads.test.d.ts +0 -2
  527. package/esm/hooks/use-tambo-threads.test.d.ts.map +0 -1
  528. package/esm/hooks/use-tambo-threads.test.js +0 -212
  529. package/esm/hooks/use-tambo-threads.test.js.map +0 -1
  530. package/esm/model/generate-component-response.d.ts +0 -37
  531. package/esm/model/generate-component-response.d.ts.map +0 -1
  532. package/esm/model/generate-component-response.js +0 -25
  533. package/esm/model/generate-component-response.js.map +0 -1
  534. package/esm/model/tambo-thread.d.ts +0 -15
  535. package/esm/model/tambo-thread.d.ts.map +0 -1
  536. package/esm/model/tambo-thread.js +0 -2
  537. package/esm/model/tambo-thread.js.map +0 -1
  538. package/esm/providers/__tests__/thread-input-resource-resolution.test.d.ts +0 -2
  539. package/esm/providers/__tests__/thread-input-resource-resolution.test.d.ts.map +0 -1
  540. package/esm/providers/__tests__/thread-input-resource-resolution.test.js +0 -587
  541. package/esm/providers/__tests__/thread-input-resource-resolution.test.js.map +0 -1
  542. package/esm/providers/index.d.ts +0 -13
  543. package/esm/providers/index.d.ts.map +0 -1
  544. package/esm/providers/index.js +0 -11
  545. package/esm/providers/index.js.map +0 -1
  546. package/esm/providers/tambo-component-provider.d.ts +0 -23
  547. package/esm/providers/tambo-component-provider.d.ts.map +0 -1
  548. package/esm/providers/tambo-component-provider.js +0 -50
  549. package/esm/providers/tambo-component-provider.js.map +0 -1
  550. package/esm/providers/tambo-prop-stream-provider/index.d.ts +0 -19
  551. package/esm/providers/tambo-prop-stream-provider/index.d.ts.map +0 -1
  552. package/esm/providers/tambo-prop-stream-provider/index.js +0 -22
  553. package/esm/providers/tambo-prop-stream-provider/index.js.map +0 -1
  554. package/esm/providers/tambo-prop-stream-provider/pending.d.ts +0 -12
  555. package/esm/providers/tambo-prop-stream-provider/pending.d.ts.map +0 -1
  556. package/esm/providers/tambo-prop-stream-provider/pending.js +0 -24
  557. package/esm/providers/tambo-prop-stream-provider/pending.js.map +0 -1
  558. package/esm/providers/tambo-prop-stream-provider/provider.d.ts +0 -17
  559. package/esm/providers/tambo-prop-stream-provider/provider.d.ts.map +0 -1
  560. package/esm/providers/tambo-prop-stream-provider/provider.js +0 -70
  561. package/esm/providers/tambo-prop-stream-provider/provider.js.map +0 -1
  562. package/esm/providers/tambo-prop-stream-provider/streaming.d.ts +0 -12
  563. package/esm/providers/tambo-prop-stream-provider/streaming.d.ts.map +0 -1
  564. package/esm/providers/tambo-prop-stream-provider/streaming.js +0 -21
  565. package/esm/providers/tambo-prop-stream-provider/streaming.js.map +0 -1
  566. package/esm/providers/tambo-prop-stream-provider/success.d.ts +0 -12
  567. package/esm/providers/tambo-prop-stream-provider/success.d.ts.map +0 -1
  568. package/esm/providers/tambo-prop-stream-provider/success.js +0 -21
  569. package/esm/providers/tambo-prop-stream-provider/success.js.map +0 -1
  570. package/esm/providers/tambo-prop-stream-provider/types.d.ts +0 -25
  571. package/esm/providers/tambo-prop-stream-provider/types.d.ts.map +0 -1
  572. package/esm/providers/tambo-prop-stream-provider/types.js +0 -3
  573. package/esm/providers/tambo-prop-stream-provider/types.js.map +0 -1
  574. package/esm/providers/tambo-prop-stream-provider.test.d.ts +0 -2
  575. package/esm/providers/tambo-prop-stream-provider.test.d.ts.map +0 -1
  576. package/esm/providers/tambo-prop-stream-provider.test.js +0 -270
  577. package/esm/providers/tambo-prop-stream-provider.test.js.map +0 -1
  578. package/esm/providers/tambo-provider.d.ts +0 -53
  579. package/esm/providers/tambo-provider.d.ts.map +0 -1
  580. package/esm/providers/tambo-provider.js +0 -94
  581. package/esm/providers/tambo-provider.js.map +0 -1
  582. package/esm/providers/tambo-stubs.d.ts +0 -89
  583. package/esm/providers/tambo-stubs.d.ts.map +0 -1
  584. package/esm/providers/tambo-stubs.js +0 -242
  585. package/esm/providers/tambo-stubs.js.map +0 -1
  586. package/esm/providers/tambo-stubs.test.d.ts +0 -2
  587. package/esm/providers/tambo-stubs.test.d.ts.map +0 -1
  588. package/esm/providers/tambo-stubs.test.js +0 -62
  589. package/esm/providers/tambo-stubs.test.js.map +0 -1
  590. package/esm/providers/tambo-thread-input-provider.d.ts +0 -65
  591. package/esm/providers/tambo-thread-input-provider.d.ts.map +0 -1
  592. package/esm/providers/tambo-thread-input-provider.js +0 -141
  593. package/esm/providers/tambo-thread-input-provider.js.map +0 -1
  594. package/esm/providers/tambo-thread-provider-initial-messages.test.d.ts +0 -2
  595. package/esm/providers/tambo-thread-provider-initial-messages.test.d.ts.map +0 -1
  596. package/esm/providers/tambo-thread-provider-initial-messages.test.js +0 -273
  597. package/esm/providers/tambo-thread-provider-initial-messages.test.js.map +0 -1
  598. package/esm/providers/tambo-thread-provider.d.ts +0 -126
  599. package/esm/providers/tambo-thread-provider.d.ts.map +0 -1
  600. package/esm/providers/tambo-thread-provider.js +0 -891
  601. package/esm/providers/tambo-thread-provider.js.map +0 -1
  602. package/esm/providers/tambo-thread-provider.test.d.ts +0 -2
  603. package/esm/providers/tambo-thread-provider.test.d.ts.map +0 -1
  604. package/esm/providers/tambo-thread-provider.test.js +0 -1553
  605. package/esm/providers/tambo-thread-provider.test.js.map +0 -1
  606. package/esm/util/generate-component.d.ts +0 -12
  607. package/esm/util/generate-component.d.ts.map +0 -1
  608. package/esm/util/generate-component.js +0 -52
  609. package/esm/util/generate-component.js.map +0 -1
  610. package/esm/util/generate-component.test.d.ts +0 -2
  611. package/esm/util/generate-component.test.d.ts.map +0 -1
  612. package/esm/util/generate-component.test.js +0 -302
  613. package/esm/util/generate-component.test.js.map +0 -1
@@ -1,10 +1,10 @@
1
1
  /**
2
- * TamboV1ThreadInputProvider - Shared Thread Input Context for v1 API
2
+ * TamboThreadInputProvider - Shared Thread Input Context
3
3
  *
4
4
  * Provides shared input state across all components, enabling features like
5
5
  * suggestions to update the input field directly.
6
6
  *
7
- * This mirrors the beta SDK's TamboThreadInputProvider pattern.
7
+ * This mirrors the TamboThreadInputProvider pattern from the legacy beta SDK.
8
8
  */
9
9
  import React, { type PropsWithChildren } from "react";
10
10
  import { type StagedImage } from "../../hooks/use-message-images";
@@ -34,7 +34,7 @@ export interface SubmitOptions {
34
34
  /**
35
35
  * Context props for thread input state
36
36
  */
37
- export interface TamboV1ThreadInputContextProps extends Omit<UseTamboMutationResult<{
37
+ export interface TamboThreadInputContextProps extends Omit<UseTamboMutationResult<{
38
38
  threadId: string | undefined;
39
39
  }, Error, SubmitOptions | undefined>, "mutate" | "mutateAsync"> {
40
40
  /** Current value of the input field */
@@ -71,28 +71,28 @@ export interface TamboV1ThreadInputContextProps extends Omit<UseTamboMutationRes
71
71
  * Context for thread input state.
72
72
  * @internal
73
73
  */
74
- export declare const TamboV1ThreadInputContext: React.Context<TamboV1ThreadInputContextProps | undefined>;
74
+ export declare const TamboThreadInputContext: React.Context<TamboThreadInputContextProps | undefined>;
75
75
  /**
76
76
  * Provider that manages shared thread input state across all components.
77
77
  *
78
- * This ensures that useTamboV1ThreadInput, useTamboV1Suggestions, and other components
78
+ * This ensures that useTamboThreadInput, useTamboSuggestions, and other components
79
79
  * all share the same input state.
80
80
  * @param props - Provider props
81
81
  * @param props.children - Child components
82
82
  * @returns Thread input context provider
83
83
  */
84
- export declare function TamboV1ThreadInputProvider({ children }: PropsWithChildren): React.JSX.Element;
84
+ export declare function TamboThreadInputProvider({ children }: PropsWithChildren): React.JSX.Element;
85
85
  /**
86
86
  * Hook to access the shared thread input state.
87
87
  *
88
88
  * All components using this hook share the same input state, enabling
89
89
  * features like suggestions to update the input field directly.
90
90
  * @returns The shared thread input context
91
- * @throws {Error} If used outside TamboV1ThreadInputProvider
91
+ * @throws {Error} If used outside TamboThreadInputProvider
92
92
  * @example
93
93
  * ```tsx
94
94
  * function ChatInput() {
95
- * const { value, setValue, submit, isPending } = useTamboV1ThreadInput();
95
+ * const { value, setValue, submit, isPending } = useTamboThreadInput();
96
96
  *
97
97
  * return (
98
98
  * <form onSubmit={(e) => { e.preventDefault(); submit(); }}>
@@ -107,5 +107,5 @@ export declare function TamboV1ThreadInputProvider({ children }: PropsWithChildr
107
107
  * }
108
108
  * ```
109
109
  */
110
- export declare function useTamboV1ThreadInput(): TamboV1ThreadInputContextProps;
110
+ export declare function useTamboThreadInput(): TamboThreadInputContextProps;
111
111
  //# sourceMappingURL=tambo-v1-thread-input-provider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tambo-v1-thread-input-provider.d.ts","sourceRoot":"","sources":["../../../src/v1/providers/tambo-v1-thread-input-provider.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,EAKZ,KAAK,iBAAiB,EACvB,MAAM,OAAO,CAAC;AACf,OAAO,EAEL,KAAK,WAAW,EACjB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,+BAA+B,CAAC;AAGvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AASvD,eAAO,MAAM,oBA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,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,qBAgGzE;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,qBAAqB,IAAI,8BAA8B,CAQtE"}
1
+ {"version":3,"file":"tambo-v1-thread-input-provider.d.ts","sourceRoot":"","sources":["../../../src/v1/providers/tambo-v1-thread-input-provider.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,EAKZ,KAAK,iBAAiB,EACvB,MAAM,OAAO,CAAC;AACf,OAAO,EAEL,KAAK,WAAW,EACjB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,+BAA+B,CAAC;AAGvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AASvD,eAAO,MAAM,oBAAoB;;;CAGvB,CAAC;AAkCX;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,4BAA6B,SAAQ,IAAI,CACxD,sBAAsB,CACpB;IAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,EAChC,KAAK,EACL,aAAa,GAAG,SAAS,CAC1B,EACD,QAAQ,GAAG,aAAa,CACzB;IACC,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAEvD;;;;OAIG;IACH,MAAM,EAAE,CACN,OAAO,CAAC,EAAE,aAAa,KACpB,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC,CAAC;IAE/C,8BAA8B;IAC9B,MAAM,EAAE,WAAW,EAAE,CAAC;IAEtB,yBAAyB;IACzB,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAExC,0BAA0B;IAC1B,SAAS,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5C,4BAA4B;IAC5B,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAElC,8BAA8B;IAC9B,WAAW,EAAE,MAAM,IAAI,CAAC;IAExB,iEAAiE;IACjE,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAE7B,qFAAqF;IACrF,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,yDAExB,CAAC;AAEb;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,qBAgGvE;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,mBAAmB,IAAI,4BAA4B,CAQlE"}
@@ -34,16 +34,16 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  };
35
35
  })();
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.TamboV1ThreadInputContext = exports.INPUT_ERROR_MESSAGES = void 0;
38
- exports.TamboV1ThreadInputProvider = TamboV1ThreadInputProvider;
39
- exports.useTamboV1ThreadInput = useTamboV1ThreadInput;
37
+ exports.TamboThreadInputContext = exports.INPUT_ERROR_MESSAGES = void 0;
38
+ exports.TamboThreadInputProvider = TamboThreadInputProvider;
39
+ exports.useTamboThreadInput = useTamboThreadInput;
40
40
  /**
41
- * TamboV1ThreadInputProvider - Shared Thread Input Context for v1 API
41
+ * TamboThreadInputProvider - Shared Thread Input Context
42
42
  *
43
43
  * Provides shared input state across all components, enabling features like
44
44
  * suggestions to update the input field directly.
45
45
  *
46
- * This mirrors the beta SDK's TamboThreadInputProvider pattern.
46
+ * This mirrors the TamboThreadInputProvider pattern from the legacy beta SDK.
47
47
  */
48
48
  const react_1 = __importStar(require("react"));
49
49
  const use_message_images_1 = require("../../hooks/use-message-images");
@@ -89,27 +89,27 @@ function stagedImageToResourceContent(image) {
89
89
  * Context for thread input state.
90
90
  * @internal
91
91
  */
92
- exports.TamboV1ThreadInputContext = (0, react_1.createContext)(undefined);
92
+ exports.TamboThreadInputContext = (0, react_1.createContext)(undefined);
93
93
  /**
94
94
  * Provider that manages shared thread input state across all components.
95
95
  *
96
- * This ensures that useTamboV1ThreadInput, useTamboV1Suggestions, and other components
96
+ * This ensures that useTamboThreadInput, useTamboSuggestions, and other components
97
97
  * all share the same input state.
98
98
  * @param props - Provider props
99
99
  * @param props.children - Child components
100
100
  * @returns Thread input context provider
101
101
  */
102
- function TamboV1ThreadInputProvider({ children }) {
102
+ function TamboThreadInputProvider({ children }) {
103
103
  const [inputValue, setInputValue] = (0, react_1.useState)("");
104
104
  const imageState = (0, use_message_images_1.useMessageImages)();
105
105
  const streamState = (0, tambo_v1_stream_context_1.useStreamState)();
106
106
  const dispatch = (0, tambo_v1_stream_context_1.useStreamDispatch)();
107
- const authState = (0, use_tambo_v1_auth_state_1.useTamboV1AuthState)();
107
+ const authState = (0, use_tambo_v1_auth_state_1.useTamboAuthState)();
108
108
  // Use the current thread from stream state directly
109
109
  // Placeholder ID indicates a new thread should be created
110
110
  const currentThreadId = streamState.currentThreadId ?? undefined;
111
111
  const isNewThread = (0, event_accumulator_1.isPlaceholderThreadId)(currentThreadId);
112
- const sendMessage = (0, use_tambo_v1_send_message_1.useTamboV1SendMessage)(currentThreadId);
112
+ const sendMessage = (0, use_tambo_v1_send_message_1.useTamboSendMessage)(currentThreadId);
113
113
  const isIdentified = authState.status === "identified";
114
114
  const submitFn = (0, react_1.useCallback)(async (options) => {
115
115
  if (!isIdentified) {
@@ -165,7 +165,7 @@ function TamboV1ThreadInputProvider({ children }) {
165
165
  threadId: currentThreadId,
166
166
  isDisabled: mutationState.isPending || !isIdentified,
167
167
  };
168
- return (react_1.default.createElement(exports.TamboV1ThreadInputContext.Provider, { value: contextValue }, children));
168
+ return (react_1.default.createElement(exports.TamboThreadInputContext.Provider, { value: contextValue }, children));
169
169
  }
170
170
  /**
171
171
  * Hook to access the shared thread input state.
@@ -173,11 +173,11 @@ function TamboV1ThreadInputProvider({ children }) {
173
173
  * All components using this hook share the same input state, enabling
174
174
  * features like suggestions to update the input field directly.
175
175
  * @returns The shared thread input context
176
- * @throws {Error} If used outside TamboV1ThreadInputProvider
176
+ * @throws {Error} If used outside TamboThreadInputProvider
177
177
  * @example
178
178
  * ```tsx
179
179
  * function ChatInput() {
180
- * const { value, setValue, submit, isPending } = useTamboV1ThreadInput();
180
+ * const { value, setValue, submit, isPending } = useTamboThreadInput();
181
181
  *
182
182
  * return (
183
183
  * <form onSubmit={(e) => { e.preventDefault(); submit(); }}>
@@ -192,10 +192,10 @@ function TamboV1ThreadInputProvider({ children }) {
192
192
  * }
193
193
  * ```
194
194
  */
195
- function useTamboV1ThreadInput() {
196
- const context = (0, react_1.useContext)(exports.TamboV1ThreadInputContext);
195
+ function useTamboThreadInput() {
196
+ const context = (0, react_1.useContext)(exports.TamboThreadInputContext);
197
197
  if (!context) {
198
- throw new Error("useTamboV1ThreadInput must be used within TamboV1ThreadInputProvider");
198
+ throw new Error("useTamboThreadInput must be used within TamboThreadInputProvider");
199
199
  }
200
200
  return context;
201
201
  }
@@ -1 +1 @@
1
- {"version":3,"file":"tambo-v1-thread-input-provider.js","sourceRoot":"","sources":["../../../src/v1/providers/tambo-v1-thread-input-provider.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiKb,gEAgGC;AA2BD,sDAQC;AAlSD;;;;;;;GAOG;AAEH,+CAMe;AACf,uEAGwC;AACxC,qEAGuC;AACvC,kFAA2E;AAG3E,kEAAmE;AACnE,8EAAuE;AACvE,uEAA8E;AAE9E,4DAA4D;AAC5D,8EAA8E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Q;QAC7B,SAAS,EAAE,UAAU,CAAC,SAAS;QAC/B,WAAW,EAAE,UAAU,CAAC,WAAW;QACnC,WAAW,EAAE,UAAU,CAAC,WAAW;QACnC,QAAQ,EAAE,eAAe;QACzB,UAAU,EAAE,aAAa,CAAC,SAAS,IAAI,CAAC,YAAY;KACrD,CAAC;IAEF,OAAO,CACL,8BAAC,iCAAyB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,IACpD,QAAQ,CAC0B,CACtC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,SAAgB,qBAAqB;IACnC,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,iCAAyB,CAAC,CAAC;IACtD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,sEAAsE,CACvE,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["\"use client\";\n\n/**\n * TamboV1ThreadInputProvider - Shared Thread Input Context for v1 API\n *\n * Provides shared input state across all components, enabling features like\n * suggestions to update the input field directly.\n *\n * This mirrors the beta SDK's TamboThreadInputProvider pattern.\n */\n\nimport React, {\n createContext,\n useCallback,\n useContext,\n useState,\n type PropsWithChildren,\n} from \"react\";\nimport {\n useMessageImages,\n type StagedImage,\n} from \"../../hooks/use-message-images\";\nimport {\n useTamboMutation,\n type UseTamboMutationResult,\n} from \"../../hooks/react-query-hooks\";\nimport { useTamboV1SendMessage } from \"../hooks/use-tambo-v1-send-message\";\nimport type { InputMessage } from \"../types/message\";\nimport type { ToolChoice } from \"../types/tool-choice\";\nimport { isPlaceholderThreadId } from \"../utils/event-accumulator\";\nimport { useTamboV1AuthState } from \"../hooks/use-tambo-v1-auth-state\";\nimport { useStreamDispatch, useStreamState } from \"./tambo-v1-stream-context\";\n\n// Error messages for various input-related error scenarios.\n// TODO: Reintroduce explicit `NETWORK` and `SERVER` keys once `submit()` maps\n// failures into a small, stable set of user-facing error codes (at minimum:\n// connectivity failures vs non-2xx responses).\nexport const INPUT_ERROR_MESSAGES = {\n EMPTY: \"Message cannot be empty\",\n VALIDATION: \"Invalid message format\",\n} as const;\n\nfunction stagedImageToResourceContent(\n image: StagedImage,\n): InputMessage[\"content\"][number] {\n if (!image.dataUrl.startsWith(\"data:\")) {\n throw new Error(INPUT_ERROR_MESSAGES.VALIDATION);\n }\n\n const commaIndex = image.dataUrl.indexOf(\",\");\n if (commaIndex === -1) {\n throw new Error(INPUT_ERROR_MESSAGES.VALIDATION);\n }\n\n const header = image.dataUrl.slice(\"data:\".length, commaIndex);\n const [mimeType, ...params] = header.split(\";\");\n const isBase64 = params.includes(\"base64\");\n\n if (mimeType !== image.type || !isBase64) {\n throw new Error(INPUT_ERROR_MESSAGES.VALIDATION);\n }\n\n return {\n type: \"resource\",\n resource: {\n name: image.name,\n mimeType: image.type,\n // Shared.Resource.blob expects base64-encoded data; this is the base64\n // payload from the `data:` URL.\n blob: image.dataUrl.slice(commaIndex + 1),\n },\n };\n}\n\n/**\n * Options for submitting a message\n */\nexport interface SubmitOptions {\n /**\n * Enable debug logging for the stream\n */\n debug?: boolean;\n\n /**\n * How the model should use tools. Defaults to \"auto\".\n * - \"auto\": Model decides whether to use tools\n * - \"required\": Model must use at least one tool\n * - \"none\": Model cannot use tools\n * - { name: \"toolName\" }: Model must use the specified tool\n */\n toolChoice?: ToolChoice;\n}\n\n/**\n * Context props for thread input state\n */\nexport interface TamboV1ThreadInputContextProps extends Omit<\n UseTamboMutationResult<\n { threadId: string | undefined },\n Error,\n SubmitOptions | undefined\n >,\n \"mutate\" | \"mutateAsync\"\n> {\n /** Current value of the input field */\n value: string;\n\n /**\n * Function to update the input value\n * @param value - New value for the input field\n */\n setValue: React.Dispatch<React.SetStateAction<string>>;\n\n /**\n * Function to submit the current input value\n * @param options - Submission options\n * @returns Promise with the threadId\n */\n submit: (\n options?: SubmitOptions,\n ) => Promise<{ threadId: string | undefined }>;\n\n /** Currently staged images */\n images: StagedImage[];\n\n /** Add a single image */\n addImage: (file: File) => Promise<void>;\n\n /** Add multiple images */\n addImages: (files: File[]) => Promise<void>;\n\n /** Remove an image by id */\n removeImage: (id: string) => void;\n\n /** Clear all staged images */\n clearImages: () => void;\n\n /** Current thread ID being used for input (from stream state) */\n threadId: string | undefined;\n\n /** Whether the input should be disabled (pending submission or not authenticated) */\n isDisabled: boolean;\n}\n\n/**\n * Context for thread input state.\n * @internal\n */\nexport const TamboV1ThreadInputContext = createContext<\n TamboV1ThreadInputContextProps | undefined\n>(undefined);\n\n/**\n * Provider that manages shared thread input state across all components.\n *\n * This ensures that useTamboV1ThreadInput, useTamboV1Suggestions, and other components\n * all share the same input state.\n * @param props - Provider props\n * @param props.children - Child components\n * @returns Thread input context provider\n */\nexport function TamboV1ThreadInputProvider({ children }: PropsWithChildren) {\n const [inputValue, setInputValue] = useState(\"\");\n const imageState = useMessageImages();\n const streamState = useStreamState();\n const dispatch = useStreamDispatch();\n const authState = useTamboV1AuthState();\n\n // Use the current thread from stream state directly\n // Placeholder ID indicates a new thread should be created\n const currentThreadId = streamState.currentThreadId ?? undefined;\n const isNewThread = isPlaceholderThreadId(currentThreadId);\n const sendMessage = useTamboV1SendMessage(currentThreadId);\n\n const isIdentified = authState.status === \"identified\";\n\n const submitFn = useCallback(\n async (\n options?: SubmitOptions,\n ): Promise<{ threadId: string | undefined }> => {\n if (!isIdentified) {\n throw new Error(\n \"Cannot submit: authentication is not ready. \" +\n \"Ensure a valid userKey or userToken is provided.\",\n );\n }\n\n const trimmedValue = inputValue.trim();\n\n // Check if we have content to send\n if (!trimmedValue && imageState.images.length === 0) {\n throw new Error(INPUT_ERROR_MESSAGES.EMPTY);\n }\n\n const content: InputMessage[\"content\"] = [];\n\n if (trimmedValue) {\n content.push({ type: \"text\", text: trimmedValue });\n }\n\n for (const image of imageState.images) {\n content.push(stagedImageToResourceContent(image));\n }\n\n const result = await sendMessage.mutateAsync({\n message: {\n role: \"user\",\n content,\n },\n userMessageText: trimmedValue, // Pass text for optimistic display\n debug: options?.debug,\n toolChoice: options?.toolChoice,\n });\n\n // Clear input and images after successful submission\n setInputValue(\"\");\n imageState.clearImages();\n\n // Update stream context's currentThreadId if a new thread was created\n if (result.threadId && isNewThread) {\n dispatch({ type: \"SET_CURRENT_THREAD\", threadId: result.threadId });\n }\n\n return result;\n },\n // `stagedImageToResourceContent` is a pure module-level helper (not a hook value).\n [inputValue, imageState, sendMessage, isNewThread, dispatch, isIdentified],\n );\n\n const {\n mutateAsync: submitAsync,\n mutate: _unusedSubmit,\n ...mutationState\n } = useTamboMutation({\n mutationKey: [\"v1-thread-input\", currentThreadId],\n mutationFn: submitFn,\n });\n\n const contextValue: TamboV1ThreadInputContextProps = {\n ...mutationState,\n value: inputValue,\n setValue: setInputValue,\n submit: submitAsync,\n images: imageState.images,\n addImage: imageState.addImage,\n addImages: imageState.addImages,\n removeImage: imageState.removeImage,\n clearImages: imageState.clearImages,\n threadId: currentThreadId,\n isDisabled: mutationState.isPending || !isIdentified,\n };\n\n return (\n <TamboV1ThreadInputContext.Provider value={contextValue}>\n {children}\n </TamboV1ThreadInputContext.Provider>\n );\n}\n\n/**\n * Hook to access the shared thread input state.\n *\n * All components using this hook share the same input state, enabling\n * features like suggestions to update the input field directly.\n * @returns The shared thread input context\n * @throws {Error} If used outside TamboV1ThreadInputProvider\n * @example\n * ```tsx\n * function ChatInput() {\n * const { value, setValue, submit, isPending } = useTamboV1ThreadInput();\n *\n * return (\n * <form onSubmit={(e) => { e.preventDefault(); submit(); }}>\n * <input\n * value={value}\n * onChange={(e) => setValue(e.target.value)}\n * disabled={isPending}\n * />\n * <button type=\"submit\" disabled={isPending}>Send</button>\n * </form>\n * );\n * }\n * ```\n */\nexport function useTamboV1ThreadInput(): TamboV1ThreadInputContextProps {\n const context = useContext(TamboV1ThreadInputContext);\n if (!context) {\n throw new Error(\n \"useTamboV1ThreadInput must be used within TamboV1ThreadInputProvider\",\n );\n }\n return context;\n}\n"]}
1
+ {"version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Aa,EACrB,GAAG,aAAa,EACjB,GAAG,IAAA,oCAAgB,EAAC;QACnB,WAAW,EAAE,CAAC,iBAAiB,EAAE,eAAe,CAAC;QACjD,UAAU,EAAE,QAAQ;KACrB,CAAC,CAAC;IAEH,MAAM,YAAY,GAAiC;QACjD,GAAG,aAAa;QAChB,KAAK,EAAE,UAAU;QACjB,QAAQ,EAAE,aAAa;QACvB,MAAM,EAAE,WAAW;QACnB,MAAM,EAAE,UAAU,CAAC,MAAM;QACzB,QAAQ,EAAE,UAAU,CAAC,QAAQ;QAC7B,SAAS,EAAE,UAAU,CAAC,SAAS;QAC/B,WAAW,EAAE,UAAU,CAAC,WAAW;QACnC,WAAW,EAAE,UAAU,CAAC,WAAW;QACnC,QAAQ,EAAE,eAAe;QACzB,UAAU,EAAE,aAAa,CAAC,SAAS,IAAI,CAAC,YAAY;KACrD,CAAC;IAEF,OAAO,CACL,8BAAC,+BAAuB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,IAClD,QAAQ,CACwB,CACpC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,SAAgB,mBAAmB;IACjC,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,+BAAuB,CAAC,CAAC;IACpD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,kEAAkE,CACnE,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["\"use client\";\n\n/**\n * TamboThreadInputProvider - Shared Thread Input Context\n *\n * Provides shared input state across all components, enabling features like\n * suggestions to update the input field directly.\n *\n * This mirrors the TamboThreadInputProvider pattern from the legacy beta SDK.\n */\n\nimport React, {\n createContext,\n useCallback,\n useContext,\n useState,\n type PropsWithChildren,\n} from \"react\";\nimport {\n useMessageImages,\n type StagedImage,\n} from \"../../hooks/use-message-images\";\nimport {\n useTamboMutation,\n type UseTamboMutationResult,\n} from \"../../hooks/react-query-hooks\";\nimport { useTamboSendMessage } from \"../hooks/use-tambo-v1-send-message\";\nimport type { InputMessage } from \"../types/message\";\nimport type { ToolChoice } from \"../types/tool-choice\";\nimport { isPlaceholderThreadId } from \"../utils/event-accumulator\";\nimport { useTamboAuthState } from \"../hooks/use-tambo-v1-auth-state\";\nimport { useStreamDispatch, useStreamState } from \"./tambo-v1-stream-context\";\n\n// Error messages for various input-related error scenarios.\n// TODO: Reintroduce explicit `NETWORK` and `SERVER` keys once `submit()` maps\n// failures into a small, stable set of user-facing error codes (at minimum:\n// connectivity failures vs non-2xx responses).\nexport const INPUT_ERROR_MESSAGES = {\n EMPTY: \"Message cannot be empty\",\n VALIDATION: \"Invalid message format\",\n} as const;\n\nfunction stagedImageToResourceContent(\n image: StagedImage,\n): InputMessage[\"content\"][number] {\n if (!image.dataUrl.startsWith(\"data:\")) {\n throw new Error(INPUT_ERROR_MESSAGES.VALIDATION);\n }\n\n const commaIndex = image.dataUrl.indexOf(\",\");\n if (commaIndex === -1) {\n throw new Error(INPUT_ERROR_MESSAGES.VALIDATION);\n }\n\n const header = image.dataUrl.slice(\"data:\".length, commaIndex);\n const [mimeType, ...params] = header.split(\";\");\n const isBase64 = params.includes(\"base64\");\n\n if (mimeType !== image.type || !isBase64) {\n throw new Error(INPUT_ERROR_MESSAGES.VALIDATION);\n }\n\n return {\n type: \"resource\",\n resource: {\n name: image.name,\n mimeType: image.type,\n // Shared.Resource.blob expects base64-encoded data; this is the base64\n // payload from the `data:` URL.\n blob: image.dataUrl.slice(commaIndex + 1),\n },\n };\n}\n\n/**\n * Options for submitting a message\n */\nexport interface SubmitOptions {\n /**\n * Enable debug logging for the stream\n */\n debug?: boolean;\n\n /**\n * How the model should use tools. Defaults to \"auto\".\n * - \"auto\": Model decides whether to use tools\n * - \"required\": Model must use at least one tool\n * - \"none\": Model cannot use tools\n * - { name: \"toolName\" }: Model must use the specified tool\n */\n toolChoice?: ToolChoice;\n}\n\n/**\n * Context props for thread input state\n */\nexport interface TamboThreadInputContextProps extends Omit<\n UseTamboMutationResult<\n { threadId: string | undefined },\n Error,\n SubmitOptions | undefined\n >,\n \"mutate\" | \"mutateAsync\"\n> {\n /** Current value of the input field */\n value: string;\n\n /**\n * Function to update the input value\n * @param value - New value for the input field\n */\n setValue: React.Dispatch<React.SetStateAction<string>>;\n\n /**\n * Function to submit the current input value\n * @param options - Submission options\n * @returns Promise with the threadId\n */\n submit: (\n options?: SubmitOptions,\n ) => Promise<{ threadId: string | undefined }>;\n\n /** Currently staged images */\n images: StagedImage[];\n\n /** Add a single image */\n addImage: (file: File) => Promise<void>;\n\n /** Add multiple images */\n addImages: (files: File[]) => Promise<void>;\n\n /** Remove an image by id */\n removeImage: (id: string) => void;\n\n /** Clear all staged images */\n clearImages: () => void;\n\n /** Current thread ID being used for input (from stream state) */\n threadId: string | undefined;\n\n /** Whether the input should be disabled (pending submission or not authenticated) */\n isDisabled: boolean;\n}\n\n/**\n * Context for thread input state.\n * @internal\n */\nexport const TamboThreadInputContext = createContext<\n TamboThreadInputContextProps | undefined\n>(undefined);\n\n/**\n * Provider that manages shared thread input state across all components.\n *\n * This ensures that useTamboThreadInput, useTamboSuggestions, and other components\n * all share the same input state.\n * @param props - Provider props\n * @param props.children - Child components\n * @returns Thread input context provider\n */\nexport function TamboThreadInputProvider({ children }: PropsWithChildren) {\n const [inputValue, setInputValue] = useState(\"\");\n const imageState = useMessageImages();\n const streamState = useStreamState();\n const dispatch = useStreamDispatch();\n const authState = useTamboAuthState();\n\n // Use the current thread from stream state directly\n // Placeholder ID indicates a new thread should be created\n const currentThreadId = streamState.currentThreadId ?? undefined;\n const isNewThread = isPlaceholderThreadId(currentThreadId);\n const sendMessage = useTamboSendMessage(currentThreadId);\n\n const isIdentified = authState.status === \"identified\";\n\n const submitFn = useCallback(\n async (\n options?: SubmitOptions,\n ): Promise<{ threadId: string | undefined }> => {\n if (!isIdentified) {\n throw new Error(\n \"Cannot submit: authentication is not ready. \" +\n \"Ensure a valid userKey or userToken is provided.\",\n );\n }\n\n const trimmedValue = inputValue.trim();\n\n // Check if we have content to send\n if (!trimmedValue && imageState.images.length === 0) {\n throw new Error(INPUT_ERROR_MESSAGES.EMPTY);\n }\n\n const content: InputMessage[\"content\"] = [];\n\n if (trimmedValue) {\n content.push({ type: \"text\", text: trimmedValue });\n }\n\n for (const image of imageState.images) {\n content.push(stagedImageToResourceContent(image));\n }\n\n const result = await sendMessage.mutateAsync({\n message: {\n role: \"user\",\n content,\n },\n userMessageText: trimmedValue, // Pass text for optimistic display\n debug: options?.debug,\n toolChoice: options?.toolChoice,\n });\n\n // Clear input and images after successful submission\n setInputValue(\"\");\n imageState.clearImages();\n\n // Update stream context's currentThreadId if a new thread was created\n if (result.threadId && isNewThread) {\n dispatch({ type: \"SET_CURRENT_THREAD\", threadId: result.threadId });\n }\n\n return result;\n },\n // `stagedImageToResourceContent` is a pure module-level helper (not a hook value).\n [inputValue, imageState, sendMessage, isNewThread, dispatch, isIdentified],\n );\n\n const {\n mutateAsync: submitAsync,\n mutate: _unusedSubmit,\n ...mutationState\n } = useTamboMutation({\n mutationKey: [\"v1-thread-input\", currentThreadId],\n mutationFn: submitFn,\n });\n\n const contextValue: TamboThreadInputContextProps = {\n ...mutationState,\n value: inputValue,\n setValue: setInputValue,\n submit: submitAsync,\n images: imageState.images,\n addImage: imageState.addImage,\n addImages: imageState.addImages,\n removeImage: imageState.removeImage,\n clearImages: imageState.clearImages,\n threadId: currentThreadId,\n isDisabled: mutationState.isPending || !isIdentified,\n };\n\n return (\n <TamboThreadInputContext.Provider value={contextValue}>\n {children}\n </TamboThreadInputContext.Provider>\n );\n}\n\n/**\n * Hook to access the shared thread input state.\n *\n * All components using this hook share the same input state, enabling\n * features like suggestions to update the input field directly.\n * @returns The shared thread input context\n * @throws {Error} If used outside TamboThreadInputProvider\n * @example\n * ```tsx\n * function ChatInput() {\n * const { value, setValue, submit, isPending } = useTamboThreadInput();\n *\n * return (\n * <form onSubmit={(e) => { e.preventDefault(); submit(); }}>\n * <input\n * value={value}\n * onChange={(e) => setValue(e.target.value)}\n * disabled={isPending}\n * />\n * <button type=\"submit\" disabled={isPending}>Send</button>\n * </form>\n * );\n * }\n * ```\n */\nexport function useTamboThreadInput(): TamboThreadInputContextProps {\n const context = useContext(TamboThreadInputContext);\n if (!context) {\n throw new Error(\n \"useTamboThreadInput must be used within TamboThreadInputProvider\",\n );\n }\n return context;\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Authentication state for the v1 SDK.
2
+ * Authentication state for the SDK.
3
3
  *
4
4
  * Discriminated union tracking the current auth lifecycle:
5
5
  * - `identified`: ready to make API calls (via userKey or successful token exchange)
@@ -8,7 +8,7 @@
8
8
  * - `invalid`: both userKey AND userToken provided (must choose one)
9
9
  * - `unauthenticated`: neither userKey nor userToken provided
10
10
  */
11
- export type TamboV1AuthState = {
11
+ export type TamboAuthState = {
12
12
  status: "identified";
13
13
  source: "userKey" | "tokenExchange";
14
14
  } | {
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/v1/types/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,MAAM,gBAAgB,GACxB;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,SAAS,GAAG,eAAe,CAAA;CAAE,GAC7D;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,GACxB;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,GACjC;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,GACrB;IAAE,MAAM,EAAE,iBAAiB,CAAA;CAAE,CAAC"}
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/v1/types/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,MAAM,cAAc,GACtB;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,SAAS,GAAG,eAAe,CAAA;CAAE,GAC7D;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,GACxB;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,GACjC;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,GACrB;IAAE,MAAM,EAAE,iBAAiB,CAAA;CAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/v1/types/auth.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Authentication state for the v1 SDK.\n *\n * Discriminated union tracking the current auth lifecycle:\n * - `identified`: ready to make API calls (via userKey or successful token exchange)\n * - `exchanging`: userToken provided, exchange in-flight\n * - `error`: token exchange failed\n * - `invalid`: both userKey AND userToken provided (must choose one)\n * - `unauthenticated`: neither userKey nor userToken provided\n */\nexport type TamboV1AuthState =\n | { status: \"identified\"; source: \"userKey\" | \"tokenExchange\" }\n | { status: \"exchanging\" }\n | { status: \"error\"; error: Error }\n | { status: \"invalid\" }\n | { status: \"unauthenticated\" };\n"]}
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/v1/types/auth.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Authentication state for the SDK.\n *\n * Discriminated union tracking the current auth lifecycle:\n * - `identified`: ready to make API calls (via userKey or successful token exchange)\n * - `exchanging`: userToken provided, exchange in-flight\n * - `error`: token exchange failed\n * - `invalid`: both userKey AND userToken provided (must choose one)\n * - `unauthenticated`: neither userKey nor userToken provided\n */\nexport type TamboAuthState =\n | { status: \"identified\"; source: \"userKey\" | \"tokenExchange\" }\n | { status: \"exchanging\" }\n | { status: \"error\"; error: Error }\n | { status: \"invalid\" }\n | { status: \"unauthenticated\" };\n"]}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Component Types for v1 API
2
+ * Component Types
3
3
  *
4
4
  * Defines how React components are registered and made available to the AI.
5
5
  *
@@ -7,7 +7,7 @@
7
7
  * from the SDK. The SDK exports two different AvailableComponent types:
8
8
  * - `shared.AvailableComponent` has `props` and `contextTools` fields
9
9
  * - `RunCreateParams.AvailableComponent` has `propsSchema` and `stateSchema` fields
10
- * We need the latter for v1 API calls, so we define it locally to avoid confusion.
10
+ * We need the latter for API calls, so we define it locally to avoid confusion.
11
11
  */
12
12
  import type { ComponentType } from "react";
13
13
  /**
@@ -28,7 +28,7 @@ export interface AvailableComponent {
28
28
  * Component registration for React SDK
29
29
  * Extends AvailableComponent with the actual React component
30
30
  */
31
- export interface TamboV1Component extends AvailableComponent {
31
+ export interface TamboComponent extends AvailableComponent {
32
32
  /** The React component to render */
33
33
  component: ComponentType<any>;
34
34
  /** Initial state factory (optional) */
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/v1/types/component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IAEb,4CAA4C;IAC5C,WAAW,EAAE,MAAM,CAAC;IAEpB,6CAA6C;IAC7C,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAErC,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;IAC1D,oCAAoC;IACpC,SAAS,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;IAE9B,uCAAuC;IACvC,YAAY,CAAC,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC9C;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB,CAClC,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChE,MAAM,SAAS,MA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AK,CAAC,EAAE,MAAM,CAAC;IAEf,mCAAmC;IACnC,WAAW,EAAE,MAAM,CAAC;IAEpB,oDAAoD;IACpD,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Component Types for v1 API
3
+ * Component Types
4
4
  *
5
5
  * Defines how React components are registered and made available to the AI.
6
6
  *
@@ -8,7 +8,7 @@
8
8
  * from the SDK. The SDK exports two different AvailableComponent types:
9
9
  * - `shared.AvailableComponent` has `props` and `contextTools` fields
10
10
  * - `RunCreateParams.AvailableComponent` has `propsSchema` and `stateSchema` fields
11
- * We need the latter for v1 API calls, so we define it locally to avoid confusion.
11
+ * We need the latter for API calls, so we define it locally to avoid confusion.
12
12
  */
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
14
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/v1/types/component.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG","sourcesContent":["/**\n * Component Types for v1 API\n *\n * Defines how React components are registered and made available to the AI.\n *\n * Note: AvailableComponent is defined locally to match RunCreateParams.AvailableComponent\n * from the SDK. The SDK exports two different AvailableComponent types:\n * - `shared.AvailableComponent` has `props` and `contextTools` fields\n * - `RunCreateParams.AvailableComponent` has `propsSchema` and `stateSchema` fields\n * We need the latter for v1 API calls, so we define it locally to avoid confusion.\n */\n\nimport type { ComponentType } from \"react\";\n\n/**\n * Component registration metadata for the AI\n * This is what gets sent to the API in the `available_components` field\n */\nexport interface AvailableComponent {\n /** Component name (must be unique) */\n name: string;\n\n /** Human-readable description for the AI */\n description: string;\n\n /** JSON Schema describing component props */\n propsSchema: Record<string, unknown>;\n\n /** JSON Schema describing component state (optional) */\n stateSchema?: Record<string, unknown>;\n}\n\n/**\n * Component registration for React SDK\n * Extends AvailableComponent with the actual React component\n */\nexport interface TamboV1Component extends AvailableComponent {\n /** The React component to render */\n component: ComponentType<any>;\n\n /** Initial state factory (optional) */\n initialState?: () => Record<string, unknown>;\n}\n\n/**\n * Props passed to components when rendered\n */\nexport interface TamboComponentProps<\n TProps extends Record<string, unknown> = Record<string, unknown>,\n TState extends Record<string, unknown> = Record<string, unknown>,\n> {\n /** Component props from AI */\n props: TProps;\n\n /** Component state (can be updated by AI or client) */\n state?: TState;\n\n /** Unique component instance ID */\n componentId: string;\n\n /** Whether this component is currently streaming */\n isStreaming?: boolean;\n}\n"]}
1
+ {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/v1/types/component.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG","sourcesContent":["/**\n * Component Types\n *\n * Defines how React components are registered and made available to the AI.\n *\n * Note: AvailableComponent is defined locally to match RunCreateParams.AvailableComponent\n * from the SDK. The SDK exports two different AvailableComponent types:\n * - `shared.AvailableComponent` has `props` and `contextTools` fields\n * - `RunCreateParams.AvailableComponent` has `propsSchema` and `stateSchema` fields\n * We need the latter for API calls, so we define it locally to avoid confusion.\n */\n\nimport type { ComponentType } from \"react\";\n\n/**\n * Component registration metadata for the AI\n * This is what gets sent to the API in the `available_components` field\n */\nexport interface AvailableComponent {\n /** Component name (must be unique) */\n name: string;\n\n /** Human-readable description for the AI */\n description: string;\n\n /** JSON Schema describing component props */\n propsSchema: Record<string, unknown>;\n\n /** JSON Schema describing component state (optional) */\n stateSchema?: Record<string, unknown>;\n}\n\n/**\n * Component registration for React SDK\n * Extends AvailableComponent with the actual React component\n */\nexport interface TamboComponent extends AvailableComponent {\n /** The React component to render */\n component: ComponentType<any>;\n\n /** Initial state factory (optional) */\n initialState?: () => Record<string, unknown>;\n}\n\n/**\n * Props passed to components when rendered\n */\nexport interface TamboComponentProps<\n TProps extends Record<string, unknown> = Record<string, unknown>,\n TState extends Record<string, unknown> = Record<string, unknown>,\n> {\n /** Component props from AI */\n props: TProps;\n\n /** Component state (can be updated by AI or client) */\n state?: TState;\n\n /** Unique component instance ID */\n componentId: string;\n\n /** Whether this component is currently streaming */\n isStreaming?: boolean;\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Tambo-specific Custom Event Types for v1 Streaming API
2
+ * Tambo-specific Custom Event Types for Streaming API
3
3
  *
4
4
  * Defines custom events specific to Tambo functionality.
5
5
  * For standard AG-UI events, import directly from `@ag-ui/core`.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Tambo-specific Custom Event Types for v1 Streaming API
3
+ * Tambo-specific Custom Event Types for Streaming API
4
4
  *
5
5
  * Defines custom events specific to Tambo functionality.
6
6
  * For standard AG-UI events, import directly from `@ag-ui/core`.
@@ -1 +1 @@
1
- {"version":3,"file":"event.js","sourceRoot":"","sources":["../../../src/v1/types/event.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AA2GH,gDAOC;AAQD,gDAiBC;AAlDD;;GAEG;AACH,MAAM,wBAAwB,GAAG;IAC/B,uBAAuB;IACvB,6BAA6B;IAC7B,6BAA6B;IAC7B,qBAAqB;IACrB,0BAA0B;CAClB,CAAC;AAEX;;;;;;GAMG;AACH,SAAgB,kBAAkB,CAAC,KAElC;IACC,OAAO,CACL,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;QAC7B,wBAA8C,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CACrE,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAgB,kBAAkB,CAChC,KAAkB;IAElB,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,uBAAuB;YAC1B,OAAO,KAA4B,CAAC;QACtC,KAAK,6BAA6B;YAChC,OAAO,KAAiC,CAAC;QAC3C,KAAK,6BAA6B;YAChC,OAAO,KAAiC,CAAC;QAC3C,KAAK,qBAAqB;YACxB,OAAO,KAA0B,CAAC;QACpC,KAAK,0BAA0B;YAC7B,OAAO,KAA8B,CAAC;QACxC;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC","sourcesContent":["/**\n * Tambo-specific Custom Event Types for v1 Streaming API\n *\n * Defines custom events specific to Tambo functionality.\n * For standard AG-UI events, import directly from `@ag-ui/core`.\n */\n\nimport type { CustomEvent } from \"@ag-ui/core\";\nimport type { Operation } from \"fast-json-patch\";\n\ntype TamboCustomEventEnvelope<TName extends string, TValue> = Omit<\n CustomEvent,\n \"name\" | \"value\"\n> & {\n name: TName;\n value: TValue;\n};\n\n/**\n * Component start event (custom: tambo.component.start)\n */\nexport type ComponentStartEvent = TamboCustomEventEnvelope<\n \"tambo.component.start\",\n {\n messageId: string;\n componentId: string;\n componentName: string;\n }\n>;\n\n/**\n * Component props delta event (custom: tambo.component.props_delta)\n * Uses JSON Patch (RFC 6902) to update component props\n */\nexport type ComponentPropsDeltaEvent = TamboCustomEventEnvelope<\n \"tambo.component.props_delta\",\n {\n componentId: string;\n operations: Operation[];\n }\n>;\n\n/**\n * Component state delta event (custom: tambo.component.state_delta)\n * Uses JSON Patch (RFC 6902) to update component state\n */\nexport type ComponentStateDeltaEvent = TamboCustomEventEnvelope<\n \"tambo.component.state_delta\",\n {\n componentId: string;\n operations: Operation[];\n }\n>;\n\n/**\n * Component end event (custom: tambo.component.end)\n */\nexport type ComponentEndEvent = TamboCustomEventEnvelope<\n \"tambo.component.end\",\n {\n componentId: string;\n }\n>;\n\n/**\n * Pending tool call information from awaiting_input event\n */\nexport interface PendingToolCall {\n toolCallId: string;\n toolName: string;\n arguments: string;\n}\n\n/**\n * Run awaiting input event (custom: tambo.run.awaiting_input)\n * Signals that the run is paused waiting for client-side tool execution\n */\nexport type RunAwaitingInputEvent = TamboCustomEventEnvelope<\n \"tambo.run.awaiting_input\",\n {\n pendingToolCalls: PendingToolCall[];\n }\n>;\n\n/**\n * Union type of Tambo-specific custom events\n */\nexport type TamboCustomEvent =\n | ComponentStartEvent\n | ComponentPropsDeltaEvent\n | ComponentStateDeltaEvent\n | ComponentEndEvent\n | RunAwaitingInputEvent;\n\n/**\n * Known Tambo custom event names for type narrowing\n */\nconst TAMBO_CUSTOM_EVENT_NAMES = [\n \"tambo.component.start\",\n \"tambo.component.props_delta\",\n \"tambo.component.state_delta\",\n \"tambo.component.end\",\n \"tambo.run.awaiting_input\",\n] as const;\n\n/**\n * Type guard to check if an event is a Tambo custom event.\n * Validates that the event has a name matching known Tambo custom event types.\n * @param event - Event object to check\n * @param event.name - Event name to match against known Tambo event types\n * @returns True if event is a TamboCustomEvent\n */\nexport function isTamboCustomEvent(event: {\n name?: string;\n}): event is TamboCustomEvent {\n return (\n typeof event.name === \"string\" &&\n (TAMBO_CUSTOM_EVENT_NAMES as readonly string[]).includes(event.name)\n );\n}\n\n/**\n * Casts a CustomEvent to the specific TamboCustomEvent type based on its name.\n * Uses exhaustive type checking to ensure all event types are handled.\n * @param event - The CustomEvent to cast\n * @returns The properly typed TamboCustomEvent, or undefined if not a known Tambo event\n */\nexport function asTamboCustomEvent(\n event: CustomEvent,\n): TamboCustomEvent | undefined {\n switch (event.name) {\n case \"tambo.component.start\":\n return event as ComponentStartEvent;\n case \"tambo.component.props_delta\":\n return event as ComponentPropsDeltaEvent;\n case \"tambo.component.state_delta\":\n return event as ComponentStateDeltaEvent;\n case \"tambo.component.end\":\n return event as ComponentEndEvent;\n case \"tambo.run.awaiting_input\":\n return event as RunAwaitingInputEvent;\n default:\n return undefined;\n }\n}\n"]}
1
+ {"version":3,"file":"event.js","sourceRoot":"","sources":["../../../src/v1/types/event.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AA2GH,gDAOC;AAQD,gDAiBC;AAlDD;;GAEG;AACH,MAAM,wBAAwB,GAAG;IAC/B,uBAAuB;IACvB,6BAA6B;IAC7B,6BAA6B;IAC7B,qBAAqB;IACrB,0BAA0B;CAClB,CAAC;AAEX;;;;;;GAMG;AACH,SAAgB,kBAAkB,CAAC,KAElC;IACC,OAAO,CACL,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;QAC7B,wBAA8C,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CACrE,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAgB,kBAAkB,CAChC,KAAkB;IAElB,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,uBAAuB;YAC1B,OAAO,KAA4B,CAAC;QACtC,KAAK,6BAA6B;YAChC,OAAO,KAAiC,CAAC;QAC3C,KAAK,6BAA6B;YAChC,OAAO,KAAiC,CAAC;QAC3C,KAAK,qBAAqB;YACxB,OAAO,KAA0B,CAAC;QACpC,KAAK,0BAA0B;YAC7B,OAAO,KAA8B,CAAC;QACxC;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC","sourcesContent":["/**\n * Tambo-specific Custom Event Types for Streaming API\n *\n * Defines custom events specific to Tambo functionality.\n * For standard AG-UI events, import directly from `@ag-ui/core`.\n */\n\nimport type { CustomEvent } from \"@ag-ui/core\";\nimport type { Operation } from \"fast-json-patch\";\n\ntype TamboCustomEventEnvelope<TName extends string, TValue> = Omit<\n CustomEvent,\n \"name\" | \"value\"\n> & {\n name: TName;\n value: TValue;\n};\n\n/**\n * Component start event (custom: tambo.component.start)\n */\nexport type ComponentStartEvent = TamboCustomEventEnvelope<\n \"tambo.component.start\",\n {\n messageId: string;\n componentId: string;\n componentName: string;\n }\n>;\n\n/**\n * Component props delta event (custom: tambo.component.props_delta)\n * Uses JSON Patch (RFC 6902) to update component props\n */\nexport type ComponentPropsDeltaEvent = TamboCustomEventEnvelope<\n \"tambo.component.props_delta\",\n {\n componentId: string;\n operations: Operation[];\n }\n>;\n\n/**\n * Component state delta event (custom: tambo.component.state_delta)\n * Uses JSON Patch (RFC 6902) to update component state\n */\nexport type ComponentStateDeltaEvent = TamboCustomEventEnvelope<\n \"tambo.component.state_delta\",\n {\n componentId: string;\n operations: Operation[];\n }\n>;\n\n/**\n * Component end event (custom: tambo.component.end)\n */\nexport type ComponentEndEvent = TamboCustomEventEnvelope<\n \"tambo.component.end\",\n {\n componentId: string;\n }\n>;\n\n/**\n * Pending tool call information from awaiting_input event\n */\nexport interface PendingToolCall {\n toolCallId: string;\n toolName: string;\n arguments: string;\n}\n\n/**\n * Run awaiting input event (custom: tambo.run.awaiting_input)\n * Signals that the run is paused waiting for client-side tool execution\n */\nexport type RunAwaitingInputEvent = TamboCustomEventEnvelope<\n \"tambo.run.awaiting_input\",\n {\n pendingToolCalls: PendingToolCall[];\n }\n>;\n\n/**\n * Union type of Tambo-specific custom events\n */\nexport type TamboCustomEvent =\n | ComponentStartEvent\n | ComponentPropsDeltaEvent\n | ComponentStateDeltaEvent\n | ComponentEndEvent\n | RunAwaitingInputEvent;\n\n/**\n * Known Tambo custom event names for type narrowing\n */\nconst TAMBO_CUSTOM_EVENT_NAMES = [\n \"tambo.component.start\",\n \"tambo.component.props_delta\",\n \"tambo.component.state_delta\",\n \"tambo.component.end\",\n \"tambo.run.awaiting_input\",\n] as const;\n\n/**\n * Type guard to check if an event is a Tambo custom event.\n * Validates that the event has a name matching known Tambo custom event types.\n * @param event - Event object to check\n * @param event.name - Event name to match against known Tambo event types\n * @returns True if event is a TamboCustomEvent\n */\nexport function isTamboCustomEvent(event: {\n name?: string;\n}): event is TamboCustomEvent {\n return (\n typeof event.name === \"string\" &&\n (TAMBO_CUSTOM_EVENT_NAMES as readonly string[]).includes(event.name)\n );\n}\n\n/**\n * Casts a CustomEvent to the specific TamboCustomEvent type based on its name.\n * Uses exhaustive type checking to ensure all event types are handled.\n * @param event - The CustomEvent to cast\n * @returns The properly typed TamboCustomEvent, or undefined if not a known Tambo event\n */\nexport function asTamboCustomEvent(\n event: CustomEvent,\n): TamboCustomEvent | undefined {\n switch (event.name) {\n case \"tambo.component.start\":\n return event as ComponentStartEvent;\n case \"tambo.component.props_delta\":\n return event as ComponentPropsDeltaEvent;\n case \"tambo.component.state_delta\":\n return event as ComponentStateDeltaEvent;\n case \"tambo.component.end\":\n return event as ComponentEndEvent;\n case \"tambo.run.awaiting_input\":\n return event as RunAwaitingInputEvent;\n default:\n return undefined;\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Message and Content Types for v1 API
2
+ * Message and Content Types
3
3
  *
4
4
  * Re-exports message and content types from `@tambo-ai/typescript-sdk`.
5
5
  * Messages use Anthropic-style content blocks pattern where a message
@@ -7,19 +7,14 @@
7
7
  */
8
8
  import type { ReactElement } from "react";
9
9
  export type { TextContent, ToolResultContent, ResourceContent, } from "@tambo-ai/typescript-sdk/resources/threads/threads";
10
- import type { InputMessage } from "@tambo-ai/typescript-sdk/resources/threads/runs";
11
10
  export type { InputMessage } from "@tambo-ai/typescript-sdk/resources/threads/runs";
11
+ import type { RunCreateParams } from "@tambo-ai/typescript-sdk/resources/threads/runs";
12
12
  /**
13
- * Widened InputMessage type for initial messages that supports system and assistant roles
14
- * in addition to the user role.
15
- *
16
- * The TS SDK `InputMessage` type constrains `role` to `'user'`, but the V1 API
17
- * accepts `'user' | 'system' | 'assistant'` for `initialMessages`. This type
18
- * widens the role field until the TS SDK type is regenerated.
13
+ * Message type for initial messages that seed a new thread.
14
+ * Supports system and assistant roles in addition to user,
15
+ * and restricts content to text and resource blocks (no tool results).
19
16
  */
20
- export type InitialInputMessage = Omit<InputMessage, "role"> & {
21
- role: "user" | "system" | "assistant";
22
- };
17
+ export type InitialInputMessage = RunCreateParams.Thread.InitialMessage;
23
18
  export type { MessageListResponse, MessageGetResponse, } from "@tambo-ai/typescript-sdk/resources/threads/messages";
24
19
  import type { TextContent, ToolUseContent, ToolResultContent, ComponentContent, ResourceContent } from "@tambo-ai/typescript-sdk/resources/threads/threads";
25
20
  /**
@@ -29,9 +24,9 @@ import type { TextContent, ToolUseContent, ToolResultContent, ComponentContent,
29
24
  export type ComponentStreamingState = "started" | "streaming" | "done";
30
25
  /**
31
26
  * Extended ComponentContent with streaming state and rendered element.
32
- * Used by the v1 SDK to track component rendering lifecycle.
27
+ * Used by the SDK to track component rendering lifecycle.
33
28
  */
34
- export interface V1ComponentContent extends ComponentContent {
29
+ export interface TamboComponentContent extends ComponentContent {
35
30
  /**
36
31
  * Current streaming state of this component's props.
37
32
  * - 'started': Component block created, awaiting props
@@ -52,8 +47,6 @@ export interface V1ComponentContent extends ComponentContent {
52
47
  * These are used to customize tool status messages shown in the UI.
53
48
  */
54
49
  export interface TamboToolDisplayProps {
55
- /** Generic display message for the tool */
56
- _tambo_displayMessage?: string;
57
50
  /** Message shown while the tool is executing */
58
51
  _tambo_statusMessage?: string;
59
52
  /** Message shown after the tool completes */
@@ -61,12 +54,12 @@ export interface TamboToolDisplayProps {
61
54
  }
62
55
  /**
63
56
  * Extended ToolUseContent with computed state properties.
64
- * Used by the v1 SDK to provide pre-computed tool state to consumers.
57
+ * Used by the SDK to provide pre-computed tool state to consumers.
65
58
  *
66
- * Note: The computed properties are populated by `useTamboV1()` hook.
59
+ * Note: The computed properties are populated by `useTambo()` hook.
67
60
  * When accessed via lower-level APIs, they may be undefined.
68
61
  */
69
- export interface V1ToolUseContent extends Omit<ToolUseContent, "input"> {
62
+ export interface TamboToolUseContent extends Omit<ToolUseContent, "input"> {
70
63
  /**
71
64
  * Tool input parameters with internal `_tambo_*` properties removed.
72
65
  * Consumers see only the actual tool parameters.
@@ -74,19 +67,19 @@ export interface V1ToolUseContent extends Omit<ToolUseContent, "input"> {
74
67
  input: Record<string, unknown>;
75
68
  /**
76
69
  * Whether this tool call has completed (has a matching tool_result).
77
- * Computed by `useTamboV1()` based on presence of matching tool_result.
70
+ * Computed by `useTambo()` based on presence of matching tool_result.
78
71
  */
79
72
  hasCompleted?: boolean;
80
73
  /**
81
74
  * The status message to display, resolved based on tool execution state.
82
75
  * Automatically updates as tool progresses through execution lifecycle.
83
- * Computed by `useTamboV1()`.
76
+ * Computed by `useTambo()`.
84
77
  */
85
78
  statusMessage?: string;
86
79
  /**
87
80
  * Extracted Tambo display properties from the tool input.
88
81
  * Consumers can use these for custom rendering if needed.
89
- * Computed by `useTamboV1()`.
82
+ * Computed by `useTambo()`.
90
83
  */
91
84
  tamboDisplayProps?: TamboToolDisplayProps;
92
85
  }
@@ -97,13 +90,13 @@ export interface V1ToolUseContent extends Omit<ToolUseContent, "input"> {
97
90
  export type MessageRole = "user" | "assistant" | "system";
98
91
  /**
99
92
  * Union type of all content block types.
100
- * Uses V1ComponentContent and V1ToolUseContent which include computed state.
93
+ * Uses TamboComponentContent and TamboToolUseContent which include computed state.
101
94
  */
102
- export type Content = TextContent | V1ToolUseContent | ToolResultContent | V1ComponentContent | ResourceContent;
95
+ export type Content = TextContent | TamboToolUseContent | ToolResultContent | TamboComponentContent | ResourceContent;
103
96
  /**
104
97
  * Message in a thread (simplified from SDK's MessageGetResponse)
105
98
  */
106
- export interface TamboV1Message {
99
+ export interface TamboThreadMessage {
107
100
  /** Unique message identifier */
108
101
  id: string;
109
102
  /** Message role (user or assistant) */
@@ -1 +1 @@
1
- {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/v1/types/message.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAK1C,YAAY,EACV,WAAW,EACX,iBAAiB,EACjB,eAAe,GAChB,MAAM,oDAAoD,CAAC;AAG5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAC;AACpF,YAAY,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAC;AAEpF;;;;;;;GAOG;AACH,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,GAAG;IAC7D,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,WAAW,CAAC;CACvC,CAAC;AAEF,YAAY,EACV,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,qDAAqD,CAAC;AAG7D,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EAChB,MAAM,oDAAoD,CAAC;AAE5D;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,SAAS,GAAG,WAAW,GAAG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H,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAE/B;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,qBAAqB,CAAC;CAC3C;AAED;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;AAE1D;;;GAGG;AACH,MAAM,MAAM,OAAO,GACf,WAAW,GACX,mBAAmB,GACnB,iBAAiB,GACjB,qBAAqB,GACrB,eAAe,CAAC;AAEpB;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,gCAAgC;IAChC,EAAE,EAAE,MAAM,CAAC;IAEX,uCAAuC;IACvC,IAAI,EAAE,WAAW,CAAC;IAElB,oCAAoC;IACpC,OAAO,EAAE,OAAO,EAAE,CAAC;IAEnB,sFAAsF;IACtF,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,uBAAuB;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEnC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IAErB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Message and Content Types for v1 API
3
+ * Message and Content Types
4
4
  *
5
5
  * Re-exports message and content types from `@tambo-ai/typescript-sdk`.
6
6
  * Messages use Anthropic-style content blocks pattern where a message
@@ -1 +1 @@
1
- {"version":3,"file":"message.js","sourceRoot":"","sources":["../../../src/v1/types/message.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG","sourcesContent":["/**\n * Message and Content Types for v1 API\n *\n * Re-exports message and content types from `@tambo-ai/typescript-sdk`.\n * Messages use Anthropic-style content blocks pattern where a message\n * contains an array of content blocks (text, tool calls, tool results, components).\n */\n\nimport type { ReactElement } from \"react\";\n\n// Re-export content block types from TypeScript SDK\n// Note: ToolUseContent and ComponentContent are NOT re-exported - use V1ToolUseContent\n// and V1ComponentContent instead, which include computed state properties.\nexport type {\n TextContent,\n ToolResultContent,\n ResourceContent,\n} from \"@tambo-ai/typescript-sdk/resources/threads/threads\";\n\n// Re-export message types from TypeScript SDK\nimport type { InputMessage } from \"@tambo-ai/typescript-sdk/resources/threads/runs\";\nexport type { InputMessage } from \"@tambo-ai/typescript-sdk/resources/threads/runs\";\n\n/**\n * Widened InputMessage type for initial messages that supports system and assistant roles\n * in addition to the user role.\n *\n * The TS SDK `InputMessage` type constrains `role` to `'user'`, but the V1 API\n * accepts `'user' | 'system' | 'assistant'` for `initialMessages`. This type\n * widens the role field until the TS SDK type is regenerated.\n */\nexport type InitialInputMessage = Omit<InputMessage, \"role\"> & {\n role: \"user\" | \"system\" | \"assistant\";\n};\n\nexport type {\n MessageListResponse,\n MessageGetResponse,\n} from \"@tambo-ai/typescript-sdk/resources/threads/messages\";\n\n// Import for Content union type\nimport type {\n TextContent,\n ToolUseContent,\n ToolResultContent,\n ComponentContent,\n ResourceContent,\n} from \"@tambo-ai/typescript-sdk/resources/threads/threads\";\n\n/**\n * Streaming state for component content blocks.\n * Tracks the lifecycle of component prop/state streaming.\n */\nexport type ComponentStreamingState = \"started\" | \"streaming\" | \"done\";\n\n/**\n * Extended ComponentContent with streaming state and rendered element.\n * Used by the v1 SDK to track component rendering lifecycle.\n */\nexport interface V1ComponentContent extends ComponentContent {\n /**\n * Current streaming state of this component's props.\n * - 'started': Component block created, awaiting props\n * - 'streaming': Props are being streamed\n * - 'done': Props streaming complete\n *\n * Optional for historical messages loaded from API (defaults to \"done\").\n */\n streamingState?: ComponentStreamingState;\n\n /**\n * The rendered React element for this component.\n * undefined if not yet rendered, null if the component couldn't be found in the registry.\n */\n renderedComponent?: ReactElement | null;\n}\n\n/**\n * Special display properties that can be included in tool input.\n * These are used to customize tool status messages shown in the UI.\n */\nexport interface TamboToolDisplayProps {\n /** Generic display message for the tool */\n _tambo_displayMessage?: string;\n /** Message shown while the tool is executing */\n _tambo_statusMessage?: string;\n /** Message shown after the tool completes */\n _tambo_completionStatusMessage?: string;\n}\n\n/**\n * Extended ToolUseContent with computed state properties.\n * Used by the v1 SDK to provide pre-computed tool state to consumers.\n *\n * Note: The computed properties are populated by `useTamboV1()` hook.\n * When accessed via lower-level APIs, they may be undefined.\n */\nexport interface V1ToolUseContent extends Omit<ToolUseContent, \"input\"> {\n /**\n * Tool input parameters with internal `_tambo_*` properties removed.\n * Consumers see only the actual tool parameters.\n */\n input: Record<string, unknown>;\n\n /**\n * Whether this tool call has completed (has a matching tool_result).\n * Computed by `useTamboV1()` based on presence of matching tool_result.\n */\n hasCompleted?: boolean;\n\n /**\n * The status message to display, resolved based on tool execution state.\n * Automatically updates as tool progresses through execution lifecycle.\n * Computed by `useTamboV1()`.\n */\n statusMessage?: string;\n\n /**\n * Extracted Tambo display properties from the tool input.\n * Consumers can use these for custom rendering if needed.\n * Computed by `useTamboV1()`.\n */\n tamboDisplayProps?: TamboToolDisplayProps;\n}\n\n/**\n * Message role (from SDK)\n * Includes 'system' to accommodate messages loaded from API.\n */\nexport type MessageRole = \"user\" | \"assistant\" | \"system\";\n\n/**\n * Union type of all content block types.\n * Uses V1ComponentContent and V1ToolUseContent which include computed state.\n */\nexport type Content =\n | TextContent\n | V1ToolUseContent\n | ToolResultContent\n | V1ComponentContent\n | ResourceContent;\n\n/**\n * Message in a thread (simplified from SDK's MessageGetResponse)\n */\nexport interface TamboV1Message {\n /** Unique message identifier */\n id: string;\n\n /** Message role (user or assistant) */\n role: MessageRole;\n\n /** Content blocks in the message */\n content: Content[];\n\n /** When the message was created (optional for historical messages loaded from API) */\n createdAt?: string;\n\n /** Message metadata */\n metadata?: Record<string, unknown>;\n\n /**\n * Reasoning content from the model (transient - only during streaming).\n * Each element is a reasoning \"chunk\" - models may emit multiple reasoning blocks.\n * This data is not persisted to the database and will not be present in\n * messages loaded from the API.\n */\n reasoning?: string[];\n\n /**\n * Duration of the reasoning phase in milliseconds (for display purposes).\n * Populated when reasoning completes.\n */\n reasoningDurationMS?: number;\n}\n"]}
1
+ {"version":3,"file":"message.js","sourceRoot":"","sources":["../../../src/v1/types/message.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG","sourcesContent":["/**\n * Message and Content Types\n *\n * Re-exports message and content types from `@tambo-ai/typescript-sdk`.\n * Messages use Anthropic-style content blocks pattern where a message\n * contains an array of content blocks (text, tool calls, tool results, components).\n */\n\nimport type { ReactElement } from \"react\";\n\n// Re-export content block types from TypeScript SDK\n// Note: ToolUseContent and ComponentContent are NOT re-exported - use TamboToolUseContent\n// and TamboComponentContent instead, which include computed state properties.\nexport type {\n TextContent,\n ToolResultContent,\n ResourceContent,\n} from \"@tambo-ai/typescript-sdk/resources/threads/threads\";\n\n// Re-export message types from TypeScript SDK\nexport type { InputMessage } from \"@tambo-ai/typescript-sdk/resources/threads/runs\";\nimport type { RunCreateParams } from \"@tambo-ai/typescript-sdk/resources/threads/runs\";\n\n/**\n * Message type for initial messages that seed a new thread.\n * Supports system and assistant roles in addition to user,\n * and restricts content to text and resource blocks (no tool results).\n */\nexport type InitialInputMessage = RunCreateParams.Thread.InitialMessage;\n\nexport type {\n MessageListResponse,\n MessageGetResponse,\n} from \"@tambo-ai/typescript-sdk/resources/threads/messages\";\n\n// Import for Content union type\nimport type {\n TextContent,\n ToolUseContent,\n ToolResultContent,\n ComponentContent,\n ResourceContent,\n} from \"@tambo-ai/typescript-sdk/resources/threads/threads\";\n\n/**\n * Streaming state for component content blocks.\n * Tracks the lifecycle of component prop/state streaming.\n */\nexport type ComponentStreamingState = \"started\" | \"streaming\" | \"done\";\n\n/**\n * Extended ComponentContent with streaming state and rendered element.\n * Used by the SDK to track component rendering lifecycle.\n */\nexport interface TamboComponentContent extends ComponentContent {\n /**\n * Current streaming state of this component's props.\n * - 'started': Component block created, awaiting props\n * - 'streaming': Props are being streamed\n * - 'done': Props streaming complete\n *\n * Optional for historical messages loaded from API (defaults to \"done\").\n */\n streamingState?: ComponentStreamingState;\n\n /**\n * The rendered React element for this component.\n * undefined if not yet rendered, null if the component couldn't be found in the registry.\n */\n renderedComponent?: ReactElement | null;\n}\n\n/**\n * Special display properties that can be included in tool input.\n * These are used to customize tool status messages shown in the UI.\n */\nexport interface TamboToolDisplayProps {\n /** Message shown while the tool is executing */\n _tambo_statusMessage?: string;\n /** Message shown after the tool completes */\n _tambo_completionStatusMessage?: string;\n}\n\n/**\n * Extended ToolUseContent with computed state properties.\n * Used by the SDK to provide pre-computed tool state to consumers.\n *\n * Note: The computed properties are populated by `useTambo()` hook.\n * When accessed via lower-level APIs, they may be undefined.\n */\nexport interface TamboToolUseContent extends Omit<ToolUseContent, \"input\"> {\n /**\n * Tool input parameters with internal `_tambo_*` properties removed.\n * Consumers see only the actual tool parameters.\n */\n input: Record<string, unknown>;\n\n /**\n * Whether this tool call has completed (has a matching tool_result).\n * Computed by `useTambo()` based on presence of matching tool_result.\n */\n hasCompleted?: boolean;\n\n /**\n * The status message to display, resolved based on tool execution state.\n * Automatically updates as tool progresses through execution lifecycle.\n * Computed by `useTambo()`.\n */\n statusMessage?: string;\n\n /**\n * Extracted Tambo display properties from the tool input.\n * Consumers can use these for custom rendering if needed.\n * Computed by `useTambo()`.\n */\n tamboDisplayProps?: TamboToolDisplayProps;\n}\n\n/**\n * Message role (from SDK)\n * Includes 'system' to accommodate messages loaded from API.\n */\nexport type MessageRole = \"user\" | \"assistant\" | \"system\";\n\n/**\n * Union type of all content block types.\n * Uses TamboComponentContent and TamboToolUseContent which include computed state.\n */\nexport type Content =\n | TextContent\n | TamboToolUseContent\n | ToolResultContent\n | TamboComponentContent\n | ResourceContent;\n\n/**\n * Message in a thread (simplified from SDK's MessageGetResponse)\n */\nexport interface TamboThreadMessage {\n /** Unique message identifier */\n id: string;\n\n /** Message role (user or assistant) */\n role: MessageRole;\n\n /** Content blocks in the message */\n content: Content[];\n\n /** When the message was created (optional for historical messages loaded from API) */\n createdAt?: string;\n\n /** Message metadata */\n metadata?: Record<string, unknown>;\n\n /**\n * Reasoning content from the model (transient - only during streaming).\n * Each element is a reasoning \"chunk\" - models may emit multiple reasoning blocks.\n * This data is not persisted to the database and will not be present in\n * messages loaded from the API.\n */\n reasoning?: string[];\n\n /**\n * Duration of the reasoning phase in milliseconds (for display purposes).\n * Populated when reasoning completes.\n */\n reasoningDurationMS?: number;\n}\n"]}
@@ -1,26 +1,28 @@
1
1
  /**
2
- * Thread Types for v1 API
2
+ * Thread Types
3
3
  *
4
4
  * Re-exports thread types from `@tambo-ai/typescript-sdk` and defines
5
5
  * React-specific extensions for streaming state management.
6
6
  */
7
- import type { TamboV1Message } from "./message";
7
+ import type { TamboThreadMessage } from "./message";
8
8
  export type { ThreadCreateResponse, ThreadRetrieveResponse, ThreadListResponse, } from "@tambo-ai/typescript-sdk/resources/threads/threads";
9
9
  /**
10
- * Run status indicates the current state of the thread
10
+ * Run status indicates the current state of the thread's run lifecycle.
11
+ * Matches the API's RunStatus — no "complete" or "error" variants.
12
+ * Error information is tracked separately in StreamingState.error.
11
13
  */
12
- export type RunStatus = "idle" | "waiting" | "streaming" | "complete" | "error";
14
+ export type RunStatus = "idle" | "waiting" | "streaming";
13
15
  /**
14
16
  * Thread represents a conversation with the AI
15
17
  * Extended from SDK's ThreadRetrieveResponse with additional fields for React state
16
18
  */
17
- export interface TamboV1Thread {
19
+ export interface TamboThread {
18
20
  /** Unique thread identifier */
19
21
  id: string;
20
- /** Thread title/name */
21
- title?: string;
22
+ /** Thread name */
23
+ name?: string;
22
24
  /** Messages in the thread */
23
- messages: TamboV1Message[];
25
+ messages: TamboThreadMessage[];
24
26
  /** Current run status */
25
27
  status: RunStatus;
26
28
  /** Thread metadata */
@@ -1 +1 @@
1
- {"version":3,"file":"thread.d.ts","sourceRoot":"","sources":["../../../src/v1/types/thread.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA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AkB,EAAE,MAAM,WAAW,CAAC;AAGpD,YAAY,EACV,oBAAoB,EACpB,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,oDAAoD,CAAC;AAE5D;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,CAAC;AAEzD;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,+BAA+B;IAC/B,EAAE,EAAE,MAAM,CAAC;IAEX,kBAAkB;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,6BAA6B;IAC7B,QAAQ,EAAE,kBAAkB,EAAE,CAAC;IAE/B,yBAAyB;IACzB,MAAM,EAAE,SAAS,CAAC;IAElB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEnC,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAC;IAElB,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAC;IAElB,iFAAiF;IACjF,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,+BAA+B;IAC/B,MAAM,EAAE,SAAS,CAAC;IAElB,mCAAmC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,wDAAwD;IACxD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B,6CAA6C;IAC7C,KAAK,CAAC,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Thread Types for v1 API
3
+ * Thread Types
4
4
  *
5
5
  * Re-exports thread types from `@tambo-ai/typescript-sdk` and defines
6
6
  * React-specific extensions for streaming state management.
@@ -1 +1 @@
1
- {"version":3,"file":"thread.js","sourceRoot":"","sources":["../../../src/v1/types/thread.ts"],"names":[],"mappings":";AAAA;;;;;GAKG","sourcesContent":["/**\n * Thread Types for v1 API\n *\n * Re-exports thread types from `@tambo-ai/typescript-sdk` and defines\n * React-specific extensions for streaming state management.\n */\n\nimport type { TamboV1Message } from \"./message\";\n\n// Re-export thread types from TypeScript SDK\nexport type {\n ThreadCreateResponse,\n ThreadRetrieveResponse,\n ThreadListResponse,\n} from \"@tambo-ai/typescript-sdk/resources/threads/threads\";\n\n/**\n * Run status indicates the current state of the thread\n */\nexport type RunStatus = \"idle\" | \"waiting\" | \"streaming\" | \"complete\" | \"error\";\n\n/**\n * Thread represents a conversation with the AI\n * Extended from SDK's ThreadRetrieveResponse with additional fields for React state\n */\nexport interface TamboV1Thread {\n /** Unique thread identifier */\n id: string;\n\n /** Thread title/name */\n title?: string;\n\n /** Messages in the thread */\n messages: TamboV1Message[];\n\n /** Current run status */\n status: RunStatus;\n\n /** Thread metadata */\n metadata?: Record<string, unknown>;\n\n /** When the thread was created */\n createdAt: string;\n\n /** When the thread was last updated */\n updatedAt: string;\n\n /** Whether the last run was cancelled (resets to false when a new run starts) */\n lastRunCancelled: boolean;\n}\n\n/**\n * Streaming state tracks the progress of an active run\n * This is React-specific and not part of the SDK\n */\nexport interface StreamingState {\n /** Current streaming status */\n status: RunStatus;\n\n /** Active run ID (if streaming) */\n runId?: string;\n\n /** Active message ID being streamed */\n messageId?: string;\n\n /** When the current run started */\n startTime?: number;\n\n /** When reasoning started (for duration calculation) */\n reasoningStartTime?: number;\n\n /** Error information if status is 'error' */\n error?: {\n message: string;\n code?: string;\n };\n}\n"]}
1
+ {"version":3,"file":"thread.js","sourceRoot":"","sources":["../../../src/v1/types/thread.ts"],"names":[],"mappings":";AAAA;;;;;GAKG","sourcesContent":["/**\n * Thread Types\n *\n * Re-exports thread types from `@tambo-ai/typescript-sdk` and defines\n * React-specific extensions for streaming state management.\n */\n\nimport type { TamboThreadMessage } from \"./message\";\n\n// Re-export thread types from TypeScript SDK\nexport type {\n ThreadCreateResponse,\n ThreadRetrieveResponse,\n ThreadListResponse,\n} from \"@tambo-ai/typescript-sdk/resources/threads/threads\";\n\n/**\n * Run status indicates the current state of the thread's run lifecycle.\n * Matches the API's RunStatus no \"complete\" or \"error\" variants.\n * Error information is tracked separately in StreamingState.error.\n */\nexport type RunStatus = \"idle\" | \"waiting\" | \"streaming\";\n\n/**\n * Thread represents a conversation with the AI\n * Extended from SDK's ThreadRetrieveResponse with additional fields for React state\n */\nexport interface TamboThread {\n /** Unique thread identifier */\n id: string;\n\n /** Thread name */\n name?: string;\n\n /** Messages in the thread */\n messages: TamboThreadMessage[];\n\n /** Current run status */\n status: RunStatus;\n\n /** Thread metadata */\n metadata?: Record<string, unknown>;\n\n /** When the thread was created */\n createdAt: string;\n\n /** When the thread was last updated */\n updatedAt: string;\n\n /** Whether the last run was cancelled (resets to false when a new run starts) */\n lastRunCancelled: boolean;\n}\n\n/**\n * Streaming state tracks the progress of an active run\n * This is React-specific and not part of the SDK\n */\nexport interface StreamingState {\n /** Current streaming status */\n status: RunStatus;\n\n /** Active run ID (if streaming) */\n runId?: string;\n\n /** Active message ID being streamed */\n messageId?: string;\n\n /** When the current run started */\n startTime?: number;\n\n /** When reasoning started (for duration calculation) */\n reasoningStartTime?: number;\n\n /** Error information if status is 'error' */\n error?: {\n message: string;\n code?: string;\n };\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Tool choice type matching the V1 API format.
2
+ * Tool choice type matching the API format.
3
3
  * Controls how the model selects tools during generation.
4
4
  */
5
5
  export type ToolChoice = "auto" | "required" | "none" | {