@tambo-ai/react 0.66.1 → 0.66.2

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 (109) hide show
  1. package/dist/hooks/use-current-message.d.ts +2 -0
  2. package/dist/hooks/use-current-message.d.ts.map +1 -1
  3. package/dist/hooks/use-current-message.js +1 -0
  4. package/dist/hooks/use-current-message.js.map +1 -1
  5. package/dist/hooks/use-current-message.test.js +5 -0
  6. package/dist/hooks/use-current-message.test.js.map +1 -1
  7. package/dist/model/component-metadata.d.ts +2 -2
  8. package/dist/model/component-metadata.d.ts.map +1 -1
  9. package/dist/model/component-metadata.js.map +1 -1
  10. package/dist/providers/tambo-interactable-provider-partial-updates.test.js +87 -87
  11. package/dist/providers/tambo-interactable-provider-partial-updates.test.js.map +1 -1
  12. package/dist/providers/tambo-interactable-provider.d.ts.map +1 -1
  13. package/dist/providers/tambo-interactable-provider.js +46 -40
  14. package/dist/providers/tambo-interactable-provider.js.map +1 -1
  15. package/dist/providers/tambo-interactables-additional-context-edge-cases.test.js +8 -8
  16. package/dist/providers/tambo-interactables-additional-context-edge-cases.test.js.map +1 -1
  17. package/dist/providers/tambo-interactables-additional-context.test.js +10 -10
  18. package/dist/providers/tambo-interactables-additional-context.test.js.map +1 -1
  19. package/dist/providers/tambo-registry-provider.test.js +28 -18
  20. package/dist/providers/tambo-registry-provider.test.js.map +1 -1
  21. package/dist/providers/tambo-registry-schema-compat.test.js +57 -28
  22. package/dist/providers/tambo-registry-schema-compat.test.js.map +1 -1
  23. package/dist/providers/tambo-thread-provider.test.js +21 -19
  24. package/dist/providers/tambo-thread-provider.test.js.map +1 -1
  25. package/dist/schema/alias.d.ts +3 -0
  26. package/dist/schema/alias.d.ts.map +1 -0
  27. package/dist/schema/alias.js +6 -0
  28. package/dist/schema/alias.js.map +1 -0
  29. package/dist/schema/json-schema.js +29 -29
  30. package/dist/schema/json-schema.js.map +1 -1
  31. package/dist/schema/schema.d.ts.map +1 -1
  32. package/dist/schema/schema.js +20 -9
  33. package/dist/schema/schema.js.map +1 -1
  34. package/dist/schema/schema.test.js +291 -3
  35. package/dist/schema/schema.test.js.map +1 -1
  36. package/dist/schema/standard-schema.js +8 -8
  37. package/dist/schema/standard-schema.js.map +1 -1
  38. package/dist/schema/validate.test.js +31 -31
  39. package/dist/schema/validate.test.js.map +1 -1
  40. package/dist/schema/zod.d.ts +1 -1
  41. package/dist/schema/zod.d.ts.map +1 -1
  42. package/dist/schema/zod.js +25 -24
  43. package/dist/schema/zod.js.map +1 -1
  44. package/dist/util/registry-validators.d.ts.map +1 -1
  45. package/dist/util/registry-validators.js +40 -0
  46. package/dist/util/registry-validators.js.map +1 -1
  47. package/dist/util/registry-validators.test.js +69 -0
  48. package/dist/util/registry-validators.test.js.map +1 -1
  49. package/dist/util/registry.d.ts +1 -5
  50. package/dist/util/registry.d.ts.map +1 -1
  51. package/dist/util/registry.js +1 -5
  52. package/dist/util/registry.js.map +1 -1
  53. package/dist/util/registry.test.js +80 -67
  54. package/dist/util/registry.test.js.map +1 -1
  55. package/esm/hooks/use-current-message.d.ts +2 -0
  56. package/esm/hooks/use-current-message.d.ts.map +1 -1
  57. package/esm/hooks/use-current-message.js +1 -0
  58. package/esm/hooks/use-current-message.js.map +1 -1
  59. package/esm/hooks/use-current-message.test.js +5 -0
  60. package/esm/hooks/use-current-message.test.js.map +1 -1
  61. package/esm/model/component-metadata.d.ts +2 -2
  62. package/esm/model/component-metadata.d.ts.map +1 -1
  63. package/esm/model/component-metadata.js.map +1 -1
  64. package/esm/providers/tambo-interactable-provider-partial-updates.test.js +1 -1
  65. package/esm/providers/tambo-interactable-provider-partial-updates.test.js.map +1 -1
  66. package/esm/providers/tambo-interactable-provider.d.ts.map +1 -1
  67. package/esm/providers/tambo-interactable-provider.js +17 -11
  68. package/esm/providers/tambo-interactable-provider.js.map +1 -1
  69. package/esm/providers/tambo-interactables-additional-context-edge-cases.test.js +1 -1
  70. package/esm/providers/tambo-interactables-additional-context-edge-cases.test.js.map +1 -1
  71. package/esm/providers/tambo-interactables-additional-context.test.js +1 -1
  72. package/esm/providers/tambo-interactables-additional-context.test.js.map +1 -1
  73. package/esm/providers/tambo-registry-provider.test.js +16 -6
  74. package/esm/providers/tambo-registry-provider.test.js.map +1 -1
  75. package/esm/providers/tambo-registry-schema-compat.test.js +57 -28
  76. package/esm/providers/tambo-registry-schema-compat.test.js.map +1 -1
  77. package/esm/providers/tambo-thread-provider.test.js +8 -6
  78. package/esm/providers/tambo-thread-provider.test.js.map +1 -1
  79. package/esm/schema/alias.d.ts +3 -0
  80. package/esm/schema/alias.d.ts.map +1 -0
  81. package/esm/schema/alias.js +13 -0
  82. package/esm/schema/alias.js.map +1 -0
  83. package/esm/schema/json-schema.js +1 -1
  84. package/esm/schema/json-schema.js.map +1 -1
  85. package/esm/schema/schema.d.ts.map +1 -1
  86. package/esm/schema/schema.js +20 -9
  87. package/esm/schema/schema.js.map +1 -1
  88. package/esm/schema/schema.test.js +258 -3
  89. package/esm/schema/schema.test.js.map +1 -1
  90. package/esm/schema/standard-schema.js +1 -1
  91. package/esm/schema/standard-schema.js.map +1 -1
  92. package/esm/schema/validate.test.js +1 -1
  93. package/esm/schema/validate.test.js.map +1 -1
  94. package/esm/schema/zod.d.ts +1 -1
  95. package/esm/schema/zod.d.ts.map +1 -1
  96. package/esm/schema/zod.js +25 -24
  97. package/esm/schema/zod.js.map +1 -1
  98. package/esm/util/registry-validators.d.ts.map +1 -1
  99. package/esm/util/registry-validators.js +40 -0
  100. package/esm/util/registry-validators.js.map +1 -1
  101. package/esm/util/registry-validators.test.js +69 -0
  102. package/esm/util/registry-validators.test.js.map +1 -1
  103. package/esm/util/registry.d.ts +1 -5
  104. package/esm/util/registry.d.ts.map +1 -1
  105. package/esm/util/registry.js +1 -5
  106. package/esm/util/registry.js.map +1 -1
  107. package/esm/util/registry.test.js +80 -67
  108. package/esm/util/registry.test.js.map +1 -1
  109. package/package.json +1 -2
