better-supabase 0.49.0 → 0.51.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 +14 -0
- package/dist/{activities-C2v_Sq4w.d.ts → activities-CL253DEv.d.ts} +2 -2
- package/dist/{adapter-BzeH7ffo.js → adapter-DBO28HF_.js} +1 -1
- package/dist/{agents-Cekdx8Bz.d.ts → agents-C3l31Csq.d.ts} +33 -2
- package/dist/agents-Cf59iYaF.d.ts +290 -0
- package/dist/agents-lkuM-m6i.js +380 -0
- package/dist/{ai-cache-Pchr6Y4y.js → ai-cache-CnmJIQZG.js} +2 -2
- package/dist/{ai-chat-D2o3jqZ5.d.ts → ai-chat-DwVklsNR.d.ts} +88 -7
- package/dist/{ai-files-B2BWwPoj.js → ai-files-CMDsogDg.js} +3 -2
- package/dist/ai-guardrails-Ckbf-cmW.d.ts +216 -0
- package/dist/{ai-schedules-BOiaFIva.d.ts → ai-schedules-D68hvDoZ.d.ts} +1 -1
- package/dist/ai-sdk/agents/index.d.ts +68 -212
- package/dist/ai-sdk/agents/index.js +103 -300
- package/dist/ai-sdk/batches/index.js +1 -1
- package/dist/ai-sdk/cache/index.js +1 -1
- package/dist/ai-sdk/chat/index.d.ts +2 -2
- package/dist/ai-sdk/chat/index.js +5 -2
- package/dist/ai-sdk/embeddings/index.d.ts +52 -3
- package/dist/ai-sdk/embeddings/index.js +69 -1
- package/dist/ai-sdk/files/index.d.ts +38 -4
- package/dist/ai-sdk/files/index.js +100 -4
- package/dist/ai-sdk/index.d.ts +166 -16
- package/dist/ai-sdk/index.js +394 -21
- package/dist/ai-sdk/mcp/index.d.ts +49 -2
- package/dist/ai-sdk/mcp/index.js +108 -6
- package/dist/ai-sdk/memory/index.d.ts +2 -2
- package/dist/ai-sdk/memory/index.js +7 -2
- package/dist/ai-sdk/react/index.js +2 -2
- package/dist/ai-sdk/react/server.js +1 -1
- package/dist/ai-sdk/workflow/index.d.ts +87 -23
- package/dist/ai-sdk/workflow/index.js +275 -28
- package/dist/ai-sdk/workflow/react/index.d.ts +25 -4
- package/dist/ai-sdk/workflow/react/index.js +71 -16
- package/dist/ai-sdk/workflow/react/server.d.ts +4 -4
- package/dist/{api-CWeCh_j2.d.ts → api-3I8ucZF2.d.ts} +1 -1
- package/dist/{api-DXZh-j0l.js → api-CZGUgEVr.js} +1 -1
- package/dist/{app-tables-D6Na4nwb.d.ts → app-tables-qa0wvhw0.d.ts} +1 -1
- package/dist/{approvals-B-WgN6Mf.d.ts → approvals-C7DjllLP.d.ts} +84 -1
- package/dist/{approvals-CMkvP9kT.js → approvals-CfQuk-lJ.js} +84 -8
- package/dist/{assistant-DcxV_seb.js → assistant-BBN9KJPi.js} +108 -26
- package/dist/{assistant-Dy9zwENt.d.ts → assistant-VF3vhPZo.d.ts} +68 -25
- package/dist/astro/index.js +2 -2
- package/dist/{attachments-gjSYzlsQ.js → attachments-Da24yVTB.js} +4 -4
- package/dist/audit-files/index.js +2 -2
- package/dist/{authorization-N4bh4KQS.d.ts → authorization-fXe0XyzB.d.ts} +1 -1
- package/dist/{automations-Ce0jNNIe.js → automations-BKxKPkhr.js} +2 -2
- package/dist/{automations-CCc5RUw-.js → automations-CkwKi84L.js} +2 -1
- package/dist/{bind-ChYzUApb.d.ts → bind-CimlbjXB.d.ts} +3 -3
- package/dist/{block-authors-CjI5VcQz.js → block-authors-Dt82LpCs.js} +1 -1
- package/dist/{block-env-buLS8m9m.d.ts → block-env-D0JCpFzh.d.ts} +4 -4
- package/dist/{block-helpers-CCl3V9ku.js → block-helpers-DApvw3n9.js} +5 -2
- package/dist/{block-hooks-C2_d17_b.js → block-hooks-mazaapv5.js} +1 -1
- package/dist/{block-subjects-ok-uZ1UU.js → block-subjects-CFDmtXvr.js} +1 -1
- package/dist/{block-subjects-rv7V0R6O.js → block-subjects-D3r2SfCb.js} +10 -10
- package/dist/{block-tables-Pd7nOPv3.d.ts → block-tables-CdXRHb2v.d.ts} +1 -1
- package/dist/blocks/access-requests/index.d.ts +1 -1
- package/dist/blocks/access-requests/index.js +2 -2
- package/dist/blocks/accounting/index.d.ts +1 -1
- package/dist/blocks/accounting/index.js +3 -3
- package/dist/blocks/acknowledgements/index.d.ts +1 -1
- package/dist/blocks/acknowledgements/index.js +2 -2
- package/dist/blocks/activities/index.d.ts +5 -13
- package/dist/blocks/activities/index.js +3 -3
- package/dist/blocks/advisories/index.d.ts +1 -1
- package/dist/blocks/advisories/index.js +2 -2
- package/dist/blocks/agent-checkout/index.d.ts +1 -1
- package/dist/blocks/agent-checkout/index.js +2 -2
- package/dist/blocks/agents/index.d.ts +4 -4
- package/dist/blocks/agents/index.js +47 -8
- package/dist/blocks/ai-cache/index.d.ts +1 -1
- package/dist/blocks/ai-cache/index.js +2 -2
- package/dist/blocks/ai-chat/index.d.ts +4 -4
- package/dist/blocks/ai-chat/index.js +76 -8
- package/dist/blocks/ai-evals/index.d.ts +1 -1
- package/dist/blocks/ai-evals/index.js +2 -2
- package/dist/blocks/ai-files/index.d.ts +2 -2
- package/dist/blocks/ai-files/index.js +2 -2
- package/dist/blocks/ai-guardrails/index.d.ts +3 -216
- package/dist/blocks/ai-guardrails/index.js +4 -4
- package/dist/blocks/ai-keys/index.d.ts +1 -1
- package/dist/blocks/ai-keys/index.js +4 -4
- package/dist/blocks/ai-schedules/index.d.ts +2 -2
- package/dist/blocks/ai-schedules/index.js +2 -2
- package/dist/blocks/announcements/index.d.ts +4 -4
- package/dist/blocks/announcements/index.js +2 -2
- package/dist/blocks/api-keys/index.d.ts +1 -1
- package/dist/blocks/api-keys/index.js +2 -2
- package/dist/blocks/appraisals/index.d.ts +1 -1
- package/dist/blocks/appraisals/index.js +2 -2
- package/dist/blocks/approvals/index.d.ts +2 -2
- package/dist/blocks/approvals/index.js +3 -3
- package/dist/blocks/assets/index.d.ts +2 -2
- package/dist/blocks/assets/index.js +3 -3
- package/dist/blocks/assignment/index.d.ts +1 -1
- package/dist/blocks/assignment/index.js +3 -3
- package/dist/blocks/attachments/index.d.ts +5 -5
- package/dist/blocks/attachments/index.js +3 -3
- package/dist/blocks/audit/index.d.ts +2 -2
- package/dist/blocks/audit/index.js +2 -2
- package/dist/blocks/automations/index.d.ts +4 -4
- package/dist/blocks/automations/index.js +3 -3
- package/dist/blocks/banking/index.d.ts +1 -1
- package/dist/blocks/banking/index.js +3 -3
- package/dist/blocks/billable-time/index.d.ts +1 -1
- package/dist/blocks/billable-time/index.js +3 -3
- package/dist/blocks/billing/index.d.ts +2 -2
- package/dist/blocks/billing/index.js +2 -2
- package/dist/blocks/bookings/index.d.ts +2 -2
- package/dist/blocks/bookings/index.js +2 -2
- package/dist/blocks/bulk/index.d.ts +1 -1
- package/dist/blocks/bulk/index.js +2 -2
- package/dist/blocks/calendar/index.d.ts +3 -3
- package/dist/blocks/calendar/index.js +1 -1
- package/dist/blocks/care/index.d.ts +27 -27
- package/dist/blocks/care/index.js +27 -27
- package/dist/blocks/care-plans/index.d.ts +3 -3
- package/dist/blocks/care-plans/index.js +3 -3
- package/dist/blocks/cases/index.d.ts +3 -3
- package/dist/blocks/cases/index.js +3 -3
- package/dist/blocks/catalog/index.d.ts +2 -2
- package/dist/blocks/catalog/index.js +3 -3
- package/dist/blocks/channels/index.d.ts +1 -1
- package/dist/blocks/channels/index.js +2 -2
- package/dist/blocks/clinical-decision-support/index.d.ts +1 -1
- package/dist/blocks/clinical-decision-support/index.js +2 -2
- package/dist/blocks/cms/index.d.ts +5 -5
- package/dist/blocks/cms/index.js +5 -5
- package/dist/blocks/collaboration/index.d.ts +6 -6
- package/dist/blocks/collaboration/index.js +6 -6
- package/dist/blocks/collections/index.d.ts +1 -1
- package/dist/blocks/collections/index.js +2 -2
- package/dist/blocks/comments/index.d.ts +2 -2
- package/dist/blocks/comments/index.js +3 -3
- package/dist/blocks/commerce/index.d.ts +5 -5
- package/dist/blocks/commerce/index.js +5 -5
- package/dist/blocks/commissions/index.d.ts +1 -1
- package/dist/blocks/commissions/index.js +2 -2
- package/dist/blocks/compliance/index.d.ts +1 -1
- package/dist/blocks/compliance/index.js +2 -2
- package/dist/blocks/connectors/index.d.ts +1 -1
- package/dist/blocks/connectors/index.js +3 -3
- package/dist/blocks/consents/index.d.ts +2 -2
- package/dist/blocks/consents/index.js +3 -3
- package/dist/blocks/contacts/index.d.ts +3 -3
- package/dist/blocks/contacts/index.js +4 -4
- package/dist/blocks/content/index.d.ts +2 -2
- package/dist/blocks/content/index.js +3 -3
- package/dist/blocks/contracts/index.d.ts +1 -1
- package/dist/blocks/contracts/index.js +4 -4
- package/dist/blocks/courses/index.d.ts +3 -3
- package/dist/blocks/courses/index.js +3 -3
- package/dist/blocks/created-by/index.d.ts +2 -2
- package/dist/blocks/crm/index.d.ts +16 -16
- package/dist/blocks/crm/index.js +16 -16
- package/dist/blocks/custom-fields/index.d.ts +1 -1
- package/dist/blocks/custom-fields/index.js +2 -2
- package/dist/blocks/dam/index.d.ts +2 -2
- package/dist/blocks/dam/index.js +4 -4
- package/dist/blocks/data-lifecycle/index.d.ts +2 -2
- package/dist/blocks/data-lifecycle/index.js +3 -3
- package/dist/blocks/deals/index.d.ts +1 -1
- package/dist/blocks/deals/index.js +3 -3
- package/dist/blocks/dispatch/index.d.ts +2 -2
- package/dist/blocks/dispatch/index.js +4 -4
- package/dist/blocks/document-templates/index.d.ts +1 -1
- package/dist/blocks/document-templates/index.js +2 -2
- package/dist/blocks/documents/index.d.ts +1 -1
- package/dist/blocks/documents/index.js +2 -2
- package/dist/blocks/domains/index.d.ts +1 -1
- package/dist/blocks/domains/index.js +3 -3
- package/dist/blocks/donations/index.d.ts +1 -1
- package/dist/blocks/donations/index.js +4 -4
- package/dist/blocks/drive/index.d.ts +5 -5
- package/dist/blocks/drive/index.js +5 -5
- package/dist/blocks/e-prescribing/index.d.ts +1 -1
- package/dist/blocks/e-prescribing/index.js +2 -2
- package/dist/blocks/employees/index.d.ts +1 -1
- package/dist/blocks/employees/index.js +3 -3
- package/dist/blocks/enrichment/index.d.ts +1 -1
- package/dist/blocks/enrichment/index.js +3 -3
- package/dist/blocks/enrollments/index.d.ts +2 -2
- package/dist/blocks/enrollments/index.js +3 -3
- package/dist/blocks/entitlements/index.d.ts +3 -3
- package/dist/blocks/entitlements/index.js +3 -3
- package/dist/blocks/events/index.d.ts +3 -3
- package/dist/blocks/events/index.js +3 -3
- package/dist/blocks/expenses/index.d.ts +1 -1
- package/dist/blocks/expenses/index.js +3 -3
- package/dist/blocks/field-history/index.d.ts +1 -1
- package/dist/blocks/field-history/index.js +3 -3
- package/dist/blocks/filespace/index.d.ts +8 -8
- package/dist/blocks/filespace/index.js +7 -7
- package/dist/blocks/finance/index.d.ts +5 -5
- package/dist/blocks/finance/index.js +5 -5
- package/dist/blocks/flags/index.d.ts +1 -1
- package/dist/blocks/flags/index.js +3 -3
- package/dist/blocks/forecasts/index.d.ts +1 -1
- package/dist/blocks/forecasts/index.js +3 -3
- package/dist/blocks/forms/index.d.ts +3 -3
- package/dist/blocks/forms/index.js +2 -2
- package/dist/blocks/funding/index.d.ts +2 -2
- package/dist/blocks/funding/index.js +3 -3
- package/dist/blocks/goals/index.d.ts +1 -1
- package/dist/blocks/goals/index.js +3 -3
- package/dist/blocks/governance/index.d.ts +4 -4
- package/dist/blocks/governance/index.js +4 -4
- package/dist/blocks/guests/index.d.ts +1 -1
- package/dist/blocks/guests/index.js +3 -3
- package/dist/blocks/hiring/index.d.ts +1 -1
- package/dist/blocks/hiring/index.js +3 -3
- package/dist/blocks/identities/index.d.ts +1 -1
- package/dist/blocks/identities/index.js +2 -2
- package/dist/blocks/imports/index.d.ts +2 -2
- package/dist/blocks/imports/index.js +2 -2
- package/dist/blocks/inbox/index.d.ts +8 -8
- package/dist/blocks/inbox/index.js +3 -3
- package/dist/blocks/incidents/index.d.ts +1 -1
- package/dist/blocks/incidents/index.js +2 -2
- package/dist/blocks/index.d.ts +8 -8
- package/dist/blocks/index.js +4 -4
- package/dist/blocks/inspections/index.d.ts +2 -2
- package/dist/blocks/inspections/index.js +2 -2
- package/dist/blocks/inventory/index.d.ts +1 -1
- package/dist/blocks/inventory/index.js +3 -3
- package/dist/blocks/invoices/index.d.ts +1 -1
- package/dist/blocks/invoices/index.js +3 -3
- package/dist/blocks/knowledge/index.d.ts +3 -3
- package/dist/blocks/knowledge/index.js +4 -4
- package/dist/blocks/lead-scoring/index.d.ts +2 -2
- package/dist/blocks/lead-scoring/index.js +3 -3
- package/dist/blocks/learning/index.d.ts +3 -3
- package/dist/blocks/learning/index.js +3 -3
- package/dist/blocks/leases/index.d.ts +1 -1
- package/dist/blocks/leases/index.js +3 -3
- package/dist/blocks/leave/index.d.ts +1 -1
- package/dist/blocks/leave/index.js +3 -3
- package/dist/blocks/ledger/index.d.ts +1 -1
- package/dist/blocks/ledger/index.js +2 -2
- package/dist/blocks/legal-entities/index.d.ts +2 -2
- package/dist/blocks/legal-entities/index.js +2 -2
- package/dist/blocks/lims/index.d.ts +2 -2
- package/dist/blocks/lims/index.js +2 -2
- package/dist/blocks/mail-sync/index.d.ts +3 -3
- package/dist/blocks/mail-sync/index.js +3 -3
- package/dist/blocks/maintenance/index.d.ts +2 -2
- package/dist/blocks/maintenance/index.js +3 -3
- package/dist/blocks/manufacturing/index.d.ts +2 -2
- package/dist/blocks/manufacturing/index.js +3 -3
- package/dist/blocks/medications/index.d.ts +1 -1
- package/dist/blocks/medications/index.js +3 -3
- package/dist/blocks/meetings/index.d.ts +3 -3
- package/dist/blocks/meetings/index.js +3 -3
- package/dist/blocks/memberships/index.d.ts +2 -2
- package/dist/blocks/memory/index.d.ts +3 -3
- package/dist/blocks/memory/index.js +7 -7
- package/dist/blocks/messaging/index.d.ts +5 -5
- package/dist/blocks/messaging/index.js +3 -3
- package/dist/blocks/metrics/index.d.ts +1 -1
- package/dist/blocks/metrics/index.js +2 -2
- package/dist/blocks/mfa/index.d.ts +2 -2
- package/dist/blocks/moderation/index.d.ts +2 -2
- package/dist/blocks/moderation/index.js +2 -2
- package/dist/blocks/notifications/index.d.ts +5 -5
- package/dist/blocks/notifications/index.js +3 -3
- package/dist/blocks/numbering/index.d.ts +1 -1
- package/dist/blocks/numbering/index.js +1 -1
- package/dist/blocks/oauth-server/index.d.ts +1 -1
- package/dist/blocks/oauth-server/index.js +2 -2
- package/dist/blocks/observations/index.d.ts +2 -2
- package/dist/blocks/observations/index.js +3 -3
- package/dist/blocks/onboarding/index.d.ts +2 -2
- package/dist/blocks/onboarding/index.js +2 -2
- package/dist/blocks/orders/index.d.ts +1 -1
- package/dist/blocks/orders/index.js +4 -4
- package/dist/blocks/organizations/index.d.ts +2 -2
- package/dist/blocks/organizations/index.js +3 -3
- package/dist/blocks/outbox/index.d.ts +1 -1
- package/dist/blocks/outbox/index.js +2 -2
- package/dist/blocks/passes/index.d.ts +2 -2
- package/dist/blocks/passes/index.js +3 -3
- package/dist/blocks/payroll-export/index.d.ts +2 -2
- package/dist/blocks/payroll-export/index.js +3 -3
- package/dist/blocks/people/index.d.ts +7 -7
- package/dist/blocks/people/index.js +7 -7
- package/dist/blocks/periods/index.d.ts +1 -1
- package/dist/blocks/periods/index.js +2 -2
- package/dist/blocks/permissions/index.d.ts +3 -3
- package/dist/blocks/permissions/index.js +2 -2
- package/dist/blocks/pipelines/index.d.ts +1 -1
- package/dist/blocks/pipelines/index.js +3 -3
- package/dist/blocks/posts/index.d.ts +2 -2
- package/dist/blocks/posts/index.js +2 -2
- package/dist/blocks/procurement/index.d.ts +5 -5
- package/dist/blocks/procurement/index.js +5 -5
- package/dist/blocks/profiles/index.d.ts +1 -1
- package/dist/blocks/profiles/index.js +3 -3
- package/dist/blocks/projects/index.d.ts +7 -7
- package/dist/blocks/projects/index.js +7 -7
- package/dist/blocks/promotions/index.d.ts +1 -1
- package/dist/blocks/promotions/index.js +4 -4
- package/dist/blocks/prompts/index.d.ts +1 -1
- package/dist/blocks/prompts/index.js +2 -2
- package/dist/blocks/push/index.d.ts +2 -2
- package/dist/blocks/push/index.js +3 -3
- package/dist/blocks/qualifications/index.d.ts +2 -2
- package/dist/blocks/qualifications/index.js +3 -3
- package/dist/blocks/queue/index.d.ts +96 -3
- package/dist/blocks/queue/index.js +149 -7
- package/dist/blocks/quotes/index.d.ts +1 -1
- package/dist/blocks/quotes/index.js +3 -3
- package/dist/blocks/rank/index.d.ts +1 -1
- package/dist/blocks/rank/index.js +2 -2
- package/dist/blocks/reactions/index.d.ts +4 -4
- package/dist/blocks/reactions/index.js +3 -3
- package/dist/blocks/recruiting/index.d.ts +4 -4
- package/dist/blocks/recruiting/index.js +4 -4
- package/dist/blocks/referrals/index.d.ts +1 -1
- package/dist/blocks/referrals/index.js +2 -2
- package/dist/blocks/relations/index.d.ts +1 -1
- package/dist/blocks/relations/index.js +4 -4
- package/dist/blocks/reminders/index.d.ts +1 -1
- package/dist/blocks/reminders/index.js +1 -1
- package/dist/blocks/reviews/index.d.ts +1 -1
- package/dist/blocks/reviews/index.js +2 -2
- package/dist/blocks/rfqs/index.d.ts +2 -2
- package/dist/blocks/rfqs/index.js +3 -3
- package/dist/blocks/risks/index.d.ts +2 -2
- package/dist/blocks/risks/index.js +2 -2
- package/dist/blocks/saas/index.d.ts +12 -12
- package/dist/blocks/saas/index.js +12 -12
- package/dist/blocks/sales/index.d.ts +1 -1
- package/dist/blocks/sales/index.js +1 -1
- package/dist/blocks/saved-views/index.d.ts +2 -2
- package/dist/blocks/saved-views/index.js +2 -2
- package/dist/blocks/scheduling/index.d.ts +4 -4
- package/dist/blocks/scheduling/index.js +4 -4
- package/dist/blocks/scores/index.d.ts +2 -2
- package/dist/blocks/scores/index.js +3 -3
- package/dist/blocks/search/index.d.ts +4 -4
- package/dist/blocks/search/index.js +2 -2
- package/dist/blocks/security-events/index.d.ts +1 -1
- package/dist/blocks/security-events/index.js +2 -2
- package/dist/blocks/segments/index.d.ts +2 -2
- package/dist/blocks/segments/index.js +3 -3
- package/dist/blocks/sequences/index.d.ts +3 -3
- package/dist/blocks/sequences/index.js +3 -3
- package/dist/blocks/service/index.d.ts +7 -7
- package/dist/blocks/service/index.js +7 -7
- package/dist/blocks/service-accounts/index.d.ts +1 -1
- package/dist/blocks/service-accounts/index.js +2 -2
- package/dist/blocks/sessions/index.d.ts +2 -2
- package/dist/blocks/sessions/index.js +2 -2
- package/dist/blocks/settings/index.d.ts +2 -2
- package/dist/blocks/settings/index.js +3 -3
- package/dist/blocks/share-links/index.d.ts +1 -1
- package/dist/blocks/share-links/index.js +1 -1
- package/dist/blocks/shifts/index.d.ts +2 -2
- package/dist/blocks/shifts/index.js +3 -3
- package/dist/blocks/shipments/index.d.ts +2 -2
- package/dist/blocks/shipments/index.js +4 -4
- package/dist/blocks/signatures/index.d.ts +2 -2
- package/dist/blocks/signatures/index.js +2 -2
- package/dist/blocks/signing-keys/index.d.ts +1 -1
- package/dist/blocks/signing-keys/index.js +2 -2
- package/dist/blocks/sla/index.d.ts +1 -1
- package/dist/blocks/sla/index.js +3 -3
- package/dist/blocks/sso/index.d.ts +1 -1
- package/dist/blocks/sso/index.js +2 -2
- package/dist/blocks/state-machine/index.d.ts +1 -1
- package/dist/blocks/state-machine/index.js +1 -1
- package/dist/blocks/subjects/index.d.ts +2 -2
- package/dist/blocks/subjects/index.js +3 -3
- package/dist/blocks/support/index.d.ts +5 -5
- package/dist/blocks/support/index.js +5 -5
- package/dist/blocks/tags/index.d.ts +2 -2
- package/dist/blocks/tags/index.js +1 -1
- package/dist/blocks/tasks/index.d.ts +2 -2
- package/dist/blocks/tasks/index.js +3 -3
- package/dist/blocks/tax/index.d.ts +2 -2
- package/dist/blocks/tax/index.js +3 -3
- package/dist/blocks/teams/index.d.ts +1 -1
- package/dist/blocks/teams/index.js +1 -1
- package/dist/blocks/templates/index.d.ts +3 -3
- package/dist/blocks/templates/index.js +2 -2
- package/dist/blocks/tills/index.d.ts +1 -1
- package/dist/blocks/tills/index.js +3 -3
- package/dist/blocks/time-tracking/index.d.ts +2 -2
- package/dist/blocks/time-tracking/index.js +2 -2
- package/dist/blocks/timeline/index.d.ts +1 -1
- package/dist/blocks/timeline/index.js +2 -2
- package/dist/blocks/trash/index.d.ts +1 -1
- package/dist/blocks/trash/index.js +2 -2
- package/dist/blocks/undo/index.d.ts +2 -2
- package/dist/blocks/undo/index.js +2 -2
- package/dist/blocks/updated-at/index.d.ts +2 -2
- package/dist/blocks/usage/index.d.ts +3 -3
- package/dist/blocks/usage/index.js +15 -3
- package/dist/blocks/vercel-marketplace/index.d.ts +1 -1
- package/dist/blocks/vercel-marketplace/index.js +2 -2
- package/dist/blocks/versions/index.d.ts +1 -1
- package/dist/blocks/versions/index.js +2 -2
- package/dist/blocks/waitlist/index.d.ts +1 -1
- package/dist/blocks/waitlist/index.js +2 -2
- package/dist/blocks/warehouse/index.d.ts +1 -1
- package/dist/blocks/warehouse/index.js +3 -3
- package/dist/blocks/webhooks/index.d.ts +1 -1
- package/dist/blocks/webhooks/index.js +6 -6
- package/dist/blocks/workflow-editor/index.d.ts +7 -7
- package/dist/blocks/workflow-editor/index.js +3 -3
- package/dist/blocks/workflows/index.d.ts +5 -5
- package/dist/blocks/workflows/index.js +51 -12
- package/dist/{blocks-ERs7xZ7E.d.ts → blocks-DbarkJe1.d.ts} +43 -19
- package/dist/{channel-iJrqCvKh.js → channel-HoCqE6Xb.js} +1 -1
- package/dist/chat-sdk/index.d.ts +549 -131
- package/dist/chat-sdk/index.js +881 -245
- package/dist/claims/index.d.ts +3 -3
- package/dist/cli/{account-D7u3LvNN.js → account-CVomaGBV.js} +1 -1
- package/dist/cli/{account-BGMPSKJs.js → account-Co53476L.js} +1 -1
- package/dist/cli/add-CGR3mLgc.js +1 -0
- package/dist/cli/{add-BXfK7N0H.js → add-Cbuj3vBk.js} +2 -2
- package/dist/cli/{add-Ca3FNbhm.js → add-ymWkkPNw.js} +13 -13
- package/dist/cli/{app-table-files-BR0zwJ7T.js → app-table-files-DoPmytoG.js} +3 -3
- package/dist/cli/{app-tables-DAHcDTFh.js → app-tables-D1rjtFmq.js} +2 -2
- package/dist/cli/{automations-DKKuC8MW.js → automations-DAMWU5je.js} +1 -1
- package/dist/cli/{backfill-DHD9e6XO.js → backfill-DgHzYvi5.js} +162 -6
- package/dist/cli/bin.js +1 -1
- package/dist/cli/{blocks-C4J4d_Jx.js → blocks-CzCYyx9N.js} +2 -2
- package/dist/cli/{blocks-DtEsw6CG.js → blocks-DmIQd43q.js} +1 -1
- package/dist/cli/{cache-DyhfGbUV.js → cache-dmC65uMm.js} +1 -1
- package/dist/cli/{codemod-B7EdR7Fu.js → codemod-CzRpopTy.js} +3 -3
- package/dist/cli/{command-bvbsvYpo.js → command-CLlRvLN9.js} +14 -7
- package/dist/cli/{completion-C8zJwfzA.js → completion-4Ta2j6uu.js} +2 -2
- package/dist/cli/{completion-CsGpvIuo.js → completion-BeyJYbyT.js} +2 -2
- package/dist/cli/{completion-GgZmb_t7.js → completion-DwUZqnou.js} +1 -1
- package/dist/cli/{config-C-DXllAX.js → config-DDzGKmmT.js} +32 -1
- package/dist/cli/{config-DyGupd-1.js → config-DPKOp4D5.js} +1 -1
- package/dist/cli/{config-CWQesy6K.js → config-lZB85ksj.js} +1 -1
- package/dist/cli/{content-mapper-BM9asZuL.js → content-mapper-B6JGZZ-x.js} +2 -2
- package/dist/cli/{db-CVoN3aLl.js → db-XUHrXei6.js} +3 -3
- package/dist/cli/{doctor-BuE0Ry7T.js → doctor-Be-y8dsz.js} +240 -20
- package/dist/cli/{env-Bco8UGR3.js → env-49B92Izr.js} +1 -1
- package/dist/cli/env-BNeYZxBV.js +1 -0
- package/dist/cli/{gen-DMAd__D1.js → gen-CMppeGNK.js} +16 -16
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +8 -8
- package/dist/cli/{init-BfpkhVgY.js → init-qbw1o0Dd.js} +10 -10
- package/dist/cli/{keys-CRf_wOFs.js → keys-DPHVpbjn.js} +1 -1
- package/dist/cli/{live-XBM0kzT3.js → live-RZhHZRFj.js} +2 -2
- package/dist/cli/{mcp-C9HqqPIV.js → mcp-DudhybBp.js} +3 -3
- package/dist/cli/{metadata-dYoVRApT.js → metadata-O2AJ-PDA.js} +3 -3
- package/dist/cli/{migrate-DLWnaHNN.js → migrate-CiGCX8KP.js} +2 -2
- package/dist/cli/{migration-safety-Bh7VzARh.js → migration-safety-Cn2z7UC-.js} +11 -2
- package/dist/cli/{migrations-Cq5hkJsa.js → migrations-6KOIDi_b.js} +2 -2
- package/dist/cli/{module-migration-BUd_MAbE.js → module-migration-XPQbFJib.js} +2 -2
- package/dist/cli/{moved-btVl2MAQ.js → moved-DV_Edueb.js} +1 -1
- package/dist/cli/{parse-ThNFQ1hP.js → parse-CX-x-r5L.js} +1 -1
- package/dist/cli/powersync-BNWYxuB0.js +1 -0
- package/dist/cli/{powersync-Cb8xtLDc.js → powersync-CFOmXWSv.js} +4 -4
- package/dist/cli/{print-BVeE5vr_.js → print-BgO62egM.js} +2 -2
- package/dist/cli/{providers-xmyaROnG.js → providers-Ciss4nHV.js} +1 -1
- package/dist/cli/{prune-workflows-DUOBOuHp.js → prune-workflows-eAi-3R9F.js} +4 -4
- package/dist/cli/{remove-BuasHmdF.js → remove-B-vjuw8U.js} +7 -7
- package/dist/cli/{render-Hvu_ZKtr.js → render-eYxq_mwL.js} +4 -4
- package/dist/cli/{run-1ZTOS-gb.js → run-CLLVkt9B.js} +2 -2
- package/dist/cli/{run-DMZQUy5b.js → run-Cn0Ay_l6.js} +51 -51
- package/dist/cli/{run-KdsUN7Qj.js → run-VHRy6vLi.js} +9 -9
- package/dist/cli/seed-BqsY5MlO.js +1 -0
- package/dist/cli/{seed-C7eiVpBy.js → seed-DNaRUG_M.js} +4 -4
- package/dist/cli/{shared-3cetvs_N.js → shared-CL-Gg-tZ.js} +1 -1
- package/dist/cli/{skills-wZ94Fa8G.js → skills-Bfx3HM5e.js} +1 -1
- package/dist/cli/{snapshot-D7h2oWfS.js → snapshot-BDeHrbby.js} +3 -3
- package/dist/cli/{source-ENOc1zZ9.js → source-BPCSkEGq.js} +1 -1
- package/dist/cli/{source-args-Deg53QHe.js → source-args-DowOyFq5.js} +1 -1
- package/dist/cli/{spec-DGaKqtfR.js → spec-BN7JlljA.js} +3 -3
- package/dist/cli/{spec-CfKQ2Xxd.js → spec-CEiZkG-g.js} +1 -1
- package/dist/cli/{sql-layout-CGlyhvQ1.js → sql-layout-oPEsvcMQ.js} +2 -2
- package/dist/cli/{stack-Dr_oEfmw.js → stack-CwBH6-o8.js} +1 -1
- package/dist/cli/{sync-DFJfT7dH.js → sync-CgpA7QSy.js} +4 -4
- package/dist/cli/{table-DJiZ_PJP.js → table-BEiSh604.js} +1 -1
- package/dist/cli/{upgrade-C2Kdvrj-.js → upgrade-CWx1Pdz2.js} +5 -5
- package/dist/cli/{upgrade-DSi7r0MG.js → upgrade-DPDYkDat.js} +3 -3
- package/dist/cli/{version-AGe2VWGm.js → version-XN1WDU-l.js} +1 -1
- package/dist/client/index.d.ts +5 -5
- package/dist/client/native/index.d.ts +4 -4
- package/dist/{codecs-jdyv13IU.js → codecs-BSDJw_Fn.js} +2 -2
- package/dist/commerce/index.js +2 -2
- package/dist/{compose-DUitDAa_.js → compose-Be6lxp05.js} +1 -1
- package/dist/{composite-CQjoTPwv.js → composite-qffn948S.js} +1 -1
- package/dist/config/index.d.ts +5 -5
- package/dist/config/index.js +4 -4
- package/dist/{config-DYtSlwsi.js → config-DVRBLGIK.js} +3 -3
- package/dist/{config-gJ9FX0jc.js → config-DwPO3Dcs.js} +1 -1
- package/dist/{context-DNwBlpKo.d.ts → context-NgBzQFD8.d.ts} +61 -4
- package/dist/contract/index.d.ts +3 -3
- package/dist/{controller-DfgxFNFx.d.ts → controller-XiTA4O2z.d.ts} +1 -1
- package/dist/{conversion-BzVxeYqk.d.ts → conversion-BYSDK6_r.d.ts} +1 -1
- package/dist/create/index.d.ts +4 -4
- package/dist/create/index.js +3 -3
- package/dist/create/lite/index.d.ts +2 -2
- package/dist/create/lite/index.js +3 -3
- package/dist/{create-blocks-DupJA8Lw.js → create-blocks-X59FRi6t.js} +2 -2
- package/dist/credentials/index.js +3 -3
- package/dist/{deal-forecast-CgzuxYtf.js → deal-forecast-DWwQ_ZL6.js} +2 -2
- package/dist/{define-block-DiW9g10_.d.ts → define-block-DLqYhrYF.d.ts} +3 -3
- package/dist/{delivery-events-DUiTctdo.js → delivery-events-BNBvla4y.js} +1 -1
- package/dist/{drive-CvgLTJA9.d.ts → drive-CnOz5P5H.d.ts} +2 -2
- package/dist/e-invoicing/index.js +1 -1
- package/dist/edge/index.js +3 -3
- package/dist/embeddings-CCPghrsU.js +249 -0
- package/dist/{embeddings-Dm-GSHAi.d.ts → embeddings-DoNwEveb.d.ts} +52 -4
- package/dist/{entitlements-5nbdIitJ.d.ts → entitlements-7iVfWIy8.d.ts} +1 -1
- package/dist/{entitlements-BxZpcgcb.js → entitlements-CE-fFbUR.js} +2 -2
- package/dist/{errors-DCJMVeY7.js → errors-B3EJToP_.js} +72 -19
- package/dist/eve/index.d.ts +4 -4
- package/dist/eve/index.js +2 -2
- package/dist/{eve-DRYPT58Y.d.ts → eve-UQ0RZX-K.d.ts} +2 -2
- package/dist/{executor-COn2O4fg.d.ts → executor-mRSXEFIB.d.ts} +1 -1
- package/dist/expo/index.js +2 -2
- package/dist/{extract-DpiLKlbp.d.ts → extract-4SajsgPj.d.ts} +2 -2
- package/dist/fhir/index.js +1 -1
- package/dist/{field-errors-BCX7RCEc.d.ts → field-errors-B6sHzfiG.d.ts} +5 -5
- package/dist/{flags-oS3Mbyfc.js → flags-CtmDvszx.js} +1 -1
- package/dist/flags-sdk/index.js +5 -3
- package/dist/{framework-D8eW-nTX.js → framework-CD0tHWLN.js} +1 -1
- package/dist/{gateway-DjJYyq6h.d.ts → gateway-BsE1qacd.d.ts} +2 -2
- package/dist/{history-6KiVNWdH.js → history-CoX8QoXr.js} +21 -6
- package/dist/hono/index.js +2 -2
- package/dist/{inbox-BnELyPRZ.d.ts → inbox-i3nEfNHG.d.ts} +21 -1
- package/dist/{index-B8Mjb-KA.d.ts → index---6uF_J0.d.ts} +1 -1
- package/dist/{index-CFT7e_HH.d.ts → index-7-mAsoAB.d.ts} +2 -2
- package/dist/{index-CakXRuAZ.d.ts → index-B2HOIiNe.d.ts} +2 -2
- package/dist/{index-DMlTXcWp.d.ts → index-B9sdIEmz.d.ts} +2 -2
- package/dist/{index-ZI4sMVPT.d.ts → index-BEyOO6xN.d.ts} +2 -2
- package/dist/{index-BB5n8R_s.d.ts → index-BHlGYVat.d.ts} +1 -1
- package/dist/{index-D48wVmDj.d.ts → index-BUGFN7Lu.d.ts} +1 -1
- package/dist/{index-DHwPGqLY.d.ts → index-BaI1DFjU.d.ts} +2 -2
- package/dist/{index-BMYIwvDA.d.ts → index-BjMlZ2la.d.ts} +1 -1
- package/dist/{index-D6y6ojUX.d.ts → index-BpW3Kn-H.d.ts} +2 -2
- package/dist/{index-CurH6bgW.d.ts → index-C35Mxkfj.d.ts} +1 -1
- package/dist/{index-Bn5v6soX.d.ts → index-CA5xzl6j.d.ts} +1 -1
- package/dist/{index-D5LnplxJ.d.ts → index-CBTA4Hus.d.ts} +6 -6
- package/dist/{index-EHczIYa7.d.ts → index-CFfFev2y.d.ts} +72 -5
- package/dist/{index-BolFrOMw.d.ts → index-CaUkbhw7.d.ts} +2 -2
- package/dist/{index-BGgGwWcn.d.ts → index-Cfft6iUs.d.ts} +1 -1
- package/dist/{index-BW0aDURc.d.ts → index-CsngKWje.d.ts} +1 -1
- package/dist/{index-BNBFiyOR.d.ts → index-D89tUktw.d.ts} +1 -1
- package/dist/{index-BK8zPigx.d.ts → index-DDIZwUK-.d.ts} +1 -1
- package/dist/{index-BZ1Akcrg.d.ts → index-D_JS5FYo.d.ts} +1 -1
- package/dist/{index-BLL45v55.d.ts → index-Dh-CE1YF.d.ts} +1 -1
- package/dist/{index-DkWXofPH.d.ts → index-Dk039ZLg.d.ts} +1 -1
- package/dist/{index-DZTavebO.d.ts → index-Do2iK7pF.d.ts} +1 -1
- package/dist/{index-IKK8zWTN.d.ts → index-DpQ1JuKa.d.ts} +2 -2
- package/dist/{index-S6axmDQL.d.ts → index-Drjrj8Y5.d.ts} +2 -2
- package/dist/{index-7UV0pNYj.d.ts → index-Dvu6MySL.d.ts} +2 -2
- package/dist/{index-B2C1NczA.d.ts → index-LnDm58TV.d.ts} +4 -4
- package/dist/{index-D25Ry5R9.d.ts → index-P5Xhtrzo.d.ts} +1 -1
- package/dist/{index-CRSNN2v9.d.ts → index-PV91A2_J.d.ts} +8 -8
- package/dist/{index-B1NcZsVD.d.ts → index-VaTlShTa.d.ts} +7 -7
- package/dist/{index-iaMOudmP.d.ts → index-aNW_fYBI.d.ts} +1 -1
- package/dist/{index-Bdg6ee4m.d.ts → index-b5FUPI-5.d.ts} +1 -1
- package/dist/{index-1001GtVL.d.ts → index-hkFhFgRv.d.ts} +1 -1
- package/dist/{index-kidoYhB8.d.ts → index-jaxdP0Qe.d.ts} +1 -1
- package/dist/index-nFxtUFQv.d.ts +11 -0
- package/dist/{index-Bopuqb8z.d.ts → index-oR-iOHLT.d.ts} +4 -4
- package/dist/{index-DplKvjCs.d.ts → index-qPP3ja-K.d.ts} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{instances-ukDFg8oN.js → instances-CAzvtvlH.js} +119 -8
- package/dist/json-render/index.d.ts +91 -0
- package/dist/json-render/index.js +233 -0
- package/dist/{knowledge-DL1ZnEe7.d.ts → knowledge-CjrMiSnp.d.ts} +59 -9
- package/dist/{knowledge-CQl9LXaZ.js → knowledge-m3IJobAw.js} +22 -10
- package/dist/{manifest-DKY9HGin.js → manifest-12CvUHma.js} +3 -3
- package/dist/{manifest-DI_Vz152.d.ts → manifest-1CNHDf-P.d.ts} +2 -2
- package/dist/{manifest-D8JpSvuE.js → manifest-1X1rpQ-5.js} +3 -3
- package/dist/{manifest-BSQh5dw2.js → manifest-1qVuPpg1.js} +2 -2
- package/dist/{manifest-Cxz4_mWy.d.ts → manifest-279mgqK2.d.ts} +1 -1
- package/dist/{manifest-Cu_4X5Rm.js → manifest-3mRZEFbA.js} +2 -2
- package/dist/{manifest-ppItbSA5.d.ts → manifest-4-J2cBhl.d.ts} +1 -1
- package/dist/{manifest-BhBqFYV4.d.ts → manifest-4Ei8W6XJ.d.ts} +1 -1
- package/dist/{manifest-BEZ8HltH.js → manifest-638tYNw7.js} +2 -2
- package/dist/{manifest-BXNDl7bx.js → manifest-AFBjJxrJ.js} +2 -2
- package/dist/{manifest-B_3_99xa.js → manifest-AI6u-id7.js} +3 -3
- package/dist/{manifest-C95-cClh.js → manifest-B1Xj7ObD.js} +1 -1
- package/dist/{manifest-_qzN4kUG.js → manifest-B2G5B8ty.js} +2 -2
- package/dist/{manifest-CPYEEX6u.js → manifest-B3Fs0ZeU.js} +8 -3
- package/dist/{manifest-DJRHzb6v.js → manifest-B5c8gqof.js} +2 -2
- package/dist/{manifest-Dagm1cVO.d.ts → manifest-BAEYvNSN.d.ts} +1 -1
- package/dist/{manifest-CJByGKJ_.d.ts → manifest-BBCFaNss.d.ts} +1 -1
- package/dist/{manifest-CRXxYu5L.js → manifest-BEyhZ8sV.js} +3 -3
- package/dist/{manifest-ycsWja2O.d.ts → manifest-BFXftMd7.d.ts} +1 -1
- package/dist/{manifest--eIzr9Tj.js → manifest-BFbZ2mZA.js} +2 -2
- package/dist/{manifest-C0f5YJ7x.d.ts → manifest-BFi8-A1w.d.ts} +1 -1
- package/dist/{manifest-DeCjklgV.js → manifest-BHaR8iYx.js} +2 -2
- package/dist/{manifest-BKD8DbQT.js → manifest-BI65KPyR.js} +4 -4
- package/dist/{manifest-DHYr9yD1.js → manifest-BIOzNAsT.js} +2 -2
- package/dist/{manifest-CKxnGCVY.d.ts → manifest-BJ7XyLlV.d.ts} +1 -1
- package/dist/{manifest-DM2T_dN2.js → manifest-BKvawy3P.js} +3 -3
- package/dist/{manifest-C-_0WkGx.d.ts → manifest-BNR_72jF.d.ts} +4 -3
- package/dist/{manifest-BcdRITPc.d.ts → manifest-BOQOTepZ.d.ts} +1 -1
- package/dist/{manifest-DqwQmPZb.js → manifest-BP7YQERu.js} +3 -3
- package/dist/{manifest-C_hIU5kk.js → manifest-BPeoWfAO.js} +3 -3
- package/dist/{manifest-DHt1h5GN.js → manifest-BPpt2s0a.js} +3 -3
- package/dist/{manifest-6MuVEQnP.js → manifest-BQobHp4x.js} +5 -5
- package/dist/{manifest-BgMjraZw.js → manifest-BRgWZzVn.js} +3 -3
- package/dist/{manifest-CCXaDWdN.d.ts → manifest-BS1QA4mT.d.ts} +1 -1
- package/dist/{manifest-JvgqqKRq.js → manifest-BW6RRJXm.js} +2 -2
- package/dist/{manifest-K_42e50M.d.ts → manifest-BWIcNHVs.d.ts} +1 -1
- package/dist/{manifest-Hx3FBHKX.js → manifest-BXIL-A7I.js} +1 -1
- package/dist/{manifest-C3VB7-hM.d.ts → manifest-BaQ-A5Jy.d.ts} +2 -2
- package/dist/{manifest-D3HTgmR3.d.ts → manifest-BaR4cYwY.d.ts} +1 -1
- package/dist/{manifest-DjVqN_iK.d.ts → manifest-Bc1-GptG.d.ts} +1 -1
- package/dist/{manifest-C8Boo7Ps.js → manifest-Bea2AWYl.js} +4 -4
- package/dist/{manifest-1Xiu6zqs.js → manifest-BgKbxGVp.js} +2 -2
- package/dist/{manifest-Dbq6t-bI.d.ts → manifest-BhhX6xjo.d.ts} +1 -1
- package/dist/{manifest-Dm_5DTyx.js → manifest-BhpXYw_3.js} +2 -2
- package/dist/{manifest-BHNrIQ8X.d.ts → manifest-BieAORBI.d.ts} +1 -1
- package/dist/{manifest-D2qeEjrC.d.ts → manifest-Bk69YFI3.d.ts} +1 -1
- package/dist/{manifest-gCNbUW-X.js → manifest-BnJ_9tgk.js} +2 -2
- package/dist/{manifest-1lzhOO0z.d.ts → manifest-BqCQrbSP.d.ts} +2 -2
- package/dist/{manifest-DnZw4JWP.js → manifest-Brv_Pss2.js} +2 -2
- package/dist/{manifest-D7y9_k5i.d.ts → manifest-BuEIqayB.d.ts} +1 -1
- package/dist/{manifest-OS0pwPRn.d.ts → manifest-BxRL6XuJ.d.ts} +1 -1
- package/dist/{manifest-qb_YXiWK.js → manifest-BydKYd32.js} +2 -2
- package/dist/{manifest-FkY_rpfH.js → manifest-C-ROCYHF.js} +5 -5
- package/dist/{manifest-BfAXsd-X.d.ts → manifest-C1JGYvR-.d.ts} +1 -1
- package/dist/{manifest-gGOpzRmJ.d.ts → manifest-C3d7DJiE.d.ts} +1 -1
- package/dist/{manifest-D84UV5p6.js → manifest-C5NzuW_p.js} +2 -2
- package/dist/{manifest-A_VPz6fq.js → manifest-C75gu7oi.js} +2 -2
- package/dist/{manifest-BdmDmQtx.js → manifest-CBj4zlpo.js} +4 -4
- package/dist/{manifest-BKDSuS3x.d.ts → manifest-CFb---rO.d.ts} +2 -2
- package/dist/{manifest-BHhBqtFw.js → manifest-CFq6WJJO.js} +4 -4
- package/dist/{manifest-Bbtt8mb1.d.ts → manifest-CGJ2xLRu.d.ts} +1 -1
- package/dist/{manifest-DpwaOTir.js → manifest-CHheBZjl.js} +3 -3
- package/dist/{manifest-B83YpMlz.d.ts → manifest-CJzK3H3h.d.ts} +1 -1
- package/dist/{manifest-ClbUuESE.js → manifest-CKT1bZoZ.js} +2 -2
- package/dist/{manifest-Cj5IjsCB.js → manifest-CLFmOMSQ.js} +2 -2
- package/dist/{manifest-B9KmOzmT.d.ts → manifest-CMmfdgAG.d.ts} +1 -1
- package/dist/{manifest-Bx_0qkBP.js → manifest-COnvr04R.js} +2 -2
- package/dist/{manifest-mu_UflgB.d.ts → manifest-CR_RHsHu.d.ts} +1 -1
- package/dist/{manifest-BTC6dWdq.d.ts → manifest-CSLqw5qE.d.ts} +1 -1
- package/dist/{manifest-BDGVge5o.js → manifest-CWkdEugm.js} +2 -2
- package/dist/{manifest-DS2PjAgW.js → manifest-CXTVwg4s.js} +3 -3
- package/dist/{manifest-CX8DVTzn.js → manifest-CY-bInzt.js} +3 -3
- package/dist/{manifest-BZP0wKpE.js → manifest-CaZnTLGe.js} +3 -3
- package/dist/{manifest-B4CVN-Kx.js → manifest-CbdezcLS.js} +2 -2
- package/dist/{manifest-B3QwQDTx.js → manifest-Ccjdt-zG.js} +3 -3
- package/dist/{manifest-BW7wdKXA.js → manifest-CdDdPHbV.js} +4 -4
- package/dist/{manifest-cqfeLW8g.js → manifest-CeN-ohYP.js} +2 -2
- package/dist/{manifest-B7MpuCmz.d.ts → manifest-Cge4urPD.d.ts} +1 -1
- package/dist/{manifest-DsYIWD--.js → manifest-CiAp3lJg.js} +2 -2
- package/dist/{manifest-BFJvys4-.js → manifest-CmtXDmOP.js} +3 -3
- package/dist/{manifest-CJb0PtMj.d.ts → manifest-Cq3zIydP.d.ts} +1 -1
- package/dist/{manifest-DLv_WaSF.d.ts → manifest-Cs5-Vi9X.d.ts} +1 -1
- package/dist/{manifest-DwVl4YC4.d.ts → manifest-CsVTMa-G.d.ts} +1 -1
- package/dist/{manifest-DBsPHetA.js → manifest-Ct3CZB2E.js} +2 -2
- package/dist/{manifest--M7GmEPg.d.ts → manifest-CyKD7Hyx.d.ts} +1 -1
- package/dist/{manifest-DNaSpmZ3.js → manifest-Cytb-iJk.js} +2 -2
- package/dist/{manifest-Cj_ZnW6k.js → manifest-D-sJpAJB.js} +3 -3
- package/dist/{manifest-Bpzxyvxc.js → manifest-D0ceE9Zm.js} +3 -3
- package/dist/{manifest-CIJTIKo3.d.ts → manifest-D1FhVaUw.d.ts} +1 -1
- package/dist/{manifest-CLphqjtj.d.ts → manifest-D2URJ82u.d.ts} +1 -1
- package/dist/{manifest-Czv_oJ77.js → manifest-D2r45JYc.js} +2 -2
- package/dist/{manifest-DBJ5nBG9.d.ts → manifest-D3V8Ngw3.d.ts} +1 -1
- package/dist/{manifest-B709eXLx.js → manifest-D5UYH-l1.js} +2 -2
- package/dist/{manifest-DVnOUxy4.js → manifest-D5gmrL5j.js} +6 -6
- package/dist/{manifest-BQwqV6dQ.js → manifest-D6k-MFrE.js} +4 -4
- package/dist/{manifest-BoSzgLUl.js → manifest-D72opuEP.js} +3 -3
- package/dist/{manifest-DJ5nCW5K.js → manifest-D8ljY6Fz.js} +4 -4
- package/dist/{manifest-DemyeI_z.js → manifest-D96KwsqD.js} +4 -4
- package/dist/{manifest-Bz3xNPJL.d.ts → manifest-D9B8QIWz.d.ts} +1 -1
- package/dist/{manifest-BkS073Py.d.ts → manifest-DA0Q62es.d.ts} +1 -1
- package/dist/{manifest-CYNC6a1d.js → manifest-DAu2qpOy.js} +2 -2
- package/dist/{manifest-0vrTq9Uf.d.ts → manifest-DB6dSXpw.d.ts} +1 -1
- package/dist/{manifest-Db-GUsLH.d.ts → manifest-DKY1mHtE.d.ts} +1 -1
- package/dist/{manifest-CQFlAwfU.d.ts → manifest-DOIRQHB8.d.ts} +2 -2
- package/dist/{manifest-0PDfKdtc.js → manifest-DR8po1OZ.js} +4 -4
- package/dist/{manifest-ITF-BpEi.js → manifest-D_RCNlv9.js} +4 -4
- package/dist/{manifest-CR-6QDLZ.d.ts → manifest-D_gWI_Xp.d.ts} +1 -1
- package/dist/{manifest-BR_uGpTd.js → manifest-DaZ7LEOi.js} +2 -2
- package/dist/{manifest-Dz2IkqqY.d.ts → manifest-DfaKFvmO.d.ts} +1 -1
- package/dist/{manifest-DPFn2x18.d.ts → manifest-Dg4rFnjr.d.ts} +1 -1
- package/dist/{manifest-n9XQtQXA.d.ts → manifest-DhYiWMYQ.d.ts} +1 -1
- package/dist/{manifest-BfOHwSNK.js → manifest-DjIq3ZJf.js} +7 -7
- package/dist/{manifest-D7yeYU0f.d.ts → manifest-DnSrbZuv.d.ts} +1 -1
- package/dist/{manifest-D7slgR5H.d.ts → manifest-Do4TvdNR.d.ts} +1 -1
- package/dist/{manifest-DdFl3BYM.d.ts → manifest-Do7f1k9C.d.ts} +1 -1
- package/dist/{manifest--qnXa2lK.js → manifest-Dr-wuvfR.js} +4 -4
- package/dist/{manifest-yPcrAK5N.d.ts → manifest-Dr5yltSj.d.ts} +10 -3
- package/dist/{manifest-CbxMRPGY.js → manifest-DunhKI5K.js} +4 -4
- package/dist/{manifest-C3RDEoAr.d.ts → manifest-Duq5aCrY.d.ts} +1 -1
- package/dist/{manifest-J6kJX8YL.js → manifest-DuwJ7Ya_.js} +3 -3
- package/dist/{manifest-FJi1pYoB.js → manifest-Dxob7J6V.js} +6 -6
- package/dist/{manifest-Dj9AIgTy.d.ts → manifest-DzNmDhoS.d.ts} +1 -1
- package/dist/{manifest-CHsjS47_.d.ts → manifest-FqJtbN5n.d.ts} +1 -1
- package/dist/{manifest-roKO06Ko.d.ts → manifest-I7nR1vhO.d.ts} +1 -1
- package/dist/{manifest-o-EzlFwZ.js → manifest-N-vJi36T.js} +2 -2
- package/dist/{manifest-FAVN8Bg9.js → manifest-UHMLAfCl.js} +2 -2
- package/dist/{manifest-BKegpJgn.d.ts → manifest-VoN5Ae-i.d.ts} +1 -1
- package/dist/{manifest-DDkncgRB.d.ts → manifest-XRDA_p9P.d.ts} +1 -1
- package/dist/{manifest-Di0UrbTw.d.ts → manifest-ZQvywRBI.d.ts} +1 -1
- package/dist/{manifest-COZUTRxz.js → manifest-aWO0h4lZ.js} +3 -3
- package/dist/{manifest-D7R4sM8L.d.ts → manifest-hpPeciuH.d.ts} +1 -1
- package/dist/{manifest-CkYNs6PX.js → manifest-iNt_0t6h.js} +4 -4
- package/dist/{manifest-BAgqRR7p.js → manifest-j5YiEWqV.js} +2 -2
- package/dist/{manifest-D_iJU__f.d.ts → manifest-jRpt7muB.d.ts} +1 -1
- package/dist/{manifest-xD290bNh.js → manifest-jU8fwfLu.js} +3 -3
- package/dist/{manifest-DCC3phPq.js → manifest-nR_d-Ivi.js} +1 -1
- package/dist/{manifest-BRd1q660.d.ts → manifest-nyksTa_6.d.ts} +1 -1
- package/dist/{manifest-CWaCXYgf.js → manifest-p4Yvamix.js} +2 -2
- package/dist/{manifest-BQJV63RV.js → manifest-pKQ4z-dv.js} +1 -1
- package/dist/{manifest-DbjDYuCE.js → manifest-q62slcP6.js} +2 -2
- package/dist/{manifest-UbBXSkXn.d.ts → manifest-uDAAzAlQ.d.ts} +1 -1
- package/dist/{manifest-CtOwRTvP.js → manifest-upxzRaY-.js} +2 -2
- package/dist/{manifest-DW2_P6AT.js → manifest-vaCUz3Wa.js} +3 -3
- package/dist/{manifest-Dqgqm1Zo.js → manifest-vabt4x2a.js} +3 -3
- package/dist/{manifest-Cfvr-BhF.js → manifest-wSbIcOln.js} +19 -7
- package/dist/mapper/bin.js +7 -7
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/sdk/index.js +1 -1
- package/dist/{mcp-Bx9wzQw6.js → mcp-D1d_uDNE.js} +2 -2
- package/dist/{message-Cc4bkdNw.d.ts → message-Chvocrom.d.ts} +27 -4
- package/dist/{model-messages-OmbNNuN2.js → model-messages-BgSCTojd.js} +1 -1
- package/dist/{model-messages-CGSUU450.d.ts → model-messages-CK7L1_hV.d.ts} +1 -1
- package/dist/{money-codec-CvUy3_Ep.js → money-codec-lrXaOqi7.js} +1 -1
- package/dist/next/index.d.ts +7 -7
- package/dist/next/index.js +5 -5
- package/dist/{operations-Di203azT.d.ts → operations-BSsNQ81h.d.ts} +1 -1
- package/dist/{options-CyYZvdSy.js → options-BNtLQZrG.js} +2 -1
- package/dist/{options-SOjQVgfS.js → options-BYlcrVVf.js} +1 -0
- package/dist/options-BxOFSs-u.js +4 -0
- package/dist/orpc/index.d.ts +1 -1
- package/dist/orpc/index.js +1 -1
- package/dist/otel/index.d.ts +1 -1
- package/dist/otel/index.js +5 -5
- package/dist/{parse-H3g3kyZa.js → parse-Iz0DTVot.js} +2 -2
- package/dist/{payments-D89SVEgj.js → payments-DjrRAHBY.js} +1 -1
- package/dist/{permissions-C7GgjgTA.d.ts → permissions-CrPkD5Ik.d.ts} +1 -1
- package/dist/{ports-6EMtxwGE.d.ts → ports-Z6S_jGD7.d.ts} +1 -1
- package/dist/powersync/index.d.ts +3 -3
- package/dist/preset/index.d.ts +4 -4
- package/dist/preset/index.js +3 -3
- package/dist/{preset-Be8m6-PH.js → preset-D2dg-EVp.js} +3 -2
- package/dist/{preview-DCndUjk9.js → preview-B7OjoABd.js} +3 -3
- package/dist/{preview-Dlc_7tMK.d.ts → preview-Bgwwuvc9.d.ts} +2 -2
- package/dist/{project-CwZtBezd.js → project-Dhm0C7OR.js} +5 -5
- package/dist/{provider-DRGTjcBY.js → provider-Bkh8zSHN.js} +1 -1
- package/dist/{push-token-CQnqTZrb.d.ts → push-token-hDDp188w.d.ts} +1 -1
- package/dist/query/index.d.ts +1 -1
- package/dist/rate-limit/index.d.ts +1 -1
- package/dist/rate-limit/index.js +1 -1
- package/dist/{rate-limit-Bl_jNyAg.d.ts → rate-limit-A_ngDsV_.d.ts} +17 -0
- package/dist/{rate-limit-Df913_w3.js → rate-limit-Jl-5e7s8.js} +30 -10
- package/dist/react/index.d.ts +5 -5
- package/dist/react/index.js +1 -1
- package/dist/react/native/index.d.ts +1 -1
- package/dist/react/server.d.ts +5 -5
- package/dist/react/server.js +1 -1
- package/dist/{react-CsgcTKRk.js → react-DIfKgdfV.js} +2 -2
- package/dist/{react-CqOVutZj.js → react-DnOu9xsi.js} +3 -3
- package/dist/react-router/index.js +2 -2
- package/dist/realtime/index.d.ts +3 -3
- package/dist/realtime/index.js +2 -2
- package/dist/{record-form-DqGcUu0C.d.ts → record-form-Bye6v7Sg.d.ts} +1 -1
- package/dist/{recordings-CiYHdFPa.d.ts → recordings-16Flkx9W.d.ts} +1 -1
- package/dist/records/index.d.ts +7 -7
- package/dist/{route-optimizer-DqUyDP78.js → route-optimizer-Ds11cQyM.js} +1 -1
- package/dist/{rows-Ccg381fF.js → rows-DidUYmOx.js} +1 -1
- package/dist/{rows-CTzeKlaI.js → rows-kSV-CDYA.js} +2 -2
- package/dist/runs-CEm5AFQk.js +91 -0
- package/dist/{sales-C8o3E5U3.js → sales-DNuk5v36.js} +7 -7
- package/dist/{sales-lines-COFwijz1.js → sales-lines-mwRnIC9p.js} +3 -3
- package/dist/{sales-shared-DGSptcqA.js → sales-shared-Ca2ZDF6a.js} +1 -1
- package/dist/{sales-variants-D0oxdF-6.js → sales-variants-QTgChYXJ.js} +1 -1
- package/dist/{scores-CQt_G6T-.js → scores-Opsegupn.js} +2 -2
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +4 -4
- package/dist/{settings-B4NApcY7.js → settings-Bf5nmbl-.js} +2 -2
- package/dist/{sign-in-Dd5ljzNG.js → sign-in-BYJboUBW.js} +1 -1
- package/dist/{signing-keys-B2bpJ3eJ.js → signing-keys-sYy92dAx.js} +2 -2
- package/dist/solid/index.d.ts +5 -5
- package/dist/solid-start/index.js +2 -2
- package/dist/spec/index.d.ts +2 -2
- package/dist/spec/index.js +2 -2
- package/dist/{spec-pins-D2Q41RiK.d.ts → spec-pins-Bb6V8nR2.d.ts} +1 -1
- package/dist/{spec-pins-BtVFN8wA.js → spec-pins-Dlz8OVqi.js} +1 -1
- package/dist/sql/index.d.ts +6 -6
- package/dist/sql/index.js +3 -3
- package/dist/{sql-BPU70zf9.js → sql-DrlapNYO.js} +3365 -788
- package/dist/{sso-gMj8CIpe.js → sso-RsAYRs9q.js} +2 -2
- package/dist/ssr/index.d.ts +1 -1
- package/dist/{store-DHoKrWYZ.d.ts → store-CGXNwUwi.d.ts} +6 -1
- package/dist/streams/index.d.ts +59 -2
- package/dist/streams/index.js +111 -22
- package/dist/streams/redis/index.d.ts +8 -1
- package/dist/streams/redis/index.js +12 -4
- package/dist/streams/resumable/index.d.ts +68 -0
- package/dist/streams/resumable/index.js +71 -0
- package/dist/{subject-readers-B5YcD7CO.js → subject-readers-DhXR7Tdk.js} +1 -1
- package/dist/svelte/index.d.ts +5 -5
- package/dist/sveltekit/index.js +2 -2
- package/dist/tanstack-start/index.js +2 -2
- package/dist/{tax-D_M90sFh.js → tax-Deg3udmG.js} +1 -1
- package/dist/{tee-eneLXtYJ.js → tee-CHLXLuvg.js} +2 -1
- package/dist/{tenant-DHLx2ZkL.d.ts → tenant-DYOUVE8r.d.ts} +1 -1
- package/dist/testing/index.d.ts +13 -12
- package/dist/testing/index.js +60 -15
- package/dist/{timeline-9mP3m30L.d.ts → timeline-DTE4-6Hq.d.ts} +2 -2
- package/dist/{topic-DVr01uhB.js → topic-CLEQ3t6o.js} +25 -2
- package/dist/{topic-BKsRT4gu.d.ts → topic-DrN4Af8U.d.ts} +16 -1
- package/dist/{transport-CS4cVH4S.js → transport-CZBRg-9e.js} +7 -3
- package/dist/{types-Y1Oa950J.d.ts → types-BKtpHTHc.d.ts} +8 -0
- package/dist/{types-B2y4HmKY.d.ts → types-C941lZYk.d.ts} +1 -1
- package/dist/{types-D9r3axee.d.ts → types-DTNDqdyT.d.ts} +2 -2
- package/dist/{types-zYtQ5JDy.d.ts → types-D_o60OcA.d.ts} +1 -1
- package/dist/{types-DlG6Uj4P.d.ts → types-DeKSApwU.d.ts} +2 -2
- package/dist/{undo-DNRfstwk.js → undo-BXeYO6gy.js} +2 -2
- package/dist/{usage-CFVOHbUu.d.ts → usage-D7CYIk1m.d.ts} +22 -0
- package/dist/vue/index.d.ts +5 -5
- package/dist/{watch-topic-M1yL9NiW.d.ts → watch-topic-ClQWiVZ1.d.ts} +1 -1
- package/dist/{webhook-inbox-BamK2_Vw.js → webhook-inbox-B36XJ2eY.js} +25 -2
- package/dist/webmcp/index.d.ts +1 -1
- package/dist/webmcp/index.js +1 -1
- package/dist/workflow-sdk/builder/index.d.ts +3 -3
- package/dist/workflow-sdk/builder/index.js +1 -1
- package/dist/workflow-sdk/index.d.ts +7 -3
- package/dist/workflow-sdk/index.js +16 -74
- package/dist/workflow-sdk/world/index.d.ts +48 -3
- package/dist/workflow-sdk/world/index.js +326 -31
- package/dist/{workflow-sdk-BCNusk7Y.d.ts → workflow-sdk-Bdp_VQ3Q.d.ts} +37 -3
- package/dist/{workflow-sdk-cHlpMyLV.js → workflow-sdk-ID8eoPMe.js} +108 -7
- package/dist/{workflow-sdk-CcoFSLFn.js → workflow-sdk-j7xorOLf.js} +230 -60
- package/dist/{workflows-DjVrHu22.d.ts → workflows-C6fR7YGm.d.ts} +56 -15
- package/dist/yjs/index.d.ts +1 -1
- package/dist/yjs/index.js +1 -1
- package/package.json +41 -11
- package/schemas/ai-message-v2.json +290 -0
- package/schemas/config-v1.json +29 -1
- package/schemas/design-v1.json +45 -0
- package/schemas/doctor-report-v1.json +5 -0
- package/skills/better-supabase/references/ui-recipes.md +77 -0
- package/skills/better-supabase-api/SKILL.md +2 -2
- package/skills/better-supabase-api/references/ai.md +56 -0
- package/skills/better-supabase-api/references/streams-credentials.md +5 -0
- package/dist/cli/add-4-omCrbh.js +0 -1
- package/dist/cli/env-C9HRYvnX.js +0 -1
- package/dist/cli/powersync-ZBM_emZL.js +0 -1
- package/dist/cli/seed-Ki7TgmY1.js +0 -1
- package/dist/embeddings-bZWDJ5yx.js +0 -129
package/dist/ai-sdk/index.js
CHANGED
|
@@ -1,10 +1,239 @@
|
|
|
1
|
+
import { t as DbException } from "../db-exception-Dv18UZ-I.js";
|
|
2
|
+
import { n as dbError } from "../errors-CXPerGIl.js";
|
|
1
3
|
import { n as isRecord } from "../guards-CsRa6v57.js";
|
|
2
4
|
import { s as nowInstant } from "../temporal-DKTdGK9i.js";
|
|
3
5
|
import { t as gatewayOptions } from "../gateway-options-DQGQzdkD.js";
|
|
4
|
-
import { _ as usageOf, a as fromUIMessage, c as toUIMessage, d as costBackfill, f as modelCatalogRefresh, g as usageEntries, i as DENIED_TOOL_OUTPUT, l as toUIMessages, m as problem429, n as aiErrorToDbError, o as isUIMessage, p as modelInputOf, r as AI_SDK_UI_FORMAT, t as aiErrorMessage, u as validUIMessages, v as usageQuota } from "../errors-
|
|
5
|
-
import { t as fromModelMessages } from "../model-messages-
|
|
6
|
+
import { _ as usageOf, a as fromUIMessage, c as toUIMessage, d as costBackfill, f as modelCatalogRefresh, g as usageEntries, i as DENIED_TOOL_OUTPUT, l as toUIMessages, m as problem429, n as aiErrorToDbError, o as isUIMessage, p as modelInputOf, r as AI_SDK_UI_FORMAT, t as aiErrorMessage, u as validUIMessages, v as usageQuota } from "../errors-B3EJToP_.js";
|
|
7
|
+
import { t as fromModelMessages } from "../model-messages-BgSCTojd.js";
|
|
6
8
|
import { i as trackedSandbox, n as byokOptions, r as tenantGatewayOptions, t as BYOK_FIELD } from "../providers-DOEILK7D.js";
|
|
7
|
-
import { generateText, jsonSchema, tool } from "ai";
|
|
9
|
+
import { generateText, jsonSchema, tool, toolSearch, transcribe } from "ai";
|
|
10
|
+
// src/ai-sdk/guardrails.ts
|
|
11
|
+
const DEFAULT_REFUSAL = "This request can't be processed.";
|
|
12
|
+
const ZERO_USAGE = {
|
|
13
|
+
inputTokens: {
|
|
14
|
+
total: 0,
|
|
15
|
+
noCache: 0,
|
|
16
|
+
cacheRead: 0,
|
|
17
|
+
cacheWrite: 0
|
|
18
|
+
},
|
|
19
|
+
outputTokens: {
|
|
20
|
+
total: 0,
|
|
21
|
+
text: 0,
|
|
22
|
+
reasoning: 0
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const STOP = {
|
|
26
|
+
unified: "stop",
|
|
27
|
+
raw: void 0
|
|
28
|
+
};
|
|
29
|
+
function lastUserIndex(prompt) {
|
|
30
|
+
for (let index = prompt.length - 1; index >= 0; index -= 1) if (prompt[index]?.role === "user") return index;
|
|
31
|
+
return -1;
|
|
32
|
+
}
|
|
33
|
+
function textOfUser(prompt, index) {
|
|
34
|
+
const message = prompt[index];
|
|
35
|
+
return message?.role === "user" ? message.content.flatMap((part) => part.type === "text" ? [part.text] : []).join("\n") : "";
|
|
36
|
+
}
|
|
37
|
+
/** Replaces the user message's text parts with one part holding `text`. */
|
|
38
|
+
function withUserText(prompt, index, text) {
|
|
39
|
+
return prompt.map((message, at) => {
|
|
40
|
+
if (at !== index || message.role !== "user") return message;
|
|
41
|
+
const content = [];
|
|
42
|
+
let placed = false;
|
|
43
|
+
for (const part of message.content) if (part.type !== "text") content.push(part);
|
|
44
|
+
else if (!placed) {
|
|
45
|
+
placed = true;
|
|
46
|
+
content.push({
|
|
47
|
+
...part,
|
|
48
|
+
text
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
...message,
|
|
53
|
+
content
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* A language model middleware that runs the ai-guardrails policy around a model
|
|
59
|
+
* call. The last user message is checked before the model runs: a `block`
|
|
60
|
+
* returns the refusal without calling the model and a `redact` rewrites the
|
|
61
|
+
* prompt. The answer is checked afterwards, and a streamed text block is held
|
|
62
|
+
* until its `text-end`, then emitted redacted or replaced by the refusal. Each
|
|
63
|
+
* check logs one decision.
|
|
64
|
+
*
|
|
65
|
+
* A check that cannot run blocks the stage unless `failOpen` is set.
|
|
66
|
+
*/
|
|
67
|
+
function guardrailsMiddleware(guardrails, options) {
|
|
68
|
+
const refusal = options.refusal ?? DEFAULT_REFUSAL;
|
|
69
|
+
const run = async (stage, text, toolDepth) => {
|
|
70
|
+
const checked = await guardrails.check({
|
|
71
|
+
agent: options.agent,
|
|
72
|
+
stage,
|
|
73
|
+
text,
|
|
74
|
+
toolDepth,
|
|
75
|
+
...options.organizationId ? { organizationId: options.organizationId } : {},
|
|
76
|
+
...options.chatId ? { chatId: options.chatId } : {}
|
|
77
|
+
});
|
|
78
|
+
if (checked.ok) return checked.data;
|
|
79
|
+
return {
|
|
80
|
+
decision: options.failOpen ? "allow" : "block",
|
|
81
|
+
text,
|
|
82
|
+
reasons: options.failOpen ? [] : [{
|
|
83
|
+
code: "injection",
|
|
84
|
+
detail: "guardrail_unavailable",
|
|
85
|
+
blocking: true
|
|
86
|
+
}],
|
|
87
|
+
logged: void 0
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
/** The prompt to send, or `undefined` when the input is blocked. */
|
|
91
|
+
const checkInput = async (params) => {
|
|
92
|
+
const index = lastUserIndex(params.prompt);
|
|
93
|
+
const text = textOfUser(params.prompt, index);
|
|
94
|
+
if (text.trim() === "") return params;
|
|
95
|
+
const toolDepth = params.prompt.filter((message) => message.role === "tool").length;
|
|
96
|
+
const verdict = await run("input", text, toolDepth);
|
|
97
|
+
if (verdict.decision === "block") return;
|
|
98
|
+
return verdict.decision === "redact" ? {
|
|
99
|
+
...params,
|
|
100
|
+
prompt: withUserText(params.prompt, index, verdict.text)
|
|
101
|
+
} : params;
|
|
102
|
+
};
|
|
103
|
+
const toolDepthOf = (params) => params.prompt.filter((message) => message.role === "tool").length;
|
|
104
|
+
/** The text to show for a model answer. */
|
|
105
|
+
const checkOutput = async (params, text) => {
|
|
106
|
+
if (text.trim() === "") return text;
|
|
107
|
+
const verdict = await run("output", text, toolDepthOf(params));
|
|
108
|
+
return verdict.decision === "block" ? refusal : verdict.text;
|
|
109
|
+
};
|
|
110
|
+
const refused = () => ({
|
|
111
|
+
content: [{
|
|
112
|
+
type: "text",
|
|
113
|
+
text: refusal
|
|
114
|
+
}],
|
|
115
|
+
finishReason: STOP,
|
|
116
|
+
usage: ZERO_USAGE,
|
|
117
|
+
warnings: []
|
|
118
|
+
});
|
|
119
|
+
return {
|
|
120
|
+
wrapGenerate: async ({ model, params }) => {
|
|
121
|
+
const allowed = await checkInput(params);
|
|
122
|
+
if (allowed === void 0) return refused();
|
|
123
|
+
const result = await model.doGenerate(allowed);
|
|
124
|
+
const content = await Promise.all(result.content.map(async (part) => {
|
|
125
|
+
if (part.type !== "text") return part;
|
|
126
|
+
return {
|
|
127
|
+
...part,
|
|
128
|
+
text: await checkOutput(allowed, part.text)
|
|
129
|
+
};
|
|
130
|
+
}));
|
|
131
|
+
return {
|
|
132
|
+
...result,
|
|
133
|
+
content
|
|
134
|
+
};
|
|
135
|
+
},
|
|
136
|
+
wrapStream: async ({ model, params }) => {
|
|
137
|
+
const allowed = await checkInput(params);
|
|
138
|
+
if (allowed === void 0) return { stream: new ReadableStream({ start(controller) {
|
|
139
|
+
controller.enqueue({
|
|
140
|
+
type: "stream-start",
|
|
141
|
+
warnings: []
|
|
142
|
+
});
|
|
143
|
+
controller.enqueue({
|
|
144
|
+
type: "text-start",
|
|
145
|
+
id: "refusal"
|
|
146
|
+
});
|
|
147
|
+
controller.enqueue({
|
|
148
|
+
type: "text-delta",
|
|
149
|
+
id: "refusal",
|
|
150
|
+
delta: refusal
|
|
151
|
+
});
|
|
152
|
+
controller.enqueue({
|
|
153
|
+
type: "text-end",
|
|
154
|
+
id: "refusal"
|
|
155
|
+
});
|
|
156
|
+
controller.enqueue({
|
|
157
|
+
type: "finish",
|
|
158
|
+
finishReason: STOP,
|
|
159
|
+
usage: ZERO_USAGE
|
|
160
|
+
});
|
|
161
|
+
controller.close();
|
|
162
|
+
} }) };
|
|
163
|
+
const result = await model.doStream(allowed);
|
|
164
|
+
const held = /* @__PURE__ */ new Map();
|
|
165
|
+
const stream = result.stream.pipeThrough(new TransformStream({ async transform(part, controller) {
|
|
166
|
+
if (part.type === "text-start") {
|
|
167
|
+
held.set(part.id, {
|
|
168
|
+
start: part,
|
|
169
|
+
text: ""
|
|
170
|
+
});
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
if (part.type === "text-delta") {
|
|
174
|
+
const block = held.get(part.id);
|
|
175
|
+
if (block) {
|
|
176
|
+
block.text += part.delta;
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
if (part.type === "text-end") {
|
|
181
|
+
const block = held.get(part.id);
|
|
182
|
+
if (block) {
|
|
183
|
+
held.delete(part.id);
|
|
184
|
+
const text = await checkOutput(allowed, block.text);
|
|
185
|
+
controller.enqueue(block.start);
|
|
186
|
+
if (text !== "") controller.enqueue({
|
|
187
|
+
type: "text-delta",
|
|
188
|
+
id: part.id,
|
|
189
|
+
delta: text
|
|
190
|
+
});
|
|
191
|
+
controller.enqueue(part);
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
controller.enqueue(part);
|
|
196
|
+
} }));
|
|
197
|
+
return {
|
|
198
|
+
...result,
|
|
199
|
+
stream
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
// src/ai-sdk/rate-limit-middleware.ts
|
|
205
|
+
/**
|
|
206
|
+
* A language model middleware that counts every model call (`generateText`,
|
|
207
|
+
* `streamText` and each agent step) against a rate limit and refuses it before
|
|
208
|
+
* the model runs. A refused call throws a `DbException` whose error is
|
|
209
|
+
* `rate_limited` with code `AI_RATE_LIMITED` and `retryAfter` in seconds, so
|
|
210
|
+
* `aiErrorToDbError` and the problem-details helpers answer it with a 429.
|
|
211
|
+
*/
|
|
212
|
+
function rateLimitMiddleware(options) {
|
|
213
|
+
const resolve = async (value, call) => typeof value === "function" ? value(call) : value;
|
|
214
|
+
return { transformParams: async (call) => {
|
|
215
|
+
const key = await resolve(options.key, call);
|
|
216
|
+
if (key === void 0) return call.params;
|
|
217
|
+
const organizationId = await resolve(options.organizationId, call);
|
|
218
|
+
const decision = await options.rateLimit.check({
|
|
219
|
+
scope: options.scope,
|
|
220
|
+
key,
|
|
221
|
+
organizationId
|
|
222
|
+
});
|
|
223
|
+
if (!decision.ok) {
|
|
224
|
+
if (options.failOpen) return call.params;
|
|
225
|
+
throw new DbException(decision.error);
|
|
226
|
+
}
|
|
227
|
+
if (!decision.data.allowed) {
|
|
228
|
+
const retryAfter = Math.max(1, Math.ceil(decision.data.retryAfter));
|
|
229
|
+
throw new DbException(dbError("rate_limited", "Too many model calls.", {
|
|
230
|
+
code: "AI_RATE_LIMITED",
|
|
231
|
+
retryAfter
|
|
232
|
+
}));
|
|
233
|
+
}
|
|
234
|
+
return call.params;
|
|
235
|
+
} };
|
|
236
|
+
}
|
|
8
237
|
// src/ai-sdk/code-tool.ts
|
|
9
238
|
const LANGUAGES = [
|
|
10
239
|
"python",
|
|
@@ -163,42 +392,81 @@ function tenantOfEvent(event) {
|
|
|
163
392
|
const id = isRecord(context) ? context["organizationId"] : void 0;
|
|
164
393
|
return typeof id === "string" && id.length > 0 ? id : void 0;
|
|
165
394
|
}
|
|
395
|
+
/** Calls kept in flight; the oldest are dropped when an end event never arrives. */
|
|
396
|
+
const MAX_IN_FLIGHT = 1e3;
|
|
397
|
+
/** A map that drops its oldest entry past `MAX_IN_FLIGHT`. */
|
|
398
|
+
function boundedMap() {
|
|
399
|
+
const map = /* @__PURE__ */ new Map();
|
|
400
|
+
const set = map.set.bind(map);
|
|
401
|
+
map.set = (key, value) => {
|
|
402
|
+
map.delete(key);
|
|
403
|
+
set(key, value);
|
|
404
|
+
if (map.size > MAX_IN_FLIGHT) {
|
|
405
|
+
const oldest = map.keys().next();
|
|
406
|
+
if (!oldest.done) map.delete(oldest.value);
|
|
407
|
+
}
|
|
408
|
+
return map;
|
|
409
|
+
};
|
|
410
|
+
return map;
|
|
411
|
+
}
|
|
166
412
|
const count = (value) => typeof value === "number" && Number.isFinite(value) && value > 0 ? Math.round(value) : 0;
|
|
167
413
|
/**
|
|
168
414
|
* A telemetry integration that meters every model call on the tenant's usage
|
|
169
415
|
* meters: input and output tokens of each language model call (agent steps
|
|
170
416
|
* included), embedding tokens, and rerank calls. Register it once with
|
|
171
417
|
* `registerTelemetry(meterTelemetry({ usage }))`; each call's rows carry an
|
|
172
|
-
* idempotency key
|
|
173
|
-
* same
|
|
418
|
+
* idempotency key (`ai-call:<callId>:<responseId>`, or your `idempotencyKey`
|
|
419
|
+
* base plus the same suffix), so a retried event is counted once, a `source`
|
|
420
|
+
* (`ai:<functionId>`), and the `actor` and `metadata` you resolve. In-flight
|
|
421
|
+
* calls are bounded to 1,000 and released on end, abort and error. Don't also
|
|
422
|
+
* record the same tokens with `usageEntries`.
|
|
174
423
|
*/
|
|
175
424
|
function meterTelemetry(options) {
|
|
176
|
-
const tenants =
|
|
177
|
-
const calls =
|
|
425
|
+
const tenants = boundedMap();
|
|
426
|
+
const calls = boundedMap();
|
|
178
427
|
const tenantOf = options.tenant ?? tenantOfEvent;
|
|
179
428
|
const meters = options.meters ?? {};
|
|
180
|
-
const
|
|
181
|
-
const
|
|
182
|
-
|
|
429
|
+
const sourceOf = (event) => typeof options.source === "function" ? options.source(event) : options.source ?? (event.functionId === void 0 || event.functionId === "" ? "ai:telemetry" : `ai:${event.functionId}`);
|
|
430
|
+
const actorOf = (event) => {
|
|
431
|
+
if (options.actor !== void 0) return options.actor(event);
|
|
432
|
+
const context = event.runtimeContext;
|
|
433
|
+
const id = isRecord(context) ? context["userId"] : void 0;
|
|
434
|
+
return typeof id === "string" && id.length > 0 ? id : void 0;
|
|
435
|
+
};
|
|
436
|
+
const record = async (callId, suffix, entries) => {
|
|
437
|
+
const state = tenants.get(callId);
|
|
183
438
|
const kept = entries.filter((entry) => (entry.quantity ?? 0) > 0);
|
|
184
|
-
if (
|
|
439
|
+
if (state === void 0 || kept.length === 0) return;
|
|
185
440
|
const saved = await options.usage.recordMany({
|
|
186
|
-
organizationId: tenant,
|
|
441
|
+
organizationId: state.tenant,
|
|
187
442
|
entries: kept,
|
|
188
|
-
idempotencyKey:
|
|
189
|
-
source
|
|
443
|
+
idempotencyKey: `${state.key}:${suffix}`,
|
|
444
|
+
source: state.source,
|
|
445
|
+
...state.actor === void 0 ? {} : { actor: state.actor },
|
|
446
|
+
...state.metadata === void 0 ? {} : { metadata: state.metadata }
|
|
190
447
|
});
|
|
191
448
|
if (!saved.ok) options.onError?.(saved.error);
|
|
192
449
|
};
|
|
450
|
+
const settle = (callId) => {
|
|
451
|
+
tenants.delete(callId);
|
|
452
|
+
calls.delete(callId);
|
|
453
|
+
};
|
|
193
454
|
return {
|
|
194
455
|
onStart: (event) => {
|
|
195
456
|
const tenant = tenantOf(event);
|
|
196
|
-
if (tenant !== void 0) tenants.set(event.callId,
|
|
457
|
+
if (tenant !== void 0) tenants.set(event.callId, {
|
|
458
|
+
tenant,
|
|
459
|
+
source: sourceOf(event),
|
|
460
|
+
key: options.idempotencyKey?.(event) ?? `ai-call:${event.callId}`,
|
|
461
|
+
actor: actorOf(event),
|
|
462
|
+
metadata: options.metadata?.(event)
|
|
463
|
+
});
|
|
197
464
|
},
|
|
198
465
|
onLanguageModelCallEnd: (event) => {
|
|
199
466
|
const step = calls.get(event.callId) ?? 0;
|
|
200
467
|
calls.set(event.callId, step + 1);
|
|
201
|
-
|
|
468
|
+
const response = event.responseId === "" ? String(step) : event.responseId;
|
|
469
|
+
return record(event.callId, response, [{
|
|
202
470
|
meter: meters.input ?? "ai.input_tokens",
|
|
203
471
|
quantity: count(event.usage.inputTokens)
|
|
204
472
|
}, {
|
|
@@ -206,17 +474,23 @@ function meterTelemetry(options) {
|
|
|
206
474
|
quantity: count(event.usage.outputTokens)
|
|
207
475
|
}]);
|
|
208
476
|
},
|
|
209
|
-
onEmbedEnd: (event) => record(event.callId,
|
|
477
|
+
onEmbedEnd: (event) => record(event.callId, event.embedCallId, [{
|
|
210
478
|
meter: meters.embedding ?? "ai.embedding_tokens",
|
|
211
479
|
quantity: count(event.usage.tokens)
|
|
212
480
|
}]),
|
|
213
|
-
onRerankEnd: (event) => record(event.callId,
|
|
481
|
+
onRerankEnd: (event) => record(event.callId, "rerank", [{
|
|
214
482
|
meter: meters.rerank ?? "ai.rerank_calls",
|
|
215
483
|
quantity: 1
|
|
216
484
|
}]),
|
|
217
485
|
onEnd: (event) => {
|
|
218
|
-
|
|
219
|
-
|
|
486
|
+
settle(event.callId);
|
|
487
|
+
},
|
|
488
|
+
onAbort: (event) => {
|
|
489
|
+
settle(event.callId);
|
|
490
|
+
},
|
|
491
|
+
onError: (error) => {
|
|
492
|
+
const callId = isRecord(error) ? error["callId"] : void 0;
|
|
493
|
+
if (typeof callId === "string") settle(callId);
|
|
220
494
|
}
|
|
221
495
|
};
|
|
222
496
|
}
|
|
@@ -263,4 +537,103 @@ function spendReconciliation(options) {
|
|
|
263
537
|
};
|
|
264
538
|
};
|
|
265
539
|
}
|
|
266
|
-
|
|
540
|
+
// src/ai-sdk/transcriber.ts
|
|
541
|
+
const MS = 1e3;
|
|
542
|
+
/**
|
|
543
|
+
* A `Transcriber` for the activities block over the AI SDK's `transcribe`.
|
|
544
|
+
* Segments become speaker turns without a speaker label; a provider that
|
|
545
|
+
* returns no segments gives one turn that covers the whole recording.
|
|
546
|
+
*/
|
|
547
|
+
function aiTranscriber(options) {
|
|
548
|
+
const { model } = options;
|
|
549
|
+
return {
|
|
550
|
+
apiVersion: 1,
|
|
551
|
+
model: options.name ?? (typeof model === "string" ? model : model.modelId),
|
|
552
|
+
transcribe: async (input, call) => {
|
|
553
|
+
const audio = await input.read();
|
|
554
|
+
const result = await transcribe({
|
|
555
|
+
model,
|
|
556
|
+
audio,
|
|
557
|
+
...options.providerOptions === void 0 ? {} : { providerOptions: options.providerOptions },
|
|
558
|
+
...call?.signal === void 0 ? {} : { abortSignal: call.signal }
|
|
559
|
+
});
|
|
560
|
+
const duration = result.durationInSeconds;
|
|
561
|
+
const segments = result.segments.length > 0 ? result.segments.map((segment) => ({
|
|
562
|
+
startMs: Math.round(segment.startSecond * MS),
|
|
563
|
+
endMs: Math.round(segment.endSecond * MS),
|
|
564
|
+
text: segment.text
|
|
565
|
+
})) : [{
|
|
566
|
+
startMs: 0,
|
|
567
|
+
endMs: Math.round((duration ?? 0) * MS),
|
|
568
|
+
text: result.text
|
|
569
|
+
}];
|
|
570
|
+
const language = result.language ?? input.language;
|
|
571
|
+
return {
|
|
572
|
+
segments,
|
|
573
|
+
...language === void 0 ? {} : { language },
|
|
574
|
+
...duration === void 0 ? {} : { durationSeconds: duration }
|
|
575
|
+
};
|
|
576
|
+
}
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
// src/ai-sdk/realtime.ts
|
|
580
|
+
const json = (status, body, headers) => Response.json(body, {
|
|
581
|
+
status,
|
|
582
|
+
...headers === void 0 ? {} : { headers }
|
|
583
|
+
});
|
|
584
|
+
/**
|
|
585
|
+
* A Fetch handler for the realtime setup endpoint. It identifies the caller,
|
|
586
|
+
* counts the request against a rate limit, mints the token and records it, so
|
|
587
|
+
* the app's provider key never mints sessions for anonymous or runaway
|
|
588
|
+
* callers.
|
|
589
|
+
*/
|
|
590
|
+
function realtimeTokenRoute(options) {
|
|
591
|
+
const scope = options.scope ?? "ai.realtime";
|
|
592
|
+
return async (request) => {
|
|
593
|
+
const caller = await options.identify(request);
|
|
594
|
+
if (caller === void 0) return json(401, { error: "unauthorized" });
|
|
595
|
+
const decision = await options.rateLimit.check({
|
|
596
|
+
scope,
|
|
597
|
+
key: caller.key,
|
|
598
|
+
organizationId: caller.organizationId
|
|
599
|
+
});
|
|
600
|
+
if (!decision.ok) return json(503, { error: dbError("network", "Rate limit check failed.") });
|
|
601
|
+
if (!decision.data.allowed) {
|
|
602
|
+
const retryAfter = Math.max(1, Math.ceil(decision.data.retryAfter));
|
|
603
|
+
return json(429, {
|
|
604
|
+
error: "rate_limited",
|
|
605
|
+
retryAfter
|
|
606
|
+
}, { "retry-after": String(retryAfter) });
|
|
607
|
+
}
|
|
608
|
+
const parsed = await request.json().catch(() => ({}));
|
|
609
|
+
const body = typeof parsed === "object" && parsed !== null && !Array.isArray(parsed) ? parsed : {};
|
|
610
|
+
const token = await options.mint(body, caller);
|
|
611
|
+
try {
|
|
612
|
+
await options.record?.({
|
|
613
|
+
caller,
|
|
614
|
+
...typeof body["model"] === "string" ? { model: body["model"] } : {},
|
|
615
|
+
at: /* @__PURE__ */ new Date()
|
|
616
|
+
});
|
|
617
|
+
} catch {}
|
|
618
|
+
return json(200, token);
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
// src/ai-sdk/tool-search.ts
|
|
622
|
+
const DEFAULT_MAX = 5;
|
|
623
|
+
/**
|
|
624
|
+
* The AI SDK's `toolSearch` with the catalog's ranking in place of keyword
|
|
625
|
+
* matching. Names the catalog returns that are not deferred tools of the
|
|
626
|
+
* generation are ignored by the SDK. A catalog error throws a `DbException`.
|
|
627
|
+
*/
|
|
628
|
+
function toolSearchFrom(options) {
|
|
629
|
+
const maxResults = options.maxResults ?? DEFAULT_MAX;
|
|
630
|
+
return toolSearch({
|
|
631
|
+
maxResults,
|
|
632
|
+
search: async ({ query }) => {
|
|
633
|
+
const found = await options.catalog.search(query, { limit: maxResults });
|
|
634
|
+
if (!found.ok) throw new DbException(found.error);
|
|
635
|
+
return found.data.map((row) => row.name);
|
|
636
|
+
}
|
|
637
|
+
});
|
|
638
|
+
}
|
|
639
|
+
export { AI_SDK_UI_FORMAT, BYOK_FIELD, DENIED_TOOL_OUTPUT, aiErrorMessage, aiErrorToDbError, aiTranscriber, byokOptions, codeTool, costBackfill, fromModelMessages, fromUIMessage, gatewayOptions, guardrailsMiddleware, isUIMessage, meterTelemetry, modelCatalogRefresh, modelInputOf, problem429, rateLimitMiddleware, realtimeTokenRoute, spendReconciliation, summarizeWith, tenantGatewayOptions, tenantOfEvent, toUIMessage, toUIMessages, toolSearchFrom, trackedSandbox, usageEntries, usageOf, usageQuota, validUIMessages };
|
|
@@ -4,7 +4,7 @@ import { r as ConnectorServer, s as Connectors } from "../../connectors-Ei9OySGI
|
|
|
4
4
|
import { n as VaultCredentials } from "../../vault-DY1RUY1k.js";
|
|
5
5
|
import { i as SupabaseMcpScope, n as SupabaseMcpModule, t as SupabaseMcpFeature } from "../../supabase-mcp-DY32eoax.js";
|
|
6
6
|
import { ToolSet } from "ai";
|
|
7
|
-
import { ElicitResult, ElicitationRequest, MCPClient, OAuthClientMetadata, OAuthClientProvider } from "@ai-sdk/mcp";
|
|
7
|
+
import { ElicitResult, ElicitationRequest, Experimental_MCPEventStore, Experimental_MCPEventWebhookOptions, MCPClient, OAuthClientMetadata, OAuthClientProvider } from "@ai-sdk/mcp";
|
|
8
8
|
/** The Vault ref of a user's OAuth connection to a server. */
|
|
9
9
|
export declare function mcpOAuthRef(serverId: string): CredentialRef;
|
|
10
10
|
interface VaultOAuthProviderOptions {
|
|
@@ -118,6 +118,18 @@ interface ConnectToolsOptions {
|
|
|
118
118
|
* lists.
|
|
119
119
|
*/
|
|
120
120
|
readonly schemas?: McpToolSchemas;
|
|
121
|
+
/**
|
|
122
|
+
* Retries a tool call after a transient transport failure this many times
|
|
123
|
+
* (the MCP client's `maxRetries`). Default 0.
|
|
124
|
+
*/
|
|
125
|
+
readonly maxRetries?: number;
|
|
126
|
+
/**
|
|
127
|
+
* `true` makes every tool wait for the user's approval unless the server
|
|
128
|
+
* marks it `readOnlyHint: true`. A tool without the annotation asks. The
|
|
129
|
+
* annotations are the server's claim, so this only reduces prompts for a
|
|
130
|
+
* server you trust.
|
|
131
|
+
*/
|
|
132
|
+
readonly askUnlessReadOnly?: boolean;
|
|
121
133
|
}
|
|
122
134
|
interface ConnectedTools {
|
|
123
135
|
readonly tools: ToolSet;
|
|
@@ -157,4 +169,39 @@ interface ConnectAllResult {
|
|
|
157
169
|
* and reported, not fatal.
|
|
158
170
|
*/
|
|
159
171
|
export declare function connectAll(servers: readonly ConnectorServer[], options: ConnectAllOptions): Promise<ConnectAllResult>;
|
|
160
|
-
|
|
172
|
+
interface PostgresMcpEventStoreOptions {
|
|
173
|
+
/** `vaultCredentials({ transport })` with the service role. */
|
|
174
|
+
readonly vault: VaultCredentials;
|
|
175
|
+
/**
|
|
176
|
+
* What the subscriptions belong to: one MCP server and one principal, such as
|
|
177
|
+
* `<serverId>:<userId>`. Keys and ids are stored under it.
|
|
178
|
+
*/
|
|
179
|
+
readonly scope: string;
|
|
180
|
+
/** The Vault tenant, when the app stores secrets per tenant. */
|
|
181
|
+
readonly tenant?: string;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* An `Experimental_MCPEventStore` that keeps each subscription, including its
|
|
185
|
+
* signing secret, as one Vault secret, with a second secret that maps the
|
|
186
|
+
* server's subscription id to the key. Nothing is readable by a browser or by
|
|
187
|
+
* the `authenticated` role.
|
|
188
|
+
*
|
|
189
|
+
* `update` reads, merges and writes, so it isn't atomic: serialize updates to
|
|
190
|
+
* one key (the webhook route does, per delivery) or run it in a queue.
|
|
191
|
+
*/
|
|
192
|
+
export declare function postgresMcpEventStore(options: PostgresMcpEventStoreOptions): Experimental_MCPEventStore;
|
|
193
|
+
interface DedupeMcpEventsOptions {
|
|
194
|
+
/**
|
|
195
|
+
* Records `key` and returns `true` the first time, `false` for a repeat: an
|
|
196
|
+
* `insert ... on conflict do nothing` on a table the app owns works.
|
|
197
|
+
*/
|
|
198
|
+
readonly claim: (key: string) => Promise<boolean>;
|
|
199
|
+
}
|
|
200
|
+
type Handlers = Pick<Experimental_MCPEventWebhookOptions, "onEvent" | "onGap" | "onTerminated">;
|
|
201
|
+
/**
|
|
202
|
+
* Wraps the webhook handlers so a delivery the server sent twice runs once.
|
|
203
|
+
* Events dedupe on subscription id and `eventId`, gaps and terminations on
|
|
204
|
+
* subscription id and `messageId`, as the AI SDK asks.
|
|
205
|
+
*/
|
|
206
|
+
export declare function dedupeMcpEvents(handlers: Handlers, options: DedupeMcpEventsOptions): Handlers;
|
|
207
|
+
export type { AuthorizeConnectorOptions, ConnectAllOptions, ConnectAllResult, ConnectToolsOptions, ConnectedTools, DedupeMcpEventsOptions, McpToolSchemas, PostgresMcpEventStoreOptions, SupabaseMcp, SupabaseMcpFeature, SupabaseMcpOptions, SupabaseMcpScope, VaultOAuthProvider, VaultOAuthProviderOptions };
|
package/dist/ai-sdk/mcp/index.js
CHANGED
|
@@ -4,8 +4,8 @@ import { n as isRecord } from "../../guards-CsRa6v57.js";
|
|
|
4
4
|
import { s as nowInstant } from "../../temporal-DKTdGK9i.js";
|
|
5
5
|
import { a as ok, r as err, t as AsyncResult } from "../../result-DrBaeIVt.js";
|
|
6
6
|
import { t as importOptionalPeer } from "../../optional-peer-5SOYr3lL.js";
|
|
7
|
-
import { L as sha256Hex, f as errorText } from "../../block-helpers-
|
|
8
|
-
import { n as credentialRefInTenant, r as foreignCredentialRef } from "../../provider-
|
|
7
|
+
import { L as sha256Hex, f as errorText } from "../../block-helpers-DApvw3n9.js";
|
|
8
|
+
import { n as credentialRefInTenant, r as foreignCredentialRef } from "../../provider-Bkh8zSHN.js";
|
|
9
9
|
import { n as loadSupabaseMcp } from "../../supabase-mcp-QvebHckf.js";
|
|
10
10
|
import { fingerprintTools } from "ai";
|
|
11
11
|
import { ElicitationRequestSchema, auth, createMCPClient, mcpAppClientCapabilities, splitMCPAppTools } from "@ai-sdk/mcp";
|
|
@@ -289,6 +289,14 @@ async function digestOf(fingerprints) {
|
|
|
289
289
|
const entries = Object.entries(fingerprints).toSorted(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
290
290
|
return `sha256:${await sha256Hex(JSON.stringify(entries))}`;
|
|
291
291
|
}
|
|
292
|
+
/** Makes the tools that aren't read-only wait for the user's approval. */
|
|
293
|
+
function askingUnlessReadOnly(tools, definitions) {
|
|
294
|
+
const readOnly = new Set(definitions.tools.flatMap((definition) => definition.annotations?.readOnlyHint === true ? [definition.name] : []));
|
|
295
|
+
return Object.fromEntries(Object.entries(tools).map(([name, tool]) => [name, readOnly.has(name) ? tool : {
|
|
296
|
+
...tool,
|
|
297
|
+
needsApproval: true
|
|
298
|
+
}]));
|
|
299
|
+
}
|
|
292
300
|
function prefixed(tools, prefix) {
|
|
293
301
|
if (prefix === void 0 || prefix === "") return tools;
|
|
294
302
|
return Object.fromEntries(Object.entries(tools).map(([name, tool]) => [`${prefix}${name}`, tool]));
|
|
@@ -331,6 +339,7 @@ function connectTools(options) {
|
|
|
331
339
|
}
|
|
332
340
|
},
|
|
333
341
|
...previous?.initializeResult === void 0 || previous.sessionId === void 0 ? {} : { initialInitializeResult: previous.initializeResult },
|
|
342
|
+
...options.maxRetries === void 0 ? {} : { maxRetries: options.maxRetries },
|
|
334
343
|
...options.protocolVersionDiscovery === void 0 ? {} : { protocolVersionDiscovery: options.protocolVersionDiscovery },
|
|
335
344
|
capabilities: {
|
|
336
345
|
...options.apps === true ? mcpAppClientCapabilities : {},
|
|
@@ -356,8 +365,9 @@ function connectTools(options) {
|
|
|
356
365
|
modelVisible: definitions,
|
|
357
366
|
appVisible: { tools: [] }
|
|
358
367
|
};
|
|
359
|
-
const
|
|
360
|
-
const
|
|
368
|
+
const listed = client.toolsFromDefinitions(split.modelVisible);
|
|
369
|
+
const tools = options.askUnlessReadOnly === true ? askingUnlessReadOnly(listed, split.modelVisible) : listed;
|
|
370
|
+
const fingerprints = await fingerprintTools(listed);
|
|
361
371
|
const fingerprint = await digestOf(fingerprints);
|
|
362
372
|
const status = await connectors.fingerprints.check({
|
|
363
373
|
serverId: server.id,
|
|
@@ -373,7 +383,7 @@ function connectTools(options) {
|
|
|
373
383
|
return err(forbidden(`The tools of ${server.name} changed and wait for an admin's approval`, "CONNECTOR_TOOLS_CHANGED"));
|
|
374
384
|
}
|
|
375
385
|
return ok({
|
|
376
|
-
tools: prefixed(options.schemas === void 0 ? tools : client.toolsFromDefinitions(split.modelVisible, { schemas: options.schemas }), options.prefix),
|
|
386
|
+
tools: prefixed(options.schemas === void 0 ? tools : options.askUnlessReadOnly === true ? askingUnlessReadOnly(client.toolsFromDefinitions(split.modelVisible, { schemas: options.schemas }), split.modelVisible) : client.toolsFromDefinitions(split.modelVisible, { schemas: options.schemas }), options.prefix),
|
|
377
387
|
appTools: prefixed(client.toolsFromDefinitions(split.appVisible), options.prefix),
|
|
378
388
|
client,
|
|
379
389
|
fingerprint,
|
|
@@ -443,4 +453,96 @@ async function supabaseMcp(options = {}, load = loadSupabaseMcp) {
|
|
|
443
453
|
schemas
|
|
444
454
|
};
|
|
445
455
|
}
|
|
446
|
-
|
|
456
|
+
// src/ai-sdk/mcp/events.ts
|
|
457
|
+
const subject = { type: "app" };
|
|
458
|
+
/**
|
|
459
|
+
* An `Experimental_MCPEventStore` that keeps each subscription, including its
|
|
460
|
+
* signing secret, as one Vault secret, with a second secret that maps the
|
|
461
|
+
* server's subscription id to the key. Nothing is readable by a browser or by
|
|
462
|
+
* the `authenticated` role.
|
|
463
|
+
*
|
|
464
|
+
* `update` reads, merges and writes, so it isn't atomic: serialize updates to
|
|
465
|
+
* one key (the webhook route does, per delivery) or run it in a queue.
|
|
466
|
+
*/
|
|
467
|
+
function postgresMcpEventStore(options) {
|
|
468
|
+
const { vault } = options;
|
|
469
|
+
const ref = (name) => ({
|
|
470
|
+
provider: "vault",
|
|
471
|
+
secret: `mcp-events:${options.scope}:${name}`,
|
|
472
|
+
scope: "app",
|
|
473
|
+
...options.tenant === void 0 ? {} : { tenant: options.tenant }
|
|
474
|
+
});
|
|
475
|
+
const read = async (name) => {
|
|
476
|
+
const stored = await vault.getToken(ref(name), {
|
|
477
|
+
subject,
|
|
478
|
+
fresh: true
|
|
479
|
+
});
|
|
480
|
+
return stored.ok ? stored.data.token : void 0;
|
|
481
|
+
};
|
|
482
|
+
const write = async (name, value) => {
|
|
483
|
+
const saved = await vault.set(ref(name), value, {
|
|
484
|
+
subject,
|
|
485
|
+
description: "MCP event subscription"
|
|
486
|
+
});
|
|
487
|
+
if (!saved.ok) throw new DbException(saved.error);
|
|
488
|
+
};
|
|
489
|
+
const remove = async (name) => {
|
|
490
|
+
await vault.revoke(ref(name), { subject });
|
|
491
|
+
};
|
|
492
|
+
const parse = (text) => {
|
|
493
|
+
if (text === void 0) return;
|
|
494
|
+
try {
|
|
495
|
+
const value = JSON.parse(text);
|
|
496
|
+
return isRecord(value) ? value : void 0;
|
|
497
|
+
} catch {
|
|
498
|
+
return;
|
|
499
|
+
}
|
|
500
|
+
};
|
|
501
|
+
const get = async (key) => parse(await read(`key:${key}`));
|
|
502
|
+
return {
|
|
503
|
+
get,
|
|
504
|
+
getById: async (id) => {
|
|
505
|
+
const key = await read(`id:${id}`);
|
|
506
|
+
return key === void 0 ? void 0 : get(key);
|
|
507
|
+
},
|
|
508
|
+
set: async (subscription) => {
|
|
509
|
+
await write(`key:${subscription.key}`, JSON.stringify(subscription));
|
|
510
|
+
if (subscription.id !== void 0) await write(`id:${subscription.id}`, subscription.key);
|
|
511
|
+
},
|
|
512
|
+
update: async (key, patch) => {
|
|
513
|
+
const current = await get(key);
|
|
514
|
+
if (!current) return;
|
|
515
|
+
const next = {
|
|
516
|
+
...current,
|
|
517
|
+
...patch
|
|
518
|
+
};
|
|
519
|
+
await write(`key:${key}`, JSON.stringify(next));
|
|
520
|
+
if (next.id !== void 0 && next.id !== current.id) await write(`id:${next.id}`, key);
|
|
521
|
+
},
|
|
522
|
+
delete: async (key) => {
|
|
523
|
+
const current = await get(key);
|
|
524
|
+
await remove(`key:${key}`);
|
|
525
|
+
if (current?.id !== void 0) await remove(`id:${current.id}`);
|
|
526
|
+
}
|
|
527
|
+
};
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* Wraps the webhook handlers so a delivery the server sent twice runs once.
|
|
531
|
+
* Events dedupe on subscription id and `eventId`, gaps and terminations on
|
|
532
|
+
* subscription id and `messageId`, as the AI SDK asks.
|
|
533
|
+
*/
|
|
534
|
+
function dedupeMcpEvents(handlers, options) {
|
|
535
|
+
const once = async (key, run) => {
|
|
536
|
+
if (await options.claim(key)) await run();
|
|
537
|
+
};
|
|
538
|
+
const { onGap, onTerminated } = handlers;
|
|
539
|
+
return {
|
|
540
|
+
onEvent: ({ subscription, event }) => once(`${subscription.id}:event:${event.eventId}`, () => handlers.onEvent({
|
|
541
|
+
subscription,
|
|
542
|
+
event
|
|
543
|
+
})),
|
|
544
|
+
...onGap ? { onGap: (args) => once(`${args.subscription.id}:gap:${args.messageId}`, () => onGap(args)) } : {},
|
|
545
|
+
...onTerminated ? { onTerminated: (args) => once(`${args.subscription.id}:end:${args.messageId}`, () => onTerminated(args)) } : {}
|
|
546
|
+
};
|
|
547
|
+
}
|
|
548
|
+
export { SUPABASE_MCP_URL, authorizeConnector, completeConnector, connectAll, connectTools, dedupeMcpEvents, mcpOAuthRef, postgresMcpEventStore, supabaseMcp, vaultOAuthProvider };
|