@tambo-ai/react 0.59.0 → 0.62.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 (135) hide show
  1. package/dist/__tests__/util/validate-zod-schema.test.js +25 -0
  2. package/dist/__tests__/util/validate-zod-schema.test.js.map +1 -1
  3. package/dist/hooks/index.d.ts +1 -0
  4. package/dist/hooks/index.d.ts.map +1 -1
  5. package/dist/hooks/index.js +3 -1
  6. package/dist/hooks/index.js.map +1 -1
  7. package/dist/hooks/react-query-hooks.d.ts +14 -1
  8. package/dist/hooks/react-query-hooks.d.ts.map +1 -1
  9. package/dist/hooks/react-query-hooks.js +13 -0
  10. package/dist/hooks/react-query-hooks.js.map +1 -1
  11. package/dist/hooks/use-tambo-voice.d.ts +21 -0
  12. package/dist/hooks/use-tambo-voice.d.ts.map +1 -0
  13. package/dist/hooks/use-tambo-voice.js +74 -0
  14. package/dist/hooks/use-tambo-voice.js.map +1 -0
  15. package/dist/index.d.ts +1 -0
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +5 -1
  18. package/dist/index.js.map +1 -1
  19. package/dist/mcp/__tests__/elicitation.test.d.ts +2 -0
  20. package/dist/mcp/__tests__/elicitation.test.d.ts.map +1 -0
  21. package/dist/mcp/__tests__/elicitation.test.js +261 -0
  22. package/dist/mcp/__tests__/elicitation.test.js.map +1 -0
  23. package/dist/mcp/__tests__/mcp-hooks.test.d.ts +2 -0
  24. package/dist/mcp/__tests__/mcp-hooks.test.d.ts.map +1 -0
  25. package/dist/mcp/__tests__/mcp-hooks.test.js +504 -0
  26. package/dist/mcp/__tests__/mcp-hooks.test.js.map +1 -0
  27. package/dist/mcp/__tests__/tambo-mcp-provider.test.js +155 -16
  28. package/dist/mcp/__tests__/tambo-mcp-provider.test.js.map +1 -1
  29. package/dist/mcp/elicitation.d.ts +80 -0
  30. package/dist/mcp/elicitation.d.ts.map +1 -0
  31. package/dist/mcp/elicitation.js +55 -0
  32. package/dist/mcp/elicitation.js.map +1 -0
  33. package/dist/mcp/index.d.ts +3 -2
  34. package/dist/mcp/index.d.ts.map +1 -1
  35. package/dist/mcp/index.js +2 -1
  36. package/dist/mcp/index.js.map +1 -1
  37. package/dist/mcp/mcp-client.d.ts +41 -9
  38. package/dist/mcp/mcp-client.d.ts.map +1 -1
  39. package/dist/mcp/mcp-client.js.map +1 -1
  40. package/dist/mcp/mcp-hooks.d.ts +20 -6
  41. package/dist/mcp/mcp-hooks.d.ts.map +1 -1
  42. package/dist/mcp/mcp-hooks.js +71 -24
  43. package/dist/mcp/mcp-hooks.js.map +1 -1
  44. package/dist/mcp/tambo-mcp-provider.d.ts +61 -7
  45. package/dist/mcp/tambo-mcp-provider.d.ts.map +1 -1
  46. package/dist/mcp/tambo-mcp-provider.js +231 -172
  47. package/dist/mcp/tambo-mcp-provider.js.map +1 -1
  48. package/dist/providers/__tests__/tambo-thread-provider-initial-messages.test.js +1 -1
  49. package/dist/providers/__tests__/tambo-thread-provider-initial-messages.test.js.map +1 -1
  50. package/dist/providers/__tests__/tambo-thread-provider.test.js +170 -0
  51. package/dist/providers/__tests__/tambo-thread-provider.test.js.map +1 -1
  52. package/dist/providers/tambo-interactable-provider.d.ts.map +1 -1
  53. package/dist/providers/tambo-interactable-provider.js +11 -4
  54. package/dist/providers/tambo-interactable-provider.js.map +1 -1
  55. package/dist/providers/tambo-provider.d.ts +2 -0
  56. package/dist/providers/tambo-provider.d.ts.map +1 -1
  57. package/dist/providers/tambo-provider.js +4 -6
  58. package/dist/providers/tambo-provider.js.map +1 -1
  59. package/dist/providers/tambo-thread-provider.d.ts +6 -0
  60. package/dist/providers/tambo-thread-provider.d.ts.map +1 -1
  61. package/dist/providers/tambo-thread-provider.js +112 -45
  62. package/dist/providers/tambo-thread-provider.js.map +1 -1
  63. package/dist/setupTests.js +10 -0
  64. package/dist/setupTests.js.map +1 -1
  65. package/dist/util/validate-zod-schema.d.ts.map +1 -1
  66. package/dist/util/validate-zod-schema.js +11 -0
  67. package/dist/util/validate-zod-schema.js.map +1 -1
  68. package/esm/__tests__/util/validate-zod-schema.test.js +25 -0
  69. package/esm/__tests__/util/validate-zod-schema.test.js.map +1 -1
  70. package/esm/hooks/index.d.ts +1 -0
  71. package/esm/hooks/index.d.ts.map +1 -1
  72. package/esm/hooks/index.js +1 -0
  73. package/esm/hooks/index.js.map +1 -1
  74. package/esm/hooks/react-query-hooks.d.ts +14 -1
  75. package/esm/hooks/react-query-hooks.d.ts.map +1 -1
  76. package/esm/hooks/react-query-hooks.js +13 -1
  77. package/esm/hooks/react-query-hooks.js.map +1 -1
  78. package/esm/hooks/use-tambo-voice.d.ts +21 -0
  79. package/esm/hooks/use-tambo-voice.d.ts.map +1 -0
  80. package/esm/hooks/use-tambo-voice.js +71 -0
  81. package/esm/hooks/use-tambo-voice.js.map +1 -0
  82. package/esm/index.d.ts +1 -0
  83. package/esm/index.d.ts.map +1 -1
  84. package/esm/index.js +3 -0
  85. package/esm/index.js.map +1 -1
  86. package/esm/mcp/__tests__/elicitation.test.d.ts +2 -0
  87. package/esm/mcp/__tests__/elicitation.test.d.ts.map +1 -0
  88. package/esm/mcp/__tests__/elicitation.test.js +259 -0
  89. package/esm/mcp/__tests__/elicitation.test.js.map +1 -0
  90. package/esm/mcp/__tests__/mcp-hooks.test.d.ts +2 -0
  91. package/esm/mcp/__tests__/mcp-hooks.test.d.ts.map +1 -0
  92. package/esm/mcp/__tests__/mcp-hooks.test.js +469 -0
  93. package/esm/mcp/__tests__/mcp-hooks.test.js.map +1 -0
  94. package/esm/mcp/__tests__/tambo-mcp-provider.test.js +155 -16
  95. package/esm/mcp/__tests__/tambo-mcp-provider.test.js.map +1 -1
  96. package/esm/mcp/elicitation.d.ts +80 -0
  97. package/esm/mcp/elicitation.d.ts.map +1 -0
  98. package/esm/mcp/elicitation.js +52 -0
  99. package/esm/mcp/elicitation.js.map +1 -0
  100. package/esm/mcp/index.d.ts +3 -2
  101. package/esm/mcp/index.d.ts.map +1 -1
  102. package/esm/mcp/index.js +1 -1
  103. package/esm/mcp/index.js.map +1 -1
  104. package/esm/mcp/mcp-client.d.ts +41 -9
  105. package/esm/mcp/mcp-client.d.ts.map +1 -1
  106. package/esm/mcp/mcp-client.js.map +1 -1
  107. package/esm/mcp/mcp-hooks.d.ts +20 -6
  108. package/esm/mcp/mcp-hooks.d.ts.map +1 -1
  109. package/esm/mcp/mcp-hooks.js +73 -26
  110. package/esm/mcp/mcp-hooks.js.map +1 -1
  111. package/esm/mcp/tambo-mcp-provider.d.ts +61 -7
  112. package/esm/mcp/tambo-mcp-provider.d.ts.map +1 -1
  113. package/esm/mcp/tambo-mcp-provider.js +231 -173
  114. package/esm/mcp/tambo-mcp-provider.js.map +1 -1
  115. package/esm/providers/__tests__/tambo-thread-provider-initial-messages.test.js +1 -1
  116. package/esm/providers/__tests__/tambo-thread-provider-initial-messages.test.js.map +1 -1
  117. package/esm/providers/__tests__/tambo-thread-provider.test.js +170 -0
  118. package/esm/providers/__tests__/tambo-thread-provider.test.js.map +1 -1
  119. package/esm/providers/tambo-interactable-provider.d.ts.map +1 -1
  120. package/esm/providers/tambo-interactable-provider.js +11 -4
  121. package/esm/providers/tambo-interactable-provider.js.map +1 -1
  122. package/esm/providers/tambo-provider.d.ts +2 -0
  123. package/esm/providers/tambo-provider.d.ts.map +1 -1
  124. package/esm/providers/tambo-provider.js +4 -6
  125. package/esm/providers/tambo-provider.js.map +1 -1
  126. package/esm/providers/tambo-thread-provider.d.ts +6 -0
  127. package/esm/providers/tambo-thread-provider.d.ts.map +1 -1
  128. package/esm/providers/tambo-thread-provider.js +112 -45
  129. package/esm/providers/tambo-thread-provider.js.map +1 -1
  130. package/esm/setupTests.js +10 -0
  131. package/esm/setupTests.js.map +1 -1
  132. package/esm/util/validate-zod-schema.d.ts.map +1 -1
  133. package/esm/util/validate-zod-schema.js +11 -0
  134. package/esm/util/validate-zod-schema.js.map +1 -1
  135. package/package.json +10 -9
