@tambo-ai/react 0.37.3 → 0.38.1

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 (79) hide show
  1. package/dist/hooks/__tests__/use-tambo-threads.test.js +1 -0
  2. package/dist/hooks/__tests__/use-tambo-threads.test.js.map +1 -1
  3. package/dist/hooks/use-tambo-threads.d.ts +5 -0
  4. package/dist/hooks/use-tambo-threads.d.ts.map +1 -1
  5. package/dist/index.d.ts +5 -2
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +9 -3
  8. package/dist/index.js.map +1 -1
  9. package/dist/model/tambo-interactable.d.ts +24 -0
  10. package/dist/model/tambo-interactable.d.ts.map +1 -0
  11. package/dist/model/tambo-interactable.js +3 -0
  12. package/dist/model/tambo-interactable.js.map +1 -0
  13. package/dist/providers/__tests__/tambo-prop-stream-provider.test.d.ts +2 -0
  14. package/dist/providers/__tests__/tambo-prop-stream-provider.test.d.ts.map +1 -0
  15. package/dist/providers/__tests__/tambo-prop-stream-provider.test.js +278 -0
  16. package/dist/providers/__tests__/tambo-prop-stream-provider.test.js.map +1 -0
  17. package/dist/providers/hoc/with-tambo-interactable.d.ts +34 -0
  18. package/dist/providers/hoc/with-tambo-interactable.d.ts.map +1 -0
  19. package/dist/providers/hoc/with-tambo-interactable.js +119 -0
  20. package/dist/providers/hoc/with-tambo-interactable.js.map +1 -0
  21. package/dist/providers/index.d.ts +2 -0
  22. package/dist/providers/index.d.ts.map +1 -1
  23. package/dist/providers/index.js +4 -1
  24. package/dist/providers/index.js.map +1 -1
  25. package/dist/providers/tambo-interactable-provider.d.ts +20 -0
  26. package/dist/providers/tambo-interactable-provider.d.ts.map +1 -0
  27. package/dist/providers/tambo-interactable-provider.js +243 -0
  28. package/dist/providers/tambo-interactable-provider.js.map +1 -0
  29. package/dist/providers/tambo-prop-stream-provider.d.ts +96 -0
  30. package/dist/providers/tambo-prop-stream-provider.d.ts.map +1 -0
  31. package/dist/providers/tambo-prop-stream-provider.js +185 -0
  32. package/dist/providers/tambo-prop-stream-provider.js.map +1 -0
  33. package/dist/providers/tambo-provider.d.ts +6 -4
  34. package/dist/providers/tambo-provider.d.ts.map +1 -1
  35. package/dist/providers/tambo-provider.js +9 -4
  36. package/dist/providers/tambo-provider.js.map +1 -1
  37. package/dist/util/query-utils.d.ts.map +1 -1
  38. package/dist/util/query-utils.js +1 -0
  39. package/dist/util/query-utils.js.map +1 -1
  40. package/esm/hooks/__tests__/use-tambo-threads.test.js +1 -0
  41. package/esm/hooks/__tests__/use-tambo-threads.test.js.map +1 -1
  42. package/esm/hooks/use-tambo-threads.d.ts +5 -0
  43. package/esm/hooks/use-tambo-threads.d.ts.map +1 -1
  44. package/esm/index.d.ts +5 -2
  45. package/esm/index.d.ts.map +1 -1
  46. package/esm/index.js +4 -2
  47. package/esm/index.js.map +1 -1
  48. package/esm/model/tambo-interactable.d.ts +24 -0
  49. package/esm/model/tambo-interactable.d.ts.map +1 -0
  50. package/esm/model/tambo-interactable.js +2 -0
  51. package/esm/model/tambo-interactable.js.map +1 -0
  52. package/esm/providers/__tests__/tambo-prop-stream-provider.test.d.ts +2 -0
  53. package/esm/providers/__tests__/tambo-prop-stream-provider.test.d.ts.map +1 -0
  54. package/esm/providers/__tests__/tambo-prop-stream-provider.test.js +273 -0
  55. package/esm/providers/__tests__/tambo-prop-stream-provider.test.js.map +1 -0
  56. package/esm/providers/hoc/with-tambo-interactable.d.ts +34 -0
  57. package/esm/providers/hoc/with-tambo-interactable.d.ts.map +1 -0
  58. package/esm/providers/hoc/with-tambo-interactable.js +83 -0
  59. package/esm/providers/hoc/with-tambo-interactable.js.map +1 -0
  60. package/esm/providers/index.d.ts +2 -0
  61. package/esm/providers/index.d.ts.map +1 -1
  62. package/esm/providers/index.js +1 -0
  63. package/esm/providers/index.js.map +1 -1
  64. package/esm/providers/tambo-interactable-provider.d.ts +20 -0
  65. package/esm/providers/tambo-interactable-provider.d.ts.map +1 -0
  66. package/esm/providers/tambo-interactable-provider.js +205 -0
  67. package/esm/providers/tambo-interactable-provider.js.map +1 -0
  68. package/esm/providers/tambo-prop-stream-provider.d.ts +96 -0
  69. package/esm/providers/tambo-prop-stream-provider.d.ts.map +1 -0
  70. package/esm/providers/tambo-prop-stream-provider.js +148 -0
  71. package/esm/providers/tambo-prop-stream-provider.js.map +1 -0
  72. package/esm/providers/tambo-provider.d.ts +6 -4
  73. package/esm/providers/tambo-provider.d.ts.map +1 -1
  74. package/esm/providers/tambo-provider.js +9 -4
  75. package/esm/providers/tambo-provider.js.map +1 -1
  76. package/esm/util/query-utils.d.ts.map +1 -1
  77. package/esm/util/query-utils.js +1 -0
  78. package/esm/util/query-utils.js.map +1 -1
  79. package/package.json +8 -8
