@tambo-ai/react 0.66.1 → 0.67.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.
- package/dist/context-helpers/current-interactables-context-helper.d.ts +2 -2
- package/dist/context-helpers/current-interactables-context-helper.d.ts.map +1 -1
- package/dist/context-helpers/current-interactables-context-helper.js +17 -23
- package/dist/context-helpers/current-interactables-context-helper.js.map +1 -1
- package/dist/hoc/with-tambo-interactable.d.ts.map +1 -1
- package/dist/hoc/with-tambo-interactable.js +0 -1
- package/dist/hoc/with-tambo-interactable.js.map +1 -1
- package/dist/hooks/use-component-state.d.ts +16 -1
- package/dist/hooks/use-component-state.d.ts.map +1 -1
- package/dist/hooks/use-component-state.js +72 -12
- package/dist/hooks/use-component-state.js.map +1 -1
- package/dist/hooks/use-component-state.test.js +42 -0
- package/dist/hooks/use-component-state.test.js.map +1 -1
- package/dist/hooks/use-current-message.d.ts +3 -0
- package/dist/hooks/use-current-message.d.ts.map +1 -1
- package/dist/hooks/use-current-message.js +6 -5
- package/dist/hooks/use-current-message.js.map +1 -1
- package/dist/hooks/use-current-message.test.js +5 -0
- package/dist/hooks/use-current-message.test.js.map +1 -1
- package/dist/model/component-metadata.d.ts +2 -2
- package/dist/model/component-metadata.d.ts.map +1 -1
- package/dist/model/component-metadata.js.map +1 -1
- package/dist/model/tambo-interactable.d.ts +6 -0
- package/dist/model/tambo-interactable.d.ts.map +1 -1
- package/dist/model/tambo-interactable.js.map +1 -1
- package/dist/providers/tambo-interactable-provider-partial-updates.test.js +87 -87
- package/dist/providers/tambo-interactable-provider-partial-updates.test.js.map +1 -1
- package/dist/providers/tambo-interactable-provider.d.ts +1 -0
- package/dist/providers/tambo-interactable-provider.d.ts.map +1 -1
- package/dist/providers/tambo-interactable-provider.js +83 -47
- package/dist/providers/tambo-interactable-provider.js.map +1 -1
- package/dist/providers/tambo-interactable-provider.test.d.ts +2 -0
- package/dist/providers/tambo-interactable-provider.test.d.ts.map +1 -0
- package/dist/providers/tambo-interactable-provider.test.js +62 -0
- package/dist/providers/tambo-interactable-provider.test.js.map +1 -0
- package/dist/providers/tambo-interactables-additional-context-edge-cases.test.js +8 -8
- package/dist/providers/tambo-interactables-additional-context-edge-cases.test.js.map +1 -1
- package/dist/providers/tambo-interactables-additional-context.test.js +10 -10
- package/dist/providers/tambo-interactables-additional-context.test.js.map +1 -1
- package/dist/providers/tambo-registry-provider.test.js +28 -18
- package/dist/providers/tambo-registry-provider.test.js.map +1 -1
- package/dist/providers/tambo-registry-schema-compat.test.js +57 -28
- package/dist/providers/tambo-registry-schema-compat.test.js.map +1 -1
- package/dist/providers/tambo-thread-provider.test.js +21 -19
- package/dist/providers/tambo-thread-provider.test.js.map +1 -1
- package/dist/schema/alias.d.ts +3 -0
- package/dist/schema/alias.d.ts.map +1 -0
- package/dist/schema/alias.js +6 -0
- package/dist/schema/alias.js.map +1 -0
- package/dist/schema/json-schema.js +29 -29
- package/dist/schema/json-schema.js.map +1 -1
- package/dist/schema/schema.d.ts.map +1 -1
- package/dist/schema/schema.js +20 -9
- package/dist/schema/schema.js.map +1 -1
- package/dist/schema/schema.test.js +291 -3
- package/dist/schema/schema.test.js.map +1 -1
- package/dist/schema/standard-schema.js +8 -8
- package/dist/schema/standard-schema.js.map +1 -1
- package/dist/schema/validate.test.js +31 -31
- package/dist/schema/validate.test.js.map +1 -1
- package/dist/schema/zod.d.ts +1 -1
- package/dist/schema/zod.d.ts.map +1 -1
- package/dist/schema/zod.js +27 -26
- package/dist/schema/zod.js.map +1 -1
- package/dist/schema/zod.test.d.ts +2 -0
- package/dist/schema/zod.test.d.ts.map +1 -0
- package/dist/schema/zod.test.js +551 -0
- package/dist/schema/zod.test.js.map +1 -0
- package/dist/util/registry-validators.d.ts.map +1 -1
- package/dist/util/registry-validators.js +40 -0
- package/dist/util/registry-validators.js.map +1 -1
- package/dist/util/registry-validators.test.js +69 -0
- package/dist/util/registry-validators.test.js.map +1 -1
- package/dist/util/registry.d.ts +1 -5
- package/dist/util/registry.d.ts.map +1 -1
- package/dist/util/registry.js +1 -5
- package/dist/util/registry.js.map +1 -1
- package/dist/util/registry.test.js +80 -67
- package/dist/util/registry.test.js.map +1 -1
- package/esm/context-helpers/current-interactables-context-helper.d.ts +2 -2
- package/esm/context-helpers/current-interactables-context-helper.d.ts.map +1 -1
- package/esm/context-helpers/current-interactables-context-helper.js +17 -23
- package/esm/context-helpers/current-interactables-context-helper.js.map +1 -1
- package/esm/hoc/with-tambo-interactable.d.ts.map +1 -1
- package/esm/hoc/with-tambo-interactable.js +0 -1
- package/esm/hoc/with-tambo-interactable.js.map +1 -1
- package/esm/hooks/use-component-state.d.ts +16 -1
- package/esm/hooks/use-component-state.d.ts.map +1 -1
- package/esm/hooks/use-component-state.js +74 -14
- package/esm/hooks/use-component-state.js.map +1 -1
- package/esm/hooks/use-component-state.test.js +40 -1
- package/esm/hooks/use-component-state.test.js.map +1 -1
- package/esm/hooks/use-current-message.d.ts +3 -0
- package/esm/hooks/use-current-message.d.ts.map +1 -1
- package/esm/hooks/use-current-message.js +2 -1
- package/esm/hooks/use-current-message.js.map +1 -1
- package/esm/hooks/use-current-message.test.js +5 -0
- package/esm/hooks/use-current-message.test.js.map +1 -1
- package/esm/model/component-metadata.d.ts +2 -2
- package/esm/model/component-metadata.d.ts.map +1 -1
- package/esm/model/component-metadata.js.map +1 -1
- package/esm/model/tambo-interactable.d.ts +6 -0
- package/esm/model/tambo-interactable.d.ts.map +1 -1
- package/esm/model/tambo-interactable.js.map +1 -1
- package/esm/providers/tambo-interactable-provider-partial-updates.test.js +1 -1
- package/esm/providers/tambo-interactable-provider-partial-updates.test.js.map +1 -1
- package/esm/providers/tambo-interactable-provider.d.ts +1 -0
- package/esm/providers/tambo-interactable-provider.d.ts.map +1 -1
- package/esm/providers/tambo-interactable-provider.js +55 -19
- package/esm/providers/tambo-interactable-provider.js.map +1 -1
- package/esm/providers/tambo-interactable-provider.test.d.ts +2 -0
- package/esm/providers/tambo-interactable-provider.test.d.ts.map +1 -0
- package/esm/providers/tambo-interactable-provider.test.js +57 -0
- package/esm/providers/tambo-interactable-provider.test.js.map +1 -0
- package/esm/providers/tambo-interactables-additional-context-edge-cases.test.js +1 -1
- package/esm/providers/tambo-interactables-additional-context-edge-cases.test.js.map +1 -1
- package/esm/providers/tambo-interactables-additional-context.test.js +1 -1
- package/esm/providers/tambo-interactables-additional-context.test.js.map +1 -1
- package/esm/providers/tambo-registry-provider.test.js +16 -6
- package/esm/providers/tambo-registry-provider.test.js.map +1 -1
- package/esm/providers/tambo-registry-schema-compat.test.js +57 -28
- package/esm/providers/tambo-registry-schema-compat.test.js.map +1 -1
- package/esm/providers/tambo-thread-provider.test.js +8 -6
- package/esm/providers/tambo-thread-provider.test.js.map +1 -1
- package/esm/schema/alias.d.ts +3 -0
- package/esm/schema/alias.d.ts.map +1 -0
- package/esm/schema/alias.js +13 -0
- package/esm/schema/alias.js.map +1 -0
- package/esm/schema/json-schema.js +1 -1
- package/esm/schema/json-schema.js.map +1 -1
- package/esm/schema/schema.d.ts.map +1 -1
- package/esm/schema/schema.js +20 -9
- package/esm/schema/schema.js.map +1 -1
- package/esm/schema/schema.test.js +258 -3
- package/esm/schema/schema.test.js.map +1 -1
- package/esm/schema/standard-schema.js +1 -1
- package/esm/schema/standard-schema.js.map +1 -1
- package/esm/schema/validate.test.js +1 -1
- package/esm/schema/validate.test.js.map +1 -1
- package/esm/schema/zod.d.ts +1 -1
- package/esm/schema/zod.d.ts.map +1 -1
- package/esm/schema/zod.js +27 -26
- package/esm/schema/zod.js.map +1 -1
- package/esm/schema/zod.test.d.ts +2 -0
- package/esm/schema/zod.test.d.ts.map +1 -0
- package/esm/schema/zod.test.js +516 -0
- package/esm/schema/zod.test.js.map +1 -0
- package/esm/util/registry-validators.d.ts.map +1 -1
- package/esm/util/registry-validators.js +40 -0
- package/esm/util/registry-validators.js.map +1 -1
- package/esm/util/registry-validators.test.js +69 -0
- package/esm/util/registry-validators.test.js.map +1 -1
- package/esm/util/registry.d.ts +1 -5
- package/esm/util/registry.d.ts.map +1 -1
- package/esm/util/registry.js +1 -5
- package/esm/util/registry.js.map +1 -1
- package/esm/util/registry.test.js +80 -67
- package/esm/util/registry.test.js.map +1 -1
- package/package.json +2 -3
|
@@ -299,17 +299,17 @@ describe("Schema Compatibility", () => {
|
|
|
299
299
|
});
|
|
300
300
|
});
|
|
301
301
|
describe("Zod 4 object schemas for tools", () => {
|
|
302
|
-
// Note:
|
|
303
|
-
//
|
|
304
|
-
// For tools, we recommend using object schemas instead of function schemas
|
|
305
|
-
// since they work consistently across both versions
|
|
302
|
+
// Note: inputSchema must always be an object schema
|
|
303
|
+
// The tool function receives a single object argument with all parameters
|
|
306
304
|
it("should register tool with Zod 4 object schema", () => {
|
|
307
305
|
const { result } = renderHook(() => useTamboRegistry(), { wrapper });
|
|
308
306
|
const tool = defineTool({
|
|
309
307
|
name: "zod4-object-tool",
|
|
310
308
|
description: "Tool with Zod 4 object schema",
|
|
311
309
|
tool: jest.fn().mockResolvedValue("result"),
|
|
312
|
-
inputSchema: z4.
|
|
310
|
+
inputSchema: z4.object({
|
|
311
|
+
input: z4.string().describe("input parameter"),
|
|
312
|
+
}),
|
|
313
313
|
outputSchema: z4.string(),
|
|
314
314
|
});
|
|
315
315
|
act(() => {
|
|
@@ -323,16 +323,11 @@ describe("Schema Compatibility", () => {
|
|
|
323
323
|
name: "zod4-multi-field-tool",
|
|
324
324
|
description: "Tool with multiple Zod 4 fields",
|
|
325
325
|
tool: jest.fn().mockResolvedValue("result"),
|
|
326
|
-
inputSchema: z4.
|
|
327
|
-
z4.
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
.boolean()
|
|
332
|
-
.optional()
|
|
333
|
-
.describe("optional third argument"),
|
|
334
|
-
}),
|
|
335
|
-
]),
|
|
326
|
+
inputSchema: z4.object({
|
|
327
|
+
first: z4.string().describe("first argument"),
|
|
328
|
+
second: z4.number().describe("second argument"),
|
|
329
|
+
third: z4.boolean().optional().describe("optional third argument"),
|
|
330
|
+
}),
|
|
336
331
|
outputSchema: z4.array(z4.string()),
|
|
337
332
|
});
|
|
338
333
|
act(() => {
|
|
@@ -346,15 +341,13 @@ describe("Schema Compatibility", () => {
|
|
|
346
341
|
name: "zod4-nested-object-tool",
|
|
347
342
|
description: "Tool with Zod 4 nested object",
|
|
348
343
|
tool: jest.fn().mockResolvedValue("result"),
|
|
349
|
-
inputSchema: z4
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
.describe("search options"),
|
|
357
|
-
]),
|
|
344
|
+
inputSchema: z4
|
|
345
|
+
.object({
|
|
346
|
+
query: z4.string().describe("search query"),
|
|
347
|
+
limit: z4.number().optional().describe("max results"),
|
|
348
|
+
filters: z4.array(z4.string()).optional(),
|
|
349
|
+
})
|
|
350
|
+
.describe("search options"),
|
|
358
351
|
outputSchema: z4.array(z4.string()),
|
|
359
352
|
});
|
|
360
353
|
act(() => {
|
|
@@ -470,7 +463,9 @@ describe("Schema Compatibility", () => {
|
|
|
470
463
|
name: "invalid-zod3-record-tool",
|
|
471
464
|
description: "Tool with invalid z.record() schema",
|
|
472
465
|
tool: jest.fn().mockResolvedValue("result"),
|
|
473
|
-
inputSchema: z3.
|
|
466
|
+
inputSchema: z3.object({
|
|
467
|
+
metadata: z3.record(z3.string()),
|
|
468
|
+
}),
|
|
474
469
|
outputSchema: z3.string(),
|
|
475
470
|
});
|
|
476
471
|
expect(() => {
|
|
@@ -485,7 +480,9 @@ describe("Schema Compatibility", () => {
|
|
|
485
480
|
name: "invalid-zod4-record-tool",
|
|
486
481
|
description: "Tool with invalid Zod 4 z.record() schema",
|
|
487
482
|
tool: jest.fn().mockResolvedValue("result"),
|
|
488
|
-
inputSchema: z4.
|
|
483
|
+
inputSchema: z4.object({
|
|
484
|
+
metadata: z4.record(z4.string(), z4.string()),
|
|
485
|
+
}),
|
|
489
486
|
outputSchema: z4.string(),
|
|
490
487
|
});
|
|
491
488
|
expect(() => {
|
|
@@ -494,6 +491,36 @@ describe("Schema Compatibility", () => {
|
|
|
494
491
|
});
|
|
495
492
|
}).toThrow(/Record types \(objects with dynamic keys\) are not supported/);
|
|
496
493
|
});
|
|
494
|
+
it("should reject non-object inputSchema (tuple)", () => {
|
|
495
|
+
const { result } = renderHook(() => useTamboRegistry(), { wrapper });
|
|
496
|
+
const tool = defineTool({
|
|
497
|
+
name: "invalid-tuple-tool",
|
|
498
|
+
description: "Tool with tuple inputSchema",
|
|
499
|
+
tool: jest.fn().mockResolvedValue("result"),
|
|
500
|
+
inputSchema: z4.tuple([z4.string()]),
|
|
501
|
+
outputSchema: z4.string(),
|
|
502
|
+
});
|
|
503
|
+
expect(() => {
|
|
504
|
+
act(() => {
|
|
505
|
+
result.current.registerTool(tool);
|
|
506
|
+
});
|
|
507
|
+
}).toThrow(/must be an object schema/);
|
|
508
|
+
});
|
|
509
|
+
it("should reject non-object inputSchema (string)", () => {
|
|
510
|
+
const { result } = renderHook(() => useTamboRegistry(), { wrapper });
|
|
511
|
+
const tool = defineTool({
|
|
512
|
+
name: "invalid-string-tool",
|
|
513
|
+
description: "Tool with string inputSchema",
|
|
514
|
+
tool: jest.fn().mockResolvedValue("result"),
|
|
515
|
+
inputSchema: z4.string(),
|
|
516
|
+
outputSchema: z4.string(),
|
|
517
|
+
});
|
|
518
|
+
expect(() => {
|
|
519
|
+
act(() => {
|
|
520
|
+
result.current.registerTool(tool);
|
|
521
|
+
});
|
|
522
|
+
}).toThrow(/must be an object schema/);
|
|
523
|
+
});
|
|
497
524
|
});
|
|
498
525
|
describe("Cross-version compatibility", () => {
|
|
499
526
|
it("should register components with mixed Zod 3 and Zod 4 schemas", () => {
|
|
@@ -528,12 +555,14 @@ describe("Schema Compatibility", () => {
|
|
|
528
555
|
tool: jest.fn().mockResolvedValue("result"),
|
|
529
556
|
toolSchema: z3.function().args(z3.string()).returns(z3.string()),
|
|
530
557
|
});
|
|
531
|
-
// Zod 4 tool (using Standard Schema)
|
|
558
|
+
// Zod 4 tool (using Standard Schema with object inputSchema)
|
|
532
559
|
const zod4Tool = defineTool({
|
|
533
560
|
name: "mixed-zod4-tool",
|
|
534
561
|
description: "Zod 4 tool",
|
|
535
562
|
tool: jest.fn().mockResolvedValue("result"),
|
|
536
|
-
inputSchema: z4.
|
|
563
|
+
inputSchema: z4.object({
|
|
564
|
+
input: z4.string(),
|
|
565
|
+
}),
|
|
537
566
|
outputSchema: z4.string(),
|
|
538
567
|
});
|
|
539
568
|
// JSON Schema tool
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tambo-registry-schema-compat.test.js","sourceRoot":"","sources":["../../src/providers/tambo-registry-schema-compat.test.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE7B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EACL,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AAEnC,wCAAwC;AACxC,MAAM,aAAa,GAAkC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CACpE,iCAAM,OAAO,CAAO,CACrB,CAAC;AAEF,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,MAAM,OAAO,GAAG,CAAC,EAAE,QAAQ,EAAiC,EAAE,EAAE,CAAC,CAC/D,oBAAC,qBAAqB,QAAE,QAAQ,CAAyB,CAC1D,CAAC;IAEF,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,+CAA+C,EAAE,GAAG,EAAE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CAAC;IAEH,QAAQ,CAAC,wCAAwC,EAAE,GAAG,EAAE;QACtD,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;YAC3D,MAAM,MAAM,GAAG,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YACjD,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;YAC3D,MAAM,MAAM,GAAG,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YACjD,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,4DAA4D,EAAE,GAAG,EAAE;YACpE,MAAM,MAAM,GAAgB;gBAC1B,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;aAC1C,CAAC;YACF,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * Tests for schema compatibility with registerTool and registerComponent.\n *\n * These tests verify that the registry functions work correctly with:\n * - Zod 3 schemas (current primary)\n * - Zod 4 schemas (Standard Schema native)\n * - Raw JSON Schema objects\n */\nimport { act, renderHook } from \"@testing-library/react\";\nimport type { JSONSchema7 } from \"json-schema\";\nimport React from \"react\";\nimport * as z3 from \"zod/v3\";\nimport * as z4 from \"zod/v4\";\nimport { TamboComponent } from \"../model/component-metadata\";\nimport { defineTool } from \"../util/registry\";\nimport {\n TamboRegistryProvider,\n useTamboRegistry,\n} from \"./tambo-registry-provider\";\n\n// Test component for registration tests\nconst TestComponent: React.FC<{ message: string }> = ({ message }) => (\n <div>{message}</div>\n);\n\ndescribe(\"Schema Compatibility\", () => {\n const wrapper = ({ children }: { children: React.ReactNode }) => (\n <TamboRegistryProvider>{children}</TamboRegistryProvider>\n );\n\n beforeEach(() => {\n jest.clearAllMocks();\n });\n\n describe(\"registerComponent with different schema types\", () => {\n describe(\"Zod 3 schemas\", () => {\n it(\"should register component with Zod 3 object schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const component: TamboComponent = {\n name: \"Zod3ObjectComponent\",\n component: TestComponent,\n description: \"Component with Zod 3 object schema\",\n propsSchema: z3.object({\n message: z3.string().describe(\"The message to display\"),\n count: z3.number().optional().describe(\"Optional count\"),\n }),\n };\n\n act(() => {\n result.current.registerComponent(component);\n });\n\n expect(result.current.componentList).toHaveProperty(\n \"Zod3ObjectComponent\",\n );\n const registered = result.current.componentList.Zod3ObjectComponent;\n expect(registered.name).toBe(\"Zod3ObjectComponent\");\n expect(registered.props).toBeDefined();\n expect(registered.props).toHaveProperty(\"type\", \"object\");\n });\n\n it(\"should register component with Zod 3 nested object schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const component: TamboComponent = {\n name: \"Zod3NestedComponent\",\n component: TestComponent,\n description: \"Component with nested Zod 3 schema\",\n propsSchema: z3.object({\n user: z3.object({\n name: z3.string(),\n email: z3.string().email(),\n }),\n settings: z3.object({\n theme: z3.enum([\"light\", \"dark\"]),\n notifications: z3.boolean(),\n }),\n }),\n };\n\n act(() => {\n result.current.registerComponent(component);\n });\n\n expect(result.current.componentList).toHaveProperty(\n \"Zod3NestedComponent\",\n );\n });\n\n it(\"should register component with Zod 3 array schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const component: TamboComponent = {\n name: \"Zod3ArrayComponent\",\n component: TestComponent,\n description: \"Component with Zod 3 array schema\",\n propsSchema: z3.object({\n items: z3.array(z3.string()).describe(\"List of items\"),\n tags: z3.array(\n z3.object({\n id: z3.number(),\n label: z3.string(),\n }),\n ),\n }),\n };\n\n act(() => {\n result.current.registerComponent(component);\n });\n\n expect(result.current.componentList).toHaveProperty(\n \"Zod3ArrayComponent\",\n );\n });\n\n it(\"should register component with Zod 3 union schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const component: TamboComponent = {\n name: \"Zod3UnionComponent\",\n component: TestComponent,\n description: \"Component with Zod 3 union schema\",\n propsSchema: z3.object({\n value: z3.union([z3.string(), z3.number()]),\n status: z3.enum([\"pending\", \"active\", \"completed\"]),\n }),\n };\n\n act(() => {\n result.current.registerComponent(component);\n });\n\n expect(result.current.componentList).toHaveProperty(\n \"Zod3UnionComponent\",\n );\n });\n });\n\n describe(\"Zod 4 schemas\", () => {\n it(\"should register component with Zod 4 object schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const component: TamboComponent = {\n name: \"Zod4ObjectComponent\",\n component: TestComponent,\n description: \"Component with Zod 4 object schema\",\n propsSchema: z4.object({\n message: z4.string().describe(\"The message to display\"),\n count: z4.number().optional().describe(\"Optional count\"),\n }),\n };\n\n act(() => {\n result.current.registerComponent(component);\n });\n\n expect(result.current.componentList).toHaveProperty(\n \"Zod4ObjectComponent\",\n );\n const registered = result.current.componentList.Zod4ObjectComponent;\n expect(registered.name).toBe(\"Zod4ObjectComponent\");\n expect(registered.props).toBeDefined();\n expect(registered.props).toHaveProperty(\"type\", \"object\");\n });\n\n it(\"should register component with Zod 4 nested object schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const component: TamboComponent = {\n name: \"Zod4NestedComponent\",\n component: TestComponent,\n description: \"Component with nested Zod 4 schema\",\n propsSchema: z4.object({\n user: z4.object({\n name: z4.string(),\n email: z4.email(),\n }),\n settings: z4.object({\n theme: z4.enum([\"light\", \"dark\"]),\n notifications: z4.boolean(),\n }),\n }),\n };\n\n act(() => {\n result.current.registerComponent(component);\n });\n\n expect(result.current.componentList).toHaveProperty(\n \"Zod4NestedComponent\",\n );\n });\n\n it(\"should register component with Zod 4 array schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const component: TamboComponent = {\n name: \"Zod4ArrayComponent\",\n component: TestComponent,\n description: \"Component with Zod 4 array schema\",\n propsSchema: z4.object({\n items: z4.array(z4.string()).describe(\"List of items\"),\n tags: z4.array(\n z4.object({\n id: z4.number(),\n label: z4.string(),\n }),\n ),\n }),\n };\n\n act(() => {\n result.current.registerComponent(component);\n });\n\n expect(result.current.componentList).toHaveProperty(\n \"Zod4ArrayComponent\",\n );\n });\n\n it(\"should register component with Zod 4 union schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const component: TamboComponent = {\n name: \"Zod4UnionComponent\",\n component: TestComponent,\n description: \"Component with Zod 4 union schema\",\n propsSchema: z4.object({\n value: z4.union([z4.string(), z4.number()]),\n status: z4.enum([\"pending\", \"active\", \"completed\"]),\n }),\n };\n\n act(() => {\n result.current.registerComponent(component);\n });\n\n expect(result.current.componentList).toHaveProperty(\n \"Zod4UnionComponent\",\n );\n });\n });\n\n describe(\"JSON Schema objects\", () => {\n it(\"should register component with raw JSON Schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const jsonSchema: JSONSchema7 = {\n type: \"object\",\n properties: {\n message: { type: \"string\", description: \"The message to display\" },\n count: { type: \"number\", description: \"Optional count\" },\n },\n required: [\"message\"],\n };\n\n const component: TamboComponent = {\n name: \"JsonSchemaComponent\",\n component: TestComponent,\n description: \"Component with raw JSON Schema\",\n propsSchema: jsonSchema,\n };\n\n act(() => {\n result.current.registerComponent(component);\n });\n\n expect(result.current.componentList).toHaveProperty(\n \"JsonSchemaComponent\",\n );\n const registered = result.current.componentList.JsonSchemaComponent;\n expect(registered.props).toEqual(jsonSchema);\n });\n\n it(\"should register component with complex JSON Schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const jsonSchema: JSONSchema7 = {\n type: \"object\",\n properties: {\n user: {\n type: \"object\",\n properties: {\n name: { type: \"string\" },\n email: { type: \"string\", format: \"email\" },\n },\n required: [\"name\", \"email\"],\n },\n items: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n id: { type: \"number\" },\n label: { type: \"string\" },\n },\n },\n },\n },\n required: [\"user\"],\n };\n\n const component: TamboComponent = {\n name: \"ComplexJsonSchemaComponent\",\n component: TestComponent,\n description: \"Component with complex JSON Schema\",\n propsSchema: jsonSchema,\n };\n\n act(() => {\n result.current.registerComponent(component);\n });\n\n expect(result.current.componentList).toHaveProperty(\n \"ComplexJsonSchemaComponent\",\n );\n });\n });\n });\n\n describe(\"registerTool with different schema types\", () => {\n describe(\"Zod 3 function schemas\", () => {\n it(\"should register tool with Zod 3 function schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const tool = defineTool({\n name: \"zod3-function-tool\",\n description: \"Tool with Zod 3 function schema\",\n tool: jest.fn().mockResolvedValue(\"result\"),\n toolSchema: z3\n .function()\n .args(z3.string().describe(\"input parameter\"))\n .returns(z3.string()),\n });\n\n act(() => {\n result.current.registerTool(tool);\n });\n\n expect(result.current.toolRegistry).toHaveProperty(\n \"zod3-function-tool\",\n );\n });\n\n it(\"should register tool with Zod 3 function schema with multiple args\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const tool = defineTool({\n name: \"zod3-multi-arg-tool\",\n description: \"Tool with multiple arguments\",\n tool: jest.fn().mockResolvedValue(\"result\"),\n toolSchema: z3\n .function()\n .args(\n z3.string().describe(\"first argument\"),\n z3.number().describe(\"second argument\"),\n z3.boolean().optional().describe(\"optional third argument\"),\n )\n .returns(z3.object({ success: z3.boolean() })),\n });\n\n act(() => {\n result.current.registerTool(tool);\n });\n\n expect(result.current.toolRegistry).toHaveProperty(\n \"zod3-multi-arg-tool\",\n );\n });\n\n it(\"should register tool with Zod 3 function schema with object arg\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const tool = defineTool({\n name: \"zod3-object-arg-tool\",\n description: \"Tool with object argument\",\n tool: jest.fn().mockResolvedValue(\"result\"),\n toolSchema: z3\n .function()\n .args(\n z3\n .object({\n query: z3.string().describe(\"search query\"),\n limit: z3.number().optional().describe(\"max results\"),\n filters: z3.array(z3.string()).optional(),\n })\n .describe(\"search options\"),\n )\n .returns(z3.array(z3.string())),\n });\n\n act(() => {\n result.current.registerTool(tool);\n });\n\n expect(result.current.toolRegistry).toHaveProperty(\n \"zod3-object-arg-tool\",\n );\n });\n });\n\n describe(\"Zod 4 object schemas for tools\", () => {\n // Note: Zod 4 uses a different function schema API than Zod 3\n // Zod 4: z.function({ input: z.tuple([...]), output: ... })\n // For tools, we recommend using object schemas instead of function schemas\n // since they work consistently across both versions\n\n it(\"should register tool with Zod 4 object schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const tool = defineTool({\n name: \"zod4-object-tool\",\n description: \"Tool with Zod 4 object schema\",\n tool: jest.fn().mockResolvedValue(\"result\"),\n inputSchema: z4.tuple([z4.string().describe(\"input parameter\")]),\n outputSchema: z4.string(),\n });\n\n act(() => {\n result.current.registerTool(tool);\n });\n\n expect(result.current.toolRegistry).toHaveProperty(\"zod4-object-tool\");\n });\n\n it(\"should register tool with Zod 4 object schema with multiple fields\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const tool = defineTool({\n name: \"zod4-multi-field-tool\",\n description: \"Tool with multiple Zod 4 fields\",\n tool: jest.fn().mockResolvedValue(\"result\"),\n inputSchema: z4.tuple([\n z4.object({\n first: z4.string().describe(\"first argument\"),\n second: z4.number().describe(\"second argument\"),\n third: z4\n .boolean()\n .optional()\n .describe(\"optional third argument\"),\n }),\n ]),\n outputSchema: z4.array(z4.string()),\n });\n\n act(() => {\n result.current.registerTool(tool);\n });\n\n expect(result.current.toolRegistry).toHaveProperty(\n \"zod4-multi-field-tool\",\n );\n });\n\n it(\"should register tool with Zod 4 nested object schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const tool = defineTool({\n name: \"zod4-nested-object-tool\",\n description: \"Tool with Zod 4 nested object\",\n tool: jest.fn().mockResolvedValue(\"result\"),\n inputSchema: z4.tuple([\n z4\n .object({\n query: z4.string().describe(\"search query\"),\n limit: z4.number().optional().describe(\"max results\"),\n filters: z4.array(z4.string()).optional(),\n })\n .describe(\"search options\"),\n ]),\n outputSchema: z4.array(z4.string()),\n });\n\n act(() => {\n result.current.registerTool(tool);\n });\n\n expect(result.current.toolRegistry).toHaveProperty(\n \"zod4-nested-object-tool\",\n );\n });\n });\n\n describe(\"JSON Schema for tools\", () => {\n it(\"should register tool with JSON Schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const jsonSchema: JSONSchema7 = {\n type: \"object\",\n description: \"Tool parameters\",\n properties: {\n query: { type: \"string\", description: \"The search query\" },\n limit: { type: \"number\", description: \"Max results to return\" },\n },\n required: [\"query\"],\n };\n\n const tool = defineTool({\n name: \"json-schema-tool\",\n description: \"Tool with raw JSON Schema\",\n tool: jest.fn().mockResolvedValue(\"result\"),\n inputSchema: jsonSchema,\n outputSchema: {},\n });\n\n act(() => {\n result.current.registerTool(tool);\n });\n\n expect(result.current.toolRegistry).toHaveProperty(\"json-schema-tool\");\n });\n\n it(\"should register tool with complex JSON Schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const jsonSchema: JSONSchema7 = {\n type: \"object\",\n description: \"Complex search parameters\",\n properties: {\n search: {\n type: \"object\",\n properties: {\n query: { type: \"string\" },\n filters: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n field: { type: \"string\" },\n value: { type: \"string\" },\n },\n },\n },\n },\n required: [\"query\"],\n },\n pagination: {\n type: \"object\",\n properties: {\n page: { type: \"number\" },\n pageSize: { type: \"number\" },\n },\n },\n },\n required: [\"search\"],\n };\n\n const tool = defineTool({\n name: \"complex-json-schema-tool\",\n description: \"Tool with complex JSON Schema\",\n tool: jest.fn().mockResolvedValue(\"result\"),\n inputSchema: jsonSchema,\n outputSchema: {},\n });\n\n act(() => {\n result.current.registerTool(tool);\n });\n\n expect(result.current.toolRegistry).toHaveProperty(\n \"complex-json-schema-tool\",\n );\n });\n });\n });\n\n describe(\"Schema validation errors\", () => {\n it(\"should reject Zod 3 z.record() in component propsSchema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const component: TamboComponent = {\n name: \"InvalidZod3RecordComponent\",\n component: TestComponent,\n description: \"Component with invalid z.record() schema\",\n propsSchema: z3.record(z3.string()),\n };\n\n expect(() => {\n act(() => {\n result.current.registerComponent(component);\n });\n }).toThrow(\n /Record types \\(objects with dynamic keys\\) are not supported/,\n );\n });\n\n it(\"should reject Zod 4 z.record() in component propsSchema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const component: TamboComponent = {\n name: \"InvalidZod4RecordComponent\",\n component: TestComponent,\n description: \"Component with invalid Zod 4 z.record() schema\",\n // Zod 4 record requires key type and value type\n propsSchema: z4.record(z4.string(), z4.string()),\n };\n\n expect(() => {\n act(() => {\n result.current.registerComponent(component);\n });\n }).toThrow(\n /Record types \\(objects with dynamic keys\\) are not supported/,\n );\n });\n\n it(\"should reject Zod 3 z.record() in tool schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const tool = defineTool({\n name: \"invalid-zod3-record-tool\",\n description: \"Tool with invalid z.record() schema\",\n tool: jest.fn().mockResolvedValue(\"result\"),\n inputSchema: z3.tuple([z3.record(z3.string())]),\n outputSchema: z3.string(),\n });\n\n expect(() => {\n act(() => {\n result.current.registerTool(tool);\n });\n }).toThrow(\n /Record types \\(objects with dynamic keys\\) are not supported/,\n );\n });\n\n it(\"should reject Zod 4 z.record() in tool schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const tool = defineTool({\n name: \"invalid-zod4-record-tool\",\n description: \"Tool with invalid Zod 4 z.record() schema\",\n tool: jest.fn().mockResolvedValue(\"result\"),\n inputSchema: z4.array(z4.record(z4.string(), z4.string())),\n outputSchema: z4.string(),\n });\n\n expect(() => {\n act(() => {\n result.current.registerTool(tool);\n });\n }).toThrow(\n /Record types \\(objects with dynamic keys\\) are not supported/,\n );\n });\n });\n\n describe(\"Cross-version compatibility\", () => {\n it(\"should register components with mixed Zod 3 and Zod 4 schemas\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n // Register Zod 3 component\n const zod3Component: TamboComponent = {\n name: \"MixedZod3Component\",\n component: TestComponent,\n description: \"Zod 3 component\",\n propsSchema: z3.object({ value: z3.string() }),\n };\n\n // Register Zod 4 component\n const zod4Component: TamboComponent = {\n name: \"MixedZod4Component\",\n component: TestComponent,\n description: \"Zod 4 component\",\n propsSchema: z4.object({ value: z4.string() }),\n };\n\n act(() => {\n result.current.registerComponent(zod3Component);\n result.current.registerComponent(zod4Component);\n });\n\n expect(result.current.componentList).toHaveProperty(\"MixedZod3Component\");\n expect(result.current.componentList).toHaveProperty(\"MixedZod4Component\");\n });\n\n it(\"should register tools with mixed Zod 3, Zod 4, and JSON Schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n // Zod 3 tool (using function schema)\n const zod3Tool = defineTool({\n name: \"mixed-zod3-tool\",\n description: \"Zod 3 tool\",\n tool: jest.fn().mockResolvedValue(\"result\"),\n toolSchema: z3.function().args(z3.string()).returns(z3.string()),\n });\n\n // Zod 4 tool (using Standard Schema)\n const zod4Tool = defineTool({\n name: \"mixed-zod4-tool\",\n description: \"Zod 4 tool\",\n tool: jest.fn().mockResolvedValue(\"result\"),\n inputSchema: z4.tuple([z4.string()]),\n outputSchema: z4.string(),\n });\n\n // JSON Schema tool\n const jsonSchemaTool = defineTool({\n name: \"mixed-json-schema-tool\",\n description: \"JSON Schema tool\",\n tool: jest.fn().mockResolvedValue(\"result\"),\n inputSchema: {\n type: \"object\",\n properties: {\n input: { type: \"string\" },\n },\n },\n outputSchema: { type: \"string\" },\n });\n\n act(() => {\n result.current.registerTools([zod3Tool, zod4Tool, jsonSchemaTool]);\n });\n\n expect(result.current.toolRegistry).toHaveProperty(\"mixed-zod3-tool\");\n expect(result.current.toolRegistry).toHaveProperty(\"mixed-zod4-tool\");\n expect(result.current.toolRegistry).toHaveProperty(\n \"mixed-json-schema-tool\",\n );\n });\n });\n\n describe(\"Standard Schema interface verification\", () => {\n it(\"should verify Zod 3 schema has ~standard property\", () => {\n const schema = z3.object({ value: z3.string() });\n expect(\"~standard\" in schema).toBe(true);\n });\n\n it(\"should verify Zod 4 schema has ~standard property\", () => {\n const schema = z4.object({ value: z4.string() });\n expect(\"~standard\" in schema).toBe(true);\n });\n\n it(\"should verify JSON Schema does not have ~standard property\", () => {\n const schema: JSONSchema7 = {\n type: \"object\",\n properties: { value: { type: \"string\" } },\n };\n expect(\"~standard\" in schema).toBe(false);\n });\n });\n});\n"]}
|
|
1
|
+
{"version":3,"file":"tambo-registry-schema-compat.test.js","sourceRoot":"","sources":["../../src/providers/tambo-registry-schema-compat.test.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE7B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EACL,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AAEnC,wCAAwC;AACxC,MAAM,aAAa,GAAkC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CACpE,iCAAM,OAAO,CAAO,CACrB,CAAC;AAEF,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE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AAC,CAAC,CAAC","sourcesContent":["/**\n * Tests for schema compatibility with registerTool and registerComponent.\n *\n * These tests verify that the registry functions work correctly with:\n * - Zod 3 schemas (current primary)\n * - Zod 4 schemas (Standard Schema native)\n * - Raw JSON Schema objects\n */\nimport { act, renderHook } from \"@testing-library/react\";\nimport type { JSONSchema7 } from \"json-schema\";\nimport React from \"react\";\nimport * as z3 from \"zod/v3\";\nimport * as z4 from \"zod/v4\";\nimport { TamboComponent } from \"../model/component-metadata\";\nimport { defineTool } from \"../util/registry\";\nimport {\n TamboRegistryProvider,\n useTamboRegistry,\n} from \"./tambo-registry-provider\";\n\n// Test component for registration tests\nconst TestComponent: React.FC<{ message: string }> = ({ message }) => (\n <div>{message}</div>\n);\n\ndescribe(\"Schema Compatibility\", () => {\n const wrapper = ({ children }: { children: React.ReactNode }) => (\n <TamboRegistryProvider>{children}</TamboRegistryProvider>\n );\n\n beforeEach(() => {\n jest.clearAllMocks();\n });\n\n describe(\"registerComponent with different schema types\", () => {\n describe(\"Zod 3 schemas\", () => {\n it(\"should register component with Zod 3 object schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const component: TamboComponent = {\n name: \"Zod3ObjectComponent\",\n component: TestComponent,\n description: \"Component with Zod 3 object schema\",\n propsSchema: z3.object({\n message: z3.string().describe(\"The message to display\"),\n count: z3.number().optional().describe(\"Optional count\"),\n }),\n };\n\n act(() => {\n result.current.registerComponent(component);\n });\n\n expect(result.current.componentList).toHaveProperty(\n \"Zod3ObjectComponent\",\n );\n const registered = result.current.componentList.Zod3ObjectComponent;\n expect(registered.name).toBe(\"Zod3ObjectComponent\");\n expect(registered.props).toBeDefined();\n expect(registered.props).toHaveProperty(\"type\", \"object\");\n });\n\n it(\"should register component with Zod 3 nested object schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const component: TamboComponent = {\n name: \"Zod3NestedComponent\",\n component: TestComponent,\n description: \"Component with nested Zod 3 schema\",\n propsSchema: z3.object({\n user: z3.object({\n name: z3.string(),\n email: z3.string().email(),\n }),\n settings: z3.object({\n theme: z3.enum([\"light\", \"dark\"]),\n notifications: z3.boolean(),\n }),\n }),\n };\n\n act(() => {\n result.current.registerComponent(component);\n });\n\n expect(result.current.componentList).toHaveProperty(\n \"Zod3NestedComponent\",\n );\n });\n\n it(\"should register component with Zod 3 array schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const component: TamboComponent = {\n name: \"Zod3ArrayComponent\",\n component: TestComponent,\n description: \"Component with Zod 3 array schema\",\n propsSchema: z3.object({\n items: z3.array(z3.string()).describe(\"List of items\"),\n tags: z3.array(\n z3.object({\n id: z3.number(),\n label: z3.string(),\n }),\n ),\n }),\n };\n\n act(() => {\n result.current.registerComponent(component);\n });\n\n expect(result.current.componentList).toHaveProperty(\n \"Zod3ArrayComponent\",\n );\n });\n\n it(\"should register component with Zod 3 union schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const component: TamboComponent = {\n name: \"Zod3UnionComponent\",\n component: TestComponent,\n description: \"Component with Zod 3 union schema\",\n propsSchema: z3.object({\n value: z3.union([z3.string(), z3.number()]),\n status: z3.enum([\"pending\", \"active\", \"completed\"]),\n }),\n };\n\n act(() => {\n result.current.registerComponent(component);\n });\n\n expect(result.current.componentList).toHaveProperty(\n \"Zod3UnionComponent\",\n );\n });\n });\n\n describe(\"Zod 4 schemas\", () => {\n it(\"should register component with Zod 4 object schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const component: TamboComponent = {\n name: \"Zod4ObjectComponent\",\n component: TestComponent,\n description: \"Component with Zod 4 object schema\",\n propsSchema: z4.object({\n message: z4.string().describe(\"The message to display\"),\n count: z4.number().optional().describe(\"Optional count\"),\n }),\n };\n\n act(() => {\n result.current.registerComponent(component);\n });\n\n expect(result.current.componentList).toHaveProperty(\n \"Zod4ObjectComponent\",\n );\n const registered = result.current.componentList.Zod4ObjectComponent;\n expect(registered.name).toBe(\"Zod4ObjectComponent\");\n expect(registered.props).toBeDefined();\n expect(registered.props).toHaveProperty(\"type\", \"object\");\n });\n\n it(\"should register component with Zod 4 nested object schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const component: TamboComponent = {\n name: \"Zod4NestedComponent\",\n component: TestComponent,\n description: \"Component with nested Zod 4 schema\",\n propsSchema: z4.object({\n user: z4.object({\n name: z4.string(),\n email: z4.email(),\n }),\n settings: z4.object({\n theme: z4.enum([\"light\", \"dark\"]),\n notifications: z4.boolean(),\n }),\n }),\n };\n\n act(() => {\n result.current.registerComponent(component);\n });\n\n expect(result.current.componentList).toHaveProperty(\n \"Zod4NestedComponent\",\n );\n });\n\n it(\"should register component with Zod 4 array schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const component: TamboComponent = {\n name: \"Zod4ArrayComponent\",\n component: TestComponent,\n description: \"Component with Zod 4 array schema\",\n propsSchema: z4.object({\n items: z4.array(z4.string()).describe(\"List of items\"),\n tags: z4.array(\n z4.object({\n id: z4.number(),\n label: z4.string(),\n }),\n ),\n }),\n };\n\n act(() => {\n result.current.registerComponent(component);\n });\n\n expect(result.current.componentList).toHaveProperty(\n \"Zod4ArrayComponent\",\n );\n });\n\n it(\"should register component with Zod 4 union schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const component: TamboComponent = {\n name: \"Zod4UnionComponent\",\n component: TestComponent,\n description: \"Component with Zod 4 union schema\",\n propsSchema: z4.object({\n value: z4.union([z4.string(), z4.number()]),\n status: z4.enum([\"pending\", \"active\", \"completed\"]),\n }),\n };\n\n act(() => {\n result.current.registerComponent(component);\n });\n\n expect(result.current.componentList).toHaveProperty(\n \"Zod4UnionComponent\",\n );\n });\n });\n\n describe(\"JSON Schema objects\", () => {\n it(\"should register component with raw JSON Schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const jsonSchema: JSONSchema7 = {\n type: \"object\",\n properties: {\n message: { type: \"string\", description: \"The message to display\" },\n count: { type: \"number\", description: \"Optional count\" },\n },\n required: [\"message\"],\n };\n\n const component: TamboComponent = {\n name: \"JsonSchemaComponent\",\n component: TestComponent,\n description: \"Component with raw JSON Schema\",\n propsSchema: jsonSchema,\n };\n\n act(() => {\n result.current.registerComponent(component);\n });\n\n expect(result.current.componentList).toHaveProperty(\n \"JsonSchemaComponent\",\n );\n const registered = result.current.componentList.JsonSchemaComponent;\n expect(registered.props).toEqual(jsonSchema);\n });\n\n it(\"should register component with complex JSON Schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const jsonSchema: JSONSchema7 = {\n type: \"object\",\n properties: {\n user: {\n type: \"object\",\n properties: {\n name: { type: \"string\" },\n email: { type: \"string\", format: \"email\" },\n },\n required: [\"name\", \"email\"],\n },\n items: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n id: { type: \"number\" },\n label: { type: \"string\" },\n },\n },\n },\n },\n required: [\"user\"],\n };\n\n const component: TamboComponent = {\n name: \"ComplexJsonSchemaComponent\",\n component: TestComponent,\n description: \"Component with complex JSON Schema\",\n propsSchema: jsonSchema,\n };\n\n act(() => {\n result.current.registerComponent(component);\n });\n\n expect(result.current.componentList).toHaveProperty(\n \"ComplexJsonSchemaComponent\",\n );\n });\n });\n });\n\n describe(\"registerTool with different schema types\", () => {\n describe(\"Zod 3 function schemas\", () => {\n it(\"should register tool with Zod 3 function schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const tool = defineTool({\n name: \"zod3-function-tool\",\n description: \"Tool with Zod 3 function schema\",\n tool: jest.fn().mockResolvedValue(\"result\"),\n toolSchema: z3\n .function()\n .args(z3.string().describe(\"input parameter\"))\n .returns(z3.string()),\n });\n\n act(() => {\n result.current.registerTool(tool);\n });\n\n expect(result.current.toolRegistry).toHaveProperty(\n \"zod3-function-tool\",\n );\n });\n\n it(\"should register tool with Zod 3 function schema with multiple args\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const tool = defineTool({\n name: \"zod3-multi-arg-tool\",\n description: \"Tool with multiple arguments\",\n tool: jest.fn().mockResolvedValue(\"result\"),\n toolSchema: z3\n .function()\n .args(\n z3.string().describe(\"first argument\"),\n z3.number().describe(\"second argument\"),\n z3.boolean().optional().describe(\"optional third argument\"),\n )\n .returns(z3.object({ success: z3.boolean() })),\n });\n\n act(() => {\n result.current.registerTool(tool);\n });\n\n expect(result.current.toolRegistry).toHaveProperty(\n \"zod3-multi-arg-tool\",\n );\n });\n\n it(\"should register tool with Zod 3 function schema with object arg\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const tool = defineTool({\n name: \"zod3-object-arg-tool\",\n description: \"Tool with object argument\",\n tool: jest.fn().mockResolvedValue(\"result\"),\n toolSchema: z3\n .function()\n .args(\n z3\n .object({\n query: z3.string().describe(\"search query\"),\n limit: z3.number().optional().describe(\"max results\"),\n filters: z3.array(z3.string()).optional(),\n })\n .describe(\"search options\"),\n )\n .returns(z3.array(z3.string())),\n });\n\n act(() => {\n result.current.registerTool(tool);\n });\n\n expect(result.current.toolRegistry).toHaveProperty(\n \"zod3-object-arg-tool\",\n );\n });\n });\n\n describe(\"Zod 4 object schemas for tools\", () => {\n // Note: inputSchema must always be an object schema\n // The tool function receives a single object argument with all parameters\n\n it(\"should register tool with Zod 4 object schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const tool = defineTool({\n name: \"zod4-object-tool\",\n description: \"Tool with Zod 4 object schema\",\n tool: jest.fn().mockResolvedValue(\"result\"),\n inputSchema: z4.object({\n input: z4.string().describe(\"input parameter\"),\n }),\n outputSchema: z4.string(),\n });\n\n act(() => {\n result.current.registerTool(tool);\n });\n\n expect(result.current.toolRegistry).toHaveProperty(\"zod4-object-tool\");\n });\n\n it(\"should register tool with Zod 4 object schema with multiple fields\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const tool = defineTool({\n name: \"zod4-multi-field-tool\",\n description: \"Tool with multiple Zod 4 fields\",\n tool: jest.fn().mockResolvedValue(\"result\"),\n inputSchema: z4.object({\n first: z4.string().describe(\"first argument\"),\n second: z4.number().describe(\"second argument\"),\n third: z4.boolean().optional().describe(\"optional third argument\"),\n }),\n outputSchema: z4.array(z4.string()),\n });\n\n act(() => {\n result.current.registerTool(tool);\n });\n\n expect(result.current.toolRegistry).toHaveProperty(\n \"zod4-multi-field-tool\",\n );\n });\n\n it(\"should register tool with Zod 4 nested object schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const tool = defineTool({\n name: \"zod4-nested-object-tool\",\n description: \"Tool with Zod 4 nested object\",\n tool: jest.fn().mockResolvedValue(\"result\"),\n inputSchema: z4\n .object({\n query: z4.string().describe(\"search query\"),\n limit: z4.number().optional().describe(\"max results\"),\n filters: z4.array(z4.string()).optional(),\n })\n .describe(\"search options\"),\n outputSchema: z4.array(z4.string()),\n });\n\n act(() => {\n result.current.registerTool(tool);\n });\n\n expect(result.current.toolRegistry).toHaveProperty(\n \"zod4-nested-object-tool\",\n );\n });\n });\n\n describe(\"JSON Schema for tools\", () => {\n it(\"should register tool with JSON Schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const jsonSchema: JSONSchema7 = {\n type: \"object\",\n description: \"Tool parameters\",\n properties: {\n query: { type: \"string\", description: \"The search query\" },\n limit: { type: \"number\", description: \"Max results to return\" },\n },\n required: [\"query\"],\n };\n\n const tool = defineTool({\n name: \"json-schema-tool\",\n description: \"Tool with raw JSON Schema\",\n tool: jest.fn().mockResolvedValue(\"result\"),\n inputSchema: jsonSchema,\n outputSchema: {},\n });\n\n act(() => {\n result.current.registerTool(tool);\n });\n\n expect(result.current.toolRegistry).toHaveProperty(\"json-schema-tool\");\n });\n\n it(\"should register tool with complex JSON Schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const jsonSchema: JSONSchema7 = {\n type: \"object\",\n description: \"Complex search parameters\",\n properties: {\n search: {\n type: \"object\",\n properties: {\n query: { type: \"string\" },\n filters: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n field: { type: \"string\" },\n value: { type: \"string\" },\n },\n },\n },\n },\n required: [\"query\"],\n },\n pagination: {\n type: \"object\",\n properties: {\n page: { type: \"number\" },\n pageSize: { type: \"number\" },\n },\n },\n },\n required: [\"search\"],\n };\n\n const tool = defineTool({\n name: \"complex-json-schema-tool\",\n description: \"Tool with complex JSON Schema\",\n tool: jest.fn().mockResolvedValue(\"result\"),\n inputSchema: jsonSchema,\n outputSchema: {},\n });\n\n act(() => {\n result.current.registerTool(tool);\n });\n\n expect(result.current.toolRegistry).toHaveProperty(\n \"complex-json-schema-tool\",\n );\n });\n });\n });\n\n describe(\"Schema validation errors\", () => {\n it(\"should reject Zod 3 z.record() in component propsSchema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const component: TamboComponent = {\n name: \"InvalidZod3RecordComponent\",\n component: TestComponent,\n description: \"Component with invalid z.record() schema\",\n propsSchema: z3.record(z3.string()),\n };\n\n expect(() => {\n act(() => {\n result.current.registerComponent(component);\n });\n }).toThrow(\n /Record types \\(objects with dynamic keys\\) are not supported/,\n );\n });\n\n it(\"should reject Zod 4 z.record() in component propsSchema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const component: TamboComponent = {\n name: \"InvalidZod4RecordComponent\",\n component: TestComponent,\n description: \"Component with invalid Zod 4 z.record() schema\",\n // Zod 4 record requires key type and value type\n propsSchema: z4.record(z4.string(), z4.string()),\n };\n\n expect(() => {\n act(() => {\n result.current.registerComponent(component);\n });\n }).toThrow(\n /Record types \\(objects with dynamic keys\\) are not supported/,\n );\n });\n\n it(\"should reject Zod 3 z.record() in tool schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const tool = defineTool({\n name: \"invalid-zod3-record-tool\",\n description: \"Tool with invalid z.record() schema\",\n tool: jest.fn().mockResolvedValue(\"result\"),\n inputSchema: z3.object({\n metadata: z3.record(z3.string()),\n }),\n outputSchema: z3.string(),\n });\n\n expect(() => {\n act(() => {\n result.current.registerTool(tool);\n });\n }).toThrow(\n /Record types \\(objects with dynamic keys\\) are not supported/,\n );\n });\n\n it(\"should reject Zod 4 z.record() in tool schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const tool = defineTool({\n name: \"invalid-zod4-record-tool\",\n description: \"Tool with invalid Zod 4 z.record() schema\",\n tool: jest.fn().mockResolvedValue(\"result\"),\n inputSchema: z4.object({\n metadata: z4.record(z4.string(), z4.string()),\n }),\n outputSchema: z4.string(),\n });\n\n expect(() => {\n act(() => {\n result.current.registerTool(tool);\n });\n }).toThrow(\n /Record types \\(objects with dynamic keys\\) are not supported/,\n );\n });\n\n it(\"should reject non-object inputSchema (tuple)\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const tool = defineTool({\n name: \"invalid-tuple-tool\",\n description: \"Tool with tuple inputSchema\",\n tool: jest.fn().mockResolvedValue(\"result\"),\n inputSchema: z4.tuple([z4.string()]),\n outputSchema: z4.string(),\n });\n\n expect(() => {\n act(() => {\n result.current.registerTool(tool);\n });\n }).toThrow(/must be an object schema/);\n });\n\n it(\"should reject non-object inputSchema (string)\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n const tool = defineTool({\n name: \"invalid-string-tool\",\n description: \"Tool with string inputSchema\",\n tool: jest.fn().mockResolvedValue(\"result\"),\n inputSchema: z4.string(),\n outputSchema: z4.string(),\n });\n\n expect(() => {\n act(() => {\n result.current.registerTool(tool);\n });\n }).toThrow(/must be an object schema/);\n });\n });\n\n describe(\"Cross-version compatibility\", () => {\n it(\"should register components with mixed Zod 3 and Zod 4 schemas\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n // Register Zod 3 component\n const zod3Component: TamboComponent = {\n name: \"MixedZod3Component\",\n component: TestComponent,\n description: \"Zod 3 component\",\n propsSchema: z3.object({ value: z3.string() }),\n };\n\n // Register Zod 4 component\n const zod4Component: TamboComponent = {\n name: \"MixedZod4Component\",\n component: TestComponent,\n description: \"Zod 4 component\",\n propsSchema: z4.object({ value: z4.string() }),\n };\n\n act(() => {\n result.current.registerComponent(zod3Component);\n result.current.registerComponent(zod4Component);\n });\n\n expect(result.current.componentList).toHaveProperty(\"MixedZod3Component\");\n expect(result.current.componentList).toHaveProperty(\"MixedZod4Component\");\n });\n\n it(\"should register tools with mixed Zod 3, Zod 4, and JSON Schema\", () => {\n const { result } = renderHook(() => useTamboRegistry(), { wrapper });\n\n // Zod 3 tool (using function schema)\n const zod3Tool = defineTool({\n name: \"mixed-zod3-tool\",\n description: \"Zod 3 tool\",\n tool: jest.fn().mockResolvedValue(\"result\"),\n toolSchema: z3.function().args(z3.string()).returns(z3.string()),\n });\n\n // Zod 4 tool (using Standard Schema with object inputSchema)\n const zod4Tool = defineTool({\n name: \"mixed-zod4-tool\",\n description: \"Zod 4 tool\",\n tool: jest.fn().mockResolvedValue(\"result\"),\n inputSchema: z4.object({\n input: z4.string(),\n }),\n outputSchema: z4.string(),\n });\n\n // JSON Schema tool\n const jsonSchemaTool = defineTool({\n name: \"mixed-json-schema-tool\",\n description: \"JSON Schema tool\",\n tool: jest.fn().mockResolvedValue(\"result\"),\n inputSchema: {\n type: \"object\",\n properties: {\n input: { type: \"string\" },\n },\n },\n outputSchema: { type: \"string\" },\n });\n\n act(() => {\n result.current.registerTools([zod3Tool, zod4Tool, jsonSchemaTool]);\n });\n\n expect(result.current.toolRegistry).toHaveProperty(\"mixed-zod3-tool\");\n expect(result.current.toolRegistry).toHaveProperty(\"mixed-zod4-tool\");\n expect(result.current.toolRegistry).toHaveProperty(\n \"mixed-json-schema-tool\",\n );\n });\n });\n\n describe(\"Standard Schema interface verification\", () => {\n it(\"should verify Zod 3 schema has ~standard property\", () => {\n const schema = z3.object({ value: z3.string() });\n expect(\"~standard\" in schema).toBe(true);\n });\n\n it(\"should verify Zod 4 schema has ~standard property\", () => {\n const schema = z4.object({ value: z4.string() });\n expect(\"~standard\" in schema).toBe(true);\n });\n\n it(\"should verify JSON Schema does not have ~standard property\", () => {\n const schema: JSONSchema7 = {\n type: \"object\",\n properties: { value: { type: \"string\" } },\n };\n expect(\"~standard\" in schema).toBe(false);\n });\n });\n});\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { advanceStream } from "@tambo-ai/typescript-sdk";
|
|
2
2
|
import { act, renderHook } from "@testing-library/react";
|
|
3
3
|
import React from "react";
|
|
4
|
-
import { z } from "
|
|
4
|
+
import { z } from "zod/v4";
|
|
5
5
|
import { GenerationStage, } from "../model/generate-component-response";
|
|
6
6
|
import { serializeRegistry } from "../testing/tools";
|
|
7
7
|
import { TamboClientContext, useTamboClient, useTamboQueryClient, } from "./tambo-client-provider";
|
|
@@ -102,7 +102,9 @@ describe("TamboThreadProvider", () => {
|
|
|
102
102
|
name: "test-tool",
|
|
103
103
|
tool: jest.fn().mockResolvedValue("test-tool"),
|
|
104
104
|
description: "test-tool",
|
|
105
|
-
inputSchema: z.
|
|
105
|
+
inputSchema: z.object({
|
|
106
|
+
param: z.string().describe("test-param-description"),
|
|
107
|
+
}),
|
|
106
108
|
outputSchema: z.string(),
|
|
107
109
|
},
|
|
108
110
|
],
|
|
@@ -964,7 +966,7 @@ describe("TamboThreadProvider", () => {
|
|
|
964
966
|
name: "custom-tool",
|
|
965
967
|
tool: jest.fn().mockResolvedValue({ data: "tool result" }),
|
|
966
968
|
description: "Tool with custom transform",
|
|
967
|
-
inputSchema: z.
|
|
969
|
+
inputSchema: z.object({ input: z.string() }),
|
|
968
970
|
outputSchema: z.object({ data: z.string() }),
|
|
969
971
|
transformToContent: mockTransformToContent,
|
|
970
972
|
},
|
|
@@ -1065,7 +1067,7 @@ describe("TamboThreadProvider", () => {
|
|
|
1065
1067
|
name: "async-tool",
|
|
1066
1068
|
tool: jest.fn().mockResolvedValue({ data: "async tool result" }),
|
|
1067
1069
|
description: "Tool with async transform",
|
|
1068
|
-
inputSchema: z.
|
|
1070
|
+
inputSchema: z.object({ input: z.string() }),
|
|
1069
1071
|
outputSchema: z.object({ data: z.string() }),
|
|
1070
1072
|
transformToContent: mockTransformToContent,
|
|
1071
1073
|
},
|
|
@@ -1171,7 +1173,7 @@ describe("TamboThreadProvider", () => {
|
|
|
1171
1173
|
.fn()
|
|
1172
1174
|
.mockResolvedValue({ complex: "data", nested: { value: 42 } }),
|
|
1173
1175
|
description: "Tool without custom transform",
|
|
1174
|
-
inputSchema: z.
|
|
1176
|
+
inputSchema: z.object({ input: z.string() }),
|
|
1175
1177
|
outputSchema: z.object({
|
|
1176
1178
|
complex: z.string(),
|
|
1177
1179
|
nested: z.object({ value: z.number() }),
|
|
@@ -1272,7 +1274,7 @@ describe("TamboThreadProvider", () => {
|
|
|
1272
1274
|
.fn()
|
|
1273
1275
|
.mockRejectedValue(new Error("Tool execution failed")),
|
|
1274
1276
|
description: "Tool that errors",
|
|
1275
|
-
inputSchema: z.
|
|
1277
|
+
inputSchema: z.object({ input: z.string() }),
|
|
1276
1278
|
outputSchema: z.string(),
|
|
1277
1279
|
transformToContent: mockTransformToContent,
|
|
1278
1280
|
},
|