@@ -67,5 +67,30 @@ describe("assertNoZodRecord", () => {
67
67
  const schema = zod_1.z.record(zod_1.z.string());
68
68
  expect(() => (0, validate_zod_schema_1.assertNoZodRecord)(schema, "mySchema")).toThrow('z.record() is not supported in mySchema. Found at path "(root)". Replace it with z.object({ ... }) using explicit keys.');
69
69
  });
70
+ it("should handle ZodLazy schemas", () => {
71
+ const schema = zod_1.z.lazy(() => zod_1.z.record(zod_1.z.string()));
72
+ expect(() => (0, validate_zod_schema_1.assertNoZodRecord)(schema)).toThrow('z.record() is not supported in schema. Found at path "(root)". Replace it with z.object({ ... }) using explicit keys.');
73
+ });
74
+ it("should allow z.function() with valid arguments", () => {
75
+ const schema = zod_1.z
76
+ .function()
77
+ .args(zod_1.z.string(), zod_1.z.number())
78
+ .returns(zod_1.z.string());
79
+ expect(() => (0, validate_zod_schema_1.assertNoZodRecord)(schema)).not.toThrow();
80
+ });
81
+ it("should throw when z.function() arguments contain z.record()", () => {
82
+ const schema = zod_1.z.function().args(zod_1.z.record(zod_1.z.string())).returns(zod_1.z.string());
83
+ expect(() => (0, validate_zod_schema_1.assertNoZodRecord)(schema)).toThrow('z.record() is not supported in schema. Found at path "args.0". Replace it with z.object({ ... }) using explicit keys.');
84
+ });
85
+ it("should throw when z.function() arguments contain nested z.record()", () => {
86
+ const schema = zod_1.z
87
+ .function()
88
+ .args(zod_1.z.object({
89
+ name: zod_1.z.string(),
90
+ metadata: zod_1.z.record(zod_1.z.string()),
91
+ }))
92
+ .returns(zod_1.z.string());
93
+ expect(() => (0, validate_zod_schema_1.assertNoZodRecord)(schema)).toThrow('z.record() is not supported in schema. Found at path "args.0.metadata". Replace it with z.object({ ... }) using explicit keys.');
94
+ });
70
95
  });
71
96
  //# sourceMappingURL=validate-zod-schema.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"validate-zod-schema.test.js","sourceRoot":"","sources":["../../../src/__tests__/util/validate-zod-schema.test.ts"],"names":[],"mappings":";;AAAA,6BAAwB;AACxB,wEAAmE;AAEnE,QAAQ,CAAC,mBA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OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;QAE3D,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,uCAAiB,EAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAC7C,kHAAkH,CACnH,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE;QACzD,MAAM,MAAM,GAAG,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC;QAEpC,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,uCAAiB,EAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CACzD,yHAAyH,CAC1H,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { z } from \"zod\";\nimport { assertNoZodRecord } from \"../../util/validate-zod-schema\";\n\ndescribe(\"assertNoZodRecord\", () => {\n it(\"should allow valid schemas without records\", () => {\n const schema = z.object({\n name: z.string(),\n age: z.number(),\n tags: z.array(z.string()),\n address: z.object({\n street: z.string(),\n city: z.string(),\n }),\n });\n\n expect(() => assertNoZodRecord(schema)).not.toThrow();\n });\n\n it(\"should throw when encountering a record at root level\", () => {\n const schema = z.record(z.string());\n\n expect(() => assertNoZodRecord(schema)).toThrow(\n 'z.record() is not supported in schema. Found at path \"(root)\". Replace it with z.object({ ... }) using explicit keys.',\n );\n });\n\n it(\"should throw when encountering a nested record\", () => {\n const schema = z.object({\n name: z.string(),\n metadata: z.record(z.string()),\n });\n\n expect(() => assertNoZodRecord(schema)).toThrow(\n 'z.record() is not supported in schema. Found at path \"metadata\". Replace it with z.object({ ... }) using explicit keys.',\n );\n });\n\n it(\"should throw when encountering a record in an array\", () => {\n const schema = z.object({\n items: z.array(z.record(z.string())),\n });\n\n expect(() => assertNoZodRecord(schema)).toThrow(\n 'z.record() is not supported in schema. Found at path \"items.[]\". Replace it with z.object({ ... }) using explicit keys.',\n );\n });\n\n it(\"should throw when encountering a record in a union\", () => {\n const schema = z.union([z.string(), z.record(z.number())]);\n\n expect(() => assertNoZodRecord(schema)).toThrow(\n 'z.record() is not supported in schema. Found at path \"|1\". Replace it with z.object({ ... }) using explicit keys.',\n );\n });\n\n it(\"should throw when encountering a record in an intersection\", () => {\n const schema = z.intersection(\n z.object({ name: z.string() }),\n z.object({ metadata: z.record(z.string()) }),\n );\n\n expect(() => assertNoZodRecord(schema)).toThrow(\n 'z.record() is not supported in schema. Found at path \"&1.metadata\". Replace it with z.object({ ... }) using explicit keys.',\n );\n });\n\n it(\"should throw when encountering a record in a discriminated union\", () => {\n const schema = z.discriminatedUnion(\"type\", [\n z.object({ type: z.literal(\"string\"), value: z.string() }),\n z.object({ type: z.literal(\"record\"), value: z.record(z.number()) }),\n ]);\n\n expect(() => assertNoZodRecord(schema)).toThrow(\n 'z.record() is not supported in schema. Found at path \"|1.value\". Replace it with z.object({ ... }) using explicit keys.',\n );\n });\n\n it(\"should throw when encountering a record in an optional field\", () => {\n const schema = z.object({\n optional: z.optional(z.record(z.string())),\n });\n\n expect(() => assertNoZodRecord(schema)).toThrow(\n 'z.record() is not supported in schema. Found at path \"optional\". Replace it with z.object({ ... }) using explicit keys.',\n );\n });\n\n it(\"should throw when encountering a record in a nullable field\", () => {\n const schema = z.object({\n nullable: z.nullable(z.record(z.string())),\n });\n\n expect(() => assertNoZodRecord(schema)).toThrow(\n 'z.record() is not supported in schema. Found at path \"nullable\". Replace it with z.object({ ... }) using explicit keys.',\n );\n });\n\n it(\"should throw when encountering a record in a tuple\", () => {\n const schema = z.tuple([z.string(), z.record(z.number())]);\n\n expect(() => assertNoZodRecord(schema)).toThrow(\n 'z.record() is not supported in schema. Found at path \"1\". Replace it with z.object({ ... }) using explicit keys.',\n );\n });\n\n it(\"should use custom context name in error message\", () => {\n const schema = z.record(z.string());\n\n expect(() => assertNoZodRecord(schema, \"mySchema\")).toThrow(\n 'z.record() is not supported in mySchema. Found at path \"(root)\". Replace it with z.object({ ... }) using explicit keys.',\n );\n });\n});\n"]}
