@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
@@ -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,kDAAyD;AACzD,kDAA0B;AAC1B,+BAA2B;AAE3B,+EAGuC;AAEvC,2BAA2B;AAC3B,MAAM,oBAAoB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AACvC,MAAM,uBAAuB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AAE1C,IAAI,CAAC,IAAI,CAAC,kCAAkC,EAAE,GAAG,EAAE,CAAC,CAAC;IACnD,2BAA2B,EAAE,CAAC,EAC5B,QAAQ,GAGT,EAAE,EAAE,CAAC,8DAAG,QAAQ,CAAI;IACrB,sBAAsB,EAAE,GAAG,EAAE,CAAC,CAAC;QAC7B,gBAAgB,EAAE,oBAAoB;QACtC,mBAAmB,EAAE,uBAAuB;KAC7C,CAAC;CACH,CAAC,CAAC,CAAC;AAEJ,8BAA8B;AAC9B,MAAM,gBAAgB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AAEnC,IAAI,CAAC,IAAI,CA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;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,kDAAyD;AACzD,kDAA0B;AAC1B,uDAAqC;AAErC,+EAGuC;AAEvC,2BAA2B;AAC3B,MAAM,oBAAoB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AACvC,MAAM,uBAAuB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AAE1C,IAAI,CAAC,IAAI,CAAC,kCAAkC,EAAE,GAAG,EAAE,CAAC,CAAC;IACnD,2BAA2B,EAAE,CAAC,EAC5B,QAAQ,GAGT,EAAE,EAAE,CAAC,8DAAG,QAAQ,CAAI;IACrB,sBAAsB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CAAC;YAEH,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 \"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"}
@@ -37,7 +37,7 @@ var __importStar = (this && this.__importStar) || (function () {
37
37
  Object.defineProperty(exports, "__esModule", { value: true });
38
38
  exports.useCurrentInteractablesSnapshot = exports.useTamboInteractable = exports.TamboInteractableProvider = void 0;
39
39
  const react_1 = __importStar(require("react"));
40
- const v3_1 = require("zod/v3");
40
+ const zodInternalAlias_1 = require("zodInternalAlias");
41
41
  const current_interactables_context_helper_1 = require("../context-helpers/current-interactables-context-helper");
42
42
  const validate_component_name_1 = require("../util/validate-component-name");
43
43
  const tambo_component_provider_1 = require("./tambo-component-provider");
@@ -84,14 +84,15 @@ const TamboInteractableProvider = ({ children, }) => {
84
84
  components: interactableComponents,
85
85
  };
86
86
  },
87
- toolSchema: v3_1.z.function().returns(v3_1.z.object({
88
- components: v3_1.z.array(v3_1.z.object({
89
- id: v3_1.z.string(),
90
- componentName: v3_1.z.string(),
91
- props: v3_1.z.record(v3_1.z.any()),
92
- propsSchema: v3_1.z.object({}).optional(),
87
+ inputSchema: zodInternalAlias_1.z.tuple([]),
88
+ outputSchema: zodInternalAlias_1.z.object({
89
+ components: zodInternalAlias_1.z.array(zodInternalAlias_1.z.object({
90
+ id: zodInternalAlias_1.z.string(),
91
+ name: zodInternalAlias_1.z.string(),
92
+ props: zodInternalAlias_1.z.record(zodInternalAlias_1.z.string(), zodInternalAlias_1.z.any()),
93
+ propsSchema: zodInternalAlias_1.z.record(zodInternalAlias_1.z.string(), zodInternalAlias_1.z.any()).optional(),
93
94
  })),
94
- })),
95
+ }),
95
96
  });
96
97
  registerTool({
97
98
  name: "get_interactable_component_by_id",
@@ -113,20 +114,23 @@ const TamboInteractableProvider = ({ children, }) => {
113
114
  },
114
115
  };
115
116
  },
116
- toolSchema: v3_1.z
117
- .function()
118
- .args(v3_1.z.string())
119
- .returns(v3_1.z.object({
120
- success: v3_1.z.boolean(),
121
- component: v3_1.z
122
- .object({
123
- id: v3_1.z.string(),
124
- componentName: v3_1.z.string(),
125
- props: v3_1.z.record(v3_1.z.any()),
126
- })
127
- .optional(),
128
- error: v3_1.z.string().optional(),
129
- })),
117
+ inputSchema: zodInternalAlias_1.z.tuple([zodInternalAlias_1.z.string()]),
118
+ outputSchema: zodInternalAlias_1.z.discriminatedUnion("success", [
119
+ zodInternalAlias_1.z.object({
120
+ success: zodInternalAlias_1.z.literal(true),
121
+ component: zodInternalAlias_1.z
122
+ .object({
123
+ id: zodInternalAlias_1.z.string(),
124
+ componentName: zodInternalAlias_1.z.string(),
125
+ props: zodInternalAlias_1.z.record(zodInternalAlias_1.z.string(), zodInternalAlias_1.z.any()),
126
+ })
127
+ .optional(),
128
+ }),
129
+ zodInternalAlias_1.z.object({
130
+ success: zodInternalAlias_1.z.literal(false),
131
+ error: zodInternalAlias_1.z.string(),
132
+ }),
133
+ ]),
130
134
  });
