@tambo-ai/react 0.65.3 → 0.66.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (346) hide show
  1. package/README.md +120 -20
  2. package/dist/{providers/hoc → hoc}/with-tambo-interactable.d.ts +2 -2
  3. package/dist/hoc/with-tambo-interactable.d.ts.map +1 -0
  4. package/dist/{providers/hoc → hoc}/with-tambo-interactable.js +29 -2
  5. package/dist/hoc/with-tambo-interactable.js.map +1 -0
  6. package/dist/hoc/with-tambo-interactable.test.d.ts +2 -0
  7. package/dist/hoc/with-tambo-interactable.test.d.ts.map +1 -0
  8. package/dist/hoc/with-tambo-interactable.test.js +192 -0
  9. package/dist/hoc/with-tambo-interactable.test.js.map +1 -0
  10. package/dist/hooks/index.d.ts +1 -1
  11. package/dist/hooks/index.d.ts.map +1 -1
  12. package/dist/hooks/index.js +2 -1
  13. package/dist/hooks/index.js.map +1 -1
  14. package/dist/hooks/use-current-message.d.ts +51 -7
  15. package/dist/hooks/use-current-message.d.ts.map +1 -1
  16. package/dist/hooks/use-current-message.js +50 -6
  17. package/dist/hooks/use-current-message.js.map +1 -1
  18. package/dist/hooks/use-current-message.test.d.ts +2 -0
  19. package/dist/hooks/use-current-message.test.d.ts.map +1 -0
  20. package/dist/hooks/use-current-message.test.js +264 -0
  21. package/dist/hooks/use-current-message.test.js.map +1 -0
  22. package/dist/index.d.ts +10 -8
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +7 -3
  25. package/dist/index.js.map +1 -1
  26. package/dist/mcp/index.d.ts +1 -1
  27. package/dist/mcp/index.d.ts.map +1 -1
  28. package/dist/mcp/index.js +2 -1
  29. package/dist/mcp/index.js.map +1 -1
  30. package/dist/mcp/mcp-hooks.d.ts +77 -6
  31. package/dist/mcp/mcp-hooks.d.ts.map +1 -1
  32. package/dist/mcp/mcp-hooks.js +104 -40
  33. package/dist/mcp/mcp-hooks.js.map +1 -1
  34. package/dist/mcp/mcp-hooks.test.js +83 -18
  35. package/dist/mcp/mcp-hooks.test.js.map +1 -1
  36. package/dist/mcp/tambo-mcp-provider.d.ts.map +1 -1
  37. package/dist/mcp/tambo-mcp-provider.js +2 -1
  38. package/dist/mcp/tambo-mcp-provider.js.map +1 -1
  39. package/dist/model/component-metadata.d.ts +444 -14
  40. package/dist/model/component-metadata.d.ts.map +1 -1
  41. package/dist/model/component-metadata.js.map +1 -1
  42. package/dist/model/generate-component-response.d.ts +12 -1
  43. package/dist/model/generate-component-response.d.ts.map +1 -1
  44. package/dist/model/generate-component-response.js.map +1 -1
  45. package/dist/model/resource-info.d.ts +55 -0
  46. package/dist/model/resource-info.d.ts.map +1 -0
  47. package/dist/model/resource-info.js +3 -0
  48. package/dist/model/resource-info.js.map +1 -0
  49. package/dist/providers/index.d.ts +1 -1
  50. package/dist/providers/index.d.ts.map +1 -1
  51. package/dist/providers/index.js.map +1 -1
  52. package/dist/providers/tambo-component-provider.d.ts +4 -4
  53. package/dist/providers/tambo-component-provider.d.ts.map +1 -1
  54. package/dist/providers/tambo-component-provider.js.map +1 -1
  55. package/dist/providers/tambo-interactable-provider-partial-updates.test.js +87 -87
  56. package/dist/providers/tambo-interactable-provider-partial-updates.test.js.map +1 -1
  57. package/dist/providers/tambo-interactable-provider.d.ts +2 -3
  58. package/dist/providers/tambo-interactable-provider.d.ts.map +1 -1
  59. package/dist/providers/tambo-interactable-provider.js +47 -41
  60. package/dist/providers/tambo-interactable-provider.js.map +1 -1
  61. package/dist/providers/tambo-interactables-additional-context-edge-cases.test.js +9 -9
  62. package/dist/providers/tambo-interactables-additional-context-edge-cases.test.js.map +1 -1
  63. package/dist/providers/tambo-interactables-additional-context.test.js +11 -11
  64. package/dist/providers/tambo-interactables-additional-context.test.js.map +1 -1
  65. package/dist/providers/tambo-registry-provider.d.ts +28 -7
  66. package/dist/providers/tambo-registry-provider.d.ts.map +1 -1
  67. package/dist/providers/tambo-registry-provider.js +70 -181
  68. package/dist/providers/tambo-registry-provider.js.map +1 -1
  69. package/dist/providers/tambo-registry-provider.test.js +152 -30
  70. package/dist/providers/tambo-registry-provider.test.js.map +1 -1
  71. package/dist/providers/tambo-registry-schema-compat.test.d.ts +2 -0
  72. package/dist/providers/tambo-registry-schema-compat.test.d.ts.map +1 -0
  73. package/dist/providers/tambo-registry-schema-compat.test.js +616 -0
  74. package/dist/providers/tambo-registry-schema-compat.test.js.map +1 -0
  75. package/dist/providers/tambo-stubs.d.ts +2 -2
  76. package/dist/providers/tambo-stubs.d.ts.map +1 -1
  77. package/dist/providers/tambo-stubs.js +5 -0
  78. package/dist/providers/tambo-stubs.js.map +1 -1
  79. package/dist/providers/tambo-thread-input-provider.d.ts +1 -0
  80. package/dist/providers/tambo-thread-input-provider.d.ts.map +1 -1
  81. package/dist/providers/tambo-thread-input-provider.js +3 -3
  82. package/dist/providers/tambo-thread-input-provider.js.map +1 -1
  83. package/dist/providers/tambo-thread-provider.d.ts.map +1 -1
  84. package/dist/providers/tambo-thread-provider.js.map +1 -1
  85. package/dist/providers/tambo-thread-provider.test.js +32 -36
  86. package/dist/providers/tambo-thread-provider.test.js.map +1 -1
  87. package/dist/schema/index.d.ts +6 -0
  88. package/dist/schema/index.d.ts.map +1 -0
  89. package/dist/schema/index.js +18 -0
  90. package/dist/schema/index.js.map +1 -0
  91. package/dist/schema/json-schema.d.ts +35 -0
  92. package/dist/schema/json-schema.d.ts.map +1 -0
  93. package/dist/schema/json-schema.js +103 -0
  94. package/dist/schema/json-schema.js.map +1 -0
  95. package/dist/schema/schema.d.ts +66 -0
  96. package/dist/schema/schema.d.ts.map +1 -0
  97. package/dist/schema/schema.js +192 -0
  98. package/dist/schema/schema.js.map +1 -0
  99. package/dist/schema/schema.test.d.ts +2 -0
  100. package/dist/schema/schema.test.d.ts.map +1 -0
  101. package/dist/schema/schema.test.js +41 -0
  102. package/dist/schema/schema.test.js.map +1 -0
  103. package/dist/schema/standard-schema.d.ts +21 -0
  104. package/dist/schema/standard-schema.d.ts.map +1 -0
  105. package/dist/schema/standard-schema.js +37 -0
  106. package/dist/schema/standard-schema.js.map +1 -0
  107. package/dist/schema/validate.d.ts +14 -0
  108. package/dist/schema/validate.d.ts.map +1 -0
  109. package/dist/schema/validate.js +148 -0
  110. package/dist/schema/validate.js.map +1 -0
  111. package/dist/schema/validate.test.d.ts +2 -0
  112. package/dist/schema/validate.test.d.ts.map +1 -0
  113. package/dist/schema/validate.test.js +128 -0
  114. package/dist/schema/validate.test.js.map +1 -0
  115. package/dist/schema/zod.d.ts +54 -0
  116. package/dist/schema/zod.d.ts.map +1 -0
  117. package/dist/schema/zod.js +135 -0
  118. package/dist/schema/zod.js.map +1 -0
  119. package/dist/testing/tools.d.ts +29 -15
  120. package/dist/testing/tools.d.ts.map +1 -1
  121. package/dist/testing/tools.js +64 -19
  122. package/dist/testing/tools.js.map +1 -1
  123. package/dist/util/generate-component.d.ts.map +1 -1
  124. package/dist/util/generate-component.js +3 -3
  125. package/dist/util/generate-component.js.map +1 -1
  126. package/dist/util/mcp-server-utils.d.ts +23 -0
  127. package/dist/util/mcp-server-utils.d.ts.map +1 -0
  128. package/dist/util/mcp-server-utils.js +107 -0
  129. package/dist/util/mcp-server-utils.js.map +1 -0
  130. package/dist/util/mcp-server-utils.test.d.ts +2 -0
  131. package/dist/util/mcp-server-utils.test.d.ts.map +1 -0
  132. package/dist/util/mcp-server-utils.test.js +287 -0
  133. package/dist/util/mcp-server-utils.test.js.map +1 -0
  134. package/dist/util/message-builder.d.ts +2 -1
  135. package/dist/util/message-builder.d.ts.map +1 -1
  136. package/dist/util/message-builder.js +54 -36
  137. package/dist/util/message-builder.js.map +1 -1
  138. package/dist/util/message-builder.test.js +500 -13
  139. package/dist/util/message-builder.test.js.map +1 -1
  140. package/dist/util/registry-validators.d.ts +26 -0
  141. package/dist/util/registry-validators.d.ts.map +1 -0
  142. package/dist/util/registry-validators.js +105 -0
  143. package/dist/util/registry-validators.js.map +1 -0
  144. package/dist/util/registry-validators.test.d.ts +2 -0
  145. package/dist/util/registry-validators.test.d.ts.map +1 -0
  146. package/dist/util/registry-validators.test.js +235 -0
  147. package/dist/util/registry-validators.test.js.map +1 -0
  148. package/dist/util/registry.d.ts +35 -7
  149. package/dist/util/registry.d.ts.map +1 -1
  150. package/dist/util/registry.js +60 -77
  151. package/dist/util/registry.js.map +1 -1
  152. package/dist/util/registry.test.d.ts +2 -0
  153. package/dist/util/registry.test.d.ts.map +1 -0
  154. package/dist/util/registry.test.js +204 -0
  155. package/dist/util/registry.test.js.map +1 -0
  156. package/dist/util/resource-validators.d.ts +16 -0
  157. package/dist/util/resource-validators.d.ts.map +1 -0
  158. package/dist/util/resource-validators.js +34 -0
  159. package/dist/util/resource-validators.js.map +1 -0
  160. package/dist/util/tool-caller.d.ts +2 -2
  161. package/dist/util/tool-caller.d.ts.map +1 -1
  162. package/dist/util/tool-caller.js +12 -4
  163. package/dist/util/tool-caller.js.map +1 -1
  164. package/esm/{providers/hoc → hoc}/with-tambo-interactable.d.ts +2 -2
  165. package/esm/hoc/with-tambo-interactable.d.ts.map +1 -0
  166. package/esm/{providers/hoc → hoc}/with-tambo-interactable.js +29 -2
  167. package/esm/hoc/with-tambo-interactable.js.map +1 -0
  168. package/esm/hoc/with-tambo-interactable.test.d.ts +2 -0
  169. package/esm/hoc/with-tambo-interactable.test.d.ts.map +1 -0
  170. package/esm/hoc/with-tambo-interactable.test.js +187 -0
  171. package/esm/hoc/with-tambo-interactable.test.js.map +1 -0
  172. package/esm/hooks/index.d.ts +1 -1
  173. package/esm/hooks/index.d.ts.map +1 -1
  174. package/esm/hooks/index.js +1 -1
  175. package/esm/hooks/index.js.map +1 -1
  176. package/esm/hooks/use-current-message.d.ts +51 -7
  177. package/esm/hooks/use-current-message.d.ts.map +1 -1
  178. package/esm/hooks/use-current-message.js +48 -5
  179. package/esm/hooks/use-current-message.js.map +1 -1
  180. package/esm/hooks/use-current-message.test.d.ts +2 -0
  181. package/esm/hooks/use-current-message.test.d.ts.map +1 -0
  182. package/esm/hooks/use-current-message.test.js +259 -0
  183. package/esm/hooks/use-current-message.test.js.map +1 -0
  184. package/esm/index.d.ts +10 -8
  185. package/esm/index.d.ts.map +1 -1
  186. package/esm/index.js +4 -2
  187. package/esm/index.js.map +1 -1
  188. package/esm/mcp/index.d.ts +1 -1
  189. package/esm/mcp/index.d.ts.map +1 -1
  190. package/esm/mcp/index.js +1 -1
  191. package/esm/mcp/index.js.map +1 -1
  192. package/esm/mcp/mcp-hooks.d.ts +77 -6
  193. package/esm/mcp/mcp-hooks.d.ts.map +1 -1
  194. package/esm/mcp/mcp-hooks.js +103 -40
  195. package/esm/mcp/mcp-hooks.js.map +1 -1
  196. package/esm/mcp/mcp-hooks.test.js +84 -19
  197. package/esm/mcp/mcp-hooks.test.js.map +1 -1
  198. package/esm/mcp/tambo-mcp-provider.d.ts.map +1 -1
  199. package/esm/mcp/tambo-mcp-provider.js +2 -1
  200. package/esm/mcp/tambo-mcp-provider.js.map +1 -1
  201. package/esm/model/component-metadata.d.ts +444 -14
  202. package/esm/model/component-metadata.d.ts.map +1 -1
  203. package/esm/model/component-metadata.js.map +1 -1
  204. package/esm/model/generate-component-response.d.ts +12 -1
  205. package/esm/model/generate-component-response.d.ts.map +1 -1
  206. package/esm/model/generate-component-response.js.map +1 -1
  207. package/esm/model/resource-info.d.ts +55 -0
  208. package/esm/model/resource-info.d.ts.map +1 -0
  209. package/esm/model/resource-info.js +2 -0
  210. package/esm/model/resource-info.js.map +1 -0
  211. package/esm/providers/index.d.ts +1 -1
  212. package/esm/providers/index.d.ts.map +1 -1
  213. package/esm/providers/index.js.map +1 -1
  214. package/esm/providers/tambo-component-provider.d.ts +4 -4
  215. package/esm/providers/tambo-component-provider.d.ts.map +1 -1
  216. package/esm/providers/tambo-component-provider.js.map +1 -1
  217. package/esm/providers/tambo-interactable-provider-partial-updates.test.js +1 -1
  218. package/esm/providers/tambo-interactable-provider-partial-updates.test.js.map +1 -1
  219. package/esm/providers/tambo-interactable-provider.d.ts +2 -3
  220. package/esm/providers/tambo-interactable-provider.d.ts.map +1 -1
  221. package/esm/providers/tambo-interactable-provider.js +44 -38
  222. package/esm/providers/tambo-interactable-provider.js.map +1 -1
  223. package/esm/providers/tambo-interactables-additional-context-edge-cases.test.js +3 -3
  224. package/esm/providers/tambo-interactables-additional-context-edge-cases.test.js.map +1 -1
  225. package/esm/providers/tambo-interactables-additional-context.test.js +3 -3
  226. package/esm/providers/tambo-interactables-additional-context.test.js.map +1 -1
  227. package/esm/providers/tambo-registry-provider.d.ts +28 -7
  228. package/esm/providers/tambo-registry-provider.d.ts.map +1 -1
  229. package/esm/providers/tambo-registry-provider.js +67 -175
  230. package/esm/providers/tambo-registry-provider.js.map +1 -1
  231. package/esm/providers/tambo-registry-provider.test.js +148 -26
  232. package/esm/providers/tambo-registry-provider.test.js.map +1 -1
  233. package/esm/providers/tambo-registry-schema-compat.test.d.ts +2 -0
  234. package/esm/providers/tambo-registry-schema-compat.test.d.ts.map +1 -0
  235. package/esm/providers/tambo-registry-schema-compat.test.js +578 -0
  236. package/esm/providers/tambo-registry-schema-compat.test.js.map +1 -0
  237. package/esm/providers/tambo-stubs.d.ts +2 -2
  238. package/esm/providers/tambo-stubs.d.ts.map +1 -1
  239. package/esm/providers/tambo-stubs.js +5 -0
  240. package/esm/providers/tambo-stubs.js.map +1 -1
  241. package/esm/providers/tambo-thread-input-provider.d.ts +1 -0
  242. package/esm/providers/tambo-thread-input-provider.d.ts.map +1 -1
  243. package/esm/providers/tambo-thread-input-provider.js +3 -3
  244. package/esm/providers/tambo-thread-input-provider.js.map +1 -1
  245. package/esm/providers/tambo-thread-provider.d.ts.map +1 -1
  246. package/esm/providers/tambo-thread-provider.js.map +1 -1
  247. package/esm/providers/tambo-thread-provider.test.js +24 -28
  248. package/esm/providers/tambo-thread-provider.test.js.map +1 -1
  249. package/esm/schema/index.d.ts +6 -0
  250. package/esm/schema/index.d.ts.map +1 -0
  251. package/esm/schema/index.js +6 -0
  252. package/esm/schema/index.js.map +1 -0
  253. package/esm/schema/json-schema.d.ts +35 -0
  254. package/esm/schema/json-schema.d.ts.map +1 -0
  255. package/esm/schema/json-schema.js +98 -0
  256. package/esm/schema/json-schema.js.map +1 -0
  257. package/esm/schema/schema.d.ts +66 -0
  258. package/esm/schema/schema.d.ts.map +1 -0
  259. package/esm/schema/schema.js +185 -0
  260. package/esm/schema/schema.js.map +1 -0
  261. package/esm/schema/schema.test.d.ts +2 -0
  262. package/esm/schema/schema.test.d.ts.map +1 -0
  263. package/esm/schema/schema.test.js +39 -0
  264. package/esm/schema/schema.test.js.map +1 -0
  265. package/esm/schema/standard-schema.d.ts +21 -0
  266. package/esm/schema/standard-schema.d.ts.map +1 -0
  267. package/esm/schema/standard-schema.js +34 -0
  268. package/esm/schema/standard-schema.js.map +1 -0
  269. package/esm/schema/validate.d.ts +14 -0
  270. package/esm/schema/validate.d.ts.map +1 -0
  271. package/esm/schema/validate.js +145 -0
  272. package/esm/schema/validate.js.map +1 -0
  273. package/esm/schema/validate.test.d.ts +2 -0
  274. package/esm/schema/validate.test.d.ts.map +1 -0
  275. package/esm/schema/validate.test.js +126 -0
  276. package/esm/schema/validate.test.js.map +1 -0
  277. package/esm/schema/zod.d.ts +54 -0
  278. package/esm/schema/zod.d.ts.map +1 -0
  279. package/esm/schema/zod.js +124 -0
  280. package/esm/schema/zod.js.map +1 -0
  281. package/esm/testing/tools.d.ts +29 -15
  282. package/esm/testing/tools.d.ts.map +1 -1
  283. package/esm/testing/tools.js +62 -16
  284. package/esm/testing/tools.js.map +1 -1
  285. package/esm/util/generate-component.d.ts.map +1 -1
  286. package/esm/util/generate-component.js +3 -3
  287. package/esm/util/generate-component.js.map +1 -1
  288. package/esm/util/mcp-server-utils.d.ts +23 -0
  289. package/esm/util/mcp-server-utils.d.ts.map +1 -0
  290. package/esm/util/mcp-server-utils.js +102 -0
  291. package/esm/util/mcp-server-utils.js.map +1 -0
  292. package/esm/util/mcp-server-utils.test.d.ts +2 -0
  293. package/esm/util/mcp-server-utils.test.d.ts.map +1 -0
  294. package/esm/util/mcp-server-utils.test.js +285 -0
  295. package/esm/util/mcp-server-utils.test.js.map +1 -0
  296. package/esm/util/message-builder.d.ts +2 -1
  297. package/esm/util/message-builder.d.ts.map +1 -1
  298. package/esm/util/message-builder.js +54 -36
  299. package/esm/util/message-builder.js.map +1 -1
  300. package/esm/util/message-builder.test.js +500 -13
  301. package/esm/util/message-builder.test.js.map +1 -1
  302. package/esm/util/registry-validators.d.ts +26 -0
  303. package/esm/util/registry-validators.d.ts.map +1 -0
  304. package/esm/util/registry-validators.js +100 -0
  305. package/esm/util/registry-validators.js.map +1 -0
  306. package/esm/util/registry-validators.test.d.ts +2 -0
  307. package/esm/util/registry-validators.test.d.ts.map +1 -0
  308. package/esm/util/registry-validators.test.js +233 -0
  309. package/esm/util/registry-validators.test.js.map +1 -0
  310. package/esm/util/registry.d.ts +35 -7
  311. package/esm/util/registry.d.ts.map +1 -1
  312. package/esm/util/registry.js +57 -73
  313. package/esm/util/registry.js.map +1 -1
  314. package/esm/util/registry.test.d.ts +2 -0
  315. package/esm/util/registry.test.d.ts.map +1 -0
  316. package/esm/util/registry.test.js +169 -0
  317. package/esm/util/registry.test.js.map +1 -0
  318. package/esm/util/resource-validators.d.ts +16 -0
  319. package/esm/util/resource-validators.d.ts.map +1 -0
  320. package/esm/util/resource-validators.js +30 -0
  321. package/esm/util/resource-validators.js.map +1 -0
  322. package/esm/util/tool-caller.d.ts +2 -2
  323. package/esm/util/tool-caller.d.ts.map +1 -1
  324. package/esm/util/tool-caller.js +12 -4
  325. package/esm/util/tool-caller.js.map +1 -1
  326. package/package.json +13 -8
  327. package/dist/providers/hoc/with-tambo-interactable.d.ts.map +0 -1
  328. package/dist/providers/hoc/with-tambo-interactable.js.map +0 -1
  329. package/dist/util/validate-zod-schema.d.ts +0 -10
  330. package/dist/util/validate-zod-schema.d.ts.map +0 -1
  331. package/dist/util/validate-zod-schema.js +0 -100
  332. package/dist/util/validate-zod-schema.js.map +0 -1
  333. package/dist/util/validate-zod-schema.test.d.ts +0 -2
  334. package/dist/util/validate-zod-schema.test.d.ts.map +0 -1
  335. package/dist/util/validate-zod-schema.test.js +0 -96
  336. package/dist/util/validate-zod-schema.test.js.map +0 -1
  337. package/esm/providers/hoc/with-tambo-interactable.d.ts.map +0 -1
  338. package/esm/providers/hoc/with-tambo-interactable.js.map +0 -1
  339. package/esm/util/validate-zod-schema.d.ts +0 -10
  340. package/esm/util/validate-zod-schema.d.ts.map +0 -1
  341. package/esm/util/validate-zod-schema.js +0 -97
  342. package/esm/util/validate-zod-schema.js.map +0 -1
  343. package/esm/util/validate-zod-schema.test.d.ts +0 -2
  344. package/esm/util/validate-zod-schema.test.d.ts.map +0 -1
  345. package/esm/util/validate-zod-schema.test.js +0 -94
  346. package/esm/util/validate-zod-schema.test.js.map +0 -1