@@ -0,0 +1,34 @@
1
+ import React from "react";
2
+ import { z } from "zod";
3
+ export interface InteractableConfig {
4
+ componentName: string;
5
+ description: string;
6
+ propsSchema?: z.ZodTypeAny;
7
+ }
8
+ export interface WithTamboInteractableProps {
9
+ interactableId?: string;
10
+ onInteractableReady?: (id: string) => void;
11
+ onPropsUpdate?: (newProps: Record<string, any>) => void;
12
+ }
13
+ /**
14
+ * Higher-Order Component that makes any component interactable by tambo.
15
+ * @param WrappedComponent - The component to make interactable
16
+ * @param config - Configuration for the interactable component
17
+ * @returns A new component that is automatically registered as interactable
18
+ * @example
19
+ * ```tsx
20
+ * const MyInteractableNote = withTamboInteractable(MyNote, {
21
+ * componentName: "MyNote",
22
+ * description: "A note component",
23
+ * propsSchema: z.object({
24
+ * title: z.string(),
25
+ * content: z.string(),
26
+ * }),
27
+ * });
28
+ *
29
+ * // Usage
30
+ * <MyInteractableNote title="My Note" content="This is my note" />
31
+ * ```
32
+ */
33
+ export declare function withTamboInteractable<P extends object>(WrappedComponent: React.ComponentType<P>, config: InteractableConfig): React.FC<P & WithTamboInteractableProps>;
34
+ //# sourceMappingURL=with-tambo-interactable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with-tambo-interactable.d.ts","sourceRoot":"","sources":["../../../src/providers/hoc/with-tambo-interactable.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmD,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC;CAC5B;AAED,MAAM,WAAW,0BAA0B;IACzC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;CACzD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,MAAM,EACpD,gBAAgB,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,EACxC,MAAM,EAAE,kBAAkB,4CA+E3B"}
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+ // react-sdk/src/providers/with-interactable.tsx
3
+ "use client";
4
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
+ if (k2 === undefined) k2 = k;
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
11
+ }) : (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ o[k2] = m[k];
14
+ }));
15
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
16
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
17
+ }) : function(o, v) {
18
+ o["default"] = v;
19
+ });
20
+ var __importStar = (this && this.__importStar) || (function () {
21
+ var ownKeys = function(o) {
22
+ ownKeys = Object.getOwnPropertyNames || function (o) {
23
+ var ar = [];
24
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
25
+ return ar;
26
+ };
27
+ return ownKeys(o);
28
+ };
29
+ return function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
36
+ })();
37
+ Object.defineProperty(exports, "__esModule", { value: true });
38
+ exports.withTamboInteractable = withTamboInteractable;
39
+ const react_1 = __importStar(require("react"));
40
+ const tambo_interactable_provider_1 = require("../tambo-interactable-provider");
41
+ /**
42
+ * Higher-Order Component that makes any component interactable by tambo.
43
+ * @param WrappedComponent - The component to make interactable
44
+ * @param config - Configuration for the interactable component
45
+ * @returns A new component that is automatically registered as interactable
46
+ * @example
47
+ * ```tsx
48
+ * const MyInteractableNote = withTamboInteractable(MyNote, {
49
+ * componentName: "MyNote",
50
+ * description: "A note component",
51
+ * propsSchema: z.object({
52
+ * title: z.string(),
53
+ * content: z.string(),
54
+ * }),
55
+ * });
56
+ *
57
+ * // Usage
58
+ * <MyInteractableNote title="My Note" content="This is my note" />
59
+ * ```
60
+ */
61
+ function withTamboInteractable(WrappedComponent, config) {
62
+ const displayName = WrappedComponent.displayName ?? WrappedComponent.name ?? "Component";
63
+ const TamboInteractableWrapper = (props) => {
64
+ const { addInteractableComponent, updateInteractableComponentProps, getInteractableComponent, } = (0, tambo_interactable_provider_1.useTamboInteractable)();
65
+ const [interactableId, setInteractableId] = (0, react_1.useState)(null);
66
+ const isInitialized = (0, react_1.useRef)(false);
67
+ const lastParentProps = (0, react_1.useRef)({});
68
+ // Extract interactable-specific props
69
+ const { onInteractableReady, onPropsUpdate, ...componentProps } = props;
70
+ // Get the current interactable component to track prop updates
71
+ const currentInteractable = interactableId
72
+ ? getInteractableComponent(interactableId)
73
+ : null;
74
+ // Use the props from the interactable component if available, otherwise use the passed props
75
+ // We need to be careful not to create a loop, so we only use stored props if they're different from passed props
76
+ const effectiveProps = currentInteractable?.props ?? componentProps;
77
+ // Memoize the registration function
78
+ const registerComponent = (0, react_1.useCallback)(() => {
79
+ if (!isInitialized.current) {
80
+ const id = addInteractableComponent({
81
+ name: config.componentName,
82
+ description: config.description,
83
+ component: WrappedComponent,
84
+ props: componentProps,
85
+ propsSchema: config.propsSchema,
86
+ });
87
+ setInteractableId(id);
88
+ onInteractableReady?.(id);
89
+ isInitialized.current = true;
90
+ }
91
+ }, [addInteractableComponent, componentProps, onInteractableReady]);
92
+ // Register the component as interactable on mount (only once)
93
+ (0, react_1.useEffect)(() => {
94
+ registerComponent();
95
+ }, [registerComponent]);
96
+ // Update the interactable component when props change from parent
97
+ (0, react_1.useEffect)(() => {
98
+ if (interactableId && isInitialized.current) {
99
+ // Only update if the props are different from what we last sent
100
+ const lastPropsString = JSON.stringify(lastParentProps.current);
101
+ const currentPropsString = JSON.stringify(componentProps);
102
+ if (lastPropsString !== currentPropsString) {
103
+ updateInteractableComponentProps(interactableId, componentProps);
104
+ onPropsUpdate?.(componentProps);
105
+ lastParentProps.current = componentProps;
106
+ }
107
+ }
108
+ }, [
109
+ interactableId,
110
+ componentProps,
111
+ updateInteractableComponentProps,
112
+ onPropsUpdate,
113
+ ]);
114
+ return react_1.default.createElement(WrappedComponent, { ...effectiveProps });
115
+ };
116
+ TamboInteractableWrapper.displayName = `withTamboInteractable(${displayName})`;
117
+ return TamboInteractableWrapper;
118
+ }
119
+ //# sourceMappingURL=with-tambo-interactable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with-tambo-interactable.js","sourceRoot":"","sources":["../../../src/providers/hoc/with-tambo-interactable.tsx"],"names":[],"mappings":";AAAA,gDAAgD;AAChD,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CAAC;gBAEH,iBAAiB,CAAC,EAAE,CAAC,CAAC;gBACtB,mBAAmB,EAAE,CAAC,EAAE,CAAC,CAAC;gBAC1B,aAAa,CAAC,OAAO,GAAG,IAAI,CAAC;YAC/B,CAAC;QACH,CAAC,EAAE,CAAC,wBAAwB,EAAE,cAAc,EAAE,mBAAmB,CAAC,CAAC,CAAC;QAEpE,8DAA8D;QAC9D,IAAA,iBAAS,EAAC,GAAG,EAAE;YACb,iBAAiB,EAAE,CAAC;QACtB,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC;QAExB,kEAAkE;QAClE,IAAA,iBAAS,EAAC,GAAG,EAAE;YACb,IAAI,cAAc,IAAI,aAAa,CAAC,OAAO,EAAE,CAAC;gBAC5C,gEAAgE;gBAChE,MAAM,eAAe,GAAG,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;gBAChE,MAAM,kBAAkB,GAAG,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;gBAE1D,IAAI,eAAe,KAAK,kBAAkB,EAAE,CAAC;oBAC3C,gCAAgC,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;oBACjE,aAAa,EAAE,CAAC,cAAc,CAAC,CAAC;oBAChC,eAAe,CAAC,OAAO,GAAG,cAAc,CAAC;gBAC3C,CAAC;YACH,CAAC;QACH,CAAC,EAAE;YACD,cAAc;YACd,cAAc;YACd,gCAAgC;YAChC,aAAa;SACd,CAAC,CAAC;QAEH,OAAO,8BAAC,gBAAgB,OAAM,cAAoB,GAAI,CAAC;IACzD,CAAC,CAAC;IAEF,wBAAwB,CAAC,WAAW,GAAG,yBAAyB,WAAW,GAAG,CAAC;IAE/E,OAAO,wBAAwB,CAAC;AAClC,CAAC","sourcesContent":["// react-sdk/src/providers/with-interactable.tsx\n\"use client\";\nimport React, { useCallback, useEffect, useRef, useState } from \"react\";\nimport { z } from \"zod\";\nimport { useTamboInteractable } from \"../tambo-interactable-provider\";\n\nexport interface InteractableConfig {\n componentName: string;\n description: string;\n propsSchema?: z.ZodTypeAny;\n}\n\nexport interface WithTamboInteractableProps {\n interactableId?: string;\n onInteractableReady?: (id: string) => void;\n onPropsUpdate?: (newProps: Record<string, any>) => void;\n}\n\n/**\n * Higher-Order Component that makes any component interactable by tambo.\n * @param WrappedComponent - The component to make interactable\n * @param config - Configuration for the interactable component\n * @returns A new component that is automatically registered as interactable\n * @example\n * ```tsx\n * const MyInteractableNote = withTamboInteractable(MyNote, {\n * componentName: \"MyNote\",\n * description: \"A note component\",\n * propsSchema: z.object({\n * title: z.string(),\n * content: z.string(),\n * }),\n * });\n *\n * // Usage\n * <MyInteractableNote title=\"My Note\" content=\"This is my note\" />\n * ```\n */\nexport function withTamboInteractable<P extends object>(\n WrappedComponent: React.ComponentType<P>,\n config: InteractableConfig,\n) {\n const displayName =\n WrappedComponent.displayName ?? WrappedComponent.name ?? \"Component\";\n\n const TamboInteractableWrapper: React.FC<P & WithTamboInteractableProps> = (\n props,\n ) => {\n const {\n addInteractableComponent,\n updateInteractableComponentProps,\n getInteractableComponent,\n } = useTamboInteractable();\n\n const [interactableId, setInteractableId] = useState<string | null>(null);\n const isInitialized = useRef(false);\n const lastParentProps = useRef<Record<string, any>>({});\n\n // Extract interactable-specific props\n const { onInteractableReady, onPropsUpdate, ...componentProps } =\n props as P & WithTamboInteractableProps;\n\n // Get the current interactable component to track prop updates\n const currentInteractable = interactableId\n ? getInteractableComponent(interactableId)\n : null;\n\n // Use the props from the interactable component if available, otherwise use the passed props\n // We need to be careful not to create a loop, so we only use stored props if they're different from passed props\n const effectiveProps = currentInteractable?.props ?? componentProps;\n\n // Memoize the registration function\n const registerComponent = useCallback(() => {\n if (!isInitialized.current) {\n const id = addInteractableComponent({\n name: config.componentName,\n description: config.description,\n component: WrappedComponent,\n props: componentProps,\n propsSchema: config.propsSchema,\n });\n\n setInteractableId(id);\n onInteractableReady?.(id);\n isInitialized.current = true;\n }\n }, [addInteractableComponent, componentProps, onInteractableReady]);\n\n // Register the component as interactable on mount (only once)\n useEffect(() => {\n registerComponent();\n }, [registerComponent]);\n\n // Update the interactable component when props change from parent\n useEffect(() => {\n if (interactableId && isInitialized.current) {\n // Only update if the props are different from what we last sent\n const lastPropsString = JSON.stringify(lastParentProps.current);\n const currentPropsString = JSON.stringify(componentProps);\n\n if (lastPropsString !== currentPropsString) {\n updateInteractableComponentProps(interactableId, componentProps);\n onPropsUpdate?.(componentProps);\n lastParentProps.current = componentProps;\n }\n }\n }, [\n interactableId,\n componentProps,\n updateInteractableComponentProps,\n onPropsUpdate,\n ]);\n\n return <WrappedComponent {...(effectiveProps as P)} />;\n };\n\n TamboInteractableWrapper.displayName = `withTamboInteractable(${displayName})`;\n\n return TamboInteractableWrapper;\n}\n"]}
@@ -1,6 +1,8 @@
1
1
  export type { TamboComponent, TamboTool } from "../model/component-metadata";