131
135
  registerTool({
132
136
  name: "remove_interactable_component",
@@ -150,19 +154,22 @@ const TamboInteractableProvider = ({ children, }) => {
150
154
  },
151
155
  };
152
156
  },
153
- toolSchema: v3_1.z
154
- .function()
155
- .args(v3_1.z.string())
156
- .returns(v3_1.z.object({
157
- success: v3_1.z.boolean(),
158
- componentId: v3_1.z.string(),
159
- removedComponent: v3_1.z.object({
160
- id: v3_1.z.string(),
161
- componentName: v3_1.z.string(),
162
- props: v3_1.z.record(v3_1.z.any()),
157
+ inputSchema: zodInternalAlias_1.z.tuple([zodInternalAlias_1.z.string()]),
158
+ outputSchema: zodInternalAlias_1.z.discriminatedUnion("success", [
159
+ zodInternalAlias_1.z.object({
160
+ success: zodInternalAlias_1.z.literal(true),
161
+ componentId: zodInternalAlias_1.z.string(),
162
+ removedComponent: zodInternalAlias_1.z.object({
163
+ id: zodInternalAlias_1.z.string(),
164
+ componentName: zodInternalAlias_1.z.string(),
165
+ props: zodInternalAlias_1.z.record(zodInternalAlias_1.z.string(), zodInternalAlias_1.z.any()),
166
+ }),
167
+ }),
168
+ zodInternalAlias_1.z.object({
169
+ success: zodInternalAlias_1.z.literal(false),
170
+ error: zodInternalAlias_1.z.string(),
163
171
  }),
164
- error: v3_1.z.string().optional(),
165
- })),
172
+ ]),
166
173
  });
167
174
  }
168
175
  }, [interactableComponents, registerTool]);
@@ -204,19 +211,18 @@ const TamboInteractableProvider = ({ children, }) => {
204
211
  "describe" in component.propsSchema &&
205
212
  "partial" in component.propsSchema
206
213
  ? component.propsSchema.partial()
207
- : v3_1.z.object({});
214
+ : zodInternalAlias_1.z.object({});
208
215
  registerTool({
209
216
  name: `${tamboToolNamePart}${component.id}`,
210
217
  description: `Update the props of interactable component ${component.id} (${component.name}). 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.`,
211
218
  tool: (componentId, newProps) => {
212
219
  return updateInteractableComponentProps(componentId, newProps);
213
220
  },
214
- toolSchema: v3_1.z
215
- .function()
216
- .args(v3_1.z
217
- .string()
218
- .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."))
219
- .returns(v3_1.z.string()),
221
+ inputSchema: zodInternalAlias_1.z.tuple([
222
+ zodInternalAlias_1.z.string().describe("The ID of the interactable component to update"),
223
+ 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."),
224
+ ]),
225
+ outputSchema: zodInternalAlias_1.z.string(),
220
226
  });
221
227
  }, [registerTool, updateInteractableComponentProps]);