@@ -0,0 +1,55 @@
1
+ import type { ListResourcesResult, ReadResourceResult } from "@modelcontextprotocol/sdk/types.js";
2
+ /**
3
+ * A single resource item from the MCP SDK listResources response.
4
+ * Re-exported for convenience when registering static resources.
5
+ */
6
+ export type ListResourceItem = ListResourcesResult["resources"][number];
7
+ export type { ReadResourceResult };
8
+ /**
9
+ * Configuration for a dynamic resource source that can search and fetch resources.
10
+ *
11
+ * Both `listResources` and `getResource` must be provided together - you cannot
12
+ * provide one without the other.
13
+ * @example
14
+ * ```typescript
15
+ * const resourceSource: ResourceSource = {
16
+ * listResources: async (search) => {
17
+ * const allResources = await fetchMyResources();
18
+ * return search
19
+ * ? allResources.filter(r => r.name.includes(search))
20
+ * : allResources;
21
+ * },
22
+ * getResource: async (uri, args) => {
23
+ * const content = await fetchResourceContent(uri, args);
24
+ * return {
25
+ * contents: [{
26
+ * uri,
27
+ * mimeType: 'text/plain',
28
+ * text: content,
29
+ * }],
30
+ * };
31
+ * },
32
+ * };
33
+ * ```
34
+ */
35
+ export interface ResourceSource {
36
+ /**
37
+ * Lists available resources, optionally filtered by a search string.
38
+ * @param search - Optional search string to filter resources
39
+ * @returns Promise resolving to an array of resource items
40
+ */
41
+ listResources: (search?: string) => Promise<ListResourceItem[]>;
42
+ /**
43
+ * Fetches the content of a specific resource by URI.
44
+ *
45
+ * Note: `getResource` may be invoked for URIs that have not previously
46
+ * been returned by `listResources` (for example, when the caller already
47
+ * knows a concrete URI). Implementations should handle unknown URIs
48
+ * gracefully rather than assuming they were listed first.
49
+ * @param uri - The URI of the resource to fetch
50
+ * @param args - Optional arguments to pass to the resource fetch
51
+ * @returns Promise resolving to the resource content
52
+ */
53
+ getResource: (uri: string, args?: Record<string, unknown>) => Promise<ReadResourceResult>;
54
+ }
55
+ //# sourceMappingURL=resource-info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-info.d.ts","sourceRoot":"","sources":["../../src/model/resource-info.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,oCAAoC,CAAC;AAE5C;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAIxE,YAAY,EAAE,kBAAkB,EAAE,CAAC;AAEnC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,aAAa,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAEhE;;;;;;;;;;OAUG;IACH,WAAW,EAAE,CACX,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC3B,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAClC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=resource-info.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-info.js","sourceRoot":"","sources":["../../src/model/resource-info.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n ListResourcesResult,\n ReadResourceResult,\n} from \"@modelcontextprotocol/sdk/types.js\";\n\n/**\n * A single resource item from the MCP SDK listResources response.\n * Re-exported for convenience when registering static resources.\n */\nexport type ListResourceItem = ListResourcesResult[\"resources\"][number];\n\n// Re-export the MCP SDK ReadResourceResult type so consumers can depend on\n// a stable SDK surface without importing directly from the MCP package.\nexport type { ReadResourceResult };\n\n/**\n * Configuration for a dynamic resource source that can search and fetch resources.\n *\n * Both `listResources` and `getResource` must be provided together - you cannot\n * provide one without the other.\n * @example\n * ```typescript\n * const resourceSource: ResourceSource = {\n * listResources: async (search) => {\n * const allResources = await fetchMyResources();\n * return search\n * ? allResources.filter(r => r.name.includes(search))\n * : allResources;\n * },\n * getResource: async (uri, args) => {\n * const content = await fetchResourceContent(uri, args);\n * return {\n * contents: [{\n * uri,\n * mimeType: 'text/plain',\n * text: content,\n * }],\n * };\n * },\n * };\n * ```\n */\nexport interface ResourceSource {\n /**\n * Lists available resources, optionally filtered by a search string.\n * @param search - Optional search string to filter resources\n * @returns Promise resolving to an array of resource items\n */\n listResources: (search?: string) => Promise<ListResourceItem[]>;\n\n /**\n * Fetches the content of a specific resource by URI.\n *\n * Note: `getResource` may be invoked for URIs that have not previously\n * been returned by `listResources` (for example, when the caller already\n * knows a concrete URI). Implementations should handle unknown URIs\n * gracefully rather than assuming they were listed first.\n * @param uri - The URI of the resource to fetch\n * @param args - Optional arguments to pass to the resource fetch\n * @returns Promise resolving to the resource content\n */\n getResource: (\n uri: string,\n args?: Record<string, unknown>,\n ) => Promise<ReadResourceResult>;\n}\n"]}
@@ -1,4 +1,4 @@
1
- export type { TamboComponent, TamboTool } from "../model/component-metadata";
1
+ export type { RegisterToolFn, RegisterToolsFn, TamboComponent, TamboTool, } from "../model/component-metadata";
2
2
  export { TamboClientProvider, useIsTamboTokenUpdating, useTamboClient, } from "./tambo-client-provider";
