@tambo-ai/react 0.73.0 → 0.74.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/README.md +12 -12
- package/dist/hooks/use-component-state.d.ts +1 -1
- package/dist/hooks/use-component-state.js.map +1 -1
- package/dist/hooks/use-streaming-props.d.ts +1 -1
- package/dist/hooks/use-streaming-props.js +1 -1
- package/dist/hooks/use-streaming-props.js.map +1 -1
- package/dist/hooks/use-tambo-stream-status.d.ts +1 -1
- package/dist/hooks/use-tambo-stream-status.js +1 -1
- package/dist/hooks/use-tambo-stream-status.js.map +1 -1
- package/dist/mcp/mcp-hooks.d.ts +4 -0
- package/dist/mcp/mcp-hooks.d.ts.map +1 -1
- package/dist/mcp/mcp-hooks.js +4 -0
- package/dist/mcp/mcp-hooks.js.map +1 -1
- package/dist/providers/tambo-interactable-provider-partial-updates.test.js +3 -3
- package/dist/providers/tambo-interactable-provider-partial-updates.test.js.map +1 -1
- package/dist/providers/tambo-interactable-provider.js +2 -2
- package/dist/providers/tambo-interactable-provider.js.map +1 -1
- package/dist/providers/tambo-interactable-provider.test.js +3 -3
- package/dist/providers/tambo-interactable-provider.test.js.map +1 -1
- package/dist/providers/tambo-provider.d.ts +3 -0
- package/dist/providers/tambo-provider.d.ts.map +1 -1
- package/dist/providers/tambo-provider.js +3 -0
- package/dist/providers/tambo-provider.js.map +1 -1
- package/dist/providers/tambo-thread-input-provider.d.ts.map +1 -1
- package/dist/providers/tambo-thread-input-provider.js +1 -0
- package/dist/providers/tambo-thread-input-provider.js.map +1 -1
- package/dist/util/resource-content-resolver.d.ts.map +1 -1
- package/dist/util/resource-content-resolver.js +2 -0
- package/dist/util/resource-content-resolver.js.map +1 -1
- package/dist/v1/__tests__/v1-interactables.test.d.ts +2 -0
- package/dist/v1/__tests__/v1-interactables.test.d.ts.map +1 -0
- package/dist/v1/__tests__/v1-interactables.test.js +135 -0
- package/dist/v1/__tests__/v1-interactables.test.js.map +1 -0
- package/dist/v1/components/v1-component-renderer.d.ts +48 -0
- package/dist/v1/components/v1-component-renderer.d.ts.map +1 -0
- package/dist/v1/components/v1-component-renderer.js +137 -0
- package/dist/v1/components/v1-component-renderer.js.map +1 -0
- package/dist/v1/components/v1-component-renderer.test.d.ts +2 -0
- package/dist/v1/components/v1-component-renderer.test.d.ts.map +1 -0
- package/dist/v1/components/v1-component-renderer.test.js +270 -0
- package/dist/v1/components/v1-component-renderer.test.js.map +1 -0
- package/dist/v1/hooks/use-tambo-v1-component-state.d.ts.map +1 -1
- package/dist/v1/hooks/use-tambo-v1-component-state.js +2 -25
- package/dist/v1/hooks/use-tambo-v1-component-state.js.map +1 -1
- package/dist/v1/hooks/use-tambo-v1-component-state.test.js +2 -1
- package/dist/v1/hooks/use-tambo-v1-component-state.test.js.map +1 -1
- package/dist/v1/hooks/use-tambo-v1-messages.test.js +25 -1
- package/dist/v1/hooks/use-tambo-v1-messages.test.js.map +1 -1
- package/dist/v1/hooks/use-tambo-v1-send-message.d.ts +18 -0
- package/dist/v1/hooks/use-tambo-v1-send-message.d.ts.map +1 -1
- package/dist/v1/hooks/use-tambo-v1-send-message.js +204 -17
- package/dist/v1/hooks/use-tambo-v1-send-message.js.map +1 -1
- package/dist/v1/hooks/use-tambo-v1-send-message.test.js +261 -7
- package/dist/v1/hooks/use-tambo-v1-send-message.test.js.map +1 -1
- package/dist/v1/hooks/use-tambo-v1-stream-status.d.ts +90 -0
- package/dist/v1/hooks/use-tambo-v1-stream-status.d.ts.map +1 -0
- package/dist/v1/hooks/use-tambo-v1-stream-status.js +179 -0
- package/dist/v1/hooks/use-tambo-v1-stream-status.js.map +1 -0
- package/dist/v1/hooks/use-tambo-v1-stream-status.test.d.ts +2 -0
- package/dist/v1/hooks/use-tambo-v1-stream-status.test.d.ts.map +1 -0
- package/dist/v1/hooks/use-tambo-v1-stream-status.test.js +371 -0
- package/dist/v1/hooks/use-tambo-v1-stream-status.test.js.map +1 -0
- package/dist/v1/hooks/use-tambo-v1-suggestions.d.ts +78 -54
- package/dist/v1/hooks/use-tambo-v1-suggestions.d.ts.map +1 -1
- package/dist/v1/hooks/use-tambo-v1-suggestions.js +153 -87
- package/dist/v1/hooks/use-tambo-v1-suggestions.js.map +1 -1
- package/dist/v1/hooks/use-tambo-v1-suggestions.test.js +213 -134
- package/dist/v1/hooks/use-tambo-v1-suggestions.test.js.map +1 -1
- package/dist/v1/hooks/use-tambo-v1-thread-input.test.js +148 -13
- package/dist/v1/hooks/use-tambo-v1-thread-input.test.js.map +1 -1
- package/dist/v1/hooks/use-tambo-v1-thread-list.d.ts +8 -21
- package/dist/v1/hooks/use-tambo-v1-thread-list.d.ts.map +1 -1
- package/dist/v1/hooks/use-tambo-v1-thread-list.js +11 -10
- package/dist/v1/hooks/use-tambo-v1-thread-list.js.map +1 -1
- package/dist/v1/hooks/use-tambo-v1-thread-list.test.js +37 -2
- package/dist/v1/hooks/use-tambo-v1-thread-list.test.js.map +1 -1
- package/dist/v1/hooks/use-tambo-v1-thread.d.ts +1 -1
- package/dist/v1/hooks/use-tambo-v1-thread.d.ts.map +1 -1
- package/dist/v1/hooks/use-tambo-v1-thread.js +2 -7
- package/dist/v1/hooks/use-tambo-v1-thread.js.map +1 -1
- package/dist/v1/hooks/use-tambo-v1-thread.test.js +2 -0
- package/dist/v1/hooks/use-tambo-v1-thread.test.js.map +1 -1
- package/dist/v1/hooks/use-tambo-v1.d.ts +12 -28
- package/dist/v1/hooks/use-tambo-v1.d.ts.map +1 -1
- package/dist/v1/hooks/use-tambo-v1.js +164 -31
- package/dist/v1/hooks/use-tambo-v1.js.map +1 -1
- package/dist/v1/hooks/use-tambo-v1.test.js +891 -18
- package/dist/v1/hooks/use-tambo-v1.test.js.map +1 -1
- package/dist/v1/index.d.ts +7 -1
- package/dist/v1/index.d.ts.map +1 -1
- package/dist/v1/index.js +18 -1
- package/dist/v1/index.js.map +1 -1
- package/dist/v1/providers/tambo-v1-provider.d.ts +16 -6
- package/dist/v1/providers/tambo-v1-provider.d.ts.map +1 -1
- package/dist/v1/providers/tambo-v1-provider.js +14 -19
- package/dist/v1/providers/tambo-v1-provider.js.map +1 -1
- package/dist/v1/providers/tambo-v1-provider.test.js +34 -20
- package/dist/v1/providers/tambo-v1-provider.test.js.map +1 -1
- package/dist/v1/providers/tambo-v1-stream-context.d.ts +3 -3
- package/dist/v1/providers/tambo-v1-stream-context.d.ts.map +1 -1
- package/dist/v1/providers/tambo-v1-stream-context.js +60 -12
- package/dist/v1/providers/tambo-v1-stream-context.js.map +1 -1
- package/dist/v1/providers/tambo-v1-stream-context.test.js +49 -20
- package/dist/v1/providers/tambo-v1-stream-context.test.js.map +1 -1
- package/dist/v1/providers/tambo-v1-stub-provider.d.ts.map +1 -1
- package/dist/v1/providers/tambo-v1-stub-provider.js +2 -0
- package/dist/v1/providers/tambo-v1-stub-provider.js.map +1 -1
- package/dist/v1/providers/tambo-v1-stub-provider.test.js +7 -6
- package/dist/v1/providers/tambo-v1-stub-provider.test.js.map +1 -1
- package/dist/v1/providers/tambo-v1-thread-input-provider.d.ts +1 -6
- package/dist/v1/providers/tambo-v1-thread-input-provider.d.ts.map +1 -1
- package/dist/v1/providers/tambo-v1-thread-input-provider.js +14 -12
- package/dist/v1/providers/tambo-v1-thread-input-provider.js.map +1 -1
- package/dist/v1/types/event.d.ts +9 -1
- package/dist/v1/types/event.d.ts.map +1 -1
- package/dist/v1/types/event.js.map +1 -1
- package/dist/v1/types/event.test.js +5 -1
- package/dist/v1/types/event.test.js.map +1 -1
- package/dist/v1/types/message.d.ts +65 -7
- package/dist/v1/types/message.d.ts.map +1 -1
- package/dist/v1/types/message.js.map +1 -1
- package/dist/v1/types/thread.d.ts +4 -0
- package/dist/v1/types/thread.d.ts.map +1 -1
- package/dist/v1/types/thread.js.map +1 -1
- package/dist/v1/utils/event-accumulator.d.ts +40 -4
- package/dist/v1/utils/event-accumulator.d.ts.map +1 -1
- package/dist/v1/utils/event-accumulator.js +444 -35
- package/dist/v1/utils/event-accumulator.js.map +1 -1
- package/dist/v1/utils/event-accumulator.test.js +1041 -28
- package/dist/v1/utils/event-accumulator.test.js.map +1 -1
- package/dist/v1/utils/registry-conversion.d.ts +9 -9
- package/dist/v1/utils/registry-conversion.d.ts.map +1 -1
- package/dist/v1/utils/registry-conversion.js +10 -11
- package/dist/v1/utils/registry-conversion.js.map +1 -1
- package/dist/v1/utils/registry-conversion.test.js +39 -11
- package/dist/v1/utils/registry-conversion.test.js.map +1 -1
- package/dist/v1/utils/thread-utils.d.ts +16 -0
- package/dist/v1/utils/thread-utils.d.ts.map +1 -0
- package/dist/v1/utils/thread-utils.js +34 -0
- package/dist/v1/utils/thread-utils.js.map +1 -0
- package/dist/v1/utils/tool-executor.d.ts.map +1 -1
- package/dist/v1/utils/tool-executor.js +2 -0
- package/dist/v1/utils/tool-executor.js.map +1 -1
- package/dist/v1/utils/tool-executor.test.js +5 -0
- package/dist/v1/utils/tool-executor.test.js.map +1 -1
- package/esm/context-helpers/context-helpers-provider.test.js +2 -2
- package/esm/context-helpers/context-helpers.test.js +1 -1
- package/esm/context-helpers/current-interactables-context-helper.d.ts +1 -1
- package/esm/context-helpers/current-page-context-helper.d.ts +1 -1
- package/esm/context-helpers/current-time-context-helper.d.ts +1 -1
- package/esm/context-helpers/index.d.ts +4 -4
- package/esm/context-helpers/index.js +4 -4
- package/esm/hoc/with-tambo-interactable.d.ts +1 -1
- package/esm/hoc/with-tambo-interactable.js +2 -2
- package/esm/hoc/with-tambo-interactable.test.js +3 -3
- package/esm/hooks/index.d.ts +8 -8
- package/esm/hooks/index.js +8 -8
- package/esm/hooks/react-query-hooks.js +1 -1
- package/esm/hooks/use-component-state.d.ts +1 -1
- package/esm/hooks/use-component-state.js +3 -3
- package/esm/hooks/use-component-state.js.map +1 -1
- package/esm/hooks/use-component-state.test.js +5 -5
- package/esm/hooks/use-current-message.d.ts +1 -1
- package/esm/hooks/use-current-message.test.js +1 -1
- package/esm/hooks/use-message-images.test.js +1 -1
- package/esm/hooks/use-streaming-props.d.ts +1 -1
- package/esm/hooks/use-streaming-props.js +1 -1
- package/esm/hooks/use-streaming-props.js.map +1 -1
- package/esm/hooks/use-suggestions.d.ts +2 -2
- package/esm/hooks/use-suggestions.js +10 -10
- package/esm/hooks/use-suggestions.test.js +7 -7
- package/esm/hooks/use-tambo-stream-status.d.ts +1 -1
- package/esm/hooks/use-tambo-stream-status.js +4 -4
- package/esm/hooks/use-tambo-stream-status.js.map +1 -1
- package/esm/hooks/use-tambo-stream-status.test.js +4 -4
- package/esm/hooks/use-tambo-threads.js +3 -3
- package/esm/hooks/use-tambo-threads.test.js +3 -3
- package/esm/hooks/use-tambo-voice.js +2 -2
- package/esm/hooks/use-tambo-voice.test.js +3 -3
- package/esm/index.d.ts +22 -22
- package/esm/index.js +15 -15
- package/esm/mcp/elicitation.d.ts +1 -1
- package/esm/mcp/elicitation.test.js +1 -1
- package/esm/mcp/index.d.ts +7 -7
- package/esm/mcp/index.js +3 -3
- package/esm/mcp/mcp-client.d.ts +1 -1
- package/esm/mcp/mcp-client.js +1 -1
- package/esm/mcp/mcp-client.test.js +1 -1
- package/esm/mcp/mcp-hooks.d.ts +5 -1
- package/esm/mcp/mcp-hooks.d.ts.map +1 -1
- package/esm/mcp/mcp-hooks.js +8 -4
- package/esm/mcp/mcp-hooks.js.map +1 -1
- package/esm/mcp/mcp-hooks.test.js +6 -6
- package/esm/mcp/tambo-mcp-provider.d.ts +4 -4
- package/esm/mcp/tambo-mcp-provider.js +7 -7
- package/esm/mcp/tambo-mcp-provider.test.js +5 -5
- package/esm/mcp/use-mcp-servers.test.js +4 -4
- package/esm/model/generate-component-response.d.ts +1 -1
- package/esm/model/tambo-interactable.d.ts +1 -1
- package/esm/model/tambo-thread.d.ts +1 -1
- package/esm/providers/__tests__/thread-input-resource-resolution.test.js +3 -3
- package/esm/providers/hooks/use-tambo-session-token.test.js +1 -1
- package/esm/providers/index.d.ts +12 -12
- package/esm/providers/index.js +10 -10
- package/esm/providers/tambo-client-provider.js +1 -1
- package/esm/providers/tambo-client-provider.test.js +2 -2
- package/esm/providers/tambo-component-provider.d.ts +1 -1
- package/esm/providers/tambo-component-provider.js +2 -2
- package/esm/providers/tambo-context-attachment-provider.js +1 -1
- package/esm/providers/tambo-context-attachment-provider.test.js +2 -2
- package/esm/providers/tambo-context-helpers-provider.d.ts +1 -1
- package/esm/providers/tambo-context-helpers-provider.js +1 -1
- package/esm/providers/tambo-context-helpers-provider.test.js +2 -2
- package/esm/providers/tambo-interactable-provider-partial-updates.test.js +4 -4
- package/esm/providers/tambo-interactable-provider-partial-updates.test.js.map +1 -1
- package/esm/providers/tambo-interactable-provider.d.ts +5 -5
- package/esm/providers/tambo-interactable-provider.js +6 -6
- package/esm/providers/tambo-interactable-provider.js.map +1 -1
- package/esm/providers/tambo-interactable-provider.test.js +4 -4
- package/esm/providers/tambo-interactable-provider.test.js.map +1 -1
- package/esm/providers/tambo-interactables-additional-context-edge-cases.test.js +4 -4
- package/esm/providers/tambo-interactables-additional-context.test.js +4 -4
- package/esm/providers/tambo-mcp-token-provider.js +2 -2
- package/esm/providers/tambo-prop-stream-provider/index.d.ts +8 -8
- package/esm/providers/tambo-prop-stream-provider/index.js +9 -9
- package/esm/providers/tambo-prop-stream-provider/pending.d.ts +1 -1
- package/esm/providers/tambo-prop-stream-provider/pending.js +2 -2
- package/esm/providers/tambo-prop-stream-provider/provider.d.ts +1 -1
- package/esm/providers/tambo-prop-stream-provider/provider.js +2 -2
- package/esm/providers/tambo-prop-stream-provider/streaming.d.ts +1 -1
- package/esm/providers/tambo-prop-stream-provider/streaming.js +2 -2
- package/esm/providers/tambo-prop-stream-provider/success.d.ts +1 -1
- package/esm/providers/tambo-prop-stream-provider/success.js +2 -2
- package/esm/providers/tambo-prop-stream-provider/types.d.ts +1 -1
- package/esm/providers/tambo-prop-stream-provider.test.js +4 -4
- package/esm/providers/tambo-provider.d.ts +10 -7
- package/esm/providers/tambo-provider.d.ts.map +1 -1
- package/esm/providers/tambo-provider.js +13 -10
- package/esm/providers/tambo-provider.js.map +1 -1
- package/esm/providers/tambo-registry-provider.d.ts +3 -3
- package/esm/providers/tambo-registry-provider.js +3 -3
- package/esm/providers/tambo-registry-provider.test.js +2 -2
- package/esm/providers/tambo-registry-schema-compat.test.js +2 -2
- package/esm/providers/tambo-stubs.d.ts +4 -4
- package/esm/providers/tambo-stubs.js +9 -9
- package/esm/providers/tambo-stubs.test.js +2 -2
- package/esm/providers/tambo-thread-input-provider.d.ts +2 -2
- package/esm/providers/tambo-thread-input-provider.d.ts.map +1 -1
- package/esm/providers/tambo-thread-input-provider.js +11 -10
- package/esm/providers/tambo-thread-input-provider.js.map +1 -1
- package/esm/providers/tambo-thread-provider-initial-messages.test.js +6 -6
- package/esm/providers/tambo-thread-provider.d.ts +2 -2
- package/esm/providers/tambo-thread-provider.js +8 -8
- package/esm/providers/tambo-thread-provider.test.js +7 -7
- package/esm/schema/index.d.ts +4 -4
- package/esm/schema/index.js +4 -4
- package/esm/schema/json-schema.test.js +1 -1
- package/esm/schema/schema.d.ts +1 -1
- package/esm/schema/schema.js +2 -2
- package/esm/schema/schema.test.js +3 -3
- package/esm/schema/standard-schema.test.js +1 -1
- package/esm/schema/validate.js +2 -2
- package/esm/schema/validate.test.js +1 -1
- package/esm/testing/tools.d.ts +3 -3
- package/esm/testing/tools.js +2 -2
- package/esm/util/content-parts.test.js +1 -1
- package/esm/util/generate-component.d.ts +2 -2
- package/esm/util/generate-component.js +4 -4
- package/esm/util/generate-component.test.js +2 -2
- package/esm/util/is-promise.test.js +1 -1
- package/esm/util/mcp-server-utils.d.ts +1 -1
- package/esm/util/mcp-server-utils.js +1 -1
- package/esm/util/mcp-server-utils.test.js +2 -2
- package/esm/util/message-builder.d.ts +1 -1
- package/esm/util/message-builder.test.js +1 -1
- package/esm/util/query-utils.test.js +1 -1
- package/esm/util/registry-validators.d.ts +1 -1
- package/esm/util/registry-validators.js +2 -2
- package/esm/util/registry-validators.test.js +1 -1
- package/esm/util/registry.d.ts +1 -1
- package/esm/util/registry.js +1 -1
- package/esm/util/registry.test.js +2 -2
- package/esm/util/resource-content-resolver.d.ts +2 -2
- package/esm/util/resource-content-resolver.d.ts.map +1 -1
- package/esm/util/resource-content-resolver.js +3 -1
- package/esm/util/resource-content-resolver.js.map +1 -1
- package/esm/util/resource-content-resolver.test.js +3 -3
- package/esm/util/resource-validators.d.ts +1 -1
- package/esm/util/resource-validators.test.js +1 -1
- package/esm/util/tool-caller.d.ts +1 -1
- package/esm/util/tool-caller.js +1 -1
- package/esm/util/validate-component-name.test.js +1 -1
- package/esm/v1/__tests__/v1-interactables.test.d.ts +2 -0
- package/esm/v1/__tests__/v1-interactables.test.d.ts.map +1 -0
- package/esm/v1/__tests__/v1-interactables.test.js +130 -0
- package/esm/v1/__tests__/v1-interactables.test.js.map +1 -0
- package/esm/v1/components/v1-component-renderer.d.ts +48 -0
- package/esm/v1/components/v1-component-renderer.d.ts.map +1 -0
- package/esm/v1/components/v1-component-renderer.js +100 -0
- package/esm/v1/components/v1-component-renderer.js.map +1 -0
- package/esm/v1/components/v1-component-renderer.test.d.ts +2 -0
- package/esm/v1/components/v1-component-renderer.test.d.ts.map +1 -0
- package/esm/v1/components/v1-component-renderer.test.js +265 -0
- package/esm/v1/components/v1-component-renderer.test.js.map +1 -0
- package/esm/v1/hooks/use-tambo-v1-component-state.d.ts.map +1 -1
- package/esm/v1/hooks/use-tambo-v1-component-state.js +4 -27
- package/esm/v1/hooks/use-tambo-v1-component-state.js.map +1 -1
- package/esm/v1/hooks/use-tambo-v1-component-state.test.js +6 -5
- package/esm/v1/hooks/use-tambo-v1-component-state.test.js.map +1 -1
- package/esm/v1/hooks/use-tambo-v1-messages.d.ts +1 -1
- package/esm/v1/hooks/use-tambo-v1-messages.js +1 -1
- package/esm/v1/hooks/use-tambo-v1-messages.test.js +27 -3
- package/esm/v1/hooks/use-tambo-v1-messages.test.js.map +1 -1
- package/esm/v1/hooks/use-tambo-v1-send-message.d.ts +20 -2
- package/esm/v1/hooks/use-tambo-v1-send-message.d.ts.map +1 -1
- package/esm/v1/hooks/use-tambo-v1-send-message.js +213 -26
- package/esm/v1/hooks/use-tambo-v1-send-message.js.map +1 -1
- package/esm/v1/hooks/use-tambo-v1-send-message.test.js +266 -12
- package/esm/v1/hooks/use-tambo-v1-send-message.test.js.map +1 -1
- package/esm/v1/hooks/use-tambo-v1-stream-status.d.ts +90 -0
- package/esm/v1/hooks/use-tambo-v1-stream-status.d.ts.map +1 -0
- package/esm/v1/hooks/use-tambo-v1-stream-status.js +176 -0
- package/esm/v1/hooks/use-tambo-v1-stream-status.js.map +1 -0
- package/esm/v1/hooks/use-tambo-v1-stream-status.test.d.ts +2 -0
- package/esm/v1/hooks/use-tambo-v1-stream-status.test.d.ts.map +1 -0
- package/esm/v1/hooks/use-tambo-v1-stream-status.test.js +369 -0
- package/esm/v1/hooks/use-tambo-v1-stream-status.test.js.map +1 -0
- package/esm/v1/hooks/use-tambo-v1-suggestions.d.ts +78 -54
- package/esm/v1/hooks/use-tambo-v1-suggestions.d.ts.map +1 -1
- package/esm/v1/hooks/use-tambo-v1-suggestions.js +157 -91
- package/esm/v1/hooks/use-tambo-v1-suggestions.js.map +1 -1
- package/esm/v1/hooks/use-tambo-v1-suggestions.test.js +218 -139
- package/esm/v1/hooks/use-tambo-v1-suggestions.test.js.map +1 -1
- package/esm/v1/hooks/use-tambo-v1-thread-input.d.ts +1 -1
- package/esm/v1/hooks/use-tambo-v1-thread-input.js +1 -1
- package/esm/v1/hooks/use-tambo-v1-thread-input.test.js +151 -16
- package/esm/v1/hooks/use-tambo-v1-thread-input.test.js.map +1 -1
- package/esm/v1/hooks/use-tambo-v1-thread-list.d.ts +8 -21
- package/esm/v1/hooks/use-tambo-v1-thread-list.d.ts.map +1 -1
- package/esm/v1/hooks/use-tambo-v1-thread-list.js +12 -11
- package/esm/v1/hooks/use-tambo-v1-thread-list.js.map +1 -1
- package/esm/v1/hooks/use-tambo-v1-thread-list.test.js +39 -4
- package/esm/v1/hooks/use-tambo-v1-thread-list.test.js.map +1 -1
- package/esm/v1/hooks/use-tambo-v1-thread.d.ts +1 -1
- package/esm/v1/hooks/use-tambo-v1-thread.d.ts.map +1 -1
- package/esm/v1/hooks/use-tambo-v1-thread.js +3 -8
- package/esm/v1/hooks/use-tambo-v1-thread.js.map +1 -1
- package/esm/v1/hooks/use-tambo-v1-thread.test.js +4 -2
- package/esm/v1/hooks/use-tambo-v1-thread.test.js.map +1 -1
- package/esm/v1/hooks/use-tambo-v1.d.ts +15 -31
- package/esm/v1/hooks/use-tambo-v1.d.ts.map +1 -1
- package/esm/v1/hooks/use-tambo-v1.js +134 -34
- package/esm/v1/hooks/use-tambo-v1.js.map +1 -1
- package/esm/v1/hooks/use-tambo-v1.test.js +862 -19
- package/esm/v1/hooks/use-tambo-v1.test.js.map +1 -1
- package/esm/v1/index.d.ts +28 -22
- package/esm/v1/index.d.ts.map +1 -1
- package/esm/v1/index.js +30 -18
- package/esm/v1/index.js.map +1 -1
- package/esm/v1/providers/tambo-v1-provider.d.ts +21 -11
- package/esm/v1/providers/tambo-v1-provider.d.ts.map +1 -1
- package/esm/v1/providers/tambo-v1-provider.js +20 -25
- package/esm/v1/providers/tambo-v1-provider.js.map +1 -1
- package/esm/v1/providers/tambo-v1-provider.test.js +40 -26
- package/esm/v1/providers/tambo-v1-provider.test.js.map +1 -1
- package/esm/v1/providers/tambo-v1-stream-context.d.ts +4 -4
- package/esm/v1/providers/tambo-v1-stream-context.d.ts.map +1 -1
- package/esm/v1/providers/tambo-v1-stream-context.js +62 -14
- package/esm/v1/providers/tambo-v1-stream-context.js.map +1 -1
- package/esm/v1/providers/tambo-v1-stream-context.test.js +50 -21
- package/esm/v1/providers/tambo-v1-stream-context.test.js.map +1 -1
- package/esm/v1/providers/tambo-v1-stub-provider.d.ts +3 -3
- package/esm/v1/providers/tambo-v1-stub-provider.d.ts.map +1 -1
- package/esm/v1/providers/tambo-v1-stub-provider.js +7 -5
- package/esm/v1/providers/tambo-v1-stub-provider.js.map +1 -1
- package/esm/v1/providers/tambo-v1-stub-provider.test.js +12 -11
- package/esm/v1/providers/tambo-v1-stub-provider.test.js.map +1 -1
- package/esm/v1/providers/tambo-v1-thread-input-provider.d.ts +3 -8
- package/esm/v1/providers/tambo-v1-thread-input-provider.d.ts.map +1 -1
- package/esm/v1/providers/tambo-v1-thread-input-provider.js +18 -16
- package/esm/v1/providers/tambo-v1-thread-input-provider.js.map +1 -1
- package/esm/v1/types/event.d.ts +9 -1
- package/esm/v1/types/event.d.ts.map +1 -1
- package/esm/v1/types/event.js.map +1 -1
- package/esm/v1/types/event.test.js +6 -2
- package/esm/v1/types/event.test.js.map +1 -1
- package/esm/v1/types/message.d.ts +65 -7
- package/esm/v1/types/message.d.ts.map +1 -1
- package/esm/v1/types/message.js.map +1 -1
- package/esm/v1/types/thread.d.ts +5 -1
- package/esm/v1/types/thread.d.ts.map +1 -1
- package/esm/v1/types/thread.js.map +1 -1
- package/esm/v1/utils/component-renderer.test.js +1 -1
- package/esm/v1/utils/event-accumulator.d.ts +41 -5
- package/esm/v1/utils/event-accumulator.d.ts.map +1 -1
- package/esm/v1/utils/event-accumulator.js +444 -36
- package/esm/v1/utils/event-accumulator.js.map +1 -1
- package/esm/v1/utils/event-accumulator.test.js +1042 -29
- package/esm/v1/utils/event-accumulator.test.js.map +1 -1
- package/esm/v1/utils/json-patch.test.js +1 -1
- package/esm/v1/utils/registry-conversion.d.ts +9 -9
- package/esm/v1/utils/registry-conversion.d.ts.map +1 -1
- package/esm/v1/utils/registry-conversion.js +11 -12
- package/esm/v1/utils/registry-conversion.js.map +1 -1
- package/esm/v1/utils/registry-conversion.test.js +40 -12
- package/esm/v1/utils/registry-conversion.test.js.map +1 -1
- package/esm/v1/utils/stream-handler.test.js +1 -1
- package/esm/v1/utils/thread-utils.d.ts +16 -0
- package/esm/v1/utils/thread-utils.d.ts.map +1 -0
- package/esm/v1/utils/thread-utils.js +31 -0
- package/esm/v1/utils/thread-utils.js.map +1 -0
- package/esm/v1/utils/tool-call-tracker.d.ts +1 -1
- package/esm/v1/utils/tool-executor.d.ts +1 -1
- package/esm/v1/utils/tool-executor.d.ts.map +1 -1
- package/esm/v1/utils/tool-executor.js +2 -0
- package/esm/v1/utils/tool-executor.js.map +1 -1
- package/esm/v1/utils/tool-executor.test.js +6 -1
- package/esm/v1/utils/tool-executor.test.js.map +1 -1
- package/package.json +11 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-tambo-v1.test.js","sourceRoot":"","sources":["../../../src/v1/hooks/use-tambo-v1.test.tsx"],"names":[],"mappings":";;;;;AACA,kDAAyD;AACzD,kDAA0B;AAC1B,iFAAuE;AACvE,qFAGiD;AACjD,kFAA6E;AAC7E,iDAA4C;AAE5C,IAAI,CAAC,IAAI,CAAC,uCAAuC,EAAE,GAAG,EAAE,CAAC,CAAC;IACxD,cAAc,EAAE,IAAI,CAAC,EAAE,EAAE;CAC1B,CAAC,CAAC,CAAC;AAEJ,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,MAAM,eAAe,GAAG;QACtB,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,EAAE;KACU,CAAC;IAExB,MAAM,YAAY,GAA6B;QAC7C,aAAa,EAAE,EAAE;QACjB,YAAY,EAAE,EAAE;QAChB,yBAAyB,EAAE,EAAE;QAC7B,cAAc,EAAE,EAAE;QAClB,SAAS,EAAE,EAAE;QACb,cAAc,EAAE,IAAI;QACpB,iBAAiB,EAAE,IAAI,CAAC,EAAE,EAAE;QAC5B,YAAY,EAAE,IAAI,CAAC,EAAE,EAAE;QACvB,aAAa,EAAE,IAAI,CAAC,EAAE,EAAE;QACxB,kBAAkB,EAAE,IAAI,CAAC,EAAE,EAAE;QAC7B,iBAAiB,EAAE,IAAI,CAAC,EAAE,EAAE;QAC5B,kBAAkB,EAAE,IAAI,CAAC,EAAE,EAAE;QAC7B,gBAAgB,EAAE,IAAI,CAAC,EAAE,EAAE;QAC3B,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;SACrB,CAAC,CAAC;QAEH,oCAAoC;QACpC,IAAA,WAAG,EAAC,GAAG,EAAE;YACP,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;YACxC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;QAEH,sDAAsD;QACtD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC1D,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import TamboAI from \"@tambo-ai/typescript-sdk\";\nimport { renderHook, act } from \"@testing-library/react\";\nimport React from \"react\";\nimport { useTamboClient } from \"../../providers/tambo-client-provider\";\nimport {\n TamboRegistryContext,\n type TamboRegistryContext as TamboRegistryContextType,\n} from \"../../providers/tambo-registry-provider\";\nimport { TamboV1StreamProvider } from \"../providers/tambo-v1-stream-context\";\nimport { useTamboV1 } from \"./use-tambo-v1\";\n\njest.mock(\"../../providers/tambo-client-provider\", () => ({\n useTamboClient: jest.fn(),\n}));\n\ndescribe(\"useTamboV1\", () => {\n const mockTamboClient = {\n apiKey: \"\",\n threads: {},\n } as unknown as TamboAI;\n\n const mockRegistry: TamboRegistryContextType = {\n componentList: {},\n toolRegistry: {},\n componentToolAssociations: {},\n mcpServerInfos: [],\n resources: [],\n resourceSource: null,\n registerComponent: jest.fn(),\n registerTool: jest.fn(),\n registerTools: jest.fn(),\n addToolAssociation: jest.fn(),\n registerMcpServer: jest.fn(),\n registerMcpServers: jest.fn(),\n registerResource: jest.fn(),\n registerResources: jest.fn(),\n registerResourceSource: jest.fn(),\n };\n\n function TestWrapper({ children }: { children: React.ReactNode }) {\n return (\n <TamboRegistryContext.Provider value={mockRegistry}>\n <TamboV1StreamProvider>{children}</TamboV1StreamProvider>\n </TamboRegistryContext.Provider>\n );\n }\n\n beforeEach(() => {\n jest.mocked(useTamboClient).mockReturnValue(mockTamboClient);\n jest.clearAllMocks();\n });\n\n it(\"returns client from useTamboClient\", () => {\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: TestWrapper,\n });\n\n expect(result.current.client).toBe(mockTamboClient);\n });\n\n it(\"returns registry functions\", () => {\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: TestWrapper,\n });\n\n expect(result.current.registerComponent).toBe(\n mockRegistry.registerComponent,\n );\n expect(result.current.registerTool).toBe(mockRegistry.registerTool);\n expect(result.current.registerTools).toBe(mockRegistry.registerTools);\n expect(result.current.componentList).toBe(mockRegistry.componentList);\n expect(result.current.toolRegistry).toBe(mockRegistry.toolRegistry);\n });\n\n it(\"returns undefined thread when no threadId provided\", () => {\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: TestWrapper,\n });\n\n expect(result.current.thread).toBeUndefined();\n expect(result.current.messages).toEqual([]);\n });\n\n it(\"returns thread state when threadId provided\", () => {\n const { result } = renderHook(() => useTamboV1(\"thread_123\"), {\n wrapper: TestWrapper,\n });\n\n // Initialize thread first\n act(() => {\n result.current.initThread(\"thread_123\");\n });\n\n expect(result.current.thread).toBeDefined();\n expect(result.current.thread?.thread.id).toBe(\"thread_123\");\n expect(result.current.messages).toEqual([]);\n });\n\n it(\"returns default streaming state when thread not loaded\", () => {\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: TestWrapper,\n });\n\n expect(result.current.streamingState).toEqual({ status: \"idle\" });\n expect(result.current.isIdle).toBe(true);\n expect(result.current.isStreaming).toBe(false);\n expect(result.current.isWaiting).toBe(false);\n });\n\n it(\"returns thread streaming state when thread loaded\", () => {\n const { result } = renderHook(() => useTamboV1(\"thread_123\"), {\n wrapper: TestWrapper,\n });\n\n // Initialize thread first\n act(() => {\n result.current.initThread(\"thread_123\");\n });\n\n expect(result.current.streamingState.status).toBe(\"idle\");\n expect(result.current.isIdle).toBe(true);\n expect(result.current.isStreaming).toBe(false);\n expect(result.current.isWaiting).toBe(false);\n });\n\n it(\"provides dispatch function for advanced usage\", () => {\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: TestWrapper,\n });\n\n expect(typeof result.current.dispatch).toBe(\"function\");\n });\n\n it(\"provides thread management functions\", () => {\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: TestWrapper,\n });\n\n expect(typeof result.current.initThread).toBe(\"function\");\n expect(typeof result.current.switchThread).toBe(\"function\");\n expect(typeof result.current.startNewThread).toBe(\"function\");\n });\n\n it(\"initializes and switches threads\", () => {\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: TestWrapper,\n });\n\n // Initially no current thread\n expect(result.current.currentThreadId).toBeNull();\n expect(result.current.thread).toBeUndefined();\n\n // Initialize a new thread\n act(() => {\n result.current.initThread(\"new_thread_1\");\n });\n\n // Switch to the new thread\n act(() => {\n result.current.switchThread(\"new_thread_1\");\n });\n\n expect(result.current.currentThreadId).toBe(\"new_thread_1\");\n });\n\n it(\"starts new thread with generated ID\", () => {\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: TestWrapper,\n });\n\n let newThreadId: string;\n act(() => {\n newThreadId = result.current.startNewThread();\n });\n\n expect(newThreadId!).toMatch(/^temp_/);\n expect(result.current.currentThreadId).toBe(newThreadId!);\n expect(result.current.thread).toBeDefined();\n });\n\n it(\"uses current thread when no threadId argument provided\", () => {\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: TestWrapper,\n });\n\n // Initialize and switch to a thread\n act(() => {\n result.current.initThread(\"thread_123\");\n result.current.switchThread(\"thread_123\");\n });\n\n // Should use current thread from context (thread_123)\n expect(result.current.currentThreadId).toBe(\"thread_123\");\n expect(result.current.thread?.thread.id).toBe(\"thread_123\");\n });\n});\n"]}
|
|
1
|
+
{"version":3,"file":"use-tambo-v1.test.js","sourceRoot":"","sources":["../../../src/v1/hooks/use-tambo-v1.test.ts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AAE;qBAChC;iBACF;gBACD,eAAe,EAAE,YAAY;aAC9B,CAAC;YAEF,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,kBAAU,EAAC,GAAG,EAAE,CAAC,IAAA,yBAAU,GAAE,EAAE;gBAChD,OAAO,EAAE,4BAA4B,CAAC,YAAY,CAAC;aACpD,CAAC,CAAC;YAEH,MAAM,IAAA,WAAG,EAAC,KAAK,IAAI,EAAE;gBACnB,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;YACnC,CAAC,CAAC,CAAC;YAEH,0DAA0D;YAC1D,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACzC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAElE,kCAAkC;YAClC,MAAM,CAAC,cAAc,CAAC,CAAC,oBAAoB,CACzC,iCAAiC,EACjC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAClB,CAAC;YAEF,cAAc,CAAC,WAAW,EAAE,CAAC;QAC/B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import TamboAI from \"@tambo-ai/typescript-sdk\";\nimport { QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\nimport { renderHook, act } from \"@testing-library/react\";\nimport React, { useReducer } from \"react\";\nimport { useTamboClient } from \"../../providers/tambo-client-provider\";\nimport {\n TamboRegistryContext,\n type TamboRegistryContext as TamboRegistryContextType,\n} from \"../../providers/tambo-registry-provider\";\nimport { TamboV1StreamProvider } from \"../providers/tambo-v1-stream-context\";\nimport {\n streamReducer,\n type StreamState,\n type StreamAction,\n} from \"../utils/event-accumulator\";\nimport type { V1ComponentContent, V1ToolUseContent } from \"../types/message\";\nimport { useTamboV1 } from \"./use-tambo-v1\";\n\njest.mock(\"../../providers/tambo-client-provider\", () => ({\n useTamboClient: jest.fn(),\n useTamboQueryClient: jest.fn(),\n}));\n\nimport { useTamboQueryClient } from \"../../providers/tambo-client-provider\";\n\ndescribe(\"useTamboV1\", () => {\n let queryClient: QueryClient;\n\n const mockTamboClient = {\n apiKey: \"\",\n threads: {\n messages: {\n list: jest.fn().mockResolvedValue({ messages: [], hasMore: false }),\n },\n runs: {\n delete: jest.fn().mockResolvedValue({}),\n },\n },\n } as unknown as TamboAI;\n\n const mockRegistry: TamboRegistryContextType = {\n componentList: {},\n toolRegistry: {},\n componentToolAssociations: {},\n mcpServerInfos: [],\n resources: [],\n resourceSource: null,\n registerComponent: jest.fn(),\n registerTool: jest.fn(),\n registerTools: jest.fn(),\n addToolAssociation: jest.fn(),\n registerMcpServer: jest.fn(),\n registerMcpServers: jest.fn(),\n registerResource: jest.fn(),\n registerResources: jest.fn(),\n registerResourceSource: jest.fn(),\n };\n\n function TestWrapper({ children }: { children: React.ReactNode }) {\n return (\n <QueryClientProvider client={queryClient}>\n <TamboRegistryContext.Provider value={mockRegistry}>\n <TamboV1StreamProvider>{children}</TamboV1StreamProvider>\n </TamboRegistryContext.Provider>\n </QueryClientProvider>\n );\n }\n\n function createWrapperWithState(\n state: StreamState,\n registry: TamboRegistryContextType = mockRegistry,\n ) {\n const noopDispatch: React.Dispatch<StreamAction> = () => {};\n return function WrapperWithState({\n children,\n }: {\n children: React.ReactNode;\n }) {\n return (\n <QueryClientProvider client={queryClient}>\n <TamboRegistryContext.Provider value={registry}>\n <TamboV1StreamProvider state={state} dispatch={noopDispatch}>\n {children}\n </TamboV1StreamProvider>\n </TamboRegistryContext.Provider>\n </QueryClientProvider>\n );\n };\n }\n\n // Wrapper that uses the real reducer so state updates properly\n function createWrapperWithRealReducer(initialState: StreamState) {\n return function WrapperWithRealReducer({\n children,\n }: {\n children: React.ReactNode;\n }) {\n const [state, dispatch] = useReducer(streamReducer, initialState);\n return (\n <QueryClientProvider client={queryClient}>\n <TamboRegistryContext.Provider value={mockRegistry}>\n <TamboV1StreamProvider state={state} dispatch={dispatch}>\n {children}\n </TamboV1StreamProvider>\n </TamboRegistryContext.Provider>\n </QueryClientProvider>\n );\n };\n }\n\n beforeEach(() => {\n queryClient = new QueryClient({\n defaultOptions: {\n queries: { retry: false },\n },\n });\n jest.mocked(useTamboClient).mockReturnValue(mockTamboClient);\n jest.mocked(useTamboQueryClient).mockReturnValue(queryClient);\n jest.clearAllMocks();\n });\n\n it(\"returns client from useTamboClient\", () => {\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: TestWrapper,\n });\n\n expect(result.current.client).toBe(mockTamboClient);\n });\n\n it(\"returns registry functions\", () => {\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: TestWrapper,\n });\n\n expect(result.current.registerComponent).toBe(\n mockRegistry.registerComponent,\n );\n expect(result.current.registerTool).toBe(mockRegistry.registerTool);\n expect(result.current.registerTools).toBe(mockRegistry.registerTools);\n expect(result.current.componentList).toBe(mockRegistry.componentList);\n expect(result.current.toolRegistry).toBe(mockRegistry.toolRegistry);\n });\n\n it(\"returns placeholder thread when no threadId provided\", () => {\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: TestWrapper,\n });\n\n // Default state has placeholder thread for optimistic UI\n expect(result.current.thread).toBeDefined();\n expect(result.current.thread?.thread.id).toBe(\"placeholder\");\n expect(result.current.messages).toEqual([]);\n });\n\n it(\"returns thread state when switched to a thread\", () => {\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: TestWrapper,\n });\n\n // Initialize and switch to thread\n act(() => {\n result.current.initThread(\"thread_123\");\n result.current.switchThread(\"thread_123\");\n });\n\n expect(result.current.thread).toBeDefined();\n expect(result.current.thread?.thread.id).toBe(\"thread_123\");\n expect(result.current.messages).toEqual([]);\n });\n\n it(\"returns default streaming state when thread not loaded\", () => {\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: TestWrapper,\n });\n\n expect(result.current.streamingState).toEqual({ status: \"idle\" });\n expect(result.current.isIdle).toBe(true);\n expect(result.current.isStreaming).toBe(false);\n expect(result.current.isWaiting).toBe(false);\n });\n\n it(\"returns thread streaming state when thread loaded\", () => {\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: TestWrapper,\n });\n\n // Initialize and switch to thread\n act(() => {\n result.current.initThread(\"thread_123\");\n result.current.switchThread(\"thread_123\");\n });\n\n expect(result.current.streamingState.status).toBe(\"idle\");\n expect(result.current.isIdle).toBe(true);\n expect(result.current.isStreaming).toBe(false);\n expect(result.current.isWaiting).toBe(false);\n });\n\n it(\"provides dispatch function for advanced usage\", () => {\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: TestWrapper,\n });\n\n expect(typeof result.current.dispatch).toBe(\"function\");\n });\n\n it(\"provides thread management functions\", () => {\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: TestWrapper,\n });\n\n expect(typeof result.current.initThread).toBe(\"function\");\n expect(typeof result.current.switchThread).toBe(\"function\");\n expect(typeof result.current.startNewThread).toBe(\"function\");\n });\n\n it(\"initializes and switches threads\", () => {\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: TestWrapper,\n });\n\n // Initially has placeholder thread for optimistic UI\n expect(result.current.currentThreadId).toBe(\"placeholder\");\n expect(result.current.thread).toBeDefined();\n expect(result.current.thread?.thread.id).toBe(\"placeholder\");\n\n // Initialize a new thread\n act(() => {\n result.current.initThread(\"new_thread_1\");\n });\n\n // Switch to the new thread\n act(() => {\n result.current.switchThread(\"new_thread_1\");\n });\n\n expect(result.current.currentThreadId).toBe(\"new_thread_1\");\n });\n\n it(\"starts new thread with generated ID\", () => {\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: TestWrapper,\n });\n\n let newThreadId: string;\n act(() => {\n newThreadId = result.current.startNewThread();\n });\n\n expect(newThreadId!).toBe(\"placeholder\");\n expect(result.current.currentThreadId).toBe(newThreadId!);\n expect(result.current.thread).toBeDefined();\n });\n\n it(\"uses current thread when no threadId argument provided\", () => {\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: TestWrapper,\n });\n\n // Initialize and switch to a thread\n act(() => {\n result.current.initThread(\"thread_123\");\n result.current.switchThread(\"thread_123\");\n });\n\n // Should use current thread from context (thread_123)\n expect(result.current.currentThreadId).toBe(\"thread_123\");\n expect(result.current.thread?.thread.id).toBe(\"thread_123\");\n });\n\n describe(\"component content transformation\", () => {\n const createComponentContent = (\n id: string,\n name: string,\n props: Record<string, unknown>,\n ): V1ComponentContent => ({\n type: \"component\",\n id,\n name,\n props,\n streamingState: \"done\",\n });\n\n it(\"adds renderedComponent to component content blocks\", () => {\n const state: StreamState = {\n threadMap: {\n thread_123: {\n thread: {\n id: \"thread_123\",\n messages: [\n {\n id: \"msg_1\",\n role: \"assistant\",\n content: [\n createComponentContent(\"comp_1\", \"TestComponent\", {\n title: \"Hello\",\n }),\n ],\n createdAt: new Date().toISOString(),\n },\n ],\n status: \"idle\",\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n lastRunCancelled: false,\n },\n streaming: { status: \"idle\" },\n accumulatingToolArgs: new Map(),\n },\n },\n currentThreadId: \"thread_123\",\n };\n\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: createWrapperWithState(state),\n });\n\n expect(result.current.messages).toHaveLength(1);\n const content = result.current.messages[0].content[0];\n expect(content.type).toBe(\"component\");\n expect((content as V1ComponentContent).renderedComponent).toBeDefined();\n });\n\n it(\"preserves non-component content blocks unchanged\", () => {\n const state: StreamState = {\n threadMap: {\n thread_123: {\n thread: {\n id: \"thread_123\",\n messages: [\n {\n id: \"msg_1\",\n role: \"assistant\",\n content: [\n { type: \"text\", text: \"Hello world\" },\n createComponentContent(\"comp_1\", \"TestComponent\", {\n title: \"Hi\",\n }),\n ],\n createdAt: new Date().toISOString(),\n },\n ],\n status: \"idle\",\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n lastRunCancelled: false,\n },\n streaming: { status: \"idle\" },\n accumulatingToolArgs: new Map(),\n },\n },\n currentThreadId: \"thread_123\",\n };\n\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: createWrapperWithState(state),\n });\n\n expect(result.current.messages).toHaveLength(1);\n const textContent = result.current.messages[0].content[0];\n expect(textContent.type).toBe(\"text\");\n expect(textContent).toEqual({ type: \"text\", text: \"Hello world\" });\n\n const componentContent = result.current.messages[0].content[1];\n expect(componentContent.type).toBe(\"component\");\n expect(\n (componentContent as V1ComponentContent).renderedComponent,\n ).toBeDefined();\n });\n\n it(\"caches rendered components and returns same reference when props unchanged\", () => {\n const state: StreamState = {\n threadMap: {\n thread_123: {\n thread: {\n id: \"thread_123\",\n messages: [\n {\n id: \"msg_1\",\n role: \"assistant\",\n content: [\n createComponentContent(\"comp_1\", \"TestComponent\", {\n title: \"Hello\",\n }),\n ],\n createdAt: new Date().toISOString(),\n },\n ],\n status: \"idle\",\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n lastRunCancelled: false,\n },\n streaming: { status: \"idle\" },\n accumulatingToolArgs: new Map(),\n },\n },\n currentThreadId: \"thread_123\",\n };\n\n const { result, rerender } = renderHook(() => useTamboV1(), {\n wrapper: createWrapperWithState(state),\n });\n\n const firstRender = (\n result.current.messages[0].content[0] as V1ComponentContent\n ).renderedComponent;\n\n // Re-render with same state\n rerender();\n\n const secondRender = (\n result.current.messages[0].content[0] as V1ComponentContent\n ).renderedComponent;\n\n // Should return the same cached element reference\n expect(secondRender).toBe(firstRender);\n });\n\n it(\"handles empty props on components\", () => {\n const state: StreamState = {\n threadMap: {\n thread_123: {\n thread: {\n id: \"thread_123\",\n messages: [\n {\n id: \"msg_1\",\n role: \"assistant\",\n content: [\n createComponentContent(\"comp_1\", \"TestComponent\", {}),\n ],\n createdAt: new Date().toISOString(),\n },\n ],\n status: \"idle\",\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n lastRunCancelled: false,\n },\n streaming: { status: \"idle\" },\n accumulatingToolArgs: new Map(),\n },\n },\n currentThreadId: \"thread_123\",\n };\n\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: createWrapperWithState(state),\n });\n\n const content = result.current.messages[0].content[0];\n expect(content.type).toBe(\"component\");\n expect((content as V1ComponentContent).renderedComponent).toBeDefined();\n });\n\n it(\"handles undefined props on components\", () => {\n const state: StreamState = {\n threadMap: {\n thread_123: {\n thread: {\n id: \"thread_123\",\n messages: [\n {\n id: \"msg_1\",\n role: \"assistant\",\n content: [\n {\n type: \"component\",\n id: \"comp_1\",\n name: \"TestComponent\",\n props: undefined,\n streamingState: \"done\",\n } as V1ComponentContent,\n ],\n createdAt: new Date().toISOString(),\n },\n ],\n status: \"idle\",\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n lastRunCancelled: false,\n },\n streaming: { status: \"idle\" },\n accumulatingToolArgs: new Map(),\n },\n },\n currentThreadId: \"thread_123\",\n };\n\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: createWrapperWithState(state),\n });\n\n const content = result.current.messages[0].content[0];\n expect(content.type).toBe(\"component\");\n expect((content as V1ComponentContent).renderedComponent).toBeDefined();\n });\n\n it(\"handles multiple component content blocks in same message\", () => {\n const state: StreamState = {\n threadMap: {\n thread_123: {\n thread: {\n id: \"thread_123\",\n messages: [\n {\n id: \"msg_1\",\n role: \"assistant\",\n content: [\n createComponentContent(\"comp_1\", \"ComponentA\", {\n value: 1,\n }),\n createComponentContent(\"comp_2\", \"ComponentB\", {\n value: 2,\n }),\n createComponentContent(\"comp_3\", \"ComponentC\", {\n value: 3,\n }),\n ],\n createdAt: new Date().toISOString(),\n },\n ],\n status: \"idle\",\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n lastRunCancelled: false,\n },\n streaming: { status: \"idle\" },\n accumulatingToolArgs: new Map(),\n },\n },\n currentThreadId: \"thread_123\",\n };\n\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: createWrapperWithState(state),\n });\n\n expect(result.current.messages[0].content).toHaveLength(3);\n result.current.messages[0].content.forEach((content) => {\n expect(content.type).toBe(\"component\");\n expect((content as V1ComponentContent).renderedComponent).toBeDefined();\n });\n });\n\n it(\"uses currentThreadId from stream state\", () => {\n const state: StreamState = {\n threadMap: {\n placeholder: {\n thread: {\n id: \"placeholder\",\n messages: [\n {\n id: \"msg_1\",\n role: \"assistant\",\n content: [\n createComponentContent(\"comp_1\", \"TestComponent\", {\n title: \"Hello\",\n }),\n ],\n createdAt: new Date().toISOString(),\n },\n ],\n status: \"idle\",\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n lastRunCancelled: false,\n },\n streaming: { status: \"idle\" },\n accumulatingToolArgs: new Map(),\n },\n },\n currentThreadId: \"placeholder\",\n };\n\n // No explicit threadId - uses currentThreadId from state\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: createWrapperWithState(state),\n });\n\n // Component should render using the placeholder thread\n const content = result.current.messages[0].content[0];\n expect(content.type).toBe(\"component\");\n expect((content as V1ComponentContent).renderedComponent).toBeDefined();\n });\n });\n\n describe(\"tool_use content transformation\", () => {\n it(\"adds computed properties to tool_use content\", () => {\n const state: StreamState = {\n threadMap: {\n thread_123: {\n thread: {\n id: \"thread_123\",\n messages: [\n {\n id: \"msg_1\",\n role: \"assistant\",\n content: [\n {\n type: \"tool_use\",\n id: \"tool_1\",\n name: \"getWeather\",\n input: { location: \"NYC\" },\n },\n ],\n createdAt: new Date().toISOString(),\n },\n ],\n status: \"idle\",\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n lastRunCancelled: false,\n },\n streaming: { status: \"idle\" },\n accumulatingToolArgs: new Map(),\n },\n },\n currentThreadId: \"thread_123\",\n };\n\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: createWrapperWithState(state),\n });\n\n const content = result.current.messages[0].content[0] as V1ToolUseContent;\n expect(content.type).toBe(\"tool_use\");\n expect(content.hasCompleted).toBe(false);\n expect(content.statusMessage).toBe(\"Calling getWeather\");\n expect(content.tamboDisplayProps).toBeDefined();\n });\n\n it(\"sets hasCompleted to true when matching tool_result exists\", () => {\n const state: StreamState = {\n threadMap: {\n thread_123: {\n thread: {\n id: \"thread_123\",\n messages: [\n {\n id: \"msg_1\",\n role: \"assistant\",\n content: [\n {\n type: \"tool_use\",\n id: \"tool_1\",\n name: \"getWeather\",\n input: { location: \"NYC\" },\n },\n ],\n createdAt: new Date().toISOString(),\n },\n {\n id: \"msg_2\",\n role: \"user\",\n content: [\n {\n type: \"tool_result\",\n toolUseId: \"tool_1\",\n content: [{ type: \"text\", text: \"Sunny\" }],\n },\n ],\n createdAt: new Date().toISOString(),\n },\n ],\n status: \"idle\",\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n lastRunCancelled: false,\n },\n streaming: { status: \"idle\" },\n accumulatingToolArgs: new Map(),\n },\n },\n currentThreadId: \"thread_123\",\n };\n\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: createWrapperWithState(state),\n });\n\n const content = result.current.messages[0].content[0] as V1ToolUseContent;\n expect(content.hasCompleted).toBe(true);\n expect(content.statusMessage).toBe(\"Called getWeather\");\n });\n\n it(\"uses _tambo_statusMessage when tool is in progress\", () => {\n const state: StreamState = {\n threadMap: {\n thread_123: {\n thread: {\n id: \"thread_123\",\n messages: [\n {\n id: \"msg_1\",\n role: \"assistant\",\n content: [\n {\n type: \"tool_use\",\n id: \"tool_1\",\n name: \"getWeather\",\n input: {\n location: \"NYC\",\n _tambo_statusMessage: \"Fetching weather for NYC...\",\n },\n },\n ],\n createdAt: new Date().toISOString(),\n },\n ],\n status: \"idle\",\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n lastRunCancelled: false,\n },\n streaming: { status: \"idle\" },\n accumulatingToolArgs: new Map(),\n },\n },\n currentThreadId: \"thread_123\",\n };\n\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: createWrapperWithState(state),\n });\n\n const content = result.current.messages[0].content[0] as V1ToolUseContent;\n expect(content.statusMessage).toBe(\"Fetching weather for NYC...\");\n expect(content.tamboDisplayProps?._tambo_statusMessage).toBe(\n \"Fetching weather for NYC...\",\n );\n });\n\n it(\"uses _tambo_completionStatusMessage when tool is completed\", () => {\n const state: StreamState = {\n threadMap: {\n thread_123: {\n thread: {\n id: \"thread_123\",\n messages: [\n {\n id: \"msg_1\",\n role: \"assistant\",\n content: [\n {\n type: \"tool_use\",\n id: \"tool_1\",\n name: \"getWeather\",\n input: {\n location: \"NYC\",\n _tambo_statusMessage: \"Fetching weather...\",\n _tambo_completionStatusMessage: \"Got weather for NYC\",\n },\n },\n ],\n createdAt: new Date().toISOString(),\n },\n {\n id: \"msg_2\",\n role: \"user\",\n content: [\n {\n type: \"tool_result\",\n toolUseId: \"tool_1\",\n content: [{ type: \"text\", text: \"Sunny\" }],\n },\n ],\n createdAt: new Date().toISOString(),\n },\n ],\n status: \"idle\",\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n lastRunCancelled: false,\n },\n streaming: { status: \"idle\" },\n accumulatingToolArgs: new Map(),\n },\n },\n currentThreadId: \"thread_123\",\n };\n\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: createWrapperWithState(state),\n });\n\n const content = result.current.messages[0].content[0] as V1ToolUseContent;\n expect(content.hasCompleted).toBe(true);\n expect(content.statusMessage).toBe(\"Got weather for NYC\");\n });\n\n it(\"filters _tambo_* properties from input\", () => {\n const state: StreamState = {\n threadMap: {\n thread_123: {\n thread: {\n id: \"thread_123\",\n messages: [\n {\n id: \"msg_1\",\n role: \"assistant\",\n content: [\n {\n type: \"tool_use\",\n id: \"tool_1\",\n name: \"getWeather\",\n input: {\n location: \"NYC\",\n units: \"celsius\",\n _tambo_statusMessage: \"Fetching...\",\n _tambo_completionStatusMessage: \"Done\",\n _tambo_displayMessage: \"Weather lookup\",\n },\n },\n ],\n createdAt: new Date().toISOString(),\n },\n ],\n status: \"idle\",\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n lastRunCancelled: false,\n },\n streaming: { status: \"idle\" },\n accumulatingToolArgs: new Map(),\n },\n },\n currentThreadId: \"thread_123\",\n };\n\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: createWrapperWithState(state),\n });\n\n const content = result.current.messages[0].content[0] as V1ToolUseContent;\n // Input should only have non-_tambo_ properties\n expect(content.input).toEqual({ location: \"NYC\", units: \"celsius\" });\n expect(content.input._tambo_statusMessage).toBeUndefined();\n expect(content.input._tambo_completionStatusMessage).toBeUndefined();\n expect(content.input._tambo_displayMessage).toBeUndefined();\n });\n\n it(\"handles tool_use with empty input\", () => {\n const state: StreamState = {\n threadMap: {\n thread_123: {\n thread: {\n id: \"thread_123\",\n messages: [\n {\n id: \"msg_1\",\n role: \"assistant\",\n content: [\n {\n type: \"tool_use\",\n id: \"tool_1\",\n name: \"getCurrentTime\",\n input: {},\n },\n ],\n createdAt: new Date().toISOString(),\n },\n ],\n status: \"idle\",\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n lastRunCancelled: false,\n },\n streaming: { status: \"idle\" },\n accumulatingToolArgs: new Map(),\n },\n },\n currentThreadId: \"thread_123\",\n };\n\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: createWrapperWithState(state),\n });\n\n const content = result.current.messages[0].content[0] as V1ToolUseContent;\n expect(content.input).toEqual({});\n expect(content.hasCompleted).toBe(false);\n expect(content.statusMessage).toBe(\"Calling getCurrentTime\");\n });\n\n it(\"handles tool_use with undefined input\", () => {\n const state: StreamState = {\n threadMap: {\n thread_123: {\n thread: {\n id: \"thread_123\",\n messages: [\n {\n id: \"msg_1\",\n role: \"assistant\",\n content: [\n {\n type: \"tool_use\",\n id: \"tool_1\",\n name: \"getCurrentTime\",\n input: undefined,\n } as unknown as V1ToolUseContent,\n ],\n createdAt: new Date().toISOString(),\n },\n ],\n status: \"idle\",\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n lastRunCancelled: false,\n },\n streaming: { status: \"idle\" },\n accumulatingToolArgs: new Map(),\n },\n },\n currentThreadId: \"thread_123\",\n };\n\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: createWrapperWithState(state),\n });\n\n const content = result.current.messages[0].content[0] as V1ToolUseContent;\n expect(content.input).toEqual({});\n expect(content.hasCompleted).toBe(false);\n });\n\n it(\"handles multiple tool_use blocks with different completion states\", () => {\n const state: StreamState = {\n threadMap: {\n thread_123: {\n thread: {\n id: \"thread_123\",\n messages: [\n {\n id: \"msg_1\",\n role: \"assistant\",\n content: [\n {\n type: \"tool_use\",\n id: \"tool_1\",\n name: \"getWeather\",\n input: { location: \"NYC\" },\n },\n {\n type: \"tool_use\",\n id: \"tool_2\",\n name: \"getTime\",\n input: { timezone: \"EST\" },\n },\n ],\n createdAt: new Date().toISOString(),\n },\n {\n id: \"msg_2\",\n role: \"user\",\n content: [\n {\n type: \"tool_result\",\n toolUseId: \"tool_1\",\n content: [{ type: \"text\", text: \"Sunny\" }],\n },\n // tool_2 has no result yet\n ],\n createdAt: new Date().toISOString(),\n },\n ],\n status: \"idle\",\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n lastRunCancelled: false,\n },\n streaming: { status: \"idle\" },\n accumulatingToolArgs: new Map(),\n },\n },\n currentThreadId: \"thread_123\",\n };\n\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: createWrapperWithState(state),\n });\n\n const tool1 = result.current.messages[0].content[0] as V1ToolUseContent;\n const tool2 = result.current.messages[0].content[1] as V1ToolUseContent;\n\n expect(tool1.hasCompleted).toBe(true);\n expect(tool1.statusMessage).toBe(\"Called getWeather\");\n\n expect(tool2.hasCompleted).toBe(false);\n expect(tool2.statusMessage).toBe(\"Calling getTime\");\n });\n });\n\n describe(\"cancelRun\", () => {\n it(\"sets thread to idle and lastRunCancelled to true when cancelled\", async () => {\n const initialState: StreamState = {\n threadMap: {\n thread_123: {\n thread: {\n id: \"thread_123\",\n messages: [],\n status: \"streaming\",\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n lastRunCancelled: false,\n },\n streaming: { status: \"streaming\", runId: \"run_456\" },\n accumulatingToolArgs: new Map(),\n },\n },\n currentThreadId: \"thread_123\",\n };\n\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: createWrapperWithRealReducer(initialState),\n });\n\n // Before cancel: streaming and lastRunCancelled is false\n expect(result.current.isStreaming).toBe(true);\n expect(result.current.isIdle).toBe(false);\n expect(result.current.thread?.thread.lastRunCancelled).toBe(false);\n\n await act(async () => {\n await result.current.cancelRun();\n });\n\n // After cancel: idle and lastRunCancelled is true\n expect(result.current.isStreaming).toBe(false);\n expect(result.current.isIdle).toBe(true);\n expect(result.current.thread?.thread.lastRunCancelled).toBe(true);\n\n // Verify API was called to cancel the run\n expect(mockTamboClient.threads.runs.delete).toHaveBeenCalledWith(\n \"run_456\",\n { threadId: \"thread_123\" },\n );\n });\n\n it(\"is a no-op when there is no active run\", async () => {\n const initialState: StreamState = {\n threadMap: {\n thread_123: {\n thread: {\n id: \"thread_123\",\n messages: [],\n status: \"idle\",\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n lastRunCancelled: false,\n },\n streaming: { status: \"idle\" }, // No runId\n accumulatingToolArgs: new Map(),\n },\n },\n currentThreadId: \"thread_123\",\n };\n\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: createWrapperWithRealReducer(initialState),\n });\n\n // Idle before\n expect(result.current.isIdle).toBe(true);\n expect(result.current.thread?.thread.lastRunCancelled).toBe(false);\n\n await act(async () => {\n await result.current.cancelRun();\n });\n\n // Still idle, lastRunCancelled unchanged\n expect(result.current.isIdle).toBe(true);\n expect(result.current.thread?.thread.lastRunCancelled).toBe(false);\n\n // API should not have been called\n expect(mockTamboClient.threads.runs.delete).not.toHaveBeenCalled();\n });\n\n it(\"is a no-op when on a placeholder thread\", async () => {\n const initialState: StreamState = {\n threadMap: {\n placeholder: {\n thread: {\n id: \"placeholder\",\n messages: [],\n status: \"streaming\",\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n lastRunCancelled: false,\n },\n streaming: { status: \"streaming\", runId: \"run_123\" },\n accumulatingToolArgs: new Map(),\n },\n },\n currentThreadId: \"placeholder\",\n };\n\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: createWrapperWithRealReducer(initialState),\n });\n\n // Before: streaming on placeholder\n expect(result.current.isStreaming).toBe(true);\n expect(result.current.thread?.thread.lastRunCancelled).toBe(false);\n\n await act(async () => {\n await result.current.cancelRun();\n });\n\n // After: state should be unchanged (placeholder threads are skipped)\n expect(result.current.isStreaming).toBe(true);\n expect(result.current.thread?.thread.lastRunCancelled).toBe(false);\n\n // API should not have been called for placeholder threads\n expect(mockTamboClient.threads.runs.delete).not.toHaveBeenCalled();\n });\n\n it(\"still updates local state even if API call fails\", async () => {\n const consoleWarnSpy = jest\n .spyOn(console, \"warn\")\n .mockImplementation(() => {});\n\n // Make the API call fail\n jest\n .mocked(mockTamboClient.threads.runs.delete)\n .mockRejectedValueOnce(new Error(\"Network error\"));\n\n const initialState: StreamState = {\n threadMap: {\n thread_123: {\n thread: {\n id: \"thread_123\",\n messages: [],\n status: \"streaming\",\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n lastRunCancelled: false,\n },\n streaming: { status: \"streaming\", runId: \"run_456\" },\n accumulatingToolArgs: new Map(),\n },\n },\n currentThreadId: \"thread_123\",\n };\n\n const { result } = renderHook(() => useTamboV1(), {\n wrapper: createWrapperWithRealReducer(initialState),\n });\n\n await act(async () => {\n await result.current.cancelRun();\n });\n\n // Local state should still be updated (optimistic update)\n expect(result.current.isIdle).toBe(true);\n expect(result.current.thread?.thread.lastRunCancelled).toBe(true);\n\n // Warning should have been logged\n expect(consoleWarnSpy).toHaveBeenCalledWith(\n \"Failed to cancel run on server:\",\n expect.any(Error),\n );\n\n consoleWarnSpy.mockRestore();\n });\n });\n});\n"]}
|
package/dist/v1/index.d.ts
CHANGED
|
@@ -72,12 +72,14 @@ export { TamboClientProvider, useIsTamboTokenUpdating, } from "../providers/tamb
|
|
|
72
72
|
export { TamboContextHelpersProvider, useTamboContextHelpers, } from "../providers/tambo-context-helpers-provider";
|
|
73
73
|
export { TamboV1ThreadInputProvider, type TamboV1ThreadInputContextProps, type SubmitOptions, } from "./providers/tambo-v1-thread-input-provider";
|
|
74
74
|
export { TamboV1StubProvider, type TamboV1StubProviderProps, } from "./providers/tambo-v1-stub-provider";
|
|
75
|
+
export { V1ComponentRenderer, type V1ComponentRendererProps, } from "./components/v1-component-renderer";
|
|
75
76
|
export { useTamboV1 } from "./hooks/use-tambo-v1";
|
|
76
77
|
export { useTamboV1ThreadInput } from "./hooks/use-tambo-v1-thread-input";
|
|
77
78
|
export { useTamboV1Thread } from "./hooks/use-tambo-v1-thread";
|
|
78
79
|
export { useTamboV1ThreadList } from "./hooks/use-tambo-v1-thread-list";
|
|
79
80
|
export { useTamboV1ComponentState } from "./hooks/use-tambo-v1-component-state";
|
|
80
|
-
export {
|
|
81
|
+
export { useTamboV1StreamStatus, type StreamStatus, type PropStatus, } from "./hooks/use-tambo-v1-stream-status";
|
|
82
|
+
export { useTamboV1Suggestions, type UseTamboV1SuggestionsOptions, type UseTamboV1SuggestionsReturn, type AcceptSuggestionOptions, } from "./hooks/use-tambo-v1-suggestions";
|
|
81
83
|
export { useTamboClient } from "../providers/tambo-client-provider";
|
|
82
84
|
export { useMessageImages, type StagedImage, } from "../hooks/use-message-images";
|
|
83
85
|
export { useTamboVoice } from "../hooks/use-tambo-voice";
|
|
@@ -90,4 +92,8 @@ export type { McpServerInfo, NormalizedMcpServerInfo, } from "../model/mcp-serve
|
|
|
90
92
|
export type { ListResourceItem, ReadResourceResult, ResourceSource, } from "../model/resource-info";
|
|
91
93
|
export type { APIError, RateLimitError, TamboAIError, } from "@tambo-ai/typescript-sdk";
|
|
92
94
|
export type { Suggestion, SuggestionGenerateParams, SuggestionGenerateResponse, SuggestionListResponse, } from "@tambo-ai/typescript-sdk/resources/beta/threads/suggestions";
|
|
95
|
+
export type { V1ToolUseContent, TamboToolDisplayProps } from "./types/message";
|
|
96
|
+
export { withTamboInteractable as withInteractable, type InteractableConfig, type WithTamboInteractableProps, } from "../hoc/with-tambo-interactable";
|
|
97
|
+
export { useTamboInteractable, useCurrentInteractablesSnapshot, } from "../providers/tambo-interactable-provider";
|
|
98
|
+
export type { TamboInteractableComponent as InteractableComponent, TamboInteractableContext, } from "../model/tambo-interactable";
|
|
93
99
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/v1/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AAMH,OAAO,EACL,eAAe,EACf,KAAK,oBAAoB,EACzB,gBAAgB,EAChB,KAAK,aAAa,GACnB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAG7E,OAAO,EACL,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,oCAAoC,CAAC;AAG5C,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,6CAA6C,CAAC;AAGrD,OAAO,EACL,0BAA0B,EAC1B,KAAK,8BAA8B,EACnC,KAAK,aAAa,GACnB,MAAM,4CAA4C,CAAC;AAGpD,OAAO,EACL,mBAAmB,EACnB,KAAK,wBAAwB,GAC9B,MAAM,oCAAoC,CAAC;AAM5C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAExE,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAEhF,OAAO,EACL,qBAAqB,EACrB,KAAK,4BAA4B,
|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
69
|
*/
|
|
70
70
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
71
|
-
exports.MCPTransport = exports.currentTimeContextHelper = exports.currentPageContextHelper = exports.defineTool = exports.useTamboVoice = exports.useMessageImages = exports.useTamboClient = exports.useTamboV1Suggestions = exports.useTamboV1ComponentState = exports.useTamboV1ThreadList = exports.useTamboV1Thread = exports.useTamboV1ThreadInput = exports.useTamboV1 = exports.TamboV1StubProvider = exports.TamboV1ThreadInputProvider = exports.useTamboContextHelpers = exports.TamboContextHelpersProvider = exports.useIsTamboTokenUpdating = exports.TamboClientProvider = exports.TamboRegistryProvider = exports.useTamboV1Config = exports.TamboV1Provider = void 0;
|
|
71
|
+
exports.useCurrentInteractablesSnapshot = exports.useTamboInteractable = exports.withInteractable = exports.MCPTransport = exports.currentTimeContextHelper = exports.currentPageContextHelper = exports.defineTool = exports.useTamboVoice = exports.useMessageImages = exports.useTamboClient = exports.useTamboV1Suggestions = exports.useTamboV1StreamStatus = exports.useTamboV1ComponentState = exports.useTamboV1ThreadList = exports.useTamboV1Thread = exports.useTamboV1ThreadInput = exports.useTamboV1 = exports.V1ComponentRenderer = exports.TamboV1StubProvider = exports.TamboV1ThreadInputProvider = exports.useTamboContextHelpers = exports.TamboContextHelpersProvider = exports.useIsTamboTokenUpdating = exports.TamboClientProvider = exports.TamboRegistryProvider = exports.useTamboV1Config = exports.TamboV1Provider = void 0;
|
|
72
72
|
// =============================================================================
|
|
73
73
|
// Providers
|
|
74
74
|
// =============================================================================
|
|
@@ -93,6 +93,11 @@ Object.defineProperty(exports, "TamboV1ThreadInputProvider", { enumerable: true,
|
|
|
93
93
|
var tambo_v1_stub_provider_1 = require("./providers/tambo-v1-stub-provider");
|
|
94
94
|
Object.defineProperty(exports, "TamboV1StubProvider", { enumerable: true, get: function () { return tambo_v1_stub_provider_1.TamboV1StubProvider; } });
|
|
95
95
|
// =============================================================================
|
|
96
|
+
// Components
|
|
97
|
+
// =============================================================================
|
|
98
|
+
var v1_component_renderer_1 = require("./components/v1-component-renderer");
|
|
99
|
+
Object.defineProperty(exports, "V1ComponentRenderer", { enumerable: true, get: function () { return v1_component_renderer_1.V1ComponentRenderer; } });
|
|
100
|
+
// =============================================================================
|
|
96
101
|
// Hooks
|
|
97
102
|
// =============================================================================
|
|
98
103
|
var use_tambo_v1_1 = require("./hooks/use-tambo-v1");
|
|
@@ -105,6 +110,8 @@ var use_tambo_v1_thread_list_1 = require("./hooks/use-tambo-v1-thread-list");
|
|
|
105
110
|
Object.defineProperty(exports, "useTamboV1ThreadList", { enumerable: true, get: function () { return use_tambo_v1_thread_list_1.useTamboV1ThreadList; } });
|
|
106
111
|
var use_tambo_v1_component_state_1 = require("./hooks/use-tambo-v1-component-state");
|
|
107
112
|
Object.defineProperty(exports, "useTamboV1ComponentState", { enumerable: true, get: function () { return use_tambo_v1_component_state_1.useTamboV1ComponentState; } });
|
|
113
|
+
var use_tambo_v1_stream_status_1 = require("./hooks/use-tambo-v1-stream-status");
|
|
114
|
+
Object.defineProperty(exports, "useTamboV1StreamStatus", { enumerable: true, get: function () { return use_tambo_v1_stream_status_1.useTamboV1StreamStatus; } });
|
|
108
115
|
var use_tambo_v1_suggestions_1 = require("./hooks/use-tambo-v1-suggestions");
|
|
109
116
|
Object.defineProperty(exports, "useTamboV1Suggestions", { enumerable: true, get: function () { return use_tambo_v1_suggestions_1.useTamboV1Suggestions; } });
|
|
110
117
|
// Re-export client hook from beta SDK (works with v1)
|
|
@@ -129,4 +136,14 @@ Object.defineProperty(exports, "currentTimeContextHelper", { enumerable: true, g
|
|
|
129
136
|
// MCP server types
|
|
130
137
|
var mcp_server_info_1 = require("../model/mcp-server-info");
|
|
131
138
|
Object.defineProperty(exports, "MCPTransport", { enumerable: true, get: function () { return mcp_server_info_1.MCPTransport; } });
|
|
139
|
+
// =============================================================================
|
|
140
|
+
// Interactable Components
|
|
141
|
+
// =============================================================================
|
|
142
|
+
// HOC for making components interactable by the AI
|
|
143
|
+
var with_tambo_interactable_1 = require("../hoc/with-tambo-interactable");
|
|
144
|
+
Object.defineProperty(exports, "withInteractable", { enumerable: true, get: function () { return with_tambo_interactable_1.withTamboInteractable; } });
|
|
145
|
+
// Interactable provider hooks
|
|
146
|
+
var tambo_interactable_provider_1 = require("../providers/tambo-interactable-provider");
|
|
147
|
+
Object.defineProperty(exports, "useTamboInteractable", { enumerable: true, get: function () { return tambo_interactable_provider_1.useTamboInteractable; } });
|
|
148
|
+
Object.defineProperty(exports, "useCurrentInteractablesSnapshot", { enumerable: true, get: function () { return tambo_interactable_provider_1.useCurrentInteractablesSnapshot; } });
|
|
132
149
|
//# sourceMappingURL=index.js.map
|
package/dist/v1/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;;;AAEH,gFAAgF;AAChF,YAAY;AACZ,gFAAgF;AAEhF,mEAKuC;AAJrC,oHAAA,eAAe,OAAA;AAEf,qHAAA,gBAAgB,OAAA;AAIlB,4DAA4D;AAC5D,gFAA6E;AAApE,gIAAA,qBAAqB,OAAA;AAE9B,0DAA0D;AAC1D,4EAG4C;AAF1C,4HAAA,mBAAmB,OAAA;AACnB,gIAAA,uBAAuB,OAAA;AAGzB,0DAA0D;AAC1D,8FAGqD;AAFnD,6IAAA,2BAA2B,OAAA;AAC3B,wIAAA,sBAAsB,OAAA;AAGxB,2DAA2D;AAC3D,6FAIoD;AAHlD,4IAAA,0BAA0B,OAAA;AAK5B,sCAAsC;AACtC,6EAG4C;AAF1C,6HAAA,mBAAmB,OAAA;AAIrB,gFAAgF;AAChF,QAAQ;AACR,gFAAgF;AAEhF,qDAAkD;AAAzC,0GAAA,UAAU,OAAA;AAEnB,+EAA0E;AAAjE,kIAAA,qBAAqB,OAAA;AAE9B,mEAA+D;AAAtD,uH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cAAc,OAAA;AAEvB,2DAA2D;AAC3D,kEAGqC;AAFnC,sHAAA,gBAAgB,OAAA;AAIlB,iEAAiE;AACjE,4DAAyD;AAAhD,gHAAA,aAAa,OAAA;AAEtB,gFAAgF;AAChF,gDAAgD;AAChD,gFAAgF;AAEhF,yBAAyB;AACzB,6CAA8C;AAArC,sGAAA,UAAU,OAAA;AAEnB,2BAA2B;AAC3B,sDAG4B;AAF1B,2HAAA,wBAAwB,OAAA;AACxB,2HAAA,wBAAwB,OAAA;AAqB1B,mBAAmB;AACnB,4DAAwD;AAA/C,+GAAA,YAAY,OAAA;AA+BrB,gFAAgF;AAChF,0BAA0B;AAC1B,gFAAgF;AAEhF,mDAAmD;AACnD,0EAIwC;AAHtC,2HAAA,qBAAqB,OAAoB;AAK3C,8BAA8B;AAC9B,wFAGkD;AAFhD,mIAAA,oBAAoB,OAAA;AACpB,8IAAA,+BAA+B,OAAA","sourcesContent":["/**\n * `@tambo-ai/react/v1` - React SDK for Tambo v1 API\n *\n * Provides React hooks and providers for building AI-powered applications\n * using the v1 streaming API with AG-UI protocol.\n *\n * ## Authentication & Thread Ownership\n *\n * All thread operations require user identification. Provide ONE of:\n * - `userKey` - Direct user identifier (for server-side or trusted environments)\n * - `userToken` - OAuth bearer token containing the userKey (for client-side apps)\n *\n * Threads are scoped to the userKey - each user only sees their own threads.\n *\n * ## Quick Start\n *\n * ```tsx\n * import {\n * TamboV1Provider,\n * useTamboV1,\n * useTamboV1ThreadInput,\n * } from '@tambo-ai/react/v1';\n *\n * function App() {\n * return (\n * <TamboV1Provider\n * apiKey={process.env.NEXT_PUBLIC_TAMBO_API_KEY!}\n * userKey={currentUserId} // Required: identifies thread owner\n * components={[WeatherCard]}\n * tools={[searchTool]}\n * >\n * <ChatInterface />\n * </TamboV1Provider>\n * );\n * }\n *\n * function ChatInterface() {\n * const [threadId, setThreadId] = useState<string>();\n * const { messages, isStreaming } = useTamboV1(threadId);\n * const { value, setValue, submit, isPending } = useTamboV1ThreadInput(threadId);\n *\n * const handleSubmit = async (e: React.FormEvent) => {\n * e.preventDefault();\n * const result = await submit();\n * if (!threadId) setThreadId(result.threadId);\n * };\n *\n * return (\n * <form onSubmit={handleSubmit}>\n * {messages.map(msg => <Message key={msg.id} message={msg} />)}\n * {isStreaming && <LoadingIndicator />}\n * <input value={value} onChange={(e) => setValue(e.target.value)} />\n * <button disabled={isPending}>Send</button>\n * </form>\n * );\n * }\n * ```\n *\n * ## Type Imports\n *\n * Types are imported directly from specific files:\n * - Thread state: `import type { TamboV1Thread } from '@tambo-ai/react/v1/types/thread'`\n * - Messages: `import type { TamboV1Message } from '@tambo-ai/react/v1/types/message'`\n * - Custom events: `import type { ComponentStartEvent } from '@tambo-ai/react/v1/types/event'`\n *\n * SDK types: `import type { ... } from '@tambo-ai/typescript-sdk'`\n * AG-UI events: `import { EventType, type BaseEvent } from '@ag-ui/core'`\n */\n\n// =============================================================================\n// Providers\n// =============================================================================\n\nexport {\n TamboV1Provider,\n type TamboV1ProviderProps,\n useTamboV1Config,\n type TamboV1Config,\n} from \"./providers/tambo-v1-provider\";\n\n// Re-export registry provider from beta SDK (works with v1)\nexport { TamboRegistryProvider } from \"../providers/tambo-registry-provider\";\n\n// Re-export client provider from beta SDK (works with v1)\nexport {\n TamboClientProvider,\n useIsTamboTokenUpdating,\n} from \"../providers/tambo-client-provider\";\n\n// Re-export context helpers from beta SDK (works with v1)\nexport {\n TamboContextHelpersProvider,\n useTamboContextHelpers,\n} from \"../providers/tambo-context-helpers-provider\";\n\n// Export v1 thread input provider for advanced composition\nexport {\n TamboV1ThreadInputProvider,\n type TamboV1ThreadInputContextProps,\n type SubmitOptions,\n} from \"./providers/tambo-v1-thread-input-provider\";\n\n// Export v1 stub provider for testing\nexport {\n TamboV1StubProvider,\n type TamboV1StubProviderProps,\n} from \"./providers/tambo-v1-stub-provider\";\n\n// =============================================================================\n// Components\n// =============================================================================\n\nexport {\n V1ComponentRenderer,\n type V1ComponentRendererProps,\n} from \"./components/v1-component-renderer\";\n\n// =============================================================================\n// Hooks\n// =============================================================================\n\nexport { useTamboV1 } from \"./hooks/use-tambo-v1\";\n\nexport { useTamboV1ThreadInput } from \"./hooks/use-tambo-v1-thread-input\";\n\nexport { useTamboV1Thread } from \"./hooks/use-tambo-v1-thread\";\n\nexport { useTamboV1ThreadList } from \"./hooks/use-tambo-v1-thread-list\";\n\nexport { useTamboV1ComponentState } from \"./hooks/use-tambo-v1-component-state\";\n\nexport {\n useTamboV1StreamStatus,\n type StreamStatus,\n type PropStatus,\n} from \"./hooks/use-tambo-v1-stream-status\";\n\nexport {\n useTamboV1Suggestions,\n type UseTamboV1SuggestionsOptions,\n type UseTamboV1SuggestionsReturn,\n type AcceptSuggestionOptions,\n} from \"./hooks/use-tambo-v1-suggestions\";\n\n// Re-export client hook from beta SDK (works with v1)\nexport { useTamboClient } from \"../providers/tambo-client-provider\";\n\n// Re-export image handling hook (pure React, API-agnostic)\nexport {\n useMessageImages,\n type StagedImage,\n} from \"../hooks/use-message-images\";\n\n// Re-export voice input hook (uses standalone transcription API)\nexport { useTamboVoice } from \"../hooks/use-tambo-voice\";\n\n// =============================================================================\n// Re-exports from Beta SDK (compatible with v1)\n// =============================================================================\n\n// Tool definition helper\nexport { defineTool } from \"../util/registry\";\n\n// Built-in context helpers\nexport {\n currentPageContextHelper,\n currentTimeContextHelper,\n} from \"../context-helpers\";\n\n// Context helper types\nexport type {\n AdditionalContext,\n ContextHelperFn,\n ContextHelpers,\n} from \"../context-helpers\";\n\n// Component and tool types\nexport type {\n ComponentContextToolMetadata,\n ComponentRegistry,\n ParameterSpec,\n RegisteredComponent,\n TamboComponent,\n TamboTool,\n ToolAnnotations,\n} from \"../model/component-metadata\";\n\n// MCP server types\nexport { MCPTransport } from \"../model/mcp-server-info\";\nexport type {\n McpServerInfo,\n NormalizedMcpServerInfo,\n} from \"../model/mcp-server-info\";\n\n// Resource types\nexport type {\n ListResourceItem,\n ReadResourceResult,\n ResourceSource,\n} from \"../model/resource-info\";\n\n// Error types from Tambo TypeScript SDK\nexport type {\n APIError,\n RateLimitError,\n TamboAIError,\n} from \"@tambo-ai/typescript-sdk\";\n\n// Suggestion types from Tambo TypeScript SDK\nexport type {\n Suggestion,\n SuggestionGenerateParams,\n SuggestionGenerateResponse,\n SuggestionListResponse,\n} from \"@tambo-ai/typescript-sdk/resources/beta/threads/suggestions\";\n\n// V1 extended content types with computed state\nexport type { V1ToolUseContent, TamboToolDisplayProps } from \"./types/message\";\n\n// =============================================================================\n// Interactable Components\n// =============================================================================\n\n// HOC for making components interactable by the AI\nexport {\n withTamboInteractable as withInteractable,\n type InteractableConfig,\n type WithTamboInteractableProps,\n} from \"../hoc/with-tambo-interactable\";\n\n// Interactable provider hooks\nexport {\n useTamboInteractable,\n useCurrentInteractablesSnapshot,\n} from \"../providers/tambo-interactable-provider\";\n\n// Interactable types\nexport type {\n TamboInteractableComponent as InteractableComponent,\n TamboInteractableContext,\n} from \"../model/tambo-interactable\";\n"]}
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
* - TamboClientProvider: API client and authentication
|
|
6
6
|
* - TamboRegistryProvider: Component and tool registration
|
|
7
7
|
* - TamboContextHelpersProvider: Context helper functions
|
|
8
|
+
* - TamboInteractableProvider: Interactive component tracking
|
|
8
9
|
* - TamboV1StreamProvider: Streaming state management
|
|
9
10
|
*
|
|
10
11
|
* This provider should wrap your entire application or the portion
|
|
11
12
|
* that needs access to Tambo v1 functionality.
|
|
12
13
|
*/
|
|
13
14
|
import React, { type PropsWithChildren } from "react";
|
|
14
|
-
import { QueryClient } from "@tanstack/react-query";
|
|
15
15
|
import { type TamboClientProviderProps } from "../../providers/tambo-client-provider";
|
|
16
16
|
import { type TamboRegistryProviderProps } from "../../providers/tambo-registry-provider";
|
|
17
17
|
import type { ContextHelpers } from "../../context-helpers";
|
|
@@ -24,6 +24,10 @@ import type { ListResourceItem, ResourceSource } from "../../model/resource-info
|
|
|
24
24
|
export interface TamboV1Config {
|
|
25
25
|
/** User key for thread ownership and scoping */
|
|
26
26
|
userKey?: string;
|
|
27
|
+
/** Whether to automatically generate thread names after a threshold of messages. Defaults to true. */
|
|
28
|
+
autoGenerateThreadName?: boolean;
|
|
29
|
+
/** The message count threshold at which the thread name will be auto-generated. Defaults to 3. */
|
|
30
|
+
autoGenerateNameThreshold?: number;
|
|
27
31
|
}
|
|
28
32
|
/**
|
|
29
33
|
* Context for v1 SDK configuration.
|
|
@@ -94,10 +98,15 @@ export interface TamboV1ProviderProps extends Pick<TamboClientProviderProps, "ap
|
|
|
94
98
|
*/
|
|
95
99
|
userKey?: string;
|
|
96
100
|
/**
|
|
97
|
-
*
|
|
98
|
-
*
|
|
101
|
+
* Whether to automatically generate thread names after a threshold of messages.
|
|
102
|
+
* Defaults to true.
|
|
99
103
|
*/
|
|
100
|
-
|
|
104
|
+
autoGenerateThreadName?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* The message count threshold at which the thread name will be auto-generated.
|
|
107
|
+
* Defaults to 3.
|
|
108
|
+
*/
|
|
109
|
+
autoGenerateNameThreshold?: number;
|
|
101
110
|
/**
|
|
102
111
|
* Children components
|
|
103
112
|
*/
|
|
@@ -127,7 +136,8 @@ export interface TamboV1ProviderProps extends Pick<TamboClientProviderProps, "ap
|
|
|
127
136
|
* @param props.getResource - Dynamic resource fetch function (must be paired with listResources)
|
|
128
137
|
* @param props.contextHelpers - Configuration for context helper functions
|
|
129
138
|
* @param props.userKey - User key for thread ownership (required if not using userToken)
|
|
130
|
-
* @param props.
|
|
139
|
+
* @param props.autoGenerateThreadName - Whether to automatically generate thread names. Defaults to true.
|
|
140
|
+
* @param props.autoGenerateNameThreshold - The message count threshold at which the thread name will be auto-generated. Defaults to 3.
|
|
131
141
|
* @param props.children - Child components
|
|
132
142
|
* @returns Provider component tree
|
|
133
143
|
* @example
|
|
@@ -147,5 +157,5 @@ export interface TamboV1ProviderProps extends Pick<TamboClientProviderProps, "ap
|
|
|
147
157
|
* }
|
|
148
158
|
* ```
|
|
149
159
|
*/
|
|
150
|
-
export declare function TamboV1Provider({ apiKey, tamboUrl, environment, userToken, components, tools, mcpServers, onCallUnregisteredTool, resources, listResources, getResource, contextHelpers, userKey,
|
|
160
|
+
export declare function TamboV1Provider({ apiKey, tamboUrl, environment, userToken, components, tools, mcpServers, onCallUnregisteredTool, resources, listResources, getResource, contextHelpers, userKey, autoGenerateThreadName, autoGenerateNameThreshold, children, }: PropsWithChildren<TamboV1ProviderProps>): React.JSX.Element;
|
|
151
161
|
//# sourceMappingURL=tambo-v1-provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tambo-v1-provider.d.ts","sourceRoot":"","sources":["../../../src/v1/providers/tambo-v1-provider.tsx"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"tambo-v1-provider.d.ts","sourceRoot":"","sources":["../../../src/v1/providers/tambo-v1-provider.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,EAGZ,KAAK,iBAAiB,EACvB,MAAM,OAAO,CAAC;AACf,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAEL,KAAK,0BAA0B,EAChC,MAAM,yCAAyC,CAAC;AAGjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACf,MAAM,2BAA2B,CAAC;AAInC;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sGAAsG;IACtG,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,kGAAkG;IAClG,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACpC;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB,qCAA4C,CAAC;AAE9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,iBAAiB,CAAC,oBAAoB,CAAC,qBAsCzC"}
|
|
@@ -44,16 +44,17 @@ exports.TamboV1Provider = TamboV1Provider;
|
|
|
44
44
|
* - TamboClientProvider: API client and authentication
|
|
45
45
|
* - TamboRegistryProvider: Component and tool registration
|
|
46
46
|
* - TamboContextHelpersProvider: Context helper functions
|
|
47
|
+
* - TamboInteractableProvider: Interactive component tracking
|
|
47
48
|
* - TamboV1StreamProvider: Streaming state management
|
|
48
49
|
*
|
|
49
50
|
* This provider should wrap your entire application or the portion
|
|
50
51
|
* that needs access to Tambo v1 functionality.
|
|
51
52
|
*/
|
|
52
53
|
const react_1 = __importStar(require("react"));
|
|
53
|
-
const react_query_1 = require("@tanstack/react-query");
|
|
54
54
|
const tambo_client_provider_1 = require("../../providers/tambo-client-provider");
|
|
55
55
|
const tambo_registry_provider_1 = require("../../providers/tambo-registry-provider");
|
|
56
56
|
const tambo_context_helpers_provider_1 = require("../../providers/tambo-context-helpers-provider");
|
|
57
|
+
const tambo_interactable_provider_1 = require("../../providers/tambo-interactable-provider");
|
|
57
58
|
const tambo_v1_stream_context_1 = require("./tambo-v1-stream-context");
|
|
58
59
|
const tambo_v1_thread_input_provider_1 = require("./tambo-v1-thread-input-provider");
|
|
59
60
|
/**
|
|
@@ -97,7 +98,8 @@ function useTamboV1Config() {
|
|
|
97
98
|
* @param props.getResource - Dynamic resource fetch function (must be paired with listResources)
|
|
98
99
|
* @param props.contextHelpers - Configuration for context helper functions
|
|
99
100
|
* @param props.userKey - User key for thread ownership (required if not using userToken)
|
|
100
|
-
* @param props.
|
|
101
|
+
* @param props.autoGenerateThreadName - Whether to automatically generate thread names. Defaults to true.
|
|
102
|
+
* @param props.autoGenerateNameThreshold - The message count threshold at which the thread name will be auto-generated. Defaults to 3.
|
|
101
103
|
* @param props.children - Child components
|
|
102
104
|
* @returns Provider component tree
|
|
103
105
|
* @example
|
|
@@ -117,24 +119,17 @@ function useTamboV1Config() {
|
|
|
117
119
|
* }
|
|
118
120
|
* ```
|
|
119
121
|
*/
|
|
120
|
-
function TamboV1Provider({ apiKey, tamboUrl, environment, userToken, components, tools, mcpServers, onCallUnregisteredTool, resources, listResources, getResource, contextHelpers, userKey,
|
|
121
|
-
// Create a stable default QueryClient if none provided.
|
|
122
|
-
// Using useState to avoid SSR issues with module-level singletons.
|
|
123
|
-
const [defaultQueryClient] = (0, react_1.useState)(() => new react_query_1.QueryClient({
|
|
124
|
-
defaultOptions: {
|
|
125
|
-
queries: {
|
|
126
|
-
staleTime: 1000,
|
|
127
|
-
retry: 1,
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
}));
|
|
131
|
-
const client = queryClient ?? defaultQueryClient;
|
|
122
|
+
function TamboV1Provider({ apiKey, tamboUrl, environment, userToken, components, tools, mcpServers, onCallUnregisteredTool, resources, listResources, getResource, contextHelpers, userKey, autoGenerateThreadName, autoGenerateNameThreshold, children, }) {
|
|
132
123
|
// Config is static - created once and never changes
|
|
133
|
-
const config = {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
124
|
+
const config = {
|
|
125
|
+
userKey,
|
|
126
|
+
autoGenerateThreadName,
|
|
127
|
+
autoGenerateNameThreshold,
|
|
128
|
+
};
|
|
129
|
+
return (react_1.default.createElement(tambo_client_provider_1.TamboClientProvider, { apiKey: apiKey, tamboUrl: tamboUrl, environment: environment, userToken: userToken },
|
|
130
|
+
react_1.default.createElement(tambo_registry_provider_1.TamboRegistryProvider, { components: components, tools: tools, mcpServers: mcpServers, onCallUnregisteredTool: onCallUnregisteredTool, resources: resources, listResources: listResources, getResource: getResource },
|
|
131
|
+
react_1.default.createElement(tambo_context_helpers_provider_1.TamboContextHelpersProvider, { contextHelpers: contextHelpers },
|
|
132
|
+
react_1.default.createElement(tambo_interactable_provider_1.TamboInteractableProvider, null,
|
|
138
133
|
react_1.default.createElement(exports.TamboV1ConfigContext.Provider, { value: config },
|
|
139
134
|
react_1.default.createElement(tambo_v1_stream_context_1.TamboV1StreamProvider, null,
|
|
140
135
|
react_1.default.createElement(tambo_v1_thread_input_provider_1.TamboV1ThreadInputProvider, null, children))))))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tambo-v1-provider.js","sourceRoot":"","sources":["../../../src/v1/providers/tambo-v1-provider.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4Db,4CAMC;AA+HD,0CAkEC;AAjQD;;;;;;;;;;;GAWG;AAEH,+CAKe;AACf,uDAAyE;AACzE,iFAG+C;AAC/C,qFAGiD;AACjD,mGAA6F;AAO7F,uEAAkE;AAClE,qFAA8E;AAW9E;;;GAGG;AACU,QAAA,oBAAoB,GAAG,IAAA,qBAAa,EAAuB,IAAI,CAAC,CAAC;AAE9E;;;;GAIG;AACH,SAAgB,gBAAgB;IAC9B,MAAM,MAAM,GAAG,IAAA,kBAAU,EAAC,4BAAoB,CAAC,CAAC;IAChD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAmFD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,SAAgB,eAAe,CAAC,EAC9B,MAAM,EACN,QAAQ,EACR,WAAW,EACX,SAAS,EACT,UAAU,EACV,KAAK,EACL,UAAU,EACV,sBAAsB,EACtB,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,EACd,OAAO,EACP,WAAW,EACX,QAAQ,GACgC;IACxC,wDAAwD;IACxD,mEAAmE;IACnE,MAAM,CAAC,kBAAkB,CAAC,GAAG,IAAA,gBAAQ,EACnC,GAAG,EAAE,CACH,IAAI,yBAAW,CAAC;QACd,cAAc,EAAE;YACd,OAAO,EAAE;gBACP,SAAS,EAAE,IAAI;gBACf,KAAK,EAAE,CAAC;aACT;SACF;KACF,CAAC,CACL,CAAC;IAEF,MAAM,MAAM,GAAG,WAAW,IAAI,kBAAkB,CAAC;IAEjD,oDAAoD;IACpD,MAAM,MAAM,GAAkB,EAAE,OAAO,EAAE,CAAC;IAE1C,OAAO,CACL,8BAAC,iCAAmB,IAAC,MAAM,EAAE,MAAM;QACjC,8BAAC,2CAAmB,IAClB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS;YAEpB,8BAAC,+CAAqB,IACpB,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,sBAAsB,EAAE,sBAAsB,EAC9C,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW;gBAExB,8BAAC,4DAA2B,IAAC,cAAc,EAAE,cAAc;oBACzD,8BAAC,4BAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,MAAM;wBAC1C,8BAAC,+CAAqB;4BACpB,8BAAC,2DAA0B,QACxB,QAAQ,CACkB,CACP,CACM,CACJ,CACR,CACJ,CACF,CACvB,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\n/**\n * TamboV1Provider - Main Provider for v1 API\n *\n * Composes the necessary providers for the v1 SDK:\n * - TamboClientProvider: API client and authentication\n * - TamboRegistryProvider: Component and tool registration\n * - TamboContextHelpersProvider: Context helper functions\n * - TamboV1StreamProvider: Streaming state management\n *\n * This provider should wrap your entire application or the portion\n * that needs access to Tambo v1 functionality.\n */\n\nimport React, {\n createContext,\n useContext,\n type PropsWithChildren,\n useState,\n} from \"react\";\nimport { QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\nimport {\n TamboClientProvider,\n type TamboClientProviderProps,\n} from \"../../providers/tambo-client-provider\";\nimport {\n TamboRegistryProvider,\n type TamboRegistryProviderProps,\n} from \"../../providers/tambo-registry-provider\";\nimport { TamboContextHelpersProvider } from \"../../providers/tambo-context-helpers-provider\";\nimport type { ContextHelpers } from \"../../context-helpers\";\nimport type { McpServerInfo } from \"../../model/mcp-server-info\";\nimport type {\n ListResourceItem,\n ResourceSource,\n} from \"../../model/resource-info\";\nimport { TamboV1StreamProvider } from \"./tambo-v1-stream-context\";\nimport { TamboV1ThreadInputProvider } from \"./tambo-v1-thread-input-provider\";\n\n/**\n * Configuration values for v1 SDK.\n * These are static values that don't change during the session.\n */\nexport interface TamboV1Config {\n /** User key for thread ownership and scoping */\n userKey?: string;\n}\n\n/**\n * Context for v1 SDK configuration.\n * @internal\n */\nexport const TamboV1ConfigContext = createContext<TamboV1Config | null>(null);\n\n/**\n * Hook to access v1 SDK configuration.\n * @returns Configuration values including userKey\n * @throws {Error} If used outside TamboV1Provider\n */\nexport function useTamboV1Config(): TamboV1Config {\n const config = useContext(TamboV1ConfigContext);\n if (!config) {\n throw new Error(\"useTamboV1Config must be used within TamboV1Provider\");\n }\n return config;\n}\n\n/**\n * Props for TamboV1Provider\n */\nexport interface TamboV1ProviderProps extends Pick<\n TamboClientProviderProps,\n \"apiKey\" | \"tamboUrl\" | \"environment\" | \"userToken\"\n> {\n /**\n * Components to register with the registry.\n * These will be available for the AI to use in responses.\n */\n components?: TamboRegistryProviderProps[\"components\"];\n\n /**\n * Tools to register with the registry.\n * These will be executed client-side when requested by the AI.\n */\n tools?: TamboRegistryProviderProps[\"tools\"];\n\n /**\n * MCP servers to register with the registry.\n * These provide additional tools and resources from MCP-compatible servers.\n */\n mcpServers?: (McpServerInfo | string)[];\n\n /**\n * Callback function called when an unregistered tool is called.\n * If not provided, an error will be thrown for unknown tools.\n */\n onCallUnregisteredTool?: TamboRegistryProviderProps[\"onCallUnregisteredTool\"];\n\n /**\n * Static resources to register with the registry.\n * These will be available for the AI to access.\n */\n resources?: ListResourceItem[];\n\n /**\n * Dynamic resource search function.\n * Must be paired with getResource.\n * Called when searching for resources dynamically.\n */\n listResources?: ResourceSource[\"listResources\"];\n\n /**\n * Dynamic resource fetch function.\n * Must be paired with listResources.\n * Called when fetching a specific resource by URI.\n */\n getResource?: ResourceSource[\"getResource\"];\n\n /**\n * Configuration for context helpers.\n * A dictionary of functions that provide additional context to the AI.\n * Each key becomes the context name, and the function returns the value.\n */\n contextHelpers?: ContextHelpers;\n\n /**\n * User key for thread ownership and scoping.\n *\n * **Required**: You must provide either `userKey` OR `userToken` (which contains a userKey).\n * All thread operations (create, list, fetch) only return threads owned by this userKey.\n *\n * - Use `userKey` for server-side or trusted environments where you control the user identity\n * - Use `userToken` (OAuth bearer token) for client-side apps where the token contains the userKey\n */\n userKey?: string;\n\n /**\n * Optional custom QueryClient instance.\n * If not provided, a default client will be created.\n */\n queryClient?: QueryClient;\n\n /**\n * Children components\n */\n children: React.ReactNode;\n}\n\n/**\n * Main provider for the Tambo v1 SDK.\n *\n * Composes TamboClientProvider, TamboRegistryProvider, and TamboV1StreamProvider\n * to provide a complete context for building AI-powered applications.\n *\n * Threads are managed dynamically through useTamboV1() hook functions:\n * - startNewThread() - Begin a new conversation\n * - switchThread(threadId) - Switch to an existing thread\n * - initThread(threadId) - Initialize a thread for receiving events\n * @param props - Provider configuration\n * @param props.apiKey - Tambo API key for authentication\n * @param props.tamboUrl - Optional custom Tambo API URL\n * @param props.environment - Optional environment configuration\n * @param props.userToken - Optional OAuth token for user authentication\n * @param props.components - Components to register with the AI\n * @param props.tools - Tools to register for client-side execution\n * @param props.mcpServers - MCP servers to register for additional tools/resources\n * @param props.onCallUnregisteredTool - Callback for handling unknown tool calls\n * @param props.resources - Static resources to register with the AI\n * @param props.listResources - Dynamic resource search function (must be paired with getResource)\n * @param props.getResource - Dynamic resource fetch function (must be paired with listResources)\n * @param props.contextHelpers - Configuration for context helper functions\n * @param props.userKey - User key for thread ownership (required if not using userToken)\n * @param props.queryClient - Optional custom React Query client\n * @param props.children - Child components\n * @returns Provider component tree\n * @example\n * ```tsx\n * import { TamboV1Provider } from '@tambo-ai/react/v1';\n *\n * function App() {\n * return (\n * <TamboV1Provider\n * apiKey={process.env.NEXT_PUBLIC_TAMBO_API_KEY!}\n * components={[WeatherCard, StockChart]}\n * tools={[searchTool, calculatorTool]}\n * >\n * <ChatInterface />\n * </TamboV1Provider>\n * );\n * }\n * ```\n */\nexport function TamboV1Provider({\n apiKey,\n tamboUrl,\n environment,\n userToken,\n components,\n tools,\n mcpServers,\n onCallUnregisteredTool,\n resources,\n listResources,\n getResource,\n contextHelpers,\n userKey,\n queryClient,\n children,\n}: PropsWithChildren<TamboV1ProviderProps>) {\n // Create a stable default QueryClient if none provided.\n // Using useState to avoid SSR issues with module-level singletons.\n const [defaultQueryClient] = useState(\n () =>\n new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: 1000,\n retry: 1,\n },\n },\n }),\n );\n\n const client = queryClient ?? defaultQueryClient;\n\n // Config is static - created once and never changes\n const config: TamboV1Config = { userKey };\n\n return (\n <QueryClientProvider client={client}>\n <TamboClientProvider\n apiKey={apiKey}\n tamboUrl={tamboUrl}\n environment={environment}\n userToken={userToken}\n >\n <TamboRegistryProvider\n components={components}\n tools={tools}\n mcpServers={mcpServers}\n onCallUnregisteredTool={onCallUnregisteredTool}\n resources={resources}\n listResources={listResources}\n getResource={getResource}\n >\n <TamboContextHelpersProvider contextHelpers={contextHelpers}>\n <TamboV1ConfigContext.Provider value={config}>\n <TamboV1StreamProvider>\n <TamboV1ThreadInputProvider>\n {children}\n </TamboV1ThreadInputProvider>\n </TamboV1StreamProvider>\n </TamboV1ConfigContext.Provider>\n </TamboContextHelpersProvider>\n </TamboRegistryProvider>\n </TamboClientProvider>\n </QueryClientProvider>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"tambo-v1-provider.js","sourceRoot":"","sources":["../../../src/v1/providers/tambo-v1-provider.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEb,4CAMC;AAsID,0CAuDC;AAjQD;;;;;;;;;;;;GAYG;AAEH,+CAIe;AACf,iFAG+C;AA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C,8BAAC,+CAAqB;4BACpB,8BAAC,2DAA0B,QACxB,QAAQ,CACkB,CACP,CACM,CACN,CACA,CACR,CACJ,CACvB,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\n/**\n * TamboV1Provider - Main Provider for v1 API\n *\n * Composes the necessary providers for the v1 SDK:\n * - TamboClientProvider: API client and authentication\n * - TamboRegistryProvider: Component and tool registration\n * - TamboContextHelpersProvider: Context helper functions\n * - TamboInteractableProvider: Interactive component tracking\n * - TamboV1StreamProvider: Streaming state management\n *\n * This provider should wrap your entire application or the portion\n * that needs access to Tambo v1 functionality.\n */\n\nimport React, {\n createContext,\n useContext,\n type PropsWithChildren,\n} from \"react\";\nimport {\n TamboClientProvider,\n type TamboClientProviderProps,\n} from \"../../providers/tambo-client-provider\";\nimport {\n TamboRegistryProvider,\n type TamboRegistryProviderProps,\n} from \"../../providers/tambo-registry-provider\";\nimport { TamboContextHelpersProvider } from \"../../providers/tambo-context-helpers-provider\";\nimport { TamboInteractableProvider } from \"../../providers/tambo-interactable-provider\";\nimport type { ContextHelpers } from \"../../context-helpers\";\nimport type { McpServerInfo } from \"../../model/mcp-server-info\";\nimport type {\n ListResourceItem,\n ResourceSource,\n} from \"../../model/resource-info\";\nimport { TamboV1StreamProvider } from \"./tambo-v1-stream-context\";\nimport { TamboV1ThreadInputProvider } from \"./tambo-v1-thread-input-provider\";\n\n/**\n * Configuration values for v1 SDK.\n * These are static values that don't change during the session.\n */\nexport interface TamboV1Config {\n /** User key for thread ownership and scoping */\n userKey?: string;\n /** Whether to automatically generate thread names after a threshold of messages. Defaults to true. */\n autoGenerateThreadName?: boolean;\n /** The message count threshold at which the thread name will be auto-generated. Defaults to 3. */\n autoGenerateNameThreshold?: number;\n}\n\n/**\n * Context for v1 SDK configuration.\n * @internal\n */\nexport const TamboV1ConfigContext = createContext<TamboV1Config | null>(null);\n\n/**\n * Hook to access v1 SDK configuration.\n * @returns Configuration values including userKey\n * @throws {Error} If used outside TamboV1Provider\n */\nexport function useTamboV1Config(): TamboV1Config {\n const config = useContext(TamboV1ConfigContext);\n if (!config) {\n throw new Error(\"useTamboV1Config must be used within TamboV1Provider\");\n }\n return config;\n}\n\n/**\n * Props for TamboV1Provider\n */\nexport interface TamboV1ProviderProps extends Pick<\n TamboClientProviderProps,\n \"apiKey\" | \"tamboUrl\" | \"environment\" | \"userToken\"\n> {\n /**\n * Components to register with the registry.\n * These will be available for the AI to use in responses.\n */\n components?: TamboRegistryProviderProps[\"components\"];\n\n /**\n * Tools to register with the registry.\n * These will be executed client-side when requested by the AI.\n */\n tools?: TamboRegistryProviderProps[\"tools\"];\n\n /**\n * MCP servers to register with the registry.\n * These provide additional tools and resources from MCP-compatible servers.\n */\n mcpServers?: (McpServerInfo | string)[];\n\n /**\n * Callback function called when an unregistered tool is called.\n * If not provided, an error will be thrown for unknown tools.\n */\n onCallUnregisteredTool?: TamboRegistryProviderProps[\"onCallUnregisteredTool\"];\n\n /**\n * Static resources to register with the registry.\n * These will be available for the AI to access.\n */\n resources?: ListResourceItem[];\n\n /**\n * Dynamic resource search function.\n * Must be paired with getResource.\n * Called when searching for resources dynamically.\n */\n listResources?: ResourceSource[\"listResources\"];\n\n /**\n * Dynamic resource fetch function.\n * Must be paired with listResources.\n * Called when fetching a specific resource by URI.\n */\n getResource?: ResourceSource[\"getResource\"];\n\n /**\n * Configuration for context helpers.\n * A dictionary of functions that provide additional context to the AI.\n * Each key becomes the context name, and the function returns the value.\n */\n contextHelpers?: ContextHelpers;\n\n /**\n * User key for thread ownership and scoping.\n *\n * **Required**: You must provide either `userKey` OR `userToken` (which contains a userKey).\n * All thread operations (create, list, fetch) only return threads owned by this userKey.\n *\n * - Use `userKey` for server-side or trusted environments where you control the user identity\n * - Use `userToken` (OAuth bearer token) for client-side apps where the token contains the userKey\n */\n userKey?: string;\n\n /**\n * Whether to automatically generate thread names after a threshold of messages.\n * Defaults to true.\n */\n autoGenerateThreadName?: boolean;\n\n /**\n * The message count threshold at which the thread name will be auto-generated.\n * Defaults to 3.\n */\n autoGenerateNameThreshold?: number;\n\n /**\n * Children components\n */\n children: React.ReactNode;\n}\n\n/**\n * Main provider for the Tambo v1 SDK.\n *\n * Composes TamboClientProvider, TamboRegistryProvider, and TamboV1StreamProvider\n * to provide a complete context for building AI-powered applications.\n *\n * Threads are managed dynamically through useTamboV1() hook functions:\n * - startNewThread() - Begin a new conversation\n * - switchThread(threadId) - Switch to an existing thread\n * - initThread(threadId) - Initialize a thread for receiving events\n * @param props - Provider configuration\n * @param props.apiKey - Tambo API key for authentication\n * @param props.tamboUrl - Optional custom Tambo API URL\n * @param props.environment - Optional environment configuration\n * @param props.userToken - Optional OAuth token for user authentication\n * @param props.components - Components to register with the AI\n * @param props.tools - Tools to register for client-side execution\n * @param props.mcpServers - MCP servers to register for additional tools/resources\n * @param props.onCallUnregisteredTool - Callback for handling unknown tool calls\n * @param props.resources - Static resources to register with the AI\n * @param props.listResources - Dynamic resource search function (must be paired with getResource)\n * @param props.getResource - Dynamic resource fetch function (must be paired with listResources)\n * @param props.contextHelpers - Configuration for context helper functions\n * @param props.userKey - User key for thread ownership (required if not using userToken)\n * @param props.autoGenerateThreadName - Whether to automatically generate thread names. Defaults to true.\n * @param props.autoGenerateNameThreshold - The message count threshold at which the thread name will be auto-generated. Defaults to 3.\n * @param props.children - Child components\n * @returns Provider component tree\n * @example\n * ```tsx\n * import { TamboV1Provider } from '@tambo-ai/react/v1';\n *\n * function App() {\n * return (\n * <TamboV1Provider\n * apiKey={process.env.NEXT_PUBLIC_TAMBO_API_KEY!}\n * components={[WeatherCard, StockChart]}\n * tools={[searchTool, calculatorTool]}\n * >\n * <ChatInterface />\n * </TamboV1Provider>\n * );\n * }\n * ```\n */\nexport function TamboV1Provider({\n apiKey,\n tamboUrl,\n environment,\n userToken,\n components,\n tools,\n mcpServers,\n onCallUnregisteredTool,\n resources,\n listResources,\n getResource,\n contextHelpers,\n userKey,\n autoGenerateThreadName,\n autoGenerateNameThreshold,\n children,\n}: PropsWithChildren<TamboV1ProviderProps>) {\n // Config is static - created once and never changes\n const config: TamboV1Config = {\n userKey,\n autoGenerateThreadName,\n autoGenerateNameThreshold,\n };\n\n return (\n <TamboClientProvider\n apiKey={apiKey}\n tamboUrl={tamboUrl}\n environment={environment}\n userToken={userToken}\n >\n <TamboRegistryProvider\n components={components}\n tools={tools}\n mcpServers={mcpServers}\n onCallUnregisteredTool={onCallUnregisteredTool}\n resources={resources}\n listResources={listResources}\n getResource={getResource}\n >\n <TamboContextHelpersProvider contextHelpers={contextHelpers}>\n <TamboInteractableProvider>\n <TamboV1ConfigContext.Provider value={config}>\n <TamboV1StreamProvider>\n <TamboV1ThreadInputProvider>\n {children}\n </TamboV1ThreadInputProvider>\n </TamboV1StreamProvider>\n </TamboV1ConfigContext.Provider>\n </TamboInteractableProvider>\n </TamboContextHelpersProvider>\n </TamboRegistryProvider>\n </TamboClientProvider>\n );\n}\n"]}
|