1
+ {"version":3,"file":"validate-zod-schema.test.js","sourceRoot":"","sources":["../../../src/__tests__/util/validate-zod-schema.test.ts"],"names":[],"mappings":";;AAAA,6BAAwB;AACxB,wEAAmE;AAEnE,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;QACpD,MAAM,MAAM,GAAG,OAAC,CAAC,MAAM,CAAC;YACtB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;YAChB,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;YACf,IAAI,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;YACzB,OAAO,EAAE,OAAC,CAAC,MAAM,CAAC;gBAChB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;gBAClB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;aACjB,CAAC;SACH,CAAC,CAAC;QAEH,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,uCAAiB,EAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uDAAuD,EAAE,GAAG,EAAE;QAC/D,MAAM,MAAM,GAAG,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC;QAEpC,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,uCAAiB,EAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAC7C,uHAAuH,CACxH,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;QACxD,MAAM,MAAM,GAAG,OAAC,CAAC,MAAM,CAAC;YACtB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE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AAI,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC;aAC5B,OAAO,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC;QAEvB,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,uCAAiB,EAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6DAA6D,EAAE,GAAG,EAAE;QACrE,MAAM,MAAM,GAAG,OAAC,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC;QAE3E,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,uCAAiB,EAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAC7C,uHAAuH,CACxH,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oEAAoE,EAAE,GAAG,EAAE;QAC5E,MAAM,MAAM,GAAG,OAAC;aACb,QAAQ,EAAE;aACV,IAAI,CACH,OAAC,CAAC,MAAM,CAAC;YACP,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;YAChB,QAAQ,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;SAC/B,CAAC,CACH;aACA,OAAO,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC;QAEvB,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,uCAAiB,EAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAC7C,gIAAgI,CACjI,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { z } from \"zod\";\nimport { assertNoZodRecord } from \"../../util/validate-zod-schema\";\n\ndescribe(\"assertNoZodRecord\", () => {\n it(\"should allow valid schemas without records\", () => {\n const schema = z.object({\n name: z.string(),\n age: z.number(),\n tags: z.array(z.string()),\n address: z.object({\n street: z.string(),\n city: z.string(),\n }),\n });\n\n expect(() => assertNoZodRecord(schema)).not.toThrow();\n });\n\n it(\"should throw when encountering a record at root level\", () => {\n const schema = z.record(z.string());\n\n expect(() => assertNoZodRecord(schema)).toThrow(\n 'z.record() is not supported in schema. Found at path \"(root)\". Replace it with z.object({ ... }) using explicit keys.',\n );\n });\n\n it(\"should throw when encountering a nested record\", () => {\n const schema = z.object({\n name: z.string(),\n metadata: z.record(z.string()),\n });\n\n expect(() => assertNoZodRecord(schema)).toThrow(\n 'z.record() is not supported in schema. Found at path \"metadata\". Replace it with z.object({ ... }) using explicit keys.',\n );\n });\n\n it(\"should throw when encountering a record in an array\", () => {\n const schema = z.object({\n items: z.array(z.record(z.string())),\n });\n\n expect(() => assertNoZodRecord(schema)).toThrow(\n 'z.record() is not supported in schema. Found at path \"items.[]\". Replace it with z.object({ ... }) using explicit keys.',\n );\n });\n\n it(\"should throw when encountering a record in a union\", () => {\n const schema = z.union([z.string(), z.record(z.number())]);\n\n expect(() => assertNoZodRecord(schema)).toThrow(\n 'z.record() is not supported in schema. Found at path \"|1\". Replace it with z.object({ ... }) using explicit keys.',\n );\n });\n\n it(\"should throw when encountering a record in an intersection\", () => {\n const schema = z.intersection(\n z.object({ name: z.string() }),\n z.object({ metadata: z.record(z.string()) }),\n );\n\n expect(() => assertNoZodRecord(schema)).toThrow(\n 'z.record() is not supported in schema. Found at path \"&1.metadata\". Replace it with z.object({ ... }) using explicit keys.',\n );\n });\n\n it(\"should throw when encountering a record in a discriminated union\", () => {\n const schema = z.discriminatedUnion(\"type\", [\n z.object({ type: z.literal(\"string\"), value: z.string() }),\n z.object({ type: z.literal(\"record\"), value: z.record(z.number()) }),\n ]);\n\n expect(() => assertNoZodRecord(schema)).toThrow(\n 'z.record() is not supported in schema. Found at path \"|1.value\". Replace it with z.object({ ... }) using explicit keys.',\n );\n });\n\n it(\"should throw when encountering a record in an optional field\", () => {\n const schema = z.object({\n optional: z.optional(z.record(z.string())),\n });\n\n expect(() => assertNoZodRecord(schema)).toThrow(\n 'z.record() is not supported in schema. Found at path \"optional\". Replace it with z.object({ ... }) using explicit keys.',\n );\n });\n\n it(\"should throw when encountering a record in a nullable field\", () => {\n const schema = z.object({\n nullable: z.nullable(z.record(z.string())),\n });\n\n expect(() => assertNoZodRecord(schema)).toThrow(\n 'z.record() is not supported in schema. Found at path \"nullable\". Replace it with z.object({ ... }) using explicit keys.',\n );\n });\n\n it(\"should throw when encountering a record in a tuple\", () => {\n const schema = z.tuple([z.string(), z.record(z.number())]);\n\n expect(() => assertNoZodRecord(schema)).toThrow(\n 'z.record() is not supported in schema. Found at path \"1\". Replace it with z.object({ ... }) using explicit keys.',\n );\n });\n\n it(\"should use custom context name in error message\", () => {\n const schema = z.record(z.string());\n\n expect(() => assertNoZodRecord(schema, \"mySchema\")).toThrow(\n 'z.record() is not supported in mySchema. Found at path \"(root)\". Replace it with z.object({ ... }) using explicit keys.',\n );\n });\n\n it(\"should handle ZodLazy schemas\", () => {\n const schema = z.lazy(() => z.record(z.string()));\n\n expect(() => assertNoZodRecord(schema)).toThrow(\n 'z.record() is not supported in schema. Found at path \"(root)\". Replace it with z.object({ ... }) using explicit keys.',\n );\n });\n\n it(\"should allow z.function() with valid arguments\", () => {\n const schema = z\n .function()\n .args(z.string(), z.number())\n .returns(z.string());\n\n expect(() => assertNoZodRecord(schema)).not.toThrow();\n });\n\n it(\"should throw when z.function() arguments contain z.record()\", () => {\n const schema = z.function().args(z.record(z.string())).returns(z.string());\n\n expect(() => assertNoZodRecord(schema)).toThrow(\n 'z.record() is not supported in schema. Found at path \"args.0\". Replace it with z.object({ ... }) using explicit keys.',\n );\n });\n\n it(\"should throw when z.function() arguments contain nested z.record()\", () => {\n const schema = z\n .function()\n .args(\n z.object({\n name: z.string(),\n metadata: z.record(z.string()),\n }),\n )\n .returns(z.string());\n\n expect(() => assertNoZodRecord(schema)).toThrow(\n 'z.record() is not supported in schema. Found at path \"args.0.metadata\". Replace it with z.object({ ... }) using explicit keys.',\n );\n });\n});\n"]}
@@ -5,4 +5,5 @@ export { useTamboStreamingProps } from "./use-streaming-props";
5
5
  export * from "./use-suggestions";
6
6
  export { useTamboStreamStatus, type PropStatus, type StreamStatus, } from "./use-tambo-stream-status";
7
7
  export { useTamboThreadList } from "./use-tambo-threads";
8
+ export { useTamboVoice } from "./use-tambo-voice";
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AACA,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,cAAc,mBAAmB,CAAC;AAClC,OAAO,EACL,oBAAoB,EACpB,KAAK,UAAU,EACf,KAAK,YAAY,GAClB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AACA,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,cAAc,mBAAmB,CAAC;AAClC,OAAO,EACL,oBAAoB,EACpB,KAAK,UAAU,EACf,KAAK,YAAY,GAClB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC"}
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.useTamboThreadList = exports.useTamboStreamStatus = exports.useTamboStreamingProps = exports.useTamboCurrentMessage = exports.useTamboComponentState = void 0;
17
+ exports.useTamboVoice = exports.useTamboThreadList = exports.useTamboStreamStatus = exports.useTamboStreamingProps = exports.useTamboCurrentMessage = exports.useTamboComponentState = void 0;
18
18
  // Export all hooks from this directory