3
3
  export { TamboComponentProvider, useTamboComponent, } from "./tambo-component-provider";
4
4
  export { TamboContextAttachmentProvider, useTamboContextAttachment, type ContextAttachment, type ContextAttachmentState, type ContextHelperData, type TamboContextAttachmentProviderProps, } from "./tambo-context-attachment-provider";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,8BAA8B,EAC9B,yBAAyB,EACzB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,mCAAmC,GACzC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,EACtB,KAAK,+BAA+B,EACpC,KAAK,gCAAgC,GACtC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,OAAO,EACP,SAAS,EACT,OAAO,EACP,uBAAuB,EACvB,cAAc,GACf,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,yBAAyB,EACzB,YAAY,EACZ,2BAA2B,GAC5B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,gBAAgB,EAChB,KAAK,oBAAoB,GAC1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,KAAK,4BAA4B,GAClC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,EACd,KAAK,wBAAwB,GAC9B,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,cAAc,EACd,eAAe,EACf,cAAc,EACd,SAAS,GACV,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,8BAA8B,EAC9B,yBAAyB,EACzB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,mCAAmC,GACzC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,EACtB,KAAK,+BAA+B,EACpC,KAAK,gCAAgC,GACtC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,OAAO,EACP,SAAS,EACT,OAAO,EACP,uBAAuB,EACvB,cAAc,GACf,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,yBAAyB,EACzB,YAAY,EACZ,2BAA2B,GAC5B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,gBAAgB,EAChB,KAAK,oBAAoB,GAC1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,KAAK,4BAA4B,GAClC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,EACd,KAAK,wBAAwB,GAC9B,MAAM,yBAAyB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,8BAA8B,EAC9B,yBAAyB,GAK1B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,GAGvB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,OAAO,EACP,SAAS,EACT,OAAO,EACP,uBAAuB,EACvB,cAAc,GACf,MAAM,8BAA8B,CAAC;AAMtC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,gBAAgB,GAEjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAA+B,MAAM,eAAe,CAAC;AAC/E,OAAO,EACL,wBAAwB,EACxB,mBAAmB,GAEpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,GAEf,MAAM,yBAAyB,CAAC","sourcesContent":["export type { TamboComponent, TamboTool } from \"../model/component-metadata\";\nexport {\n TamboClientProvider,\n useIsTamboTokenUpdating,\n useTamboClient,\n} from \"./tambo-client-provider\";\nexport {\n TamboComponentProvider,\n useTamboComponent,\n} from \"./tambo-component-provider\";\nexport {\n TamboContextAttachmentProvider,\n useTamboContextAttachment,\n type ContextAttachment,\n type ContextAttachmentState,\n type ContextHelperData,\n type TamboContextAttachmentProviderProps,\n} from \"./tambo-context-attachment-provider\";\nexport {\n TamboContextHelpersProvider,\n useTamboContextHelpers,\n type TamboContextHelpersContextProps,\n type TamboContextHelpersProviderProps,\n} from \"./tambo-context-helpers-provider\";\nexport {\n Pending,\n Streaming,\n Success,\n TamboPropStreamProvider,\n useTamboStream,\n} from \"./tambo-prop-stream-provider\";\nexport type {\n StreamStateComponentProps,\n StreamStatus,\n TamboPropStreamContextValue,\n} from \"./tambo-prop-stream-provider\";\nexport { TamboContext, TamboProvider, useTambo } from \"./tambo-provider\";\nexport {\n TamboRegistryProvider,\n useTamboMcpServerInfos,\n useTamboRegistry,\n type TamboRegistryContext,\n} from \"./tambo-registry-provider\";\nexport { TamboStubProvider, type TamboStubProviderProps } from \"./tambo-stubs\";\nexport {\n TamboThreadInputProvider,\n useTamboThreadInput,\n type TamboThreadInputContextProps,\n} from \"./tambo-thread-input-provider\";\nexport {\n TamboThreadContext,\n TamboThreadProvider,\n useTamboGenerationStage,\n useTamboThread,\n type TamboThreadProviderProps,\n} from \"./tambo-thread-provider\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,8BAA8B,EAC9B,yBAAyB,GAK1B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,GAGvB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,OAAO,EACP,SAAS,EACT,OAAO,EACP,uBAAuB,EACvB,cAAc,GACf,MAAM,8BAA8B,CAAC;AAMtC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,gBAAgB,GAEjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAA+B,MAAM,eAAe,CAAC;AAC/E,OAAO,EACL,wBAAwB,EACxB,mBAAmB,GAEpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,GAEf,MAAM,yBAAyB,CAAC","sourcesContent":["export type {\n RegisterToolFn,\n RegisterToolsFn,\n TamboComponent,\n TamboTool,\n} from \"../model/component-metadata\";\nexport {\n TamboClientProvider,\n useIsTamboTokenUpdating,\n useTamboClient,\n} from \"./tambo-client-provider\";\nexport {\n TamboComponentProvider,\n useTamboComponent,\n} from \"./tambo-component-provider\";\nexport {\n TamboContextAttachmentProvider,\n useTamboContextAttachment,\n type ContextAttachment,\n type ContextAttachmentState,\n type ContextHelperData,\n type TamboContextAttachmentProviderProps,\n} from \"./tambo-context-attachment-provider\";\nexport {\n TamboContextHelpersProvider,\n useTamboContextHelpers,\n type TamboContextHelpersContextProps,\n type TamboContextHelpersProviderProps,\n} from \"./tambo-context-helpers-provider\";\nexport {\n Pending,\n Streaming,\n Success,\n TamboPropStreamProvider,\n useTamboStream,\n} from \"./tambo-prop-stream-provider\";\nexport type {\n StreamStateComponentProps,\n StreamStatus,\n TamboPropStreamContextValue,\n} from \"./tambo-prop-stream-provider\";\nexport { TamboContext, TamboProvider, useTambo } from \"./tambo-provider\";\nexport {\n TamboRegistryProvider,\n useTamboMcpServerInfos,\n useTamboRegistry,\n type TamboRegistryContext,\n} from \"./tambo-registry-provider\";\nexport { TamboStubProvider, type TamboStubProviderProps } from \"./tambo-stubs\";\nexport {\n TamboThreadInputProvider,\n useTamboThreadInput,\n type TamboThreadInputContextProps,\n} from \"./tambo-thread-input-provider\";\nexport {\n TamboThreadContext,\n TamboThreadProvider,\n useTamboGenerationStage,\n useTamboThread,\n type TamboThreadProviderProps,\n} from \"./tambo-thread-provider\";\n"]}