2
2
  export { TamboClientProvider, useTamboClient } from "./tambo-client-provider";
3
3
  export { TamboComponentProvider, useTamboComponent, } from "./tambo-component-provider";
4
+ export { TamboPropStreamProvider, useTamboStream, } from "./tambo-prop-stream-provider";
5
+ export type { TamboPropStreamProviderProps, LoadingProps, EmptyProps, CompleteProps, } from "./tambo-prop-stream-provider";
4
6
  export { TamboContext, TamboProvider, useTambo } from "./tambo-provider";
5
7
  export { TamboRegistryProvider, useTamboRegistry, type TamboRegistryContext, } from "./tambo-registry-provider";
6
8
  export { TamboStubProvider, type TamboStubProviderProps } from "./tambo-stubs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EACL,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,KAAK,oBAAoB,GAC1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,GACf,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EACL,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,uBAAuB,EACvB,cAAc,GACf,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,4BAA4B,EAC5B,YAAY,EACZ,UAAU,EACV,aAAa,GACd,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,KAAK,oBAAoB,GAC1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,GACf,MAAM,yBAAyB,CAAC"}
@@ -1,12 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useTamboThread = exports.TamboThreadProvider = exports.TamboThreadContext = exports.TamboStubProvider = exports.useTamboRegistry = exports.TamboRegistryProvider = exports.useTambo = exports.TamboProvider = exports.TamboContext = exports.useTamboComponent = exports.TamboComponentProvider = exports.useTamboClient = exports.TamboClientProvider = void 0;
3
+ exports.useTamboThread = exports.TamboThreadProvider = exports.TamboThreadContext = exports.TamboStubProvider = exports.useTamboRegistry = exports.TamboRegistryProvider = exports.useTambo = exports.TamboProvider = exports.TamboContext = exports.useTamboStream = exports.TamboPropStreamProvider = exports.useTamboComponent = exports.TamboComponentProvider = exports.useTamboClient = exports.TamboClientProvider = void 0;
4
4
  var tambo_client_provider_1 = require("./tambo-client-provider");