19
19
  __exportStar(require("./react-query-hooks"), exports);
20
20
  var use_component_state_1 = require("./use-component-state");
@@ -28,4 +28,6 @@ var use_tambo_stream_status_1 = require("./use-tambo-stream-status");
28
28
  Object.defineProperty(exports, "useTamboStreamStatus", { enumerable: true, get: function () { return use_tambo_stream_status_1.useTamboStreamStatus; } });
29
29
  var use_tambo_threads_1 = require("./use-tambo-threads");
30
30
  Object.defineProperty(exports, "useTamboThreadList", { enumerable: true, get: function () { return use_tambo_threads_1.useTamboThreadList; } });
31
+ var use_tambo_voice_1 = require("./use-tambo-voice");
32
+ Object.defineProperty(exports, "useTamboVoice", { enumerable: true, get: function () { return use_tambo_voice_1.useTamboVoice; } });
31
33
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,uCAAuC;AACvC,sDAAoC;AACpC,6DAA+D;AAAtD,6HAAA,sBAAsB,OAAA;AAC/B,6DAA+D;AAAtD,6HAAA,sBAAsB,OAAA;AAC/B,6DAA+D;AAAtD,6HAAA,sBAAsB,OAAA;AAC/B,oDAAkC;AAClC,qEAImC;AAHjC,+HAAA,oBAAoB,OAAA;AAItB,yDAAyD;AAAhD,uHAAA,kBAAkB,OAAA","sourcesContent":["// Export all hooks from this directory\nexport * from \"./react-query-hooks\";\nexport { useTamboComponentState } from \"./use-component-state\";\nexport { useTamboCurrentMessage } from \"./use-current-message\";\nexport { useTamboStreamingProps } from \"./use-streaming-props\";\nexport * from \"./use-suggestions\";\nexport {\n useTamboStreamStatus,\n type PropStatus,\n type StreamStatus,\n} from \"./use-tambo-stream-status\";\nexport { useTamboThreadList } from \"./use-tambo-threads\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,uCAAuC;AACvC,sDAAoC;AACpC,6DAA+D;AAAtD,6HAAA,sBAAsB,OAAA;AAC/B,6DAA+D;AAAtD,6HAAA,sBAAsB,OAAA;AAC/B,6DAA+D;AAAtD,6HAAA,sBAAsB,OAAA;AAC/B,oDAAkC;AAClC,qEAImC;AAHjC,+HAAA,oBAAoB,OAAA;AAItB,yDAAyD;AAAhD,uHAAA,kBAAkB,OAAA;AAC3B,qDAAkD;AAAzC,gHAAA,aAAa,OAAA","sourcesContent":["// Export all hooks from this directory\nexport * from \"./react-query-hooks\";\nexport { useTamboComponentState } from \"./use-component-state\";\nexport { useTamboCurrentMessage } from \"./use-current-message\";\nexport { useTamboStreamingProps } from \"./use-streaming-props\";\nexport * from \"./use-suggestions\";\nexport {\n useTamboStreamStatus,\n type PropStatus,\n type StreamStatus,\n} from \"./use-tambo-stream-status\";\nexport { useTamboThreadList } from \"./use-tambo-threads\";\nexport { useTamboVoice } from \"./use-tambo-voice\";\n"]}
@@ -1,4 +1,4 @@
1
- import { QueryKey, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
1
+ import { QueriesOptions, QueriesResults, QueryKey, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
2
2
  /**
3
3
  * Wrapper around useQuery that uses the internal tambo query client.
4
4
  *
@@ -23,4 +23,17 @@ export type UseTamboMutationResult<TData = unknown, TError = Error, TVariables =
23
23
  * Type alias for the result of a query.
24
24
  */
25
25
  export type UseTamboQueryResult<TData = unknown, TError = Error> = UseQueryResult<TData, TError>;
26
+ /**
27
+ * Wrapper around useQueries that uses the internal tambo query client.
28
+ * @param options - The options for the queries, same as useQueries from `@tanstack/react-query`
29
+ * @param options.queries - The queries to run, same as queries from useQueries from `@tanstack/react-query`
30
+ * @param options.combine - The function to combine the results of the queries, same as combine from useQueries from `@tanstack/react-query`
31
+ * @param options.subscribed - Whether to subscribe to the queries, same as subscribed from useQueries from `@tanstack/react-query`
32
+ * @returns The queries result
33
+ */
34
+ export declare function useTamboQueries<T extends any[], TCombinedResult = QueriesResults<T>>({ queries, ...options }: {
35
+ queries: readonly [...QueriesOptions<T>];
36
+ combine?: (result: QueriesResults<T>) => TCombinedResult;
37
+ subscribed?: boolean;
38
+ }): TCombinedResult;
26
39
  //# sourceMappingURL=react-query-hooks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"react-query-hooks.d.ts","sourceRoot":"","sources":["../../src/hooks/react-query-hooks.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAER,kBAAkB,EAClB,iBAAiB,EAEjB,eAAe,EACf,cAAc,EACf,MAAM,uBAAuB,CAAC;AAG/B;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,YAAY,GAAG,OAAO,EACtB,MAAM,GAAG,KAAK,EACd,KAAK,GAAG,YAAY,EACpB,SAAS,SAAS,QAAQ,GAAG,QAAQ,EACrC,OAAO,EAAE,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,0EAGjE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,GAAG,OAAO,EACf,MAAM,GAAG,KAAK,EACd,UAAU,GAAG,IAAI,EACjB,QAAQ,GAAG,OAAO,EAClB,OAAO,EAAE,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,CAAC,0DAGjE;AAED;;GAEG;AACH,MAAM,MA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AmB,CAC7B,KAAK,GAAG,OAAO,EACf,MAAM,GAAG,KAAK,IACZ,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAElC;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,CAAC,SAAS,GAAG,EAAE,EACf,eAAe,GAAG,cAAc,CAAC,CAAC,CAAC,EACnC,EACA,OAAO,EACP,GAAG,OAAO,EACX,EAAE;IACD,OAAO,EAAE,SAAS,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,eAAe,CAAC;IACzD,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,mBAGA"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useTamboQuery = useTamboQuery;
4
4
  exports.useTamboMutation = useTamboMutation;
5
+ exports.useTamboQueries = useTamboQueries;
5
6
  // tamboHooks.ts
6
7
  const react_query_1 = require("@tanstack/react-query");
7
8
  const tambo_client_provider_1 = require("../providers/tambo-client-provider");
@@ -27,4 +28,16 @@ function useTamboMutation(options) {
27
28
  const queryClient = (0, tambo_client_provider_1.useTamboQueryClient)();
28
29
  return (0, react_query_1.useMutation)(options, queryClient);
29
30
  }
31
+ /**
32
+ * Wrapper around useQueries that uses the internal tambo query client.
33
+ * @param options - The options for the queries, same as useQueries from `@tanstack/react-query`
34
+ * @param options.queries - The queries to run, same as queries from useQueries from `@tanstack/react-query`
35
+ * @param options.combine - The function to combine the results of the queries, same as combine from useQueries from `@tanstack/react-query`
36
+ * @param options.subscribed - Whether to subscribe to the queries, same as subscribed from useQueries from `@tanstack/react-query`
37
+ * @returns The queries result
38
+ */
39
+ function useTamboQueries({ queries, ...options }) {
40
+ const queryClient = (0, tambo_client_provider_1.useTamboQueryClient)();
41
+ return (0, react_query_1.useQueries)({ ...options, queries }, queryClient);
42
+ }
30
43
  //# sourceMappingURL=react-query-hooks.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"react-query-hooks.js","sourceRoot":"","sources":["../../src/hooks/react-query-hooks.ts"],"names":[],"mappings":";;AAmBA,sCAQC;AASD,4CAQC;AA5CD,gBAAgB;AAChB,uDAQ+B;AAC/B,8EAAyE;AAEzE;;;;;;GAMG;AACH,SAAgB,aAAa,CAK3B,OAAgE;IAChE,MAAM,WAAW,GAAG,IAAA,2CAAmB,GAAE,CAAC;IAC1C,OAAO,IAAA,sBAAQ,EAAC,OAAO,EAAE,WAAW,CAAC,CAAC;AACxC,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,gBAAgB,CAK9B,OAAgE;IAChE,MAAM,WAAW,GAAG,IAAA,2CAAmB,GAAE,CAAC;IAC1C,OAAO,IAAA,yBAAW,EAAC,OAAO,EAAE,WAAW,CAAC,CAAC;AAC3C,CAAC","sourcesContent":["// tamboHooks.ts\nimport {\n QueryKey,\n useMutation,\n UseMutationOptions,\n UseMutationResult,\n useQuery,\n UseQueryOptions,\n UseQueryResult,\n} from \"@tanstack/react-query\";\nimport { useTamboQueryClient } from \"../providers/tambo-client-provider\";\n\n/**\n * Wrapper around useQuery that uses the internal tambo query client.\n *\n * Use this instead of useQuery from `@tanstack/react-query`\n * @param options - The options for the query, same as useQuery from `@tanstack/react-query`\n * @returns The query result\n */\nexport function useTamboQuery<\n TQueryFnData = unknown,\n TError = Error,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(options: UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>) {\n const queryClient = useTamboQueryClient();\n return useQuery(options, queryClient);\n}\n\n/**\n * Wrapper around useMutation that uses the internal tambo query client.\n *\n * Use this instead of useMutation from `@tanstack/react-query`\n * @param options - The options for the mutation, same as useMutation from `@tanstack/react-query`\n * @returns The mutation result\n */\nexport function useTamboMutation<\n TData = unknown,\n TError = Error,\n TVariables = void,\n TContext = unknown,\n>(options: UseMutationOptions<TData, TError, TVariables, TContext>) {\n const queryClient = useTamboQueryClient();\n return useMutation(options, queryClient);\n}\n\n/**\n * Type alias for the result of a mutation.\n */\nexport type UseTamboMutationResult<\n TData = unknown,\n TError = Error,\n TVariables = void,\n TContext = unknown,\n> = UseMutationResult<TData, TError, TVariables, TContext>;\n\n/**\n * Type alias for the result of a query.\n */\nexport type UseTamboQueryResult<\n TData = unknown,\n TError = Error,\n> = UseQueryResult<TData, TError>;\n"]}
1
+ {"version":3,"file":"react-query-hooks.js","sourceRoot":"","sources":["../../src/hooks/react-query-hooks.ts"],"names":[],"mappings":";;AAsBA,sCAQC;AASD,4CAQC;AA4BD,0CAaC;AAxFD,gBAAgB;AAChB,uDAW+B;AAC/B,8EAAyE;AAEzE;;;;;;GAMG;AACH,SAAgB,aAAa,CAK3B,OAAgE;IAChE,MAAM,WAAW,GAAG,IAAA,2CAAmB,GAAE,CAAC;IAC1C,OAAO,IAAA,sBAAQ,EAAC,OAAO,EAAE,WAAW,CAAC,CAAC;AACxC,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,gBAAgB,CAK9B,OAAgE;IAChE,MAAM,WAAW,GAAG,IAAA,2CAAmB,GAAE,CAAC;IAC1C,OAAO,IAAA,yBAAW,EAAC,OAAO,EAAE,WAAW,CAAC,CAAC;AAC3C,CAAC;AAoBD;;;;;;;GAOG;AACH,SAAgB,eAAe,CAG7B,EACA,OAAO,EACP,GAAG,OAAO,EAKX;IACC,MAAM,WAAW,GAAG,IAAA,2CAAmB,GAAE,CAAC;IAC1C,OAAO,IAAA,wBAAU,EAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,EAAE,WAAW,CAAC,CAAC;AAC1D,CAAC","sourcesContent":["// tamboHooks.ts\nimport {\n QueriesOptions,\n QueriesResults,\n QueryKey,\n useMutation,\n UseMutationOptions,\n UseMutationResult,\n useQueries,\n useQuery,\n UseQueryOptions,\n UseQueryResult,\n} from \"@tanstack/react-query\";\nimport { useTamboQueryClient } from \"../providers/tambo-client-provider\";\n\n/**\n * Wrapper around useQuery that uses the internal tambo query client.\n *\n * Use this instead of useQuery from `@tanstack/react-query`\n * @param options - The options for the query, same as useQuery from `@tanstack/react-query`\n * @returns The query result\n */\nexport function useTamboQuery<\n TQueryFnData = unknown,\n TError = Error,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(options: UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>) {\n const queryClient = useTamboQueryClient();\n return useQuery(options, queryClient);\n}\n\n/**\n * Wrapper around useMutation that uses the internal tambo query client.\n *\n * Use this instead of useMutation from `@tanstack/react-query`\n * @param options - The options for the mutation, same as useMutation from `@tanstack/react-query`\n * @returns The mutation result\n */\nexport function useTamboMutation<\n TData = unknown,\n TError = Error,\n TVariables = void,\n TContext = unknown,\n>(options: UseMutationOptions<TData, TError, TVariables, TContext>) {\n const queryClient = useTamboQueryClient();\n return useMutation(options, queryClient);\n}\n\n/**\n * Type alias for the result of a mutation.\n */\nexport type UseTamboMutationResult<\n TData = unknown,\n TError = Error,\n TVariables = void,\n TContext = unknown,\n> = UseMutationResult<TData, TError, TVariables, TContext>;\n\n/**\n * Type alias for the result of a query.\n */\nexport type UseTamboQueryResult<\n TData = unknown,\n TError = Error,\n> = UseQueryResult<TData, TError>;\n\n/**\n * Wrapper around useQueries that uses the internal tambo query client.\n * @param options - The options for the queries, same as useQueries from `@tanstack/react-query`\n * @param options.queries - The queries to run, same as queries from useQueries from `@tanstack/react-query`\n * @param options.combine - The function to combine the results of the queries, same as combine from useQueries from `@tanstack/react-query`\n * @param options.subscribed - Whether to subscribe to the queries, same as subscribed from useQueries from `@tanstack/react-query`\n * @returns The queries result\n */\nexport function useTamboQueries<\n T extends any[],\n TCombinedResult = QueriesResults<T>,\n>({\n queries,\n ...options\n}: {\n queries: readonly [...QueriesOptions<T>];\n combine?: (result: QueriesResults<T>) => TCombinedResult;\n subscribed?: boolean;\n}) {\n const queryClient = useTamboQueryClient();\n return useQueries({ ...options, queries }, queryClient);\n}\n"]}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Exposes functionality to record speech and transcribe it using the Tambo API.
3
+ * @returns An object with:
4
+ * - startRecording: A function to start recording audio and reset the current transcript.
5
+ * - stopRecording: A function to stop recording audio and automatically kick off transcription.
6
+ * - isRecording: A boolean indicating if the user is recording audio.
7
+ * - isTranscribing: A boolean indicating if the audio is being transcribed.
8
+ * - transcript: The transcript of the recorded audio.
9
+ * - transcriptionError: An error message if the transcription fails.
10
+ * - mediaAccessError: An error message if microphone access fails.
11
+ */
12
+ export declare function useTamboVoice(): {
13
+ startRecording: () => void;
14
+ stopRecording: () => void;
15
+ isRecording: boolean;
16
+ mediaAccessError: string;
17
+ isTranscribing: boolean;
18
+ transcript: string | null;
19
+ transcriptionError: string | null;
20
+ };
21
+ //# sourceMappingURL=use-tambo-voice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-tambo-voice.d.ts","sourceRoot":"","sources":["../../src/hooks/use-tambo-voice.tsx"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa;;;;;;;;EAyE5B"}
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useTamboVoice = useTamboVoice;
4
+ const react_1 = require("react");
5
+ const react_media_recorder_1 = require("react-media-recorder");
6
+ const tambo_client_provider_1 = require("../providers/tambo-client-provider");
7
+ const react_query_hooks_1 = require("./react-query-hooks");
8
+ /**
9
+ * Exposes functionality to record speech and transcribe it using the Tambo API.
10
+ * @returns An object with:
11
+ * - startRecording: A function to start recording audio and reset the current transcript.
12
+ * - stopRecording: A function to stop recording audio and automatically kick off transcription.
13
+ * - isRecording: A boolean indicating if the user is recording audio.
14
+ * - isTranscribing: A boolean indicating if the audio is being transcribed.
15
+ * - transcript: The transcript of the recorded audio.
16
+ * - transcriptionError: An error message if the transcription fails.
17
+ * - mediaAccessError: An error message if microphone access fails.
18
+ */
19
+ function useTamboVoice() {
20
+ const [transcript, setTranscript] = (0, react_1.useState)(null);
21
+ const client = (0, tambo_client_provider_1.useTamboClient)();
22
+ const { status, startRecording: startMediaRecording, stopRecording: stopMediaRecording, mediaBlobUrl, error: mediaAccessError, } = (0, react_media_recorder_1.useReactMediaRecorder)({
23
+ audio: true,
24
+ video: false,
25
+ blobPropertyBag: { type: "audio/webm" },
26
+ });
27
+ const isRecording = status === "recording";
28
+ const transcriptionMutation = (0, react_query_hooks_1.useTamboMutation)({
29
+ mutationFn: async (blobUrl) => {
30
+ const response = await fetch(blobUrl);
31
+ const audioBlob = await response.blob();
32
+ const file = new File([audioBlob], "recording.webm", {
33
+ type: "audio/webm",
34
+ });
35
+ return await client.beta.audio.transcribe({ file });
36
+ },
37
+ onSuccess: (transcription) => {
38
+ setTranscript(transcription);
39
+ },
40
+ });
41
+ // Trigger transcription when recording stops and we have a blob URL
42
+ const shouldTranscribe = status === "stopped" &&
43
+ mediaBlobUrl &&
44
+ !transcriptionMutation.isPending &&
45
+ !transcriptionMutation.isSuccess;
46
+ (0, react_1.useEffect)(() => {
47
+ if (shouldTranscribe) {
48
+ transcriptionMutation.mutate(mediaBlobUrl);
49
+ }
50
+ }, [shouldTranscribe, mediaBlobUrl, transcriptionMutation]);
51
+ const startRecording = (0, react_1.useCallback)(() => {
52
+ if (isRecording)
53
+ return;
54
+ // Reset state when starting new recording
55
+ setTranscript(null);
56
+ transcriptionMutation.reset(); // Clear any previous mutation state
57
+ startMediaRecording();
58
+ }, [isRecording, startMediaRecording, transcriptionMutation]);
59
+ const stopRecording = (0, react_1.useCallback)(() => {
60
+ if (isRecording) {
61
+ stopMediaRecording();
62
+ }
63
+ }, [isRecording, stopMediaRecording]);
64
+ return {
65
+ startRecording,
66
+ stopRecording,
67
+ isRecording,
68
+ mediaAccessError: mediaAccessError ?? null,
69
+ isTranscribing: transcriptionMutation.isPending,
70
+ transcript,
71
+ transcriptionError: transcriptionMutation.error?.message ?? null,
72
+ };
73
+ }
74
+ //# sourceMappingURL=use-tambo-voice.js.map
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,oEAAoE;IACpE,MAAM,gBAAgB,GACpB,MAAM,KAAK,SAAS;QACpB,YAAY;QACZ,CAAC,qBAAqB,CAAC,SAAS;QAChC,CAAC,qBAAqB,CAAC,SAAS,CAAC;IAEnC,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,gBAAgB,EAAE,CAAC;YACrB,qBAAqB,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC,EAAE,CAAC,gBAAgB,EAAE,YAAY,EAAE,qBAAqB,CAAC,CAAC,CAAC;IAE5D,MAAM,cAAc,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QACtC,IAAI,WAAW;YAAE,OAAO;QAExB,0CAA0C;QAC1C,aAAa,CAAC,IAAI,CAAC,CAAC;QACpB,qBAAqB,CAAC,KAAK,EAAE,CAAC,CAAC,oCAAoC;QACnE,mBAAmB,EAAE,CAAC;IACxB,CAAC,EAAE,CAAC,WAAW,EAAE,mBAAmB,EAAE,qBAAqB,CAAC,CAAC,CAAC;IAE9D,MAAM,aAAa,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QACrC,IAAI,WAAW,EAAE,CAAC;YAChB,kBAAkB,EAAE,CAAC;QACvB,CAAC;IACH,CAAC,EAAE,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAEtC,OAAO;QACL,cAAc;QACd,aAAa;QACb,WAAW;QACX,gBAAgB,EAAE,gBAAgB,IAAI,IAAI;QAC1C,cAAc,EAAE,qBAAqB,CAAC,SAAS;QAC/C,UAAU;QACV,kBAAkB,EAAE,qBAAqB,CAAC,KAAK,EAAE,OAAO,IAAI,IAAI;KACjE,CAAC;AACJ,CAAC","sourcesContent":["import { useCallback, useEffect, useState } from \"react\";\nimport { useReactMediaRecorder } from \"react-media-recorder\";\nimport { useTamboClient } from \"../providers/tambo-client-provider\";\nimport { useTamboMutation } from \"./react-query-hooks\";\n\n/**\n * Exposes functionality to record speech and transcribe it using the Tambo API.\n * @returns An object with:\n * - startRecording: A function to start recording audio and reset the current transcript.\n * - stopRecording: A function to stop recording audio and automatically kick off transcription.\n * - isRecording: A boolean indicating if the user is recording audio.\n * - isTranscribing: A boolean indicating if the audio is being transcribed.\n * - transcript: The transcript of the recorded audio.\n * - transcriptionError: An error message if the transcription fails.\n * - mediaAccessError: An error message if microphone access fails.\n */\nexport function useTamboVoice() {\n const [transcript, setTranscript] = useState<string | null>(null);\n const client = useTamboClient();\n const {\n status,\n startRecording: startMediaRecording,\n stopRecording: stopMediaRecording,\n mediaBlobUrl,\n error: mediaAccessError,\n } = useReactMediaRecorder({\n audio: true,\n video: false,\n blobPropertyBag: { type: \"audio/webm\" },\n });\n\n const isRecording = status === \"recording\";\n\n const transcriptionMutation = useTamboMutation<\n string,\n Error,\n string // blobUrl parameter\n >({\n mutationFn: async (blobUrl: string) => {\n const response = await fetch(blobUrl);\n const audioBlob = await response.blob();\n const file = new File([audioBlob], \"recording.webm\", {\n type: \"audio/webm\",\n });\n\n return await client.beta.audio.transcribe({ file });\n },\n onSuccess: (transcription) => {\n setTranscript(transcription);\n },\n });\n\n // Trigger transcription when recording stops and we have a blob URL\n const shouldTranscribe =\n status === \"stopped\" &&\n mediaBlobUrl &&\n !transcriptionMutation.isPending &&\n !transcriptionMutation.isSuccess;\n\n useEffect(() => {\n if (shouldTranscribe) {\n transcriptionMutation.mutate(mediaBlobUrl);\n }\n }, [shouldTranscribe, mediaBlobUrl, transcriptionMutation]);\n\n const startRecording = useCallback(() => {\n if (isRecording) return;\n\n // Reset state when starting new recording\n setTranscript(null);\n transcriptionMutation.reset(); // Clear any previous mutation state\n startMediaRecording();\n }, [isRecording, startMediaRecording, transcriptionMutation]);\n\n const stopRecording = useCallback(() => {\n if (isRecording) {\n stopMediaRecording();\n }\n }, [isRecording, stopMediaRecording]);\n\n return {\n startRecording,\n stopRecording,\n isRecording,\n mediaAccessError: mediaAccessError ?? null,\n isTranscribing: transcriptionMutation.isPending,\n transcript,\n transcriptionError: transcriptionMutation.error?.message ?? null,\n };\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export { useMessageImages, type StagedImage } from "./hooks/use-message-images";
5
5
  export { useTamboStreamingProps } from "./hooks/use-streaming-props";
6
6
  export * from "./hooks/use-suggestions";
7
7
  export { useTamboStreamStatus, type PropStatus, type StreamStatus, } from "./hooks/use-tambo-stream-status";
8
+ export { useTamboVoice } from "./hooks/use-tambo-voice";
8
9
  export { TamboClientProvider, TamboComponentProvider, TamboContextHelpersProvider, TamboPropStreamProvider, TamboProvider, TamboStubProvider, TamboThreadInputProvider, TamboThreadProvider, useIsTamboTokenUpdating, useTambo, useTamboClient, useTamboContextHelpers, useTamboGenerationStage, useTamboStream, useTamboThread, useTamboThreadInput, type TamboComponent, type TamboContextHelpersContextProps, type TamboContextHelpersProviderProps, type TamboRegistryContext, type TamboStubProviderProps, type TamboThreadInputContextProps, type TamboThreadProviderProps, } from "./providers";
9
10
  export type { APIError, RateLimitError, TamboAIError, } from "@tambo-ai/typescript-sdk";
10
11
  export type { Suggestion, SuggestionGenerateParams, SuggestionGenerateResponse, SuggestionListResponse, } from "@tambo-ai/typescript-sdk/resources/beta/threads/suggestions";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,wKAAwK;AAExK,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EACL,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,KAAK,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAChF,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,cAAc,yBAAyB,CAAC;AACxC,OAAO,EACL,oBAAoB,EACpB,KAAK,UAAU,EACf,KAAK,YAAY,GAClB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EACL,mBAAmB,EACnB,sBAA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,EAClB,KAAK,mBAAmB,EACxB,KAAK,SAAS,GACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,eAAe,EACf,KAAK,kBAAkB,GACxB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAEnF,YAAY,EACV,0BAA0B,IAAI,qBAAqB,EACnD,wBAAwB,GACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,qBAAqB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,EACvB,KAAK,0BAA0B,GAChC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,+BAA+B,EAC/B,oBAAoB,GACrB,MAAM,yCAAyC,CAAC;AAGjD,OAAO,EACL,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,iBAAiB,EACjB,eAAe,EACf,cAAc,GACf,MAAM,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
16
  };
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.currentTimeContextHelper = exports.currentPageContextHelper = exports.useTamboInteractable = exports.useCurrentInteractablesSnapshot = exports.withInteractable = exports.GenerationStage = exports.useTamboThreadList = exports.useTamboThreadInput = exports.useTamboThread = exports.useTamboStream = exports.useTamboGenerationStage = exports.useTamboContextHelpers = exports.useTamboClient = exports.useTambo = exports.useIsTamboTokenUpdating = exports.TamboThreadProvider = exports.TamboThreadInputProvider = exports.TamboStubProvider = exports.TamboProvider = exports.TamboPropStreamProvider = exports.TamboContextHelpersProvider = exports.TamboComponentProvider = exports.TamboClientProvider = exports.useTamboStreamStatus = exports.useTamboStreamingProps = exports.useMessageImages = exports.useTamboCurrentMessage = exports.TamboMessageProvider = exports.useTamboComponentState = void 0;
18
+ exports.currentTimeContextHelper = exports.currentPageContextHelper = exports.useTamboInteractable = exports.useCurrentInteractablesSnapshot = exports.withInteractable = exports.GenerationStage = exports.useTamboThreadList = exports.useTamboThreadInput = exports.useTamboThread = exports.useTamboStream = exports.useTamboGenerationStage = exports.useTamboContextHelpers = exports.useTamboClient = exports.useTambo = exports.useIsTamboTokenUpdating = exports.TamboThreadProvider = exports.TamboThreadInputProvider = exports.TamboStubProvider = exports.TamboProvider = exports.TamboPropStreamProvider = exports.TamboContextHelpersProvider = exports.TamboComponentProvider = exports.TamboClientProvider = exports.useTamboVoice = exports.useTamboStreamStatus = exports.useTamboStreamingProps = exports.useMessageImages = exports.useTamboCurrentMessage = exports.TamboMessageProvider = exports.useTamboComponentState = void 0;
19
19
  var use_component_state_1 = require("./hooks/use-component-state");
20
20
  Object.defineProperty(exports, "useTamboComponentState", { enumerable: true, get: function () { return use_component_state_1.useTamboComponentState; } });
21
21
  var use_current_message_1 = require("./hooks/use-current-message");
@@ -28,6 +28,8 @@ Object.defineProperty(exports, "useTamboStreamingProps", { enumerable: true, get
28
28
  __exportStar(require("./hooks/use-suggestions"), exports);
29
29
  var use_tambo_stream_status_1 = require("./hooks/use-tambo-stream-status");
30
30
  Object.defineProperty(exports, "useTamboStreamStatus", { enumerable: true, get: function () { return use_tambo_stream_status_1.useTamboStreamStatus; } });
31
+ var use_tambo_voice_1 = require("./hooks/use-tambo-voice");
32
+ Object.defineProperty(exports, "useTamboVoice", { enumerable: true, get: function () { return use_tambo_voice_1.useTamboVoice; } });
31
33
  // Re-export provider components
32
34
  var providers_1 = require("./providers");
33
35
  Object.defineProperty(exports, "TamboClientProvider", { enumerable: true, get: function () { return providers_1.TamboClientProvider; } });
@@ -59,4 +61,6 @@ Object.defineProperty(exports, "useTamboInteractable", { enumerable: true, get:
59
61
  var context_helpers_1 = require("./context-helpers");
60
62
  Object.defineProperty(exports, "currentPageContextHelper", { enumerable: true, get: function () { return context_helpers_1.currentPageContextHelper; } });
61
63
  Object.defineProperty(exports, "currentTimeContextHelper", { enumerable: true, get: function () { return context_helpers_1.currentTimeContextHelper; } });
64
+ // Note MCP exports like TamboMcpProvider are available separately in the
65
+ // @tambo-ai/react/mcp package
62
66
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,wKAAwK;;;;;;;;;;;;;;;;;AAExK,mEAAqE;AAA5D,6HAAA,sBAAsB,OAAA;AAC/B,mEAGqC;AAFnC,2HAAA,oBAAoB,OAAA;AACpB,6HAAA,sBAAsB,OAAA;AAExB,iEAAgF;AAAvE,sHAAA,gBAAgB,OAAA;AACzB,mEAAqE;AAA5D,6HAAA,sBAAsB,OAAA;AAC/B,0DAAwC;AACxC,2EAIyC;AAHvC,+HAAA,oBAAoB,OAAA;AAKtB,gCAAgC;AAChC,yCAwBqB;AAvBnB,gHAAA,mBAAmB,OAAA;AACnB,mHAAA,sBAAsB,OAAA;AACtB,wHAAA,2BAA2B,OAAA;AAC3B,oHAAA,uBAAuB,OAAA;AACvB,0GAAA,aAAa,OAAA;AACb,8GAAA,iBAAiB,OAAA;AACjB,qHAAA,wBAAwB,OAAA;AACxB,gHAAA,mBAAmB,OAAA;AACnB,oHAAA,uBAAuB,OAAA;AACvB,qGAAA,QAAQ,OAAA;AACR,2GAAA,cAAc,OAAA;AACd,mHAAA,sBAAsB,OAAA;AACtB,oHAAA,uBAAuB,OAAA;AACvB,2GAAA,cAAc,OAAA;AACd,2GAAA,cAAc,OAAA;AACd,gHAAA,mBAAmB,OAAA;AAsBrB,+DAA+D;AAAtD,uHAAA,kBAAkB,OAAA;AAQ3B,mFAG6C;AAF3C,8HAAA,eAAe,OAAA;AAUjB,mFAIiD;AAH/C,2HAAA,qBAAqB,OAAoB;AAI3C,uFAGiD;AAF/C,8IAAA,+BAA+B,OAAA;AAC/B,mIAAA,oBAAoB,OAAA;AAGtB,0BAA0B;AAC1B,qDAG2B;AAFzB,2HAAA,wBAAwB,OAAA;AACxB,2HAAA,wBAAwB,OAAA","sourcesContent":["/** Exports for the library. Only publically available exports are re-exported here. Anything not exported here is not supported and may change or break at any time. */\n\nexport { useTamboComponentState } from \"./hooks/use-component-state\";\nexport {\n TamboMessageProvider,\n useTamboCurrentMessage,\n} from \"./hooks/use-current-message\";\nexport { useMessageImages, type StagedImage } from \"./hooks/use-message-images\";\nexport { useTamboStreamingProps } from \"./hooks/use-streaming-props\";\nexport * from \"./hooks/use-suggestions\";\nexport {\n useTamboStreamStatus,\n type PropStatus,\n type StreamStatus,\n} from \"./hooks/use-tambo-stream-status\";\n\n// Re-export provider components\nexport {\n TamboClientProvider,\n TamboComponentProvider,\n TamboContextHelpersProvider,\n TamboPropStreamProvider,\n TamboProvider,\n TamboStubProvider,\n TamboThreadInputProvider,\n TamboThreadProvider,\n useIsTamboTokenUpdating,\n useTambo,\n useTamboClient,\n useTamboContextHelpers,\n useTamboGenerationStage,\n useTamboStream,\n useTamboThread,\n useTamboThreadInput,\n type TamboComponent,\n type TamboContextHelpersContextProps,\n type TamboContextHelpersProviderProps,\n type TamboRegistryContext,\n type TamboStubProviderProps,\n type TamboThreadInputContextProps,\n type TamboThreadProviderProps,\n} from \"./providers\";\n\n// Re-export types from Tambo Node SDK\nexport type {\n APIError,\n RateLimitError,\n TamboAIError,\n} from \"@tambo-ai/typescript-sdk\";\nexport type {\n Suggestion,\n SuggestionGenerateParams,\n SuggestionGenerateResponse,\n SuggestionListResponse,\n} from \"@tambo-ai/typescript-sdk/resources/beta/threads/suggestions\";\nexport { useTamboThreadList } from \"./hooks/use-tambo-threads\";\nexport {\n type ComponentContextToolMetadata,\n type ComponentRegistry,\n type ParameterSpec,\n type RegisteredComponent,\n type TamboTool,\n} from \"./model/component-metadata\";\nexport {\n GenerationStage,\n type TamboThreadMessage,\n} from \"./model/generate-component-response\";\nexport { type TamboThread } from \"./model/tambo-thread\";\nexport { type InitialTamboThreadMessage } from \"./providers/tambo-thread-provider\";\n\nexport type {\n TamboInteractableComponent as InteractableComponent,\n TamboInteractableContext,\n} from \"./model/tambo-interactable\";\nexport {\n withTamboInteractable as withInteractable,\n type InteractableConfig,\n type WithTamboInteractableProps,\n} from \"./providers/hoc/with-tambo-interactable\";\nexport {\n useCurrentInteractablesSnapshot,\n useTamboInteractable,\n} from \"./providers/tambo-interactable-provider\";\n\n// Context helpers exports\nexport {\n currentPageContextHelper,\n currentTimeContextHelper,\n} from \"./context-helpers\";\nexport type {\n AdditionalContext,\n ContextHelperFn,\n ContextHelpers,\n} from \"./context-helpers\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,wKAAwK;;;;;;;;;;;;;;;;;AAExK,mEAAqE;AAA5D,6HAAA,sBAAsB,OAAA;AAC/B,mEAGqC;AAFnC,2HAAA,oBAAoB,OAAA;AACpB,6HAAA,sBAAsB,OAAA;AAExB,iEAAgF;AAAvE,sHAAA,gBAAgB,OAAA;AACzB,mEAAqE;AAA5D,6HAAA,sBAAsB,OAAA;AAC/B,0DAAwC;AACxC,2EAIyC;AAHvC,+HAAA,oBAAoB,OAAA;AAItB,2DAAwD;AAA/C,gHAAA,aAAa,OAAA;AAEtB,gCAAgC;AAChC,yCAwBqB;AAvBnB,gHAAA,mBAAmB,OAAA;AACnB,mHAAA,sBAAsB,OAAA;AACtB,wHAAA,2BAA2B,OAAA;AAC3B,oHAAA,uBAAuB,OAAA;AACvB,0GAAA,aAAa,OAAA;AACb,8GAAA,iBAAiB,OAAA;AACjB,qHAAA,wBAAwB,OAAA;AACxB,gHAAA,mBAAmB,OAAA;AACnB,oHAAA,uBAAuB,OAAA;AACvB,qGAAA,QAAQ,OAAA;AACR,2GAAA,cAAc,OAAA;AACd,mHAAA,sBAAsB,OAAA;AACtB,oHAAA,uBAAuB,OAAA;AACvB,2GAAA,cAAc,OAAA;AACd,2GAAA,cAAc,OAAA;AACd,gHAAA,mBAAmB,OAAA;AAsBrB,+DAA+D;AAAtD,uHAAA,kBAAkB,OAAA;AAQ3B,mFAG6C;AAF3C,8HAAA,eAAe,OAAA;AAUjB,mFAIiD;AAH/C,2HAAA,qBAAqB,OAAoB;AAI3C,uFAGiD;AAF/C,8IAAA,+BAA+B,OAAA;AAC/B,mIAAA,oBAAoB,OAAA;AAGtB,0BAA0B;AAC1B,qDAG2B;AAFzB,2HAAA,wBAAwB,OAAA;AACxB,2HAAA,wBAAwB,OAAA;AAQ1B,yEAAyE;AACzE,8BAA8B","sourcesContent":["/** Exports for the library. Only publically available exports are re-exported here. Anything not exported here is not supported and may change or break at any time. */\n\nexport { useTamboComponentState } from \"./hooks/use-component-state\";\nexport {\n TamboMessageProvider,\n useTamboCurrentMessage,\n} from \"./hooks/use-current-message\";\nexport { useMessageImages, type StagedImage } from \"./hooks/use-message-images\";\nexport { useTamboStreamingProps } from \"./hooks/use-streaming-props\";\nexport * from \"./hooks/use-suggestions\";\nexport {\n useTamboStreamStatus,\n type PropStatus,\n type StreamStatus,\n} from \"./hooks/use-tambo-stream-status\";\nexport { useTamboVoice } from \"./hooks/use-tambo-voice\";\n\n// Re-export provider components\nexport {\n TamboClientProvider,\n TamboComponentProvider,\n TamboContextHelpersProvider,\n TamboPropStreamProvider,\n TamboProvider,\n TamboStubProvider,\n TamboThreadInputProvider,\n TamboThreadProvider,\n useIsTamboTokenUpdating,\n useTambo,\n useTamboClient,\n useTamboContextHelpers,\n useTamboGenerationStage,\n useTamboStream,\n useTamboThread,\n useTamboThreadInput,\n type TamboComponent,\n type TamboContextHelpersContextProps,\n type TamboContextHelpersProviderProps,\n type TamboRegistryContext,\n type TamboStubProviderProps,\n type TamboThreadInputContextProps,\n type TamboThreadProviderProps,\n} from \"./providers\";\n\n// Re-export types from Tambo Node SDK\nexport type {\n APIError,\n RateLimitError,\n TamboAIError,\n} from \"@tambo-ai/typescript-sdk\";\nexport type {\n Suggestion,\n SuggestionGenerateParams,\n SuggestionGenerateResponse,\n SuggestionListResponse,\n} from \"@tambo-ai/typescript-sdk/resources/beta/threads/suggestions\";\nexport { useTamboThreadList } from \"./hooks/use-tambo-threads\";\nexport {\n type ComponentContextToolMetadata,\n type ComponentRegistry,\n type ParameterSpec,\n type RegisteredComponent,\n type TamboTool,\n} from \"./model/component-metadata\";\nexport {\n GenerationStage,\n type TamboThreadMessage,\n} from \"./model/generate-component-response\";\nexport { type TamboThread } from \"./model/tambo-thread\";\nexport { type InitialTamboThreadMessage } from \"./providers/tambo-thread-provider\";\n\nexport type {\n TamboInteractableComponent as InteractableComponent,\n TamboInteractableContext,\n} from \"./model/tambo-interactable\";\nexport {\n withTamboInteractable as withInteractable,\n type InteractableConfig,\n type WithTamboInteractableProps,\n} from \"./providers/hoc/with-tambo-interactable\";\nexport {\n useCurrentInteractablesSnapshot,\n useTamboInteractable,\n} from \"./providers/tambo-interactable-provider\";\n\n// Context helpers exports\nexport {\n currentPageContextHelper,\n currentTimeContextHelper,\n} from \"./context-helpers\";\nexport type {\n AdditionalContext,\n ContextHelperFn,\n ContextHelpers,\n} from \"./context-helpers\";\n\n// Note MCP exports like TamboMcpProvider are available separately in the\n// @tambo-ai/react/mcp package\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=elicitation.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elicitation.test.d.ts","sourceRoot":"","sources":["../../../src/mcp/__tests__/elicitation.test.tsx"],"names":[],"mappings":""}