@tambo-ai/react 0.67.1 → 0.69.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 +3 -5
- package/dist/context-helpers/context-helpers.test.js +16 -4
- package/dist/context-helpers/context-helpers.test.js.map +1 -1
- package/dist/context-helpers/current-interactables-context-helper.d.ts +2 -2
- package/dist/context-helpers/current-interactables-context-helper.d.ts.map +1 -1
- package/dist/context-helpers/current-interactables-context-helper.js +31 -12
- package/dist/context-helpers/current-interactables-context-helper.js.map +1 -1
- package/dist/context-helpers/registry.d.ts +2 -2
- package/dist/context-helpers/registry.d.ts.map +1 -1
- package/dist/context-helpers/registry.js.map +1 -1
- package/dist/context-helpers/types.d.ts +2 -2
- package/dist/context-helpers/types.d.ts.map +1 -1
- package/dist/context-helpers/types.js.map +1 -1
- package/dist/hoc/with-tambo-interactable.d.ts +50 -4
- package/dist/hoc/with-tambo-interactable.d.ts.map +1 -1
- package/dist/hoc/with-tambo-interactable.js +20 -5
- package/dist/hoc/with-tambo-interactable.js.map +1 -1
- package/dist/hooks/use-component-state.d.ts +3 -8
- package/dist/hooks/use-component-state.d.ts.map +1 -1
- package/dist/hooks/use-component-state.js +8 -0
- package/dist/hooks/use-component-state.js.map +1 -1
- package/dist/hooks/use-component-state.test.js +37 -0
- package/dist/hooks/use-component-state.test.js.map +1 -1
- package/dist/hooks/use-message-images.test.js +174 -37
- package/dist/hooks/use-message-images.test.js.map +1 -1
- package/dist/hooks/use-tambo-threads.js +1 -1
- package/dist/hooks/use-tambo-threads.js.map +1 -1
- package/dist/hooks/use-tambo-voice.d.ts +1 -1
- package/dist/hooks/use-tambo-voice.js +1 -1
- package/dist/hooks/use-tambo-voice.js.map +1 -1
- package/dist/hooks/use-tambo-voice.test.d.ts +2 -0
- package/dist/hooks/use-tambo-voice.test.d.ts.map +1 -0
- package/dist/hooks/use-tambo-voice.test.js +239 -0
- package/dist/hooks/use-tambo-voice.test.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/elicitation.d.ts.map +1 -1
- package/dist/mcp/elicitation.js +12 -0
- package/dist/mcp/elicitation.js.map +1 -1
- package/dist/mcp/elicitation.test.js +8 -1
- package/dist/mcp/elicitation.test.js.map +1 -1
- package/dist/mcp/mcp-client.d.ts +6 -10
- package/dist/mcp/mcp-client.d.ts.map +1 -1
- package/dist/mcp/mcp-client.js.map +1 -1
- package/dist/mcp/mcp-constants.d.ts +19 -0
- package/dist/mcp/mcp-constants.d.ts.map +1 -0
- package/dist/mcp/mcp-constants.js +21 -0
- package/dist/mcp/mcp-constants.js.map +1 -0
- package/dist/mcp/mcp-hooks.d.ts +21 -40
- package/dist/mcp/mcp-hooks.d.ts.map +1 -1
- package/dist/mcp/mcp-hooks.js +130 -39
- package/dist/mcp/mcp-hooks.js.map +1 -1
- package/dist/mcp/mcp-hooks.test.js +431 -5
- package/dist/mcp/mcp-hooks.test.js.map +1 -1
- package/dist/mcp/tambo-mcp-provider.d.ts +7 -0
- package/dist/mcp/tambo-mcp-provider.d.ts.map +1 -1
- package/dist/mcp/tambo-mcp-provider.js +205 -155
- package/dist/mcp/tambo-mcp-provider.js.map +1 -1
- package/dist/mcp/tambo-mcp-provider.test.js +37 -0
- package/dist/mcp/tambo-mcp-provider.test.js.map +1 -1
- package/dist/model/component-metadata.d.ts +54 -21
- package/dist/model/component-metadata.d.ts.map +1 -1
- package/dist/model/component-metadata.js.map +1 -1
- package/dist/model/tambo-interactable.d.ts +13 -5
- package/dist/model/tambo-interactable.d.ts.map +1 -1
- package/dist/model/tambo-interactable.js.map +1 -1
- package/dist/providers/__tests__/thread-input-resource-resolution.test.d.ts +2 -0
- package/dist/providers/__tests__/thread-input-resource-resolution.test.d.ts.map +1 -0
- package/dist/providers/__tests__/thread-input-resource-resolution.test.js +592 -0
- package/dist/providers/__tests__/thread-input-resource-resolution.test.js.map +1 -0
- package/dist/providers/index.d.ts +1 -1
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/tambo-client-provider.d.ts +8 -0
- package/dist/providers/tambo-client-provider.d.ts.map +1 -1
- package/dist/providers/tambo-client-provider.js +10 -11
- package/dist/providers/tambo-client-provider.js.map +1 -1
- package/dist/providers/tambo-client-provider.test.d.ts +2 -0
- package/dist/providers/tambo-client-provider.test.d.ts.map +1 -0
- package/dist/providers/tambo-client-provider.test.js +208 -0
- package/dist/providers/tambo-client-provider.test.js.map +1 -0
- package/dist/providers/tambo-context-attachment-provider.d.ts +34 -92
- package/dist/providers/tambo-context-attachment-provider.d.ts.map +1 -1
- package/dist/providers/tambo-context-attachment-provider.js +62 -105
- package/dist/providers/tambo-context-attachment-provider.js.map +1 -1
- package/dist/providers/tambo-context-attachment-provider.test.js +229 -463
- package/dist/providers/tambo-context-attachment-provider.test.js.map +1 -1
- package/dist/providers/tambo-interactable-provider-partial-updates.test.js +22 -21
- package/dist/providers/tambo-interactable-provider-partial-updates.test.js.map +1 -1
- package/dist/providers/tambo-interactable-provider.d.ts +5 -2
- package/dist/providers/tambo-interactable-provider.d.ts.map +1 -1
- package/dist/providers/tambo-interactable-provider.js +126 -17
- package/dist/providers/tambo-interactable-provider.js.map +1 -1
- package/dist/providers/tambo-interactable-provider.test.js +242 -0
- package/dist/providers/tambo-interactable-provider.test.js.map +1 -1
- package/dist/providers/tambo-interactables-additional-context.test.js +2 -5
- package/dist/providers/tambo-interactables-additional-context.test.js.map +1 -1
- package/dist/providers/tambo-provider.d.ts +2 -3
- package/dist/providers/tambo-provider.d.ts.map +1 -1
- package/dist/providers/tambo-provider.js +6 -5
- package/dist/providers/tambo-provider.js.map +1 -1
- package/dist/providers/tambo-registry-provider.test.js +16 -0
- package/dist/providers/tambo-registry-provider.test.js.map +1 -1
- package/dist/providers/tambo-registry-schema-compat.test.js +31 -0
- package/dist/providers/tambo-registry-schema-compat.test.js.map +1 -1
- package/dist/providers/tambo-thread-input-provider.d.ts +1 -1
- package/dist/providers/tambo-thread-input-provider.d.ts.map +1 -1
- package/dist/providers/tambo-thread-input-provider.js +26 -4
- package/dist/providers/tambo-thread-input-provider.js.map +1 -1
- package/dist/providers/tambo-thread-provider-initial-messages.test.js +84 -2
- package/dist/providers/tambo-thread-provider-initial-messages.test.js.map +1 -1
- package/dist/providers/tambo-thread-provider.d.ts.map +1 -1
- package/dist/providers/tambo-thread-provider.js +53 -42
- package/dist/providers/tambo-thread-provider.js.map +1 -1
- package/dist/providers/tambo-thread-provider.test.js +368 -262
- package/dist/providers/tambo-thread-provider.test.js.map +1 -1
- package/dist/schema/index.d.ts +1 -1
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +2 -1
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/json-schema.d.ts +7 -0
- package/dist/schema/json-schema.d.ts.map +1 -1
- package/dist/schema/json-schema.js +40 -29
- package/dist/schema/json-schema.js.map +1 -1
- package/dist/schema/json-schema.test.d.ts +2 -0
- package/dist/schema/json-schema.test.d.ts.map +1 -0
- package/dist/schema/json-schema.test.js +204 -0
- package/dist/schema/json-schema.test.js.map +1 -0
- package/dist/schema/schema.test.js +237 -0
- package/dist/schema/schema.test.js.map +1 -1
- package/dist/schema/standard-schema.d.ts +1 -0
- package/dist/schema/standard-schema.d.ts.map +1 -1
- package/dist/schema/standard-schema.js +18 -13
- package/dist/schema/standard-schema.js.map +1 -1
- package/dist/schema/standard-schema.test.d.ts +2 -0
- package/dist/schema/standard-schema.test.d.ts.map +1 -0
- package/dist/schema/standard-schema.test.js +165 -0
- package/dist/schema/standard-schema.test.js.map +1 -0
- package/dist/schema/validate.test.js +149 -0
- package/dist/schema/validate.test.js.map +1 -1
- package/dist/schema/zod.d.ts +7 -4
- package/dist/schema/zod.d.ts.map +1 -1
- package/dist/schema/zod.js +65 -22
- package/dist/schema/zod.js.map +1 -1
- package/dist/schema/zod.test.js +112 -0
- package/dist/schema/zod.test.js.map +1 -1
- package/dist/setupTests.js +3 -0
- package/dist/setupTests.js.map +1 -1
- package/dist/testing/tools.d.ts +4 -1
- package/dist/testing/tools.d.ts.map +1 -1
- package/dist/testing/tools.js +6 -1
- package/dist/testing/tools.js.map +1 -1
- package/dist/util/generate-component.d.ts.map +1 -1
- package/dist/util/generate-component.js +18 -3
- package/dist/util/generate-component.js.map +1 -1
- package/dist/util/generate-component.test.d.ts +2 -0
- package/dist/util/generate-component.test.d.ts.map +1 -0
- package/dist/util/generate-component.test.js +340 -0
- package/dist/util/generate-component.test.js.map +1 -0
- package/dist/util/is-promise.d.ts +9 -0
- package/dist/util/is-promise.d.ts.map +1 -0
- package/dist/util/is-promise.js +20 -0
- package/dist/util/is-promise.js.map +1 -0
- package/dist/util/is-promise.test.d.ts +2 -0
- package/dist/util/is-promise.test.d.ts.map +1 -0
- package/dist/util/is-promise.test.js +48 -0
- package/dist/util/is-promise.test.js.map +1 -0
- package/dist/util/message-builder.d.ts +3 -1
- package/dist/util/message-builder.d.ts.map +1 -1
- package/dist/util/message-builder.js +20 -3
- package/dist/util/message-builder.js.map +1 -1
- package/dist/util/message-builder.test.js +269 -0
- package/dist/util/message-builder.test.js.map +1 -1
- package/dist/util/query-utils.test.d.ts +2 -0
- package/dist/util/query-utils.test.d.ts.map +1 -0
- package/dist/util/query-utils.test.js +382 -0
- package/dist/util/query-utils.test.js.map +1 -0
- package/dist/util/registry-validators.d.ts.map +1 -1
- package/dist/util/registry-validators.js +7 -0
- package/dist/util/registry-validators.js.map +1 -1
- package/dist/util/registry-validators.test.js +57 -0
- package/dist/util/registry-validators.test.js.map +1 -1
- package/dist/util/registry.d.ts.map +1 -1
- package/dist/util/registry.js +9 -0
- package/dist/util/registry.js.map +1 -1
- package/dist/util/registry.test.js +323 -1
- package/dist/util/registry.test.js.map +1 -1
- package/dist/util/resource-content-resolver.d.ts +20 -0
- package/dist/util/resource-content-resolver.d.ts.map +1 -0
- package/dist/util/resource-content-resolver.js +93 -0
- package/dist/util/resource-content-resolver.js.map +1 -0
- package/dist/util/resource-content-resolver.test.d.ts +2 -0
- package/dist/util/resource-content-resolver.test.d.ts.map +1 -0
- package/dist/util/resource-content-resolver.test.js +254 -0
- package/dist/util/resource-content-resolver.test.js.map +1 -0
- package/dist/util/resource-validators.test.d.ts +2 -0
- package/dist/util/resource-validators.test.d.ts.map +1 -0
- package/dist/util/resource-validators.test.js +90 -0
- package/dist/util/resource-validators.test.js.map +1 -0
- package/dist/util/tool-caller.d.ts +2 -2
- package/dist/util/tool-caller.d.ts.map +1 -1
- package/dist/util/tool-caller.js +8 -8
- package/dist/util/tool-caller.js.map +1 -1
- package/dist/util/validate-component-name.test.d.ts +2 -0
- package/dist/util/validate-component-name.test.d.ts.map +1 -0
- package/dist/util/validate-component-name.test.js +35 -0
- package/dist/util/validate-component-name.test.js.map +1 -0
- package/esm/context-helpers/context-helpers.test.js +16 -4
- package/esm/context-helpers/context-helpers.test.js.map +1 -1
- package/esm/context-helpers/current-interactables-context-helper.d.ts +2 -2
- package/esm/context-helpers/current-interactables-context-helper.d.ts.map +1 -1
- package/esm/context-helpers/current-interactables-context-helper.js +31 -12
- package/esm/context-helpers/current-interactables-context-helper.js.map +1 -1
- package/esm/context-helpers/registry.d.ts +2 -2
- package/esm/context-helpers/registry.d.ts.map +1 -1
- package/esm/context-helpers/registry.js.map +1 -1
- package/esm/context-helpers/types.d.ts +2 -2
- package/esm/context-helpers/types.d.ts.map +1 -1
- package/esm/context-helpers/types.js.map +1 -1
- package/esm/hoc/with-tambo-interactable.d.ts +50 -4
- package/esm/hoc/with-tambo-interactable.d.ts.map +1 -1
- package/esm/hoc/with-tambo-interactable.js +20 -5
- package/esm/hoc/with-tambo-interactable.js.map +1 -1
- package/esm/hooks/use-component-state.d.ts +3 -8
- package/esm/hooks/use-component-state.d.ts.map +1 -1
- package/esm/hooks/use-component-state.js +8 -0
- package/esm/hooks/use-component-state.js.map +1 -1
- package/esm/hooks/use-component-state.test.js +37 -0
- package/esm/hooks/use-component-state.test.js.map +1 -1
- package/esm/hooks/use-message-images.test.js +174 -37
- package/esm/hooks/use-message-images.test.js.map +1 -1
- package/esm/hooks/use-tambo-threads.js +1 -1
- package/esm/hooks/use-tambo-threads.js.map +1 -1
- package/esm/hooks/use-tambo-voice.d.ts +1 -1
- package/esm/hooks/use-tambo-voice.js +1 -1
- package/esm/hooks/use-tambo-voice.js.map +1 -1
- package/esm/hooks/use-tambo-voice.test.d.ts +2 -0
- package/esm/hooks/use-tambo-voice.test.d.ts.map +1 -0
- package/esm/hooks/use-tambo-voice.test.js +234 -0
- package/esm/hooks/use-tambo-voice.test.js.map +1 -0
- package/esm/index.d.ts +2 -2
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js.map +1 -1
- package/esm/mcp/elicitation.d.ts.map +1 -1
- package/esm/mcp/elicitation.js +12 -0
- package/esm/mcp/elicitation.js.map +1 -1
- package/esm/mcp/elicitation.test.js +8 -1
- package/esm/mcp/elicitation.test.js.map +1 -1
- package/esm/mcp/mcp-client.d.ts +6 -10
- package/esm/mcp/mcp-client.d.ts.map +1 -1
- package/esm/mcp/mcp-client.js.map +1 -1
- package/esm/mcp/mcp-constants.d.ts +19 -0
- package/esm/mcp/mcp-constants.d.ts.map +1 -0
- package/esm/mcp/mcp-constants.js +18 -0
- package/esm/mcp/mcp-constants.js.map +1 -0
- package/esm/mcp/mcp-hooks.d.ts +21 -40
- package/esm/mcp/mcp-hooks.d.ts.map +1 -1
- package/esm/mcp/mcp-hooks.js +97 -40
- package/esm/mcp/mcp-hooks.js.map +1 -1
- package/esm/mcp/mcp-hooks.test.js +431 -5
- package/esm/mcp/mcp-hooks.test.js.map +1 -1
- package/esm/mcp/tambo-mcp-provider.d.ts +7 -0
- package/esm/mcp/tambo-mcp-provider.d.ts.map +1 -1
- package/esm/mcp/tambo-mcp-provider.js +204 -154
- package/esm/mcp/tambo-mcp-provider.js.map +1 -1
- package/esm/mcp/tambo-mcp-provider.test.js +37 -0
- package/esm/mcp/tambo-mcp-provider.test.js.map +1 -1
- package/esm/model/component-metadata.d.ts +54 -21
- package/esm/model/component-metadata.d.ts.map +1 -1
- package/esm/model/component-metadata.js.map +1 -1
- package/esm/model/tambo-interactable.d.ts +13 -5
- package/esm/model/tambo-interactable.d.ts.map +1 -1
- package/esm/model/tambo-interactable.js.map +1 -1
- package/esm/providers/__tests__/thread-input-resource-resolution.test.d.ts +2 -0
- package/esm/providers/__tests__/thread-input-resource-resolution.test.d.ts.map +1 -0
- package/esm/providers/__tests__/thread-input-resource-resolution.test.js +587 -0
- package/esm/providers/__tests__/thread-input-resource-resolution.test.js.map +1 -0
- package/esm/providers/index.d.ts +1 -1
- package/esm/providers/index.d.ts.map +1 -1
- package/esm/providers/index.js.map +1 -1
- package/esm/providers/tambo-client-provider.d.ts +8 -0
- package/esm/providers/tambo-client-provider.d.ts.map +1 -1
- package/esm/providers/tambo-client-provider.js +11 -12
- package/esm/providers/tambo-client-provider.js.map +1 -1
- package/esm/providers/tambo-client-provider.test.d.ts +2 -0
- package/esm/providers/tambo-client-provider.test.d.ts.map +1 -0
- package/esm/providers/tambo-client-provider.test.js +203 -0
- package/esm/providers/tambo-client-provider.test.js.map +1 -0
- package/esm/providers/tambo-context-attachment-provider.d.ts +34 -92
- package/esm/providers/tambo-context-attachment-provider.d.ts.map +1 -1
- package/esm/providers/tambo-context-attachment-provider.js +63 -106
- package/esm/providers/tambo-context-attachment-provider.js.map +1 -1
- package/esm/providers/tambo-context-attachment-provider.test.js +230 -464
- package/esm/providers/tambo-context-attachment-provider.test.js.map +1 -1
- package/esm/providers/tambo-interactable-provider-partial-updates.test.js +22 -21
- package/esm/providers/tambo-interactable-provider-partial-updates.test.js.map +1 -1
- package/esm/providers/tambo-interactable-provider.d.ts +5 -2
- package/esm/providers/tambo-interactable-provider.d.ts.map +1 -1
- package/esm/providers/tambo-interactable-provider.js +126 -17
- package/esm/providers/tambo-interactable-provider.js.map +1 -1
- package/esm/providers/tambo-interactable-provider.test.js +242 -0
- package/esm/providers/tambo-interactable-provider.test.js.map +1 -1
- package/esm/providers/tambo-interactables-additional-context.test.js +2 -5
- package/esm/providers/tambo-interactables-additional-context.test.js.map +1 -1
- package/esm/providers/tambo-provider.d.ts +2 -3
- package/esm/providers/tambo-provider.d.ts.map +1 -1
- package/esm/providers/tambo-provider.js +6 -5
- package/esm/providers/tambo-provider.js.map +1 -1
- package/esm/providers/tambo-registry-provider.test.js +16 -0
- package/esm/providers/tambo-registry-provider.test.js.map +1 -1
- package/esm/providers/tambo-registry-schema-compat.test.js +31 -0
- package/esm/providers/tambo-registry-schema-compat.test.js.map +1 -1
- package/esm/providers/tambo-thread-input-provider.d.ts +1 -1
- package/esm/providers/tambo-thread-input-provider.d.ts.map +1 -1
- package/esm/providers/tambo-thread-input-provider.js +26 -4
- package/esm/providers/tambo-thread-input-provider.js.map +1 -1
- package/esm/providers/tambo-thread-provider-initial-messages.test.js +84 -2
- package/esm/providers/tambo-thread-provider-initial-messages.test.js.map +1 -1
- package/esm/providers/tambo-thread-provider.d.ts.map +1 -1
- package/esm/providers/tambo-thread-provider.js +53 -42
- package/esm/providers/tambo-thread-provider.js.map +1 -1
- package/esm/providers/tambo-thread-provider.test.js +368 -262
- package/esm/providers/tambo-thread-provider.test.js.map +1 -1
- package/esm/schema/index.d.ts +1 -1
- package/esm/schema/index.d.ts.map +1 -1
- package/esm/schema/index.js +1 -1
- package/esm/schema/index.js.map +1 -1
- package/esm/schema/json-schema.d.ts +7 -0
- package/esm/schema/json-schema.d.ts.map +1 -1
- package/esm/schema/json-schema.js +11 -1
- package/esm/schema/json-schema.js.map +1 -1
- package/esm/schema/json-schema.test.d.ts +2 -0
- package/esm/schema/json-schema.test.d.ts.map +1 -0
- package/esm/schema/json-schema.test.js +202 -0
- package/esm/schema/json-schema.test.js.map +1 -0
- package/esm/schema/schema.test.js +238 -1
- package/esm/schema/schema.test.js.map +1 -1
- package/esm/schema/standard-schema.d.ts +1 -0
- package/esm/schema/standard-schema.d.ts.map +1 -1
- package/esm/schema/standard-schema.js +18 -13
- package/esm/schema/standard-schema.js.map +1 -1
- package/esm/schema/standard-schema.test.d.ts +2 -0
- package/esm/schema/standard-schema.test.d.ts.map +1 -0
- package/esm/schema/standard-schema.test.js +130 -0
- package/esm/schema/standard-schema.test.js.map +1 -0
- package/esm/schema/validate.test.js +149 -0
- package/esm/schema/validate.test.js.map +1 -1
- package/esm/schema/zod.d.ts +7 -4
- package/esm/schema/zod.d.ts.map +1 -1
- package/esm/schema/zod.js +65 -22
- package/esm/schema/zod.js.map +1 -1
- package/esm/schema/zod.test.js +113 -1
- package/esm/schema/zod.test.js.map +1 -1
- package/esm/setupTests.js +3 -0
- package/esm/setupTests.js.map +1 -1
- package/esm/testing/tools.d.ts +4 -1
- package/esm/testing/tools.d.ts.map +1 -1
- package/esm/testing/tools.js +6 -1
- package/esm/testing/tools.js.map +1 -1
- package/esm/util/generate-component.d.ts.map +1 -1
- package/esm/util/generate-component.js +18 -3
- package/esm/util/generate-component.js.map +1 -1
- package/esm/util/generate-component.test.d.ts +2 -0
- package/esm/util/generate-component.test.d.ts.map +1 -0
- package/esm/util/generate-component.test.js +302 -0
- package/esm/util/generate-component.test.js.map +1 -0
- package/esm/util/is-promise.d.ts +9 -0
- package/esm/util/is-promise.d.ts.map +1 -0
- package/esm/util/is-promise.js +17 -0
- package/esm/util/is-promise.js.map +1 -0
- package/esm/util/is-promise.test.d.ts +2 -0
- package/esm/util/is-promise.test.d.ts.map +1 -0
- package/esm/util/is-promise.test.js +46 -0
- package/esm/util/is-promise.test.js.map +1 -0
- package/esm/util/message-builder.d.ts +3 -1
- package/esm/util/message-builder.d.ts.map +1 -1
- package/esm/util/message-builder.js +20 -3
- package/esm/util/message-builder.js.map +1 -1
- package/esm/util/message-builder.test.js +269 -0
- package/esm/util/message-builder.test.js.map +1 -1
- package/esm/util/query-utils.test.d.ts +2 -0
- package/esm/util/query-utils.test.d.ts.map +1 -0
- package/esm/util/query-utils.test.js +380 -0
- package/esm/util/query-utils.test.js.map +1 -0
- package/esm/util/registry-validators.d.ts.map +1 -1
- package/esm/util/registry-validators.js +7 -0
- package/esm/util/registry-validators.js.map +1 -1
- package/esm/util/registry-validators.test.js +57 -0
- package/esm/util/registry-validators.test.js.map +1 -1
- package/esm/util/registry.d.ts.map +1 -1
- package/esm/util/registry.js +9 -0
- package/esm/util/registry.js.map +1 -1
- package/esm/util/registry.test.js +324 -2
- package/esm/util/registry.test.js.map +1 -1
- package/esm/util/resource-content-resolver.d.ts +20 -0
- package/esm/util/resource-content-resolver.d.ts.map +1 -0
- package/esm/util/resource-content-resolver.js +89 -0
- package/esm/util/resource-content-resolver.js.map +1 -0
- package/esm/util/resource-content-resolver.test.d.ts +2 -0
- package/esm/util/resource-content-resolver.test.d.ts.map +1 -0
- package/esm/util/resource-content-resolver.test.js +252 -0
- package/esm/util/resource-content-resolver.test.js.map +1 -0
- package/esm/util/resource-validators.test.d.ts +2 -0
- package/esm/util/resource-validators.test.d.ts.map +1 -0
- package/esm/util/resource-validators.test.js +88 -0
- package/esm/util/resource-validators.test.js.map +1 -0
- package/esm/util/tool-caller.d.ts +2 -2
- package/esm/util/tool-caller.d.ts.map +1 -1
- package/esm/util/tool-caller.js +8 -8
- package/esm/util/tool-caller.js.map +1 -1
- package/esm/util/validate-component-name.test.d.ts +2 -0
- package/esm/util/validate-component-name.test.d.ts.map +1 -0
- package/esm/util/validate-component-name.test.js +33 -0
- package/esm/util/validate-component-name.test.js.map +1 -0
- package/package.json +15 -23
- package/dist/schema/alias.d.ts +0 -3
- package/dist/schema/alias.d.ts.map +0 -1
- package/dist/schema/alias.js +0 -6
- package/dist/schema/alias.js.map +0 -1
- package/esm/schema/alias.d.ts +0 -3
- package/esm/schema/alias.d.ts.map +0 -1
- package/esm/schema/alias.js +0 -13
- package/esm/schema/alias.js.map +0 -1
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const resource_validators_1 = require("./resource-validators");
|
|
4
|
+
describe("validateResourceSource", () => {
|
|
5
|
+
it("should throw when has listResources but not getResource", () => {
|
|
6
|
+
const listResources = async () => [];
|
|
7
|
+
const getResource = undefined;
|
|
8
|
+
expect(() => {
|
|
9
|
+
(0, resource_validators_1.validateResourceSource)(listResources, getResource);
|
|
10
|
+
}).toThrow("Both listResources and getResource must be provided together, or neither should be provided. " +
|
|
11
|
+
"Got: listResources=defined, getResource=undefined");
|
|
12
|
+
});
|
|
13
|
+
it("should throw when has getResource but not listResources", () => {
|
|
14
|
+
const listResources = undefined;
|
|
15
|
+
const getResource = async () => ({
|
|
16
|
+
contents: [
|
|
17
|
+
{
|
|
18
|
+
uri: "https://resource",
|
|
19
|
+
mimeType: "text/plain",
|
|
20
|
+
text: "test",
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
});
|
|
24
|
+
expect(() => {
|
|
25
|
+
(0, resource_validators_1.validateResourceSource)(listResources, getResource);
|
|
26
|
+
}).toThrow("Both listResources and getResource must be provided together, or neither should be provided. " +
|
|
27
|
+
"Got: listResources=undefined, getResource=defined");
|
|
28
|
+
});
|
|
29
|
+
it("should not throw when both listResources and getResource are provided", () => {
|
|
30
|
+
const listResources = async () => [];
|
|
31
|
+
const getResource = async () => ({
|
|
32
|
+
contents: [
|
|
33
|
+
{
|
|
34
|
+
uri: "https://resource",
|
|
35
|
+
mimeType: "text/plain",
|
|
36
|
+
text: "test",
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
});
|
|
40
|
+
expect(() => {
|
|
41
|
+
(0, resource_validators_1.validateResourceSource)(listResources, getResource);
|
|
42
|
+
}).not.toThrow();
|
|
43
|
+
});
|
|
44
|
+
it("should not throw when neither listResources nor getResource are provided", () => {
|
|
45
|
+
const listResources = undefined;
|
|
46
|
+
const getResource = undefined;
|
|
47
|
+
expect(() => {
|
|
48
|
+
(0, resource_validators_1.validateResourceSource)(listResources, getResource);
|
|
49
|
+
}).not.toThrow();
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
describe("validateResource", () => {
|
|
53
|
+
it("should throw when resource is missing uri field", () => {
|
|
54
|
+
const resource = {
|
|
55
|
+
name: "Test Resource",
|
|
56
|
+
};
|
|
57
|
+
expect(() => {
|
|
58
|
+
(0, resource_validators_1.validateResource)(resource);
|
|
59
|
+
}).toThrow("Resource must have a 'uri' field");
|
|
60
|
+
});
|
|
61
|
+
it("should throw when resource is missing name field", () => {
|
|
62
|
+
const resource = {
|
|
63
|
+
uri: "https://resource",
|
|
64
|
+
};
|
|
65
|
+
expect(() => {
|
|
66
|
+
(0, resource_validators_1.validateResource)(resource);
|
|
67
|
+
}).toThrow("Resource with URI 'https://resource' must have a 'name' field");
|
|
68
|
+
});
|
|
69
|
+
it("should not throw when resource has both uri and name fields", () => {
|
|
70
|
+
const resource = {
|
|
71
|
+
uri: "https://resource",
|
|
72
|
+
name: "Test Resource",
|
|
73
|
+
};
|
|
74
|
+
expect(() => {
|
|
75
|
+
(0, resource_validators_1.validateResource)(resource);
|
|
76
|
+
}).not.toThrow();
|
|
77
|
+
});
|
|
78
|
+
it("should not throw when resource has uri, name, and optional fields", () => {
|
|
79
|
+
const resource = {
|
|
80
|
+
uri: "https://resource",
|
|
81
|
+
name: "Test Resource",
|
|
82
|
+
description: "A test resource",
|
|
83
|
+
mimeType: "text/plain",
|
|
84
|
+
};
|
|
85
|
+
expect(() => {
|
|
86
|
+
(0, resource_validators_1.validateResource)(resource);
|
|
87
|
+
}).not.toThrow();
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
//# sourceMappingURL=resource-validators.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-validators.test.js","sourceRoot":"","sources":["../../src/util/resource-validators.test.ts"],"names":[],"mappings":";;AACA,+DAG+B;AAE/B,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,EAAE,CAAC,yDAAyD,EAAE,GAAG,EAAE;QACjE,MAAM,aAAa,GAAG,KAAK,IAAI,EAAE,CAAC,EAAE,CAAC;QACrC,MAAM,WAAW,GAAG,SAAS,CAAC;QAE9B,MAAM,CAAC,GAAG,EAAE;YACV,IAAA,4CAAsB,EAAC,aAAa,EAAE,WAAW,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC,OAAO,CACR,+FAA+F;YAC7F,mDAAmD,CACtD,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yDAAyD,EAAE,GAAG,EAAE;QACjE,MAAM,aAAa,GAAG,SAAS,CAAC;QAChC,MAAM,WAAW,GAAG,KAAK,IAAI,EAAE,CAAC,CAAC;YAC/B,QAAQ,EAAE;gBACR;oBACE,GAAG,EAAE,kBAAkB;oBACvB,QAAQ,EAAE,YAAY;oBACtB,IAAI,EAAE,MAAM;iBACb;aACF;SACF,CAAC,CAAC;QAEH,MAAM,CAAC,GAAG,EAAE;YACV,IAAA,4CAAsB,EAAC,aAAa,EAAE,WAAW,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC,OAAO,CACR,+FAA+F;YAC7F,mDAAmD,CACtD,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uEAAuE,EAAE,GAAG,EAAE;QAC/E,MAAM,aAAa,GAAG,KAAK,IAAI,EAAE,CAAC,EAAE,CAAC;QACrC,MAAM,WAAW,GAAG,KAAK,IAAI,EAAE,CAAC,CAAC;YAC/B,QAAQ,EAAE;gBACR;oBACE,GAAG,EAAE,kBAAkB;oBACvB,QAAQ,EAAE,YAAY;oBACtB,IAAI,EAAE,MAAM;iBACb;aACF;SACF,CAAC,CAAC;QAEH,MAAM,CAAC,GAAG,EAAE;YACV,IAAA,4CAAsB,EAAC,aAAa,EAAE,WAAW,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0EAA0E,EAAE,GAAG,EAAE;QAClF,MAAM,aAAa,GAAG,SAAS,CAAC;QAChC,MAAM,WAAW,GAAG,SAAS,CAAC;QAE9B,MAAM,CAAC,GAAG,EAAE;YACV,IAAA,4CAAsB,EAAC,aAAa,EAAE,WAAW,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE;QACzD,MAAM,QAAQ,GAAG;YACf,IAAI,EAAE,eAAe;SACF,CAAC;QAEtB,MAAM,CAAC,GAAG,EAAE;YACV,IAAA,sCAAgB,EAAC,QAAQ,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC,OAAO,CAAC,kCAAkC,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;QAC1D,MAAM,QAAQ,GAAG;YACf,GAAG,EAAE,kBAAkB;SACJ,CAAC;QAEtB,MAAM,CAAC,GAAG,EAAE;YACV,IAAA,sCAAgB,EAAC,QAAQ,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC,OAAO,CAAC,+DAA+D,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6DAA6D,EAAE,GAAG,EAAE;QACrE,MAAM,QAAQ,GAAqB;YACjC,GAAG,EAAE,kBAAkB;YACvB,IAAI,EAAE,eAAe;SACtB,CAAC;QAEF,MAAM,CAAC,GAAG,EAAE;YACV,IAAA,sCAAgB,EAAC,QAAQ,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mEAAmE,EAAE,GAAG,EAAE;QAC3E,MAAM,QAAQ,GAAqB;YACjC,GAAG,EAAE,kBAAkB;YACvB,IAAI,EAAE,eAAe;YACrB,WAAW,EAAE,iBAAiB;YAC9B,QAAQ,EAAE,YAAY;SACvB,CAAC;QAEF,MAAM,CAAC,GAAG,EAAE;YACV,IAAA,sCAAgB,EAAC,QAAQ,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import type { ListResourceItem } from \"../model/resource-info\";\nimport {\n validateResource,\n validateResourceSource,\n} from \"./resource-validators\";\n\ndescribe(\"validateResourceSource\", () => {\n it(\"should throw when has listResources but not getResource\", () => {\n const listResources = async () => [];\n const getResource = undefined;\n\n expect(() => {\n validateResourceSource(listResources, getResource);\n }).toThrow(\n \"Both listResources and getResource must be provided together, or neither should be provided. \" +\n \"Got: listResources=defined, getResource=undefined\",\n );\n });\n\n it(\"should throw when has getResource but not listResources\", () => {\n const listResources = undefined;\n const getResource = async () => ({\n contents: [\n {\n uri: \"https://resource\",\n mimeType: \"text/plain\",\n text: \"test\",\n },\n ],\n });\n\n expect(() => {\n validateResourceSource(listResources, getResource);\n }).toThrow(\n \"Both listResources and getResource must be provided together, or neither should be provided. \" +\n \"Got: listResources=undefined, getResource=defined\",\n );\n });\n\n it(\"should not throw when both listResources and getResource are provided\", () => {\n const listResources = async () => [];\n const getResource = async () => ({\n contents: [\n {\n uri: \"https://resource\",\n mimeType: \"text/plain\",\n text: \"test\",\n },\n ],\n });\n\n expect(() => {\n validateResourceSource(listResources, getResource);\n }).not.toThrow();\n });\n\n it(\"should not throw when neither listResources nor getResource are provided\", () => {\n const listResources = undefined;\n const getResource = undefined;\n\n expect(() => {\n validateResourceSource(listResources, getResource);\n }).not.toThrow();\n });\n});\n\ndescribe(\"validateResource\", () => {\n it(\"should throw when resource is missing uri field\", () => {\n const resource = {\n name: \"Test Resource\",\n } as ListResourceItem;\n\n expect(() => {\n validateResource(resource);\n }).toThrow(\"Resource must have a 'uri' field\");\n });\n\n it(\"should throw when resource is missing name field\", () => {\n const resource = {\n uri: \"https://resource\",\n } as ListResourceItem;\n\n expect(() => {\n validateResource(resource);\n }).toThrow(\"Resource with URI 'https://resource' must have a 'name' field\");\n });\n\n it(\"should not throw when resource has both uri and name fields\", () => {\n const resource: ListResourceItem = {\n uri: \"https://resource\",\n name: \"Test Resource\",\n };\n\n expect(() => {\n validateResource(resource);\n }).not.toThrow();\n });\n\n it(\"should not throw when resource has uri, name, and optional fields\", () => {\n const resource: ListResourceItem = {\n uri: \"https://resource\",\n name: \"Test Resource\",\n description: \"A test resource\",\n mimeType: \"text/plain\",\n };\n\n expect(() => {\n validateResource(resource);\n }).not.toThrow();\n });\n});\n"]}
|
|
@@ -2,11 +2,11 @@ import TamboAI from "@tambo-ai/typescript-sdk";
|
|
|
2
2
|
import { TamboTool, TamboToolRegistry, TamboToolWithToolSchema } from "../model/component-metadata";
|
|
3
3
|
/**
|
|
4
4
|
* Process a message from the thread, invoking the appropriate tool and returning the result.
|
|
5
|
-
* @param
|
|
5
|
+
* @param toolCallRequest - The message to handle
|
|
6
6
|
* @param toolRegistry - The tool registry
|
|
7
7
|
* @returns The result of the tool call along with the tool definition
|
|
8
8
|
*/
|
|
9
|
-
export declare const handleToolCall: (
|
|
9
|
+
export declare const handleToolCall: (toolCallRequest: TamboAI.ToolCallRequest, toolRegistry: TamboToolRegistry, onCallUnregisteredTool?: (toolName: string, args: TamboAI.ToolCallParameter[]) => Promise<string>) => Promise<{
|
|
10
10
|
result: unknown;
|
|
11
11
|
error?: string;
|
|
12
12
|
tamboTool?: TamboTool | TamboToolWithToolSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-caller.d.ts","sourceRoot":"","sources":["../../src/util/tool-caller.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAEL,SAAS,EACT,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,6BAA6B,CAAC;AAIrC;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GACzB,
|
|
1
|
+
{"version":3,"file":"tool-caller.d.ts","sourceRoot":"","sources":["../../src/util/tool-caller.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAEL,SAAS,EACT,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,6BAA6B,CAAC;AAIrC;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GACzB,iBAAiB,OAAO,CAAC,eAAe,EACxC,cAAc,iBAAiB,EAC/B,yBAAyB,CACvB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,OAAO,CAAC,iBAAiB,EAAE,KAC9B,OAAO,CAAC,MAAM,CAAC,KACnB,OAAO,CAAC;IACT,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,SAAS,GAAG,uBAAuB,CAAC;CACjD,CAiCA,CAAC"}
|
package/dist/util/tool-caller.js
CHANGED
|
@@ -5,34 +5,34 @@ const schema_1 = require("../schema");
|
|
|
5
5
|
const registry_1 = require("./registry");
|
|
6
6
|
/**
|
|
7
7
|
* Process a message from the thread, invoking the appropriate tool and returning the result.
|
|
8
|
-
* @param
|
|
8
|
+
* @param toolCallRequest - The message to handle
|
|
9
9
|
* @param toolRegistry - The tool registry
|
|
10
10
|
* @returns The result of the tool call along with the tool definition
|
|
11
11
|
*/
|
|
12
|
-
const handleToolCall = async (
|
|
13
|
-
if (!
|
|
12
|
+
const handleToolCall = async (toolCallRequest, toolRegistry, onCallUnregisteredTool) => {
|
|
13
|
+
if (!toolCallRequest?.toolName) {
|
|
14
14
|
throw new Error("Tool name is required");
|
|
15
15
|
}
|
|
16
16
|
try {
|
|
17
|
-
const { tool, tamboTool } = findTool(
|
|
17
|
+
const { tool, tamboTool } = findTool(toolCallRequest.toolName, toolRegistry);
|
|
18
18
|
if (!tool) {
|
|
19
19
|
if (onCallUnregisteredTool) {
|
|
20
|
-
const result = await onCallUnregisteredTool(
|
|
20
|
+
const result = await onCallUnregisteredTool(toolCallRequest.toolName, toolCallRequest.parameters);
|
|
21
21
|
return {
|
|
22
22
|
result,
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
throw new Error(`Tool ${
|
|
25
|
+
throw new Error(`Tool ${toolCallRequest.toolName} not found in registry`);
|
|
26
26
|
}
|
|
27
27
|
return {
|
|
28
|
-
result: await runToolChoice(
|
|
28
|
+
result: await runToolChoice(toolCallRequest, tool, tamboTool),
|
|
29
29
|
tamboTool,
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
catch (error) {
|
|
33
33
|
console.error("Error in calling tool: ", error);
|
|
34
34
|
return {
|
|
35
|
-
result: `When attempting to call tool ${
|
|
35
|
+
result: `When attempting to call tool ${toolCallRequest.toolName} the following error occurred: ${error}. Explain to the user that the tool call failed and try again if needed.`,
|
|
36
36
|
error: error instanceof Error ? error.message : "Unknown error",
|
|
37
37
|
};
|
|
38
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-caller.js","sourceRoot":"","sources":["../../src/util/tool-caller.ts"],"names":[],"mappings":";;;AAOA,sCAA2C;AAC3C,yCAAuD;AAEvD;;;;;GAKG;AACI,MAAM,cAAc,GAAG,KAAK,EACjC,
|
|
1
|
+
{"version":3,"file":"tool-caller.js","sourceRoot":"","sources":["../../src/util/tool-caller.ts"],"names":[],"mappings":";;;AAOA,sCAA2C;AAC3C,yCAAuD;AAEvD;;;;;GAKG;AACI,MAAM,cAAc,GAAG,KAAK,EACjC,eAAwC,EACxC,YAA+B,EAC/B,sBAGoB,EAKnB,EAAE;IACH,IAAI,CAAC,eAAe,EAAE,QAAQ,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC3C,CAAC;IAED,IAAI,CAAC;QACH,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,QAAQ,CAClC,eAAe,CAAC,QAAQ,EACxB,YAAY,CACb,CAAC;QACF,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,IAAI,sBAAsB,EAAE,CAAC;gBAC3B,MAAM,MAAM,GAAG,MAAM,sBAAsB,CACzC,eAAe,CAAC,QAAQ,EACxB,eAAe,CAAC,UAAU,CAC3B,CAAC;gBACF,OAAO;oBACL,MAAM;iBACP,CAAC;YACJ,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,QAAQ,eAAe,CAAC,QAAQ,wBAAwB,CAAC,CAAC;QAC5E,CAAC;QACD,OAAO;YACL,MAAM,EAAE,MAAM,aAAa,CAAC,eAAe,EAAE,IAAI,EAAE,SAAS,CAAC;YAC7D,SAAS;SACV,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;QAChD,OAAO;YACL,MAAM,EAAE,gCAAgC,eAAe,CAAC,QAAQ,kCAAkC,KAAK,0EAA0E;YACjL,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;SAChE,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AA5CW,QAAA,cAAc,kBA4CzB;AAEF,MAAM,QAAQ,GAAG,CACf,QAAgB,EAChB,YAA+B,EAMG,EAAE;IACpC,MAAM,YAAY,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;IAE5C,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IACzC,CAAC;IAED,MAAM,WAAW,GAAG,IAAA,oCAAyB,EAAC,YAAY,CAAC,CAAC;IAC5D,OAAO;QACL,IAAI,EAAE;YACJ,mBAAmB,EAAE,YAAY,CAAC,IAAI;YACtC,UAAU,EAAE,WAAW;SACxB;QACD,SAAS,EAAE,YAAY;KACxB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,KAAK,EACzB,eAAwC,EACxC,IAA0B,EAC1B,SAA8C,EAC5B,EAAE;IACpB,MAAM,UAAU,GAAG,eAAe,CAAC,UAAU,IAAI,EAAE,CAAC;IAEpD,2DAA2D;IAC3D,IAAI,IAAA,uBAAc,EAAC,SAAS,CAAC,EAAE,CAAC;QAC9B,yDAAyD;QACzD,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CACpC,UAAU,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,CACvE,CAAC;QACF,OAAO,MAAM,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;IACrD,CAAC;IAED,iEAAiE;IACjE,MAAM,eAAe,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IACxE,OAAO,MAAM,IAAI,CAAC,mBAAmB,CAAC,GAAG,eAAe,CAAC,CAAC;AAC5D,CAAC,CAAC","sourcesContent":["import TamboAI from \"@tambo-ai/typescript-sdk\";\nimport {\n ComponentContextTool,\n TamboTool,\n TamboToolRegistry,\n TamboToolWithToolSchema,\n} from \"../model/component-metadata\";\nimport { hasInputSchema } from \"../schema\";\nimport { mapTamboToolToContextTool } from \"./registry\";\n\n/**\n * Process a message from the thread, invoking the appropriate tool and returning the result.\n * @param toolCallRequest - The message to handle\n * @param toolRegistry - The tool registry\n * @returns The result of the tool call along with the tool definition\n */\nexport const handleToolCall = async (\n toolCallRequest: TamboAI.ToolCallRequest,\n toolRegistry: TamboToolRegistry,\n onCallUnregisteredTool?: (\n toolName: string,\n args: TamboAI.ToolCallParameter[],\n ) => Promise<string>,\n): Promise<{\n result: unknown;\n error?: string;\n tamboTool?: TamboTool | TamboToolWithToolSchema;\n}> => {\n if (!toolCallRequest?.toolName) {\n throw new Error(\"Tool name is required\");\n }\n\n try {\n const { tool, tamboTool } = findTool(\n toolCallRequest.toolName,\n toolRegistry,\n );\n if (!tool) {\n if (onCallUnregisteredTool) {\n const result = await onCallUnregisteredTool(\n toolCallRequest.toolName,\n toolCallRequest.parameters,\n );\n return {\n result,\n };\n }\n throw new Error(`Tool ${toolCallRequest.toolName} not found in registry`);\n }\n return {\n result: await runToolChoice(toolCallRequest, tool, tamboTool),\n tamboTool,\n };\n } catch (error) {\n console.error(\"Error in calling tool: \", error);\n return {\n result: `When attempting to call tool ${toolCallRequest.toolName} the following error occurred: ${error}. Explain to the user that the tool call failed and try again if needed.`,\n error: error instanceof Error ? error.message : \"Unknown error\",\n };\n }\n};\n\nconst findTool = (\n toolName: string,\n toolRegistry: TamboToolRegistry,\n):\n | {\n tool: ComponentContextTool;\n tamboTool: TamboTool | TamboToolWithToolSchema;\n }\n | { tool: null; tamboTool: null } => {\n const registryTool = toolRegistry[toolName];\n\n if (!registryTool) {\n return { tool: null, tamboTool: null };\n }\n\n const contextTool = mapTamboToolToContextTool(registryTool);\n return {\n tool: {\n getComponentContext: registryTool.tool,\n definition: contextTool,\n },\n tamboTool: registryTool,\n };\n};\n\nconst runToolChoice = async (\n toolCallRequest: TamboAI.ToolCallRequest,\n tool: ComponentContextTool,\n tamboTool: TamboTool | TamboToolWithToolSchema,\n): Promise<unknown> => {\n const parameters = toolCallRequest.parameters ?? [];\n\n // New interface (inputSchema): pass single object argument\n if (hasInputSchema(tamboTool)) {\n // Reconstruct the object from parameter name-value pairs\n const inputObject = Object.fromEntries(\n parameters.map((param) => [param.parameterName, param.parameterValue]),\n );\n return await tool.getComponentContext(inputObject);\n }\n\n // Deprecated interface (toolSchema): spread positional arguments\n const parameterValues = parameters.map((param) => param.parameterValue);\n return await tool.getComponentContext(...parameterValues);\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-component-name.test.d.ts","sourceRoot":"","sources":["../../src/util/validate-component-name.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const validate_component_name_1 = require("./validate-component-name");
|
|
4
|
+
describe("assertValidName", () => {
|
|
5
|
+
// Valid names
|
|
6
|
+
it("should not throw an error for a valid name with letters only", () => {
|
|
7
|
+
expect(() => (0, validate_component_name_1.assertValidName)("MyComponent", "component")).not.toThrow();
|
|
8
|
+
});
|
|
9
|
+
it("should not throw an error for letters, numbers, underscore", () => {
|
|
10
|
+
expect(() => (0, validate_component_name_1.assertValidName)("component_123", "component")).not.toThrow();
|
|
11
|
+
});
|
|
12
|
+
it("should not throw an error for letters, numbers, hyphen", () => {
|
|
13
|
+
expect(() => (0, validate_component_name_1.assertValidName)("tool-456", "tool")).not.toThrow();
|
|
14
|
+
});
|
|
15
|
+
it("should not throw an error for mix of letters, numbers, underscores, hyphens", () => {
|
|
16
|
+
expect(() => (0, validate_component_name_1.assertValidName)("A1_b-2C", "component")).not.toThrow();
|
|
17
|
+
});
|
|
18
|
+
it("should not throw an error with single underscore, and hyphen", () => {
|
|
19
|
+
expect(() => (0, validate_component_name_1.assertValidName)("_", "tool")).not.toThrow();
|
|
20
|
+
expect(() => (0, validate_component_name_1.assertValidName)("-", "tool")).not.toThrow();
|
|
21
|
+
});
|
|
22
|
+
// Invalid names
|
|
23
|
+
it("should throw an error for name with space", () => {
|
|
24
|
+
expect(() => (0, validate_component_name_1.assertValidName)("My Component", "component")).toThrow(`component "My Component" must only contain letters, numbers, underscores, and hyphens.`);
|
|
25
|
+
});
|
|
26
|
+
it("should throw an error for name with special characters", () => {
|
|
27
|
+
expect(() => (0, validate_component_name_1.assertValidName)("tool@123", "tool")).toThrow(`tool "tool@123" must only contain letters, numbers, underscores, and hyphens.`);
|
|
28
|
+
expect(() => (0, validate_component_name_1.assertValidName)("component!$", "component")).toThrow(`component "component!$" must only contain letters, numbers, underscores, and hyphens.`);
|
|
29
|
+
});
|
|
30
|
+
// Edge Cases
|
|
31
|
+
it("should throw an error for name with empty string", () => {
|
|
32
|
+
expect(() => (0, validate_component_name_1.assertValidName)("", "component")).toThrow(`component "" must only contain letters, numbers, underscores, and hyphens.`);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=validate-component-name.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-component-name.test.js","sourceRoot":"","sources":["../../src/util/validate-component-name.test.ts"],"names":[],"mappings":";;AAAA,uEAA4D;AAC5D,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,cAAc;IACd,EAAE,CAAC,8DAA8D,EAAE,GAAG,EAAE;QACtE,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,yCAAe,EAAC,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IAC1E,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,4DAA4D,EAAE,GAAG,EAAE;QACpE,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,yCAAe,EAAC,eAAe,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IAC5E,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,wDAAwD,EAAE,GAAG,EAAE;QAChE,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,yCAAe,EAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IAClE,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,6EAA6E,EAAE,GAAG,EAAE;QACrF,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,yCAAe,EAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IACtE,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,8DAA8D,EAAE,GAAG,EAAE;QACtE,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,yCAAe,EAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;QACzD,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,yCAAe,EAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IAC3D,CAAC,CAAC,CAAC;IACH,gBAAgB;IAChB,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;QACnD,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,yCAAe,EAAC,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC,OAAO,CAChE,wFAAwF,CACzF,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,wDAAwD,EAAE,GAAG,EAAE;QAChE,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,yCAAe,EAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CACvD,+EAA+E,CAChF,CAAC;QACF,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,yCAAe,EAAC,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC,OAAO,CAC/D,uFAAuF,CACxF,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,aAAa;IACb,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;QAC1D,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,yCAAe,EAAC,EAAE,EAAE,WAAW,CAAC,CAAC,CAAC,OAAO,CACpD,4EAA4E,CAC7E,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { assertValidName } from \"./validate-component-name\";\ndescribe(\"assertValidName\", () => {\n // Valid names\n it(\"should not throw an error for a valid name with letters only\", () => {\n expect(() => assertValidName(\"MyComponent\", \"component\")).not.toThrow();\n });\n it(\"should not throw an error for letters, numbers, underscore\", () => {\n expect(() => assertValidName(\"component_123\", \"component\")).not.toThrow();\n });\n it(\"should not throw an error for letters, numbers, hyphen\", () => {\n expect(() => assertValidName(\"tool-456\", \"tool\")).not.toThrow();\n });\n it(\"should not throw an error for mix of letters, numbers, underscores, hyphens\", () => {\n expect(() => assertValidName(\"A1_b-2C\", \"component\")).not.toThrow();\n });\n it(\"should not throw an error with single underscore, and hyphen\", () => {\n expect(() => assertValidName(\"_\", \"tool\")).not.toThrow();\n expect(() => assertValidName(\"-\", \"tool\")).not.toThrow();\n });\n // Invalid names\n it(\"should throw an error for name with space\", () => {\n expect(() => assertValidName(\"My Component\", \"component\")).toThrow(\n `component \"My Component\" must only contain letters, numbers, underscores, and hyphens.`,\n );\n });\n it(\"should throw an error for name with special characters\", () => {\n expect(() => assertValidName(\"tool@123\", \"tool\")).toThrow(\n `tool \"tool@123\" must only contain letters, numbers, underscores, and hyphens.`,\n );\n expect(() => assertValidName(\"component!$\", \"component\")).toThrow(\n `component \"component!$\" must only contain letters, numbers, underscores, and hyphens.`,\n );\n });\n // Edge Cases\n it(\"should throw an error for name with empty string\", () => {\n expect(() => assertValidName(\"\", \"component\")).toThrow(\n `component \"\" must only contain letters, numbers, underscores, and hyphens.`,\n );\n });\n});\n"]}
|
|
@@ -11,11 +11,17 @@ describe("Context Helpers (prebuilt functions)", () => {
|
|
|
11
11
|
const context = currentTimeContextHelper();
|
|
12
12
|
// Should not be null (error case)
|
|
13
13
|
expect(context).not.toBeNull();
|
|
14
|
+
// Type guard: ensure context is an object
|
|
15
|
+
expect(typeof context).toBe("object");
|
|
16
|
+
if (typeof context !== "object" || context === null) {
|
|
17
|
+
throw new Error("Expected context to be a non-null object");
|
|
18
|
+
}
|
|
14
19
|
// Shape: { timestamp: string }
|
|
15
20
|
expect(context).toHaveProperty("timestamp");
|
|
16
|
-
|
|
21
|
+
const contextObj = context;
|
|
22
|
+
expect(typeof contextObj.timestamp).toBe("string");
|
|
17
23
|
// Verify timestamp string parses
|
|
18
|
-
expect(() => new Date(
|
|
24
|
+
expect(() => new Date(contextObj.timestamp)).not.toThrow();
|
|
19
25
|
});
|
|
20
26
|
});
|
|
21
27
|
describe("currentPageContextHelper", () => {
|
|
@@ -26,11 +32,17 @@ describe("Context Helpers (prebuilt functions)", () => {
|
|
|
26
32
|
expect(context).toBeNull();
|
|
27
33
|
return;
|
|
28
34
|
}
|
|
35
|
+
// Type guard: ensure context is an object
|
|
36
|
+
expect(typeof context).toBe("object");
|
|
37
|
+
if (typeof context !== "object") {
|
|
38
|
+
throw new Error("Expected context to be an object");
|
|
39
|
+
}
|
|
29
40
|
// Shape: { url: string, title: string }
|
|
30
41
|
expect(context).toHaveProperty("url");
|
|
31
42
|
expect(context).toHaveProperty("title");
|
|
32
|
-
|
|
33
|
-
expect(typeof
|
|
43
|
+
const contextObj = context;
|
|
44
|
+
expect(typeof contextObj.url).toBe("string");
|
|
45
|
+
expect(typeof contextObj.title).toBe("string");
|
|
34
46
|
});
|
|
35
47
|
});
|
|
36
48
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-helpers.test.js","sourceRoot":"","sources":["../../src/context-helpers/context-helpers.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAE7E;;;;;GAKG;AACH,QAAQ,CAAC,sCAAsC,EAAE,GAAG,EAAE;IACpD,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;QACxC,EAAE,CAAC,sDAAsD,EAAE,GAAG,EAAE;YAC9D,MAAM,OAAO,GAAG,wBAAwB,EAAE,CAAC;YAE3C,kCAAkC;YAClC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;YAE/B,+BAA+B;YAC/B,MAAM,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;YAC5C,MAAM,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"context-helpers.test.js","sourceRoot":"","sources":["../../src/context-helpers/context-helpers.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAE7E;;;;;GAKG;AACH,QAAQ,CAAC,sCAAsC,EAAE,GAAG,EAAE;IACpD,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;QACxC,EAAE,CAAC,sDAAsD,EAAE,GAAG,EAAE;YAC9D,MAAM,OAAO,GAAG,wBAAwB,EAAE,CAAC;YAE3C,kCAAkC;YAClC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;YAE/B,0CAA0C;YAC1C,MAAM,CAAC,OAAO,OAAO,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACtC,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;gBACpD,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;YAC9D,CAAC;YAED,+BAA+B;YAC/B,MAAM,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;YAC5C,MAAM,UAAU,GAAG,OAAkC,CAAC;YACtD,MAAM,CAAC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAEnD,iCAAiC;YACjC,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,SAAmB,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;QACvE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;QACxC,EAAE,CAAC,0DAA0D,EAAE,GAAG,EAAE;YAClE,MAAM,OAAO,GAAG,wBAAwB,EAAE,CAAC;YAE3C,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;gBACrB,sDAAsD;gBACtD,MAAM,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC;gBAC3B,OAAO;YACT,CAAC;YAED,0CAA0C;YAC1C,MAAM,CAAC,OAAO,OAAO,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACtC,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;gBAChC,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;YACtD,CAAC;YAED,wCAAwC;YACxC,MAAM,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;YACtC,MAAM,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;YAExC,MAAM,UAAU,GAAG,OAAkC,CAAC;YACtD,MAAM,CAAC,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC7C,MAAM,CAAC,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACjD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { currentPageContextHelper, currentTimeContextHelper } from \"./index\";\n\n/**\n * Tests for prebuilt context helper functions.\n *\n * These helpers now return raw values (or null) instead of { name, context }.\n * The provider is responsible for wrapping values as { name, context }.\n */\ndescribe(\"Context Helpers (prebuilt functions)\", () => {\n describe(\"currentTimeContextHelper\", () => {\n it(\"should return user time context with required fields\", () => {\n const context = currentTimeContextHelper();\n\n // Should not be null (error case)\n expect(context).not.toBeNull();\n\n // Type guard: ensure context is an object\n expect(typeof context).toBe(\"object\");\n if (typeof context !== \"object\" || context === null) {\n throw new Error(\"Expected context to be a non-null object\");\n }\n\n // Shape: { timestamp: string }\n expect(context).toHaveProperty(\"timestamp\");\n const contextObj = context as Record<string, unknown>;\n expect(typeof contextObj.timestamp).toBe(\"string\");\n\n // Verify timestamp string parses\n expect(() => new Date(contextObj.timestamp as string)).not.toThrow();\n });\n });\n\n describe(\"currentPageContextHelper\", () => {\n it(\"should return page context in browser, or null otherwise\", () => {\n const context = currentPageContextHelper();\n\n if (context === null) {\n // Non-browser environments should return null to skip\n expect(context).toBeNull();\n return;\n }\n\n // Type guard: ensure context is an object\n expect(typeof context).toBe(\"object\");\n if (typeof context !== \"object\") {\n throw new Error(\"Expected context to be an object\");\n }\n\n // Shape: { url: string, title: string }\n expect(context).toHaveProperty(\"url\");\n expect(context).toHaveProperty(\"title\");\n\n const contextObj = context as Record<string, unknown>;\n expect(typeof contextObj.url).toBe(\"string\");\n expect(typeof contextObj.title).toBe(\"string\");\n });\n });\n});\n"]}
|
|
@@ -22,7 +22,7 @@ export declare const currentInteractablesContextHelper: ContextHelperFn;
|
|
|
22
22
|
* Creates an interactables context helper with access to the current components.
|
|
23
23
|
* This is used internally by TamboInteractableProvider.
|
|
24
24
|
* @param components Array of interactable components
|
|
25
|
-
* @returns
|
|
25
|
+
* @returns A context helper function that returns component metadata or null if no components exist
|
|
26
26
|
*/
|
|
27
|
-
export declare const createInteractablesContextHelper: (components:
|
|
27
|
+
export declare const createInteractablesContextHelper: (components: unknown[]) => ContextHelperFn;
|
|
28
28
|
//# sourceMappingURL=current-interactables-context-helper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"current-interactables-context-helper.d.ts","sourceRoot":"","sources":["../../src/context-helpers/current-interactables-context-helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,iCAAiC,EAAE,eAI/C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC,GAC3C,YAAY,
|
|
1
|
+
{"version":3,"file":"current-interactables-context-helper.d.ts","sourceRoot":"","sources":["../../src/context-helpers/current-interactables-context-helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,iCAAiC,EAAE,eAI/C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC,GAC3C,YAAY,OAAO,EAAE,KACpB,eAyCF,CAAC"}
|
|
@@ -25,7 +25,7 @@ export const currentInteractablesContextHelper = () => {
|
|
|
25
25
|
* Creates an interactables context helper with access to the current components.
|
|
26
26
|
* This is used internally by TamboInteractableProvider.
|
|
27
27
|
* @param components Array of interactable components
|
|
28
|
-
* @returns
|
|
28
|
+
* @returns A context helper function that returns component metadata or null if no components exist
|
|
29
29
|
*/
|
|
30
30
|
export const createInteractablesContextHelper = (components) => {
|
|
31
31
|
return () => {
|
|
@@ -33,17 +33,36 @@ export const createInteractablesContextHelper = (components) => {
|
|
|
33
33
|
return null; // No interactable components on the page
|
|
34
34
|
}
|
|
35
35
|
return {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
36
|
+
components: components.map((component) => {
|
|
37
|
+
// Type guard: ensure component is an object with the expected properties
|
|
38
|
+
if (typeof component !== "object" || component === null) {
|
|
39
|
+
return {
|
|
40
|
+
id: "unknown",
|
|
41
|
+
componentName: "unknown",
|
|
42
|
+
description: "invalid component",
|
|
43
|
+
props: undefined,
|
|
44
|
+
propsSchema: "Not specified",
|
|
45
|
+
state: undefined,
|
|
46
|
+
isSelectedForInteraction: false,
|
|
47
|
+
stateSchema: "Not specified",
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
const comp = component;
|
|
51
|
+
return {
|
|
52
|
+
id: String(comp.id ?? "unknown"),
|
|
53
|
+
componentName: String(comp.name ?? "unknown"),
|
|
54
|
+
description: String(comp.description ?? ""),
|
|
55
|
+
props: comp.props,
|
|
56
|
+
propsSchema: comp.propsSchema
|
|
57
|
+
? "Available - use component-specific update tools"
|
|
58
|
+
: "Not specified",
|
|
59
|
+
state: comp.state,
|
|
60
|
+
isSelectedForInteraction: comp.isSelectedForInteraction ?? false,
|
|
61
|
+
stateSchema: comp.stateSchema
|
|
62
|
+
? "Available - use component-specific update tools"
|
|
63
|
+
: "Not specified",
|
|
64
|
+
};
|
|
65
|
+
}),
|
|
47
66
|
};
|
|
48
67
|
};
|
|
49
68
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"current-interactables-context-helper.js","sourceRoot":"","sources":["../../src/context-helpers/current-interactables-context-helper.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAoB,GAAG,EAAE;IACrE,mFAAmF;IACnF,wEAAwE;IACxE,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAC9C,
|
|
1
|
+
{"version":3,"file":"current-interactables-context-helper.js","sourceRoot":"","sources":["../../src/context-helpers/current-interactables-context-helper.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAoB,GAAG,EAAE;IACrE,mFAAmF;IACnF,wEAAwE;IACxE,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAC9C,UAAqB,EACJ,EAAE;IACnB,OAAO,GAAG,EAAE;QACV,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC1D,OAAO,IAAI,CAAC,CAAC,yCAAyC;QACxD,CAAC;QAED,OAAO;YACL,UAAU,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE;gBACvC,yEAAyE;gBACzE,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;oBACxD,OAAO;wBACL,EAAE,EAAE,SAAS;wBACb,aAAa,EAAE,SAAS;wBACxB,WAAW,EAAE,mBAAmB;wBAChC,KAAK,EAAE,SAAS;wBAChB,WAAW,EAAE,eAAe;wBAC5B,KAAK,EAAE,SAAS;wBAChB,wBAAwB,EAAE,KAAK;wBAC/B,WAAW,EAAE,eAAe;qBAC7B,CAAC;gBACJ,CAAC;gBAED,MAAM,IAAI,GAAG,SAAoC,CAAC;gBAClD,OAAO;oBACL,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,SAAS,CAAC;oBAChC,aAAa,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,SAAS,CAAC;oBAC7C,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC;oBAC3C,KAAK,EAAE,IAAI,CAAC,KAAK;oBACjB,WAAW,EAAE,IAAI,CAAC,WAAW;wBAC3B,CAAC,CAAC,iDAAiD;wBACnD,CAAC,CAAC,eAAe;oBACnB,KAAK,EAAE,IAAI,CAAC,KAAK;oBACjB,wBAAwB,EACrB,IAAI,CAAC,wBAAgD,IAAI,KAAK;oBACjE,WAAW,EAAE,IAAI,CAAC,WAAW;wBAC3B,CAAC,CAAC,iDAAiD;wBACnD,CAAC,CAAC,eAAe;iBACpB,CAAC;YACJ,CAAC,CAAC;SACH,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { ContextHelperFn } from \"./types\";\n\n/**\n * Prebuilt context helper that provides information about all interactable components currently on the page.\n * This gives the AI awareness of what components it can interact with and their current state.\n * @returns an object with description and components, or null to skip including this context.\n * To disable this helper, override it with a function that returns null:\n * @example\n * ```tsx\n * // To disable the default interactables context\n * const { addContextHelper } = useTamboContextHelpers();\n * addContextHelper(\"interactables\", () => null);\n *\n * // To customize the context\n * addContextHelper(\"interactables\", () => ({\n * description: \"Custom description\",\n * components: getCustomComponentsSubset()\n * }));\n * ```\n */\nexport const currentInteractablesContextHelper: ContextHelperFn = () => {\n // This will be provided by the interactable provider when it registers this helper\n // Since we're provider-only now, this function gets replaced at runtime\n return null;\n};\n\n/**\n * Creates an interactables context helper with access to the current components.\n * This is used internally by TamboInteractableProvider.\n * @param components Array of interactable components\n * @returns A context helper function that returns component metadata or null if no components exist\n */\nexport const createInteractablesContextHelper = (\n components: unknown[],\n): ContextHelperFn => {\n return () => {\n if (!Array.isArray(components) || components.length === 0) {\n return null; // No interactable components on the page\n }\n\n return {\n components: components.map((component) => {\n // Type guard: ensure component is an object with the expected properties\n if (typeof component !== \"object\" || component === null) {\n return {\n id: \"unknown\",\n componentName: \"unknown\",\n description: \"invalid component\",\n props: undefined,\n propsSchema: \"Not specified\",\n state: undefined,\n isSelectedForInteraction: false,\n stateSchema: \"Not specified\",\n };\n }\n\n const comp = component as Record<string, unknown>;\n return {\n id: String(comp.id ?? \"unknown\"),\n componentName: String(comp.name ?? \"unknown\"),\n description: String(comp.description ?? \"\"),\n props: comp.props,\n propsSchema: comp.propsSchema\n ? \"Available - use component-specific update tools\"\n : \"Not specified\",\n state: comp.state,\n isSelectedForInteraction:\n (comp.isSelectedForInteraction as boolean | undefined) ?? false,\n stateSchema: comp.stateSchema\n ? \"Available - use component-specific update tools\"\n : \"Not specified\",\n };\n }),\n };\n };\n};\n"]}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* Global context helpers registry.
|
|
3
3
|
* Consumers can add/remove helpers and resolve additional context anywhere.
|
|
4
4
|
*/
|
|
5
|
-
export type HelperFn = () =>
|
|
5
|
+
export type HelperFn = () => unknown | null | undefined | Promise<unknown | null | undefined>;
|
|
6
6
|
/**
|
|
7
7
|
* Resolve all helpers to AdditionalContext entries, skipping null/undefined and errors.
|
|
8
8
|
* @returns The resolved additional context.
|
|
9
9
|
*/
|
|
10
10
|
export declare function resolveAdditionalContext(helpers: Record<string, HelperFn>): Promise<{
|
|
11
11
|
name: string;
|
|
12
|
-
context:
|
|
12
|
+
context: unknown;
|
|
13
13
|
}[]>;
|
|
14
14
|
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/context-helpers/registry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,QAAQ,GAAG,MACnB,
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/context-helpers/registry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,QAAQ,GAAG,MACnB,OAAO,GACP,IAAI,GACJ,SAAS,GACT,OAAO,CAAC,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;AAExC;;;GAGG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAChC,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,EAAE,CAAC,CAkB/C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/context-helpers/registry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,OAAiC;IAEjC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACxC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEpC,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAC/B,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE;QAC/B,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,MAAM,EAAE,EAAE,CAAC;YACzB,IAAI,KAAK,IAAI,IAAI;gBAAE,OAAO,IAAI,CAAC;YAC/B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QAClC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,gCAAgC,IAAI,GAAG,EAAE,KAAK,CAAC,CAAC;YAC9D,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC,CAAC,CACH,CAAC;IAEF,OAAO,OAAO,CAAC,MAAM,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/context-helpers/registry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,OAAiC;IAEjC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACxC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEpC,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAC/B,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE;QAC/B,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,MAAM,EAAE,EAAE,CAAC;YACzB,IAAI,KAAK,IAAI,IAAI;gBAAE,OAAO,IAAI,CAAC;YAC/B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QAClC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,gCAAgC,IAAI,GAAG,EAAE,KAAK,CAAC,CAAC;YAC9D,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC,CAAC,CACH,CAAC;IAEF,OAAO,OAAO,CAAC,MAAM,CAAC,OAAO,CAAyC,CAAC;AACzE,CAAC","sourcesContent":["/**\n * Global context helpers registry.\n * Consumers can add/remove helpers and resolve additional context anywhere.\n */\n\nexport type HelperFn = () =>\n | unknown\n | null\n | undefined\n | Promise<unknown | null | undefined>;\n\n/**\n * Resolve all helpers to AdditionalContext entries, skipping null/undefined and errors.\n * @returns The resolved additional context.\n */\nexport async function resolveAdditionalContext(\n helpers: Record<string, HelperFn>,\n): Promise<{ name: string; context: unknown }[]> {\n const entries = Object.entries(helpers);\n if (entries.length === 0) return [];\n\n const results = await Promise.all(\n entries.map(async ([name, fn]) => {\n try {\n const value = await fn();\n if (value == null) return null;\n return { name, context: value };\n } catch (error) {\n console.error(`Error running context helper ${name}:`, error);\n return null;\n }\n }),\n );\n\n return results.filter(Boolean) as { name: string; context: unknown }[];\n}\n"]}
|
|
@@ -5,13 +5,13 @@ export interface AdditionalContext {
|
|
|
5
5
|
/** The name of the context type */
|
|
6
6
|
name: string;
|
|
7
7
|
/** The context data */
|
|
8
|
-
context:
|
|
8
|
+
context: unknown;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* A context helper is a function that returns data to include in the context,
|
|
12
12
|
* or null/undefined to skip including anything.
|
|
13
13
|
*/
|
|
14
|
-
export type ContextHelperFn = () =>
|
|
14
|
+
export type ContextHelperFn = () => unknown | null | undefined | Promise<unknown | null | undefined>;
|
|
15
15
|
/**
|
|
16
16
|
* A collection of context helpers keyed by their context name.
|
|
17
17
|
* The key becomes the AdditionalContext.name sent to the model.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/context-helpers/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,uBAAuB;IACvB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/context-helpers/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,uBAAuB;IACvB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,MAC1B,OAAO,GACP,IAAI,GACJ,SAAS,GACT,OAAO,CAAC,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;AAExC;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/context-helpers/types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Interface for additional context that can be added to messages\n */\nexport interface AdditionalContext {\n /** The name of the context type */\n name: string;\n /** The context data */\n context:
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/context-helpers/types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Interface for additional context that can be added to messages\n */\nexport interface AdditionalContext {\n /** The name of the context type */\n name: string;\n /** The context data */\n context: unknown;\n}\n\n/**\n * A context helper is a function that returns data to include in the context,\n * or null/undefined to skip including anything.\n */\nexport type ContextHelperFn = () =>\n | unknown\n | null\n | undefined\n | Promise<unknown | null | undefined>;\n\n/**\n * A collection of context helpers keyed by their context name.\n * The key becomes the AdditionalContext.name sent to the model.\n */\nexport type ContextHelpers = Record<string, ContextHelperFn>;\n"]}
|
|
@@ -1,14 +1,47 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { SupportedSchema } from "../schema";
|
|
3
|
-
export interface InteractableConfig {
|
|
3
|
+
export interface InteractableConfig<Props = Record<string, unknown>, State = Record<string, unknown>> {
|
|
4
|
+
/**
|
|
5
|
+
* The name of the component, used for identification in Tambo.
|
|
6
|
+
*/
|
|
4
7
|
componentName: string;
|
|
8
|
+
/**
|
|
9
|
+
* A brief description of the component's purpose and functionality. LLM will
|
|
10
|
+
* use this to understand how to interact with it.
|
|
11
|
+
*/
|
|
5
12
|
description: string;
|
|
6
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Optional schema for component props. If provided, prop updates will be
|
|
15
|
+
* validated against this schema.
|
|
16
|
+
*/
|
|
17
|
+
propsSchema?: SupportedSchema<Props>;
|
|
18
|
+
/**
|
|
19
|
+
* Optional schema for component state. If provided, state updates will be
|
|
20
|
+
* validated against this schema.
|
|
21
|
+
*/
|
|
22
|
+
stateSchema?: SupportedSchema<State>;
|
|
7
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Props injected by withTamboInteractable HOC. These can be passed to the wrapped
|
|
26
|
+
* component to customize interactable behavior.
|
|
27
|
+
*/
|
|
8
28
|
export interface WithTamboInteractableProps {
|
|
29
|
+
/**
|
|
30
|
+
* Optional ID to use for this interactable component instance.
|
|
31
|
+
* If not provided, a unique ID will be generated automatically.
|
|
32
|
+
*/
|
|
9
33
|
interactableId?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Callback fired when the component has been registered as interactable.
|
|
36
|
+
* @param id - The assigned interactable component ID
|
|
37
|
+
*/
|
|
10
38
|
onInteractableReady?: (id: string) => void;
|
|
11
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Callback fired when the component's serializable props are updated by Tambo
|
|
41
|
+
* through a tool call. Note: Only serializable props are tracked.
|
|
42
|
+
* @param newProps - The updated serializable props
|
|
43
|
+
*/
|
|
44
|
+
onPropsUpdate?: (newProps: Record<string, unknown>) => void;
|
|
12
45
|
}
|
|
13
46
|
/**
|
|
14
47
|
* Higher-Order Component that makes any component interactable by tambo.
|
|
@@ -17,6 +50,16 @@ export interface WithTamboInteractableProps {
|
|
|
17
50
|
* @returns A new component that is automatically registered as interactable
|
|
18
51
|
* @example
|
|
19
52
|
* ```tsx
|
|
53
|
+
* const MyNote: React.FC<{ title: string; content: string }> = ({ title, content }) => {
|
|
54
|
+
* const [isPinned, setIsPinned] = useTamboComponentState("isPinned", false);
|
|
55
|
+
* return (
|
|
56
|
+
* <div style={{ border: isPinned ? "2px solid gold" : "1px solid gray", order: isPinned ? -1 : 0 }}>
|
|
57
|
+
* <h2>{title}</h2>
|
|
58
|
+
* <p>{content}</p>
|
|
59
|
+
* </div>
|
|
60
|
+
* );
|
|
61
|
+
* };
|
|
62
|
+
*
|
|
20
63
|
* const MyInteractableNote = withTamboInteractable(MyNote, {
|
|
21
64
|
* componentName: "MyNote",
|
|
22
65
|
* description: "A note component",
|
|
@@ -24,11 +67,14 @@ export interface WithTamboInteractableProps {
|
|
|
24
67
|
* title: z.string(),
|
|
25
68
|
* content: z.string(),
|
|
26
69
|
* }),
|
|
70
|
+
* stateSchema: z.object({
|
|
71
|
+
* isPinned: z.boolean(),
|
|
72
|
+
* }),
|
|
27
73
|
* });
|
|
28
74
|
*
|
|
29
75
|
* // Usage
|
|
30
76
|
* <MyInteractableNote title="My Note" content="This is my note" />
|
|
31
77
|
* ```
|
|
32
78
|
*/
|
|
33
|
-
export declare function withTamboInteractable<
|
|
79
|
+
export declare function withTamboInteractable<ComponentProps extends object>(WrappedComponent: React.ComponentType<ComponentProps>, config: InteractableConfig): React.FC<ComponentProps & WithTamboInteractableProps>;
|
|
34
80
|
//# sourceMappingURL=with-tambo-interactable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-tambo-interactable.d.ts","sourceRoot":"","sources":["../../src/hoc/with-tambo-interactable.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAIxE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,MAAM,WAAW,kBAAkB;
|
|
1
|
+
{"version":3,"file":"with-tambo-interactable.d.ts","sourceRoot":"","sources":["../../src/hoc/with-tambo-interactable.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAIxE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,MAAM,WAAW,kBAAkB,CACjC,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAE/B;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC;IACrC;;;OAGG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC;CACtC;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CAC7D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,qBAAqB,CAAC,cAAc,SAAS,MAAM,EACjE,gBAAgB,EAAE,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,EACrD,MAAM,EAAE,kBAAkB,yDAsH3B"}
|