veryfront 0.0.49 → 0.0.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai/components.js +260 -56
- package/dist/ai/components.js.map +4 -4
- package/dist/ai/index.d.ts +1 -0
- package/dist/ai/index.js +12 -4
- package/dist/ai/index.js.map +2 -2
- package/dist/ai/primitives.js +55 -10
- package/dist/ai/primitives.js.map +3 -3
- package/dist/ai/react.js +140 -1
- package/dist/ai/react.js.map +3 -3
- package/dist/ai/workflow-react.js +458 -0
- package/dist/ai/workflow-react.js.map +7 -0
- package/dist/ai/workflow.js +5422 -0
- package/dist/ai/workflow.js.map +7 -0
- package/dist/cli.js +957 -221
- package/dist/components.js +12 -4
- package/dist/components.js.map +2 -2
- package/dist/config.js +12 -4
- package/dist/config.js.map +2 -2
- package/dist/data.js +12 -4
- package/dist/data.js.map +2 -2
- package/dist/index.js +12 -6
- package/dist/index.js.map +2 -2
- package/dist/integrations/_base/files/SETUP.md +667 -98
- package/dist/integrations/_base/files/app/api/integrations/token-storage/route.ts +14 -0
- package/dist/integrations/_base/files/app/components/ServiceConnections.tsx +2 -1
- package/dist/integrations/_base/files/app/setup/page.tsx +858 -54
- package/dist/integrations/_base/files/lib/token-store-examples.ts +435 -0
- package/dist/integrations/_base/files/lib/token-store.ts +273 -23
- package/dist/integrations/airtable/connector.json +99 -0
- package/dist/integrations/airtable/files/ai/tools/create-record.ts +25 -0
- package/dist/integrations/airtable/files/ai/tools/get-base.ts +34 -0
- package/dist/integrations/airtable/files/ai/tools/get-record.ts +23 -0
- package/dist/integrations/airtable/files/ai/tools/list-bases.ts +19 -0
- package/dist/integrations/airtable/files/ai/tools/list-records.ts +47 -0
- package/dist/integrations/airtable/files/app/api/auth/airtable/callback/route.ts +11 -0
- package/dist/integrations/airtable/files/app/api/auth/airtable/route.ts +9 -0
- package/dist/integrations/airtable/files/lib/airtable-client.ts +244 -0
- package/dist/integrations/airtable/files/lib/token-store.ts +5 -0
- package/dist/integrations/anthropic/README.md +181 -0
- package/dist/integrations/anthropic/connector.json +88 -0
- package/dist/integrations/anthropic/files/_env.example +4 -0
- package/dist/integrations/anthropic/files/ai/tools/get-organization.ts +36 -0
- package/dist/integrations/anthropic/files/ai/tools/get-usage.ts +100 -0
- package/dist/integrations/anthropic/files/ai/tools/list-api-keys.ts +64 -0
- package/dist/integrations/anthropic/files/ai/tools/list-members.ts +65 -0
- package/dist/integrations/anthropic/files/ai/tools/list-workspaces.ts +35 -0
- package/dist/integrations/anthropic/files/lib/anthropic-admin-client.ts +264 -0
- package/dist/integrations/asana/connector.json +85 -0
- package/dist/integrations/asana/files/_env.example +4 -0
- package/dist/integrations/asana/files/ai/tools/create-task.ts +34 -0
- package/dist/integrations/asana/files/ai/tools/get-task.ts +26 -0
- package/dist/integrations/asana/files/ai/tools/list-projects.ts +26 -0
- package/dist/integrations/asana/files/ai/tools/list-tasks.ts +50 -0
- package/dist/integrations/asana/files/ai/tools/update-task.ts +36 -0
- package/dist/integrations/asana/files/app/api/auth/asana/callback/route.ts +11 -0
- package/dist/integrations/asana/files/app/api/auth/asana/route.ts +7 -0
- package/dist/integrations/asana/files/lib/asana-client.ts +162 -0
- package/dist/integrations/asana/files/lib/token-store.ts +11 -0
- package/dist/integrations/aws/connector.json +72 -0
- package/dist/integrations/aws/files/_env.example +10 -0
- package/dist/integrations/aws/files/ai/tools/get-s3-object.ts +62 -0
- package/dist/integrations/aws/files/ai/tools/list-ec2-instances.ts +56 -0
- package/dist/integrations/aws/files/ai/tools/list-lambda-functions.ts +57 -0
- package/dist/integrations/aws/files/ai/tools/list-s3-buckets.ts +44 -0
- package/dist/integrations/aws/files/ai/tools/list-s3-objects.ts +58 -0
- package/dist/integrations/aws/files/lib/aws-client.ts +255 -0
- package/dist/integrations/bitbucket/connector.json +85 -0
- package/dist/integrations/bitbucket/files/_env.example +9 -0
- package/dist/integrations/bitbucket/files/ai/tools/create-pull-request.ts +83 -0
- package/dist/integrations/bitbucket/files/ai/tools/list-issues.ts +112 -0
- package/dist/integrations/bitbucket/files/ai/tools/list-pull-requests.ts +91 -0
- package/dist/integrations/bitbucket/files/ai/tools/list-repositories.ts +78 -0
- package/dist/integrations/bitbucket/files/app/api/auth/bitbucket/callback/route.ts +11 -0
- package/dist/integrations/bitbucket/files/app/api/auth/bitbucket/route.ts +9 -0
- package/dist/integrations/bitbucket/files/lib/bitbucket-client.ts +316 -0
- package/dist/integrations/bitbucket/files/lib/token-store.ts +5 -0
- package/dist/integrations/box/connector.json +85 -0
- package/dist/integrations/box/files/_env.example +4 -0
- package/dist/integrations/box/files/ai/tools/create-folder.ts +28 -0
- package/dist/integrations/box/files/ai/tools/get-file.ts +29 -0
- package/dist/integrations/box/files/ai/tools/list-files.ts +33 -0
- package/dist/integrations/box/files/ai/tools/search-files.ts +35 -0
- package/dist/integrations/box/files/ai/tools/upload-file.ts +32 -0
- package/dist/integrations/box/files/app/api/auth/box/callback/route.ts +11 -0
- package/dist/integrations/box/files/app/api/auth/box/route.ts +7 -0
- package/dist/integrations/box/files/lib/box-client.ts +280 -0
- package/dist/integrations/box/files/lib/token-store.ts +11 -0
- package/dist/integrations/calendar/files/app/api/auth/calendar/callback/route.ts +7 -110
- package/dist/integrations/calendar/files/app/api/auth/calendar/route.ts +5 -25
- package/dist/integrations/calendar/files/lib/token-store.ts +2 -110
- package/dist/integrations/clickup/connector.json +85 -0
- package/dist/integrations/clickup/files/_env.example +4 -0
- package/dist/integrations/clickup/files/ai/tools/create-task.ts +64 -0
- package/dist/integrations/clickup/files/ai/tools/get-task.ts +59 -0
- package/dist/integrations/clickup/files/ai/tools/list-lists.ts +109 -0
- package/dist/integrations/clickup/files/ai/tools/list-tasks.ts +95 -0
- package/dist/integrations/clickup/files/ai/tools/update-task.ts +85 -0
- package/dist/integrations/clickup/files/app/api/auth/clickup/callback/route.ts +11 -0
- package/dist/integrations/clickup/files/app/api/auth/clickup/route.ts +7 -0
- package/dist/integrations/clickup/files/lib/clickup-client.ts +439 -0
- package/dist/integrations/clickup/files/lib/token-store.ts +11 -0
- package/dist/integrations/confluence/README.md +246 -0
- package/dist/integrations/confluence/connector.json +104 -0
- package/dist/integrations/confluence/files/_env.example +4 -0
- package/dist/integrations/confluence/files/ai/tools/create-page.ts +43 -0
- package/dist/integrations/confluence/files/ai/tools/get-page.ts +30 -0
- package/dist/integrations/confluence/files/ai/tools/list-spaces.ts +31 -0
- package/dist/integrations/confluence/files/ai/tools/search-content.ts +38 -0
- package/dist/integrations/confluence/files/ai/tools/update-page.ts +45 -0
- package/dist/integrations/confluence/files/app/api/auth/confluence/callback/route.ts +11 -0
- package/dist/integrations/confluence/files/app/api/auth/confluence/route.ts +9 -0
- package/dist/integrations/confluence/files/lib/confluence-client.ts +281 -0
- package/dist/integrations/confluence/files/lib/token-store.ts +5 -0
- package/dist/integrations/discord/connector.json +100 -0
- package/dist/integrations/discord/files/_env.example +12 -0
- package/dist/integrations/discord/files/ai/tools/get-messages.ts +55 -0
- package/dist/integrations/discord/files/ai/tools/get-user.ts +32 -0
- package/dist/integrations/discord/files/ai/tools/list-channels.ts +32 -0
- package/dist/integrations/discord/files/ai/tools/list-guilds.ts +24 -0
- package/dist/integrations/discord/files/ai/tools/send-message.ts +33 -0
- package/dist/integrations/discord/files/app/api/auth/discord/callback/route.ts +11 -0
- package/dist/integrations/discord/files/app/api/auth/discord/route.ts +9 -0
- package/dist/integrations/discord/files/lib/discord-client.ts +273 -0
- package/dist/integrations/discord/files/lib/token-store.ts +5 -0
- package/dist/integrations/docs-google/connector.json +101 -0
- package/dist/integrations/docs-google/files/_env.example +8 -0
- package/dist/integrations/docs-google/files/ai/tools/create-document.ts +46 -0
- package/dist/integrations/docs-google/files/ai/tools/get-document.ts +46 -0
- package/dist/integrations/docs-google/files/ai/tools/list-documents.ts +42 -0
- package/dist/integrations/docs-google/files/ai/tools/search-documents.ts +38 -0
- package/dist/integrations/docs-google/files/ai/tools/update-document.ts +131 -0
- package/dist/integrations/docs-google/files/app/api/auth/docs-google/callback/route.ts +11 -0
- package/dist/integrations/docs-google/files/app/api/auth/docs-google/route.ts +9 -0
- package/dist/integrations/docs-google/files/lib/docs-client.ts +582 -0
- package/dist/integrations/docs-google/files/lib/token-store.ts +5 -0
- package/dist/integrations/drive/connector.json +134 -0
- package/dist/integrations/drive/files/_env.example +9 -0
- package/dist/integrations/drive/files/ai/tools/create-folder.ts +47 -0
- package/dist/integrations/drive/files/ai/tools/get-file.ts +55 -0
- package/dist/integrations/drive/files/ai/tools/list-files.ts +78 -0
- package/dist/integrations/drive/files/ai/tools/search-files.ts +79 -0
- package/dist/integrations/drive/files/ai/tools/upload-file.ts +59 -0
- package/dist/integrations/drive/files/app/api/auth/drive/callback/route.ts +11 -0
- package/dist/integrations/drive/files/app/api/auth/drive/route.ts +9 -0
- package/dist/integrations/drive/files/lib/drive-client.ts +359 -0
- package/dist/integrations/drive/files/lib/token-store.ts +113 -0
- package/dist/integrations/dropbox/connector.json +107 -0
- package/dist/integrations/dropbox/files/_env.example +24 -0
- package/dist/integrations/dropbox/files/ai/tools/get-account.ts +58 -0
- package/dist/integrations/dropbox/files/ai/tools/get-file.ts +61 -0
- package/dist/integrations/dropbox/files/ai/tools/list-files.ts +56 -0
- package/dist/integrations/dropbox/files/ai/tools/search-files.ts +70 -0
- package/dist/integrations/dropbox/files/ai/tools/upload-file.ts +48 -0
- package/dist/integrations/dropbox/files/app/api/auth/dropbox/callback/route.ts +11 -0
- package/dist/integrations/dropbox/files/app/api/auth/dropbox/route.ts +9 -0
- package/dist/integrations/dropbox/files/lib/dropbox-client.ts +397 -0
- package/dist/integrations/dropbox/files/lib/token-store.ts +5 -0
- package/dist/integrations/figma/INTEGRATION_SUMMARY.md +436 -0
- package/dist/integrations/figma/README.md +287 -0
- package/dist/integrations/figma/connector.json +100 -0
- package/dist/integrations/figma/files/_env.example +5 -0
- package/dist/integrations/figma/files/ai/tools/get-comments.ts +72 -0
- package/dist/integrations/figma/files/ai/tools/get-file.ts +54 -0
- package/dist/integrations/figma/files/ai/tools/list-files.ts +39 -0
- package/dist/integrations/figma/files/ai/tools/list-projects.ts +69 -0
- package/dist/integrations/figma/files/ai/tools/post-comment.ts +54 -0
- package/dist/integrations/figma/files/app/api/auth/figma/callback/route.ts +11 -0
- package/dist/integrations/figma/files/app/api/auth/figma/route.ts +9 -0
- package/dist/integrations/figma/files/lib/figma-client.ts +355 -0
- package/dist/integrations/figma/files/lib/token-store.ts +5 -0
- package/dist/integrations/figma/files/lib/types.ts +503 -0
- package/dist/integrations/freshdesk/connector.json +85 -0
- package/dist/integrations/freshdesk/files/_env.example +4 -0
- package/dist/integrations/freshdesk/files/ai/tools/create-ticket.ts +60 -0
- package/dist/integrations/freshdesk/files/ai/tools/get-ticket.ts +46 -0
- package/dist/integrations/freshdesk/files/ai/tools/list-contacts.ts +37 -0
- package/dist/integrations/freshdesk/files/ai/tools/list-tickets.ts +59 -0
- package/dist/integrations/freshdesk/files/ai/tools/update-ticket.ts +61 -0
- package/dist/integrations/freshdesk/files/app/api/auth/freshdesk/callback/route.ts +11 -0
- package/dist/integrations/freshdesk/files/app/api/auth/freshdesk/route.ts +7 -0
- package/dist/integrations/freshdesk/files/lib/freshdesk-client.ts +178 -0
- package/dist/integrations/freshdesk/files/lib/token-store.ts +11 -0
- package/dist/integrations/github/files/app/api/auth/github/callback/route.ts +6 -127
- package/dist/integrations/github/files/app/api/auth/github/route.ts +4 -24
- package/dist/integrations/github/files/lib/token-store.ts +2 -110
- package/dist/integrations/gitlab/connector.json +100 -0
- package/dist/integrations/gitlab/files/_env.example +7 -0
- package/dist/integrations/gitlab/files/ai/tools/create-issue.ts +49 -0
- package/dist/integrations/gitlab/files/ai/tools/get-issue.ts +56 -0
- package/dist/integrations/gitlab/files/ai/tools/list-merge-requests.ts +75 -0
- package/dist/integrations/gitlab/files/ai/tools/list-projects.ts +51 -0
- package/dist/integrations/gitlab/files/ai/tools/search-issues.ts +67 -0
- package/dist/integrations/gitlab/files/app/api/auth/gitlab/callback/route.ts +11 -0
- package/dist/integrations/gitlab/files/app/api/auth/gitlab/route.ts +9 -0
- package/dist/integrations/gitlab/files/lib/gitlab-client.ts +366 -0
- package/dist/integrations/gitlab/files/lib/token-store.ts +5 -0
- package/dist/integrations/gmail/files/app/api/auth/gmail/callback/route.ts +7 -108
- package/dist/integrations/gmail/files/app/api/auth/gmail/route.ts +5 -23
- package/dist/integrations/gmail/files/lib/gmail-client.ts +16 -55
- package/dist/integrations/gmail/files/lib/token-store.ts +4 -109
- package/dist/integrations/hubspot/connector.json +98 -0
- package/dist/integrations/hubspot/files/_env.example +5 -0
- package/dist/integrations/hubspot/files/ai/tools/create-contact.ts +41 -0
- package/dist/integrations/hubspot/files/ai/tools/create-deal.ts +41 -0
- package/dist/integrations/hubspot/files/ai/tools/get-contact.ts +39 -0
- package/dist/integrations/hubspot/files/ai/tools/list-contacts.ts +43 -0
- package/dist/integrations/hubspot/files/ai/tools/list-deals.ts +41 -0
- package/dist/integrations/hubspot/files/app/api/auth/hubspot/callback/route.ts +11 -0
- package/dist/integrations/hubspot/files/app/api/auth/hubspot/route.ts +9 -0
- package/dist/integrations/hubspot/files/lib/hubspot-client.ts +393 -0
- package/dist/integrations/hubspot/files/lib/token-store.ts +5 -0
- package/dist/integrations/intercom/connector.json +85 -0
- package/dist/integrations/intercom/files/_env.example +4 -0
- package/dist/integrations/intercom/files/ai/tools/get-contact.ts +35 -0
- package/dist/integrations/intercom/files/ai/tools/get-conversation.ts +55 -0
- package/dist/integrations/intercom/files/ai/tools/list-contacts.ts +35 -0
- package/dist/integrations/intercom/files/ai/tools/list-conversations.ts +49 -0
- package/dist/integrations/intercom/files/ai/tools/send-message.ts +34 -0
- package/dist/integrations/intercom/files/app/api/auth/intercom/callback/route.ts +11 -0
- package/dist/integrations/intercom/files/app/api/auth/intercom/route.ts +7 -0
- package/dist/integrations/intercom/files/lib/intercom-client.ts +308 -0
- package/dist/integrations/intercom/files/lib/token-store.ts +11 -0
- package/dist/integrations/jira/connector.json +109 -0
- package/dist/integrations/jira/files/ai/tools/create-issue.ts +47 -0
- package/dist/integrations/jira/files/ai/tools/get-issue.ts +57 -0
- package/dist/integrations/jira/files/ai/tools/list-projects.ts +30 -0
- package/dist/integrations/jira/files/ai/tools/search-issues.ts +49 -0
- package/dist/integrations/jira/files/ai/tools/update-issue.ts +81 -0
- package/dist/integrations/jira/files/app/api/auth/jira/callback/route.ts +11 -0
- package/dist/integrations/jira/files/app/api/auth/jira/route.ts +9 -0
- package/dist/integrations/jira/files/lib/jira-client.ts +338 -0
- package/dist/integrations/jira/files/lib/token-store.ts +5 -0
- package/dist/integrations/linear/connector.json +100 -0
- package/dist/integrations/linear/files/_env.example +6 -0
- package/dist/integrations/linear/files/ai/tools/create-issue.ts +71 -0
- package/dist/integrations/linear/files/ai/tools/get-issue.ts +55 -0
- package/dist/integrations/linear/files/ai/tools/list-projects.ts +43 -0
- package/dist/integrations/linear/files/ai/tools/search-issues.ts +54 -0
- package/dist/integrations/linear/files/ai/tools/update-issue.ts +71 -0
- package/dist/integrations/linear/files/app/api/auth/linear/callback/route.ts +11 -0
- package/dist/integrations/linear/files/app/api/auth/linear/route.ts +9 -0
- package/dist/integrations/linear/files/lib/linear-client.ts +464 -0
- package/dist/integrations/linear/files/lib/token-store.ts +5 -0
- package/dist/integrations/mailchimp/connector.json +85 -0
- package/dist/integrations/mailchimp/files/_env.example +4 -0
- package/dist/integrations/mailchimp/files/ai/tools/get-campaign.ts +45 -0
- package/dist/integrations/mailchimp/files/ai/tools/get-list.ts +51 -0
- package/dist/integrations/mailchimp/files/ai/tools/list-campaigns.ts +46 -0
- package/dist/integrations/mailchimp/files/ai/tools/list-lists.ts +46 -0
- package/dist/integrations/mailchimp/files/ai/tools/list-members.ts +58 -0
- package/dist/integrations/mailchimp/files/app/api/auth/mailchimp/callback/route.ts +11 -0
- package/dist/integrations/mailchimp/files/app/api/auth/mailchimp/route.ts +7 -0
- package/dist/integrations/mailchimp/files/lib/mailchimp-client.ts +267 -0
- package/dist/integrations/mailchimp/files/lib/token-store.ts +11 -0
- package/dist/integrations/mixpanel/connector.json +96 -0
- package/dist/integrations/mixpanel/files/_env.example +11 -0
- package/dist/integrations/mixpanel/files/ai/tools/get-funnel.ts +46 -0
- package/dist/integrations/mixpanel/files/ai/tools/get-retention.ts +64 -0
- package/dist/integrations/mixpanel/files/ai/tools/list-cohorts.ts +46 -0
- package/dist/integrations/mixpanel/files/ai/tools/query-events.ts +43 -0
- package/dist/integrations/mixpanel/files/ai/tools/track-event.ts +41 -0
- package/dist/integrations/mixpanel/files/lib/mixpanel-client.ts +319 -0
- package/dist/integrations/mixpanel/files/lib/token-store.ts +43 -0
- package/dist/integrations/monday/connector.json +85 -0
- package/dist/integrations/monday/files/_env.example +4 -0
- package/dist/integrations/monday/files/ai/tools/create-item.ts +36 -0
- package/dist/integrations/monday/files/ai/tools/get-item.ts +31 -0
- package/dist/integrations/monday/files/ai/tools/list-boards.ts +29 -0
- package/dist/integrations/monday/files/ai/tools/list-items.ts +36 -0
- package/dist/integrations/monday/files/ai/tools/update-item.ts +36 -0
- package/dist/integrations/monday/files/app/api/auth/monday/callback/route.ts +11 -0
- package/dist/integrations/monday/files/app/api/auth/monday/route.ts +7 -0
- package/dist/integrations/monday/files/lib/monday-client.ts +329 -0
- package/dist/integrations/monday/files/lib/token-store.ts +11 -0
- package/dist/integrations/neon/connector.json +89 -0
- package/dist/integrations/neon/files/_env.example +6 -0
- package/dist/integrations/neon/files/ai/tools/describe-table.ts +38 -0
- package/dist/integrations/neon/files/ai/tools/list-branches.ts +35 -0
- package/dist/integrations/neon/files/ai/tools/list-projects.ts +31 -0
- package/dist/integrations/neon/files/ai/tools/list-tables.ts +49 -0
- package/dist/integrations/neon/files/ai/tools/query-database.ts +33 -0
- package/dist/integrations/neon/files/app/api/auth/neon/route.ts +51 -0
- package/dist/integrations/neon/files/lib/neon-client.ts +294 -0
- package/dist/integrations/neon/files/lib/token-store.ts +29 -0
- package/dist/integrations/notion/connector.json +87 -0
- package/dist/integrations/notion/files/_env.example +6 -0
- package/dist/integrations/notion/files/ai/tools/create-page.ts +32 -0
- package/dist/integrations/notion/files/ai/tools/query-database.ts +44 -0
- package/dist/integrations/notion/files/ai/tools/read-page.ts +34 -0
- package/dist/integrations/notion/files/ai/tools/search-notion.ts +51 -0
- package/dist/integrations/notion/files/app/api/auth/notion/callback/route.ts +11 -0
- package/dist/integrations/notion/files/app/api/auth/notion/route.ts +9 -0
- package/dist/integrations/notion/files/lib/notion-client.ts +218 -0
- package/dist/integrations/notion/files/lib/token-store.ts +5 -0
- package/dist/integrations/onedrive/connector.json +100 -0
- package/dist/integrations/onedrive/files/_env.example +23 -0
- package/dist/integrations/onedrive/files/ai/tools/download-file.ts +38 -0
- package/dist/integrations/onedrive/files/ai/tools/list-files.ts +63 -0
- package/dist/integrations/onedrive/files/ai/tools/search-files.ts +59 -0
- package/dist/integrations/onedrive/files/ai/tools/upload-file.ts +43 -0
- package/dist/integrations/onedrive/files/app/api/auth/onedrive/callback/route.ts +11 -0
- package/dist/integrations/onedrive/files/app/api/auth/onedrive/route.ts +9 -0
- package/dist/integrations/onedrive/files/lib/onedrive-client.ts +314 -0
- package/dist/integrations/onedrive/files/lib/token-store.ts +5 -0
- package/dist/integrations/outlook/README.md +308 -0
- package/dist/integrations/outlook/connector.json +98 -0
- package/dist/integrations/outlook/files/_env.example +8 -0
- package/dist/integrations/outlook/files/ai/tools/get-email.ts +47 -0
- package/dist/integrations/outlook/files/ai/tools/list-emails.ts +46 -0
- package/dist/integrations/outlook/files/ai/tools/list-folders.ts +22 -0
- package/dist/integrations/outlook/files/ai/tools/search-emails.ts +41 -0
- package/dist/integrations/outlook/files/ai/tools/send-email.ts +41 -0
- package/dist/integrations/outlook/files/app/api/auth/outlook/callback/route.ts +11 -0
- package/dist/integrations/outlook/files/app/api/auth/outlook/route.ts +9 -0
- package/dist/integrations/outlook/files/lib/outlook-client.ts +204 -0
- package/dist/integrations/outlook/files/lib/token-store.ts +5 -0
- package/dist/integrations/pipedrive/connector.json +85 -0
- package/dist/integrations/pipedrive/files/_env.example +4 -0
- package/dist/integrations/pipedrive/files/ai/tools/create-deal.ts +44 -0
- package/dist/integrations/pipedrive/files/ai/tools/get-deal.ts +34 -0
- package/dist/integrations/pipedrive/files/ai/tools/list-deals.ts +40 -0
- package/dist/integrations/pipedrive/files/ai/tools/list-persons.ts +33 -0
- package/dist/integrations/pipedrive/files/ai/tools/update-deal.ts +46 -0
- package/dist/integrations/pipedrive/files/app/api/auth/pipedrive/callback/route.ts +11 -0
- package/dist/integrations/pipedrive/files/app/api/auth/pipedrive/route.ts +7 -0
- package/dist/integrations/pipedrive/files/lib/pipedrive-client.ts +259 -0
- package/dist/integrations/pipedrive/files/lib/token-store.ts +11 -0
- package/dist/integrations/posthog/connector.json +84 -0
- package/dist/integrations/posthog/files/_env.example +6 -0
- package/dist/integrations/posthog/files/ai/tools/capture-event.ts +37 -0
- package/dist/integrations/posthog/files/ai/tools/get-trends.ts +44 -0
- package/dist/integrations/posthog/files/ai/tools/list-feature-flags.ts +38 -0
- package/dist/integrations/posthog/files/ai/tools/list-persons.ts +32 -0
- package/dist/integrations/posthog/files/lib/posthog-client.ts +286 -0
- package/dist/integrations/posthog/files/lib/token-store.ts +21 -0
- package/dist/integrations/quickbooks/connector.json +85 -0
- package/dist/integrations/quickbooks/files/_env.example +4 -0
- package/dist/integrations/quickbooks/files/ai/tools/create-invoice.ts +48 -0
- package/dist/integrations/quickbooks/files/ai/tools/get-customer.ts +36 -0
- package/dist/integrations/quickbooks/files/ai/tools/get-invoice.ts +46 -0
- package/dist/integrations/quickbooks/files/ai/tools/list-customers.ts +37 -0
- package/dist/integrations/quickbooks/files/ai/tools/list-invoices.ts +40 -0
- package/dist/integrations/quickbooks/files/app/api/auth/quickbooks/callback/route.ts +11 -0
- package/dist/integrations/quickbooks/files/app/api/auth/quickbooks/route.ts +7 -0
- package/dist/integrations/quickbooks/files/lib/quickbooks-client.ts +252 -0
- package/dist/integrations/quickbooks/files/lib/token-store.ts +11 -0
- package/dist/integrations/salesforce/connector.json +104 -0
- package/dist/integrations/salesforce/files/ai/tools/create-lead.ts +101 -0
- package/dist/integrations/salesforce/files/ai/tools/get-account.ts +53 -0
- package/dist/integrations/salesforce/files/ai/tools/list-accounts.ts +50 -0
- package/dist/integrations/salesforce/files/ai/tools/list-contacts.ts +54 -0
- package/dist/integrations/salesforce/files/ai/tools/list-opportunities.ts +55 -0
- package/dist/integrations/salesforce/files/app/api/auth/salesforce/callback/route.ts +11 -0
- package/dist/integrations/salesforce/files/app/api/auth/salesforce/route.ts +9 -0
- package/dist/integrations/salesforce/files/lib/salesforce-client.ts +539 -0
- package/dist/integrations/salesforce/files/lib/token-store.ts +5 -0
- package/dist/integrations/sentry/connector.json +84 -0
- package/dist/integrations/sentry/files/_env.example +6 -0
- package/dist/integrations/sentry/files/ai/tools/get-issue.ts +66 -0
- package/dist/integrations/sentry/files/ai/tools/list-issues.ts +57 -0
- package/dist/integrations/sentry/files/ai/tools/list-projects.ts +32 -0
- package/dist/integrations/sentry/files/ai/tools/resolve-issue.ts +28 -0
- package/dist/integrations/sentry/files/lib/sentry-client.ts +268 -0
- package/dist/integrations/sentry/files/lib/token-store.ts +29 -0
- package/dist/integrations/servicenow/connector.json +66 -0
- package/dist/integrations/servicenow/files/_env.example +5 -0
- package/dist/integrations/servicenow/files/ai/tools/create-incident.ts +58 -0
- package/dist/integrations/servicenow/files/ai/tools/get-incident.ts +59 -0
- package/dist/integrations/servicenow/files/ai/tools/list-incidents.ts +72 -0
- package/dist/integrations/servicenow/files/ai/tools/search-knowledge.ts +48 -0
- package/dist/integrations/servicenow/files/ai/tools/update-incident.ts +60 -0
- package/dist/integrations/servicenow/files/app/api/auth/servicenow/callback/route.ts +89 -0
- package/dist/integrations/servicenow/files/app/api/auth/servicenow/route.ts +42 -0
- package/dist/integrations/servicenow/files/lib/servicenow-client.ts +239 -0
- package/dist/integrations/servicenow/files/lib/token-store.ts +42 -0
- package/dist/integrations/sharepoint/connector.json +99 -0
- package/dist/integrations/sharepoint/files/ai/tools/get-file.ts +93 -0
- package/dist/integrations/sharepoint/files/ai/tools/get-site.ts +51 -0
- package/dist/integrations/sharepoint/files/ai/tools/list-files.ts +63 -0
- package/dist/integrations/sharepoint/files/ai/tools/list-sites.ts +28 -0
- package/dist/integrations/sharepoint/files/ai/tools/upload-file.ts +72 -0
- package/dist/integrations/sharepoint/files/app/api/auth/sharepoint/callback/route.ts +11 -0
- package/dist/integrations/sharepoint/files/app/api/auth/sharepoint/route.ts +9 -0
- package/dist/integrations/sharepoint/files/lib/sharepoint-client.ts +420 -0
- package/dist/integrations/sharepoint/files/lib/token-store.ts +5 -0
- package/dist/integrations/sheets/README.md +331 -0
- package/dist/integrations/sheets/connector.json +99 -0
- package/dist/integrations/sheets/files/_env.example +8 -0
- package/dist/integrations/sheets/files/ai/tools/create-spreadsheet.ts +85 -0
- package/dist/integrations/sheets/files/ai/tools/get-spreadsheet.ts +39 -0
- package/dist/integrations/sheets/files/ai/tools/list-spreadsheets.ts +41 -0
- package/dist/integrations/sheets/files/ai/tools/read-range.ts +35 -0
- package/dist/integrations/sheets/files/ai/tools/write-range.ts +51 -0
- package/dist/integrations/sheets/files/app/api/auth/sheets/callback/route.ts +11 -0
- package/dist/integrations/sheets/files/app/api/auth/sheets/route.ts +9 -0
- package/dist/integrations/sheets/files/lib/sheets-client.ts +425 -0
- package/dist/integrations/sheets/files/lib/token-store.ts +5 -0
- package/dist/integrations/shopify/connector.json +99 -0
- package/dist/integrations/shopify/files/_env.example +5 -0
- package/dist/integrations/shopify/files/ai/tools/get-order.ts +49 -0
- package/dist/integrations/shopify/files/ai/tools/get-product.ts +39 -0
- package/dist/integrations/shopify/files/ai/tools/list-customers.ts +40 -0
- package/dist/integrations/shopify/files/ai/tools/list-orders.ts +52 -0
- package/dist/integrations/shopify/files/ai/tools/list-products.ts +39 -0
- package/dist/integrations/shopify/files/app/api/auth/shopify/callback/route.ts +11 -0
- package/dist/integrations/shopify/files/app/api/auth/shopify/route.ts +7 -0
- package/dist/integrations/shopify/files/lib/shopify-client.ts +198 -0
- package/dist/integrations/shopify/files/lib/token-store.ts +11 -0
- package/dist/integrations/slack/files/app/api/auth/slack/callback/route.ts +6 -127
- package/dist/integrations/slack/files/app/api/auth/slack/route.ts +4 -24
- package/dist/integrations/slack/files/lib/token-store.ts +2 -110
- package/dist/integrations/snowflake/connector.json +151 -0
- package/dist/integrations/snowflake/files/_env.example +16 -0
- package/dist/integrations/snowflake/files/ai/tools/describe-table.ts +57 -0
- package/dist/integrations/snowflake/files/ai/tools/list-databases.ts +34 -0
- package/dist/integrations/snowflake/files/ai/tools/list-schemas.ts +40 -0
- package/dist/integrations/snowflake/files/ai/tools/list-tables.ts +49 -0
- package/dist/integrations/snowflake/files/ai/tools/run-query.ts +119 -0
- package/dist/integrations/snowflake/files/lib/snowflake-client.ts +389 -0
- package/dist/integrations/snowflake/files/lib/token-store.ts +77 -0
- package/dist/integrations/stripe/connector.json +97 -0
- package/dist/integrations/stripe/files/_env.example +6 -0
- package/dist/integrations/stripe/files/ai/tools/get-balance.ts +28 -0
- package/dist/integrations/stripe/files/ai/tools/get-customer.ts +26 -0
- package/dist/integrations/stripe/files/ai/tools/list-customers.ts +42 -0
- package/dist/integrations/stripe/files/ai/tools/list-payments.ts +45 -0
- package/dist/integrations/stripe/files/ai/tools/list-subscriptions.ts +67 -0
- package/dist/integrations/stripe/files/app/api/auth/stripe/route.ts +71 -0
- package/dist/integrations/stripe/files/lib/stripe-client.ts +376 -0
- package/dist/integrations/stripe/files/lib/token-store.ts +21 -0
- package/dist/integrations/supabase/connector.json +101 -0
- package/dist/integrations/supabase/files/_env.example +6 -0
- package/dist/integrations/supabase/files/ai/tools/delete-row.ts +77 -0
- package/dist/integrations/supabase/files/ai/tools/insert-row.ts +35 -0
- package/dist/integrations/supabase/files/ai/tools/list-tables.ts +60 -0
- package/dist/integrations/supabase/files/ai/tools/query-table.ts +48 -0
- package/dist/integrations/supabase/files/ai/tools/update-row.ts +64 -0
- package/dist/integrations/supabase/files/app/api/auth/supabase/route.ts +91 -0
- package/dist/integrations/supabase/files/lib/supabase-client.ts +296 -0
- package/dist/integrations/supabase/files/lib/token-store.ts +47 -0
- package/dist/integrations/teams/README.md +256 -0
- package/dist/integrations/teams/connector.json +99 -0
- package/dist/integrations/teams/files/ai/tools/get-messages.ts +55 -0
- package/dist/integrations/teams/files/ai/tools/list-channels.ts +28 -0
- package/dist/integrations/teams/files/ai/tools/list-chats.ts +41 -0
- package/dist/integrations/teams/files/ai/tools/list-teams.ts +27 -0
- package/dist/integrations/teams/files/ai/tools/send-message.ts +61 -0
- package/dist/integrations/teams/files/app/api/auth/teams/callback/route.ts +11 -0
- package/dist/integrations/teams/files/app/api/auth/teams/route.ts +9 -0
- package/dist/integrations/teams/files/lib/teams-client.ts +345 -0
- package/dist/integrations/teams/files/lib/token-store.ts +5 -0
- package/dist/integrations/trello/connector.json +85 -0
- package/dist/integrations/trello/files/_env.example +4 -0
- package/dist/integrations/trello/files/ai/tools/create-card.ts +54 -0
- package/dist/integrations/trello/files/ai/tools/get-card.ts +33 -0
- package/dist/integrations/trello/files/ai/tools/list-boards.ts +29 -0
- package/dist/integrations/trello/files/ai/tools/list-cards.ts +52 -0
- package/dist/integrations/trello/files/ai/tools/update-card.ts +65 -0
- package/dist/integrations/trello/files/app/api/auth/trello/callback/route.ts +11 -0
- package/dist/integrations/trello/files/app/api/auth/trello/route.ts +7 -0
- package/dist/integrations/trello/files/lib/token-store.ts +11 -0
- package/dist/integrations/trello/files/lib/trello-client.ts +202 -0
- package/dist/integrations/twilio/connector.json +146 -0
- package/dist/integrations/twilio/files/_env.example +14 -0
- package/dist/integrations/twilio/files/ai/tools/get-message.ts +58 -0
- package/dist/integrations/twilio/files/ai/tools/list-calls.ts +129 -0
- package/dist/integrations/twilio/files/ai/tools/list-messages.ts +97 -0
- package/dist/integrations/twilio/files/ai/tools/send-sms.ts +75 -0
- package/dist/integrations/twilio/files/ai/tools/send-whatsapp.ts +81 -0
- package/dist/integrations/twilio/files/lib/token-store.ts +60 -0
- package/dist/integrations/twilio/files/lib/twilio-client.ts +375 -0
- package/dist/integrations/twitter/connector.json +87 -0
- package/dist/integrations/twitter/files/_env.example +6 -0
- package/dist/integrations/twitter/files/ai/tools/get-timeline.ts +59 -0
- package/dist/integrations/twitter/files/ai/tools/post-tweet.ts +49 -0
- package/dist/integrations/twitter/files/ai/tools/search-tweets.ts +71 -0
- package/dist/integrations/twitter/files/app/api/auth/twitter/callback/route.ts +11 -0
- package/dist/integrations/twitter/files/app/api/auth/twitter/route.ts +9 -0
- package/dist/integrations/twitter/files/lib/token-store.ts +5 -0
- package/dist/integrations/twitter/files/lib/twitter-client.ts +236 -0
- package/dist/integrations/webex/connector.json +85 -0
- package/dist/integrations/webex/files/_env.example +4 -0
- package/dist/integrations/webex/files/ai/tools/create-meeting.ts +69 -0
- package/dist/integrations/webex/files/ai/tools/get-meeting.ts +31 -0
- package/dist/integrations/webex/files/ai/tools/list-meetings.ts +44 -0
- package/dist/integrations/webex/files/ai/tools/list-rooms.ts +35 -0
- package/dist/integrations/webex/files/ai/tools/send-message.ts +51 -0
- package/dist/integrations/webex/files/app/api/auth/webex/callback/route.ts +11 -0
- package/dist/integrations/webex/files/app/api/auth/webex/route.ts +7 -0
- package/dist/integrations/webex/files/lib/token-store.ts +11 -0
- package/dist/integrations/webex/files/lib/webex-client.ts +279 -0
- package/dist/integrations/xero/connector.json +85 -0
- package/dist/integrations/xero/files/_env.example +4 -0
- package/dist/integrations/xero/files/ai/tools/create-invoice.ts +65 -0
- package/dist/integrations/xero/files/ai/tools/get-contact.ts +40 -0
- package/dist/integrations/xero/files/ai/tools/get-invoice.ts +44 -0
- package/dist/integrations/xero/files/ai/tools/list-contacts.ts +54 -0
- package/dist/integrations/xero/files/ai/tools/list-invoices.ts +54 -0
- package/dist/integrations/xero/files/app/api/auth/xero/callback/route.ts +11 -0
- package/dist/integrations/xero/files/app/api/auth/xero/route.ts +7 -0
- package/dist/integrations/xero/files/lib/token-store.ts +11 -0
- package/dist/integrations/xero/files/lib/xero-client.ts +292 -0
- package/dist/integrations/zendesk/connector.json +61 -0
- package/dist/integrations/zendesk/files/_env.example +5 -0
- package/dist/integrations/zendesk/files/ai/tools/create-ticket.ts +82 -0
- package/dist/integrations/zendesk/files/ai/tools/get-ticket.ts +53 -0
- package/dist/integrations/zendesk/files/ai/tools/list-tickets.ts +60 -0
- package/dist/integrations/zendesk/files/ai/tools/search-tickets.ts +56 -0
- package/dist/integrations/zendesk/files/app/api/auth/zendesk/callback/route.ts +91 -0
- package/dist/integrations/zendesk/files/app/api/auth/zendesk/route.ts +41 -0
- package/dist/integrations/zendesk/files/lib/token-store.ts +47 -0
- package/dist/integrations/zendesk/files/lib/zendesk-client.ts +265 -0
- package/dist/integrations/zoom/connector.json +85 -0
- package/dist/integrations/zoom/files/_env.example +4 -0
- package/dist/integrations/zoom/files/ai/tools/create-meeting.ts +106 -0
- package/dist/integrations/zoom/files/ai/tools/delete-meeting.ts +32 -0
- package/dist/integrations/zoom/files/ai/tools/get-meeting.ts +44 -0
- package/dist/integrations/zoom/files/ai/tools/list-meetings.ts +47 -0
- package/dist/integrations/zoom/files/ai/tools/update-meeting.ts +111 -0
- package/dist/integrations/zoom/files/app/api/auth/zoom/callback/route.ts +11 -0
- package/dist/integrations/zoom/files/app/api/auth/zoom/route.ts +7 -0
- package/dist/integrations/zoom/files/lib/token-store.ts +11 -0
- package/dist/integrations/zoom/files/lib/zoom-client.ts +228 -0
- package/dist/oauth/handlers.js +554 -0
- package/dist/oauth/handlers.js.map +7 -0
- package/dist/oauth/index.js +1157 -0
- package/dist/oauth/index.js.map +7 -0
- package/dist/oauth/providers.js +927 -0
- package/dist/oauth/providers.js.map +7 -0
- package/dist/oauth/token-store.js +82 -0
- package/dist/oauth/token-store.js.map +7 -0
- package/package.json +25 -1
- package/dist/integrations/gmail/files/lib/oauth.ts +0 -145
- package/dist/integrations/slack/files/lib/oauth.ts +0 -145
- /package/dist/integrations/{calendar → docs-google}/files/lib/oauth.ts +0 -0
- /package/dist/integrations/{github → drive}/files/lib/oauth.ts +0 -0
package/dist/ai/components.js
CHANGED
|
@@ -40,7 +40,7 @@ function cn(...classes) {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
// src/ai/react/components/chat.tsx
|
|
43
|
-
import * as
|
|
43
|
+
import * as React7 from "react";
|
|
44
44
|
|
|
45
45
|
// src/ai/react/primitives/chat-container.tsx
|
|
46
46
|
import * as React from "react";
|
|
@@ -128,7 +128,7 @@ MessageContent.displayName = "MessageContent";
|
|
|
128
128
|
|
|
129
129
|
// src/ai/react/primitives/input-box.tsx
|
|
130
130
|
import * as React3 from "react";
|
|
131
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
131
|
+
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
132
132
|
var InputBox = React3.forwardRef(({ className, value, onChange, onSubmit, multiline, ...props }, ref) => {
|
|
133
133
|
const handleKeyDown = (e) => {
|
|
134
134
|
if (e.key === "Enter" && !e.shiftKey && onSubmit) {
|
|
@@ -167,19 +167,64 @@ var InputBox = React3.forwardRef(({ className, value, onChange, onSubmit, multil
|
|
|
167
167
|
);
|
|
168
168
|
});
|
|
169
169
|
InputBox.displayName = "InputBox";
|
|
170
|
-
var
|
|
170
|
+
var SubmitIcon = () => /* @__PURE__ */ jsx3("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx3("path", { d: "M2.01 21L23 12 2.01 3 2 10l15 2-15 2z" }) });
|
|
171
|
+
var StopIcon = () => /* @__PURE__ */ jsx3("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx3("rect", { x: "4", y: "4", width: "16", height: "16", rx: "2" }) });
|
|
172
|
+
var VoiceIcon = () => /* @__PURE__ */ jsxs(
|
|
173
|
+
"svg",
|
|
174
|
+
{
|
|
175
|
+
width: "16",
|
|
176
|
+
height: "16",
|
|
177
|
+
viewBox: "0 0 24 24",
|
|
178
|
+
fill: "none",
|
|
179
|
+
stroke: "currentColor",
|
|
180
|
+
strokeWidth: "2",
|
|
181
|
+
strokeLinecap: "round",
|
|
182
|
+
strokeLinejoin: "round",
|
|
183
|
+
children: [
|
|
184
|
+
/* @__PURE__ */ jsx3("path", { d: "M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z" }),
|
|
185
|
+
/* @__PURE__ */ jsx3("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
|
|
186
|
+
/* @__PURE__ */ jsx3("line", { x1: "12", x2: "12", y1: "19", y2: "22" })
|
|
187
|
+
]
|
|
188
|
+
}
|
|
189
|
+
);
|
|
190
|
+
var SubmitButton = React3.forwardRef(({ className, isLoading, hasInput, onStop, onVoice, icons, disabled, children, ...props }, ref) => {
|
|
191
|
+
const showStop = isLoading;
|
|
192
|
+
const showVoice = !isLoading && !hasInput && onVoice;
|
|
193
|
+
const handleClick = (e) => {
|
|
194
|
+
if (showStop && onStop) {
|
|
195
|
+
e.preventDefault();
|
|
196
|
+
onStop();
|
|
197
|
+
} else if (showVoice && onVoice) {
|
|
198
|
+
e.preventDefault();
|
|
199
|
+
onVoice();
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
let icon;
|
|
203
|
+
let ariaLabel;
|
|
204
|
+
if (showStop) {
|
|
205
|
+
icon = icons?.stop || /* @__PURE__ */ jsx3(StopIcon, {});
|
|
206
|
+
ariaLabel = "Stop generating";
|
|
207
|
+
} else if (showVoice) {
|
|
208
|
+
icon = icons?.voice || /* @__PURE__ */ jsx3(VoiceIcon, {});
|
|
209
|
+
ariaLabel = "Voice input";
|
|
210
|
+
} else {
|
|
211
|
+
icon = icons?.submit || /* @__PURE__ */ jsx3(SubmitIcon, {});
|
|
212
|
+
ariaLabel = "Send message";
|
|
213
|
+
}
|
|
171
214
|
return /* @__PURE__ */ jsx3(
|
|
172
215
|
"button",
|
|
173
216
|
{
|
|
174
217
|
ref,
|
|
175
|
-
type: "submit",
|
|
218
|
+
type: showStop || showVoice ? "button" : "submit",
|
|
176
219
|
className,
|
|
177
|
-
disabled: disabled
|
|
220
|
+
disabled: disabled && !showStop,
|
|
221
|
+
onClick: handleClick,
|
|
178
222
|
"data-submit-button": "",
|
|
223
|
+
"data-state": showStop ? "stop" : showVoice ? "voice" : "submit",
|
|
179
224
|
"data-loading": isLoading,
|
|
180
|
-
"aria-label":
|
|
225
|
+
"aria-label": ariaLabel,
|
|
181
226
|
...props,
|
|
182
|
-
children: children ||
|
|
227
|
+
children: children || icon
|
|
183
228
|
}
|
|
184
229
|
);
|
|
185
230
|
});
|
|
@@ -270,9 +315,9 @@ function formatStatus(status) {
|
|
|
270
315
|
|
|
271
316
|
// src/ai/react/primitives/tool-primitives.tsx
|
|
272
317
|
import * as React5 from "react";
|
|
273
|
-
import { jsx as jsx5, jsxs } from "react/jsx-runtime";
|
|
318
|
+
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
274
319
|
var ToolInvocation = React5.forwardRef(({ className, name, args, status, children, ...props }, ref) => {
|
|
275
|
-
return /* @__PURE__ */
|
|
320
|
+
return /* @__PURE__ */ jsxs2(
|
|
276
321
|
"div",
|
|
277
322
|
{
|
|
278
323
|
ref,
|
|
@@ -282,9 +327,9 @@ var ToolInvocation = React5.forwardRef(({ className, name, args, status, childre
|
|
|
282
327
|
"data-status": status,
|
|
283
328
|
...props,
|
|
284
329
|
children: [
|
|
285
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ jsxs2("div", { "data-tool-header": "", children: [
|
|
286
331
|
/* @__PURE__ */ jsx5("span", { "data-tool-name": "", children: name }),
|
|
287
|
-
status && /* @__PURE__ */
|
|
332
|
+
status && /* @__PURE__ */ jsxs2("span", { "data-tool-status": "", children: [
|
|
288
333
|
"(",
|
|
289
334
|
status,
|
|
290
335
|
")"
|
|
@@ -340,9 +385,147 @@ var ToolList = React5.forwardRef(
|
|
|
340
385
|
);
|
|
341
386
|
ToolList.displayName = "ToolList";
|
|
342
387
|
|
|
388
|
+
// src/ai/react/hooks/use-voice-input.ts
|
|
389
|
+
import * as React6 from "react";
|
|
390
|
+
function useVoiceInput(options = {}) {
|
|
391
|
+
const {
|
|
392
|
+
language,
|
|
393
|
+
continuous = false,
|
|
394
|
+
interimResults = true,
|
|
395
|
+
onTranscript,
|
|
396
|
+
onError,
|
|
397
|
+
onStart,
|
|
398
|
+
onEnd
|
|
399
|
+
} = options;
|
|
400
|
+
const [isListening, setIsListening] = React6.useState(false);
|
|
401
|
+
const [transcript, setTranscript] = React6.useState("");
|
|
402
|
+
const [error, setError] = React6.useState(null);
|
|
403
|
+
const recognitionRef = React6.useRef(null);
|
|
404
|
+
const isSupported = React6.useMemo(() => {
|
|
405
|
+
if (typeof globalThis === "undefined")
|
|
406
|
+
return false;
|
|
407
|
+
const g = globalThis;
|
|
408
|
+
return !!(g.SpeechRecognition || g.webkitSpeechRecognition);
|
|
409
|
+
}, []);
|
|
410
|
+
React6.useEffect(() => {
|
|
411
|
+
if (!isSupported)
|
|
412
|
+
return;
|
|
413
|
+
const g = globalThis;
|
|
414
|
+
const SpeechRecognitionAPI = g.SpeechRecognition || g.webkitSpeechRecognition;
|
|
415
|
+
if (!SpeechRecognitionAPI)
|
|
416
|
+
return;
|
|
417
|
+
const recognition = new SpeechRecognitionAPI();
|
|
418
|
+
recognition.continuous = continuous;
|
|
419
|
+
recognition.interimResults = interimResults;
|
|
420
|
+
if (language) {
|
|
421
|
+
recognition.lang = language;
|
|
422
|
+
}
|
|
423
|
+
recognition.onresult = (event) => {
|
|
424
|
+
let finalTranscript = "";
|
|
425
|
+
let interimTranscript = "";
|
|
426
|
+
for (let i = event.resultIndex; i < event.results.length; i++) {
|
|
427
|
+
const result = event.results[i];
|
|
428
|
+
if (!result || !result[0])
|
|
429
|
+
continue;
|
|
430
|
+
if (result.isFinal) {
|
|
431
|
+
finalTranscript += result[0].transcript;
|
|
432
|
+
} else {
|
|
433
|
+
interimTranscript += result[0].transcript;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
const currentTranscript = finalTranscript || interimTranscript;
|
|
437
|
+
setTranscript(currentTranscript);
|
|
438
|
+
if (onTranscript) {
|
|
439
|
+
onTranscript(currentTranscript, !!finalTranscript);
|
|
440
|
+
}
|
|
441
|
+
};
|
|
442
|
+
recognition.onerror = (event) => {
|
|
443
|
+
const errorMessage = getErrorMessage(event.error);
|
|
444
|
+
setError(errorMessage);
|
|
445
|
+
setIsListening(false);
|
|
446
|
+
if (onError) {
|
|
447
|
+
onError(errorMessage);
|
|
448
|
+
}
|
|
449
|
+
};
|
|
450
|
+
recognition.onstart = () => {
|
|
451
|
+
setIsListening(true);
|
|
452
|
+
setError(null);
|
|
453
|
+
if (onStart) {
|
|
454
|
+
onStart();
|
|
455
|
+
}
|
|
456
|
+
};
|
|
457
|
+
recognition.onend = () => {
|
|
458
|
+
setIsListening(false);
|
|
459
|
+
if (onEnd) {
|
|
460
|
+
onEnd();
|
|
461
|
+
}
|
|
462
|
+
};
|
|
463
|
+
recognitionRef.current = recognition;
|
|
464
|
+
return () => {
|
|
465
|
+
recognition.abort();
|
|
466
|
+
};
|
|
467
|
+
}, [isSupported, language, continuous, interimResults, onTranscript, onError, onStart, onEnd]);
|
|
468
|
+
const start = React6.useCallback(() => {
|
|
469
|
+
if (!recognitionRef.current || isListening)
|
|
470
|
+
return;
|
|
471
|
+
setTranscript("");
|
|
472
|
+
setError(null);
|
|
473
|
+
try {
|
|
474
|
+
recognitionRef.current.start();
|
|
475
|
+
} catch {
|
|
476
|
+
console.warn("Speech recognition already started");
|
|
477
|
+
}
|
|
478
|
+
}, [isListening]);
|
|
479
|
+
const stop = React6.useCallback(() => {
|
|
480
|
+
if (!recognitionRef.current || !isListening)
|
|
481
|
+
return;
|
|
482
|
+
recognitionRef.current.stop();
|
|
483
|
+
}, [isListening]);
|
|
484
|
+
const toggle = React6.useCallback(() => {
|
|
485
|
+
if (isListening) {
|
|
486
|
+
stop();
|
|
487
|
+
} else {
|
|
488
|
+
start();
|
|
489
|
+
}
|
|
490
|
+
}, [isListening, start, stop]);
|
|
491
|
+
const clear = React6.useCallback(() => {
|
|
492
|
+
setTranscript("");
|
|
493
|
+
}, []);
|
|
494
|
+
return {
|
|
495
|
+
isSupported,
|
|
496
|
+
isListening,
|
|
497
|
+
transcript,
|
|
498
|
+
start,
|
|
499
|
+
stop,
|
|
500
|
+
toggle,
|
|
501
|
+
clear,
|
|
502
|
+
error
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
function getErrorMessage(error) {
|
|
506
|
+
switch (error) {
|
|
507
|
+
case "no-speech":
|
|
508
|
+
return "No speech detected. Please try again.";
|
|
509
|
+
case "audio-capture":
|
|
510
|
+
return "No microphone found. Please check your device.";
|
|
511
|
+
case "not-allowed":
|
|
512
|
+
return "Microphone permission denied. Please allow access.";
|
|
513
|
+
case "network":
|
|
514
|
+
return "Network error. Please check your connection.";
|
|
515
|
+
case "aborted":
|
|
516
|
+
return "Speech recognition was aborted.";
|
|
517
|
+
case "language-not-supported":
|
|
518
|
+
return "Language not supported.";
|
|
519
|
+
case "service-not-allowed":
|
|
520
|
+
return "Speech recognition service not allowed.";
|
|
521
|
+
default:
|
|
522
|
+
return `Speech recognition error: ${error}`;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
|
|
343
526
|
// src/ai/react/components/chat.tsx
|
|
344
|
-
import { jsx as jsx6, jsxs as
|
|
345
|
-
var Chat =
|
|
527
|
+
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
528
|
+
var Chat = React7.forwardRef(
|
|
346
529
|
({
|
|
347
530
|
messages,
|
|
348
531
|
input,
|
|
@@ -350,6 +533,10 @@ var Chat = React6.forwardRef(
|
|
|
350
533
|
handleInputChange,
|
|
351
534
|
onSubmit,
|
|
352
535
|
handleSubmit,
|
|
536
|
+
stop,
|
|
537
|
+
enableVoice = false,
|
|
538
|
+
onVoice,
|
|
539
|
+
setInput,
|
|
353
540
|
isLoading,
|
|
354
541
|
error,
|
|
355
542
|
placeholder = "Type a message...",
|
|
@@ -361,23 +548,38 @@ var Chat = React6.forwardRef(
|
|
|
361
548
|
multiline = false
|
|
362
549
|
}, ref) => {
|
|
363
550
|
const theme = mergeThemes(defaultChatTheme, userTheme);
|
|
364
|
-
const messagesEndRef =
|
|
551
|
+
const messagesEndRef = React7.useRef(null);
|
|
365
552
|
const inputChangeHandler = onChange || handleInputChange || (() => {
|
|
366
553
|
});
|
|
367
554
|
const submitHandler = onSubmit || handleSubmit;
|
|
368
|
-
|
|
555
|
+
const voice = useVoiceInput({
|
|
556
|
+
onTranscript: (transcript, isFinal) => {
|
|
557
|
+
if (setInput && isFinal) {
|
|
558
|
+
setInput(transcript);
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
});
|
|
562
|
+
const voiceHandler = React7.useMemo(() => {
|
|
563
|
+
if (onVoice)
|
|
564
|
+
return onVoice;
|
|
565
|
+
if (enableVoice && voice.isSupported && setInput) {
|
|
566
|
+
return voice.toggle;
|
|
567
|
+
}
|
|
568
|
+
return void 0;
|
|
569
|
+
}, [onVoice, enableVoice, voice.isSupported, voice.toggle, setInput]);
|
|
570
|
+
React7.useEffect(() => {
|
|
369
571
|
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
370
572
|
}, [messages]);
|
|
371
|
-
return /* @__PURE__ */
|
|
573
|
+
return /* @__PURE__ */ jsxs3(
|
|
372
574
|
ChatContainer,
|
|
373
575
|
{
|
|
374
576
|
ref,
|
|
375
577
|
className: cn(theme.container, className),
|
|
376
578
|
style: { maxHeight },
|
|
377
579
|
children: [
|
|
378
|
-
/* @__PURE__ */ jsx6(MessageList, { className: "flex-1 min-h-0 overflow-y-auto", children: /* @__PURE__ */
|
|
580
|
+
/* @__PURE__ */ jsx6(MessageList, { className: "flex-1 min-h-0 overflow-y-auto", children: /* @__PURE__ */ jsxs3("div", { className: "max-w-2xl mx-auto px-4 py-4 space-y-2", children: [
|
|
379
581
|
messages.map(
|
|
380
|
-
(msg) => renderMessage ? /* @__PURE__ */ jsx6(
|
|
582
|
+
(msg) => renderMessage ? /* @__PURE__ */ jsx6(React7.Fragment, { children: renderMessage(msg) }, msg.id) : /* @__PURE__ */ jsx6(
|
|
381
583
|
MessageItem,
|
|
382
584
|
{
|
|
383
585
|
role: msg.role,
|
|
@@ -390,7 +592,7 @@ var Chat = React6.forwardRef(
|
|
|
390
592
|
msg.id
|
|
391
593
|
)
|
|
392
594
|
),
|
|
393
|
-
isLoading && /* @__PURE__ */ jsx6("div", { className: "flex justify-start", children: /* @__PURE__ */ jsx6("div", { className: "bg-neutral-100 dark:bg-neutral-800 rounded-[20px] rounded-bl-[4px] px-4 py-3", children: /* @__PURE__ */
|
|
595
|
+
isLoading && /* @__PURE__ */ jsx6("div", { className: "flex justify-start", children: /* @__PURE__ */ jsx6("div", { className: "bg-neutral-100 dark:bg-neutral-800 rounded-[20px] rounded-bl-[4px] px-4 py-3", children: /* @__PURE__ */ jsxs3("div", { className: "flex gap-1.5 items-center", children: [
|
|
394
596
|
/* @__PURE__ */ jsx6("span", { className: cn(theme.loading) }),
|
|
395
597
|
/* @__PURE__ */ jsx6("span", { className: cn(theme.loading), style: { animationDelay: "0.15s" } }),
|
|
396
598
|
/* @__PURE__ */ jsx6("span", { className: cn(theme.loading), style: { animationDelay: "0.3s" } })
|
|
@@ -403,14 +605,14 @@ var Chat = React6.forwardRef(
|
|
|
403
605
|
{
|
|
404
606
|
onSubmit: submitHandler,
|
|
405
607
|
className: "max-w-2xl mx-auto px-4 py-3",
|
|
406
|
-
children: /* @__PURE__ */
|
|
608
|
+
children: /* @__PURE__ */ jsxs3("div", { className: "flex gap-2 items-center", children: [
|
|
407
609
|
/* @__PURE__ */ jsx6(
|
|
408
610
|
InputBox,
|
|
409
611
|
{
|
|
410
|
-
value: input,
|
|
612
|
+
value: voice.isListening ? voice.transcript || input : input,
|
|
411
613
|
onChange: inputChangeHandler,
|
|
412
|
-
placeholder,
|
|
413
|
-
disabled: isLoading,
|
|
614
|
+
placeholder: voice.isListening ? "Listening..." : placeholder,
|
|
615
|
+
disabled: isLoading || voice.isListening,
|
|
414
616
|
multiline,
|
|
415
617
|
className: theme.input
|
|
416
618
|
}
|
|
@@ -418,10 +620,12 @@ var Chat = React6.forwardRef(
|
|
|
418
620
|
/* @__PURE__ */ jsx6(
|
|
419
621
|
SubmitButton,
|
|
420
622
|
{
|
|
421
|
-
isLoading,
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
623
|
+
isLoading: isLoading || voice.isListening,
|
|
624
|
+
hasInput: !!input.trim(),
|
|
625
|
+
onStop: voice.isListening ? voice.stop : stop,
|
|
626
|
+
onVoice: voiceHandler,
|
|
627
|
+
disabled: !input.trim(),
|
|
628
|
+
className: theme.button
|
|
425
629
|
}
|
|
426
630
|
)
|
|
427
631
|
] })
|
|
@@ -433,7 +637,7 @@ var Chat = React6.forwardRef(
|
|
|
433
637
|
}
|
|
434
638
|
);
|
|
435
639
|
Chat.displayName = "Chat";
|
|
436
|
-
var ChatHeader =
|
|
640
|
+
var ChatHeader = React7.forwardRef(({ className, children, ...props }, ref) => {
|
|
437
641
|
return /* @__PURE__ */ jsx6(
|
|
438
642
|
"div",
|
|
439
643
|
{
|
|
@@ -450,7 +654,7 @@ var ChatHeader = React6.forwardRef(({ className, children, ...props }, ref) => {
|
|
|
450
654
|
ChatHeader.displayName = "ChatHeader";
|
|
451
655
|
var ChatMessages = MessageList;
|
|
452
656
|
ChatMessages.displayName = "ChatMessages";
|
|
453
|
-
var ChatInput =
|
|
657
|
+
var ChatInput = React7.forwardRef(({ className, ...props }, ref) => {
|
|
454
658
|
return /* @__PURE__ */ jsx6("div", { className: "border-t border-gray-200 dark:border-gray-800 p-4", children: /* @__PURE__ */ jsx6("div", { className: "flex gap-2", children: /* @__PURE__ */ jsx6(
|
|
455
659
|
InputBox,
|
|
456
660
|
{
|
|
@@ -461,7 +665,7 @@ var ChatInput = React6.forwardRef(({ className, ...props }, ref) => {
|
|
|
461
665
|
) }) });
|
|
462
666
|
});
|
|
463
667
|
ChatInput.displayName = "ChatInput";
|
|
464
|
-
var ChatFooter =
|
|
668
|
+
var ChatFooter = React7.forwardRef(({ className, children, ...props }, ref) => {
|
|
465
669
|
return /* @__PURE__ */ jsx6(
|
|
466
670
|
"div",
|
|
467
671
|
{
|
|
@@ -484,9 +688,9 @@ var ChatComponents = Object.assign(Chat, {
|
|
|
484
688
|
});
|
|
485
689
|
|
|
486
690
|
// src/ai/react/components/agent-card.tsx
|
|
487
|
-
import * as
|
|
488
|
-
import { jsx as jsx7, jsxs as
|
|
489
|
-
var AgentCard =
|
|
691
|
+
import * as React8 from "react";
|
|
692
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
693
|
+
var AgentCard = React8.forwardRef(
|
|
490
694
|
({
|
|
491
695
|
messages,
|
|
492
696
|
toolCalls = [],
|
|
@@ -497,7 +701,7 @@ var AgentCard = React7.forwardRef(
|
|
|
497
701
|
renderTool
|
|
498
702
|
}, ref) => {
|
|
499
703
|
const theme = mergeThemes(defaultAgentTheme, userTheme);
|
|
500
|
-
return /* @__PURE__ */
|
|
704
|
+
return /* @__PURE__ */ jsxs4(AgentContainer, { ref, className: cn(theme.container, className), children: [
|
|
501
705
|
/* @__PURE__ */ jsx7(
|
|
502
706
|
AgentStatus,
|
|
503
707
|
{
|
|
@@ -505,18 +709,18 @@ var AgentCard = React7.forwardRef(
|
|
|
505
709
|
className: cn(theme.status, getStatusColor(status))
|
|
506
710
|
}
|
|
507
711
|
),
|
|
508
|
-
thinking && /* @__PURE__ */
|
|
712
|
+
thinking && /* @__PURE__ */ jsxs4(ThinkingIndicator, { className: theme.thinking, children: [
|
|
509
713
|
/* @__PURE__ */ jsx7("span", { className: "font-semibold", children: "Thinking:" }),
|
|
510
714
|
thinking
|
|
511
715
|
] }),
|
|
512
|
-
toolCalls.length > 0 && /* @__PURE__ */
|
|
716
|
+
toolCalls.length > 0 && /* @__PURE__ */ jsxs4("div", { className: "space-y-3", children: [
|
|
513
717
|
/* @__PURE__ */ jsx7("h3", { className: "text-sm font-semibold text-neutral-700 dark:text-neutral-300", children: "Tool Calls" }),
|
|
514
718
|
/* @__PURE__ */ jsx7(
|
|
515
719
|
ToolList,
|
|
516
720
|
{
|
|
517
721
|
toolCalls,
|
|
518
722
|
className: "space-y-3",
|
|
519
|
-
renderTool: renderTool || ((tool) => /* @__PURE__ */
|
|
723
|
+
renderTool: renderTool || ((tool) => /* @__PURE__ */ jsxs4(
|
|
520
724
|
ToolInvocation,
|
|
521
725
|
{
|
|
522
726
|
name: tool.name,
|
|
@@ -525,7 +729,7 @@ var AgentCard = React7.forwardRef(
|
|
|
525
729
|
className: theme.tool,
|
|
526
730
|
children: [
|
|
527
731
|
tool.result !== void 0 && /* @__PURE__ */ jsx7(ToolResult, { result: tool.result, className: theme.toolResult }),
|
|
528
|
-
tool.error && /* @__PURE__ */
|
|
732
|
+
tool.error && /* @__PURE__ */ jsxs4("div", { className: "mt-2 p-3 bg-red-50 dark:bg-red-900/20 text-red-900 dark:text-red-100 rounded-xl text-sm border border-red-200 dark:border-red-800", children: [
|
|
529
733
|
"Error: ",
|
|
530
734
|
tool.error
|
|
531
735
|
] })
|
|
@@ -535,18 +739,18 @@ var AgentCard = React7.forwardRef(
|
|
|
535
739
|
}
|
|
536
740
|
)
|
|
537
741
|
] }),
|
|
538
|
-
messages && messages.length > 0 && /* @__PURE__ */
|
|
742
|
+
messages && messages.length > 0 && /* @__PURE__ */ jsxs4("div", { className: "space-y-3", children: [
|
|
539
743
|
/* @__PURE__ */ jsx7("h3", { className: "text-sm font-semibold text-neutral-700 dark:text-neutral-300", children: "Messages" }),
|
|
540
|
-
/* @__PURE__ */ jsx7("div", { className: "space-y-2 max-h-96 overflow-y-auto", children: messages.map((msg) => /* @__PURE__ */
|
|
744
|
+
/* @__PURE__ */ jsx7("div", { className: "space-y-2 max-h-96 overflow-y-auto", children: messages.map((msg) => /* @__PURE__ */ jsxs4(
|
|
541
745
|
"div",
|
|
542
746
|
{
|
|
543
747
|
className: "text-sm p-3 rounded-xl bg-neutral-50 dark:bg-neutral-800",
|
|
544
748
|
children: [
|
|
545
|
-
/* @__PURE__ */
|
|
749
|
+
/* @__PURE__ */ jsxs4("span", { className: "font-semibold capitalize text-neutral-900 dark:text-neutral-100", children: [
|
|
546
750
|
msg.role,
|
|
547
751
|
":"
|
|
548
752
|
] }),
|
|
549
|
-
/* @__PURE__ */
|
|
753
|
+
/* @__PURE__ */ jsxs4("span", { className: "text-neutral-600 dark:text-neutral-400 ml-1", children: [
|
|
550
754
|
msg.content.substring(0, 200),
|
|
551
755
|
"..."
|
|
552
756
|
] })
|
|
@@ -579,9 +783,9 @@ function getStatusColor(status) {
|
|
|
579
783
|
}
|
|
580
784
|
|
|
581
785
|
// src/ai/react/components/message.tsx
|
|
582
|
-
import * as
|
|
583
|
-
import { jsx as jsx8, jsxs as
|
|
584
|
-
var Message =
|
|
786
|
+
import * as React9 from "react";
|
|
787
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
788
|
+
var Message = React9.forwardRef(
|
|
585
789
|
({ message, className, theme: userTheme, showRole = false, showTimestamp = false }, ref) => {
|
|
586
790
|
const theme = mergeThemes(defaultChatTheme, userTheme);
|
|
587
791
|
return /* @__PURE__ */ jsx8(
|
|
@@ -594,7 +798,7 @@ var Message = React8.forwardRef(
|
|
|
594
798
|
message.role === "user" ? "justify-end" : "justify-start",
|
|
595
799
|
className
|
|
596
800
|
),
|
|
597
|
-
children: /* @__PURE__ */
|
|
801
|
+
children: /* @__PURE__ */ jsxs5("div", { className: theme.message?.[message.role] || theme.message?.assistant, children: [
|
|
598
802
|
showRole && /* @__PURE__ */ jsx8(MessageRole, { className: "block text-xs font-semibold mb-1 opacity-75 uppercase", children: message.role }),
|
|
599
803
|
/* @__PURE__ */ jsx8(MessageContent, { children: message.content }),
|
|
600
804
|
showTimestamp && message.timestamp && /* @__PURE__ */ jsx8("div", { className: "text-xs opacity-60 mt-1", children: new Date(message.timestamp).toLocaleTimeString() })
|
|
@@ -604,7 +808,7 @@ var Message = React8.forwardRef(
|
|
|
604
808
|
}
|
|
605
809
|
);
|
|
606
810
|
Message.displayName = "Message";
|
|
607
|
-
var StreamingMessage =
|
|
811
|
+
var StreamingMessage = React9.forwardRef(({ content, showCursor = true, className, theme: userTheme }, ref) => {
|
|
608
812
|
const theme = mergeThemes(defaultChatTheme, userTheme);
|
|
609
813
|
return /* @__PURE__ */ jsx8(
|
|
610
814
|
MessageItem,
|
|
@@ -612,7 +816,7 @@ var StreamingMessage = React8.forwardRef(({ content, showCursor = true, classNam
|
|
|
612
816
|
ref,
|
|
613
817
|
role: "assistant",
|
|
614
818
|
className: cn("flex justify-start", className),
|
|
615
|
-
children: /* @__PURE__ */ jsx8("div", { className: theme.message?.assistant, children: /* @__PURE__ */
|
|
819
|
+
children: /* @__PURE__ */ jsx8("div", { className: theme.message?.assistant, children: /* @__PURE__ */ jsxs5(MessageContent, { children: [
|
|
616
820
|
content,
|
|
617
821
|
showCursor && /* @__PURE__ */ jsx8("span", { className: "inline-block w-1 h-4 bg-current ml-1 animate-pulse" })
|
|
618
822
|
] }) })
|
|
@@ -622,9 +826,9 @@ var StreamingMessage = React8.forwardRef(({ content, showCursor = true, classNam
|
|
|
622
826
|
StreamingMessage.displayName = "StreamingMessage";
|
|
623
827
|
|
|
624
828
|
// src/ai/react/components/error-boundary.tsx
|
|
625
|
-
import * as
|
|
626
|
-
import { jsx as jsx9, jsxs as
|
|
627
|
-
var AIErrorBoundary = class extends
|
|
829
|
+
import * as React10 from "react";
|
|
830
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
831
|
+
var AIErrorBoundary = class extends React10.Component {
|
|
628
832
|
constructor(props) {
|
|
629
833
|
super(props);
|
|
630
834
|
this.reset = () => {
|
|
@@ -654,7 +858,7 @@ var AIErrorBoundary = class extends React9.Component {
|
|
|
654
858
|
{
|
|
655
859
|
className: "border border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900/20 rounded-2xl p-6",
|
|
656
860
|
role: "alert",
|
|
657
|
-
children: /* @__PURE__ */
|
|
861
|
+
children: /* @__PURE__ */ jsxs6("div", { className: "flex items-start gap-4", children: [
|
|
658
862
|
/* @__PURE__ */ jsx9("div", { className: "w-10 h-10 rounded-full bg-red-100 dark:bg-red-900/40 flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsx9(
|
|
659
863
|
"svg",
|
|
660
864
|
{
|
|
@@ -673,7 +877,7 @@ var AIErrorBoundary = class extends React9.Component {
|
|
|
673
877
|
)
|
|
674
878
|
}
|
|
675
879
|
) }),
|
|
676
|
-
/* @__PURE__ */
|
|
880
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex-1 min-w-0", children: [
|
|
677
881
|
/* @__PURE__ */ jsx9("h3", { className: "text-base font-semibold text-red-900 dark:text-red-100", children: this.props.errorMessage || "An error occurred in the AI component" }),
|
|
678
882
|
/* @__PURE__ */ jsx9("p", { className: "mt-1.5 text-sm text-red-700 dark:text-red-300 leading-relaxed", children: this.state.error.message }),
|
|
679
883
|
/* @__PURE__ */ jsx9(
|
|
@@ -694,12 +898,12 @@ var AIErrorBoundary = class extends React9.Component {
|
|
|
694
898
|
}
|
|
695
899
|
};
|
|
696
900
|
function useAIErrorHandler() {
|
|
697
|
-
const [error, setError] =
|
|
698
|
-
const handleError =
|
|
901
|
+
const [error, setError] = React10.useState(null);
|
|
902
|
+
const handleError = React10.useCallback((error2) => {
|
|
699
903
|
console.error("[useAIErrorHandler] Error:", error2);
|
|
700
904
|
setError(error2);
|
|
701
905
|
}, []);
|
|
702
|
-
const clearError =
|
|
906
|
+
const clearError = React10.useCallback(() => {
|
|
703
907
|
setError(null);
|
|
704
908
|
}, []);
|
|
705
909
|
return {
|