5
5
  Object.defineProperty(exports, "TamboClientProvider", { enumerable: true, get: function () { return tambo_client_provider_1.TamboClientProvider; } });
6
6
  Object.defineProperty(exports, "useTamboClient", { enumerable: true, get: function () { return tambo_client_provider_1.useTamboClient; } });
7
7
  var tambo_component_provider_1 = require("./tambo-component-provider");
8
8
  Object.defineProperty(exports, "TamboComponentProvider", { enumerable: true, get: function () { return tambo_component_provider_1.TamboComponentProvider; } });
9
9
  Object.defineProperty(exports, "useTamboComponent", { enumerable: true, get: function () { return tambo_component_provider_1.useTamboComponent; } });
10
+ var tambo_prop_stream_provider_1 = require("./tambo-prop-stream-provider");
11
+ Object.defineProperty(exports, "TamboPropStreamProvider", { enumerable: true, get: function () { return tambo_prop_stream_provider_1.TamboPropStreamProvider; } });
12
+ Object.defineProperty(exports, "useTamboStream", { enumerable: true, get: function () { return tambo_prop_stream_provider_1.useTamboStream; } });
10
13
  var tambo_provider_1 = require("./tambo-provider");
11
14
  Object.defineProperty(exports, "TamboContext", { enumerable: true, get: function () { return tambo_provider_1.TamboContext; } });