@@ -1,10 +1,10 @@
1
1
  import React, { PropsWithChildren } from "react";
2
- import { TamboComponent, TamboTool } from "../model/component-metadata";
2
+ import { RegisterToolFn, RegisterToolsFn, TamboComponent, TamboTool, TamboToolWithToolSchema } from "../model/component-metadata";
3
3
  export interface TamboComponentContextProps {
4
4
  registerComponent: (options: TamboComponent) => void;
5
- registerTool: (tool: TamboTool) => void;
6
- registerTools: (tools: TamboTool[]) => void;
7
- addToolAssociation: (componentName: string, tool: TamboTool) => void;
5
+ registerTool: RegisterToolFn;
6
+ registerTools: RegisterToolsFn;
7
+ addToolAssociation: (componentName: string, tool: TamboTool | TamboToolWithToolSchema) => void;
8
8
  }
9
9
  /**
10
10
  * The TamboComponentProvider is a React provider that provides component
@@ -1 +1 @@
1
- {"version":3,"file":"tambo-component-provider.d.ts","sourceRoot":"","sources":["../../src/providers/tambo-component-provider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAiB,iBAAiB,EAAc,MAAM,OAAO,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAIxE,MAAM,WAAW,0BAA0B;IACzC,iBAAiB,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IACrD,YAAY,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IACxC,aAAa,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,IAAI,CAAC;IAC5C,kBAAkB,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;CACtE;AAqBD;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAoB9D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,kCAE7B,CAAC"}
1
+ {"version":3,"file":"tambo-component-provider.d.ts","sourceRoot":"","sources":["../../src/providers/tambo-component-provider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAiB,iBAAiB,EAAc,MAAM,OAAO,CAAC;AAC5E,OAAO,EACL,cAAc,EACd,eAAe,EACf,cAAc,EACd,SAAS,EACT,uBAAuB,EACxB,MAAM,6BAA6B,CAAC;AAIrC,MAAM,WAAW,0BAA0B;IACzC,iBAAiB,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IACrD,YAAY,EAAE,cAAc,CAAC;IAC7B,aAAa,EAAE,eAAe,CAAC;IAC/B,kBAAkB,EAAE,CAClB,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,SAAS,GAAG,uBAAuB,KACtC,IAAI,CAAC;CACX;AAqBD;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAoB9D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,kCAE7B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"tambo-component-provider.js","sourceRoot":"","sources":["../../src/providers/tambo-component-provider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,KAAK,EAAE,EAAE,aAAa,EAAqB,UAAU,EAAE,MAAM,OAAO,CAAC;AAE5E,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAS7D,MAAM,qBAAqB,GAAG,aAAa,CAA6B;IACtE;;OAEG;IACH,iBAAiB,EAAE,GAAG,EAAE,GAAE,CAAC;IAC3B;;OAEG;IACH,YAAY,EAAE,GAAG,EAAE,GAAE,CAAC;IACtB;;OAEG;IACH,aAAa,EAAE,GAAG,EAAE,GAAE,CAAC;IACvB;;OAEG;IACH,kBAAkB,EAAE,GAAG,EAAE,GAAE,CAAC;CAC7B,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAgC,CAAC,EAClE,QAAQ,GACT,EAAE,EAAE;IACH,MAAM,MAAM,GAAG,cAAc,EAAE,CAAC;IAChC,MAAM,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,YAAY,EAAE,aAAa,EAAE,GAC1E,gBAAgB,EAAE,CAAC;IAErB,MAAM,KAAK,GAAG;QACZ,MAAM;QACN,iBAAiB;QACjB,YAAY;QACZ,aAAa;QACb,kBAAkB;KACnB,CAAC;IAEF,OAAO,CACL,oBAAC,qBAAqB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,IACzC,QAAQ,CACsB,CAClC,CAAC;AACJ,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE;IACpC,OAAO,UAAU,CAAC,qBAAqB,CAAC,CAAC;AAC3C,CAAC,CAAC","sourcesContent":["\"use client\";\nimport React, { createContext, PropsWithChildren, useContext } from \"react\";\nimport { TamboComponent, TamboTool } from \"../model/component-metadata\";\nimport { useTamboClient } from \"./tambo-client-provider\";\nimport { useTamboRegistry } from \"./tambo-registry-provider\";\n\nexport interface TamboComponentContextProps {\n registerComponent: (options: TamboComponent) => void;\n registerTool: (tool: TamboTool) => void;\n registerTools: (tools: TamboTool[]) => void;\n addToolAssociation: (componentName: string, tool: TamboTool) => void;\n}\n\nconst TamboComponentContext = createContext<TamboComponentContextProps>({\n /**\n *\n */\n registerComponent: () => {},\n /**\n *\n */\n registerTool: () => {},\n /**\n *\n */\n registerTools: () => {},\n /**\n *\n */\n addToolAssociation: () => {},\n});\n\n/**\n * The TamboComponentProvider is a React provider that provides component\n * registration services to the descendants of the provider.\n * @param props - The props for the TamboComponentProvider\n * @param props.children - The children to wrap\n * @returns The TamboComponentProvider component\n */\nexport const TamboComponentProvider: React.FC<PropsWithChildren> = ({\n children,\n}) => {\n const client = useTamboClient();\n const { registerComponent, addToolAssociation, registerTool, registerTools } =\n useTamboRegistry();\n\n const value = {\n client,\n registerComponent,\n registerTool,\n registerTools,\n addToolAssociation,\n };\n\n return (\n <TamboComponentContext.Provider value={value}>\n {children}\n </TamboComponentContext.Provider>\n );\n};\n\n/**\n * The useTamboComponent hook provides access to the component registration\n * services to the descendants of the TamboComponentProvider.\n * @returns The component registration services\n */\nexport const useTamboComponent = () => {\n return useContext(TamboComponentContext);\n};\n"]}
1
+ {"version":3,"file":"tambo-component-provider.js","sourceRoot":"","sources":["../../src/providers/tambo-component-provider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,KAAK,EAAE,EAAE,aAAa,EAAqB,UAAU,EAAE,MAAM,OAAO,CAAC;AAQ5E,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAY7D,MAAM,qBAAqB,GAAG,aAAa,CAA6B;IACtE;;OAEG;IACH,iBAAiB,EAAE,GAAG,EAAE,GAAE,CAAC;IAC3B;;OAEG;IACH,YAAY,EAAE,GAAG,EAAE,GAAE,CAAC;IACtB;;OAEG;IACH,aAAa,EAAE,GAAG,EAAE,GAAE,CAAC;IACvB;;OAEG;IACH,kBAAkB,EAAE,GAAG,EAAE,GAAE,CAAC;CAC7B,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAgC,CAAC,EAClE,QAAQ,GACT,EAAE,EAAE;IACH,MAAM,MAAM,GAAG,cAAc,EAAE,CAAC;IAChC,MAAM,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,YAAY,EAAE,aAAa,EAAE,GAC1E,gBAAgB,EAAE,CAAC;IAErB,MAAM,KAAK,GAAG;QACZ,MAAM;QACN,iBAAiB;QACjB,YAAY;QACZ,aAAa;QACb,kBAAkB;KACnB,CAAC;IAEF,OAAO,CACL,oBAAC,qBAAqB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,IACzC,QAAQ,CACsB,CAClC,CAAC;AACJ,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE;IACpC,OAAO,UAAU,CAAC,qBAAqB,CAAC,CAAC;AAC3C,CAAC,CAAC","sourcesContent":["\"use client\";\nimport React, { createContext, PropsWithChildren, useContext } from \"react\";\nimport {\n RegisterToolFn,\n RegisterToolsFn,\n TamboComponent,\n TamboTool,\n TamboToolWithToolSchema,\n} from \"../model/component-metadata\";\nimport { useTamboClient } from \"./tambo-client-provider\";\nimport { useTamboRegistry } from \"./tambo-registry-provider\";\n\nexport interface TamboComponentContextProps {\n registerComponent: (options: TamboComponent) => void;\n registerTool: RegisterToolFn;\n registerTools: RegisterToolsFn;\n addToolAssociation: (\n componentName: string,\n tool: TamboTool | TamboToolWithToolSchema,\n ) => void;\n}\n\nconst TamboComponentContext = createContext<TamboComponentContextProps>({\n /**\n *\n */\n registerComponent: () => {},\n /**\n *\n */\n registerTool: () => {},\n /**\n *\n */\n registerTools: () => {},\n /**\n *\n */\n addToolAssociation: () => {},\n});\n\n/**\n * The TamboComponentProvider is a React provider that provides component\n * registration services to the descendants of the provider.\n * @param props - The props for the TamboComponentProvider\n * @param props.children - The children to wrap\n * @returns The TamboComponentProvider component\n */\nexport const TamboComponentProvider: React.FC<PropsWithChildren> = ({\n children,\n}) => {\n const client = useTamboClient();\n const { registerComponent, addToolAssociation, registerTool, registerTools } =\n useTamboRegistry();\n\n const value = {\n client,\n registerComponent,\n registerTool,\n registerTools,\n addToolAssociation,\n };\n\n return (\n <TamboComponentContext.Provider value={value}>\n {children}\n </TamboComponentContext.Provider>\n );\n};\n\n/**\n * The useTamboComponent hook provides access to the component registration\n * services to the descendants of the TamboComponentProvider.\n * @returns The component registration services\n */\nexport const useTamboComponent = () => {\n return useContext(TamboComponentContext);\n};\n"]}
@@ -1,6 +1,6 @@
1
1
  import { act, renderHook } from "@testing-library/react";
2
2
  import React from "react";
3
- import { z } from "zod/v3";
3
+ import { z } from "zodInternalAlias";
4
4
  import { TamboInteractableProvider, useTamboInteractable, } from "./tambo-interactable-provider";
5
5
  // Mock the context helpers
6
6
  const mockAddContextHelper = jest.fn();
@@ -1 +1 @@
1
- {"version":3,"file":"tambo-interactable-provider-partial-updates.test.js","sourceRoot":"","sources":["../../src/providers/tambo-interactable-provider-partial-updates.test.tsx"],"names":[],"mappings":"AAAA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AEH,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;gBAC7D,KAAK,EAAE,gBAAgB;gBACvB,MAAM,EAAE;oBACN,4DAA4D;oBAC5D,QAAQ,EAAE;wBACR,qEAAqE;wBACrE,YAAY,EAAE;4BACZ,IAAI,EAAE,IAAI,EAAE,UAAU;4BACtB,8CAA8C;yBAC/C;qBACF;iBACF;aACF,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { act, renderHook } from \"@testing-library/react\";\nimport React from \"react\";\nimport { z } from \"zod/v3\";\nimport { TamboInteractableComponent } from \"../model/tambo-interactable\";\nimport {\n TamboInteractableProvider,\n useTamboInteractable,\n} from \"./tambo-interactable-provider\";\n\n// Mock the context helpers\nconst mockAddContextHelper = jest.fn();\nconst mockRemoveContextHelper = jest.fn();\n\njest.mock(\"./tambo-context-helpers-provider\", () => ({\n TamboContextHelpersProvider: ({\n children,\n }: {\n children: React.ReactNode;\n }) => <>{children}</>,\n useTamboContextHelpers: () => ({\n addContextHelper: mockAddContextHelper,\n removeContextHelper: mockRemoveContextHelper,\n }),\n}));\n\n// Mock the component provider\nconst mockRegisterTool = jest.fn();\n\njest.mock(\"./tambo-component-provider\", () => ({\n useTamboComponent: () => ({\n registerTool: mockRegisterTool,\n }),\n}));\n\n// Mock the context helper creation\njest.mock(\"../context-helpers/current-interactables-context-helper\", () => ({\n createInteractablesContextHelper: () =>\n jest.fn(() => ({\n name: \"interactables\",\n context: {\n description: \"Test interactables context\",\n components: [],\n },\n })),\n}));\n\ndescribe(\"updateInteractableComponentProps - Partial Updates\", () => {\n beforeEach(() => {\n jest.clearAllMocks();\n });\n\n const wrapper = ({ children }: { children: React.ReactNode }) => (\n <TamboInteractableProvider>{children}</TamboInteractableProvider>\n );\n\n describe(\"Partial Updates Functionality\", () => {\n it(\"should apply partial updates to existing props\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n const component: Omit<TamboInteractableComponent, \"id\" | \"createdAt\"> = {\n name: \"TestComponent\",\n description: \"A test component\",\n component: () => <div>Test</div>,\n props: {\n title: \"Original Title\",\n count: 0,\n active: true,\n metadata: { type: \"test\", version: \"1.0\" },\n },\n propsSchema: z.object({\n title: z.string(),\n count: z.number(),\n active: z.boolean(),\n metadata: z.object({\n type: z.string(),\n version: z.string(),\n }),\n }),\n };\n\n let componentId = \"\";\n act(() => {\n componentId = result.current.addInteractableComponent(component);\n });\n\n // Verify initial state\n expect(result.current.interactableComponents[0].props).toEqual({\n title: \"Original Title\",\n count: 0,\n active: true,\n metadata: { type: \"test\", version: \"1.0\" },\n });\n\n // Apply partial update - only change count\n let updateResult = \"\";\n act(() => {\n updateResult = result.current.updateInteractableComponentProps(\n componentId,\n {\n count: 5,\n },\n );\n });\n\n expect(updateResult).toBe(\"Updated successfully\");\n expect(result.current.interactableComponents[0].props).toEqual({\n title: \"Original Title\", // unchanged\n count: 5, // updated\n active: true, // unchanged\n metadata: { type: \"test\", version: \"1.0\" }, // unchanged\n });\n });\n\n it(\"should apply multiple partial updates in sequence\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n const component: Omit<TamboInteractableComponent, \"id\" | \"createdAt\"> = {\n name: \"TestComponent\",\n description: \"A test component\",\n component: () => <div>Test</div>,\n props: {\n title: \"Original Title\",\n count: 0,\n active: true,\n description: \"Original description\",\n },\n propsSchema: z.object({\n title: z.string(),\n count: z.number(),\n active: z.boolean(),\n description: z.string(),\n }),\n };\n\n let componentId = \"\";\n act(() => {\n componentId = result.current.addInteractableComponent(component);\n });\n\n // First partial update - change title and count\n act(() => {\n result.current.updateInteractableComponentProps(componentId, {\n title: \"Updated Title\",\n count: 10,\n });\n });\n\n expect(result.current.interactableComponents[0].props).toEqual({\n title: \"Updated Title\",\n count: 10,\n active: true,\n description: \"Original description\",\n });\n\n // Second partial update - change active and description\n act(() => {\n result.current.updateInteractableComponentProps(componentId, {\n active: false,\n description: \"Updated description\",\n });\n });\n\n expect(result.current.interactableComponents[0].props).toEqual({\n title: \"Updated Title\", // from previous update\n count: 10, // from previous update\n active: false, // new update\n description: \"Updated description\", // new update\n });\n });\n\n it(\"should handle nested object partial updates (shallow merge behavior)\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n const component: Omit<TamboInteractableComponent, \"id\" | \"createdAt\"> = {\n name: \"TestComponent\",\n description: \"A test component\",\n component: () => <div>Test</div>,\n props: {\n title: \"Original Title\",\n config: {\n theme: \"light\",\n language: \"en\",\n features: {\n notifications: true,\n analytics: false,\n },\n },\n },\n propsSchema: z.object({\n title: z.string(),\n config: z.object({\n theme: z.string(),\n language: z.string(),\n features: z.object({\n notifications: z.boolean(),\n analytics: z.boolean(),\n }),\n }),\n }),\n };\n\n let componentId = \"\";\n act(() => {\n componentId = result.current.addInteractableComponent(component);\n });\n\n // Partial update - replace entire config object (shallow merge behavior)\n act(() => {\n result.current.updateInteractableComponentProps(componentId, {\n config: {\n theme: \"dark\",\n // Note: language and features are not provided, so they will be undefined\n // This demonstrates the shallow merge behavior\n },\n });\n });\n\n expect(result.current.interactableComponents[0].props).toEqual({\n title: \"Original Title\",\n config: {\n theme: \"dark\", // updated\n // language and features are now undefined due to shallow merge\n },\n });\n });\n\n it(\"should handle array partial updates\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n const component: Omit<TamboInteractableComponent, \"id\" | \"createdAt\"> = {\n name: \"TestComponent\",\n description: \"A test component\",\n component: () => <div>Test</div>,\n props: {\n title: \"Original Title\",\n items: [\"item1\", \"item2\", \"item3\"],\n tags: [\"tag1\", \"tag2\"],\n },\n propsSchema: z.object({\n title: z.string(),\n items: z.array(z.string()),\n tags: z.array(z.string()),\n }),\n };\n\n let componentId = \"\";\n act(() => {\n componentId = result.current.addInteractableComponent(component);\n });\n\n // Partial update - only change items array\n act(() => {\n result.current.updateInteractableComponentProps(componentId, {\n items: [\"newItem1\", \"newItem2\"],\n });\n });\n\n expect(result.current.interactableComponents[0].props).toEqual({\n title: \"Original Title\", // unchanged\n items: [\"newItem1\", \"newItem2\"], // updated\n tags: [\"tag1\", \"tag2\"], // unchanged\n });\n });\n\n it(\"should handle null and undefined values in partial updates\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n const component: Omit<TamboInteractableComponent, \"id\" | \"createdAt\"> = {\n name: \"TestComponent\",\n description: \"A test component\",\n component: () => <div>Test</div>,\n props: {\n title: \"Original Title\",\n count: 5,\n description: \"Original description\",\n },\n propsSchema: z.object({\n title: z.string(),\n count: z.number(),\n description: z.string(),\n }),\n };\n\n let componentId = \"\";\n act(() => {\n componentId = result.current.addInteractableComponent(component);\n });\n\n // Partial update with null value\n act(() => {\n result.current.updateInteractableComponentProps(componentId, {\n description: null as any,\n });\n });\n\n expect(result.current.interactableComponents[0].props).toEqual({\n title: \"Original Title\",\n count: 5,\n description: null,\n });\n\n // Partial update with undefined value\n act(() => {\n result.current.updateInteractableComponentProps(componentId, {\n count: undefined as any,\n });\n });\n\n expect(result.current.interactableComponents[0].props).toEqual({\n title: \"Original Title\",\n count: undefined,\n description: null,\n });\n });\n });\n\n describe(\"Error Handling\", () => {\n it(\"should return error for non-existent component\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n let updateResult = \"\";\n act(() => {\n updateResult = result.current.updateInteractableComponentProps(\n \"non-existent\",\n {\n title: \"New Title\",\n },\n );\n });\n\n expect(updateResult).toBe(\"Updated successfully\");\n });\n\n it(\"should throw error when component name contains spaces\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n const invalidComponent: Omit<\n TamboInteractableComponent,\n \"id\" | \"createdAt\"\n > = {\n name: \"Invalid Component Name\", // Contains spaces\n description: \"A component with spaces in name\",\n component: () => <div>Invalid</div>,\n props: { title: \"Test\" },\n propsSchema: z.object({ title: z.string() }),\n };\n\n expect(() => {\n act(() => {\n result.current.addInteractableComponent(invalidComponent);\n });\n }).toThrow(\n 'component \"Invalid Component Name\" must only contain letters, numbers, underscores, and hyphens.',\n );\n });\n\n it(\"should return warning for empty props object\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n const component: Omit<TamboInteractableComponent, \"id\" | \"createdAt\"> = {\n name: \"TestComponent\",\n description: \"A test component\",\n component: () => <div>Test</div>,\n props: { title: \"Original Title\" },\n propsSchema: z.object({ title: z.string() }),\n };\n\n let componentId = \"\";\n act(() => {\n componentId = result.current.addInteractableComponent(component);\n });\n\n let updateResult = \"\";\n act(() => {\n updateResult = result.current.updateInteractableComponentProps(\n componentId,\n {},\n );\n });\n\n expect(updateResult).toBe(\n `Warning: No props provided for component with ID ${componentId}.`,\n );\n });\n\n it(\"should return warning for null props\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n const component: Omit<TamboInteractableComponent, \"id\" | \"createdAt\"> = {\n name: \"TestComponent\",\n description: \"A test component\",\n component: () => <div>Test</div>,\n props: { title: \"Original Title\" },\n propsSchema: z.object({ title: z.string() }),\n };\n\n let componentId = \"\";\n act(() => {\n componentId = result.current.addInteractableComponent(component);\n });\n\n let updateResult = \"\";\n act(() => {\n updateResult = result.current.updateInteractableComponentProps(\n componentId,\n null as any,\n );\n });\n\n expect(updateResult).toBe(\n `Warning: No props provided for component with ID ${componentId}.`,\n );\n });\n\n it(\"should return warning for undefined props\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n const component: Omit<TamboInteractableComponent, \"id\" | \"createdAt\"> = {\n name: \"TestComponent\",\n description: \"A test component\",\n component: () => <div>Test</div>,\n props: { title: \"Original Title\" },\n propsSchema: z.object({ title: z.string() }),\n };\n\n let componentId = \"\";\n act(() => {\n componentId = result.current.addInteractableComponent(component);\n });\n\n let updateResult = \"\";\n act(() => {\n updateResult = result.current.updateInteractableComponentProps(\n componentId,\n undefined as any,\n );\n });\n\n expect(updateResult).toBe(\n `Warning: No props provided for component with ID ${componentId}.`,\n );\n });\n });\n\n describe(\"Performance and Efficiency\", () => {\n it(\"should only update changed properties without affecting others\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n const component: Omit<TamboInteractableComponent, \"id\" | \"createdAt\"> = {\n name: \"TestComponent\",\n description: \"A test component\",\n component: () => <div>Test</div>,\n props: {\n title: \"Original Title\",\n count: 0,\n active: true,\n metadata: { type: \"test\", version: \"1.0\" },\n items: [\"item1\", \"item2\"],\n },\n propsSchema: z.object({\n title: z.string(),\n count: z.number(),\n active: z.boolean(),\n metadata: z.object({\n type: z.string(),\n version: z.string(),\n }),\n items: z.array(z.string()),\n }),\n };\n\n let componentId = \"\";\n act(() => {\n componentId = result.current.addInteractableComponent(component);\n });\n\n const originalProps = result.current.interactableComponents[0].props;\n const originalMetadata = originalProps.metadata;\n const originalItems = originalProps.items;\n\n // Apply minimal partial update - only change count\n act(() => {\n result.current.updateInteractableComponentProps(componentId, {\n count: 1,\n });\n });\n\n const updatedProps = result.current.interactableComponents[0].props;\n\n // Verify that only count changed\n expect(updatedProps.count).toBe(1);\n expect(updatedProps.title).toBe(\"Original Title\");\n expect(updatedProps.active).toBe(true);\n\n // Verify that nested objects are preserved (same reference for efficiency)\n expect(updatedProps.metadata).toBe(originalMetadata);\n expect(updatedProps.items).toBe(originalItems);\n });\n\n it(\"should handle large objects efficiently with partial updates\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n // Create a component with a large initial state\n const largeData = {\n users: Array.from({ length: 1000 }, (_, i) => ({\n id: i,\n name: `User ${i}`,\n })),\n settings: {\n theme: \"light\",\n language: \"en\",\n notifications: true,\n privacy: {\n shareData: false,\n analytics: true,\n marketing: false,\n },\n },\n metadata: {\n version: \"1.0.0\",\n build: \"12345\",\n timestamp: Date.now(),\n },\n };\n\n const component: Omit<TamboInteractableComponent, \"id\" | \"createdAt\"> = {\n name: \"TestComponent\",\n description: \"A test component with large data\",\n component: () => <div>Test</div>,\n props: largeData,\n propsSchema: z.object({\n users: z.array(\n z.object({\n id: z.number(),\n name: z.string(),\n }),\n ),\n settings: z.object({\n theme: z.string(),\n language: z.string(),\n notifications: z.boolean(),\n privacy: z.object({\n shareData: z.boolean(),\n analytics: z.boolean(),\n marketing: z.boolean(),\n }),\n }),\n metadata: z.object({\n version: z.string(),\n build: z.string(),\n timestamp: z.number(),\n }),\n }),\n };\n\n let componentId = \"\";\n act(() => {\n componentId = result.current.addInteractableComponent(component);\n });\n\n const originalProps = result.current.interactableComponents[0].props;\n const originalUsers = originalProps.users;\n\n // Apply a small partial update - only change theme (shallow merge behavior)\n act(() => {\n result.current.updateInteractableComponentProps(componentId, {\n settings: {\n theme: \"dark\",\n // Note: other settings properties are not provided, so they will be undefined\n // This demonstrates the shallow merge behavior\n },\n });\n });\n\n const updatedProps = result.current.interactableComponents[0].props;\n\n // Verify the update worked\n expect(updatedProps.settings.theme).toBe(\"dark\");\n // Due to shallow merge, other properties are now undefined\n expect(updatedProps.settings.language).toBeUndefined();\n expect(updatedProps.settings.notifications).toBeUndefined();\n\n // Verify that large arrays are preserved (same reference for efficiency)\n expect(updatedProps.users).toBe(originalUsers);\n\n // Verify that metadata is preserved (not updated)\n expect(updatedProps.metadata).toBe(originalProps.metadata);\n });\n });\n\n describe(\"Edge Cases\", () => {\n it(\"should handle updating a property that doesn't exist in original props\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n const component: Omit<TamboInteractableComponent, \"id\" | \"createdAt\"> = {\n name: \"TestComponent\",\n description: \"A test component\",\n component: () => <div>Test</div>,\n props: {\n title: \"Original Title\",\n count: 0,\n },\n propsSchema: z.object({\n title: z.string(),\n count: z.number(),\n newProperty: z.string().optional(),\n }),\n };\n\n let componentId = \"\";\n act(() => {\n componentId = result.current.addInteractableComponent(component);\n });\n\n // Add a new property that wasn't in the original props\n act(() => {\n result.current.updateInteractableComponentProps(componentId, {\n newProperty: \"New Value\",\n });\n });\n\n expect(result.current.interactableComponents[0].props).toEqual({\n title: \"Original Title\",\n count: 0,\n newProperty: \"New Value\",\n });\n });\n\n it(\"should handle updating with same values (no-op updates)\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n const component: Omit<TamboInteractableComponent, \"id\" | \"createdAt\"> = {\n name: \"TestComponent\",\n description: \"A test component\",\n component: () => <div>Test</div>,\n props: {\n title: \"Original Title\",\n count: 5,\n active: true,\n },\n propsSchema: z.object({\n title: z.string(),\n count: z.number(),\n active: z.boolean(),\n }),\n };\n\n let componentId = \"\";\n act(() => {\n componentId = result.current.addInteractableComponent(component);\n });\n\n const originalProps = result.current.interactableComponents[0].props;\n\n // Update with the same values\n let updateResult = \"\";\n act(() => {\n updateResult = result.current.updateInteractableComponentProps(\n componentId,\n {\n title: \"Original Title\",\n count: 5,\n active: true,\n },\n );\n });\n\n expect(updateResult).toBe(\"Updated successfully\");\n expect(result.current.interactableComponents[0].props).toEqual(\n originalProps,\n );\n });\n\n it(\"should handle proper nested partial updates by providing complete nested structure\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n const component: Omit<TamboInteractableComponent, \"id\" | \"createdAt\"> = {\n name: \"TestComponent\",\n description: \"A test component\",\n component: () => <div>Test</div>,\n props: {\n title: \"Original Title\",\n config: {\n theme: \"light\",\n language: \"en\",\n features: {\n notifications: true,\n analytics: false,\n experimental: {\n beta: false,\n alpha: true,\n },\n },\n },\n },\n propsSchema: z.object({\n title: z.string(),\n config: z.object({\n theme: z.string(),\n language: z.string(),\n features: z.object({\n notifications: z.boolean(),\n analytics: z.boolean(),\n experimental: z.object({\n beta: z.boolean(),\n alpha: z.boolean(),\n }),\n }),\n }),\n }),\n };\n\n let componentId = \"\";\n act(() => {\n componentId = result.current.addInteractableComponent(component);\n });\n\n // Proper nested partial update - provide complete nested structure\n act(() => {\n result.current.updateInteractableComponentProps(componentId, {\n config: {\n theme: \"light\", // keep original\n language: \"en\", // keep original\n features: {\n notifications: true, // keep original\n analytics: false, // keep original\n experimental: {\n beta: true, // update this\n alpha: true, // keep original\n },\n },\n },\n });\n });\n\n expect(result.current.interactableComponents[0].props).toEqual({\n title: \"Original Title\",\n config: {\n theme: \"light\", // unchanged\n language: \"en\", // unchanged\n features: {\n notifications: true, // unchanged\n analytics: false, // unchanged\n experimental: {\n beta: true, // updated\n alpha: true, // unchanged\n },\n },\n },\n });\n });\n\n it(\"should handle complex nested partial updates (shallow merge behavior)\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n const component: Omit<TamboInteractableComponent, \"id\" | \"createdAt\"> = {\n name: \"TestComponent\",\n description: \"A test component\",\n component: () => <div>Test</div>,\n props: {\n title: \"Original Title\",\n config: {\n theme: \"light\",\n language: \"en\",\n features: {\n notifications: true,\n analytics: false,\n experimental: {\n beta: false,\n alpha: true,\n },\n },\n },\n },\n propsSchema: z.object({\n title: z.string(),\n config: z.object({\n theme: z.string(),\n language: z.string(),\n features: z.object({\n notifications: z.boolean(),\n analytics: z.boolean(),\n experimental: z.object({\n beta: z.boolean(),\n alpha: z.boolean(),\n }),\n }),\n }),\n }),\n };\n\n let componentId = \"\";\n act(() => {\n componentId = result.current.addInteractableComponent(component);\n });\n\n // Deep nested partial update - only change beta flag (shallow merge behavior)\n act(() => {\n result.current.updateInteractableComponentProps(componentId, {\n config: {\n features: {\n experimental: {\n beta: true,\n // Note: alpha is not provided, so it will be undefined\n // This demonstrates the shallow merge behavior\n },\n },\n },\n });\n });\n\n expect(result.current.interactableComponents[0].props).toEqual({\n title: \"Original Title\",\n config: {\n // theme and language are now undefined due to shallow merge\n features: {\n // notifications and analytics are now undefined due to shallow merge\n experimental: {\n beta: true, // updated\n // alpha is now undefined due to shallow merge\n },\n },\n },\n });\n });\n });\n});\n"]}
1
+ {"version":3,"file":"tambo-interactable-provider-partial-updates.test.js","sourceRoot":"","sources":["../../src/providers/tambo-interactable-provider-partial-updates.test.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE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AAC,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;gBAC7D,KAAK,EAAE,gBAAgB;gBACvB,MAAM,EAAE;oBACN,4DAA4D;oBAC5D,QAAQ,EAAE;wBACR,qEAAqE;wBACrE,YAAY,EAAE;4BACZ,IAAI,EAAE,IAAI,EAAE,UAAU;4BACtB,8CAA8C;yBAC/C;qBACF;iBACF;aACF,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { act, renderHook } from \"@testing-library/react\";\nimport React from \"react\";\nimport { z } from \"zodInternalAlias\";\nimport { TamboInteractableComponent } from \"../model/tambo-interactable\";\nimport {\n TamboInteractableProvider,\n useTamboInteractable,\n} from \"./tambo-interactable-provider\";\n\n// Mock the context helpers\nconst mockAddContextHelper = jest.fn();\nconst mockRemoveContextHelper = jest.fn();\n\njest.mock(\"./tambo-context-helpers-provider\", () => ({\n TamboContextHelpersProvider: ({\n children,\n }: {\n children: React.ReactNode;\n }) => <>{children}</>,\n useTamboContextHelpers: () => ({\n addContextHelper: mockAddContextHelper,\n removeContextHelper: mockRemoveContextHelper,\n }),\n}));\n\n// Mock the component provider\nconst mockRegisterTool = jest.fn();\n\njest.mock(\"./tambo-component-provider\", () => ({\n useTamboComponent: () => ({\n registerTool: mockRegisterTool,\n }),\n}));\n\n// Mock the context helper creation\njest.mock(\"../context-helpers/current-interactables-context-helper\", () => ({\n createInteractablesContextHelper: () =>\n jest.fn(() => ({\n name: \"interactables\",\n context: {\n description: \"Test interactables context\",\n components: [],\n },\n })),\n}));\n\ndescribe(\"updateInteractableComponentProps - Partial Updates\", () => {\n beforeEach(() => {\n jest.clearAllMocks();\n });\n\n const wrapper = ({ children }: { children: React.ReactNode }) => (\n <TamboInteractableProvider>{children}</TamboInteractableProvider>\n );\n\n describe(\"Partial Updates Functionality\", () => {\n it(\"should apply partial updates to existing props\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n const component: Omit<TamboInteractableComponent, \"id\" | \"createdAt\"> = {\n name: \"TestComponent\",\n description: \"A test component\",\n component: () => <div>Test</div>,\n props: {\n title: \"Original Title\",\n count: 0,\n active: true,\n metadata: { type: \"test\", version: \"1.0\" },\n },\n propsSchema: z.object({\n title: z.string(),\n count: z.number(),\n active: z.boolean(),\n metadata: z.object({\n type: z.string(),\n version: z.string(),\n }),\n }),\n };\n\n let componentId = \"\";\n act(() => {\n componentId = result.current.addInteractableComponent(component);\n });\n\n // Verify initial state\n expect(result.current.interactableComponents[0].props).toEqual({\n title: \"Original Title\",\n count: 0,\n active: true,\n metadata: { type: \"test\", version: \"1.0\" },\n });\n\n // Apply partial update - only change count\n let updateResult = \"\";\n act(() => {\n updateResult = result.current.updateInteractableComponentProps(\n componentId,\n {\n count: 5,\n },\n );\n });\n\n expect(updateResult).toBe(\"Updated successfully\");\n expect(result.current.interactableComponents[0].props).toEqual({\n title: \"Original Title\", // unchanged\n count: 5, // updated\n active: true, // unchanged\n metadata: { type: \"test\", version: \"1.0\" }, // unchanged\n });\n });\n\n it(\"should apply multiple partial updates in sequence\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n const component: Omit<TamboInteractableComponent, \"id\" | \"createdAt\"> = {\n name: \"TestComponent\",\n description: \"A test component\",\n component: () => <div>Test</div>,\n props: {\n title: \"Original Title\",\n count: 0,\n active: true,\n description: \"Original description\",\n },\n propsSchema: z.object({\n title: z.string(),\n count: z.number(),\n active: z.boolean(),\n description: z.string(),\n }),\n };\n\n let componentId = \"\";\n act(() => {\n componentId = result.current.addInteractableComponent(component);\n });\n\n // First partial update - change title and count\n act(() => {\n result.current.updateInteractableComponentProps(componentId, {\n title: \"Updated Title\",\n count: 10,\n });\n });\n\n expect(result.current.interactableComponents[0].props).toEqual({\n title: \"Updated Title\",\n count: 10,\n active: true,\n description: \"Original description\",\n });\n\n // Second partial update - change active and description\n act(() => {\n result.current.updateInteractableComponentProps(componentId, {\n active: false,\n description: \"Updated description\",\n });\n });\n\n expect(result.current.interactableComponents[0].props).toEqual({\n title: \"Updated Title\", // from previous update\n count: 10, // from previous update\n active: false, // new update\n description: \"Updated description\", // new update\n });\n });\n\n it(\"should handle nested object partial updates (shallow merge behavior)\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n const component: Omit<TamboInteractableComponent, \"id\" | \"createdAt\"> = {\n name: \"TestComponent\",\n description: \"A test component\",\n component: () => <div>Test</div>,\n props: {\n title: \"Original Title\",\n config: {\n theme: \"light\",\n language: \"en\",\n features: {\n notifications: true,\n analytics: false,\n },\n },\n },\n propsSchema: z.object({\n title: z.string(),\n config: z.object({\n theme: z.string(),\n language: z.string(),\n features: z.object({\n notifications: z.boolean(),\n analytics: z.boolean(),\n }),\n }),\n }),\n };\n\n let componentId = \"\";\n act(() => {\n componentId = result.current.addInteractableComponent(component);\n });\n\n // Partial update - replace entire config object (shallow merge behavior)\n act(() => {\n result.current.updateInteractableComponentProps(componentId, {\n config: {\n theme: \"dark\",\n // Note: language and features are not provided, so they will be undefined\n // This demonstrates the shallow merge behavior\n },\n });\n });\n\n expect(result.current.interactableComponents[0].props).toEqual({\n title: \"Original Title\",\n config: {\n theme: \"dark\", // updated\n // language and features are now undefined due to shallow merge\n },\n });\n });\n\n it(\"should handle array partial updates\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n const component: Omit<TamboInteractableComponent, \"id\" | \"createdAt\"> = {\n name: \"TestComponent\",\n description: \"A test component\",\n component: () => <div>Test</div>,\n props: {\n title: \"Original Title\",\n items: [\"item1\", \"item2\", \"item3\"],\n tags: [\"tag1\", \"tag2\"],\n },\n propsSchema: z.object({\n title: z.string(),\n items: z.array(z.string()),\n tags: z.array(z.string()),\n }),\n };\n\n let componentId = \"\";\n act(() => {\n componentId = result.current.addInteractableComponent(component);\n });\n\n // Partial update - only change items array\n act(() => {\n result.current.updateInteractableComponentProps(componentId, {\n items: [\"newItem1\", \"newItem2\"],\n });\n });\n\n expect(result.current.interactableComponents[0].props).toEqual({\n title: \"Original Title\", // unchanged\n items: [\"newItem1\", \"newItem2\"], // updated\n tags: [\"tag1\", \"tag2\"], // unchanged\n });\n });\n\n it(\"should handle null and undefined values in partial updates\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n const component: Omit<TamboInteractableComponent, \"id\" | \"createdAt\"> = {\n name: \"TestComponent\",\n description: \"A test component\",\n component: () => <div>Test</div>,\n props: {\n title: \"Original Title\",\n count: 5,\n description: \"Original description\",\n },\n propsSchema: z.object({\n title: z.string(),\n count: z.number(),\n description: z.string(),\n }),\n };\n\n let componentId = \"\";\n act(() => {\n componentId = result.current.addInteractableComponent(component);\n });\n\n // Partial update with null value\n act(() => {\n result.current.updateInteractableComponentProps(componentId, {\n description: null as any,\n });\n });\n\n expect(result.current.interactableComponents[0].props).toEqual({\n title: \"Original Title\",\n count: 5,\n description: null,\n });\n\n // Partial update with undefined value\n act(() => {\n result.current.updateInteractableComponentProps(componentId, {\n count: undefined as any,\n });\n });\n\n expect(result.current.interactableComponents[0].props).toEqual({\n title: \"Original Title\",\n count: undefined,\n description: null,\n });\n });\n });\n\n describe(\"Error Handling\", () => {\n it(\"should return error for non-existent component\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n let updateResult = \"\";\n act(() => {\n updateResult = result.current.updateInteractableComponentProps(\n \"non-existent\",\n {\n title: \"New Title\",\n },\n );\n });\n\n expect(updateResult).toBe(\"Updated successfully\");\n });\n\n it(\"should throw error when component name contains spaces\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n const invalidComponent: Omit<\n TamboInteractableComponent,\n \"id\" | \"createdAt\"\n > = {\n name: \"Invalid Component Name\", // Contains spaces\n description: \"A component with spaces in name\",\n component: () => <div>Invalid</div>,\n props: { title: \"Test\" },\n propsSchema: z.object({ title: z.string() }),\n };\n\n expect(() => {\n act(() => {\n result.current.addInteractableComponent(invalidComponent);\n });\n }).toThrow(\n 'component \"Invalid Component Name\" must only contain letters, numbers, underscores, and hyphens.',\n );\n });\n\n it(\"should return warning for empty props object\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n const component: Omit<TamboInteractableComponent, \"id\" | \"createdAt\"> = {\n name: \"TestComponent\",\n description: \"A test component\",\n component: () => <div>Test</div>,\n props: { title: \"Original Title\" },\n propsSchema: z.object({ title: z.string() }),\n };\n\n let componentId = \"\";\n act(() => {\n componentId = result.current.addInteractableComponent(component);\n });\n\n let updateResult = \"\";\n act(() => {\n updateResult = result.current.updateInteractableComponentProps(\n componentId,\n {},\n );\n });\n\n expect(updateResult).toBe(\n `Warning: No props provided for component with ID ${componentId}.`,\n );\n });\n\n it(\"should return warning for null props\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n const component: Omit<TamboInteractableComponent, \"id\" | \"createdAt\"> = {\n name: \"TestComponent\",\n description: \"A test component\",\n component: () => <div>Test</div>,\n props: { title: \"Original Title\" },\n propsSchema: z.object({ title: z.string() }),\n };\n\n let componentId = \"\";\n act(() => {\n componentId = result.current.addInteractableComponent(component);\n });\n\n let updateResult = \"\";\n act(() => {\n updateResult = result.current.updateInteractableComponentProps(\n componentId,\n null as any,\n );\n });\n\n expect(updateResult).toBe(\n `Warning: No props provided for component with ID ${componentId}.`,\n );\n });\n\n it(\"should return warning for undefined props\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n const component: Omit<TamboInteractableComponent, \"id\" | \"createdAt\"> = {\n name: \"TestComponent\",\n description: \"A test component\",\n component: () => <div>Test</div>,\n props: { title: \"Original Title\" },\n propsSchema: z.object({ title: z.string() }),\n };\n\n let componentId = \"\";\n act(() => {\n componentId = result.current.addInteractableComponent(component);\n });\n\n let updateResult = \"\";\n act(() => {\n updateResult = result.current.updateInteractableComponentProps(\n componentId,\n undefined as any,\n );\n });\n\n expect(updateResult).toBe(\n `Warning: No props provided for component with ID ${componentId}.`,\n );\n });\n });\n\n describe(\"Performance and Efficiency\", () => {\n it(\"should only update changed properties without affecting others\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n const component: Omit<TamboInteractableComponent, \"id\" | \"createdAt\"> = {\n name: \"TestComponent\",\n description: \"A test component\",\n component: () => <div>Test</div>,\n props: {\n title: \"Original Title\",\n count: 0,\n active: true,\n metadata: { type: \"test\", version: \"1.0\" },\n items: [\"item1\", \"item2\"],\n },\n propsSchema: z.object({\n title: z.string(),\n count: z.number(),\n active: z.boolean(),\n metadata: z.object({\n type: z.string(),\n version: z.string(),\n }),\n items: z.array(z.string()),\n }),\n };\n\n let componentId = \"\";\n act(() => {\n componentId = result.current.addInteractableComponent(component);\n });\n\n const originalProps = result.current.interactableComponents[0].props;\n const originalMetadata = originalProps.metadata;\n const originalItems = originalProps.items;\n\n // Apply minimal partial update - only change count\n act(() => {\n result.current.updateInteractableComponentProps(componentId, {\n count: 1,\n });\n });\n\n const updatedProps = result.current.interactableComponents[0].props;\n\n // Verify that only count changed\n expect(updatedProps.count).toBe(1);\n expect(updatedProps.title).toBe(\"Original Title\");\n expect(updatedProps.active).toBe(true);\n\n // Verify that nested objects are preserved (same reference for efficiency)\n expect(updatedProps.metadata).toBe(originalMetadata);\n expect(updatedProps.items).toBe(originalItems);\n });\n\n it(\"should handle large objects efficiently with partial updates\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n // Create a component with a large initial state\n const largeData = {\n users: Array.from({ length: 1000 }, (_, i) => ({\n id: i,\n name: `User ${i}`,\n })),\n settings: {\n theme: \"light\",\n language: \"en\",\n notifications: true,\n privacy: {\n shareData: false,\n analytics: true,\n marketing: false,\n },\n },\n metadata: {\n version: \"1.0.0\",\n build: \"12345\",\n timestamp: Date.now(),\n },\n };\n\n const component: Omit<TamboInteractableComponent, \"id\" | \"createdAt\"> = {\n name: \"TestComponent\",\n description: \"A test component with large data\",\n component: () => <div>Test</div>,\n props: largeData,\n propsSchema: z.object({\n users: z.array(\n z.object({\n id: z.number(),\n name: z.string(),\n }),\n ),\n settings: z.object({\n theme: z.string(),\n language: z.string(),\n notifications: z.boolean(),\n privacy: z.object({\n shareData: z.boolean(),\n analytics: z.boolean(),\n marketing: z.boolean(),\n }),\n }),\n metadata: z.object({\n version: z.string(),\n build: z.string(),\n timestamp: z.number(),\n }),\n }),\n };\n\n let componentId = \"\";\n act(() => {\n componentId = result.current.addInteractableComponent(component);\n });\n\n const originalProps = result.current.interactableComponents[0].props;\n const originalUsers = originalProps.users;\n\n // Apply a small partial update - only change theme (shallow merge behavior)\n act(() => {\n result.current.updateInteractableComponentProps(componentId, {\n settings: {\n theme: \"dark\",\n // Note: other settings properties are not provided, so they will be undefined\n // This demonstrates the shallow merge behavior\n },\n });\n });\n\n const updatedProps = result.current.interactableComponents[0].props;\n\n // Verify the update worked\n expect(updatedProps.settings.theme).toBe(\"dark\");\n // Due to shallow merge, other properties are now undefined\n expect(updatedProps.settings.language).toBeUndefined();\n expect(updatedProps.settings.notifications).toBeUndefined();\n\n // Verify that large arrays are preserved (same reference for efficiency)\n expect(updatedProps.users).toBe(originalUsers);\n\n // Verify that metadata is preserved (not updated)\n expect(updatedProps.metadata).toBe(originalProps.metadata);\n });\n });\n\n describe(\"Edge Cases\", () => {\n it(\"should handle updating a property that doesn't exist in original props\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n const component: Omit<TamboInteractableComponent, \"id\" | \"createdAt\"> = {\n name: \"TestComponent\",\n description: \"A test component\",\n component: () => <div>Test</div>,\n props: {\n title: \"Original Title\",\n count: 0,\n },\n propsSchema: z.object({\n title: z.string(),\n count: z.number(),\n newProperty: z.string().optional(),\n }),\n };\n\n let componentId = \"\";\n act(() => {\n componentId = result.current.addInteractableComponent(component);\n });\n\n // Add a new property that wasn't in the original props\n act(() => {\n result.current.updateInteractableComponentProps(componentId, {\n newProperty: \"New Value\",\n });\n });\n\n expect(result.current.interactableComponents[0].props).toEqual({\n title: \"Original Title\",\n count: 0,\n newProperty: \"New Value\",\n });\n });\n\n it(\"should handle updating with same values (no-op updates)\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n const component: Omit<TamboInteractableComponent, \"id\" | \"createdAt\"> = {\n name: \"TestComponent\",\n description: \"A test component\",\n component: () => <div>Test</div>,\n props: {\n title: \"Original Title\",\n count: 5,\n active: true,\n },\n propsSchema: z.object({\n title: z.string(),\n count: z.number(),\n active: z.boolean(),\n }),\n };\n\n let componentId = \"\";\n act(() => {\n componentId = result.current.addInteractableComponent(component);\n });\n\n const originalProps = result.current.interactableComponents[0].props;\n\n // Update with the same values\n let updateResult = \"\";\n act(() => {\n updateResult = result.current.updateInteractableComponentProps(\n componentId,\n {\n title: \"Original Title\",\n count: 5,\n active: true,\n },\n );\n });\n\n expect(updateResult).toBe(\"Updated successfully\");\n expect(result.current.interactableComponents[0].props).toEqual(\n originalProps,\n );\n });\n\n it(\"should handle proper nested partial updates by providing complete nested structure\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n const component: Omit<TamboInteractableComponent, \"id\" | \"createdAt\"> = {\n name: \"TestComponent\",\n description: \"A test component\",\n component: () => <div>Test</div>,\n props: {\n title: \"Original Title\",\n config: {\n theme: \"light\",\n language: \"en\",\n features: {\n notifications: true,\n analytics: false,\n experimental: {\n beta: false,\n alpha: true,\n },\n },\n },\n },\n propsSchema: z.object({\n title: z.string(),\n config: z.object({\n theme: z.string(),\n language: z.string(),\n features: z.object({\n notifications: z.boolean(),\n analytics: z.boolean(),\n experimental: z.object({\n beta: z.boolean(),\n alpha: z.boolean(),\n }),\n }),\n }),\n }),\n };\n\n let componentId = \"\";\n act(() => {\n componentId = result.current.addInteractableComponent(component);\n });\n\n // Proper nested partial update - provide complete nested structure\n act(() => {\n result.current.updateInteractableComponentProps(componentId, {\n config: {\n theme: \"light\", // keep original\n language: \"en\", // keep original\n features: {\n notifications: true, // keep original\n analytics: false, // keep original\n experimental: {\n beta: true, // update this\n alpha: true, // keep original\n },\n },\n },\n });\n });\n\n expect(result.current.interactableComponents[0].props).toEqual({\n title: \"Original Title\",\n config: {\n theme: \"light\", // unchanged\n language: \"en\", // unchanged\n features: {\n notifications: true, // unchanged\n analytics: false, // unchanged\n experimental: {\n beta: true, // updated\n alpha: true, // unchanged\n },\n },\n },\n });\n });\n\n it(\"should handle complex nested partial updates (shallow merge behavior)\", () => {\n const { result } = renderHook(() => useTamboInteractable(), { wrapper });\n\n const component: Omit<TamboInteractableComponent, \"id\" | \"createdAt\"> = {\n name: \"TestComponent\",\n description: \"A test component\",\n component: () => <div>Test</div>,\n props: {\n title: \"Original Title\",\n config: {\n theme: \"light\",\n language: \"en\",\n features: {\n notifications: true,\n analytics: false,\n experimental: {\n beta: false,\n alpha: true,\n },\n },\n },\n },\n propsSchema: z.object({\n title: z.string(),\n config: z.object({\n theme: z.string(),\n language: z.string(),\n features: z.object({\n notifications: z.boolean(),\n analytics: z.boolean(),\n experimental: z.object({\n beta: z.boolean(),\n alpha: z.boolean(),\n }),\n }),\n }),\n }),\n };\n\n let componentId = \"\";\n act(() => {\n componentId = result.current.addInteractableComponent(component);\n });\n\n // Deep nested partial update - only change beta flag (shallow merge behavior)\n act(() => {\n result.current.updateInteractableComponentProps(componentId, {\n config: {\n features: {\n experimental: {\n beta: true,\n // Note: alpha is not provided, so it will be undefined\n // This demonstrates the shallow merge behavior\n },\n },\n },\n });\n });\n\n expect(result.current.interactableComponents[0].props).toEqual({\n title: \"Original Title\",\n config: {\n // theme and language are now undefined due to shallow merge\n features: {\n // notifications and analytics are now undefined due to shallow merge\n experimental: {\n beta: true, // updated\n // alpha is now undefined due to shallow merge\n },\n },\n },\n });\n });\n });\n});\n"]}
@@ -1,5 +1,4 @@
1
1
  import React, { PropsWithChildren } from "react";