222
228
  const addInteractableComponent = (0, react_1.useCallback)((component) => {
@@ -1 +1 @@
1
- {"version":3,"file":"tambo-interactable-provider.js","sourceRoot":"","sources":["../../src/providers/tambo-interactable-provider.tsx"],"names":[],"mappings":";AAAA,0DAA0D;AAC1D,YAAY,CAAC;;;;;;;;;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AAK,EAAE,KAAK,IAC5C,QAAQ,CACyB,CACrC,CAAC;AACJ,CAAC,CAAC;AAvRW,QAAA,yBAAyB,6BAuRpC;AAEF;;;;GAIG;AACI,MAAM,oBAAoB,GAAG,GAAG,EAAE;IACvC,OAAO,IAAA,kBAAU,EAAC,wBAAwB,CAAC,CAAC;AAC9C,CAAC,CAAC;AAFW,QAAA,oBAAoB,wBAE/B;AAEF;;;;;GAKG;AACI,MAAM,+BAA+B,GAAG,GAAG,EAAE;IAClD,MAAM,EAAE,sBAAsB,EAAE,GAAG,IAAA,4BAAoB,GAAE,CAAC;IAC1D,0DAA0D;IAC1D,MAAM,IAAI,GAAG,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC9C,GAAG,CAAC;QACJ,KAAK,EAAE,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE;KACtB,CAAC,CAAC,CAAC;IAEJ,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AATW,QAAA,+BAA+B,mCAS1C","sourcesContent":["// react-sdk/src/providers/tambo-interactable-provider.tsx\n\"use client\";\nimport React, {\n createContext,\n PropsWithChildren,\n useCallback,\n useContext,\n useEffect,\n useState,\n} from \"react\";\nimport { z } from \"zod/v3\";\nimport { createInteractablesContextHelper } from \"../context-helpers/current-interactables-context-helper\";\nimport {\n TamboInteractableComponent,\n type TamboInteractableContext,\n} from \"../model/tambo-interactable\";\nimport { assertValidName } from \"../util/validate-component-name\";\nimport { useTamboComponent } from \"./tambo-component-provider\";\nimport { useTamboContextHelpers } from \"./tambo-context-helpers-provider\";\n\nconst TamboInteractableContext = createContext<TamboInteractableContext>({\n interactableComponents: [],\n addInteractableComponent: () => \"\",\n removeInteractableComponent: () => {},\n updateInteractableComponentProps: () => \"\",\n getInteractableComponent: () => undefined,\n getInteractableComponentsByName: () => [],\n clearAllInteractableComponents: () => {},\n});\n\n/**\n * The TamboInteractableProvider manages a list of components that are currently\n * interactable, allowing tambo to interact with them by updating their props. It also registers tools\n * for Tambo to perform CRUD operations on the components list.\n * @param props - The props for the TamboInteractableProvider\n * @param props.children - The children to wrap\n * @returns The TamboInteractableProvider component\n */\nexport const TamboInteractableProvider: React.FC<PropsWithChildren> = ({\n children,\n}) => {\n const [interactableComponents, setInteractableComponents] = useState<\n TamboInteractableComponent[]\n >([]);\n const { registerTool } = useTamboComponent();\n const { addContextHelper, removeContextHelper } = useTamboContextHelpers();\n\n // Create a stable context helper function\n const contextHelper = useCallback(() => {\n return createInteractablesContextHelper(() => interactableComponents)();\n }, [interactableComponents]);\n\n // Register the default interactables context helper\n useEffect(() => {\n addContextHelper(\"interactables\", contextHelper);\n\n return () => {\n removeContextHelper(\"interactables\");\n };\n }, [contextHelper, addContextHelper, removeContextHelper]);\n\n useEffect(() => {\n if (interactableComponents.length > 0) {\n registerTool({\n name: \"get_all_interactable_components\",\n description:\n \"Only use this tool if the user is asking about interactable components.Get all currently interactable components with their details including their current props. These are components that you can interact with on behalf of the user.\",\n tool: () => {\n return {\n components: interactableComponents,\n };\n },\n toolSchema: z.function().returns(\n z.object({\n components: z.array(\n z.object({\n id: z.string(),\n componentName: z.string(),\n props: z.record(z.any()),\n propsSchema: z.object({}).optional(),\n }),\n ),\n }),\n ),\n });\n\n registerTool({\n name: \"get_interactable_component_by_id\",\n description: \"Get a specific interactable component by its ID\",\n tool: (componentId: string) => {\n const component = interactableComponents.find(\n (c) => c.id === componentId,\n );\n\n if (!component) {\n return {\n success: false,\n error: `Component with ID ${componentId} not found`,\n };\n }\n\n return {\n success: true,\n component: {\n id: component.id,\n componentName: component.name,\n props: component.props,\n },\n };\n },\n toolSchema: z\n .function()\n .args(z.string())\n .returns(\n z.object({\n success: z.boolean(),\n component: z\n .object({\n id: z.string(),\n componentName: z.string(),\n props: z.record(z.any()),\n })\n .optional(),\n error: z.string().optional(),\n }),\n ),\n });\n\n registerTool({\n name: \"remove_interactable_component\",\n description: \"Remove an interactable component from the system\",\n tool: (componentId: string) => {\n const component = interactableComponents.find(\n (c) => c.id === componentId,\n );\n\n if (!component) {\n return {\n success: false,\n error: `Component with ID ${componentId} not found`,\n };\n }\n\n setInteractableComponents((prev) =>\n prev.filter((c) => c.id !== componentId),\n );\n\n return {\n success: true,\n componentId,\n removedComponent: {\n id: component.id,\n componentName: component.name,\n props: component.props,\n },\n };\n },\n toolSchema: z\n .function()\n .args(z.string())\n .returns(\n z.object({\n success: z.boolean(),\n componentId: z.string(),\n removedComponent: z.object({\n id: z.string(),\n componentName: z.string(),\n props: z.record(z.any()),\n }),\n error: z.string().optional(),\n }),\n ),\n });\n }\n }, [interactableComponents, registerTool]);\n\n const updateInteractableComponentProps = useCallback(\n (id: string, newProps: Record<string, any>): string => {\n if (!newProps || Object.keys(newProps).length === 0) {\n return `Warning: No props provided for component with ID ${id}.`;\n }\n\n setInteractableComponents((prev) => {\n const component = prev.find((c) => c.id === id);\n if (!component) {\n return prev;\n }\n\n // Compare props shallowly\n const propsChanged = Object.entries(newProps).some(([key, value]) => {\n return component.props[key] !== value;\n });\n\n if (!propsChanged) {\n return prev; // unchanged\n }\n\n // Apply partial update\n const updated = {\n ...component,\n props: { ...component.props, ...newProps },\n };\n\n const updatedComponents = [...prev];\n const idx = prev.findIndex((c) => c.id === id);\n updatedComponents[idx] = updated;\n\n return updatedComponents;\n });\n\n return \"Updated successfully\";\n },\n [],\n );\n\n const registerInteractableComponentUpdateTool = useCallback(\n (component: TamboInteractableComponent, maxNameLength = 60) => {\n const tamboToolNamePart = `update_component_`;\n const availableLength = maxNameLength - tamboToolNamePart.length;\n if (component.id.length > availableLength) {\n throw new Error(\n `Interactable component id ${component.id} is too long. It must be less than ${availableLength} characters.`,\n );\n }\n\n const schemaForArgs =\n typeof component.propsSchema === \"object\" &&\n \"describe\" in component.propsSchema &&\n \"partial\" in component.propsSchema\n ? (component.propsSchema as any).partial()\n : z.object({});\n\n registerTool({\n name: `${tamboToolNamePart}${component.id}`,\n description: `Update the props of interactable component ${component.id} (${component.name}). 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.`,\n tool: (componentId: string, newProps: any) => {\n return updateInteractableComponentProps(componentId, newProps);\n },\n toolSchema: z\n .function()\n .args(\n z\n .string()\n .describe(\"The ID of the interactable component to update\"),\n schemaForArgs.describe(\n \"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.\",\n ),\n )\n .returns(z.string()),\n });\n },\n [registerTool, updateInteractableComponentProps],\n );\n\n const addInteractableComponent = useCallback(\n (\n component: Omit<TamboInteractableComponent, \"id\" | \"createdAt\">,\n ): string => {\n // Validate component name\n assertValidName(component.name, \"component\");\n\n // Add a random part to the component name to make it unique when using multiple instances of the same component.\n const tamboGeneratedNamePart = `-${Math.random().toString(36).slice(2, 5)}`;\n const id = `${component.name}${tamboGeneratedNamePart}`;\n const newComponent: TamboInteractableComponent = {\n ...component,\n id,\n };\n\n registerInteractableComponentUpdateTool(newComponent);\n\n setInteractableComponents((prev) => {\n return [...prev, newComponent];\n });\n\n return id;\n },\n [registerInteractableComponentUpdateTool],\n );\n\n const removeInteractableComponent = useCallback((id: string) => {\n setInteractableComponents((prev) => prev.filter((c) => c.id !== id));\n }, []);\n\n const getInteractableComponent = useCallback(\n (id: string) => {\n return interactableComponents.find((c) => c.id === id);\n },\n [interactableComponents],\n );\n\n const getInteractableComponentsByName = useCallback(\n (componentName: string) => {\n return interactableComponents.filter((c) => c.name === componentName);\n },\n [interactableComponents],\n );\n\n const clearAllInteractableComponents = useCallback(() => {\n setInteractableComponents([]);\n }, []);\n\n const value: TamboInteractableContext = {\n interactableComponents,\n addInteractableComponent,\n removeInteractableComponent,\n updateInteractableComponentProps,\n getInteractableComponent,\n getInteractableComponentsByName,\n clearAllInteractableComponents,\n };\n\n return (\n <TamboInteractableContext.Provider value={value}>\n {children}\n </TamboInteractableContext.Provider>\n );\n};\n\n/**\n * The useTamboInteractable hook provides access to the interactable component\n * management functions.\n * @returns The interactable component management functions\n */\nexport const useTamboInteractable = () => {\n return useContext(TamboInteractableContext);\n};\n\n/**\n * Hook to get a cloned snapshot of the current interactables.\n * Returns a shallow copy of the array with cloned items and props to prevent\n * external mutation from affecting internal state.\n * @returns The current interactables snapshot (cloned).\n */\nexport const useCurrentInteractablesSnapshot = () => {\n const { interactableComponents } = useTamboInteractable();\n // Clone the array and each item/props to prevent mutation\n const copy = interactableComponents.map((c) => ({\n ...c,\n props: { ...c.props },\n }));\n\n return copy;\n};\n"]}
1
+ {"version":3,"file":"tambo-interactable-provider.js","sourceRoot":"","sources":["../../src/providers/tambo-interactable-provider.tsx"],"names":[],"mappings":";AAAA,0DAA0D;AAC1D,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACb,+CAOe;AACf,uDAAqC;AACrC,kHAA2G;AAK3G,6EAAkE;AAClE,yEAA+D;AAC/D,qFAA0E;AAE1E,MAAM,wBAAwB,GAAG,IAAA,qBAAa,EAA2B;IACvE,sBAAsB,EAAE,EAAE;IAC1B,wBAAwB,EAAE,GAAG,EAAE,CAAC,EAAE;IAClC,2BAA2B,EAAE,GAAG,EAAE,GAAE,CAAC;IACrC,gCAAgC,EAAE,GAAG,EAAE,CAAC,EAAE;IAC1C,wBAAwB,EAAE,GAAG,EAAE,CAAC,SAAS;IACzC,+BAA+B,EAAE,GAAG,EAAE,CAAC,EAAE;IACzC,8BAA8B,EAAE,GAAG,EAAE,GAAE,CAAC;CACzC,CAAC,CAAC;AAEH;;;;;;;GAOG;AACI,MAAM,yBAAyB,GAAgC,CAAC,EACrE,QAAQ,GACT,EAAE,EAAE;IACH,MAAM,CAAC,sBAAsB,EAAE,yBAAyB,CAAC,GAAG,IAAA,gBAAQ,EAElE,EAAE,CAAC,CAAC;IACN,MAAM,EAAE,YAAY,EAAE,GAAG,IAAA,4CAAiB,GAAE,CAAC;IAC7C,MAAM,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,GAAG,IAAA,uDAAsB,GAAE,CAAC;IAE3E,0CAA0C;IAC1C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AE,CAAC;IAC1D,0DAA0D;IAC1D,MAAM,IAAI,GAAG,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC9C,GAAG,CAAC;QACJ,KAAK,EAAE,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE;KACtB,CAAC,CAAC,CAAC;IAEJ,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AATW,QAAA,+BAA+B,mCAS1C","sourcesContent":["// react-sdk/src/providers/tambo-interactable-provider.tsx\n\"use client\";\nimport React, {\n createContext,\n PropsWithChildren,\n useCallback,\n useContext,\n useEffect,\n useState,\n} from \"react\";\nimport { z } from \"zodInternalAlias\";\nimport { createInteractablesContextHelper } from \"../context-helpers/current-interactables-context-helper\";\nimport {\n TamboInteractableComponent,\n type TamboInteractableContext,\n} from \"../model/tambo-interactable\";\nimport { assertValidName } from \"../util/validate-component-name\";\nimport { useTamboComponent } from \"./tambo-component-provider\";\nimport { useTamboContextHelpers } from \"./tambo-context-helpers-provider\";\n\nconst TamboInteractableContext = createContext<TamboInteractableContext>({\n interactableComponents: [],\n addInteractableComponent: () => \"\",\n removeInteractableComponent: () => {},\n updateInteractableComponentProps: () => \"\",\n getInteractableComponent: () => undefined,\n getInteractableComponentsByName: () => [],\n clearAllInteractableComponents: () => {},\n});\n\n/**\n * The TamboInteractableProvider manages a list of components that are currently\n * interactable, allowing tambo to interact with them by updating their props. It also registers tools\n * for Tambo to perform CRUD operations on the components list.\n * @param props - The props for the TamboInteractableProvider\n * @param props.children - The children to wrap\n * @returns The TamboInteractableProvider component\n */\nexport const TamboInteractableProvider: React.FC<PropsWithChildren> = ({\n children,\n}) => {\n const [interactableComponents, setInteractableComponents] = useState<\n TamboInteractableComponent[]\n >([]);\n const { registerTool } = useTamboComponent();\n const { addContextHelper, removeContextHelper } = useTamboContextHelpers();\n\n // Create a stable context helper function\n const contextHelper = useCallback(() => {\n return createInteractablesContextHelper(() => interactableComponents)();\n }, [interactableComponents]);\n\n // Register the default interactables context helper\n useEffect(() => {\n addContextHelper(\"interactables\", contextHelper);\n\n return () => {\n removeContextHelper(\"interactables\");\n };\n }, [contextHelper, addContextHelper, removeContextHelper]);\n\n useEffect(() => {\n if (interactableComponents.length > 0) {\n registerTool({\n name: \"get_all_interactable_components\",\n description:\n \"Only use this tool if the user is asking about interactable components.Get all currently interactable components with their details including their current props. These are components that you can interact with on behalf of the user.\",\n tool: () => {\n return {\n components: interactableComponents,\n };\n },\n inputSchema: z.tuple([]),\n outputSchema: z.object({\n components: z.array(\n z.object({\n id: z.string(),\n name: z.string(),\n props: z.record(z.string(), z.any()),\n propsSchema: z.record(z.string(), z.any()).optional(),\n }),\n ),\n }),\n });\n\n registerTool({\n name: \"get_interactable_component_by_id\",\n description: \"Get a specific interactable component by its ID\",\n tool: (componentId: string) => {\n const component = interactableComponents.find(\n (c) => c.id === componentId,\n );\n\n if (!component) {\n return {\n success: false,\n error: `Component with ID ${componentId} not found`,\n } as const;\n }\n\n return {\n success: true,\n component: {\n id: component.id,\n componentName: component.name,\n props: component.props,\n },\n } as const;\n },\n inputSchema: z.tuple([z.string()]),\n outputSchema: z.discriminatedUnion(\"success\", [\n z.object({\n success: z.literal(true),\n component: z\n .object({\n id: z.string(),\n componentName: z.string(),\n props: z.record(z.string(), z.any()),\n })\n .optional(),\n }),\n z.object({\n success: z.literal(false),\n error: z.string(),\n }),\n ]),\n });\n\n registerTool({\n name: \"remove_interactable_component\",\n description: \"Remove an interactable component from the system\",\n tool: (componentId: string) => {\n const component = interactableComponents.find(\n (c) => c.id === componentId,\n );\n\n if (!component) {\n return {\n success: false,\n error: `Component with ID ${componentId} not found`,\n } as const;\n }\n\n setInteractableComponents((prev) =>\n prev.filter((c) => c.id !== componentId),\n );\n\n return {\n success: true,\n componentId,\n removedComponent: {\n id: component.id,\n componentName: component.name,\n props: component.props,\n },\n } as const;\n },\n inputSchema: z.tuple([z.string()]),\n outputSchema: z.discriminatedUnion(\"success\", [\n z.object({\n success: z.literal(true),\n componentId: z.string(),\n removedComponent: z.object({\n id: z.string(),\n componentName: z.string(),\n props: z.record(z.string(), z.any()),\n }),\n }),\n z.object({\n success: z.literal(false),\n error: z.string(),\n }),\n ]),\n });\n }\n }, [interactableComponents, registerTool]);\n\n const updateInteractableComponentProps = useCallback(\n (id: string, newProps: Record<string, any>): string => {\n if (!newProps || Object.keys(newProps).length === 0) {\n return `Warning: No props provided for component with ID ${id}.`;\n }\n\n setInteractableComponents((prev) => {\n const component = prev.find((c) => c.id === id);\n if (!component) {\n return prev;\n }\n\n // Compare props shallowly\n const propsChanged = Object.entries(newProps).some(([key, value]) => {\n return component.props[key] !== value;\n });\n\n if (!propsChanged) {\n return prev; // unchanged\n }\n\n // Apply partial update\n const updated = {\n ...component,\n props: { ...component.props, ...newProps },\n };\n\n const updatedComponents = [...prev];\n const idx = prev.findIndex((c) => c.id === id);\n updatedComponents[idx] = updated;\n\n return updatedComponents;\n });\n\n return \"Updated successfully\";\n },\n [],\n );\n\n const registerInteractableComponentUpdateTool = useCallback(\n (component: TamboInteractableComponent, maxNameLength = 60) => {\n const tamboToolNamePart = `update_component_`;\n const availableLength = maxNameLength - tamboToolNamePart.length;\n if (component.id.length > availableLength) {\n throw new Error(\n `Interactable component id ${component.id} is too long. It must be less than ${availableLength} characters.`,\n );\n }\n\n const schemaForArgs =\n typeof component.propsSchema === \"object\" &&\n \"describe\" in component.propsSchema &&\n \"partial\" in component.propsSchema\n ? (component.propsSchema as any).partial()\n : z.object({});\n\n registerTool({\n name: `${tamboToolNamePart}${component.id}`,\n description: `Update the props of interactable component ${component.id} (${component.name}). 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.`,\n tool: (componentId: string, newProps?: any) => {\n return updateInteractableComponentProps(componentId, newProps);\n },\n inputSchema: z.tuple([\n z.string().describe(\"The ID of the interactable component to update\"),\n schemaForArgs.describe(\n \"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.\",\n ),\n ]),\n outputSchema: z.string(),\n });\n },\n [registerTool, updateInteractableComponentProps],\n );\n\n const addInteractableComponent = useCallback(\n (\n component: Omit<TamboInteractableComponent, \"id\" | \"createdAt\">,\n ): string => {\n // Validate component name\n assertValidName(component.name, \"component\");\n\n // Add a random part to the component name to make it unique when using multiple instances of the same component.\n const tamboGeneratedNamePart = `-${Math.random().toString(36).slice(2, 5)}`;\n const id = `${component.name}${tamboGeneratedNamePart}`;\n const newComponent: TamboInteractableComponent = {\n ...component,\n id,\n };\n\n registerInteractableComponentUpdateTool(newComponent);\n\n setInteractableComponents((prev) => {\n return [...prev, newComponent];\n });\n\n return id;\n },\n [registerInteractableComponentUpdateTool],\n );\n\n const removeInteractableComponent = useCallback((id: string) => {\n setInteractableComponents((prev) => prev.filter((c) => c.id !== id));\n }, []);\n\n const getInteractableComponent = useCallback(\n (id: string) => {\n return interactableComponents.find((c) => c.id === id);\n },\n [interactableComponents],\n );\n\n const getInteractableComponentsByName = useCallback(\n (componentName: string) => {\n return interactableComponents.filter((c) => c.name === componentName);\n },\n [interactableComponents],\n );\n\n const clearAllInteractableComponents = useCallback(() => {\n setInteractableComponents([]);\n }, []);\n\n const value: TamboInteractableContext = {\n interactableComponents,\n addInteractableComponent,\n removeInteractableComponent,\n updateInteractableComponentProps,\n getInteractableComponent,\n getInteractableComponentsByName,\n clearAllInteractableComponents,\n };\n\n return (\n <TamboInteractableContext.Provider value={value}>\n {children}\n </TamboInteractableContext.Provider>\n );\n};\n\n/**\n * The useTamboInteractable hook provides access to the interactable component\n * management functions.\n * @returns The interactable component management functions\n */\nexport const useTamboInteractable = () => {\n return useContext(TamboInteractableContext);\n};\n\n/**\n * Hook to get a cloned snapshot of the current interactables.\n * Returns a shallow copy of the array with cloned items and props to prevent\n * external mutation from affecting internal state.\n * @returns The current interactables snapshot (cloned).\n */\nexport const useCurrentInteractablesSnapshot = () => {\n const { interactableComponents } = useTamboInteractable();\n // Clone the array and each item/props to prevent mutation\n const copy = interactableComponents.map((c) => ({\n ...c,\n props: { ...c.props },\n }));\n\n return copy;\n};\n"]}
@@ -5,11 +5,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const react_1 = require("@testing-library/react");
7
7
  const react_2 = __importDefault(require("react"));
8
- const v3_1 = require("zod/v3");
8
+ const zodInternalAlias_1 = require("zodInternalAlias");
9
+ const with_tambo_interactable_1 = require("../hoc/with-tambo-interactable");
9
10
  const tambo_context_helpers_provider_1 = require("./tambo-context-helpers-provider");
10
11
  const tambo_interactable_provider_1 = require("./tambo-interactable-provider");
11
12
  const tambo_stubs_1 = require("./tambo-stubs");
12
- const with_tambo_interactable_1 = require("./hoc/with-tambo-interactable");
13
13
  function wrapperWithProviders(children) {
14
14
  const thread = {
15
15
  id: "t-1",
@@ -62,7 +62,7 @@ describe("Interactables AdditionalContext - Edge Cases & Advanced Scenarios", ()
62
62
  const InteractableNote = (0, with_tambo_interactable_1.withTamboInteractable)(Note, {
63
63
  componentName: "Note",
64
64
  description: "A note",
65
- propsSchema: v3_1.z.object({ title: v3_1.z.string() }),
65
+ propsSchema: zodInternalAlias_1.z.object({ title: zodInternalAlias_1.z.string() }),
66
66
  });
67
67
  let capturedContexts = [];
68
68
  const TestComponent = () => {
@@ -116,9 +116,9 @@ describe("Interactables AdditionalContext - Edge Cases & Advanced Scenarios", ()
116
116
  const InteractableCounter = (0, with_tambo_interactable_1.withTamboInteractable)(Counter, {
117
117
  componentName: "Counter",
118
118
  description: "A counter component",
119
- propsSchema: v3_1.z.object({
120
- count: v3_1.z.number(),
121
- label: v3_1.z.string().optional(),
119
+ propsSchema: zodInternalAlias_1.z.object({
120
+ count: zodInternalAlias_1.z.number(),
121
+ label: zodInternalAlias_1.z.string().optional(),
122
122
  }),
123
123
  });
124
124
  let capturedContexts = [];
@@ -174,7 +174,7 @@ describe("Interactables AdditionalContext - Edge Cases & Advanced Scenarios", ()
174
174
  const InteractableNote = (0, with_tambo_interactable_1.withTamboInteractable)(Note, {
175
175
  componentName: "Note",
176
176
  description: "A note",
177
- propsSchema: v3_1.z.object({ title: v3_1.z.string() }),
177
+ propsSchema: zodInternalAlias_1.z.object({ title: zodInternalAlias_1.z.string() }),
178
178
  });
179
179
  let outerContexts = [];
180
180
  let innerContexts = [];
@@ -239,7 +239,7 @@ describe("Interactables AdditionalContext - Edge Cases & Advanced Scenarios", ()
239
239
  const InteractableNote = (0, with_tambo_interactable_1.withTamboInteractable)(Note, {
240
240
  componentName: "Note",
241
241
  description: "A note",
242
- propsSchema: v3_1.z.object({ title: v3_1.z.string() }),
242
+ propsSchema: zodInternalAlias_1.z.object({ title: zodInternalAlias_1.z.string() }),
243
243
  });
244
244
  let capturedContexts = [];
245
245
  const TestComponent = () => {
@@ -289,7 +289,7 @@ describe("Interactables AdditionalContext - Edge Cases & Advanced Scenarios", ()
289
289
  const InteractableNote = (0, with_tambo_interactable_1.withTamboInteractable)(Note, {
290
290
  componentName: "Note",
291
291
  description: "A note",
292
- propsSchema: v3_1.z.object({ title: v3_1.z.string() }),
292
+ propsSchema: zodInternalAlias_1.z.object({ title: zodInternalAlias_1.z.string() }),
293
293
  });
294
294
  // Mock console.error to capture error logs
295
295
  const consoleSpy = jest