@@ -1,4 +1,3 @@
1
- import * as v from "valibot";
2
1
  import * as z3 from "zod/v3";
3
2
  import * as z4 from "zod/v4";
4
3
  import { createMockTool, createMockToolWithToolSchema } from "../testing/tools";
@@ -25,7 +24,7 @@ describe("getParametersFromToolSchema (via mapTamboToolToContextTool)", () => {
25
24
  });
26
25
  describe("New inputSchema interface (object schemas)", () => {
27
26
  describe("Zod 4 object schemas", () => {
28
- it("should return single input param with object schema", () => {
27
+ it("should extract parameters from object schema properties", () => {
29
28
  const tool = createMockTool({
30
29
  inputSchema: z4.object({
31
30
  name: z4.string().describe("User name"),
@@ -34,9 +33,18 @@ describe("getParametersFromToolSchema (via mapTamboToolToContextTool)", () => {
34
33
  outputSchema: z4.boolean(),
35
34
  });
36
35
  const result = mapTamboToolToContextTool(tool);
37
- expect(result.parameters).toHaveLength(1);
38
- expect(result.parameters[0].name).toBe("input");
39
- expect(result.parameters[0].type).toBe("object");
36
+ expect(result.parameters).toHaveLength(2);
37
+ // Parameters should be extracted from object properties
38
+ const nameParam = result.parameters.find((p) => p.name === "name");
39
+ const ageParam = result.parameters.find((p) => p.name === "age");
40
+ expect(nameParam).toBeDefined();
41
+ expect(nameParam?.type).toBe("string");
42
+ expect(nameParam?.description).toBe("User name");
43
+ expect(nameParam?.isRequired).toBe(true);
44
+ expect(ageParam).toBeDefined();
45
+ expect(ageParam?.type).toBe("number");
46
+ expect(ageParam?.description).toBe("User age");
47
+ expect(ageParam?.isRequired).toBe(true);
40
48
  expect(result.parameters).toMatchSnapshot();
41
49
  });
42
50
  it("should handle complex nested objects", () => {
@@ -49,108 +57,108 @@ describe("getParametersFromToolSchema (via mapTamboToolToContextTool)", () => {
49
57
  outputSchema: z4.void(),
50
58
  });
51
59
  const result = mapTamboToolToContextTool(tool);
52
- expect(result.parameters).toHaveLength(1);
53
- expect(result.parameters[0].name).toBe("input");
60
+ expect(result.parameters).toHaveLength(3);
61
+ const pointParam = result.parameters.find((p) => p.name === "point");
62
+ const tagsParam = result.parameters.find((p) => p.name === "tags");
63
+ const colorParam = result.parameters.find((p) => p.name === "color");
64
+ expect(pointParam).toBeDefined();
65
+ expect(pointParam?.type).toBe("object");
66
+ expect(tagsParam).toBeDefined();
67
+ expect(tagsParam?.type).toBe("array");
68
+ expect(colorParam).toBeDefined();
69
+ expect(colorParam?.type).toBe("string");
54
70
  expect(result.parameters).toMatchSnapshot();
55
71
  });
56
72
  });
57
73
  describe("Zod 3 object schemas", () => {
58
- it("should return single input param with object schema", () => {
74
+ it("should extract parameters from object schema properties", () => {
59
75
  const tool = createMockTool({
60
76
  inputSchema: z3.object({
61
- name: z3.string(),
62
- age: z3.number(),
77
+ name: z3.string().describe("User name"),
78
+ age: z3.number().describe("User age"),
63
79
  }),
64
80
  outputSchema: z3.boolean(),
65
81
  });
66
82
  const result = mapTamboToolToContextTool(tool);
67
- expect(result.parameters).toHaveLength(1);
68
- expect(result.parameters[0].name).toBe("input");
69
- expect(result.parameters).toMatchSnapshot();
70
- });
71
- });
72
- describe("Valibot object schemas", () => {
73
- it("should return single input param with object schema", () => {
74
- const tool = createMockTool({
75
- inputSchema: v.object({
76
- name: v.string(),
77
- age: v.number(),
78
- }),
79
- outputSchema: v.boolean(),
80
- });
81
- const result = mapTamboToolToContextTool(tool);
82
- expect(result.parameters).toHaveLength(1);
83
- expect(result.parameters[0].name).toBe("input");
84
- expect(result.parameters).toMatchSnapshot();
85
- });
86
- it("should handle complex nested objects", () => {
87
- const tool = createMockTool({
88
- inputSchema: v.object({
89
- point: v.pipe(v.object({ x: v.number(), y: v.number() }), v.description("Point")),
90
- tags: v.array(v.string()),
91
- color: v.picklist(["red", "green", "blue"]),
92
- }),
93
- outputSchema: v.undefined(),
94
- });
95
- const result = mapTamboToolToContextTool(tool);
96
- expect(result.parameters).toHaveLength(1);
97
- expect(result.parameters[0].name).toBe("input");
83
+ expect(result.parameters).toHaveLength(2);
84
+ const nameParam = result.parameters.find((p) => p.name === "name");
85
+ const ageParam = result.parameters.find((p) => p.name === "age");
86
+ expect(nameParam).toBeDefined();
87
+ expect(nameParam?.type).toBe("string");
88
+ expect(nameParam?.isRequired).toBe(true);
89
+ expect(ageParam).toBeDefined();
90
+ expect(ageParam?.type).toBe("number");
91
+ expect(ageParam?.isRequired).toBe(true);
98
92
  expect(result.parameters).toMatchSnapshot();
99
93
  });
100
94
  });
101
95
  describe("JSON Schema object schemas", () => {
102
- it("should return single input param with object schema", () => {
96
+ it("should extract parameters from object schema properties", () => {
103
97
  const schema = {
104
98
  type: "object",
105
99
  properties: {
106
- name: { type: "string" },
107
- age: { type: "number" },
100
+ name: { type: "string", description: "User name" },
101
+ age: { type: "number", description: "User age" },
108
102
  },
109
103
  required: ["name"],
110
104
  description: "User data",
111
105
  };
112
106
  const tool = createMockTool({ inputSchema: schema, outputSchema: {} });
113
107
  const result = mapTamboToolToContextTool(tool);
114
- expect(result.parameters).toHaveLength(1);
115
- expect(result.parameters[0].name).toBe("input");
116
- expect(result.parameters[0].type).toBe("object");
117
- expect(result.parameters[0].description).toBe("User data");
108
+ expect(result.parameters).toHaveLength(2);
109
+ const nameParam = result.parameters.find((p) => p.name === "name");
110
+ const ageParam = result.parameters.find((p) => p.name === "age");
111
+ expect(nameParam).toBeDefined();
112
+ expect(nameParam?.type).toBe("string");
113
+ expect(nameParam?.description).toBe("User name");
114
+ expect(nameParam?.isRequired).toBe(true);
115
+ expect(ageParam).toBeDefined();
116
+ expect(ageParam?.type).toBe("number");
117
+ expect(ageParam?.description).toBe("User age");
118
+ expect(ageParam?.isRequired).toBe(false);
118
119
  expect(result.parameters).toMatchSnapshot();
119
120
  });
121
+ it("should handle empty object schema", () => {
122
+ const schema = {
123
+ type: "object",
124
+ properties: {},
125
+ };
126
+ const tool = createMockTool({ inputSchema: schema, outputSchema: {} });
127
+ const result = mapTamboToolToContextTool(tool);
128
+ expect(result.parameters).toHaveLength(0);
129
+ });
120
130
  });
121
131
  });
122
132
  describe("Direct schema (shorthand for inputSchema)", () => {
123
- it("should accept Zod 4 object schema directly", () => {
133
+ it("should accept Zod 4 object schema directly and extract parameters", () => {
124
134
  const tool = createMockTool(z4.object({
125
135
  name: z4.string(),
126
136
  age: z4.number(),
127
137
  }));
128
138
  const result = mapTamboToolToContextTool(tool);
129
- expect(result.parameters).toHaveLength(1);
130
- expect(result.parameters[0].name).toBe("input");
139
+ expect(result.parameters).toHaveLength(2);
140
+ const nameParam = result.parameters.find((p) => p.name === "name");
141
+ const ageParam = result.parameters.find((p) => p.name === "age");
142
+ expect(nameParam).toBeDefined();
143
+ expect(nameParam?.type).toBe("string");
144
+ expect(ageParam).toBeDefined();
145
+ expect(ageParam?.type).toBe("number");
131
146
  expect(result.parameters).toMatchSnapshot();
132
147
  });
133
- it("should accept Zod 3 object schema directly", () => {
148
+ it("should accept Zod 3 object schema directly and extract parameters", () => {
134
149
  const tool = createMockTool(z3.object({
135
150
  name: z3.string(),
136
151
  age: z3.number(),
137
152
  }));
138
153
  const result = mapTamboToolToContextTool(tool);
139
- expect(result.parameters).toHaveLength(1);
140
- expect(result.parameters[0].name).toBe("input");
141
- expect(result.parameters).toMatchSnapshot();
142
- });
143
- it("should accept Valibot object schema directly", () => {
144
- const tool = createMockTool(v.object({
145
- name: v.string(),
146
- age: v.number(),
147
- }));
148
- const result = mapTamboToolToContextTool(tool);
149
- expect(result.parameters).toHaveLength(1);
150
- expect(result.parameters[0].name).toBe("input");
154
+ expect(result.parameters).toHaveLength(2);
155
+ const nameParam = result.parameters.find((p) => p.name === "name");
156
+ const ageParam = result.parameters.find((p) => p.name === "age");
157
+ expect(nameParam).toBeDefined();
158
+ expect(ageParam).toBeDefined();
151
159
  expect(result.parameters).toMatchSnapshot();
152
160
  });
153
- it("should accept JSON Schema object directly", () => {
161
+ it("should accept JSON Schema object directly and extract parameters", () => {
154
162
  const schema = {
155
163
  type: "object",
156
164
  properties: {
@@ -160,8 +168,13 @@ describe("getParametersFromToolSchema (via mapTamboToolToContextTool)", () => {
160
168
  };
161
169
  const tool = createMockTool(schema);
162
170
  const result = mapTamboToolToContextTool(tool);
163
- expect(result.parameters).toHaveLength(1);
164
- expect(result.parameters[0].name).toBe("input");
171
+ expect(result.parameters).toHaveLength(2);
172
+ const nameParam = result.parameters.find((p) => p.name === "name");
173
+ const ageParam = result.parameters.find((p) => p.name === "age");
174
+ expect(nameParam).toBeDefined();
175
+ expect(nameParam?.type).toBe("string");
176
+ expect(ageParam).toBeDefined();
177
+ expect(ageParam?.type).toBe("number");
165
178
  expect(result.parameters).toMatchSnapshot();
166
179
  });
167
180
  });
@@ -1 +1 @@
1
- {"version":3,"file":"registry.test.js","sourceRoot":"","sources":["../../src/util/registry.test.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAEvD,QAAQ,CAAC,6DAA6D,EAAE,GAAG,EAAE;IAC3E,QAAQ,CAAC,wDAAwD,EAAE,GAAG,EAAE;QACtE,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;YAC5C,MAAM,IAAI,GAAG,4BAA4B,CACvC,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,CACxE,CAAC;YACF,MAAM,MAAM,GAAG,yBAAyB,CAAC,IAAI,CAAC,CAAC;YAC/C,mEAAmE;YACnE,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;YAC3D,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;Y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,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAChD,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,eAAe,EAAE,CAAC;QAC9C,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;YACnD,MAAM,MAAM,GAAgB;gBAC1B,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACxB,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;iBACxB;aACF,CAAC;YACF,MAAM,IAAI,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;YACpC,MAAM,MAAM,GAAG,yBAAyB,CAAC,IAAI,CAAC,CAAC;YAC/C,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;YAC1C,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAChD,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,eAAe,EAAE,CAAC;QAC9C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * Tests for getParametersFromToolSchema via mapTamboToolToContextTool.\n *\n * These tests verify that tool schemas are correctly converted to parameter specifications:\n *\n * **New interface (inputSchema)**:\n * - inputSchema should be an object schema (Zod object, Valibot object, JSON Schema object)\n * - Returns a single \"input\" parameter representing the full object schema\n * - Tool function receives single object argument: tool({ name: \"...\", age: 30 })\n *\n * **Deprecated interface (toolSchema)**:\n * - toolSchema uses z.function().args(...) pattern\n * - Returns positional parameters: param1, param2, etc.\n * - Tool function receives spread arguments: tool(value1, value2)\n */\nimport type { JSONSchema7 } from \"json-schema\";\nimport * as v from \"valibot\";\nimport * as z3 from \"zod/v3\";\nimport * as z4 from \"zod/v4\";\nimport { createMockTool, createMockToolWithToolSchema } from \"../testing/tools\";\nimport { mapTamboToolToContextTool } from \"./registry\";\n\ndescribe(\"getParametersFromToolSchema (via mapTamboToolToContextTool)\", () => {\n describe(\"Deprecated toolSchema interface (Zod function schemas)\", () => {\n it(\"should handle tool with toolSchema\", () => {\n const tool = createMockToolWithToolSchema(\n z3.function().args(z3.string().describe(\"The name\")).returns(z3.void()),\n );\n const result = mapTamboToolToContextTool(tool);\n // Should have at least one parameter (either extracted or wrapped)\n expect(result.parameters.length).toBeGreaterThanOrEqual(1);\n expect(result.name).toBe(\"testTool\");\n expect(result.description).toBe(\"A test tool\");\n });\n\n it(\"should handle toolSchema with multiple args\", () => {\n const tool = createMockToolWithToolSchema(\n z3\n .function()\n .args(\n z3.string().describe(\"First name\"),\n z3.number().describe(\"Age\"),\n z3.boolean().describe(\"Is active\"),\n )\n .returns(z3.void()),\n );\n const result = mapTamboToolToContextTool(tool);\n // Should have parameters (extraction depends on JSON Schema conversion)\n expect(result.parameters.length).toBeGreaterThanOrEqual(1);\n });\n });\n\n describe(\"New inputSchema interface (object schemas)\", () => {\n describe(\"Zod 4 object schemas\", () => {\n it(\"should return single input param with object schema\", () => {\n const tool = createMockTool({\n inputSchema: z4.object({\n name: z4.string().describe(\"User name\"),\n age: z4.number().describe(\"User age\"),\n }),\n outputSchema: z4.boolean(),\n });\n const result = mapTamboToolToContextTool(tool);\n expect(result.parameters).toHaveLength(1);\n expect(result.parameters[0].name).toBe(\"input\");\n expect(result.parameters[0].type).toBe(\"object\");\n expect(result.parameters).toMatchSnapshot();\n });\n\n it(\"should handle complex nested objects\", () => {\n const tool = createMockTool({\n inputSchema: z4.object({\n point: z4.object({ x: z4.number(), y: z4.number() }),\n tags: z4.array(z4.string()),\n color: z4.enum([\"red\", \"green\", \"blue\"]),\n }),\n outputSchema: z4.void(),\n });\n const result = mapTamboToolToContextTool(tool);\n expect(result.parameters).toHaveLength(1);\n expect(result.parameters[0].name).toBe(\"input\");\n expect(result.parameters).toMatchSnapshot();\n });\n });\n\n describe(\"Zod 3 object schemas\", () => {\n it(\"should return single input param with object schema\", () => {\n const tool = createMockTool({\n inputSchema: z3.object({\n name: z3.string(),\n age: z3.number(),\n }),\n outputSchema: z3.boolean(),\n });\n const result = mapTamboToolToContextTool(tool);\n expect(result.parameters).toHaveLength(1);\n expect(result.parameters[0].name).toBe(\"input\");\n expect(result.parameters).toMatchSnapshot();\n });\n });\n\n describe(\"Valibot object schemas\", () => {\n it(\"should return single input param with object schema\", () => {\n const tool = createMockTool({\n inputSchema: v.object({\n name: v.string(),\n age: v.number(),\n }),\n outputSchema: v.boolean(),\n });\n const result = mapTamboToolToContextTool(tool);\n expect(result.parameters).toHaveLength(1);\n expect(result.parameters[0].name).toBe(\"input\");\n expect(result.parameters).toMatchSnapshot();\n });\n\n it(\"should handle complex nested objects\", () => {\n const tool = createMockTool({\n inputSchema: v.object({\n point: v.pipe(\n v.object({ x: v.number(), y: v.number() }),\n v.description(\"Point\"),\n ),\n tags: v.array(v.string()),\n color: v.picklist([\"red\", \"green\", \"blue\"]),\n }),\n outputSchema: v.undefined(),\n });\n const result = mapTamboToolToContextTool(tool);\n expect(result.parameters).toHaveLength(1);\n expect(result.parameters[0].name).toBe(\"input\");\n expect(result.parameters).toMatchSnapshot();\n });\n });\n\n describe(\"JSON Schema object schemas\", () => {\n it(\"should return single input param with object schema\", () => {\n const schema: JSONSchema7 = {\n type: \"object\",\n properties: {\n name: { type: \"string\" },\n age: { type: \"number\" },\n },\n required: [\"name\"],\n description: \"User data\",\n };\n const tool = createMockTool({ inputSchema: schema, outputSchema: {} });\n const result = mapTamboToolToContextTool(tool);\n expect(result.parameters).toHaveLength(1);\n expect(result.parameters[0].name).toBe(\"input\");\n expect(result.parameters[0].type).toBe(\"object\");\n expect(result.parameters[0].description).toBe(\"User data\");\n expect(result.parameters).toMatchSnapshot();\n });\n });\n });\n\n describe(\"Direct schema (shorthand for inputSchema)\", () => {\n it(\"should accept Zod 4 object schema directly\", () => {\n const tool = createMockTool(\n z4.object({\n name: z4.string(),\n age: z4.number(),\n }),\n );\n const result = mapTamboToolToContextTool(tool);\n expect(result.parameters).toHaveLength(1);\n expect(result.parameters[0].name).toBe(\"input\");\n expect(result.parameters).toMatchSnapshot();\n });\n\n it(\"should accept Zod 3 object schema directly\", () => {\n const tool = createMockTool(\n z3.object({\n name: z3.string(),\n age: z3.number(),\n }),\n );\n const result = mapTamboToolToContextTool(tool);\n expect(result.parameters).toHaveLength(1);\n expect(result.parameters[0].name).toBe(\"input\");\n expect(result.parameters).toMatchSnapshot();\n });\n\n it(\"should accept Valibot object schema directly\", () => {\n const tool = createMockTool(\n v.object({\n name: v.string(),\n age: v.number(),\n }),\n );\n const result = mapTamboToolToContextTool(tool);\n expect(result.parameters).toHaveLength(1);\n expect(result.parameters[0].name).toBe(\"input\");\n expect(result.parameters).toMatchSnapshot();\n });\n\n it(\"should accept JSON Schema object directly\", () => {\n const schema: JSONSchema7 = {\n type: \"object\",\n properties: {\n name: { type: \"string\" },\n age: { type: \"number\" },\n },\n };\n const tool = createMockTool(schema);\n const result = mapTamboToolToContextTool(tool);\n expect(result.parameters).toHaveLength(1);\n expect(result.parameters[0].name).toBe(\"input\");\n expect(result.parameters).toMatchSnapshot();\n });\n });\n});\n"]}
1
+ {"version":3,"file":"registry.test.js","sourceRoot":"","sources":["../../src/util/registry.test.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAEvD,QAAQ,CAAC,6DAA6D,EAAE,GAAG,EAAE;IAC3E,QAAQ,CAAC,wDAAwD,EAAE,GAAG,EAAE;QACtE,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;YAC5C,MAAM,IAAI,GAAG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AAC,UAAU,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;YAE1C,MAAM,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC;YACnE,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC;YAEjE,MAAM,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,CAAC;YAChC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAEvC,MAAM,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;YAC/B,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAEtC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,eAAe,EAAE,CAAC;QAC9C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * Tests for getParametersFromToolSchema via mapTamboToolToContextTool.\n *\n * These tests verify that tool schemas are correctly converted to parameter specifications:\n *\n * **New interface (inputSchema)**:\n * - inputSchema should be an object schema (Zod object, Valibot object, JSON Schema object)\n * - Returns an array of parameters extracted from the object's properties\n * - Tool function receives single object argument: tool({ name: \"...\", age: 30 })\n *\n * **Deprecated interface (toolSchema)**:\n * - toolSchema uses z.function().args(...) pattern\n * - Returns positional parameters: param1, param2, etc.\n * - Tool function receives spread arguments: tool(value1, value2)\n */\nimport type { JSONSchema7 } from \"json-schema\";\nimport * as z3 from \"zod/v3\";\nimport * as z4 from \"zod/v4\";\nimport { createMockTool, createMockToolWithToolSchema } from \"../testing/tools\";\nimport { mapTamboToolToContextTool } from \"./registry\";\n\ndescribe(\"getParametersFromToolSchema (via mapTamboToolToContextTool)\", () => {\n describe(\"Deprecated toolSchema interface (Zod function schemas)\", () => {\n it(\"should handle tool with toolSchema\", () => {\n const tool = createMockToolWithToolSchema(\n z3.function().args(z3.string().describe(\"The name\")).returns(z3.void()),\n );\n const result = mapTamboToolToContextTool(tool);\n // Should have at least one parameter (either extracted or wrapped)\n expect(result.parameters.length).toBeGreaterThanOrEqual(1);\n expect(result.name).toBe(\"testTool\");\n expect(result.description).toBe(\"A test tool\");\n });\n\n it(\"should handle toolSchema with multiple args\", () => {\n const tool = createMockToolWithToolSchema(\n z3\n .function()\n .args(\n z3.string().describe(\"First name\"),\n z3.number().describe(\"Age\"),\n z3.boolean().describe(\"Is active\"),\n )\n .returns(z3.void()),\n );\n const result = mapTamboToolToContextTool(tool);\n // Should have parameters (extraction depends on JSON Schema conversion)\n expect(result.parameters.length).toBeGreaterThanOrEqual(1);\n });\n });\n\n describe(\"New inputSchema interface (object schemas)\", () => {\n describe(\"Zod 4 object schemas\", () => {\n it(\"should extract parameters from object schema properties\", () => {\n const tool = createMockTool({\n inputSchema: z4.object({\n name: z4.string().describe(\"User name\"),\n age: z4.number().describe(\"User age\"),\n }),\n outputSchema: z4.boolean(),\n });\n const result = mapTamboToolToContextTool(tool);\n expect(result.parameters).toHaveLength(2);\n\n // Parameters should be extracted from object properties\n const nameParam = result.parameters.find((p) => p.name === \"name\");\n const ageParam = result.parameters.find((p) => p.name === \"age\");\n\n expect(nameParam).toBeDefined();\n expect(nameParam?.type).toBe(\"string\");\n expect(nameParam?.description).toBe(\"User name\");\n expect(nameParam?.isRequired).toBe(true);\n\n expect(ageParam).toBeDefined();\n expect(ageParam?.type).toBe(\"number\");\n expect(ageParam?.description).toBe(\"User age\");\n expect(ageParam?.isRequired).toBe(true);\n\n expect(result.parameters).toMatchSnapshot();\n });\n\n it(\"should handle complex nested objects\", () => {\n const tool = createMockTool({\n inputSchema: z4.object({\n point: z4.object({ x: z4.number(), y: z4.number() }),\n tags: z4.array(z4.string()),\n color: z4.enum([\"red\", \"green\", \"blue\"]),\n }),\n outputSchema: z4.void(),\n });\n const result = mapTamboToolToContextTool(tool);\n expect(result.parameters).toHaveLength(3);\n\n const pointParam = result.parameters.find((p) => p.name === \"point\");\n const tagsParam = result.parameters.find((p) => p.name === \"tags\");\n const colorParam = result.parameters.find((p) => p.name === \"color\");\n\n expect(pointParam).toBeDefined();\n expect(pointParam?.type).toBe(\"object\");\n\n expect(tagsParam).toBeDefined();\n expect(tagsParam?.type).toBe(\"array\");\n\n expect(colorParam).toBeDefined();\n expect(colorParam?.type).toBe(\"string\");\n\n expect(result.parameters).toMatchSnapshot();\n });\n });\n\n describe(\"Zod 3 object schemas\", () => {\n it(\"should extract parameters from object schema properties\", () => {\n const tool = createMockTool({\n inputSchema: z3.object({\n name: z3.string().describe(\"User name\"),\n age: z3.number().describe(\"User age\"),\n }),\n outputSchema: z3.boolean(),\n });\n const result = mapTamboToolToContextTool(tool);\n expect(result.parameters).toHaveLength(2);\n\n const nameParam = result.parameters.find((p) => p.name === \"name\");\n const ageParam = result.parameters.find((p) => p.name === \"age\");\n\n expect(nameParam).toBeDefined();\n expect(nameParam?.type).toBe(\"string\");\n expect(nameParam?.isRequired).toBe(true);\n\n expect(ageParam).toBeDefined();\n expect(ageParam?.type).toBe(\"number\");\n expect(ageParam?.isRequired).toBe(true);\n\n expect(result.parameters).toMatchSnapshot();\n });\n });\n\n describe(\"JSON Schema object schemas\", () => {\n it(\"should extract parameters from object schema properties\", () => {\n const schema: JSONSchema7 = {\n type: \"object\",\n properties: {\n name: { type: \"string\", description: \"User name\" },\n age: { type: \"number\", description: \"User age\" },\n },\n required: [\"name\"],\n description: \"User data\",\n };\n const tool = createMockTool({ inputSchema: schema, outputSchema: {} });\n const result = mapTamboToolToContextTool(tool);\n expect(result.parameters).toHaveLength(2);\n\n const nameParam = result.parameters.find((p) => p.name === \"name\");\n const ageParam = result.parameters.find((p) => p.name === \"age\");\n\n expect(nameParam).toBeDefined();\n expect(nameParam?.type).toBe(\"string\");\n expect(nameParam?.description).toBe(\"User name\");\n expect(nameParam?.isRequired).toBe(true);\n\n expect(ageParam).toBeDefined();\n expect(ageParam?.type).toBe(\"number\");\n expect(ageParam?.description).toBe(\"User age\");\n expect(ageParam?.isRequired).toBe(false);\n\n expect(result.parameters).toMatchSnapshot();\n });\n\n it(\"should handle empty object schema\", () => {\n const schema: JSONSchema7 = {\n type: \"object\",\n properties: {},\n };\n const tool = createMockTool({ inputSchema: schema, outputSchema: {} });\n const result = mapTamboToolToContextTool(tool);\n expect(result.parameters).toHaveLength(0);\n });\n });\n });\n\n describe(\"Direct schema (shorthand for inputSchema)\", () => {\n it(\"should accept Zod 4 object schema directly and extract parameters\", () => {\n const tool = createMockTool(\n z4.object({\n name: z4.string(),\n age: z4.number(),\n }),\n );\n const result = mapTamboToolToContextTool(tool);\n expect(result.parameters).toHaveLength(2);\n\n const nameParam = result.parameters.find((p) => p.name === \"name\");\n const ageParam = result.parameters.find((p) => p.name === \"age\");\n\n expect(nameParam).toBeDefined();\n expect(nameParam?.type).toBe(\"string\");\n\n expect(ageParam).toBeDefined();\n expect(ageParam?.type).toBe(\"number\");\n\n expect(result.parameters).toMatchSnapshot();\n });\n\n it(\"should accept Zod 3 object schema directly and extract parameters\", () => {\n const tool = createMockTool(\n z3.object({\n name: z3.string(),\n age: z3.number(),\n }),\n );\n const result = mapTamboToolToContextTool(tool);\n expect(result.parameters).toHaveLength(2);\n\n const nameParam = result.parameters.find((p) => p.name === \"name\");\n const ageParam = result.parameters.find((p) => p.name === \"age\");\n\n expect(nameParam).toBeDefined();\n expect(ageParam).toBeDefined();\n\n expect(result.parameters).toMatchSnapshot();\n });\n\n it(\"should accept JSON Schema object directly and extract parameters\", () => {\n const schema: JSONSchema7 = {\n type: \"object\",\n properties: {\n name: { type: \"string\" },\n age: { type: \"number\" },\n },\n };\n const tool = createMockTool(schema);\n const result = mapTamboToolToContextTool(tool);\n expect(result.parameters).toHaveLength(2);\n\n const nameParam = result.parameters.find((p) => p.name === \"name\");\n const ageParam = result.parameters.find((p) => p.name === \"age\");\n\n expect(nameParam).toBeDefined();\n expect(nameParam?.type).toBe(\"string\");\n\n expect(ageParam).toBeDefined();\n expect(ageParam?.type).toBe(\"number\");\n\n expect(result.parameters).toMatchSnapshot();\n });\n });\n});\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tambo-ai/react",
3
- "version": "0.66.1",
3
+ "version": "0.66.2",
4
4
  "description": "React client package for Tambo AI",
5
5
  "repository": {
6
6
  "type": "git",
@@ -119,7 +119,6 @@
119
119
  "ts-jest": "^29.4.6",
120
120
  "typescript": "^5.9.3",
121
121
  "typescript-eslint": "^8.48.1",
122
- "valibot": "^1.2.0",
123
122
  "zod": "^3.25.76 || ^4.1.0",
124
123
  "zod-to-json-schema": "^3.25.0"
125
124
  }