12
15
  Object.defineProperty(exports, "TamboProvider", { enumerable: true, get: function () { return tambo_provider_1.TamboProvider; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":";;;AACA,iEAA8E;AAArE,4HAAA,mBAAmB,OAAA;AAAE,uHAAA,cAAc,OAAA;AAC5C,uEAGoC;AAFlC,kIAAA,sBAAsB,OAAA;AACtB,6HAAA,iBAAiB,OAAA;AAEnB,mDAAyE;AAAhE,8GAAA,YAAY,OAAA;AAAE,+GAAA,aAAa,OAAA;AAAE,0GAAA,QAAQ,OAAA;AAC9C,qEAImC;AAHjC,gIAAA,qBAAqB,OAAA;AACrB,2HAAA,gBAAgB,OAAA;AAGlB,6CAA+E;AAAtE,gHAAA,iBAAiB,OAAA;AAC1B,iEAIiC;AAH/B,2HAAA,kBAAkB,OAAA;AAClB,4HAAA,mBAAmB,OAAA;AACnB,uHAAA,cAAc,OAAA","sourcesContent":["export type { TamboComponent, TamboTool } from \"../model/component-metadata\";\nexport { TamboClientProvider, useTamboClient } from \"./tambo-client-provider\";\nexport {\n TamboComponentProvider,\n useTamboComponent,\n} from \"./tambo-component-provider\";\nexport { TamboContext, TamboProvider, useTambo } from \"./tambo-provider\";\nexport {\n TamboRegistryProvider,\n useTamboRegistry,\n type TamboRegistryContext,\n} from \"./tambo-registry-provider\";\nexport { TamboStubProvider, type TamboStubProviderProps } from \"./tambo-stubs\";\nexport {\n TamboThreadContext,\n TamboThreadProvider,\n useTamboThread,\n} from \"./tambo-thread-provider\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":";;;AACA,iEAA8E;AAArE,4HAAA,mBAAmB,OAAA;AAAE,uHAAA,cAAc,OAAA;AAC5C,uEAGoC;AAFlC,kIAAA,sBAAsB,OAAA;AACtB,6HAAA,iBAAiB,OAAA;AAEnB,2EAGsC;AAFpC,qIAAA,uBAAuB,OAAA;AACvB,4HAAA,cAAc,OAAA;AAQhB,mDAAyE;AAAhE,8GAAA,YAAY,OAAA;AAAE,+GAAA,aAAa,OAAA;AAAE,0GAAA,QAAQ,OAAA;AAC9C,qEAImC;AAHjC,gIAAA,qBAAqB,OAAA;AACrB,2HAAA,gBAAgB,OAAA;AAGlB,6CAA+E;AAAtE,gHAAA,iBAAiB,OAAA;AAC1B,iEAIiC;AAH/B,2HAAA,kBAAkB,OAAA;AAClB,4HAAA,mBAAmB,OAAA;AACnB,uHAAA,cAAc,OAAA","sourcesContent":["export type { TamboComponent, TamboTool } from \"../model/component-metadata\";\nexport { TamboClientProvider, useTamboClient } from \"./tambo-client-provider\";\nexport {\n TamboComponentProvider,\n useTamboComponent,\n} from \"./tambo-component-provider\";\nexport {\n TamboPropStreamProvider,\n useTamboStream,\n} from \"./tambo-prop-stream-provider\";\nexport type {\n TamboPropStreamProviderProps,\n LoadingProps,\n EmptyProps,\n CompleteProps,\n} from \"./tambo-prop-stream-provider\";\nexport { TamboContext, TamboProvider, useTambo } from \"./tambo-provider\";\nexport {\n TamboRegistryProvider,\n useTamboRegistry,\n type TamboRegistryContext,\n} from \"./tambo-registry-provider\";\nexport { TamboStubProvider, type TamboStubProviderProps } from \"./tambo-stubs\";\nexport {\n TamboThreadContext,\n TamboThreadProvider,\n useTamboThread,\n} from \"./tambo-thread-provider\";\n"]}
@@ -0,0 +1,20 @@
1
+ import React, { PropsWithChildren } from "react";
2
+ import { type TamboInteractableContext } from "../model/tambo-interactable";
3
+ declare const TamboInteractableContext: React.Context<TamboInteractableContext>;
4
+ /**
5
+ * The TamboInteractableProvider manages a list of components that are currently
6
+ * interactable, allowing tambo to interact with them by updating their props. It also registers tools
7
+ * for Tambo to perform CRUD operations on the components list.
8
+ * @param props - The props for the TamboInteractableProvider
9
+ * @param props.children - The children to wrap
10
+ * @returns The TamboInteractableProvider component
11
+ */
12
+ export declare const TamboInteractableProvider: React.FC<PropsWithChildren>;
13
+ /**
14
+ * The useTamboInteractable hook provides access to the interactable component
15
+ * management functions.
16
+ * @returns The interactable component management functions
17
+ */
18
+ export declare const useTamboInteractable: () => TamboInteractableContext;
19
+ export {};
20
+ //# sourceMappingURL=tambo-interactable-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tambo-interactable-provider.d.ts","sourceRoot":"","sources":["../../src/providers/tambo-interactable-provider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAEZ,iBAAiB,EAKlB,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,6BAA6B,CAAC;AAGrC,QAAA,MAAM,wBAAwB,yCAQ5B,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA4PjE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,gCAEhC,CAAC"}
@@ -0,0 +1,243 @@
1
+ "use strict";
2
+ // react-sdk/src/providers/tambo-interactable-provider.tsx
3
+ "use client";
4
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
+ if (k2 === undefined) k2 = k;
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
11
+ }) : (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ o[k2] = m[k];
14
+ }));
15
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
16
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
17
+ }) : function(o, v) {
18
+ o["default"] = v;
19
+ });
20
+ var __importStar = (this && this.__importStar) || (function () {
21
+ var ownKeys = function(o) {
22
+ ownKeys = Object.getOwnPropertyNames || function (o) {
23
+ var ar = [];
24
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
25
+ return ar;
26
+ };
27
+ return ownKeys(o);
28
+ };
29
+ return function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
36
+ })();
37
+ Object.defineProperty(exports, "__esModule", { value: true });
38
+ exports.useTamboInteractable = exports.TamboInteractableProvider = void 0;
39
+ const react_1 = __importStar(require("react"));
40
+ const zod_1 = require("zod");
41
+ const tambo_component_provider_1 = require("./tambo-component-provider");
42
+ const TamboInteractableContext = (0, react_1.createContext)({
43
+ interactableComponents: [],
44
+ addInteractableComponent: () => "",
45
+ removeInteractableComponent: () => { },
46
+ updateInteractableComponentProps: () => { },
47
+ getInteractableComponent: () => undefined,
48
+ getInteractableComponentsByName: () => [],
49
+ clearAllInteractableComponents: () => { },
50
+ });
51
+ /**
52
+ * The TamboInteractableProvider manages a list of components that are currently
53
+ * interactable, allowing tambo to interact with them by updating their props. It also registers tools
54
+ * for Tambo to perform CRUD operations on the components list.
55
+ * @param props - The props for the TamboInteractableProvider
56
+ * @param props.children - The children to wrap
57
+ * @returns The TamboInteractableProvider component
58
+ */
59
+ const TamboInteractableProvider = ({ children, }) => {
60
+ const [interactableComponents, setInteractableComponents] = (0, react_1.useState)([]);
61
+ const { registerTool } = (0, tambo_component_provider_1.useTamboComponent)();
62
+ (0, react_1.useEffect)(() => {
63
+ registerTool({
64
+ name: "get_all_interactable_components",
65
+ description: "Get all currently interactable components with their details including their current props. These are components that you can interact with on behalf of the user.",
66
+ tool: () => {
67
+ return {
68
+ components: interactableComponents,
69
+ };
70
+ },
71
+ toolSchema: zod_1.z.function().returns(zod_1.z.object({
72
+ components: zod_1.z.array(zod_1.z.object({
73
+ id: zod_1.z.string(),
74
+ componentName: zod_1.z.string(),
75
+ props: zod_1.z.record(zod_1.z.any()),
76
+ propsSchema: zod_1.z.object({}).optional(),
77
+ })),
78
+ })),
79
+ });
80
+ registerTool({
81
+ name: "get_interactable_component_by_id",
82
+ description: "Get a specific interactable component by its ID",
83
+ tool: (componentId) => {
84
+ const component = interactableComponents.find((c) => c.id === componentId);
85
+ if (!component) {
86
+ return {
87
+ success: false,
88
+ error: `Component with ID ${componentId} not found`,
89
+ };
90
+ }
91
+ return {
92
+ success: true,
93
+ component: {
94
+ id: component.id,
95
+ componentName: component.name,
96
+ props: component.props,
97
+ },
98
+ };
99
+ },
100
+ toolSchema: zod_1.z
101
+ .function()
102
+ .args(zod_1.z.string())
103
+ .returns(zod_1.z.object({
104
+ success: zod_1.z.boolean(),
105
+ component: zod_1.z
106
+ .object({
107
+ id: zod_1.z.string(),
108
+ componentName: zod_1.z.string(),
109
+ props: zod_1.z.record(zod_1.z.any()),
110
+ })
111
+ .optional(),
112
+ error: zod_1.z.string().optional(),
113
+ })),
114
+ });
115
+ registerTool({
116
+ name: "remove_interactable_component",
117
+ description: "Remove an interactable component from the system",
118
+ tool: (componentId) => {
119
+ const component = interactableComponents.find((c) => c.id === componentId);
120
+ if (!component) {
121
+ return {
122
+ success: false,
123
+ error: `Component with ID ${componentId} not found`,
124
+ };
125
+ }
126
+ setInteractableComponents((prev) => prev.filter((c) => c.id !== componentId));
127
+ return {
128
+ success: true,
129
+ componentId,
130
+ removedComponent: {
131
+ id: component.id,
132
+ componentName: component.name,
133
+ props: component.props,
134
+ },
135
+ };
136
+ },
137
+ toolSchema: zod_1.z
138
+ .function()
139
+ .args(zod_1.z.string())
140
+ .returns(zod_1.z.object({
141
+ success: zod_1.z.boolean(),
142
+ componentId: zod_1.z.string(),
143
+ removedComponent: zod_1.z.object({
144
+ id: zod_1.z.string(),
145
+ componentName: zod_1.z.string(),
146
+ props: zod_1.z.record(zod_1.z.any()),
147
+ }),
148
+ error: zod_1.z.string().optional(),
149
+ })),
150
+ });
151
+ }, [interactableComponents, registerTool]);
152
+ const updateInteractableComponentProps = (0, react_1.useCallback)((id, newProps) => {
153
+ let updateResult = "Updated successfully";
154
+ setInteractableComponents((prev) => {
155
+ const componentExists = prev.some((c) => c.id === id);
156
+ if (!componentExists) {
157
+ updateResult = `Error: Component with ID ${id} not found`;
158
+ return prev;
159
+ }
160
+ const updatedComponents = prev.map((c) => c.id === id ? { ...c, props: { ...c.props, ...newProps } } : c);
161
+ // Check if the update actually changed anything
162
+ const originalComponent = prev.find((c) => c.id === id);
163
+ const updatedComponent = updatedComponents.find((c) => c.id === id);
164
+ if (!originalComponent || !updatedComponent) {
165
+ updateResult = `Error: Failed to update component with ID ${id}`;
166
+ return prev;
167
+ }
168
+ // Check if props actually changed
169
+ const propsChanged = JSON.stringify(originalComponent.props) !==
170
+ JSON.stringify(updatedComponent.props);
171
+ if (!propsChanged) {
172
+ updateResult = `Warning: No changes detected for component with ID ${id}. The update might not have worked.`;
173
+ return prev;
174
+ }
175
+ return updatedComponents;
176
+ });
177
+ return updateResult;
178
+ }, []);
179
+ const registerInteractableComponentUpdateTool = (0, react_1.useCallback)((component) => {
180
+ const schemaForArgs = typeof component.propsSchema === "object" &&
181
+ "describe" in component.propsSchema
182
+ ? component.propsSchema
183
+ : zod_1.z.object({});
184
+ registerTool({
185
+ name: `update_interactable_component_${component.id}`,
186
+ description: `Update the props of interactable component ${component.id} (${component.name})`,
187
+ tool: (componentId, newProps) => {
188
+ return updateInteractableComponentProps(componentId, newProps);
189
+ },
190
+ toolSchema: zod_1.z
191
+ .function()
192
+ .args(zod_1.z
193
+ .string()
194
+ .describe("The ID of the interactable component to update"), schemaForArgs.describe("The new props to update the component with"))
195
+ .returns(zod_1.z.string()),
196
+ });
197
+ }, [registerTool, updateInteractableComponentProps]);
198
+ const addInteractableComponent = (0, react_1.useCallback)((component) => {
199
+ const id = `${component.name}-${Math.random().toString(36).substr(2, 9)}`;
200
+ const newComponent = {
201
+ ...component,
202
+ id,
203
+ };
204
+ registerInteractableComponentUpdateTool(newComponent);
205
+ setInteractableComponents((prev) => {
206
+ return [...prev, newComponent];
207
+ });
208
+ return id;
209
+ }, [registerInteractableComponentUpdateTool]);
210
+ const removeInteractableComponent = (0, react_1.useCallback)((id) => {
211
+ setInteractableComponents((prev) => prev.filter((c) => c.id !== id));
212
+ }, []);
213
+ const getInteractableComponent = (0, react_1.useCallback)((id) => {
214
+ return interactableComponents.find((c) => c.id === id);
215
+ }, [interactableComponents]);
216
+ const getInteractableComponentsByName = (0, react_1.useCallback)((componentName) => {
217
+ return interactableComponents.filter((c) => c.name === componentName);
218
+ }, [interactableComponents]);
219
+ const clearAllInteractableComponents = (0, react_1.useCallback)(() => {
220
+ setInteractableComponents([]);
221
+ }, []);
222
+ const value = {
223
+ interactableComponents,
224
+ addInteractableComponent,
225
+ removeInteractableComponent,
226
+ updateInteractableComponentProps,
227
+ getInteractableComponent,
228
+ getInteractableComponentsByName,
229
+ clearAllInteractableComponents,
230
+ };
231
+ return (react_1.default.createElement(TamboInteractableContext.Provider, { value: value }, children));
232
+ };
233
+ exports.TamboInteractableProvider = TamboInteractableProvider;
234
+ /**
235
+ * The useTamboInteractable hook provides access to the interactable component
236
+ * management functions.
237
+ * @returns The interactable component management functions
238
+ */
239
+ const useTamboInteractable = () => {
240
+ return (0, react_1.useContext)(TamboInteractableContext);
241
+ };
242
+ exports.useTamboInteractable = useTamboInteractable;
243
+ //# sourceMappingURL=tambo-interactable-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tambo-interactable-provider.js","sourceRoot":"","sources":["../../src/providers/tambo-interactable-provider.tsx"],"names":[],"mappings":";AAAA,0DAA0D;AAC1D,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACb,+CAOe;AACf,6BAAwB;AAKxB,yEAA+D;AAE/D,MAAM,wBAAwB,GAAG,IAAA,qBAAa,EAA2B;IACvE,sBAAsB,EAAE,EAAE;IAC1B,wBAAwB,EAAE,GAAG,EAAE,CAAC,EAAE;IAClC,2BAA2B,EAAE,GAAG,EAAE,GAAE,CAAC;IACrC,gCAAgC,EAAE,GAAG,EAAE,GAAE,CAAC;IAC1C,wBAAwB,EAAE,GAAG,EAAE,CAAC,SAAS;IACzC,+BAA+B,EAAE,GAAG,EAAE,CAAC,EAAE;IACzC,8BAA8B,EAAE,GAAG,EAAE,GAAE,CAAC;CACzC,CAAC,CAAC;AAEH;;;;;;;GAOG;AACI,MAAM,yBAAyB,GAAgC,CAAC,EACrE,QAAQ,GACT,EAAE,EAAE;IACH,MAAM,CAAC,sBAAs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ithChildren,\n useCallback,\n useContext,\n useEffect,\n useState,\n} from \"react\";\nimport { z } from \"zod\";\nimport {\n TamboInteractableComponent,\n type TamboInteractableContext,\n} from \"../model/tambo-interactable\";\nimport { useTamboComponent } from \"./tambo-component-provider\";\n\nconst TamboInteractableContext = createContext<TamboInteractableContext>({\n interactableComponents: [],\n addInteractableComponent: () => \"\",\n removeInteractableComponent: () => {},\n updateInteractableComponentProps: () => {},\n getInteractableComponent: () => undefined,\n getInteractableComponentsByName: () => [],\n clearAllInteractableComponents: () => {},\n});\n\n/**\n * The TamboInteractableProvider manages a list of components that are currently\n * interactable, allowing tambo to interact with them by updating their props. It also registers tools\n * for Tambo to perform CRUD operations on the components list.\n * @param props - The props for the TamboInteractableProvider\n * @param props.children - The children to wrap\n * @returns The TamboInteractableProvider component\n */\nexport const TamboInteractableProvider: React.FC<PropsWithChildren> = ({\n children,\n}) => {\n const [interactableComponents, setInteractableComponents] = useState<\n TamboInteractableComponent[]\n >([]);\n const { registerTool } = useTamboComponent();\n\n useEffect(() => {\n registerTool({\n name: \"get_all_interactable_components\",\n description:\n \"Get all currently interactable components with their details including their current props. These are components that you can interact with on behalf of the user.\",\n tool: () => {\n return {\n components: interactableComponents,\n };\n },\n toolSchema: z.function().returns(\n z.object({\n components: z.array(\n z.object({\n id: z.string(),\n componentName: z.string(),\n props: z.record(z.any()),\n propsSchema: z.object({}).optional(),\n }),\n ),\n }),\n ),\n });\n\n registerTool({\n name: \"get_interactable_component_by_id\",\n description: \"Get a specific interactable component by its ID\",\n tool: (componentId: string) => {\n const component = interactableComponents.find(\n (c) => c.id === componentId,\n );\n\n if (!component) {\n return {\n success: false,\n error: `Component with ID ${componentId} not found`,\n };\n }\n\n return {\n success: true,\n component: {\n id: component.id,\n componentName: component.name,\n props: component.props,\n },\n };\n },\n toolSchema: z\n .function()\n .args(z.string())\n .returns(\n z.object({\n success: z.boolean(),\n component: z\n .object({\n id: z.string(),\n componentName: z.string(),\n props: z.record(z.any()),\n })\n .optional(),\n error: z.string().optional(),\n }),\n ),\n });\n\n registerTool({\n name: \"remove_interactable_component\",\n description: \"Remove an interactable component from the system\",\n tool: (componentId: string) => {\n const component = interactableComponents.find(\n (c) => c.id === componentId,\n );\n\n if (!component) {\n return {\n success: false,\n error: `Component with ID ${componentId} not found`,\n };\n }\n\n setInteractableComponents((prev) =>\n prev.filter((c) => c.id !== componentId),\n );\n\n return {\n success: true,\n componentId,\n removedComponent: {\n id: component.id,\n componentName: component.name,\n props: component.props,\n },\n };\n },\n toolSchema: z\n .function()\n .args(z.string())\n .returns(\n z.object({\n success: z.boolean(),\n componentId: z.string(),\n removedComponent: z.object({\n id: z.string(),\n componentName: z.string(),\n props: z.record(z.any()),\n }),\n error: z.string().optional(),\n }),\n ),\n });\n }, [interactableComponents, registerTool]);\n\n const updateInteractableComponentProps = useCallback(\n (id: string, newProps: Record<string, any>) => {\n let updateResult = \"Updated successfully\";\n\n setInteractableComponents((prev) => {\n const componentExists = prev.some((c) => c.id === id);\n\n if (!componentExists) {\n updateResult = `Error: Component with ID ${id} not found`;\n return prev;\n }\n\n const updatedComponents = prev.map((c) =>\n c.id === id ? { ...c, props: { ...c.props, ...newProps } } : c,\n );\n\n // Check if the update actually changed anything\n const originalComponent = prev.find((c) => c.id === id);\n const updatedComponent = updatedComponents.find((c) => c.id === id);\n\n if (!originalComponent || !updatedComponent) {\n updateResult = `Error: Failed to update component with ID ${id}`;\n return prev;\n }\n\n // Check if props actually changed\n const propsChanged =\n JSON.stringify(originalComponent.props) !==\n JSON.stringify(updatedComponent.props);\n\n if (!propsChanged) {\n updateResult = `Warning: No changes detected for component with ID ${id}. The update might not have worked.`;\n return prev;\n }\n\n return updatedComponents;\n });\n\n return updateResult;\n },\n [],\n );\n\n const registerInteractableComponentUpdateTool = useCallback(\n (component: TamboInteractableComponent) => {\n const schemaForArgs =\n typeof component.propsSchema === \"object\" &&\n \"describe\" in component.propsSchema\n ? component.propsSchema\n : z.object({});\n\n registerTool({\n name: `update_interactable_component_${component.id}`,\n description: `Update the props of interactable component ${component.id} (${component.name})`,\n tool: (componentId: string, newProps: any) => {\n return updateInteractableComponentProps(componentId, newProps);\n },\n toolSchema: z\n .function()\n .args(\n z\n .string()\n .describe(\"The ID of the interactable component to update\"),\n schemaForArgs.describe(\n \"The new props to update the component with\",\n ),\n )\n .returns(z.string()),\n });\n },\n [registerTool, updateInteractableComponentProps],\n );\n\n const addInteractableComponent = useCallback(\n (\n component: Omit<TamboInteractableComponent, \"id\" | \"createdAt\">,\n ): string => {\n const id = `${component.name}-${Math.random().toString(36).substr(2, 9)}`;\n const newComponent: TamboInteractableComponent = {\n ...component,\n id,\n };\n\n registerInteractableComponentUpdateTool(newComponent);\n\n setInteractableComponents((prev) => {\n return [...prev, newComponent];\n });\n\n return id;\n },\n [registerInteractableComponentUpdateTool],\n );\n\n const removeInteractableComponent = useCallback((id: string) => {\n setInteractableComponents((prev) => prev.filter((c) => c.id !== id));\n }, []);\n\n const getInteractableComponent = useCallback(\n (id: string) => {\n return interactableComponents.find((c) => c.id === id);\n },\n [interactableComponents],\n );\n\n const getInteractableComponentsByName = useCallback(\n (componentName: string) => {\n return interactableComponents.filter((c) => c.name === componentName);\n },\n [interactableComponents],\n );\n\n const clearAllInteractableComponents = useCallback(() => {\n setInteractableComponents([]);\n }, []);\n\n const value: TamboInteractableContext = {\n interactableComponents,\n addInteractableComponent,\n removeInteractableComponent,\n updateInteractableComponentProps,\n getInteractableComponent,\n getInteractableComponentsByName,\n clearAllInteractableComponents,\n };\n\n return (\n <TamboInteractableContext.Provider value={value}>\n {children}\n </TamboInteractableContext.Provider>\n );\n};\n\n/**\n * The useTamboInteractable hook provides access to the interactable component\n * management functions.\n * @returns The interactable component management functions\n */\nexport const useTamboInteractable = () => {\n return useContext(TamboInteractableContext);\n};\n"]}
@@ -0,0 +1,96 @@
1
+ import React, { PropsWithChildren } from "react";
2
+ import { StreamStatus } from "../hooks/use-tambo-stream-status";
3
+ interface TamboPropStreamContextValue {
4
+ /** The stream data */
5
+ data: any;
6
+ /** The stream status */
7
+ streamStatus: StreamStatus;
8
+ /** Get the status for a specific key */
9
+ getStatusForKey: (key: string) => {
10
+ isPending: boolean;
11
+ isStreaming: boolean;
12
+ isSuccess: boolean;
13
+ isError: boolean;
14
+ error?: Error;
15
+ };
16
+ }
17
+ export interface TamboPropStreamProviderProps {
18
+ /** The stream data */
19
+ data: any;
20
+ /** Optional stream status for more granular control */
21
+ streamStatus?: StreamStatus;
22
+ }
23
+ export interface LoadingProps {
24
+ /** The key to identify this loading state */
25
+ streamKey?: string;
26
+ /** The children to render when loading */
27
+ children: React.ReactNode;
28
+ /** Optional className for styling */
29
+ className?: string;
30
+ }
31
+ export interface EmptyProps {
32
+ /** The key to identify this empty state */
33
+ streamKey?: string;
34
+ /** The children to render when empty */
35
+ children: React.ReactNode;
36
+ /** Optional className for styling */
37
+ className?: string;
38
+ }
39
+ export interface CompleteProps {
40
+ /** The key to identify this complete state */
41
+ streamKey?: string;
42
+ /** The children to render when complete */
43
+ children: React.ReactNode;
44
+ /** Optional className for styling */
45
+ className?: string;
46
+ }
47
+ /**
48
+ * Loading component that renders children when the stream is in a loading state
49
+ * @param props - The props for the Loading component
50
+ * @param props.streamKey - The key to identify this loading state
51
+ * @param props.children - The children to render when loading
52
+ * @param props.className - Optional className for styling
53
+ * @returns The Loading component
54
+ */
55
+ declare const Loading: React.FC<LoadingProps>;
56
+ /**
57
+ * Empty component that renders children when the stream has no data
58
+ * @param props - The props for the Empty component
59
+ * @param props.streamKey - The key to identify this empty state
60
+ * @param props.children - The children to render when empty
61
+ * @param props.className - Optional className for styling
62
+ * @returns The Empty component
63
+ */
64
+ declare const Empty: React.FC<EmptyProps>;
65
+ /**
66
+ * Complete component that renders children when the stream has data
67
+ * @param props - The props for the Complete component
68
+ * @param props.streamKey - The key to identify this complete state
69
+ * @param props.children - The children to render when complete
70
+ * @param props.className - Optional className for styling
71
+ * @returns The Complete component
72
+ */
73
+ declare const Complete: React.FC<CompleteProps>;
74
+ /**
75
+ * Hook to use the TamboStream context
76
+ * @returns The TamboStream context
77
+ */
78
+ export declare const useTamboStream: () => TamboPropStreamContextValue;
79
+ /**
80
+ * The TamboStreamProvider provides a context for managing stream states
81
+ * with compound components for Loading, Empty, and Complete states.
82
+ * @param props - The props for the TamboStreamProvider
83
+ * @param props.children - The children to wrap
84
+ * @param props.data - The stream data
85
+ * @param props.streamStatus - Optional stream status for more granular control
86
+ * @returns The TamboStreamProvider component
87
+ */
88
+ declare const TamboPropStreamProviderComponent: React.FC<PropsWithChildren<TamboPropStreamProviderProps>>;
89
+ type TamboPropStreamProviderCompound = typeof TamboPropStreamProviderComponent & {
90
+ Loading: typeof Loading;
91
+ Empty: typeof Empty;
92
+ Complete: typeof Complete;
93
+ };
94
+ export declare const TamboPropStreamProvider: TamboPropStreamProviderCompound;
95
+ export {};
96
+ //# sourceMappingURL=tambo-prop-stream-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tambo-prop-stream-provider.d.ts","sourceRoot":"","sources":["../../src/providers/tambo-prop-stream-provider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAEZ,iBAAiB,EAGlB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAEhE,UAAU,2BAA2B;IACnC,sBAAsB;IACtB,IAAI,EAAE,GAAG,CAAC;IACV,wBAAwB;IACxB,YAAY,EAAE,YAAY,CAAC;IAC3B,wCAAwC;IACxC,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK;QAChC,SAAS,EAAE,OAAO,CAAC;QACnB,WAAW,EAAE,OAAO,CAAC;QACrB,SAAS,EAAE,OAAO,CAAC;QACnB,OAAO,EAAE,OAAO,CAAC;QACjB,KAAK,CAAC,EAAE,KAAK,CAAC;KACf,CAAC;CACH;AAKD,MAAM,WAAW,4BAA4B;IAC3C,sBAAsB;IACtB,IAAI,EAAE,GAAG,CAAC;IACV,uDAAuD;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