2
- import { z } from "zod/v3";
3
2
  import { type TamboInteractableContext } from "../model/tambo-interactable";
4
3
  declare const TamboInteractableContext: React.Context<TamboInteractableContext>;
5
4
  /**
@@ -31,10 +30,10 @@ export declare const useCurrentInteractablesSnapshot: () => {
31
30
  name: string;
32
31
  description: string;
33
32
  component: React.ComponentType<any>;
34
- propsSchema?: z.ZodTypeAny | import("json-schema").JSONSchema7;
33
+ propsSchema?: import("../schema").SupportedSchema;
35
34
  propsDefinition?: any;
36
35
  loadingComponent?: React.ComponentType<any>;
37
- associatedTools?: import(".").TamboTool[];
36
+ associatedTools?: (import(".").TamboTool | import("../model/component-metadata").TamboToolWithToolSchema)[];
38
37
  }[];
39
38
  export {};
40
39
  //# sourceMappingURL=tambo-interactable-provider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tambo-interactable-provider.d.ts","sourceRoot":"","sources":["../../src/providers/tambo-interactable-provider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAEZ,iBAAiB,EAKlB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,6BAA6B,CAAC;AAKrC,QAAA,MAAM,wBAAwB,yCAQ5B,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAuRjE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,gCAEhC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;GAS3C,CAAC"}
1
+ {"version":3,"file":"tambo-interactable-provider.d.ts","sourceRoot":"","sources":["../../src/providers/tambo-interactable-provider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAEZ,iBAAiB,EAKlB,MAAM,OAAO,CAAC;AAGf,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,6BAA6B,CAAC;AAKrC,QAAA,MAAM,wBAAwB,yCAQ5B,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAoRjE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,gCAEhC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;GAS3C,CAAC"}
@@ -1,7 +1,7 @@
1
1
  // react-sdk/src/providers/tambo-interactable-provider.tsx
2
2
  "use client";
3
3
  import React, { createContext, useCallback, useContext, useEffect, useState, } from "react";
4
- import { z } from "zod/v3";
4
+ import { z } from "zodInternalAlias";
5
5
  import { createInteractablesContextHelper } from "../context-helpers/current-interactables-context-helper";
6
6
  import { assertValidName } from "../util/validate-component-name";
7
7
  import { useTamboComponent } from "./tambo-component-provider";
@@ -48,14 +48,15 @@ export const TamboInteractableProvider = ({ children, }) => {
48
48
  components: interactableComponents,
49
49
  };
50
50
  },
51
- toolSchema: z.function().returns(z.object({
51
+ inputSchema: z.tuple([]),
52
+ outputSchema: z.object({
52
53
  components: z.array(z.object({
53
54
  id: z.string(),
54
- componentName: z.string(),
55
- props: z.record(z.any()),
56
- propsSchema: z.object({}).optional(),
55
+ name: z.string(),
56
+ props: z.record(z.string(), z.any()),
57
+ propsSchema: z.record(z.string(), z.any()).optional(),
57
58
  })),
58
- })),
59
+ }),
59
60
  });
60
61
  registerTool({
61
62
  name: "get_interactable_component_by_id",
@@ -77,20 +78,23 @@ export const TamboInteractableProvider = ({ children, }) => {
77
78
  },
78
79
  };
79
80
  },
80
- toolSchema: z
81
- .function()
82
- .args(z.string())
83
- .returns(z.object({
84
- success: z.boolean(),
85
- component: z
86
- .object({
87
- id: z.string(),
88
- componentName: z.string(),
89
- props: z.record(z.any()),
90
- })
91
- .optional(),
92
- error: z.string().optional(),
93
- })),
81
+ inputSchema: z.tuple([z.string()]),
82
+ outputSchema: z.discriminatedUnion("success", [
83
+ z.object({
84
+ success: z.literal(true),
85
+ component: z
86
+ .object({
87
+ id: z.string(),
88
+ componentName: z.string(),
89
+ props: z.record(z.string(), z.any()),
90
+ })
91
+ .optional(),
92
+ }),
93
+ z.object({
94
+ success: z.literal(false),
95
+ error: z.string(),
96
+ }),
97
+ ]),
94
98
  });
95
99
  registerTool({
96
100
  name: "remove_interactable_component",
@@ -114,19 +118,22 @@ export const TamboInteractableProvider = ({ children, }) => {
114
118
  },
115
119
  };
116
120
  },
117
- toolSchema: z
118
- .function()
119
- .args(z.string())
120
- .returns(z.object({
121
- success: z.boolean(),
122
- componentId: z.string(),
123
- removedComponent: z.object({
124
- id: z.string(),
125
- componentName: z.string(),
126
- props: z.record(z.any()),
121
+ inputSchema: z.tuple([z.string()]),
122
+ outputSchema: z.discriminatedUnion("success", [
123
+ z.object({
124
+ success: z.literal(true),
125
+ componentId: z.string(),
126
+ removedComponent: z.object({
127
+ id: z.string(),
128
+ componentName: z.string(),
129
+ props: z.record(z.string(), z.any()),
130
+ }),
131
+ }),
132
+ z.object({
133
+ success: z.literal(false),
134
+ error: z.string(),
127
135
  }),
128
- error: z.string().optional(),
129
- })),
136
+ ]),
130
137
  });
131
138
  }
132
139
  }, [interactableComponents, registerTool]);
@@ -175,12 +182,11 @@ export const TamboInteractableProvider = ({ children, }) => {
175
182
  tool: (componentId, newProps) => {
176
183
  return updateInteractableComponentProps(componentId, newProps);
177
184
  },
178
- toolSchema: z
179
- .function()
180
- .args(z
181
- .string()
182
- .describe("The ID of the interactable component to update"), schemaForArgs.describe("The props to update the component with. You can provide partial props (only the props you want to change) or complete props (all props). Only the props you specify will be updated."))
183
- .returns(z.string()),
185
+ inputSchema: z.tuple([
186
+ z.string().describe("The ID of the interactable component to update"),
187
+ schemaForArgs.describe("The props to update the component with. You can provide partial props (only the props you want to change) or complete props (all props). Only the props you specify will be updated."),
188
+ ]),
189
+ outputSchema: z.string(),
184
190
  });
185
191
  }, [registerTool, updateInteractableComponentProps]);
186
192
  const addInteractableComponent = useCallback((component) => {