employee001 0.7.0 → 0.9.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/.env.example +53 -5
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-path-routes-manifest.json +26 -2
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/prerender-manifest.json +90 -34
- package/.next/standalone/.next/required-server-files.json +1 -1
- package/.next/standalone/.next/routes-manifest.json +154 -6
- package/.next/standalone/.next/server/app/(auth)/auth/setup/page/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/{(workspace)/handover/live → (auth)/auth/setup}/page/next-font-manifest.json +1 -1
- package/.next/standalone/.next/server/app/(auth)/auth/setup/page.js +14 -0
- package/.next/standalone/.next/server/app/{(workspace)/handover/live → (auth)/auth/setup}/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(auth)/auth/setup/page_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/(auth)/forgot-password/page.js +3 -4
- package/.next/standalone/.next/server/app/(auth)/forgot-password/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(auth)/forgot-password/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(auth)/login/page.js +2 -3
- package/.next/standalone/.next/server/app/(auth)/login/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(auth)/login/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(auth)/signup/page.js +3 -4
- package/.next/standalone/.next/server/app/(auth)/signup/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(auth)/signup/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(workspace)/account/page/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/(workspace)/account/page/build-manifest.json +20 -0
- package/.next/standalone/.next/server/app/(workspace)/account/page/next-font-manifest.json +13 -0
- package/.next/standalone/.next/server/app/(workspace)/account/page/react-loadable-manifest.json +1 -0
- package/.next/standalone/.next/server/app/(workspace)/account/page.js +14 -0
- package/.next/standalone/.next/server/app/(workspace)/account/page.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/(workspace)/account/page_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/(workspace)/ask/page.js +2 -2
- package/.next/standalone/.next/server/app/(workspace)/ask/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(workspace)/ask/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(workspace)/audit/page.js +2 -2
- package/.next/standalone/.next/server/app/(workspace)/audit/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(workspace)/audit/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(workspace)/brain/page.js +2 -2
- package/.next/standalone/.next/server/app/(workspace)/brain/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(workspace)/brain/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(workspace)/budgets/page.js +2 -2
- package/.next/standalone/.next/server/app/(workspace)/budgets/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(workspace)/budgets/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(workspace)/cockpit/page.js +2 -2
- package/.next/standalone/.next/server/app/(workspace)/cockpit/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(workspace)/cockpit/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(workspace)/connections/[id]/page.js +2 -2
- package/.next/standalone/.next/server/app/(workspace)/connections/[id]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(workspace)/connections/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(workspace)/connections/page.js +3 -3
- package/.next/standalone/.next/server/app/(workspace)/connections/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(workspace)/connections/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(workspace)/council/page.js +2 -2
- package/.next/standalone/.next/server/app/(workspace)/council/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(workspace)/council/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(workspace)/employees/page.js +2 -2
- package/.next/standalone/.next/server/app/(workspace)/employees/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(workspace)/employees/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(workspace)/flow/page.js +2 -2
- package/.next/standalone/.next/server/app/(workspace)/flow/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(workspace)/flow/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(workspace)/focus/page.js +2 -2
- package/.next/standalone/.next/server/app/(workspace)/focus/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(workspace)/focus/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(workspace)/generation/page.js +2 -2
- package/.next/standalone/.next/server/app/(workspace)/generation/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(workspace)/generation/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(workspace)/goals/page.js +2 -2
- package/.next/standalone/.next/server/app/(workspace)/goals/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(workspace)/goals/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(workspace)/handover/interview/page/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/(workspace)/handover/interview/page/build-manifest.json +20 -0
- package/.next/standalone/.next/server/app/(workspace)/handover/interview/page/next-font-manifest.json +13 -0
- package/.next/standalone/.next/server/app/(workspace)/handover/interview/page/react-loadable-manifest.json +1 -0
- package/.next/standalone/.next/server/app/(workspace)/handover/interview/page/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/(workspace)/handover/{live → interview}/page.js +7 -7
- package/.next/standalone/.next/server/app/(workspace)/handover/interview/page.js.map +5 -0
- package/.next/standalone/.next/server/app/(workspace)/handover/interview/page.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/(workspace)/handover/interview/page_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/(workspace)/handover/page.js +2 -2
- package/.next/standalone/.next/server/app/(workspace)/handover/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(workspace)/handover/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(workspace)/inbox/page.js +2 -2
- package/.next/standalone/.next/server/app/(workspace)/inbox/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(workspace)/inbox/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(workspace)/learning/page.js +2 -2
- package/.next/standalone/.next/server/app/(workspace)/learning/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(workspace)/learning/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(workspace)/marketplace/page.js +2 -2
- package/.next/standalone/.next/server/app/(workspace)/marketplace/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(workspace)/marketplace/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(workspace)/profile/page.js +2 -2
- package/.next/standalone/.next/server/app/(workspace)/profile/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(workspace)/profile/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(workspace)/routines/page.js +2 -2
- package/.next/standalone/.next/server/app/(workspace)/routines/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(workspace)/routines/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(workspace)/settings/page.js +2 -2
- package/.next/standalone/.next/server/app/(workspace)/settings/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(workspace)/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(workspace)/tasks/page.js +2 -2
- package/.next/standalone/.next/server/app/(workspace)/tasks/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(workspace)/tasks/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(workspace)/templates/page.js +2 -2
- package/.next/standalone/.next/server/app/(workspace)/templates/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(workspace)/templates/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(workspace)/workspace/page.js +2 -2
- package/.next/standalone/.next/server/app/(workspace)/workspace/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(workspace)/workspace/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error/page.js +1 -1
- package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +9 -9
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +9 -9
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +8 -8
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/account.html +1 -0
- package/.next/standalone/.next/server/app/account.meta +31 -0
- package/.next/standalone/.next/server/app/account.rsc +31 -0
- package/.next/standalone/.next/server/app/account.segments/!KHdvcmtzcGFjZSk/account/__PAGE__.segment.rsc +33 -0
- package/.next/standalone/.next/server/app/account.segments/_full.segment.rsc +31 -0
- package/.next/standalone/.next/server/app/account.segments/_tree.segment.rsc +6 -0
- package/.next/standalone/.next/server/app/api/active-runs/route.js +1 -1
- package/.next/standalone/.next/server/app/api/active-runs/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/active-runs/stream/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/approvals/pending/route.js +1 -1
- package/.next/standalone/.next/server/app/api/approvals/pending/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/audit/export/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/audit/export/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/audit/export/route.js +6 -0
- package/.next/standalone/.next/server/app/api/audit/export/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/audit/export/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/audit/export/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/audit/route.js +1 -1
- package/.next/standalone/.next/server/app/api/audit/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/audit/verify/route.js +1 -1
- package/.next/standalone/.next/server/app/api/audit/verify/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/login/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/auth/login/route/build-manifest.json +12 -0
- package/.next/standalone/.next/server/app/api/auth/login/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/auth/login/route.js +8 -0
- package/.next/standalone/.next/server/app/api/auth/login/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/auth/login/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/auth/login/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/auth/logout/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/auth/logout/route/build-manifest.json +12 -0
- package/.next/standalone/.next/server/app/api/auth/logout/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/auth/logout/route.js +7 -0
- package/.next/standalone/.next/server/app/api/auth/logout/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/auth/logout/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/auth/logout/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/auth/me/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/auth/me/route/build-manifest.json +12 -0
- package/.next/standalone/.next/server/app/api/auth/me/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/auth/me/route.js +7 -0
- package/.next/standalone/.next/server/app/api/auth/me/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/auth/me/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/auth/me/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/auth/mfa/confirm/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/auth/mfa/confirm/route/build-manifest.json +12 -0
- package/.next/standalone/.next/server/app/api/auth/mfa/confirm/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/auth/mfa/confirm/route.js +8 -0
- package/.next/standalone/.next/server/app/api/auth/mfa/confirm/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/auth/mfa/confirm/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/auth/mfa/confirm/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/auth/mfa/disable/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/auth/mfa/disable/route/build-manifest.json +12 -0
- package/.next/standalone/.next/server/app/api/auth/mfa/disable/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/auth/mfa/disable/route.js +8 -0
- package/.next/standalone/.next/server/app/api/auth/mfa/disable/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/auth/mfa/disable/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/auth/mfa/disable/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/auth/mfa/enroll/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/auth/mfa/enroll/route/build-manifest.json +12 -0
- package/.next/standalone/.next/server/app/api/auth/mfa/enroll/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/auth/mfa/enroll/route.js +7 -0
- package/.next/standalone/.next/server/app/api/auth/mfa/enroll/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/{relay/[employeeId]/stream → auth/mfa/enroll}/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/mfa/enroll/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/auth/mfa/verify/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/auth/mfa/verify/route/build-manifest.json +12 -0
- package/.next/standalone/.next/server/app/api/auth/mfa/verify/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/auth/mfa/verify/route.js +8 -0
- package/.next/standalone/.next/server/app/api/auth/mfa/verify/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/auth/mfa/verify/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/auth/mfa/verify/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/auth/oidc/callback/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/auth/oidc/callback/route/build-manifest.json +12 -0
- package/.next/standalone/.next/server/app/api/auth/oidc/callback/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/auth/oidc/callback/route.js +8 -0
- package/.next/standalone/.next/server/app/api/auth/oidc/callback/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/auth/oidc/callback/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/auth/oidc/callback/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/auth/oidc/start/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/auth/oidc/start/route/build-manifest.json +12 -0
- package/.next/standalone/.next/server/app/api/auth/oidc/start/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/auth/oidc/start/route.js +8 -0
- package/.next/standalone/.next/server/app/api/auth/oidc/start/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/auth/oidc/start/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/auth/oidc/start/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/auth/password/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/auth/password/route/build-manifest.json +12 -0
- package/.next/standalone/.next/server/app/api/auth/password/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/auth/password/route.js +8 -0
- package/.next/standalone/.next/server/app/api/auth/password/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/auth/password/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/auth/password/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/auth/setup/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/auth/setup/route/build-manifest.json +12 -0
- package/.next/standalone/.next/server/app/api/auth/setup/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/auth/setup/route.js +8 -0
- package/.next/standalone/.next/server/app/api/auth/setup/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/auth/setup/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/auth/setup/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/auth/users/[id]/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/auth/users/[id]/route/build-manifest.json +12 -0
- package/.next/standalone/.next/server/app/api/auth/users/[id]/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/auth/users/[id]/route.js +9 -0
- package/.next/standalone/.next/server/app/api/auth/users/[id]/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/auth/users/[id]/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/auth/users/[id]/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/auth/users/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/auth/users/route/build-manifest.json +12 -0
- package/.next/standalone/.next/server/app/api/auth/users/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/auth/users/route.js +8 -0
- package/.next/standalone/.next/server/app/api/auth/users/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/auth/users/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/auth/users/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/budgets/[id]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/budgets/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/budgets/route.js +3 -3
- package/.next/standalone/.next/server/app/api/budgets/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/connections/[id]/debug/route.js +4 -3
- package/.next/standalone/.next/server/app/api/connections/[id]/debug/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/connections/[id]/disconnect/route.js +4 -4
- package/.next/standalone/.next/server/app/api/connections/[id]/disconnect/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/connections/[id]/initiate/route.js +4 -4
- package/.next/standalone/.next/server/app/api/connections/[id]/initiate/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/connections/[id]/route.js +6 -5
- package/.next/standalone/.next/server/app/api/connections/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/connections/toolkits/route.js +4 -3
- package/.next/standalone/.next/server/app/api/connections/toolkits/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/consent/required/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/consent/required/route/build-manifest.json +12 -0
- package/.next/standalone/.next/server/app/api/consent/required/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/consent/required/route.js +6 -0
- package/.next/standalone/.next/server/app/api/consent/required/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/consent/required/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/consent/required/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/council/approve/route.js +1 -1
- package/.next/standalone/.next/server/app/api/council/approve/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/council/chat/route.js +12 -10
- package/.next/standalone/.next/server/app/api/council/chat/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/council/export/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/council/file/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/council/summary/route.js +3 -3
- package/.next/standalone/.next/server/app/api/council/summary/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/demo/route.js +1 -1
- package/.next/standalone/.next/server/app/api/demo/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/email/composio/route.js +6 -5
- package/.next/standalone/.next/server/app/api/email/composio/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/employees/[id]/chat-history/route.js +2 -1
- package/.next/standalone/.next/server/app/api/employees/[id]/chat-history/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/employees/[id]/file/[name]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/employees/[id]/graph/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/employees/[id]/knowledge/[name]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/employees/[id]/knowledge/[name]/versions/[ts]/restore/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/employees/[id]/knowledge/[name]/versions/[ts]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/employees/[id]/knowledge/[name]/versions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/employees/[id]/knowledge/proposals/[pid]/route.js +2 -2
- package/.next/standalone/.next/server/app/api/employees/[id]/knowledge/proposals/[pid]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/employees/[id]/knowledge/proposals/route.js +2 -2
- package/.next/standalone/.next/server/app/api/employees/[id]/knowledge/proposals/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/employees/[id]/knowledge/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/employees/[id]/route.js +5 -4
- package/.next/standalone/.next/server/app/api/employees/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/employees/[id]/skills/route.js +2 -2
- package/.next/standalone/.next/server/app/api/employees/[id]/skills/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/employees/[id]/task/route.js +10 -8
- package/.next/standalone/.next/server/app/api/employees/[id]/task/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/employees/[id]/versions/builds/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/employees/[id]/versions/file/[name]/[ts]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/employees/[id]/versions/file/[name]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/employees/[id]/versions/restore-build/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/employees/[id]/versions/restore-file/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/employees/route.js +3 -3
- package/.next/standalone/.next/server/app/api/employees/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/feed/[id]/resolve/route.js +1 -1
- package/.next/standalone/.next/server/app/api/feed/[id]/resolve/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/feed/route.js +1 -1
- package/.next/standalone/.next/server/app/api/feed/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/goals/[id]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/goals/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/goals/route.js +1 -1
- package/.next/standalone/.next/server/app/api/goals/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/invites/[token]/complete/route.js +8 -7
- package/.next/standalone/.next/server/app/api/invites/[token]/complete/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/invites/[token]/connections/[toolkit]/disconnect/route.js +6 -6
- package/.next/standalone/.next/server/app/api/invites/[token]/connections/[toolkit]/disconnect/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/invites/[token]/connections/initiate/route.js +6 -6
- package/.next/standalone/.next/server/app/api/invites/[token]/connections/initiate/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/invites/[token]/connections/route.js +6 -6
- package/.next/standalone/.next/server/app/api/invites/[token]/connections/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/invites/[token]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/invites/[token]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/invites/bulk-revoke/route.js +1 -1
- package/.next/standalone/.next/server/app/api/invites/bulk-revoke/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/invites/route.js +1 -1
- package/.next/standalone/.next/server/app/api/invites/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/marketplace/agents/route.js +2 -2
- package/.next/standalone/.next/server/app/api/marketplace/agents/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/marketplace/hire/route.js +2 -2
- package/.next/standalone/.next/server/app/api/marketplace/hire/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/marketplace/hired/[id]/route.js +2 -2
- package/.next/standalone/.next/server/app/api/marketplace/hired/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/marketplace/trial-chat/route.js +10 -8
- package/.next/standalone/.next/server/app/api/marketplace/trial-chat/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/mcp/route.js +9 -7
- package/.next/standalone/.next/server/app/api/mcp/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/model-provider/route.js +1 -1
- package/.next/standalone/.next/server/app/api/model-provider/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/ops-health/route.js +2 -2
- package/.next/standalone/.next/server/app/api/ops-health/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/org/ask/route.js +11 -9
- package/.next/standalone/.next/server/app/api/org/ask/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/org/brain/[slug]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/org/brain/builder/route.js +3 -3
- package/.next/standalone/.next/server/app/api/org/brain/builder/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/org/brain/graph/route.js +2 -2
- package/.next/standalone/.next/server/app/api/org/brain/graph/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/org/brain/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/org/graph/route.js +4 -4
- package/.next/standalone/.next/server/app/api/org/graph/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/org/identity/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/org/mcp/[id]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/org/mcp/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/org/mcp/oauth/callback/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/org/mcp/oauth/start/route.js +1 -1
- package/.next/standalone/.next/server/app/api/org/mcp/oauth/start/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/org/mcp/route.js +1 -1
- package/.next/standalone/.next/server/app/api/org/mcp/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/org/read-allowlist/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/org/read-allowlist/route/build-manifest.json +12 -0
- package/.next/standalone/.next/server/app/api/org/read-allowlist/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/org/read-allowlist/route.js +6 -0
- package/.next/standalone/.next/server/app/api/org/read-allowlist/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/org/read-allowlist/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/org/read-allowlist/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/org/router/route.js +11 -9
- package/.next/standalone/.next/server/app/api/org/router/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/org/skills/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/org/skills/import/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/org/skills/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/org/slack-autoreply/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/org/slack-autoreply/route/build-manifest.json +12 -0
- package/.next/standalone/.next/server/app/api/org/slack-autoreply/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/org/slack-autoreply/route.js +10 -0
- package/.next/standalone/.next/server/app/api/org/slack-autoreply/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/org/slack-autoreply/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/org/slack-autoreply/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/playbooks/[id]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/playbooks/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/playbooks/[id]/run/route.js +12 -10
- package/.next/standalone/.next/server/app/api/playbooks/[id]/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/playbooks/route.js +1 -1
- package/.next/standalone/.next/server/app/api/playbooks/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/relay/[employeeId]/consent/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/relay/[employeeId]/consent/route/build-manifest.json +12 -0
- package/.next/standalone/.next/server/app/api/relay/[employeeId]/consent/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/relay/[employeeId]/consent/route.js +10 -0
- package/.next/standalone/.next/server/app/api/relay/[employeeId]/consent/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/relay/[employeeId]/consent/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/relay/[employeeId]/consent/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/relay/[employeeId]/interview/route.js +5 -4
- package/.next/standalone/.next/server/app/api/relay/[employeeId]/interview/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/relay/[employeeId]/package/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/relay/[employeeId]/package/route/build-manifest.json +12 -0
- package/.next/standalone/.next/server/app/api/relay/[employeeId]/package/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/relay/[employeeId]/package/route.js +10 -0
- package/.next/standalone/.next/server/app/api/relay/[employeeId]/package/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/relay/[employeeId]/package/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/relay/[employeeId]/package/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/relay/[employeeId]/route.js +5 -5
- package/.next/standalone/.next/server/app/api/relay/[employeeId]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/relay/[employeeId]/synthesize/route.js +5 -4
- package/.next/standalone/.next/server/app/api/relay/[employeeId]/synthesize/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/relay/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/relay/route/build-manifest.json +12 -0
- package/.next/standalone/.next/server/app/api/relay/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/relay/route.js +8 -0
- package/.next/standalone/.next/server/app/api/relay/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/relay/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/relay/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/routines/[id]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/routines/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/routines/[id]/run/route.js +12 -10
- package/.next/standalone/.next/server/app/api/routines/[id]/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/routines/route.js +12 -10
- package/.next/standalone/.next/server/app/api/routines/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/runs/[id]/log/route.js +1 -1
- package/.next/standalone/.next/server/app/api/runs/[id]/log/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/shifts/[runId]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/shifts/[runId]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/shifts/route.js +1 -1
- package/.next/standalone/.next/server/app/api/shifts/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/slack/composio/route.js +5 -4
- package/.next/standalone/.next/server/app/api/slack/composio/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/stt/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/stt/route/build-manifest.json +12 -0
- package/.next/standalone/.next/server/app/api/stt/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/stt/route.js +7 -0
- package/.next/standalone/.next/server/app/api/stt/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/stt/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/stt/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/stt/token/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/stt/token/route/build-manifest.json +12 -0
- package/.next/standalone/.next/server/app/api/stt/token/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/stt/token/route.js +6 -0
- package/.next/standalone/.next/server/app/api/stt/token/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/stt/token/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/stt/token/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/system/config/route.js +1 -1
- package/.next/standalone/.next/server/app/api/system/config/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/mode/route.js +1 -1
- package/.next/standalone/.next/server/app/api/system/mode/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[id]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tasks/costs/route.js +1 -1
- package/.next/standalone/.next/server/app/api/tasks/costs/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tasks/route.js +1 -1
- package/.next/standalone/.next/server/app/api/tasks/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/telemetry/route.js +3 -3
- package/.next/standalone/.next/server/app/api/telemetry/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/templates/[id]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/templates/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/templates/route.js +1 -1
- package/.next/standalone/.next/server/app/api/templates/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tts/route.js +1 -1
- package/.next/standalone/.next/server/app/api/tts/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tts/stream/route.js +1 -1
- package/.next/standalone/.next/server/app/api/tts/stream/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tts/token/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/tts/token/route/build-manifest.json +12 -0
- package/.next/standalone/.next/server/app/api/tts/token/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/tts/token/route.js +6 -0
- package/.next/standalone/.next/server/app/api/tts/token/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/tts/token/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/tts/token/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/tts/voices/route.js +1 -1
- package/.next/standalone/.next/server/app/api/tts/voices/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/twin/chat/route.js +12 -10
- package/.next/standalone/.next/server/app/api/twin/chat/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/twin/upload/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/twin-builder/[employeeId]/active/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/twin-builder/[employeeId]/route.js +7 -7
- package/.next/standalone/.next/server/app/api/twin-builder/[employeeId]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/twin-builder/[employeeId]/stream/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/twin-builder/active/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/twin-focus/[id]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/twin-focus/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/twin-tasks/route.js +1 -1
- package/.next/standalone/.next/server/app/api/twin-tasks/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/work-items/route.js +13 -11
- package/.next/standalone/.next/server/app/api/work-items/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ask.html +1 -1
- package/.next/standalone/.next/server/app/ask.rsc +27 -30
- package/.next/standalone/.next/server/app/ask.segments/!KHdvcmtzcGFjZSk/ask/__PAGE__.segment.rsc +20 -18
- package/.next/standalone/.next/server/app/ask.segments/_full.segment.rsc +27 -30
- package/.next/standalone/.next/server/app/ask.segments/_tree.segment.rsc +3 -2
- package/.next/standalone/.next/server/app/audit.html +1 -1
- package/.next/standalone/.next/server/app/audit.rsc +25 -24
- package/.next/standalone/.next/server/app/audit.segments/!KHdvcmtzcGFjZSk/audit/__PAGE__.segment.rsc +19 -18
- package/.next/standalone/.next/server/app/audit.segments/_full.segment.rsc +25 -24
- package/.next/standalone/.next/server/app/audit.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/auth/setup.html +1 -0
- package/.next/standalone/.next/server/app/auth/setup.meta +36 -0
- package/.next/standalone/.next/server/app/auth/setup.rsc +35 -0
- package/.next/standalone/.next/server/app/auth/setup.segments/!KGF1dGgp/auth/setup/__PAGE__.segment.rsc +33 -0
- package/.next/standalone/.next/server/app/auth/setup.segments/_full.segment.rsc +35 -0
- package/.next/standalone/.next/server/app/auth/setup.segments/_tree.segment.rsc +6 -0
- package/.next/standalone/.next/server/app/brain.html +1 -1
- package/.next/standalone/.next/server/app/brain.rsc +25 -24
- package/.next/standalone/.next/server/app/brain.segments/!KHdvcmtzcGFjZSk/brain/__PAGE__.segment.rsc +18 -17
- package/.next/standalone/.next/server/app/brain.segments/_full.segment.rsc +25 -24
- package/.next/standalone/.next/server/app/brain.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/budgets.html +1 -1
- package/.next/standalone/.next/server/app/budgets.rsc +25 -24
- package/.next/standalone/.next/server/app/budgets.segments/!KHdvcmtzcGFjZSk/budgets/__PAGE__.segment.rsc +19 -18
- package/.next/standalone/.next/server/app/budgets.segments/_full.segment.rsc +25 -24
- package/.next/standalone/.next/server/app/budgets.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/cockpit.html +1 -1
- package/.next/standalone/.next/server/app/cockpit.rsc +25 -24
- package/.next/standalone/.next/server/app/cockpit.segments/!KHdvcmtzcGFjZSk/cockpit/__PAGE__.segment.rsc +19 -18
- package/.next/standalone/.next/server/app/cockpit.segments/_full.segment.rsc +25 -24
- package/.next/standalone/.next/server/app/cockpit.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/connections.html +1 -1
- package/.next/standalone/.next/server/app/connections.rsc +22 -21
- package/.next/standalone/.next/server/app/connections.segments/!KHdvcmtzcGFjZSk/connections/__PAGE__.segment.rsc +17 -16
- package/.next/standalone/.next/server/app/connections.segments/_full.segment.rsc +22 -21
- package/.next/standalone/.next/server/app/connections.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/council.html +1 -1
- package/.next/standalone/.next/server/app/council.rsc +25 -24
- package/.next/standalone/.next/server/app/council.segments/!KHdvcmtzcGFjZSk/council/__PAGE__.segment.rsc +18 -17
- package/.next/standalone/.next/server/app/council.segments/_full.segment.rsc +25 -24
- package/.next/standalone/.next/server/app/council.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/employees.html +1 -1
- package/.next/standalone/.next/server/app/employees.rsc +25 -24
- package/.next/standalone/.next/server/app/employees.segments/!KHdvcmtzcGFjZSk/employees/__PAGE__.segment.rsc +18 -19
- package/.next/standalone/.next/server/app/employees.segments/_full.segment.rsc +25 -24
- package/.next/standalone/.next/server/app/employees.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/favicon.ico/route.js +1 -1
- package/.next/standalone/.next/server/app/favicon.ico/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/flow.html +1 -1
- package/.next/standalone/.next/server/app/flow.rsc +25 -31
- package/.next/standalone/.next/server/app/flow.segments/!KHdvcmtzcGFjZSk/flow/__PAGE__.segment.rsc +18 -17
- package/.next/standalone/.next/server/app/flow.segments/_full.segment.rsc +25 -31
- package/.next/standalone/.next/server/app/flow.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/focus.html +1 -1
- package/.next/standalone/.next/server/app/focus.rsc +25 -24
- package/.next/standalone/.next/server/app/focus.segments/!KHdvcmtzcGFjZSk/focus/__PAGE__.segment.rsc +19 -18
- package/.next/standalone/.next/server/app/focus.segments/_full.segment.rsc +25 -24
- package/.next/standalone/.next/server/app/focus.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/forgot-password.html +1 -1
- package/.next/standalone/.next/server/app/forgot-password.rsc +18 -22
- package/.next/standalone/.next/server/app/forgot-password.segments/!KGF1dGgp/forgot-password/__PAGE__.segment.rsc +26 -29
- package/.next/standalone/.next/server/app/forgot-password.segments/_full.segment.rsc +18 -22
- package/.next/standalone/.next/server/app/forgot-password.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/generation.html +1 -1
- package/.next/standalone/.next/server/app/generation.rsc +25 -24
- package/.next/standalone/.next/server/app/generation.segments/!KHdvcmtzcGFjZSk/generation/__PAGE__.segment.rsc +19 -18
- package/.next/standalone/.next/server/app/generation.segments/_full.segment.rsc +25 -24
- package/.next/standalone/.next/server/app/generation.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/goals.html +1 -1
- package/.next/standalone/.next/server/app/goals.rsc +25 -24
- package/.next/standalone/.next/server/app/goals.segments/!KHdvcmtzcGFjZSk/goals/__PAGE__.segment.rsc +19 -18
- package/.next/standalone/.next/server/app/goals.segments/_full.segment.rsc +25 -24
- package/.next/standalone/.next/server/app/goals.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/handover/interview.html +1 -0
- package/.next/standalone/.next/server/app/handover/{live.meta → interview.meta} +2 -2
- package/.next/standalone/.next/server/app/handover/interview.rsc +32 -0
- package/.next/standalone/.next/server/app/handover/interview.segments/!KHdvcmtzcGFjZSk/handover/interview/__PAGE__.segment.rsc +33 -0
- package/.next/standalone/.next/server/app/handover/interview.segments/_full.segment.rsc +32 -0
- package/.next/standalone/.next/server/app/handover/{live.segments → interview.segments}/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/handover.html +1 -1
- package/.next/standalone/.next/server/app/handover.rsc +25 -24
- package/.next/standalone/.next/server/app/handover.segments/!KHdvcmtzcGFjZSk/handover/__PAGE__.segment.rsc +19 -18
- package/.next/standalone/.next/server/app/handover.segments/_full.segment.rsc +25 -24
- package/.next/standalone/.next/server/app/handover.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/inbox.html +1 -1
- package/.next/standalone/.next/server/app/inbox.rsc +25 -24
- package/.next/standalone/.next/server/app/inbox.segments/!KHdvcmtzcGFjZSk/inbox/__PAGE__.segment.rsc +19 -18
- package/.next/standalone/.next/server/app/inbox.segments/_full.segment.rsc +25 -24
- package/.next/standalone/.next/server/app/inbox.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +9 -9
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +8 -8
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +9 -9
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/join/page.js +1 -1
- package/.next/standalone/.next/server/app/join/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/join/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/join.html +1 -1
- package/.next/standalone/.next/server/app/join.rsc +11 -11
- package/.next/standalone/.next/server/app/join.segments/_full.segment.rsc +11 -11
- package/.next/standalone/.next/server/app/join.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/join.segments/join/__PAGE__.segment.rsc +10 -10
- package/.next/standalone/.next/server/app/launchpad/page.js +1 -1
- package/.next/standalone/.next/server/app/launchpad/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/launchpad/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/launchpad.html +1 -1
- package/.next/standalone/.next/server/app/launchpad.rsc +11 -11
- package/.next/standalone/.next/server/app/launchpad.segments/_full.segment.rsc +11 -11
- package/.next/standalone/.next/server/app/launchpad.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/launchpad.segments/launchpad/__PAGE__.segment.rsc +10 -10
- package/.next/standalone/.next/server/app/learning.html +1 -1
- package/.next/standalone/.next/server/app/learning.rsc +25 -24
- package/.next/standalone/.next/server/app/learning.segments/!KHdvcmtzcGFjZSk/learning/__PAGE__.segment.rsc +19 -18
- package/.next/standalone/.next/server/app/learning.segments/_full.segment.rsc +25 -24
- package/.next/standalone/.next/server/app/learning.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/login.html +1 -1
- package/.next/standalone/.next/server/app/login.rsc +15 -15
- package/.next/standalone/.next/server/app/login.segments/!KGF1dGgp/login/__PAGE__.segment.rsc +13 -13
- package/.next/standalone/.next/server/app/login.segments/_full.segment.rsc +15 -15
- package/.next/standalone/.next/server/app/login.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/marketplace.html +2 -2
- package/.next/standalone/.next/server/app/marketplace.rsc +25 -24
- package/.next/standalone/.next/server/app/marketplace.segments/!KHdvcmtzcGFjZSk/marketplace/__PAGE__.segment.rsc +20 -18
- package/.next/standalone/.next/server/app/marketplace.segments/_full.segment.rsc +25 -24
- package/.next/standalone/.next/server/app/marketplace.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/onboarding/page.js +1 -1
- package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/onboarding.html +1 -1
- package/.next/standalone/.next/server/app/onboarding.rsc +11 -11
- package/.next/standalone/.next/server/app/onboarding.segments/_full.segment.rsc +11 -11
- package/.next/standalone/.next/server/app/onboarding.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +10 -10
- package/.next/standalone/.next/server/app/page.js +2 -2
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/profile.html +1 -1
- package/.next/standalone/.next/server/app/profile.rsc +25 -24
- package/.next/standalone/.next/server/app/profile.segments/!KHdvcmtzcGFjZSk/profile/__PAGE__.segment.rsc +20 -18
- package/.next/standalone/.next/server/app/profile.segments/_full.segment.rsc +25 -24
- package/.next/standalone/.next/server/app/profile.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/routines.html +1 -1
- package/.next/standalone/.next/server/app/routines.rsc +25 -24
- package/.next/standalone/.next/server/app/routines.segments/!KHdvcmtzcGFjZSk/routines/__PAGE__.segment.rsc +20 -18
- package/.next/standalone/.next/server/app/routines.segments/_full.segment.rsc +25 -24
- package/.next/standalone/.next/server/app/routines.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings.html +1 -1
- package/.next/standalone/.next/server/app/settings.rsc +25 -24
- package/.next/standalone/.next/server/app/settings.segments/!KHdvcmtzcGFjZSk/settings/__PAGE__.segment.rsc +20 -18
- package/.next/standalone/.next/server/app/settings.segments/_full.segment.rsc +25 -24
- package/.next/standalone/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/setup/page.js +1 -1
- package/.next/standalone/.next/server/app/setup/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/setup.html +1 -1
- package/.next/standalone/.next/server/app/setup.rsc +11 -11
- package/.next/standalone/.next/server/app/setup.segments/_full.segment.rsc +11 -11
- package/.next/standalone/.next/server/app/setup.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/setup.segments/setup/__PAGE__.segment.rsc +10 -10
- package/.next/standalone/.next/server/app/signup.html +1 -1
- package/.next/standalone/.next/server/app/signup.rsc +18 -22
- package/.next/standalone/.next/server/app/signup.segments/!KGF1dGgp/signup/__PAGE__.segment.rsc +26 -29
- package/.next/standalone/.next/server/app/signup.segments/_full.segment.rsc +18 -22
- package/.next/standalone/.next/server/app/signup.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/sources/page.js +1 -1
- package/.next/standalone/.next/server/app/sources/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/sources/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/sources.html +1 -1
- package/.next/standalone/.next/server/app/sources.rsc +11 -11
- package/.next/standalone/.next/server/app/sources.segments/_full.segment.rsc +11 -11
- package/.next/standalone/.next/server/app/sources.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/sources.segments/sources/__PAGE__.segment.rsc +10 -10
- package/.next/standalone/.next/server/app/tasks.html +1 -1
- package/.next/standalone/.next/server/app/tasks.rsc +25 -24
- package/.next/standalone/.next/server/app/tasks.segments/!KHdvcmtzcGFjZSk/tasks/__PAGE__.segment.rsc +20 -18
- package/.next/standalone/.next/server/app/tasks.segments/_full.segment.rsc +25 -24
- package/.next/standalone/.next/server/app/tasks.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/templates.html +1 -1
- package/.next/standalone/.next/server/app/templates.rsc +25 -24
- package/.next/standalone/.next/server/app/templates.segments/!KHdvcmtzcGFjZSk/templates/__PAGE__.segment.rsc +19 -18
- package/.next/standalone/.next/server/app/templates.segments/_full.segment.rsc +25 -24
- package/.next/standalone/.next/server/app/templates.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/twin-build/page.js +1 -1
- package/.next/standalone/.next/server/app/twin-build/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/twin-build/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/twin-build.html +1 -1
- package/.next/standalone/.next/server/app/twin-build.rsc +11 -11
- package/.next/standalone/.next/server/app/twin-build.segments/_full.segment.rsc +11 -11
- package/.next/standalone/.next/server/app/twin-build.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/twin-build.segments/twin-build/__PAGE__.segment.rsc +10 -10
- package/.next/standalone/.next/server/app/welcome/page.js +1 -1
- package/.next/standalone/.next/server/app/welcome/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/welcome/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/welcome.html +1 -1
- package/.next/standalone/.next/server/app/welcome.rsc +11 -11
- package/.next/standalone/.next/server/app/welcome.segments/_full.segment.rsc +11 -11
- package/.next/standalone/.next/server/app/welcome.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/welcome.segments/welcome/__PAGE__.segment.rsc +10 -10
- package/.next/standalone/.next/server/app/workspace.html +1 -1
- package/.next/standalone/.next/server/app/workspace.rsc +25 -24
- package/.next/standalone/.next/server/app/workspace.segments/!KHdvcmtzcGFjZSk/workspace/__PAGE__.segment.rsc +19 -18
- package/.next/standalone/.next/server/app/workspace.segments/_full.segment.rsc +25 -24
- package/.next/standalone/.next/server/app/workspace.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +26 -2
- package/.next/standalone/.next/server/chunks/{[externals]__1limx8_._.js → [externals]__0nxi2l4._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[externals]__1pi7aj5._.js → [externals]__0vcj7kw._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[externals]__1z3kzg4._.js → [externals]__1_901ey._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[externals]__00k-v4v._.js → [externals]__1ewdba2._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[externals]_fs_00fjqgo._.js → [externals]_fs_07t3o6l._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[externals]_fs_17h9b_u._.js → [externals]_fs_0ag5n5g._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[externals]_fs_1hz8wnu._.js → [externals]_fs_0dp2q9g._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[externals]_fs_1j98zw6._.js → [externals]_fs_0ili5zm._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[externals]_fs_0pbe5pu._.js +3 -0
- package/.next/standalone/.next/server/chunks/[externals]_fs_0wzdz4f._.js +3 -0
- package/.next/standalone/.next/server/chunks/[externals]_fs_15hr4nt._.js +3 -0
- package/.next/standalone/.next/server/chunks/[externals]_fs_1jxb7rx._.js +3 -0
- package/.next/standalone/.next/server/chunks/[externals]_fs_1psq23k._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-n2mqu._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-vc3ao._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__1kb4y5e._.js → [root-of-the-server]__01ehhqm._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0l15w_l._.js → [root-of-the-server]__02qmjil._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__03rtbq-._.js +4 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0_5a22_._.js → [root-of-the-server]__04f6tue._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__03k-vg3._.js → [root-of-the-server]__04jh1d6._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__05om_3g._.js +32 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__06yw_39._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0010rmm._.js → [root-of-the-server]__07_xozb._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__08-u69v._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__1-yyomh._.js → [root-of-the-server]__08d3sqn._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__09k8l8g._.js +5 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_qwjly._.js +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0aolece._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__1zwylqr._.js → [root-of-the-server]__0b3ohn-._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0bm2v-l._.js +3 -3
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0so8if0._.js → [root-of-the-server]__0ca2u_8._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0chy3s3._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0csv-lz._.js +10 -10
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0i6w8f-._.js → [root-of-the-server]__0d89ksg._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__036eg7y._.js → [root-of-the-server]__0e5b-vz._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0eg0pva._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__104e4f0._.js → [root-of-the-server]__0gbweob._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0gt0fut._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0lzmaey._.js → [root-of-the-server]__0k_4txt._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__1krsm0c._.js → [root-of-the-server]__0li8h7i._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0lixxrh._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0m7nqjn._.js +32 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0mwbyyk._.js +5 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0myrv44._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ng48j9._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0nirfrp._.js +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0nqdfck._.js +65 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ola1qn._.js +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0opw_le._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0pkwpyc._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0poyc33._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0pvjdmc._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__20gjrtf._.js → [root-of-the-server]__0q4_9em._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0q5qvb5._.js +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0-9d1vn._.js → [root-of-the-server]__0q9ziii._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qc51dg._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__1k6d3ft._.js → [root-of-the-server]__0qmahnj._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0512jpi._.js → [root-of-the-server]__0qw-4j8._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__1e055ud._.js → [root-of-the-server]__0ru3j57._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__12yk1zb._.js → [root-of-the-server]__0s_twdz._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0f9fcy_._.js → [root-of-the-server]__0t88ktj._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__125b8kl._.js → [root-of-the-server]__0utjftu._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__11yxbwh._.js → [root-of-the-server]__0uwlfx4._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0vf1iyh._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0xo5_el._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0xrwxwo._.js +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0y0zw0d._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0ce5tqr._.js → [root-of-the-server]__0yxxa8m._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0z-y5c1._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0z7yb43._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1-4zkf4._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0tyh-03._.js → [root-of-the-server]__1-tgkxr._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1-uv5ed._.js +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0yptt0g._.js → [root-of-the-server]__1-wtne5._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__10jhvip._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__1maniwq._.js → [root-of-the-server]__10y-v9i._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__115qdau._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__11x48t8._.js +32 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__12h9vzc._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__12pl2yl._.js +32 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__12yudew._.js +65 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1411h8e._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__146oxo7._.js +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__14k2814._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__14ref7k._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__1ftvei8._.js → [root-of-the-server]__14s90wy._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__15sgf09._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__17_hrz-._.js +155 -89
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__18cuw8j._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__18u-m0_._.js +32 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__05fn4ap._.js → [root-of-the-server]__1a1e_2v._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1ahn2ih._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1at3c43._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1bnpxy1._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__1-gq653._.js → [root-of-the-server]__1bo96gy._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__119jmnq._.js → [root-of-the-server]__1cxo3b3._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1d1u19l._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1e0lyo5._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1ei70__._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1ewsv28._.js +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1hb0rv1._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1ichg88._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__1ld4ywi._.js → [root-of-the-server]__1il9_7s._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1imswj8._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1ismwpk._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1isniyv._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1itgzj7._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0mgw-aw._.js → [root-of-the-server]__1j7qi9k._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1jklz16._.js +4 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__1trcpa7._.js → [root-of-the-server]__1kcaug_._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1kfptd7._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__131o7pw._.js → [root-of-the-server]__1kwf51i._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1l4szc5._.js +3 -3
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__18bm57r._.js → [root-of-the-server]__1m8-w67._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1mcx_t2._.js +4 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__1tqwo94._.js → [root-of-the-server]__1mpsfey._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1mxo-yh._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1n0v-lv._.js +4 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__13165dk._.js → [root-of-the-server]__1nea5fw._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1o2t6af._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__18m9a4-._.js → [root-of-the-server]__1o_rt16._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__05rmhfn._.js → [root-of-the-server]__1oe3-j9._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1pibpsu._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1pj9htu._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0hev_-e._.js → [root-of-the-server]__1pppsd4._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1pq3u_0._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__03t0cmh._.js → [root-of-the-server]__1qnmqw0._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__1bnu2qr._.js → [root-of-the-server]__1r6fsl2._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1r76xr9._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1rvr5z4._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1s4r4cv._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1sog9ok._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1t7wk01._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1tscicc._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1u7wown._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1uo6xdt._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1v1arwr._.js +142 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1v4mf3p._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1wlpthr._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1x0ggm3._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1x6p59a._.js +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1xgp4xr._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1xm1uoh._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0-gdrw3._.js → [root-of-the-server]__1z056-d._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1z1sm07._.js +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1zb90ri._.js +4 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__19mdfmb._.js → [root-of-the-server]__1zyjypx._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__212syas._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0t1txsb._.js → [root-of-the-server]__2139zr4._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{_0-6e2pd._.js → _01rie1w._.js} +52 -20
- package/.next/standalone/.next/server/chunks/_01xrnfn._.js +3 -0
- package/.next/standalone/.next/server/chunks/_04xy4n6._.js +3 -0
- package/.next/standalone/.next/server/chunks/_06xt0ue._.js +3 -0
- package/.next/standalone/.next/server/chunks/_0982uo6._.js +85 -50
- package/.next/standalone/.next/server/chunks/_0dhc9en._.js +2 -2
- package/.next/standalone/.next/server/chunks/{_0lhu4s7._.js → _0f2-nuc._.js} +52 -20
- package/.next/standalone/.next/server/chunks/_0jr7u6u._.js +3 -0
- package/.next/standalone/.next/server/chunks/_0k_ctn0._.js +3 -0
- package/.next/standalone/.next/server/chunks/_0q23_hv._.js +1 -1
- package/.next/standalone/.next/server/chunks/_0qzjv-u._.js +3 -0
- package/.next/standalone/.next/server/chunks/_0rf3leo._.js +5 -5
- package/.next/standalone/.next/server/chunks/_0u__w0t._.js +3 -0
- package/.next/standalone/.next/server/chunks/_0vhkeez._.js +3 -0
- package/.next/standalone/.next/server/chunks/_0wsfql9._.js +3 -0
- package/.next/standalone/.next/server/chunks/_0ycu-lj._.js +3 -3
- package/.next/standalone/.next/server/chunks/_176vd3-._.js +5 -0
- package/.next/standalone/.next/server/chunks/_1_00ht9._.js +3 -0
- package/.next/standalone/.next/server/chunks/_1ak-huv._.js +1 -1
- package/.next/standalone/.next/server/chunks/_1g9a9x-._.js +3 -0
- package/.next/standalone/.next/server/chunks/_1gpufk7._.js +3 -3
- package/.next/standalone/.next/server/chunks/_1h9h72-._.js +2 -2
- package/.next/standalone/.next/server/chunks/_1izhih1._.js +3 -0
- package/.next/standalone/.next/server/chunks/{_1gu152b._.js → _1vo9y9t._.js} +52 -20
- package/.next/standalone/.next/server/chunks/_1xa-d-y._.js +1 -1
- package/.next/standalone/.next/server/chunks/_1xgxv5x._.js +3 -0
- package/.next/standalone/.next/server/chunks/_1xw_kw0._.js +3 -0
- package/.next/standalone/.next/server/chunks/_2009skr._.js +2 -2
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_audit_export_route_actions_0cte8ch.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_auth_login_route_actions_1ox7zi0.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_auth_logout_route_actions_0regwyr.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_auth_me_route_actions_17uv6xh.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_auth_mfa_confirm_route_actions_15emc1c.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_auth_mfa_disable_route_actions_18h8v3o.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_auth_mfa_enroll_route_actions_0pn0--q.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_auth_mfa_verify_route_actions_0o6pdez.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_auth_oidc_callback_route_actions_1plmqdo.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_auth_oidc_start_route_actions_200mui0.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_auth_password_route_actions_1qvu66h.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_auth_setup_route_actions_14j5aon.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_auth_users_[id]_route_actions_0tp4byy.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_auth_users_route_actions_1tt685v.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_consent_required_route_actions_1ha11b1.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_org_read-allowlist_route_actions_1icso8z.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_org_slack-autoreply_route_actions_12s7gzu.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_relay_[employeeId]_consent_route_actions_19815l0.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_relay_[employeeId]_package_route_actions_06vi30u.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_relay_route_actions_05ac61w.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_stt_route_actions_1syp06r.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_stt_token_route_actions_164n_0c.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_tts_token_route_actions_1o-yvv_.js +3 -0
- package/.next/standalone/.next/server/chunks/src_0hb7ag_._.js +3 -0
- package/.next/standalone/.next/server/chunks/src_lib_01g9r1q._.js +7 -7
- package/.next/standalone/.next/server/chunks/src_lib_15r786a._.js +3 -0
- package/.next/standalone/.next/server/chunks/src_lib_auth_100taw0._.js +3 -0
- package/.next/standalone/.next/server/chunks/src_lib_data-residency_ts_0lijrw5._.js +3 -0
- package/.next/standalone/.next/server/chunks/src_lib_i18n_catalog_onboarding_ts_0c4jwse._.js +3 -0
- package/.next/standalone/.next/server/chunks/src_lib_routine-scheduler_ts_1hapepe._.js +20 -20
- package/.next/standalone/.next/server/chunks/src_lib_twin-build-runner_ts_1lh_a33._.js +4 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0727-51._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0dwpths._.js → [root-of-the-server]__0mc8o1s._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0llcmpq._.js → [root-of-the-server]__0tbrsri._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__018mor7._.js → [root-of-the-server]__12-plo3._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1bfoflf._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__212gcrn._.js → [root-of-the-server]__1fvglqm._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1mrz5ah._.js → [root-of-the-server]__1gmph10._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1ui1hej._.js → [root-of-the-server]__1hkl3m7._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1ssteud._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1vxhzid._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0gemer1._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0m32r04._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0p6llav._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0trhjqm._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0iuf43o._.js → _12fqcyo._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_1r9t6kn._.js → _131qt6y._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_18978yo._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1n06g1t._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0gohe7n._.js → _1ufnkt1._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_1z6l4hu._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app_(auth)_auth_setup_page_actions_1apt5s6.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app_(workspace)_account_page_actions_0hnvlrl.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app_(workspace)_handover_interview_page_actions_0qkpc9z.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_04-1x6i._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_0jfdpts._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_17w3tf-._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_0h449mj._.js → node_modules_1n2_hbe._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/node_modules_@reactflow_core_dist_esm_index_mjs_1izve_l._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_0drixxt._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_1v8aef8._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_08p45eu._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_0oyh0tt._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_0u5t-97._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_0vo-ngp._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_12saktg._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_19xm9v7._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_(workspace)_ask_page_tsx_03wnqs7._.js +21 -3
- package/.next/standalone/.next/server/chunks/ssr/src_app_(workspace)_brain_page_tsx_1q-bnp7._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_(workspace)_council_page_tsx_0eegc9s._.js +4 -4
- package/.next/standalone/.next/server/chunks/ssr/src_app_(workspace)_employees_page_tsx_0kg94aw._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/src_app_(workspace)_flow_page_tsx_0y2iq8g._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/src_app_(workspace)_marketplace_page_tsx_0hgmj_8._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_(workspace)_routines_page_tsx_1n6xrkt._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_onboarding_page_tsx_1kq06fb._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_setup_page_tsx_0szlnxo._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_twin-build_page_tsx_100su_3._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_components_0xl7ihx._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_components_ex_i18n-context_tsx_1exnnt-._.js +1 -1
- package/.next/standalone/.next/server/functions-config-manifest.json +24 -6
- package/.next/standalone/.next/server/instrumentation.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/middleware.js +1 -1
- package/.next/standalone/.next/server/next-font-manifest.js +1 -1
- package/.next/standalone/.next/server/next-font-manifest.json +13 -1
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/prefetch-hints.json +44 -1
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/static/chunks/00xi6epzddd9_.js +1 -0
- package/.next/standalone/.next/static/chunks/09g03bgpk_gox.js +1 -0
- package/.next/standalone/.next/static/chunks/0c7-x9-qnxass.js +3 -0
- package/.next/standalone/.next/static/chunks/0x4by6_a26efe.js +1 -0
- package/.next/standalone/.next/static/chunks/0z5u1_lhywrie.js +13 -0
- package/.next/standalone/.next/static/chunks/0zevh2qohf_3t.js +9 -0
- package/.next/standalone/.next/static/chunks/1-j3r1d0j2zq-.js +1 -0
- package/.next/standalone/.next/static/chunks/114zb_ipd2ems.js +1 -0
- package/.next/standalone/.next/static/chunks/17ox-8evz-xpr.js +1 -0
- package/.next/standalone/.next/static/chunks/1d5toi8apt4qj.js +1 -0
- package/.next/standalone/.next/static/chunks/1jppc_c6sk5gi.js +1 -0
- package/.next/standalone/.next/static/chunks/{06d8-3m9aok-8.js → 1wb-3-f28j2ej.js} +1 -1
- package/.next/standalone/.next/static/chunks/{2um66gzq_iz4w.js → 1yu168a5k2-ut.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0c3n_v7d961bq.js → 28sbt-haxiphd.js} +1 -1
- package/.next/standalone/.next/static/chunks/2a128cwgekm0g.js +1 -0
- package/.next/standalone/.next/static/chunks/2e79-nqss9-uo.js +1 -0
- package/.next/standalone/.next/static/chunks/2kb90u7kiaa21.js +1 -0
- package/.next/standalone/.next/static/chunks/2rag-53ut-5dn.js +3 -0
- package/.next/standalone/.next/static/chunks/{2qulwnctyl8i6.js → 2rucecierpb26.js} +3 -3
- package/.next/standalone/.next/static/chunks/2scfg_49gwu8r.js +1 -0
- package/.next/standalone/.next/static/chunks/2y42dpykhd3-n.js +1 -0
- package/.next/standalone/.next/static/chunks/{25wg8grttp78r.js → 2yscc1v3yf10y.js} +2 -2
- package/.next/standalone/.next/static/chunks/329_eih46omjt.js +4 -0
- package/.next/standalone/.next/static/chunks/{3punzoxl9wb29.js → 380bgkhfm4p8w.js} +1 -1
- package/.next/standalone/.next/static/chunks/{1i5u_g-j38kdw.js → 3_nuv864d2-p7.js} +1 -1
- package/.next/standalone/.next/static/chunks/3_v6dijlqiuml.js +236 -0
- package/.next/standalone/.next/static/chunks/3bcuo-ckmd9op.js +1 -0
- package/.next/standalone/.next/static/chunks/3okurz0kou_yf.js +23 -0
- package/.next/standalone/.next/static/chunks/3sb-6rbshmu36.js +1 -0
- package/.next/standalone/.next/static/chunks/{3grhdjv6993ar.css → 444p843u2ch-j.css} +1 -1
- package/.next/standalone/package.json +5 -2
- package/.next/standalone/server.js +1 -1
- package/README.md +239 -267
- package/bin/cli.mjs +34 -10
- package/bin/commands/audit.mjs +41 -0
- package/bin/commands/demo.mjs +16 -1
- package/bin/commands/mcp.mjs +7 -8
- package/bin/commands/setup.mjs +83 -43
- package/bin/commands/start.mjs +18 -2
- package/bin/demo/data/employees/amara-vale/employee.json +2 -1
- package/bin/demo/data/employees/elise-moreno/employee.json +2 -1
- package/bin/demo/data/employees/marcus-reed/employee.json +2 -1
- package/bin/demo/data/employees/priya-nair/employee.json +2 -1
- package/bin/demo/data/employees/yael-ben-ami/employee.json +2 -1
- package/bin/lib/audit-verify.mjs +94 -0
- package/bin/lib/mcp-bridge.mjs +46 -5
- package/bin/lib/node-version.mjs +2 -2
- package/bin/lib/port.mjs +32 -0
- package/package.json +5 -2
- package/.next/standalone/.next/server/app/(workspace)/handover/live/page/app-paths-manifest.json +0 -3
- package/.next/standalone/.next/server/app/(workspace)/handover/live/page_client-reference-manifest.js +0 -3
- package/.next/standalone/.next/server/app/api/relay/[employeeId]/stream/route/app-paths-manifest.json +0 -3
- package/.next/standalone/.next/server/app/api/relay/[employeeId]/stream/route.js +0 -7
- package/.next/standalone/.next/server/app/api/relay/[employeeId]/stream/route_client-reference-manifest.js +0 -3
- package/.next/standalone/.next/server/app/handover/live.html +0 -1
- package/.next/standalone/.next/server/app/handover/live.rsc +0 -31
- package/.next/standalone/.next/server/app/handover/live.segments/!KHdvcmtzcGFjZSk/handover/live/__PAGE__.segment.rsc +0 -32
- package/.next/standalone/.next/server/app/handover/live.segments/_full.segment.rsc +0 -31
- package/.next/standalone/.next/server/chunks/[externals]_fs_1jhye3e._.js +0 -3
- package/.next/standalone/.next/server/chunks/[externals]_fs_1rui0sw._.js +0 -3
- package/.next/standalone/.next/server/chunks/[externals]_fs_1t-8zdj._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__00fh0we._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0472deh._.js +0 -32
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__069vopk._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__07g8345._.js +0 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__07h2n-0._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__08or3b3._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_2eoeo._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_ds8pz._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_hvxbq._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0a04ney._.js +0 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0cq74yf._.js +0 -65
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0cvo9_3._.js +0 -32
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0fg6uni._.js +0 -5
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0h46hu0._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0havxbz._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0i1jy0r._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0igi7ks._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0io9lcq._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ivai0r._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ja65z_._.js +0 -160
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0jyjpp-._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0l4n2qp._.js +0 -65
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0n0_p7i._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0pg_6uf._.js +0 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0sdihuj._.js +0 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0szyubc._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0u3po0d._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0vigvxv._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wij6di._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0xa2cqn._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0zcybcp._.js +0 -32
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1-e7v0-._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1-s9nmh._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__102ufcx._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__11l_ew8._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__11yf45e._.js +0 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__12k8mcq._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__14celvq._.js +0 -32
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__15kfvzi._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__15mnd51._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__16x1shk._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__18hydc1._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__19i8pxn._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1_9b7vq._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1a23u02._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1c2-n9h._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1d22l5t._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1e_zjjz._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1fxpd15._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1gr4jts._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1hkjat3._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1j63r0r._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1l2y8mq._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1n4ib37._.js +0 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1paekf9._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1qvpc0o._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1rx01oe._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1sy7k9y._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1tgc3ox._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1vvaak8._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1w59_7k._.js +0 -7
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1x9bxnh._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1xo5vg6._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1xp1-a2._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1yb1sfm._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__20-08y5._.js +0 -32
- package/.next/standalone/.next/server/chunks/_016a3j7._.js +0 -3
- package/.next/standalone/.next/server/chunks/_0l1k_bg._.js +0 -3
- package/.next/standalone/.next/server/chunks/_1td1smt._.js +0 -34
- package/.next/standalone/.next/server/chunks/_20uz0e5._.js +0 -5
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_relay_[employeeId]_stream_route_actions_02ysbse.js +0 -3
- package/.next/standalone/.next/server/chunks/src_0bjm8f6._.js +0 -3
- package/.next/standalone/.next/server/chunks/src_lib_06aj-vv._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0k65baz._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1v5cf9h._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1yx37p1._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_09lqkh4._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0u3vp6p._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_1emf68-._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app_(workspace)_handover_live_page_actions_1-7hx2_.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_@swc_helpers_cjs__interop_require_default_cjs_0_02q6_._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_0yfr3uu._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_app_(workspace)_handover_live_page_tsx_0ttfkz9._.js +0 -9
- package/.next/standalone/.next/server/chunks/ssr/src_app_(workspace)_handover_page_tsx_0dvjd7_._.js +0 -13
- package/.next/standalone/.next/server/chunks/ssr/src_components_ex_0m2040b._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_components_ex_handover-tabs_tsx_02oimof._.js +0 -3
- package/.next/standalone/.next/static/chunks/070sldl_zbtbs.js +0 -1
- package/.next/standalone/.next/static/chunks/09y5jq2io7j5f.js +0 -7
- package/.next/standalone/.next/static/chunks/0e9g_riqq_fal.js +0 -1
- package/.next/standalone/.next/static/chunks/0r57e2rd91472.js +0 -1
- package/.next/standalone/.next/static/chunks/0vu1j7c5234-a.js +0 -1
- package/.next/standalone/.next/static/chunks/0vx0txc5w-upo.js +0 -1
- package/.next/standalone/.next/static/chunks/0wbx1ylp-ihyy.js +0 -9
- package/.next/standalone/.next/static/chunks/0yi29ah290y0r.js +0 -5
- package/.next/standalone/.next/static/chunks/176a_4gkmczzs.js +0 -1
- package/.next/standalone/.next/static/chunks/1_jklidlos85i.js +0 -3
- package/.next/standalone/.next/static/chunks/1ba349blam86v.js +0 -1
- package/.next/standalone/.next/static/chunks/1ccd20g3n-xw3.js +0 -1
- package/.next/standalone/.next/static/chunks/1ewhfgqf3y72h.js +0 -1
- package/.next/standalone/.next/static/chunks/1gro73d89yeh8.js +0 -1
- package/.next/standalone/.next/static/chunks/1xi6knt8jtbru.js +0 -11
- package/.next/standalone/.next/static/chunks/2gaif3o_1onop.js +0 -3
- package/.next/standalone/.next/static/chunks/2y1eulaukpmb1.js +0 -236
- package/.next/standalone/.next/static/chunks/335g1d_jw440g.js +0 -4
- package/.next/standalone/.next/static/chunks/39l2fxea-mqch.js +0 -13
- package/.next/standalone/.next/static/chunks/3_9x58-x3-8i2.js +0 -1
- package/.next/standalone/.next/static/chunks/3ru1-spx5q99n.js +0 -1
- /package/.next/standalone/.next/server/app/{(workspace)/handover/live → (auth)/auth/setup}/page/build-manifest.json +0 -0
- /package/.next/standalone/.next/server/app/{(workspace)/handover/live → (auth)/auth/setup}/page/react-loadable-manifest.json +0 -0
- /package/.next/standalone/.next/server/app/{(workspace)/handover/live → (auth)/auth/setup}/page/server-reference-manifest.json +0 -0
- /package/.next/standalone/.next/server/app/{(workspace)/handover/live → (auth)/auth/setup}/page.js.map +0 -0
- /package/.next/standalone/.next/server/app/{api/relay/[employeeId]/stream/route → (workspace)/account/page}/server-reference-manifest.json +0 -0
- /package/.next/standalone/.next/server/app/{api/relay/[employeeId]/stream/route.js.map → (workspace)/account/page.js.map} +0 -0
- /package/.next/standalone/.next/server/app/api/{relay/[employeeId]/stream → audit/export}/route/build-manifest.json +0 -0
- /package/.next/standalone/.next/static/{Xgi_g_n9LTDlgX3524TKa → EznAhYnUBWbpPitFK99k0}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{Xgi_g_n9LTDlgX3524TKa → EznAhYnUBWbpPitFK99k0}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{Xgi_g_n9LTDlgX3524TKa → EznAhYnUBWbpPitFK99k0}/_ssgManifest.js +0 -0
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
module.exports=[740507,488318,911433,988169,e=>{"use strict";let t,r;e.i(844376);var s,n,i,o,a,l=Object.defineProperty;function c(e,t,r,s,n){if("m"===s)throw TypeError("Private method is not writable");if("a"===s&&!n)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,r):n?n.value=r:t.set(e,r),r}function u(e,t,r,s){if("a"===r&&!s)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?s:"a"===r?s.call(e):s?s.value:t.get(e)}e.s(["t",0,(e,t)=>{let r={};for(var s in e)l(r,s,{get:e[s],enumerable:!0});return t&&l(r,Symbol.toStringTag,{value:"Module"}),r}],740507);let d=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return d=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),r=e?()=>e.getRandomValues(t)[0]:()=>255*Math.random()&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(e^r()&15>>e/4).toString(16))},h=e=>{if(e instanceof Error)return e;if("object"==typeof e&&null!==e){try{if("[object Error]"===Object.prototype.toString.call(e)){let t=Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(t.stack=e.stack),e.cause&&!t.cause&&(t.cause=e.cause),e.name&&(t.name=e.name),t}}catch{}try{return Error(JSON.stringify(e))}catch{}}return Error(e)};class p extends Error{}class f extends p{constructor(e,t,r,s){super(`${f.makeMessage(e,t,r)}`),this.status=e,this.headers=s,this.error=t}static makeMessage(e,t,r){let s=t?.message?"string"==typeof t.message?t.message:JSON.stringify(t.message):t?JSON.stringify(t):r;return e&&s?`${e} ${s}`:e?`${e} status code (no body)`:s||"(no status code or body)"}static generate(e,t,r,s){return e&&s?400===e?new b(e,t,r,s):401===e?new _(e,t,r,s):403===e?new w(e,t,r,s):404===e?new v(e,t,r,s):409===e?new I(e,t,r,s):422===e?new k(e,t,r,s):429===e?new x(e,t,r,s):e>=500?new T(e,t,r,s):new f(e,t,r,s):new g({message:r,cause:h(t)})}}class m extends f{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}}class g extends f{constructor({message:e,cause:t}){super(void 0,void 0,e||"Connection error.",void 0),t&&(this.cause=t)}}class y extends g{constructor({message:e}={}){super({message:e??"Request timed out."})}}class b extends f{}class _ extends f{}class w extends f{}class v extends f{}class I extends f{}class k extends f{}class x extends f{}class T extends f{}e.s(["APIConnectionError",0,g,"APIConnectionTimeoutError",0,y,"APIError",0,f,"APIUserAbortError",0,m,"AuthenticationError",0,_,"BadRequestError",0,b,"ComposioError",0,p,"ConflictError",0,I,"InternalServerError",0,T,"NotFoundError",0,v,"PermissionDeniedError",0,w,"RateLimitError",0,x,"UnprocessableEntityError",0,k],488318);let E=/^[a-z][a-z0-9+.-]*:/i,z=e=>(z=Array.isArray)(e),A=z;function S(e){if(!e)return!0;for(let t in e)return!1;return!0}let C="0.1.0-alpha.66",O=e=>"x32"===e?"x32":"x86_64"===e||"x64"===e?"x64":"arm"===e?"arm":"aarch64"===e||"arm64"===e?"arm64":e?`other:${e}`:"unknown",P=e=>(e=e.toLowerCase()).includes("ios")?"iOS":"android"===e?"Android":"darwin"===e?"MacOS":"win32"===e?"Windows":"freebsd"===e?"FreeBSD":"openbsd"===e?"OpenBSD":"linux"===e?"Linux":e?`Other:${e}`:"Unknown";async function R(e){if(null===e||"object"!=typeof e)return;if(e[Symbol.asyncIterator])return void await e[Symbol.asyncIterator]().return?.();let t=e.getReader(),r=t.cancel();t.releaseLock(),await r}let $=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)}),N="RFC3986",j=e=>String(e),L={RFC1738:e=>String(e).replace(/%20/g,"+"),RFC3986:j},D=(e,t)=>(D=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty))(e,t),U=(()=>{let e=[];for(let t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e})();function F(e,t){if(z(e)){let r=[];for(let s=0;s<e.length;s+=1)r.push(t(e[s]));return r}return t(e)}let M={brackets:e=>String(e)+"[]",comma:"comma",indices:(e,t)=>String(e)+"["+t+"]",repeat:e=>String(e)},Z=function(e,t){Array.prototype.push.apply(e,z(t)?t:[t])},B={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:(e,t,r,s,n)=>{if(0===e.length)return e;let i=e;if("symbol"==typeof e?i=Symbol.prototype.toString.call(e):"string"!=typeof e&&(i=String(e)),"iso-8859-1"===r)return escape(i).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});let o="";for(let e=0;e<i.length;e+=1024){let t=i.length>=1024?i.slice(e,e+1024):i,r=[];for(let e=0;e<t.length;++e){let s=t.charCodeAt(e);if(45===s||46===s||95===s||126===s||s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122||"RFC1738"===n&&(40===s||41===s)){r[r.length]=t.charAt(e);continue}if(s<128){r[r.length]=U[s];continue}if(s<2048){r[r.length]=U[192|s>>6]+U[128|63&s];continue}if(s<55296||s>=57344){r[r.length]=U[224|s>>12]+U[128|s>>6&63]+U[128|63&s];continue}e+=1,s=65536+((1023&s)<<10|1023&t.charCodeAt(e)),r[r.length]=U[240|s>>18]+U[128|s>>12&63]+U[128|s>>6&63]+U[128|63&s]}o+=r.join("")}return o},encodeValuesOnly:!1,format:N,formatter:j,indices:!1,serializeDate:e=>(r??(r=Function.prototype.call.bind(Date.prototype.toISOString)))(e),skipNulls:!1,strictNullHandling:!1},V={},W=()=>{if("u"<typeof File){let{process:e}=globalThis;throw Error("`File` is not defined as a global, which is required for file uploads."+("string"==typeof e?.versions?.node&&20>parseInt(e.versions.node.split("."))?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function K(e,t,r){return W(),new File(e,t??"unknown_file",r)}let q=e=>null!=e&&"object"==typeof e&&"number"==typeof e.size&&"string"==typeof e.type&&"function"==typeof e.text&&"function"==typeof e.slice&&"function"==typeof e.arrayBuffer;async function H(e,t,r){var s;let n,i;if(W(),null!=(n=e=await e)&&"object"==typeof n&&"string"==typeof n.name&&"number"==typeof n.lastModified&&q(n))return e instanceof File?e:K([await e.arrayBuffer()],e.name);if(null!=(i=e)&&"object"==typeof i&&"string"==typeof i.url&&"function"==typeof i.blob){let s=await e.blob();return t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()),K(await G(s),t,r)}let o=await G(e);if(t||(t=("object"==typeof(s=e)&&null!==s&&("name"in s&&s.name&&String(s.name)||"url"in s&&s.url&&String(s.url)||"filename"in s&&s.filename&&String(s.filename)||"path"in s&&s.path&&String(s.path))||"").split(/[\\/]/).pop()||void 0),!r?.type){let e=o.find(e=>"object"==typeof e&&"type"in e&&e.type);"string"==typeof e&&(r={...r,type:e})}return K(o,t,r)}async function G(e){let t=[];if("string"==typeof e||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(q(e))t.push(e instanceof Blob?e:await e.arrayBuffer());else{let r;if(null!=(r=e)&&"object"==typeof r&&"function"==typeof r[Symbol.asyncIterator])for await(let r of e)t.push(...await G(r));else{let t=e?.constructor?.name;throw Error(`Unexpected data type: ${typeof e}${t?`; constructor: ${t}`:""}${function(e){if("object"!=typeof e||null===e)return"";let t=Object.getOwnPropertyNames(e);return`; props: [${t.map(e=>`"${e}"`).join(", ")}]`}(e)}`)}}return t}class X{constructor(e){this._client=e}}class J extends X{auth(e,t){return this._client.post("/api/v3/cli/realtime/auth",{body:e,...t})}credentials(e){return this._client.get("/api/v3/cli/realtime/credentials",e)}}class Y extends X{constructor(){super(...arguments),this.realtime=new J(this._client)}createSession(e={},t){return this._client.post("/api/v3/cli/create-session",{body:e,...t})}getSession(e,t){return this._client.get("/api/v3/cli/get-session",{query:e,...t})}}function Q(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}Y.Realtime=J;let ee=Object.freeze(Object.create(null)),et=((e=Q)=>function(t,...r){let s;if(1===t.length)return t[0];let n=!1,i=[],o=t.reduce((t,s,o)=>{/[?#]/.test(s)&&(n=!0);let a=r[o],l=(n?encodeURIComponent:e)(""+a);return o!==r.length&&(null==a||"object"==typeof a&&a.toString===Object.getPrototypeOf(Object.getPrototypeOf(a.hasOwnProperty??ee)??ee)?.toString)&&(l=a+"",i.push({start:t.length+s.length,length:l.length,error:`Value of type ${Object.prototype.toString.call(a).slice(8,-1)} is not a valid path parameter`})),t+s+(o===r.length?"":l)},""),a=o.split(/[?#]/,1)[0],l=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;for(;null!==(s=l.exec(a));)i.push({start:s.index,length:s[0].length,error:`Value "${s[0]}" can't be safely passed as a path parameter`});if(i.sort((e,t)=>e.start-t.start),i.length>0){let e=0,t=i.reduce((t,r)=>{let s=" ".repeat(r.start-e),n="^".repeat(r.length);return e=r.start+r.length,t+s+n},"");throw new p(`Path parameters result in path with invalid segments:
|
|
2
|
-
${i.map(e=>e.error).join("\n")}
|
|
3
|
-
${o}
|
|
4
|
-
${t}`)}return o})(Q);class er extends X{retrieve(e,t){return this._client.get(et`/api/v3/internal/action_execution/log/${e}`,t)}list(e,t){return this._client.post("/api/v3/internal/action_execution/logs",{body:e,...t})}}class es extends X{retrieve(e,t){return this._client.get(et`/api/v3/internal/trigger/log/${e}`,t)}list(e={},t){return this._client.post("/api/v3/internal/trigger/logs",{body:e,...t})}}class en extends X{constructor(){super(...arguments),this.triggers=new es(this._client),this.tools=new er(this._client)}}en.Triggers=es,en.Tools=er;class ei extends X{create(e,t){return this._client.post("/api/v3/mcp/servers/custom",{body:e,...t})}}class eo extends X{url(e,t){return this._client.post("/api/v3/mcp/servers/generate",{body:e,...t})}}class ea extends X{constructor(){super(...arguments),this.custom=new ei(this._client),this.generate=new eo(this._client)}create(e,t){return this._client.post("/api/v3/mcp/servers",{body:e,...t})}retrieve(e,t){return this._client.get(et`/api/v3/mcp/${e}`,t)}update(e,t={},r){return this._client.patch(et`/api/v3/mcp/${e}`,{body:t,...r})}list(e={},t){return this._client.get("/api/v3/mcp/servers",{query:e,...t})}delete(e,t){return this._client.delete(et`/api/v3/mcp/${e}`,t)}retrieveApp(e,t={},r){return this._client.get(et`/api/v3/mcp/app/${e}`,{query:t,...r})}}ea.Custom=ei,ea.Generate=eo;class el extends X{retrieve(e){return this._client.get("/api/v3/org/project/config",e)}update(e={},t){return this._client.patch("/api/v3/org/project/config",{body:e,...t})}}class ec extends X{constructor(){super(...arguments),this.config=new el(this._client)}}ec.Config=el;class eu extends X{list(e,t,r){let{session_id:s,...n}=t;return this._client.get(et`/api/v3/tool_router/session/${s}/mounts/${e}/items`,{query:n,...r})}delete(e,t,r){let{session_id:s,...n}=t;return this._client.post(et`/api/v3/tool_router/session/${s}/mounts/${e}/delete`,{body:n,...r})}createDownloadURL(e,t,r){let{session_id:s,...n}=t;return this._client.post(et`/api/v3/tool_router/session/${s}/mounts/${e}/download_url`,{body:n,...r})}createUploadURL(e,t,r){let{session_id:s,...n}=t;return this._client.post(et`/api/v3/tool_router/session/${s}/mounts/${e}/upload_url`,{body:n,...r})}}class ed extends X{constructor(){super(...arguments),this.files=new eu(this._client)}create(e,t){return this._client.post("/api/v3/tool_router/session",{body:e,...t})}retrieve(e,t){return this._client.get(et`/api/v3/tool_router/session/${e}`,t)}execute(e,t,r){return this._client.post(et`/api/v3/tool_router/session/${e}/execute`,{body:t,...r})}executeMeta(e,t,r){return this._client.post(et`/api/v3/tool_router/session/${e}/execute_meta`,{body:t,...r})}link(e,t,r){return this._client.post(et`/api/v3/tool_router/session/${e}/link`,{body:t,...r})}proxyExecute(e,t,r){return this._client.post(et`/api/v3/tool_router/session/${e}/proxy_execute`,{body:t,...r})}search(e,t,r){return this._client.post(et`/api/v3/tool_router/session/${e}/search`,{body:t,...r})}toolkits(e,t={},r){return this._client.get(et`/api/v3/tool_router/session/${e}/toolkits`,{query:t,...r})}tools(e,t,r){return this._client.get(et`/api/v3/tool_router/session/${e}/tools`,r)}}ed.Files=eu;class eh extends X{constructor(){super(...arguments),this.session=new ed(this._client)}createSession(e,t){return this._client.post("/api/v3/labs/tool_router/session",{body:e,...t})}}eh.Session=ed;class ep extends X{update(e,t,r){return this._client.patch(et`/api/v3/trigger_instances/manage/${e}`,{body:t,...r})}delete(e,t){return this._client.delete(et`/api/v3/trigger_instances/manage/${e}`,t)}}class ef extends X{constructor(){super(...arguments),this.manage=new ep(this._client)}listActive(e={},t){return this._client.get("/api/v3/trigger_instances/active",{query:e,...t})}upsert(e,t={},r){return this._client.post(et`/api/v3/trigger_instances/${e}/upsert`,{body:t,...r})}}ef.Manage=ep;class em extends X{create(e,t){return this._client.post("/api/v3/auth_configs",{body:e,...t})}retrieve(e,t){return this._client.get(et`/api/v3/auth_configs/${e}`,t)}update(e,t,r){return this._client.patch(et`/api/v3/auth_configs/${e}`,{body:t,...r})}list(e={},t){return this._client.get("/api/v3/auth_configs",{query:e,...t})}delete(e,t){return this._client.delete(et`/api/v3/auth_configs/${e}`,t)}updateStatus(e,t,r){let{nanoid:s}=t;return this._client.patch(et`/api/v3/auth_configs/${s}/${e}`,r)}}class eg extends X{create(e,t){return this._client.post("/api/v3/connected_accounts",{body:e,...t})}retrieve(e,t){return this._client.get(et`/api/v3/connected_accounts/${e}`,t)}list(e={},t){return this._client.get("/api/v3/connected_accounts",{query:e,...t})}delete(e,t){return this._client.delete(et`/api/v3/connected_accounts/${e}`,t)}patch(e,t={},r){return this._client.patch(et`/api/v3/connected_accounts/${e}`,{body:t,...r})}refresh(e,t={},r){let{query_redirect_url:s,...n}=t??{};return this._client.post(et`/api/v3/connected_accounts/${e}/refresh`,{query:{redirect_url:s},body:n,...r})}updateStatus(e,t,r){return this._client.patch(et`/api/v3/connected_accounts/${e}/status`,{body:t,...r})}}class ey extends X{create(e,t){return this._client.post("/api/v3/connected_accounts/link",{body:e,...t})}}class eb extends X{retrieve(e,t={},r){return this._client.get(et`/api/v3/toolkits/${e}`,{query:t,...r})}list(e={},t){return this._client.get("/api/v3/toolkits",{query:e,...t})}retrieveCategories(e){return this._client.get("/api/v3/toolkits/categories",e)}}let e_=Symbol("brand.privateNullableHeaders"),ew=e=>{let t=new Headers,r=new Set;for(let s of e){let e=new Set;for(let[n,i]of function*(e){let t;if(!e)return;if(e_ in e){let{values:t,nulls:r}=e;for(let e of(yield*t.entries(),r))yield[e,null];return}let r=!1;for(let s of(e instanceof Headers?t=e.entries():A(e)?t=e:(r=!0,t=Object.entries(e??{})),t)){let e=s[0];if("string"!=typeof e)throw TypeError("expected header name to be a string");let t=A(s[1])?s[1]:[s[1]],n=!1;for(let s of t)void 0!==s&&(r&&!n&&(n=!0,yield[e,null]),yield[e,s])}}(s)){let s=n.toLowerCase();e.has(s)||(t.delete(n),e.add(s)),null===i?(t.delete(n),r.add(s)):(t.append(n,i),r.delete(s))}}return{[e_]:!0,values:t,nulls:r}};class ev extends X{retrieve(e,t={},r){return this._client.get(et`/api/v3/tools/${e}`,{query:t,...r})}list(e={},t){return this._client.get("/api/v3/tools",{query:e,...t})}execute(e,t={},r){let{"x-llm-gateway-headers":s,...n}=t??{};return this._client.post(et`/api/v3/tools/execute/${e}`,{body:n,...r,headers:ew([{...null!=s?{"x-llm-gateway-headers":s}:void 0},r?.headers])})}getInput(e,t,r){return this._client.post(et`/api/v3/tools/execute/${e}/input`,{body:t,...r})}proxy(e,t){return this._client.post("/api/v3/tools/execute/proxy",{body:e,...t})}retrieveEnum(e){return this._client.get("/api/v3/tools/enum",e)}}class eI extends X{retrieve(e,t={},r){return this._client.get(et`/api/v3/triggers_types/${e}`,{query:t,...r})}list(e={},t){return this._client.get("/api/v3/triggers_types",{query:e,...t})}retrieveEnum(e){return this._client.get("/api/v3/triggers_types/list/enum",e)}}class ek extends X{list(e={},t){return this._client.get("/api/v3/files/list",{query:e,...t})}createPresignedURL(e,t){return this._client.post("/api/v3/files/upload/request",{body:e,...t})}}class ex extends X{retrieveNanoid(e,t){return this._client.get("/api/v3/migration/get-nanoid",{query:e,...t})}}let eT={off:0,error:200,warn:300,info:400,debug:500},eE=(e,t,r)=>{if(e){if(Object.prototype.hasOwnProperty.call(eT,e))return e;eO(r).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(eT))}`)}};function ez(){}function eA(e,t,r){return!t||eT[e]>eT[r]?ez:t[e].bind(t)}let eS={error:ez,warn:ez,info:ez,debug:ez},eC=new WeakMap;function eO(e){let t=e.logger,r=e.logLevel??"off";if(!t)return eS;let s=eC.get(t);if(s&&s[0]===r)return s[1];let n={error:eA("error",t,r),warn:eA("warn",t,r),info:eA("info",t,r),debug:eA("debug",t,r)};return eC.set(t,[r,n]),n}let eP=e=>(e.options&&(e.options={...e.options},delete e.options.headers),e.headers&&(e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([e,t])=>[e,"x-api-key"===e.toLowerCase()||"authorization"===e.toLowerCase()||"cookie"===e.toLowerCase()||"set-cookie"===e.toLowerCase()?"***":t]))),"retryOfRequestLogID"in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e);async function eR(e,t){let{response:r,requestLogID:s,retryOfRequestLogID:n,startTime:i}=t,o=await (async()=>{if(204===r.status)return null;if(t.options.__binaryResponse)return r;let e=r.headers.get("content-type"),s=e?.split(";")[0]?.trim();if(s?.includes("application/json")||s?.endsWith("+json")){if("0"===r.headers.get("content-length"))return;return await r.json()}return await r.text()})();return eO(e).debug(`[${s}] response parsed`,eP({retryOfRequestLogID:n,url:r.url,status:r.status,body:o,durationMs:Date.now()-i})),o}class e$ extends Promise{constructor(e,t,r=eR){super(e=>{e(null)}),this.responsePromise=t,this.parseResponse=r,s.set(this,void 0),c(this,s,e,"f")}_thenUnwrap(e){return new e$(u(this,s,"f"),this.responsePromise,async(t,r)=>e(await this.parseResponse(t,r),r))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,t]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:t}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(u(this,s,"f"),e))),this.parsedPromise}then(e,t){return this.parse().then(e,t)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}}s=new WeakMap;let eN=e=>void 0!==globalThis.process?globalThis.process.env?.[e]?.trim()||void 0:void 0!==globalThis.Deno&&globalThis.Deno.env?.get?.(e)?.trim()||void 0,ej={production:"https://backend.composio.dev",staging:"https://staging-backend.composio.dev",local:"http://localhost:9900"};class eL{constructor({baseURL:e=eN("COMPOSIO_BASE_URL"),apiKey:t=eN("COMPOSIO_API_KEY")??null,...r}={}){n.add(this),o.set(this,void 0),this.authConfigs=new em(this),this.connectedAccounts=new eg(this),this.link=new ey(this),this.toolkits=new eb(this),this.tools=new ev(this),this.triggerInstances=new ef(this),this.triggersTypes=new eI(this),this.mcp=new ea(this),this.files=new ek(this),this.migration=new ex(this),this.cli=new Y(this),this.project=new ec(this),this.logs=new en(this),this.toolRouter=new eh(this);const s={apiKey:t,...r,baseURL:e,environment:r.environment??"production"};if(e&&r.environment)throw new p("Ambiguous URL; The `baseURL` option (or COMPOSIO_BASE_URL env var) and the `environment` option are given. If you want to use the environment you must pass baseURL: null");this.baseURL=s.baseURL||ej[s.environment||"production"],this.timeout=s.timeout??i.DEFAULT_TIMEOUT,this.logger=s.logger??console;const a="warn";this.logLevel=a,this.logLevel=eE(s.logLevel,"ClientOptions.logLevel",this)??eE(eN("COMPOSIO_LOG"),"process.env['COMPOSIO_LOG']",this)??a,this.fetchOptions=s.fetchOptions,this.maxRetries=s.maxRetries??2,this.fetch=s.fetch??function(){if("u">typeof fetch)return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Composio({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}(),c(this,o,$,"f"),this._options=s,this.apiKey=t}withOptions(e){return new this.constructor({...this._options,environment:e.environment?e.environment:void 0,baseURL:e.environment?void 0:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,...e})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:t}){}async authHeaders(e){if(null!=this.apiKey)return ew([{"x-api-key":this.apiKey}])}stringifyQuery(e){return function(e,t={}){let r,s=e,n=function(e=B){let t;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.encodeDotInKeys&&"boolean"!=typeof e.encodeDotInKeys)throw TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw TypeError("Encoder has to be a function.");let r=e.charset||B.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let s=N;if(void 0!==e.format){if(!D(L,e.format))throw TypeError("Unknown format option provided.");s=e.format}let n=L[s],i=B.filter;if(("function"==typeof e.filter||z(e.filter))&&(i=e.filter),t=e.arrayFormat&&e.arrayFormat in M?e.arrayFormat:"indices"in e?e.indices?"indices":"repeat":B.arrayFormat,"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw TypeError("`commaRoundTrip` must be a boolean, or absent");let o=void 0===e.allowDots?!0==!!e.encodeDotInKeys||B.allowDots:!!e.allowDots;return{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:B.addQueryPrefix,allowDots:o,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:B.allowEmptyArrays,arrayFormat:t,charset:r,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:B.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:void 0===e.delimiter?B.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:B.encode,encodeDotInKeys:"boolean"==typeof e.encodeDotInKeys?e.encodeDotInKeys:B.encodeDotInKeys,encoder:"function"==typeof e.encoder?e.encoder:B.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:B.encodeValuesOnly,filter:i,format:s,formatter:n,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:B.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:B.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:B.strictNullHandling}}(t);"function"==typeof n.filter?s=(0,n.filter)("",s):z(n.filter)&&(r=n.filter);let i=[];if("object"!=typeof s||null===s)return"";let o=M[n.arrayFormat],a="comma"===o&&n.commaRoundTrip;r||(r=Object.keys(s)),n.sort&&r.sort(n.sort);let l=new WeakMap;for(let e=0;e<r.length;++e){let t=r[e];n.skipNulls&&null===s[t]||Z(i,function e(t,r,s,n,i,o,a,l,c,u,d,h,p,f,m,g,y,b){var _,w;let v,I=t,k=b,x=0,T=!1;for(;void 0!==(k=k.get(V))&&!T;){let e=k.get(t);if(x+=1,void 0!==e)if(e===x)throw RangeError("Cyclic object value");else T=!0;void 0===k.get(V)&&(x=0)}if("function"==typeof u?I=u(r,I):I instanceof Date?I=p?.(I):"comma"===s&&z(I)&&(I=F(I,function(e){return e instanceof Date?p?.(e):e})),null===I){if(o)return c&&!g?c(r,B.encoder,y,"key",f):r;I=""}if("string"==typeof(_=I)||"number"==typeof _||"boolean"==typeof _||"symbol"==typeof _||"bigint"==typeof _||(w=I)&&"object"==typeof w&&w.constructor&&w.constructor.isBuffer&&w.constructor.isBuffer(w)){if(c){let e=g?r:c(r,B.encoder,y,"key",f);return[m?.(e)+"="+m?.(c(I,B.encoder,y,"value",f))]}return[m?.(r)+"="+m?.(String(I))]}let E=[];if(void 0===I)return E;if("comma"===s&&z(I))g&&c&&(I=F(I,c)),v=[{value:I.length>0?I.join(",")||null:void 0}];else if(z(u))v=u;else{let e=Object.keys(I);v=d?e.sort(d):e}let A=l?String(r).replace(/\./g,"%2E"):String(r),S=n&&z(I)&&1===I.length?A+"[]":A;if(i&&z(I)&&0===I.length)return S+"[]";for(let r=0;r<v.length;++r){let _=v[r],w="object"==typeof _&&void 0!==_.value?_.value:I[_];if(a&&null===w)continue;let k=h&&l?_.replace(/\./g,"%2E"):_,T=z(I)?"function"==typeof s?s(S,k):S:S+(h?"."+k:"["+k+"]");b.set(t,x);let A=new WeakMap;A.set(V,b),Z(E,e(w,T,s,n,i,o,a,l,"comma"===s&&g&&z(I)?null:c,u,d,h,p,f,m,g,y,A))}return E}(s[t],t,o,a,n.allowEmptyArrays,n.strictNullHandling,n.skipNulls,n.encodeDotInKeys,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,l))}let c=i.join(n.delimiter),u=!0===n.addQueryPrefix?"?":"";return n.charsetSentinel&&("iso-8859-1"===n.charset?u+="utf8=%26%2310003%3B&":u+="utf8=%E2%9C%93&"),c.length>0?u+c:""}(e,{arrayFormat:"comma"})}getUserAgent(){return`${this.constructor.name}/JS ${C}`}defaultIdempotencyKey(){return`stainless-node-retry-${d()}`}makeStatusError(e,t,r,s){return f.generate(e,t,r,s)}buildURL(e,t,r){let s=!u(this,n,"m",a).call(this)&&r||this.baseURL,i=new URL(E.test(e)?e:s+(s.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),o=this.defaultQuery(),l=Object.fromEntries(i.searchParams);return S(o)&&S(l)||(t={...l,...o,...t}),"object"==typeof t&&t&&!Array.isArray(t)&&(i.search=this.stringifyQuery(t)),i.toString()}async prepareOptions(e){}async prepareRequest(e,{url:t,options:r}){}get(e,t){return this.methodRequest("get",e,t)}post(e,t){return this.methodRequest("post",e,t)}patch(e,t){return this.methodRequest("patch",e,t)}put(e,t){return this.methodRequest("put",e,t)}delete(e,t){return this.methodRequest("delete",e,t)}methodRequest(e,t,r){return this.request(Promise.resolve(r).then(r=>({method:e,path:t,...r})))}request(e,t=null){return new e$(this,this.makeRequest(e,t,void 0))}async makeRequest(e,t,r){let s=await e,n=s.maxRetries??this.maxRetries;null==t&&(t=n),await this.prepareOptions(s);let{req:i,url:o,timeout:a}=await this.buildRequest(s,{retryCount:n-t});await this.prepareRequest(i,{url:o,options:s});let l="log_"+(0x1000000*Math.random()|0).toString(16).padStart(6,"0"),c=void 0===r?"":`, retryOf: ${r}`,u=Date.now();if(eO(this).debug(`[${l}] sending request`,eP({retryOfRequestLogID:r,method:s.method,url:o,options:s,headers:i.headers})),s.signal?.aborted)throw new m;let d=new AbortController,p=await this.fetchWithTimeout(o,i,a,d).catch(h),f=Date.now();if(p instanceof globalThis.Error){let e=`retrying, ${t} attempts remaining`;if(s.signal?.aborted)throw new m;let n="object"==typeof p&&null!==p&&("name"in p&&"AbortError"===p.name||"message"in p&&String(p.message).includes("FetchRequestCanceledException"))||/timed? ?out/i.test(String(p)+("cause"in p?String(p.cause):""));if(t)return eO(this).info(`[${l}] connection ${n?"timed out":"failed"} - ${e}`),eO(this).debug(`[${l}] connection ${n?"timed out":"failed"} (${e})`,eP({retryOfRequestLogID:r,url:o,durationMs:f-u,message:p.message})),this.retryRequest(s,t,r??l);if(eO(this).info(`[${l}] connection ${n?"timed out":"failed"} - error; no more retries left`),eO(this).debug(`[${l}] connection ${n?"timed out":"failed"} (error; no more retries left)`,eP({retryOfRequestLogID:r,url:o,durationMs:f-u,message:p.message})),n)throw new y;throw new g({cause:p})}let b=`[${l}${c}] ${i.method} ${o} ${p.ok?"succeeded":"failed"} with status ${p.status} in ${f-u}ms`;if(!p.ok){let e=await this.shouldRetry(p);if(t&&e){let e=`retrying, ${t} attempts remaining`;return await R(p.body),eO(this).info(`${b} - ${e}`),eO(this).debug(`[${l}] response error (${e})`,eP({retryOfRequestLogID:r,url:p.url,status:p.status,headers:p.headers,durationMs:f-u})),this.retryRequest(s,t,r??l,p.headers)}let n=e?"error; no more retries left":"error; not retryable";eO(this).info(`${b} - ${n}`);let i=await p.text().catch(e=>h(e).message),o=(e=>{try{return JSON.parse(e)}catch(e){return}})(i),a=o?void 0:i;throw eO(this).debug(`[${l}] response error (${n})`,eP({retryOfRequestLogID:r,url:p.url,status:p.status,headers:p.headers,message:a,durationMs:Date.now()-u})),this.makeStatusError(p.status,o,a,p.headers)}return eO(this).info(b),eO(this).debug(`[${l}] response start`,eP({retryOfRequestLogID:r,url:p.url,status:p.status,headers:p.headers,durationMs:f-u})),{response:p,options:s,controller:d,requestLogID:l,retryOfRequestLogID:r,startTime:u}}async fetchWithTimeout(e,t,r,s){let{signal:n,method:i,...o}=t||{},a=this._makeAbort(s);n&&n.addEventListener("abort",a,{once:!0});let l=setTimeout(a,r),c=globalThis.ReadableStream&&o.body instanceof globalThis.ReadableStream||"object"==typeof o.body&&null!==o.body&&Symbol.asyncIterator in o.body,u={signal:s.signal,...c?{duplex:"half"}:{},method:"GET",...o};i&&(u.method=i.toUpperCase());try{return await this.fetch.call(void 0,e,u)}finally{clearTimeout(l)}}async shouldRetry(e){let t=e.headers.get("x-should-retry");return"true"===t||"false"!==t&&(408===e.status||409===e.status||429===e.status||!!(e.status>=500))}async retryRequest(e,t,r,s){let n,i,o=s?.get("retry-after-ms");if(o){let e=parseFloat(o);Number.isNaN(e)||(n=e)}let a=s?.get("retry-after");if(a&&!n){let e=parseFloat(a);n=Number.isNaN(e)?Date.parse(a)-Date.now():1e3*e}if(void 0===n){let r=e.maxRetries??this.maxRetries;n=this.calculateDefaultRetryTimeoutMillis(t,r)}return await (i=n,new Promise(e=>setTimeout(e,i))),this.makeRequest(e,t-1,r)}calculateDefaultRetryTimeoutMillis(e,t){return Math.min(.5*Math.pow(2,t-e),8)*(1-.25*Math.random())*1e3}async buildRequest(e,{retryCount:t=0}={}){let r={...e},{method:s,path:n,query:i,defaultBaseURL:o}=r,a=this.buildURL(n,i,o);"timeout"in r&&((e,t)=>{if("number"!=typeof t||!Number.isInteger(t))throw new p(`${e} must be an integer`);if(t<0)throw new p(`${e} must be a positive integer`)})("timeout",r.timeout),r.timeout=r.timeout??this.timeout;let{bodyHeaders:l,body:c}=this.buildBody({options:r}),u=await this.buildHeaders({options:e,method:s,bodyHeaders:l,retryCount:t});return{req:{method:s,headers:u,...r.signal&&{signal:r.signal},...globalThis.ReadableStream&&c instanceof globalThis.ReadableStream&&{duplex:"half"},...c&&{body:c},...this.fetchOptions??{},...r.fetchOptions??{}},url:a,timeout:r.timeout}}async buildHeaders({options:e,method:r,bodyHeaders:s,retryCount:n}){let i={};this.idempotencyHeader&&"get"!==r&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),i[this.idempotencyHeader]=e.idempotencyKey);let o=ew([i,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(n),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...t??(t=(()=>{let e="u">typeof Deno&&null!=Deno.build?"deno":"u">typeof EdgeRuntime?"edge":"[object process]"===Object.prototype.toString.call(void 0!==globalThis.process?globalThis.process:0)?"node":"unknown";if("deno"===e)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":C,"X-Stainless-OS":P(Deno.build.os),"X-Stainless-Arch":O(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":"string"==typeof Deno.version?Deno.version:Deno.version?.deno??"unknown"};if("u">typeof EdgeRuntime)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":C,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if("node"===e)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":C,"X-Stainless-OS":P(globalThis.process.platform??"unknown"),"X-Stainless-Arch":O(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let t=function(){if("u"<typeof navigator||!navigator)return null;for(let{key:e,pattern:t}of[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}]){let r=t.exec(navigator.userAgent);if(r){let t=r[1]||0,s=r[2]||0,n=r[3]||0;return{browser:e,version:`${t}.${s}.${n}`}}}return null}();return t?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":C,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":C,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}})())},await this.authHeaders(e),this._options.defaultHeaders,s,e.headers]);return this.validateHeaders(o),o.values}_makeAbort(e){return()=>e.abort()}buildBody({options:{body:e,headers:t}}){if(!e)return{bodyHeaders:void 0,body:void 0};let r=ew([t]);if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||"string"==typeof e&&r.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream)return{bodyHeaders:void 0,body:e};if("object"==typeof e&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&"function"==typeof e.next)){var s;let t;return{bodyHeaders:void 0,body:(t=Symbol.asyncIterator in(s=e)?s[Symbol.asyncIterator]():s[Symbol.iterator](),function(...e){let t=globalThis.ReadableStream;if(void 0===t)throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}({start(){},async pull(e){let{done:r,value:s}=await t.next();r?e.close():e.enqueue(s)},async cancel(){await t.return?.()}}))}}return"object"==typeof e&&"application/x-www-form-urlencoded"===r.values.get("content-type")?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(e)}:u(this,o,"f").call(this,{body:e,headers:r})}}i=eL,o=new WeakMap,n=new WeakSet,a=function(){return this.baseURL!==ej[this._options.environment||"production"]},eL.Composio=i,eL.DEFAULT_TIMEOUT=6e4,eL.ComposioError=p,eL.APIError=f,eL.APIConnectionError=g,eL.APIConnectionTimeoutError=y,eL.APIUserAbortError=m,eL.NotFoundError=v,eL.ConflictError=I,eL.RateLimitError=x,eL.BadRequestError=b,eL.AuthenticationError=_,eL.InternalServerError=T,eL.PermissionDeniedError=w,eL.UnprocessableEntityError=k,eL.toFile=H,eL.AuthConfigs=em,eL.ConnectedAccounts=eg,eL.Link=ey,eL.Toolkits=eb,eL.Tools=ev,eL.TriggerInstances=ef,eL.TriggersTypes=eI,eL.Mcp=ea,eL.Files=ek,eL.Migration=ex,eL.Cli=Y,eL.Project=ec,eL.Logs=en,eL.ToolRouter=eh,e.s(["Composio",0,eL],911433),e.s([],988169)},13336,129487,e=>{"use strict";let t,r,s,n;e.i(740507);var i,o,a,l,c,u,d,h,p,f,m,g,y,b,_,w,v,I,k,x,T,E,z,A,S,C,O,P,R,$,N,j,L,D,U,F,M,Z,B,V,W,K,q,H,G,X,J,Y,Q,ee,et,er,es,en,ei,eo,ea,el,ec,eu,ed,eh,ep,ef,em,eg,ey,eb,e_,ew,ev,eI,ek,ex,eT,eE,ez=e.i(859290),eA=ez;e.i(988169);var eS=e.i(488318),eC=e.i(115235),eO=e.i(322632);let eP=e.i(901480).zodToJsonSchema;var eR=class extends eA.s{constructor(e="Connected account not found",t={}){super(e,{...t,code:"CONNECTED_ACCOUNT_NOT_FOUND",statusCode:404,possibleFixes:t.possibleFixes||["Ensure the connected account exists and is active in your Composio dashboard"]}),this.name="ComposioConnectedAccountNotFoundError"}},e$=class extends eA.s{constructor(e="Multiple connected accounts found",t={}){super(e,{...t,code:"MULTIPLE_CONNECTED_ACCOUNTS",possibleFixes:t.possibleFixes||["Use the allowMultiple flag to allow multiple connected accounts per user for an auth config"]}),this.name="ComposioMultipleConnectedAccountsError"}},eN=class extends eA.s{constructor(e="Failed to create connected account link",t={}){super(e,{...t,code:"FAILED_TO_CREATE_CONNECTED_ACCOUNT_LINK"}),this.name="ComposioFailedToCreateConnectedAccountLink"}},ej=class extends eA.s{constructor(e="Provider not defined",t={}){super(e,{...t,code:"TOOLSET_NOT_DEFINED",possibleFixes:t.possibleFixes||["Ensure that the provider is defined in the Composio project and passed into the tool instance"]}),this.name="ComposioProviderNotDefinedError"}},eL=class extends eA.s{constructor(e="Tool not found",t={}){super(e,{...t,code:"TOOL_NOT_FOUND",possibleFixes:t.possibleFixes||["Ensure the tool slug is correct and exists in the Composio project"]}),this.name="ComposioToolNotFoundError"}},eD=class extends eA.s{constructor(e="Invalid modifier",t={}){super(e,{...t,code:"INVALID_MODIFIER",possibleFixes:t.possibleFixes||["Ensure the modifier is a function and returns a valid result"]}),this.name="ComposioInvalidModifierError"}},eU=class extends eA.s{constructor(e="Custom tools not initialized",t={}){super(e,{...t,code:"CUSTOM_TOOLS_NOT_INITIALIZED",possibleFixes:t.possibleFixes||["Ensure the custom tools class is initialized in the Tools instance"]}),this.name="ComposioCustomToolsNotInitializedError"}},eF=class extends eA.s{constructor(e="Tool execution error",t={}){super(e,{...t,code:t.code||"TOOL_EXECUTION_ERROR",cause:t.cause,possibleFixes:t.possibleFixes||["Ensure the tool is correctly configured and the input is valid","Ensure the userId is correct and has an active connected account for the user in case of non NoAuth toolkits"]}),this.name="ComposioToolExecutionError"}},eM=class extends eA.s{constructor(e="Invalid execute function",t={}){super(e,{...t,code:"INVALID_EXECUTE_FUNCTION",possibleFixes:t.possibleFixes||["Ensure the execute function is a valid function and returns a valid result"]}),this.name="ComposioInvalidExecuteFunctionError"}},eZ=class extends eA.s{constructor(e="Global execute tool function not set",t={}){super(e,{...t,code:"GLOBAL_EXECUTE_TOOL_FN_NOT_SET",possibleFixes:t.possibleFixes||["Ensure the global execute tool function is set in the provider"]}),this.name="ComposioGlobalExecuteToolFnNotSetError"}},eB=class extends eA.s{constructor(e="Toolkit version not specified. For manual execution of the tool please pass a specific toolkit version",t={}){super(e,{...t,code:"TOOL_VERSION_REQUIRED",possibleFixes:t.possibleFixes||['Pass the toolkit version as a parameter to the execute function ("latest" is not supported in manual execution)','Set the toolkit versions in the Composio config (toolkitVersions: { <toolkit-slug>: "<toolkit-version>" })',"Set the toolkit version in the environment variable (COMPOSIO_TOOLKIT_VERSION_<TOOLKIT_SLUG>)","Set dangerouslySkipVersionCheck to true (this might cause unexpected behavior when new versions of the tools are released)"]})}};let eV=new Map([[1803,e=>new eR(e)]]);var eW=class extends eA.s{constructor(e="Auth config not found",t={}){super(e,{...t,code:"AUTH_CONFIG_NOT_FOUND",possibleFixes:t.possibleFixes||["Check if the auth config exists","Check if the auth config id is correct","Check if the auth config is enabled"]}),this.name="ComposioAuthConfigNotFoundError"}},eK=class extends eA.s{constructor(e="Connection request timed out",t={}){super(e,{...t,code:"CONNECTION_REQUEST_TIMEOUT"}),this.name="ConnectionRequestTimeoutError"}},eq=class extends eA.s{constructor(e="Connection request failed",t={}){super(e,{...t,code:"CONNECTION_REQUEST_FAILED"}),this.name="ConnectionRequestFailedError"}},eH=class extends eA.s{constructor(e="Toolkit not found",t={}){super(e,{...t,code:"TOOLKIT_NOT_FOUND",possibleFixes:t.possibleFixes||["Ensure the toolkit is correctly configured and the slug is valid"]}),this.name="ComposioToolkitNotFoundError"}},eG=class extends eA.s{constructor(e="Failed to fetch toolkit",t={}){super(e,{...t,code:"TOOLKIT_FETCH_ERROR",possibleFixes:t.possibleFixes||["Ensure the toolkit slug is valid","Ensure you are using the correct API key","Ensure you are using the correct API endpoint / Base URL and it is working"]}),this.name="ComposioToolkitFetchError"}},eX=class extends eA.s{constructor(e="Input validation failed",t={}){let r;const{cause:s,...n}=t,i=(r=s instanceof eC.ZodError?s:new eC.ZodError([{path:[],message:"Invalid input",code:"custom"}])).issues.map(e=>`[${e.code}] ${e.path.join(".")} - ${e.message}`);super(e,{...n,code:t.code||"VALIDATION_ERROR",possibleFixes:i,cause:r}),this.name="ValidationError",this.message=`${e}: ${this.generateUserFriendlyMessage()}`}generateUserFriendlyMessage(){if(this.cause instanceof eC.ZodError&&this.cause.issues.length>0){let e=this.cause.issues[0],t=e.path.join(".")||"parameter";return"invalid_type"===e.code?`The ${t} should be a ${e.expected}, but you provided a ${e.received}`:e.message}return"Please check your input parameters"}},eJ=class extends eA.s{constructor(e="Failed to convert JSON schema to Zod schema",t={}){super(e,{...t,code:t.code||"JSON_SCHEMA_TO_ZOD_ERROR"})}},eY=class extends eA.s{constructor(e="No Composio API key provided",t={}){super(e,{...t,code:"NO_API_KEY_PROVIDED",cause:t.cause||"Couldn't find an API key in the params, environment variables or in the user config file",possibleFixes:t.possibleFixes||["Ensure you have an API key passed in the params, or in environment variable (COMPOSIO_API_KEY) or in the user config file","To get an API key, please sign up at https://composio.dev/signup","You can also use the Composio CLI to create a project and get an API key"],statusCode:401}),this.name="ComposioNoAPIKeyError"}},eQ=class extends eA.s{constructor(e="Failed to get SDK realtime credentials",t={}){super(e,{...t,code:"TRIGGER_FAILED_TO_GET_SDK_REALTIME_CREDENTIALS",possibleFixes:t.possibleFixes||["Please contact support."]}),this.name="ComposioFailedToGetSDKRealtimeCredentialsError"}},e0=class extends eA.s{constructor(e="Failed to create Pusher client",t={}){super(e,{...t,code:"TRIGGER_FAILED_TO_CREATE_PUSHER_CLIENT",possibleFixes:t.possibleFixes||["Please contact support."]}),this.name="ComposioFailedToCreatePusherClientError"}},e1=class extends eA.s{constructor(e="Failed to subscribe to Pusher channel",t={}){super(e,{...t,code:"TRIGGER_FAILED_TO_SUBSCRIBE_TO_PUSHER_CHANNEL",possibleFixes:t.possibleFixes||["Please contact support."]}),this.name="ComposioFailedToSubscribeToPusherChannelError"}};eA.s;var e2=class extends eA.s{constructor(e="Trigger type not found",t={}){super(e,{...t,code:"TRIGGER_TYPE_NOT_FOUND",statusCode:404,possibleFixes:t.possibleFixes||["Please contact support."]}),this.name="ComposioTriggerTypeNotFoundError"}},e5=class extends eA.s{constructor(e="Webhook signature verification failed",t={}){super(e,{...t,code:"WEBHOOK_SIGNATURE_VERIFICATION_FAILED",statusCode:401,possibleFixes:t.possibleFixes||["Verify that the webhook secret is correct.","Ensure the raw request body is passed without modifications.","Check that the signature header value is being passed correctly."]}),this.name="ComposioWebhookSignatureVerificationError"}},e3=class extends eA.s{constructor(e="Invalid webhook payload",t={}){super(e,{...t,code:"WEBHOOK_PAYLOAD_INVALID",statusCode:400,possibleFixes:t.possibleFixes||["Ensure the webhook payload is valid JSON.","Verify the payload structure matches the expected format."]}),this.name="ComposioWebhookPayloadError"}},e4=class extends eA.s{constructor(e="Failed to download remote file",t={}){const{statusCode:r,statusText:s,downloadUrl:n,mountRelativePath:i,filename:o,meta:a,...l}=t,c={...a,...void 0!==r&&{statusCode:r},...s&&{statusText:s},...n&&{downloadUrl:n},...i&&{mountRelativePath:i},...o&&{filename:o}};super(e,{...l,code:"REMOTE_FILE_DOWNLOAD_FAILED",statusCode:r,meta:Object.keys(c).length>0?c:void 0,possibleFixes:t.possibleFixes??["Verify the download URL has not expired (check expiresAt)","Ensure the file exists at the specified mount path","Retry the operation; presigned URLs may have transient failures"]}),this.name="RemoteFileDownloadError"}};function e6(){return globalThis.crypto.randomUUID()}function e9(){return e6().slice(0,8).replace(/-/g,"")}eO.z.string().min(1,"slug is required").regex(/^[A-Za-z0-9_-]+$/,"slug must only contain alphanumeric characters, underscores, and hyphens").refine(e=>!e.toUpperCase().startsWith("LOCAL_"),{message:'slug must not start with "LOCAL_" — this prefix is reserved for internal routing.'}).refine(e=>!e.toUpperCase().startsWith("COMPOSIO_"),{message:'slug must not start with "COMPOSIO_" — this prefix is reserved for Composio meta tools.'}),eO.z.object({name:eO.z.string().min(1,"createCustomTool: name is required"),description:eO.z.string().min(1,"createCustomTool: description is required"),extendsToolkit:eO.z.string().optional()}),eO.z.object({name:eO.z.string().min(1,"createCustomToolkit: name is required"),description:eO.z.string().min(1,"createCustomToolkit: description is required")});let e8=e=>{let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)};var e7=class{batch=[];time;batchSize;processBatchCallback;timer=null;pendingBatches=new Set;constructor(e=2e3,t=100,r){this.batch=[],this.time=e,this.batchSize=t,this.processBatchCallback=r}pushItem(e){this.batch.push(e),this.batch.length>=this.batchSize?this.processBatch():this.timer||(this.timer=setTimeout(()=>this.processBatch(),this.time))}processBatch(){if(this.batch.length>0){let e=this.batch;this.batch=[];let t=this.processBatchCallback(e).catch(()=>{}).finally(()=>{this.pendingBatches.delete(t)});this.pendingBatches.add(t)}this.timer&&(clearTimeout(this.timer),this.timer=null)}async flush(){this.processBatch(),this.pendingBatches.size>0&&await Promise.all(this.pendingBatches)}};let te="https://telemetry.composio.dev/v1";var tt=class{static async sendMetric(e){try{return await fetch(`${te}/metrics/invocations`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch(e){ez.c.debug("Error sending metric telemetry",e)}}static async sendErrorLog(e){try{return await fetch(`${te}/errors`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch(e){ez.c.debug("Error sending error telemetry",e)}}};let tr=new class{telemetryMetadata;isTelemetryDisabled=!0;telemetrySource;telemetrySourceName="typescript-sdk";telemetryServiceName="sdk";telemetryLanguage="typescript";exitHandlersRegistered=!1;batchProcessor=new e7(200,10,async e=>{ez.c.debug("Sending batch of telemetry metrics",e),await tt.sendMetric(e)});setup(e){this.telemetryMetadata=e,this.isTelemetryDisabled=!1,this.telemetrySource={host:this.telemetryMetadata?.host??this.telemetrySourceName,service:this.telemetryServiceName,language:this.telemetryLanguage,version:this.telemetryMetadata?.version,platform:this.telemetryMetadata?.isBrowser?"browser":"node",environment:(0,ez._)("NODE_ENV","production")},this.registerExitHandlers(),this.sendMetric([{functionName:"SDK_INITIALIZED",durationMs:0,timestamp:Date.now()/1e3,props:{},source:this.telemetrySource,metadata:{provider:this.telemetryMetadata?.provider??"openai"},error:void 0}])}instrument(e,t){let r=Object.getPrototypeOf(e),s=Object.getOwnPropertyNames(r).filter(e=>{let t=Object.getOwnPropertyDescriptor(r,e);return"constructor"!==e&&t&&"function"==typeof t.value&&"AsyncFunction"===t.value.constructor.name}),n=t??e.constructor?.name??"unknown";for(let t of s){let r=e[t];e[t]=async(...s)=>{let i=this.shouldSendTelemetry(),o=i?Date.now():void 0;try{let a=await r.apply(e,s);if(i&&void 0!==o){let e=Date.now()-o,r={functionName:`${n}.${t}`,durationMs:e,timestamp:o/1e3,props:{fileName:n,method:t},metadata:{provider:this.telemetryMetadata?.provider??"openai"},error:void 0,source:this.telemetrySource};this.batchProcessor.pushItem(r)}return a}catch(e){if(e instanceof Error&&!e.errorId&&(e.errorId=e6(),i&&void 0!==o)){let r=Date.now()-o;await this.prepareAndSendErrorTelemetry(e,n,t,o,r)}throw e}}}return e}shouldSendTelemetry(){let e=["test","ci"].includes(((0,ez._)("NODE_ENV","development")||"").toLowerCase()),t="true"===(0,ez._)("TELEMETRY_DISABLED","false");return!this.isTelemetryDisabled&&!t&&!e}async prepareAndSendErrorTelemetry(e,t,r,s,n){let i={functionName:`${t}.${r}`,durationMs:n,timestamp:s/1e3,props:{fileName:t,method:r},metadata:{provider:this.telemetryMetadata?.provider??"openai"},source:this.telemetrySource};e instanceof eS.ComposioError?i.error={errorId:e.errorId,name:e.name,message:e.message,stack:e.stack}:e instanceof ez.s?i.error={errorId:e.errorId,name:e.name,code:e.code,message:e.message,stack:e.stack}:e instanceof Error&&(i.error={errorId:e.errorId,name:e.name??"Unknown error",message:e.message,stack:e.stack}),await this.sendErrorTelemetry(i)}async sendMetric(e){if(!this.shouldSendTelemetry())return void ez.c.debug("Telemetry is disabled, skipping metric telemetry",e);try{ez.c.debug("SDK Metric",e),await tt.sendMetric(e)}catch(e){ez.c.error("Error sending metric telemetry",e)}}async sendErrorTelemetry(e){if(!this.shouldSendTelemetry())return void ez.c.debug("Telemetry is disabled, skipping metric telemetry",e);try{ez.c.debug("SDK Error Telemetry",e),await tt.sendErrorLog(e)}catch(e){ez.c.error("Error sending error telemetry",e)}}async flush(){await this.batchProcessor.flush()}registerExitHandlers(){if(this.exitHandlersRegistered||"u"<typeof process||!process.on)return;this.exitHandlersRegistered=!0;let e=()=>{this.flush().catch(e=>{ez.c.debug("Error flushing telemetry on exit",e)})};process.on("beforeExit",()=>{e()});let t=e=>{let t=()=>{ez.c.debug(`Received ${e}, flushing telemetry...`),this.flush().catch(e=>{ez.c.debug("Error flushing telemetry on signal",e)}).finally(()=>{process.removeListener(e,t),process.kill(process.pid,e)})};return t};process.on("SIGINT",t("SIGINT")),process.on("SIGTERM",t("SIGTERM"))}};function ts(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let tn=e=>{if(e.file_uploadable)return{title:e.title,description:e.description,format:"path",type:"string",file_uploadable:!0};let t={...e};return"object"===e.type&&e.properties&&(t.properties=ti(e.properties)),e.anyOf&&(t.anyOf=e.anyOf.map(tn)),e.oneOf&&(t.oneOf=e.oneOf.map(tn)),e.allOf&&(t.allOf=e.allOf.map(tn)),e.items&&(Array.isArray(e.items)?t.items=e.items.map(tn):t.items=tn(e.items)),t},ti=e=>{let t={};for(let[r,s]of Object.entries(e))t[r]=tn(s);return t},to=(e,t)=>{if(!e)return!1;if(e[t])return!0;if(e.properties){for(let r of Object.values(e.properties))if(to(r,t))return!0}if(e.anyOf){for(let r of e.anyOf)if(to(r,t))return!0}if(e.oneOf){for(let r of e.oneOf)if(to(r,t))return!0}if(e.allOf){for(let r of e.allOf)if(to(r,t))return!0}if(e.items){if(Array.isArray(e.items)){for(let r of e.items)if(to(r,t))return!0}else if(to(e.items,t))return!0}return!1},ta=e=>to(e,"file_uploadable"),tl=e=>to(e,"file_downloadable");var tc=e.i(911433),tc=tc,tu=e.i(902157),td=e.i(660526),th=e.i(750227);let tp={supportsFileSystem:!0,homedir(){try{return td.homedir()}catch{return null}},joinPath:(...e)=>th.join(...e),resolvePath:(...e)=>th.resolve(...e),isAbsolutePath:e=>th.isAbsolute(e),basename:e=>th.basename(e),existsSync:e=>tu.existsSync(e),mkdirSync(e){tu.mkdirSync(e,{recursive:!0})},readFileSync(e,t){if(void 0===t){let t=tu.readFileSync(e,{encoding:null});return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}return tu.readFileSync(e,{encoding:t})},writeFileSync(e,t,r){r&&"string"==typeof t?tu.writeFileSync(e,t,{encoding:r}):tu.writeFileSync(e,t)}};var tf=e.i(666680);let tm=[".ssh",".aws",".azure",".gnupg",".kube",".docker",".claude",".password-store","keychains"],tg=/^(\.env(\.|$)|\.netrc$|\.pgpass$)/i,ty=/^id_(rsa|ed25519|ecdsa|dsa|ecdsa_sk)(\.old)?$/i;function tb(e){try{if(tu.default.existsSync(e))return tu.default.realpathSync(e)}catch{}return null}function t_(e){return["\nAllowed upload directories (fileUploadDirs):",0===e.length?" (none configured — all local paths are blocked)":e.map(e=>` - ${e}`).join("\n"),"\nFix one of the following:\n\n 1. Recommended — move the file under an allowed directory, or add your\n directory to the allowlist:\n new Composio({\n fileUploadDirs: ['/abs/path/to/uploads', '~/.composio/temp'],\n })\n Note: user-provided `fileUploadDirs` REPLACES the default\n `~/.composio/temp`. Include it explicitly if you want staged uploads\n to keep working.\n\n 2. Pass the file by URL or as a File/Blob object instead of a filesystem\n path. URLs and File objects are never path-checked.\n\n 3. (Dangerous) Bypass the allowlist entirely by opting into automatic\n file upload/download from any readable path:\n new Composio({ dangerouslyAllowAutoUploadDownloadFiles: true })\n WARNING: This lets a prompt-injected or misbehaving tool read ANY\n file the process can access. Only enable it in trusted, sandboxed\n environments. The built-in sensitive-path denylist (.ssh, .aws,\n .env, private SSH keys, etc.) still applies unless you also set\n `sensitiveFileUploadProtection: false`."].join("\n")}let tw=e=>{let t={"text/plain":"txt","text/html":"html","text/css":"css","text/javascript":"js","application/json":"json","application/xml":"xml","application/pdf":"pdf","application/zip":"zip","application/x-zip-compressed":"zip","application/gzip":"gz","application/x-tar":"tar","application/msword":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.ms-excel":"xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-powerpoint":"ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","image/jpeg":"jpg","image/jpg":"jpg","image/png":"png","image/gif":"gif","image/svg+xml":"svg","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff","audio/mpeg":"mp3","audio/wav":"wav","audio/ogg":"ogg","video/mp4":"mp4","video/mpeg":"mpeg","video/quicktime":"mov","video/x-msvideo":"avi","video/webm":"webm"},r=e.split(";")[0].toLowerCase().trim();if(t[r])return t[r];let s=r.split("/");if(2===s.length){let e=s[1].toLowerCase();if(e.includes("+")){let t=e.split("+"),r=t[0],s=t[t.length-1];return["svg","atom","rss"].includes(r)?r:(["json","xml","yaml","zip","gzip"].includes(s),s)}return e||"txt"}return"txt"},tv=(e,t)=>`${t||"file_ts"}${Date.now()}${e9()}.${e}`,tI=async e=>{try{if(!tp.supportsFileSystem)throw Error("File system operations are not supported in this runtime environment");let t=tp.readFileSync(e);return{fileName:tv(e.split(".").pop()||"txt"),content:t instanceof Uint8Array?e8(t):e8(new TextEncoder().encode(t)),mimeType:"application/octet-stream"}}catch(t){throw Error(`Error reading file at ${e}: ${t}`)}},tk=async e=>{let t=await fetch(e);if(!t.ok)throw Error(`Failed to fetch file: ${t.statusText}`);let r=new Uint8Array(await t.arrayBuffer()),s=t.headers.get("content-type")||"application/octet-stream",n=new URL(e).pathname,i=tp.basename(n);return i&&"/"!==i&&i.includes(".")||(i=tv(tw(s))),{content:e8(r),mimeType:s,fileName:i}},tx=async(e,t,r,s,n,i)=>{let o=(e=>{let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r})(t),{key:a,new_presigned_url:l}=await i.files.createPresignedURL({filename:e,mimetype:n,md5:tf.default.createHash("md5").update(o).digest("hex"),tool_slug:r,toolkit_slug:s});ez.c.debug(`Uploading ${a} file to S3: ${a}`);let c=new Uint8Array(o.byteLength);c.set(o);let u=await fetch(l,{method:"PUT",body:c,headers:{"Content-Type":n,"Content-Length":o.length.toString()}});if(!u.ok)throw Error(`Failed to upload file to S3: ${u.statusText}`);return a},tT=async e=>{if(e instanceof File){let t=await e.arrayBuffer();return{fileName:e.name,content:e8(new Uint8Array(t)),mimeType:e.type}}if("string"==typeof e)if(e.startsWith("http"))return await tk(e);else return await tI(e);throw Error("Invalid file type")},tE=async(e,{toolSlug:t,toolkitSlug:r,client:s,sensitiveFileUploadProtection:n,fileUploadPathDenySegments:i,fileUploadAllowlist:o})=>{if(!e)throw Error("Either path or blob must be provided");let a="string"==typeof e&&!e.startsWith("http");a&&void 0!==o&&function(e,t){let r=th.resolve(e),s=tb(r);if(!s){let s=process.cwd(),n=th.dirname(r),i=(()=>{try{return tu.default.existsSync(n)}catch{return!1}})();throw new ez.t([`Refusing to auto-upload "${e}": the file does not exist on disk.`,"",`Path attempted: ${e}`,`Resolved to: ${r}`,`Process cwd: ${s}`,`Parent exists: ${i?"yes ("+n+")":"no ("+n+")"}`,"\nCommon causes:\n - Typo in the filename passed to the tool.\n - Relative path resolved against the wrong working directory\n (relative paths use process.cwd() at the moment of upload).\n - File was deleted between the tool being called and the upload starting.\n",t_(t)].join("\n"),{meta:{attempted:e,resolved:r,cwd:s,allowlist:t}})}if(0===t.length)throw new ez.i([`Refusing to auto-upload "${e}": no upload directories are configured.`,"",`Path attempted: ${e}`,`Resolved to: ${s}`,"\nAutomatic file upload during tool execution is locked down by default\nto prevent a prompt-injected tool from exfiltrating server files\n(source code, .env, SSH keys, etc.).",t_(t)].join("\n"),{meta:{attempted:e,resolved:s,allowlist:t}});for(let e of t)if(function(e,t){if(e===t)return!0;let r=th.sep,s=t.endsWith(r)?t:t+r;return e.startsWith(s)}(s,tb(e)??th.resolve(e)))return;throw new ez.i([`Refusing to auto-upload "${e}": resolved path is not inside any`,"directory in the configured `fileUploadDirs` allowlist.\n",`Path attempted: ${e}`,`Resolved to: ${s}`,t_(t)].join("\n"),{meta:{attempted:e,resolved:s,allowlist:t}})}(e,o),!1!==n&&a&&function(e,t){let r=function(e,t){let r=function(e){let t=th.resolve(e),r=t;try{tu.default.existsSync(t)&&(r=tu.default.realpathSync(t))}catch{}return r.split(/[/\\]+/).filter(Boolean)}(e);process.platform;let s=new Set([...tm,...(t??[]).map(e=>e.trim()).filter(Boolean)].map(e=>e));for(let e=0;e<r.length;e++)if(s.has(r[e]))return`path segment "${r[e]}" is in the sensitive file upload denylist`;let n=r.length>0?r[r.length-1]:"";if(n){if(tg.test(n)||ty.test(n))return`file name "${n}" looks like a credential, env, or private key file`;if("credentials"===n.toLowerCase())return'file name "credentials" is often used for cloud/API credential stores'}return null}(e,t?.additionalDenySegments);if(r)throw new ez.a(`Refusing to upload: ${r}. To upload from this path anyway, set sensitiveFileUploadProtection: false on Composio (not recommended) or use a copy outside sensitive locations.`,{meta:{filePath:e,reason:r}})}(e,{additionalDenySegments:i});let l=await tT(e);ez.c.debug("Uploading file to S3...");let c=await tx(tp.basename(l.fileName),l.content,t,r,l.mimeType,s);return ez.c.debug(`Done! File uploaded to S3: ${c}`,JSON.stringify(l,null,2)),{name:l.fileName,mimetype:l.mimeType,s3key:c}},tz=async({toolSlug:e,s3Url:t,mimeType:r,fileDownloadDir:s})=>{let n=await fetch(t);if(!n.ok)throw Error(`Failed to download file: ${n.statusText}`);let i=await n.arrayBuffer(),o=tv(tw(r),`${e}_`);return{name:o,mimeType:r,s3Url:t,filePath:tS(o,new Uint8Array(i),{isTempFile:void 0===s,outputDir:s})}},tA=(e=!1)=>{try{let t=tp.homedir();if(!t)return null;let r=tp.joinPath(t,ez.l,ez.m);return e&&tp.supportsFileSystem&&!tp.existsSync(r)&&tp.mkdirSync(r),r}catch(e){return null}},tS=(e,t,r={})=>{let s="boolean"==typeof r?{isTempFile:r}:r;try{let r;if(!tp.supportsFileSystem)return ez.c.debug("File system operations are not supported in this runtime environment"),null;if(s.outputDir){let e=tp.joinPath(s.outputDir);try{tp.existsSync(e)||tp.mkdirSync(e),r=e}catch(t){ez.c.warn(`fileDownloadDir "${e}" is not writable, falling back to the default (~/.composio/files). Error: ${t}`),r=tA(!0)}}else r=s.isTempFile?tA(!0):((e=!1)=>{try{let t=tp.homedir();if(!t)return null;let r=tp.joinPath(t,ez.l);return e&&tp.supportsFileSystem&&!tp.existsSync(r)&&tp.mkdirSync(r),r}catch(e){return null}})(!0);if(!r)return null;let n=tp.joinPath(r,tp.basename(e));return ez.c.info(`Saving file to: ${n}`),t instanceof Uint8Array?tp.writeFileSync(n,t):tp.writeFileSync(n,t,"utf8"),n}catch(e){return ez.c.debug(`Error saving file: ${e}`),null}},tC=async(e,t,r)=>{if(t?.file_uploadable){if("string"!=typeof e&&!(e instanceof File))return e;let t=async(e,t)=>{if(!r.beforeFileUpload)return e;let s=await r.beforeFileUpload({path:e,source:t,toolSlug:r.toolSlug,toolkitSlug:r.toolkitSlug});if(!1===s)throw new ez.n("File upload was aborted because beforeFileUpload returned false.");return s};if("string"==typeof e){let s=await t(e,e.startsWith("http")?"url":"path");return ez.c.debug(`Uploading file "${s}"`),tE(s,{toolSlug:r.toolSlug,toolkitSlug:r.toolkitSlug,client:r.client,sensitiveFileUploadProtection:r.sensitiveFileUploadProtection,fileUploadPathDenySegments:r.fileUploadPathDenySegments,fileUploadAllowlist:r.fileUploadAllowlist})}if(r.beforeFileUpload){let t=await r.beforeFileUpload({path:e.name,source:"file",toolSlug:r.toolSlug,toolkitSlug:r.toolkitSlug});if(!1===t)throw new ez.n("File upload was aborted because beforeFileUpload returned false.");if("string"==typeof t&&t!==e.name)return ez.c.debug(`Uploading file from path "${t}" (replaced File: ${e.name})`),tE(t,{toolSlug:r.toolSlug,toolkitSlug:r.toolkitSlug,client:r.client,sensitiveFileUploadProtection:r.sensitiveFileUploadProtection,fileUploadPathDenySegments:r.fileUploadPathDenySegments,fileUploadAllowlist:r.fileUploadAllowlist})}return ez.c.debug(`Uploading file "${e.name}"`),tE(e,{toolSlug:r.toolSlug,toolkitSlug:r.toolkitSlug,client:r.client,sensitiveFileUploadProtection:r.sensitiveFileUploadProtection,fileUploadPathDenySegments:r.fileUploadPathDenySegments})}let s=[...t?.anyOf??[],...t?.oneOf??[],...t?.allOf??[]];if(s.length>0){let t=s.find(ta);if(t)return tC(e,t,r)}if(t?.type==="object"&&t.properties&&ts(e)){let s={};for(let[n,i]of Object.entries(e))s[n]=await tC(i,t.properties[n],r);return s}if(t?.type==="array"&&t.items&&Array.isArray(e)){let s=Array.isArray(t.items)?t.items[0]:t.items;return Promise.all(e.map(e=>tC(e,s,r)))}return e},tO=async(e,t)=>{let{s3url:r,mimetype:s}=e;try{ez.c.debug(`Downloading from S3: ${r}`);let e=await tz({toolSlug:t.toolSlug,s3Url:r,mimeType:s??"application/octet-stream",fileDownloadDir:t.fileDownloadDir});return ez.c.debug(`Downloaded → ${e.filePath}`),{uri:e.filePath,file_downloaded:!!e.filePath,s3url:r,mimeType:e.mimeType}}catch(e){return ez.c.error(`Download failed: ${r}`,{cause:e}),{uri:"",file_downloaded:!1,s3url:r,mimeType:s??"application/octet-stream"}}},tP=async(e,t,r)=>{if(ts(e)&&"string"==typeof e.s3url||t?.file_downloadable&&ts(e)&&"string"==typeof e.s3url)return tO(e,r);let s=[...t?.anyOf??[],...t?.oneOf??[],...t?.allOf??[]];if(s.length>0){let t=s.filter(tl),n=e;for(let e of t)n=await tP(n,e,r);return 0===t.length?tP(e,void 0,r):n}if(ts(e))return Object.fromEntries(await Promise.all(Object.entries(e).map(async([e,s])=>[e,await tP(s,t?.properties?.[e],r)])));if(Array.isArray(e)){let s=t?.items?Array.isArray(t.items)?t.items[0]:t.items:void 0;return Promise.all(e.map(e=>tP(e,s,r)))}return e};var tR=class{client;fileUploadPathOptions;constructor(e,t={}){this.client=e,this.fileUploadPathOptions=t}async modifyToolSchema(e){if(!e.inputParameters?.properties)return e;let t=ti(e.inputParameters.properties);return{...e,inputParameters:{...e.inputParameters,properties:t}}}async fileUploadModifier(e,t){let{params:r,toolSlug:s,toolkitSlug:n="unknown"}=t,{arguments:i}=r;if(!i||"object"!=typeof i)return r;try{let t=await tC(i,e.inputParameters,{toolSlug:s,toolkitSlug:n,client:this.client,...this.fileUploadPathOptions});return{...r,arguments:t}}catch(e){if(e instanceof ez.a||e instanceof ez.n||e instanceof ez.i||e instanceof ez.t)throw e;throw new ez.r("Failed to upload file",{cause:e})}}async fileDownloadModifier(e,t){let{result:r,toolSlug:s}=t,n=await tP(r.data,e.outputParameters,{toolSlug:s,fileDownloadDir:this.fileUploadPathOptions.fileDownloadDir});return{...r,data:n}}},t$=e.i(735907);let tN="latest";function tj(e,t,r,s,n){if("m"===s)throw TypeError("Private method is not writable");if("a"===s&&!n)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,r):n?n.value=r:t.set(e,r),r}function tL(e,t,r,s){if("a"===r&&!s)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?s:"a"===r?s.call(e):s?s.value:t.get(e)}let tD=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return tD=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),r=e?()=>e.getRandomValues(t)[0]:()=>255*Math.random()&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(e^r()&15>>e/4).toString(16))};function tU(e){return"object"==typeof e&&null!==e&&("name"in e&&"AbortError"===e.name||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}let tF=e=>{if(e instanceof Error)return e;if("object"==typeof e&&null!==e){try{if("[object Error]"===Object.prototype.toString.call(e)){let t=Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(t.stack=e.stack),e.cause&&!t.cause&&(t.cause=e.cause),e.name&&(t.name=e.name),t}}catch{}try{return Error(JSON.stringify(e))}catch{}}return Error(e)};class tM extends Error{}class tZ extends tM{constructor(e,t,r,s){super(`${tZ.makeMessage(e,t,r)}`),this.status=e,this.headers=s,this.requestID=s?.get("x-request-id"),this.error=t,this.code=t?.code,this.param=t?.param,this.type=t?.type}static makeMessage(e,t,r){let s=t?.message?"string"==typeof t.message?t.message:JSON.stringify(t.message):t?JSON.stringify(t):r;return e&&s?`${e} ${s}`:e?`${e} status code (no body)`:s||"(no status code or body)"}static generate(e,t,r,s){if(!e||!s)return new tV({message:r,cause:tF(t)});let n=t?.error;return 400===e?new tK(e,n,r,s):401===e?new tq(e,n,r,s):403===e?new tH(e,n,r,s):404===e?new tG(e,n,r,s):409===e?new tX(e,n,r,s):422===e?new tJ(e,n,r,s):429===e?new tY(e,n,r,s):e>=500?new tQ(e,n,r,s):new tZ(e,n,r,s)}}class tB extends tZ{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}}class tV extends tZ{constructor({message:e,cause:t}){super(void 0,void 0,e||"Connection error.",void 0),t&&(this.cause=t)}}class tW extends tV{constructor({message:e}={}){super({message:e??"Request timed out."})}}class tK extends tZ{}class tq extends tZ{}class tH extends tZ{}class tG extends tZ{}class tX extends tZ{}class tJ extends tZ{}class tY extends tZ{}class tQ extends tZ{}class t0 extends tM{constructor(){super("Could not parse response content as the length limit was reached")}}class t1 extends tM{constructor(){super("Could not parse response content as the request was rejected by the content filter")}}class t2 extends Error{constructor(e){super(e)}}class t5 extends tZ{constructor(e,t,r){let s,n="OAuth2 authentication error";if(t&&"object"==typeof t){s=t.error;const e=t.error_description;e&&"string"==typeof e?n=e:s&&(n=s)}super(e,t,n,r),this.error_code=s}}class t3 extends tM{constructor(e,t,r){super(e),this.provider=t,this.cause=r}}let t4=/^[a-z][a-z0-9+.-]*:/i,t6=e=>(t6=Array.isArray)(e),t9=t6;function t8(e){return"object"!=typeof e?{}:e??{}}function t7(e){if(!e)return!0;for(let t in e)return!1;return!0}function re(e){return null!=e&&"object"==typeof e&&!Array.isArray(e)}let rt=e=>new Promise(t=>setTimeout(t,e)),rr="6.35.0",rs=e=>"x32"===e?"x32":"x86_64"===e||"x64"===e?"x64":"arm"===e?"arm":"aarch64"===e||"arm64"===e?"arm64":e?`other:${e}`:"unknown",rn=e=>(e=e.toLowerCase()).includes("ios")?"iOS":"android"===e?"Android":"darwin"===e?"MacOS":"win32"===e?"Windows":"freebsd"===e?"FreeBSD":"openbsd"===e?"OpenBSD":"linux"===e?"Linux":e?`Other:${e}`:"Unknown";function ri(){if("u">typeof fetch)return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function ro(...e){let t=globalThis.ReadableStream;if(void 0===t)throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function ra(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return ro({start(){},async pull(e){let{done:r,value:s}=await t.next();r?e.close():e.enqueue(s)},async cancel(){await t.return?.()}})}function rl(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let e=await t.read();return e?.done&&t.releaseLock(),e}catch(e){throw t.releaseLock(),e}},async return(){let e=t.cancel();return t.releaseLock(),await e,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function rc(e){if(null===e||"object"!=typeof e)return;if(e[Symbol.asyncIterator])return void await e[Symbol.asyncIterator]().return?.();let t=e.getReader(),r=t.cancel();t.releaseLock(),await r}let ru=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)}),rd="RFC3986",rh=e=>String(e),rp={RFC1738:e=>String(e).replace(/%20/g,"+"),RFC3986:rh},rf=(e,t)=>(rf=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty))(e,t),rm=(()=>{let e=[];for(let t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e})();function rg(e,t){if(t6(e)){let r=[];for(let s=0;s<e.length;s+=1)r.push(t(e[s]));return r}return t(e)}let ry={brackets:e=>String(e)+"[]",comma:"comma",indices:(e,t)=>String(e)+"["+t+"]",repeat:e=>String(e)},rb=function(e,t){Array.prototype.push.apply(e,t6(t)?t:[t])},r_={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:(e,t,r,s,n)=>{if(0===e.length)return e;let i=e;if("symbol"==typeof e?i=Symbol.prototype.toString.call(e):"string"!=typeof e&&(i=String(e)),"iso-8859-1"===r)return escape(i).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});let o="";for(let e=0;e<i.length;e+=1024){let t=i.length>=1024?i.slice(e,e+1024):i,r=[];for(let e=0;e<t.length;++e){let s=t.charCodeAt(e);if(45===s||46===s||95===s||126===s||s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122||"RFC1738"===n&&(40===s||41===s)){r[r.length]=t.charAt(e);continue}if(s<128){r[r.length]=rm[s];continue}if(s<2048){r[r.length]=rm[192|s>>6]+rm[128|63&s];continue}if(s<55296||s>=57344){r[r.length]=rm[224|s>>12]+rm[128|s>>6&63]+rm[128|63&s];continue}e+=1,s=65536+((1023&s)<<10|1023&t.charCodeAt(e)),r[r.length]=rm[240|s>>18]+rm[128|s>>12&63]+rm[128|s>>6&63]+rm[128|63&s]}o+=r.join("")}return o},encodeValuesOnly:!1,format:rd,formatter:rh,indices:!1,serializeDate:e=>(r??(r=Function.prototype.call.bind(Date.prototype.toISOString)))(e),skipNulls:!1,strictNullHandling:!1},rw={};function rv(e){let t;return(s??(s=(t=new globalThis.TextEncoder).encode.bind(t)))(e)}function rI(e){let t;return(n??(n=(t=new globalThis.TextDecoder).decode.bind(t)))(e)}class rk{constructor(){i.set(this,void 0),o.set(this,void 0),tj(this,i,new Uint8Array,"f"),tj(this,o,null,"f")}decode(e){let t;if(null==e)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):"string"==typeof e?rv(e):e;tj(this,i,function(e){let t=0;for(let r of e)t+=r.length;let r=new Uint8Array(t),s=0;for(let t of e)r.set(t,s),s+=t.length;return r}([tL(this,i,"f"),r]),"f");let s=[];for(;null!=(t=function(e,t){for(let r=t??0;r<e.length;r++){if(10===e[r])return{preceding:r,index:r+1,carriage:!1};if(13===e[r])return{preceding:r,index:r+1,carriage:!0}}return null}(tL(this,i,"f"),tL(this,o,"f")));){if(t.carriage&&null==tL(this,o,"f")){tj(this,o,t.index,"f");continue}if(null!=tL(this,o,"f")&&(t.index!==tL(this,o,"f")+1||t.carriage)){s.push(rI(tL(this,i,"f").subarray(0,tL(this,o,"f")-1))),tj(this,i,tL(this,i,"f").subarray(tL(this,o,"f")),"f"),tj(this,o,null,"f");continue}let e=null!==tL(this,o,"f")?t.preceding-1:t.preceding,r=rI(tL(this,i,"f").subarray(0,e));s.push(r),tj(this,i,tL(this,i,"f").subarray(t.index),"f"),tj(this,o,null,"f")}return s}flush(){return tL(this,i,"f").length?this.decode("\n"):[]}}i=new WeakMap,o=new WeakMap,rk.NEWLINE_CHARS=new Set(["\n","\r"]),rk.NEWLINE_REGEXP=/\r\n|[\n\r]/g;let rx={off:0,error:200,warn:300,info:400,debug:500},rT=(e,t,r)=>{if(e){if(Object.prototype.hasOwnProperty.call(rx,e))return e;rC(r).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(rx))}`)}};function rE(){}function rz(e,t,r){return!t||rx[e]>rx[r]?rE:t[e].bind(t)}let rA={error:rE,warn:rE,info:rE,debug:rE},rS=new WeakMap;function rC(e){let t=e.logger,r=e.logLevel??"off";if(!t)return rA;let s=rS.get(t);if(s&&s[0]===r)return s[1];let n={error:rz("error",t,r),warn:rz("warn",t,r),info:rz("info",t,r),debug:rz("debug",t,r)};return rS.set(t,[r,n]),n}let rO=e=>(e.options&&(e.options={...e.options},delete e.options.headers),e.headers&&(e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([e,t])=>[e,"authorization"===e.toLowerCase()||"cookie"===e.toLowerCase()||"set-cookie"===e.toLowerCase()?"***":t]))),"retryOfRequestLogID"in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e);class rP{constructor(e,t,r){this.iterator=e,a.set(this,void 0),this.controller=t,tj(this,a,r,"f")}static fromSSEResponse(e,t,r,s){let n=!1,i=r?rC(r):console;return new rP(async function*(){if(n)throw new tM("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");n=!0;let r=!1;try{for await(let n of rR(e,t))if(!r){if(n.data.startsWith("[DONE]")){r=!0;continue}if(null!==n.event&&n.event.startsWith("thread.")){let e;try{e=JSON.parse(n.data)}catch(e){throw console.error("Could not parse message into JSON:",n.data),console.error("From chunk:",n.raw),e}if("error"==n.event)throw new tZ(void 0,e.error,e.message,void 0);yield{event:n.event,data:e}}else{let t;try{t=JSON.parse(n.data)}catch(e){throw i.error("Could not parse message into JSON:",n.data),i.error("From chunk:",n.raw),e}if(t&&t.error)throw new tZ(void 0,t.error,void 0,e.headers);yield s?{event:n.event,data:t}:t}}r=!0}catch(e){if(tU(e))return;throw e}finally{r||t.abort()}},t,r)}static fromReadableStream(e,t,r){let s=!1;async function*n(){let t=new rk;for await(let r of rl(e))for(let e of t.decode(r))yield e;for(let e of t.flush())yield e}return new rP(async function*(){if(s)throw new tM("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");s=!0;let e=!1;try{for await(let t of n())!e&&t&&(yield JSON.parse(t));e=!0}catch(e){if(tU(e))return;throw e}finally{e||t.abort()}},t,r)}[(a=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],t=[],r=this.iterator(),s=s=>({next:()=>{if(0===s.length){let s=r.next();e.push(s),t.push(s)}return s.shift()}});return[new rP(()=>s(e),this.controller,tL(this,a,"f")),new rP(()=>s(t),this.controller,tL(this,a,"f"))]}toReadableStream(){let e,t=this;return ro({async start(){e=t[Symbol.asyncIterator]()},async pull(t){try{let{value:r,done:s}=await e.next();if(s)return t.close();let n=rv(JSON.stringify(r)+"\n");t.enqueue(n)}catch(e){t.error(e)}},async cancel(){await e.return?.()}})}}async function*rR(e,t){if(!e.body){if(t.abort(),void 0!==globalThis.navigator&&"ReactNative"===globalThis.navigator.product)throw new tM("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new tM("Attempted to iterate over a response with no body")}let r=new rN,s=new rk;for await(let t of r$(rl(e.body)))for(let e of s.decode(t)){let t=r.decode(e);t&&(yield t)}for(let e of s.flush()){let t=r.decode(e);t&&(yield t)}}async function*r$(e){let t=new Uint8Array;for await(let r of e){let e;if(null==r)continue;let s=r instanceof ArrayBuffer?new Uint8Array(r):"string"==typeof r?rv(r):r,n=new Uint8Array(t.length+s.length);for(n.set(t),n.set(s,t.length),t=n;-1!==(e=function(e){for(let t=0;t<e.length-1;t++){if(10===e[t]&&10===e[t+1]||13===e[t]&&13===e[t+1])return t+2;if(13===e[t]&&10===e[t+1]&&t+3<e.length&&13===e[t+2]&&10===e[t+3])return t+4}return -1}(t));)yield t.slice(0,e),t=t.slice(e)}t.length>0&&(yield t)}class rN{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){var t;let r;if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let e={event:this.event,data:this.data.join("\n"),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],e}if(this.chunks.push(e),e.startsWith(":"))return null;let[s,n,i]=-1!==(r=(t=e).indexOf(":"))?[t.substring(0,r),":",t.substring(r+1)]:[t,"",""];return i.startsWith(" ")&&(i=i.substring(1)),"event"===s?this.event=i:"data"===s&&this.data.push(i),null}}async function rj(e,t){let{response:r,requestLogID:s,retryOfRequestLogID:n,startTime:i}=t,o=await (async()=>{if(t.options.stream)return(rC(e).debug("response",r.status,r.url,r.headers,r.body),t.options.__streamClass)?t.options.__streamClass.fromSSEResponse(r,t.controller,e,t.options.__synthesizeEventData):rP.fromSSEResponse(r,t.controller,e,t.options.__synthesizeEventData);if(204===r.status)return null;if(t.options.__binaryResponse)return r;let s=r.headers.get("content-type"),n=s?.split(";")[0]?.trim();if(n?.includes("application/json")||n?.endsWith("+json")){if("0"===r.headers.get("content-length"))return;return rL(await r.json(),r)}return await r.text()})();return rC(e).debug(`[${s}] response parsed`,rO({retryOfRequestLogID:n,url:r.url,status:r.status,body:o,durationMs:Date.now()-i})),o}function rL(e,t){return!e||"object"!=typeof e||Array.isArray(e)?e:Object.defineProperty(e,"_request_id",{value:t.headers.get("x-request-id"),enumerable:!1})}class rD extends Promise{constructor(e,t,r=rj){super(e=>{e(null)}),this.responsePromise=t,this.parseResponse=r,l.set(this,void 0),tj(this,l,e,"f")}_thenUnwrap(e){return new rD(tL(this,l,"f"),this.responsePromise,async(t,r)=>rL(e(await this.parseResponse(t,r),r),r.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,t]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:t,request_id:t.headers.get("x-request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(tL(this,l,"f"),e))),this.parsedPromise}then(e,t){return this.parse().then(e,t)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}}l=new WeakMap;class rU{constructor(e,t,r,s){c.set(this,void 0),tj(this,c,e,"f"),this.options=s,this.response=t,this.body=r}hasNextPage(){return!!this.getPaginatedItems().length&&null!=this.nextPageRequestOptions()}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new tM("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await tL(this,c,"f").requestAPIList(this.constructor,e)}async *iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async *[(c=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let t of e.getPaginatedItems())yield t}}class rF extends rD{constructor(e,t,r){super(e,t,async(e,t)=>new r(e,t.response,await rj(e,t),t.options))}async *[Symbol.asyncIterator](){for await(let e of(await this))yield e}}class rM extends rU{constructor(e,t,r,s){super(e,t,r,s),this.data=r.data||[],this.object=r.object}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){return null}}class rZ extends rU{constructor(e,t,r,s){super(e,t,r,s),this.data=r.data||[],this.has_more=r.has_more||!1}getPaginatedItems(){return this.data??[]}hasNextPage(){return!1!==this.has_more&&super.hasNextPage()}nextPageRequestOptions(){let e=this.getPaginatedItems(),t=e[e.length-1]?.id;return t?{...this.options,query:{...t8(this.options.query),after:t}}:null}}class rB extends rU{constructor(e,t,r,s){super(e,t,r,s),this.data=r.data||[],this.has_more=r.has_more||!1,this.last_id=r.last_id||""}getPaginatedItems(){return this.data??[]}hasNextPage(){return!1!==this.has_more&&super.hasNextPage()}nextPageRequestOptions(){let e=this.last_id;return e?{...this.options,query:{...t8(this.options.query),after:e}}:null}}let rV={jwt:"urn:ietf:params:oauth:token-type:jwt",id:"urn:ietf:params:oauth:token-type:id_token"};class rW{constructor(e,t){this.cachedToken=null,this.refreshPromise=null,this.tokenExchangeUrl="https://auth.openai.com/oauth/token",this.config=e,this.fetch=t??ri()}async getToken(){if(!this.cachedToken||this.isTokenExpired(this.cachedToken)){if(this.refreshPromise)return await this.refreshPromise;this.refreshPromise=this.refreshToken();try{return await this.refreshPromise}finally{this.refreshPromise=null}}return this.needsRefresh(this.cachedToken)&&!this.refreshPromise&&(this.refreshPromise=this.refreshToken().finally(()=>{this.refreshPromise=null})),this.cachedToken.token}async refreshToken(){let e=await this.config.provider.getToken(),t=await this.fetch(this.tokenExchangeUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",client_id:this.config.clientId,subject_token:e,subject_token_type:rV[this.config.provider.tokenType],identity_provider_id:this.config.identityProviderId,service_account_id:this.config.serviceAccountId})});if(!t.ok){let e,r=await t.text();try{e=JSON.parse(r)}catch{}if(400===t.status||401===t.status||403===t.status)throw new t5(t.status,e,t.headers);throw tZ.generate(t.status,e,`Token exchange failed with status ${t.status}`,t.headers)}let r=await t.json(),s=r.expires_in||3600,n=Date.now()+1e3*s;return this.cachedToken={token:r.access_token,expiresAt:n},r.access_token}isTokenExpired(e){return Date.now()>=e.expiresAt}needsRefresh(e){let t=this.config.refreshBufferSeconds??1200;return Date.now()>=e.expiresAt-1e3*t}invalidateToken(){this.cachedToken=null,this.refreshPromise=null}}let rK=()=>{if("u"<typeof File){let{process:e}=globalThis;throw Error("`File` is not defined as a global, which is required for file uploads."+("string"==typeof e?.versions?.node&&20>parseInt(e.versions.node.split("."))?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function rq(e,t,r){return rK(),new File(e,t??"unknown_file",r)}function rH(e){return("object"==typeof e&&null!==e&&("name"in e&&e.name&&String(e.name)||"url"in e&&e.url&&String(e.url)||"filename"in e&&e.filename&&String(e.filename)||"path"in e&&e.path&&String(e.path))||"").split(/[\\/]/).pop()||void 0}let rG=e=>null!=e&&"object"==typeof e&&"function"==typeof e[Symbol.asyncIterator],rX=async(e,t)=>r1(e.body)?{...e,body:await rQ(e.body,t)}:e,rJ=async(e,t)=>({...e,body:await rQ(e.body,t)}),rY=new WeakMap,rQ=async(e,t)=>{if(!await function(e){let t="function"==typeof e?e:e.fetch,r=rY.get(t);if(r)return r;let s=(async()=>{try{let e="Response"in t?t.Response:(await t("data:,")).constructor,r=new FormData;if(r.toString()===await new e(r).text())return!1;return!0}catch{return!0}})();return rY.set(t,s),s}(t))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let r=new FormData;return await Promise.all(Object.entries(e||{}).map(([e,t])=>r2(r,e,t))),r},r0=e=>e instanceof Blob&&"name"in e,r1=e=>{if("object"==typeof e&&null!==e&&(e instanceof Response||rG(e)||r0(e)))return!0;if(Array.isArray(e))return e.some(r1);if(e&&"object"==typeof e){for(let t in e)if(r1(e[t]))return!0}return!1},r2=async(e,t,r)=>{if(void 0!==r){if(null==r)throw TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if("string"==typeof r||"number"==typeof r||"boolean"==typeof r)e.append(t,String(r));else if(r instanceof Response)e.append(t,rq([await r.blob()],rH(r)));else if(rG(r))e.append(t,rq([await new Response(ra(r)).blob()],rH(r)));else if(r0(r))e.append(t,r,rH(r));else if(Array.isArray(r))await Promise.all(r.map(r=>r2(e,t+"[]",r)));else if("object"==typeof r)await Promise.all(Object.entries(r).map(([r,s])=>r2(e,`${t}[${r}]`,s)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${r} instead`)}},r5=e=>null!=e&&"object"==typeof e&&"number"==typeof e.size&&"string"==typeof e.type&&"function"==typeof e.text&&"function"==typeof e.slice&&"function"==typeof e.arrayBuffer;async function r3(e,t,r){let s,n;if(rK(),null!=(s=e=await e)&&"object"==typeof s&&"string"==typeof s.name&&"number"==typeof s.lastModified&&r5(s))return e instanceof File?e:rq([await e.arrayBuffer()],e.name);if(null!=(n=e)&&"object"==typeof n&&"string"==typeof n.url&&"function"==typeof n.blob){let s=await e.blob();return t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()),rq(await r4(s),t,r)}let i=await r4(e);if(t||(t=rH(e)),!r?.type){let e=i.find(e=>"object"==typeof e&&"type"in e&&e.type);"string"==typeof e&&(r={...r,type:e})}return rq(i,t,r)}async function r4(e){let t=[];if("string"==typeof e||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(r5(e))t.push(e instanceof Blob?e:await e.arrayBuffer());else if(rG(e))for await(let r of e)t.push(...await r4(r));else{let t=e?.constructor?.name;throw Error(`Unexpected data type: ${typeof e}${t?`; constructor: ${t}`:""}${function(e){if("object"!=typeof e||null===e)return"";let t=Object.getOwnPropertyNames(e);return`; props: [${t.map(e=>`"${e}"`).join(", ")}]`}(e)}`)}return t}class r6{constructor(e){this._client=e}}function r9(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}let r8=Object.freeze(Object.create(null)),r7=((e=r9)=>function(t,...r){let s;if(1===t.length)return t[0];let n=!1,i=[],o=t.reduce((t,s,o)=>{/[?#]/.test(s)&&(n=!0);let a=r[o],l=(n?encodeURIComponent:e)(""+a);return o!==r.length&&(null==a||"object"==typeof a&&a.toString===Object.getPrototypeOf(Object.getPrototypeOf(a.hasOwnProperty??r8)??r8)?.toString)&&(l=a+"",i.push({start:t.length+s.length,length:l.length,error:`Value of type ${Object.prototype.toString.call(a).slice(8,-1)} is not a valid path parameter`})),t+s+(o===r.length?"":l)},""),a=o.split(/[?#]/,1)[0],l=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;for(;null!==(s=l.exec(a));)i.push({start:s.index,length:s[0].length,error:`Value "${s[0]}" can't be safely passed as a path parameter`});if(i.sort((e,t)=>e.start-t.start),i.length>0){let e=0,t=i.reduce((t,r)=>{let s=" ".repeat(r.start-e),n="^".repeat(r.length);return e=r.start+r.length,t+s+n},"");throw new tM(`Path parameters result in path with invalid segments:
|
|
5
|
-
${i.map(e=>e.error).join("\n")}
|
|
6
|
-
${o}
|
|
7
|
-
${t}`)}return o})(r9);class se extends r6{list(e,t={},r){return this._client.getAPIList(r7`/chat/completions/${e}/messages`,rZ,{query:t,...r})}}function st(e){return void 0!==e&&"function"in e&&void 0!==e.function}function sr(e){return e?.$brand==="auto-parseable-response-format"}function ss(e){return e?.$brand==="auto-parseable-tool"}function sn(e,t){let r=e.choices.map(e=>{var r,s;if("length"===e.finish_reason)throw new t0;if("content_filter"===e.finish_reason)throw new t1;return so(e.message.tool_calls),{...e,message:{...e.message,...e.message.tool_calls?{tool_calls:e.message.tool_calls?.map(e=>{var r,s;let n;return r=t,s=e,n=r.tools?.find(e=>st(e)&&e.function?.name===s.function.name),{...s,function:{...s.function,parsed_arguments:ss(n)?n.$parseRaw(s.function.arguments):n?.function.strict?JSON.parse(s.function.arguments):null}}})??void 0}:void 0,parsed:e.message.content&&!e.message.refusal?(r=t,s=e.message.content,r.response_format?.type!=="json_schema"?null:r.response_format?.type==="json_schema"?"$parseRaw"in r.response_format?r.response_format.$parseRaw(s):JSON.parse(s):null):null}}});return{...e,choices:r}}function si(e){return!!sr(e.response_format)||(e.tools?.some(e=>ss(e)||"function"===e.type&&!0===e.function.strict)??!1)}function so(e){for(let t of e||[])if("function"!==t.type)throw new tM(`Currently only \`function\` tool calls are supported; Received \`${t.type}\``)}let sa=e=>e?.role==="assistant",sl=e=>e?.role==="tool";class sc{constructor(){u.add(this),this.controller=new AbortController,d.set(this,void 0),h.set(this,()=>{}),p.set(this,()=>{}),f.set(this,void 0),m.set(this,()=>{}),g.set(this,()=>{}),y.set(this,{}),b.set(this,!1),_.set(this,!1),w.set(this,!1),v.set(this,!1),tj(this,d,new Promise((e,t)=>{tj(this,h,e,"f"),tj(this,p,t,"f")}),"f"),tj(this,f,new Promise((e,t)=>{tj(this,m,e,"f"),tj(this,g,t,"f")}),"f"),tL(this,d,"f").catch(()=>{}),tL(this,f,"f").catch(()=>{})}_run(e){setTimeout(()=>{e().then(()=>{this._emitFinal(),this._emit("end")},tL(this,u,"m",I).bind(this))},0)}_connected(){this.ended||(tL(this,h,"f").call(this),this._emit("connect"))}get ended(){return tL(this,b,"f")}get errored(){return tL(this,_,"f")}get aborted(){return tL(this,w,"f")}abort(){this.controller.abort()}on(e,t){return(tL(this,y,"f")[e]||(tL(this,y,"f")[e]=[])).push({listener:t}),this}off(e,t){let r=tL(this,y,"f")[e];if(!r)return this;let s=r.findIndex(e=>e.listener===t);return s>=0&&r.splice(s,1),this}once(e,t){return(tL(this,y,"f")[e]||(tL(this,y,"f")[e]=[])).push({listener:t,once:!0}),this}emitted(e){return new Promise((t,r)=>{tj(this,v,!0,"f"),"error"!==e&&this.once("error",r),this.once(e,t)})}async done(){tj(this,v,!0,"f"),await tL(this,f,"f")}_emit(e,...t){if(tL(this,b,"f"))return;"end"===e&&(tj(this,b,!0,"f"),tL(this,m,"f").call(this));let r=tL(this,y,"f")[e];if(r&&(tL(this,y,"f")[e]=r.filter(e=>!e.once),r.forEach(({listener:e})=>e(...t))),"abort"===e){let e=t[0];tL(this,v,"f")||r?.length||Promise.reject(e),tL(this,p,"f").call(this,e),tL(this,g,"f").call(this,e),this._emit("end");return}if("error"===e){let e=t[0];tL(this,v,"f")||r?.length||Promise.reject(e),tL(this,p,"f").call(this,e),tL(this,g,"f").call(this,e),this._emit("end")}}_emitFinal(){}}d=new WeakMap,h=new WeakMap,p=new WeakMap,f=new WeakMap,m=new WeakMap,g=new WeakMap,y=new WeakMap,b=new WeakMap,_=new WeakMap,w=new WeakMap,v=new WeakMap,u=new WeakSet,I=function(e){if(tj(this,_,!0,"f"),e instanceof Error&&"AbortError"===e.name&&(e=new tB),e instanceof tB)return tj(this,w,!0,"f"),this._emit("abort",e);if(e instanceof tM)return this._emit("error",e);if(e instanceof Error){let t=new tM(e.message);return t.cause=e,this._emit("error",t)}return this._emit("error",new tM(String(e)))};class su extends sc{constructor(){super(...arguments),k.add(this),this._chatCompletions=[],this.messages=[]}_addChatCompletion(e){this._chatCompletions.push(e),this._emit("chatCompletion",e);let t=e.choices[0]?.message;return t&&this._addMessage(t),e}_addMessage(e,t=!0){if("content"in e||(e.content=null),this.messages.push(e),t){if(this._emit("message",e),sl(e)&&e.content)this._emit("functionToolCallResult",e.content);else if(sa(e)&&e.tool_calls)for(let t of e.tool_calls)"function"===t.type&&this._emit("functionToolCall",t.function)}}async finalChatCompletion(){await this.done();let e=this._chatCompletions[this._chatCompletions.length-1];if(!e)throw new tM("stream ended without producing a ChatCompletion");return e}async finalContent(){return await this.done(),tL(this,k,"m",x).call(this)}async finalMessage(){return await this.done(),tL(this,k,"m",T).call(this)}async finalFunctionToolCall(){return await this.done(),tL(this,k,"m",E).call(this)}async finalFunctionToolCallResult(){return await this.done(),tL(this,k,"m",z).call(this)}async totalUsage(){return await this.done(),tL(this,k,"m",A).call(this)}allChatCompletions(){return[...this._chatCompletions]}_emitFinal(){let e=this._chatCompletions[this._chatCompletions.length-1];e&&this._emit("finalChatCompletion",e);let t=tL(this,k,"m",T).call(this);t&&this._emit("finalMessage",t);let r=tL(this,k,"m",x).call(this);r&&this._emit("finalContent",r);let s=tL(this,k,"m",E).call(this);s&&this._emit("finalFunctionToolCall",s);let n=tL(this,k,"m",z).call(this);null!=n&&this._emit("finalFunctionToolCallResult",n),this._chatCompletions.some(e=>e.usage)&&this._emit("totalUsage",tL(this,k,"m",A).call(this))}async _createChatCompletion(e,t,r){let s=r?.signal;s&&(s.aborted&&this.controller.abort(),s.addEventListener("abort",()=>this.controller.abort())),tL(this,k,"m",S).call(this,t);let n=await e.chat.completions.create({...t,stream:!1},{...r,signal:this.controller.signal});return this._connected(),this._addChatCompletion(sn(n,t))}async _runChatCompletion(e,t,r){for(let e of t.messages)this._addMessage(e,!1);return await this._createChatCompletion(e,t,r)}async _runTools(e,t,r){let s="tool",{tool_choice:n="auto",stream:i,...o}=t,a="string"!=typeof n&&"function"===n.type&&n?.function?.name,{maxChatCompletions:l=10}=r||{},c=t.tools.map(e=>{if(ss(e)){if(!e.$callback)throw new tM("Tool given to `.runTools()` that does not have an associated function");return{type:"function",function:{function:e.$callback,name:e.function.name,description:e.function.description||"",parameters:e.function.parameters,parse:e.$parseRaw,strict:!0}}}return e}),u={};for(let e of c)"function"===e.type&&(u[e.function.name||e.function.function.name]=e.function);let d="tools"in t?c.map(e=>"function"===e.type?{type:"function",function:{name:e.function.name||e.function.function.name,parameters:e.function.parameters,description:e.function.description,strict:e.function.strict}}:e):void 0;for(let e of t.messages)this._addMessage(e,!1);for(let t=0;t<l;++t){let t=await this._createChatCompletion(e,{...o,tool_choice:n,tools:d,messages:[...this.messages]},r),i=t.choices[0]?.message;if(!i)throw new tM("missing message in ChatCompletion response");if(!i.tool_calls?.length)break;for(let e of i.tool_calls){let t;if("function"!==e.type)continue;let r=e.id,{name:n,arguments:i}=e.function,o=u[n];if(o){if(a&&a!==n){let e=`Invalid tool_call: ${JSON.stringify(n)}. ${JSON.stringify(a)} requested. Please try again`;this._addMessage({role:s,tool_call_id:r,content:e});continue}}else{let e=`Invalid tool_call: ${JSON.stringify(n)}. Available options are: ${Object.keys(u).map(e=>JSON.stringify(e)).join(", ")}. Please try again`;this._addMessage({role:s,tool_call_id:r,content:e});continue}try{t="function"==typeof o.parse?await o.parse(i):i}catch(t){let e=t instanceof Error?t.message:String(t);this._addMessage({role:s,tool_call_id:r,content:e});continue}let l=await o.function(t,this),c=tL(this,k,"m",C).call(this,l);if(this._addMessage({role:s,tool_call_id:r,content:c}),a)return}}}}k=new WeakSet,x=function(){return tL(this,k,"m",T).call(this).content??null},T=function(){let e=this.messages.length;for(;e-- >0;){let t=this.messages[e];if(sa(t))return{...t,content:t.content??null,refusal:t.refusal??null}}throw new tM("stream ended without producing a ChatCompletionMessage with role=assistant")},E=function(){for(let e=this.messages.length-1;e>=0;e--){let t=this.messages[e];if(sa(t)&&t?.tool_calls?.length)return t.tool_calls.filter(e=>"function"===e.type).at(-1)?.function}},z=function(){for(let e=this.messages.length-1;e>=0;e--){let t=this.messages[e];if(sl(t)&&null!=t.content&&"string"==typeof t.content&&this.messages.some(e=>"assistant"===e.role&&e.tool_calls?.some(e=>"function"===e.type&&e.id===t.tool_call_id)))return t.content}},A=function(){let e={completion_tokens:0,prompt_tokens:0,total_tokens:0};for(let{usage:t}of this._chatCompletions)t&&(e.completion_tokens+=t.completion_tokens,e.prompt_tokens+=t.prompt_tokens,e.total_tokens+=t.total_tokens);return e},S=function(e){if(null!=e.n&&e.n>1)throw new tM("ChatCompletion convenience helpers only support n=1 at this time. To use n>1, please use chat.completions.create() directly.")},C=function(e){return"string"==typeof e?e:void 0===e?"undefined":JSON.stringify(e)};class sd extends su{static runTools(e,t,r){let s=new sd,n={...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"runTools"}};return s._run(()=>s._runTools(e,t,n)),s}_addMessage(e,t=!0){super._addMessage(e,t),sa(e)&&e.content&&this._emit("content",e.content)}}let sh={STR:1,NUM:2,ARR:4,OBJ:8,NULL:16,BOOL:32,NAN:64,INFINITY:128,MINUS_INFINITY:256,INF:384,ALL:511};class sp extends Error{}class sf extends Error{}let sm=e=>(function(e,t=sh.ALL){var r,s;let n,i,o,a,l,c,u,d,h,p;if("string"!=typeof e)throw TypeError(`expecting str, got ${typeof e}`);if(!e.trim())throw Error(`${e} is empty`);return r=e.trim(),s=t,n=r.length,i=0,o=e=>{throw new sp(`${e} at position ${i}`)},a=e=>{throw new sf(`${e} at position ${i}`)},l=()=>(p(),i>=n&&o("Unexpected end of input"),'"'===r[i])?c():"{"===r[i]?u():"["===r[i]?d():"null"===r.substring(i,i+4)||sh.NULL&s&&n-i<4&&"null".startsWith(r.substring(i))?(i+=4,null):"true"===r.substring(i,i+4)||sh.BOOL&s&&n-i<4&&"true".startsWith(r.substring(i))?(i+=4,!0):"false"===r.substring(i,i+5)||sh.BOOL&s&&n-i<5&&"false".startsWith(r.substring(i))?(i+=5,!1):"Infinity"===r.substring(i,i+8)||sh.INFINITY&s&&n-i<8&&"Infinity".startsWith(r.substring(i))?(i+=8,1/0):"-Infinity"===r.substring(i,i+9)||sh.MINUS_INFINITY&s&&1<n-i&&n-i<9&&"-Infinity".startsWith(r.substring(i))?(i+=9,-1/0):"NaN"===r.substring(i,i+3)||sh.NAN&s&&n-i<3&&"NaN".startsWith(r.substring(i))?(i+=3,NaN):h(),c=()=>{let e=i,t=!1;for(i++;i<n&&('"'!==r[i]||t&&"\\"===r[i-1]);)t="\\"===r[i]&&!t,i++;if('"'==r.charAt(i))try{return JSON.parse(r.substring(e,++i-Number(t)))}catch(e){a(String(e))}else if(sh.STR&s)try{return JSON.parse(r.substring(e,i-Number(t))+'"')}catch(t){return JSON.parse(r.substring(e,r.lastIndexOf("\\"))+'"')}o("Unterminated string literal")},u=()=>{i++,p();let e={};try{for(;"}"!==r[i];){if(p(),i>=n&&sh.OBJ&s)return e;let t=c();p(),i++;try{let r=l();Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}catch(t){if(sh.OBJ&s)return e;throw t}p(),","===r[i]&&i++}}catch(t){if(sh.OBJ&s)return e;o("Expected '}' at end of object")}return i++,e},d=()=>{i++;let e=[];try{for(;"]"!==r[i];)e.push(l()),p(),","===r[i]&&i++}catch(t){if(sh.ARR&s)return e;o("Expected ']' at end of array")}return i++,e},h=()=>{if(0===i){"-"===r&&sh.NUM&s&&o("Not sure what '-' is");try{return JSON.parse(r)}catch(e){if(sh.NUM&s)try{if("."===r[r.length-1])return JSON.parse(r.substring(0,r.lastIndexOf(".")));return JSON.parse(r.substring(0,r.lastIndexOf("e")))}catch(e){}a(String(e))}}let e=i;for("-"===r[i]&&i++;r[i]&&!",]}".includes(r[i]);)i++;i!=n||sh.NUM&s||o("Unterminated number literal");try{return JSON.parse(r.substring(e,i))}catch(t){"-"===r.substring(e,i)&&sh.NUM&s&&o("Not sure what '-' is");try{return JSON.parse(r.substring(e,r.lastIndexOf("e")))}catch(e){a(String(e))}}},p=()=>{for(;i<n&&" \n\r ".includes(r[i]);)i++},l()})(e,sh.ALL^sh.NUM);class sg extends su{constructor(e){super(),O.add(this),P.set(this,void 0),R.set(this,void 0),$.set(this,void 0),tj(this,P,e,"f"),tj(this,R,[],"f")}get currentChatCompletionSnapshot(){return tL(this,$,"f")}static fromReadableStream(e){let t=new sg(null);return t._run(()=>t._fromReadableStream(e)),t}static createChatCompletion(e,t,r){let s=new sg(t);return s._run(()=>s._runChatCompletion(e,{...t,stream:!0},{...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"stream"}})),s}async _createChatCompletion(e,t,r){super._createChatCompletion;let s=r?.signal;s&&(s.aborted&&this.controller.abort(),s.addEventListener("abort",()=>this.controller.abort())),tL(this,O,"m",N).call(this);let n=await e.chat.completions.create({...t,stream:!0},{...r,signal:this.controller.signal});for await(let e of(this._connected(),n))tL(this,O,"m",L).call(this,e);if(n.controller.signal?.aborted)throw new tB;return this._addChatCompletion(tL(this,O,"m",F).call(this))}async _fromReadableStream(e,t){let r,s=t?.signal;s&&(s.aborted&&this.controller.abort(),s.addEventListener("abort",()=>this.controller.abort())),tL(this,O,"m",N).call(this),this._connected();let n=rP.fromReadableStream(e,this.controller);for await(let e of n)r&&r!==e.id&&this._addChatCompletion(tL(this,O,"m",F).call(this)),tL(this,O,"m",L).call(this,e),r=e.id;if(n.controller.signal?.aborted)throw new tB;return this._addChatCompletion(tL(this,O,"m",F).call(this))}[(P=new WeakMap,R=new WeakMap,$=new WeakMap,O=new WeakSet,N=function(){this.ended||tj(this,$,void 0,"f")},j=function(e){let t=tL(this,R,"f")[e.index];return t||(t={content_done:!1,refusal_done:!1,logprobs_content_done:!1,logprobs_refusal_done:!1,done_tool_calls:new Set,current_tool_call_index:null},tL(this,R,"f")[e.index]=t),t},L=function(e){if(this.ended)return;let t=tL(this,O,"m",Z).call(this,e);for(let r of(this._emit("chunk",e,t),e.choices)){let e=t.choices[r.index];null!=r.delta.content&&e.message?.role==="assistant"&&e.message?.content&&(this._emit("content",r.delta.content,e.message.content),this._emit("content.delta",{delta:r.delta.content,snapshot:e.message.content,parsed:e.message.parsed})),null!=r.delta.refusal&&e.message?.role==="assistant"&&e.message?.refusal&&this._emit("refusal.delta",{delta:r.delta.refusal,snapshot:e.message.refusal}),r.logprobs?.content!=null&&e.message?.role==="assistant"&&this._emit("logprobs.content.delta",{content:r.logprobs?.content,snapshot:e.logprobs?.content??[]}),r.logprobs?.refusal!=null&&e.message?.role==="assistant"&&this._emit("logprobs.refusal.delta",{refusal:r.logprobs?.refusal,snapshot:e.logprobs?.refusal??[]});let s=tL(this,O,"m",j).call(this,e);for(let t of(e.finish_reason&&(tL(this,O,"m",U).call(this,e),null!=s.current_tool_call_index&&tL(this,O,"m",D).call(this,e,s.current_tool_call_index)),r.delta.tool_calls??[]))s.current_tool_call_index!==t.index&&(tL(this,O,"m",U).call(this,e),null!=s.current_tool_call_index&&tL(this,O,"m",D).call(this,e,s.current_tool_call_index)),s.current_tool_call_index=t.index;for(let t of r.delta.tool_calls??[]){let r=e.message.tool_calls?.[t.index];r?.type&&(r?.type==="function"?this._emit("tool_calls.function.arguments.delta",{name:r.function?.name,index:t.index,arguments:r.function.arguments,parsed_arguments:r.function.parsed_arguments,arguments_delta:t.function?.arguments??""}):s_(r?.type))}}},D=function(e,t){if(tL(this,O,"m",j).call(this,e).done_tool_calls.has(t))return;let r=e.message.tool_calls?.[t];if(!r)throw Error("no tool call snapshot");if(!r.type)throw Error("tool call snapshot missing `type`");if("function"===r.type){let e=tL(this,P,"f")?.tools?.find(e=>st(e)&&e.function.name===r.function.name);this._emit("tool_calls.function.arguments.done",{name:r.function.name,index:t,arguments:r.function.arguments,parsed_arguments:ss(e)?e.$parseRaw(r.function.arguments):e?.function.strict?JSON.parse(r.function.arguments):null})}else s_(r.type)},U=function(e){let t=tL(this,O,"m",j).call(this,e);if(e.message.content&&!t.content_done){t.content_done=!0;let r=tL(this,O,"m",M).call(this);this._emit("content.done",{content:e.message.content,parsed:r?r.$parseRaw(e.message.content):null})}e.message.refusal&&!t.refusal_done&&(t.refusal_done=!0,this._emit("refusal.done",{refusal:e.message.refusal})),e.logprobs?.content&&!t.logprobs_content_done&&(t.logprobs_content_done=!0,this._emit("logprobs.content.done",{content:e.logprobs.content})),e.logprobs?.refusal&&!t.logprobs_refusal_done&&(t.logprobs_refusal_done=!0,this._emit("logprobs.refusal.done",{refusal:e.logprobs.refusal}))},F=function(){if(this.ended)throw new tM("stream has ended, this shouldn't happen");let e=tL(this,$,"f");if(!e)throw new tM("request ended without sending any chunks");return tj(this,$,void 0,"f"),tj(this,R,[],"f"),function(e,t){var r;let{id:s,choices:n,created:i,model:o,system_fingerprint:a,...l}=e;return r={...l,id:s,choices:n.map(({message:t,finish_reason:r,index:s,logprobs:n,...i})=>{if(!r)throw new tM(`missing finish_reason for choice ${s}`);let{content:o=null,function_call:a,tool_calls:l,...c}=t,u=t.role;if(!u)throw new tM(`missing role for choice ${s}`);if(a){let{arguments:e,name:l}=a;if(null==e)throw new tM(`missing function_call.arguments for choice ${s}`);if(!l)throw new tM(`missing function_call.name for choice ${s}`);return{...i,message:{content:o,function_call:{arguments:e,name:l},role:u,refusal:t.refusal??null},finish_reason:r,index:s,logprobs:n}}return l?{...i,index:s,finish_reason:r,logprobs:n,message:{...c,role:u,content:o,refusal:t.refusal??null,tool_calls:l.map((t,r)=>{let{function:n,type:i,id:o,...a}=t,{arguments:l,name:c,...u}=n||{};if(null==o)throw new tM(`missing choices[${s}].tool_calls[${r}].id
|
|
8
|
-
${sy(e)}`);if(null==i)throw new tM(`missing choices[${s}].tool_calls[${r}].type
|
|
9
|
-
${sy(e)}`);if(null==c)throw new tM(`missing choices[${s}].tool_calls[${r}].function.name
|
|
10
|
-
${sy(e)}`);if(null==l)throw new tM(`missing choices[${s}].tool_calls[${r}].function.arguments
|
|
11
|
-
${sy(e)}`);return{...a,id:o,type:i,function:{...u,name:c,arguments:l}}})}}:{...i,message:{...c,content:o,role:u,refusal:t.refusal??null},finish_reason:r,index:s,logprobs:n}}),created:i,model:o,object:"chat.completion",...a?{system_fingerprint:a}:{}},t&&si(t)?sn(r,t):{...r,choices:r.choices.map(e=>(so(e.message.tool_calls),{...e,message:{...e.message,parsed:null,...e.message.tool_calls?{tool_calls:e.message.tool_calls}:void 0}}))}}(e,tL(this,P,"f"))},M=function(){let e=tL(this,P,"f")?.response_format;return sr(e)?e:null},Z=function(e){var t,r,s,n;let i=tL(this,$,"f"),{choices:o,...a}=e;for(let{delta:o,finish_reason:l,index:c,logprobs:u=null,...d}of(i?Object.assign(i,a):i=tj(this,$,{...a,choices:[]},"f"),e.choices)){let e=i.choices[c];if(e||(e=i.choices[c]={finish_reason:l,index:c,message:{},logprobs:u,...d}),u)if(e.logprobs){let{content:s,refusal:n,...i}=u;sb(i),Object.assign(e.logprobs,i),s&&((t=e.logprobs).content??(t.content=[]),e.logprobs.content.push(...s)),n&&((r=e.logprobs).refusal??(r.refusal=[]),e.logprobs.refusal.push(...n))}else e.logprobs=Object.assign({},u);if(l&&(e.finish_reason=l,tL(this,P,"f")&&si(tL(this,P,"f")))){if("length"===l)throw new t0;if("content_filter"===l)throw new t1}if(Object.assign(e,d),!o)continue;let{content:a,refusal:h,function_call:p,role:f,tool_calls:m,...g}=o;if(sb(g),Object.assign(e.message,g),h&&(e.message.refusal=(e.message.refusal||"")+h),f&&(e.message.role=f),p&&(e.message.function_call?(p.name&&(e.message.function_call.name=p.name),p.arguments&&((s=e.message.function_call).arguments??(s.arguments=""),e.message.function_call.arguments+=p.arguments)):e.message.function_call=p),a&&(e.message.content=(e.message.content||"")+a,!e.message.refusal&&tL(this,O,"m",M).call(this)&&(e.message.parsed=sm(e.message.content))),m)for(let{index:t,id:r,type:s,function:i,...o}of(e.message.tool_calls||(e.message.tool_calls=[]),m)){let a=(n=e.message.tool_calls)[t]??(n[t]={});Object.assign(a,o),r&&(a.id=r),s&&(a.type=s),i&&(a.function??(a.function={name:i.name??"",arguments:""})),i?.name&&(a.function.name=i.name),i?.arguments&&(a.function.arguments+=i.arguments,function(e,t){if(!e||!("tools"in e)||!e.tools)return!1;let r=e.tools?.find(e=>st(e)&&e.function?.name===t.function.name);return st(r)&&(ss(r)||r?.function.strict||!1)}(tL(this,P,"f"),a)&&(a.function.parsed_arguments=sm(a.function.arguments)))}}return i},Symbol.asyncIterator)](){let e=[],t=[],r=!1;return this.on("chunk",r=>{let s=t.shift();s?s.resolve(r):e.push(r)}),this.on("end",()=>{for(let e of(r=!0,t))e.resolve(void 0);t.length=0}),this.on("abort",e=>{for(let s of(r=!0,t))s.reject(e);t.length=0}),this.on("error",e=>{for(let s of(r=!0,t))s.reject(e);t.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:r?{value:void 0,done:!0}:new Promise((e,r)=>t.push({resolve:e,reject:r})).then(e=>e?{value:e,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new rP(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}function sy(e){return JSON.stringify(e)}function sb(e){}function s_(e){}class sw extends sg{static fromReadableStream(e){let t=new sw(null);return t._run(()=>t._fromReadableStream(e)),t}static runTools(e,t,r){let s=new sw(t),n={...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"runTools"}};return s._run(()=>s._runTools(e,t,n)),s}}class sv extends r6{constructor(){super(...arguments),this.messages=new se(this._client)}create(e,t){return this._client.post("/chat/completions",{body:e,...t,stream:e.stream??!1})}retrieve(e,t){return this._client.get(r7`/chat/completions/${e}`,t)}update(e,t,r){return this._client.post(r7`/chat/completions/${e}`,{body:t,...r})}list(e={},t){return this._client.getAPIList("/chat/completions",rZ,{query:e,...t})}delete(e,t){return this._client.delete(r7`/chat/completions/${e}`,t)}parse(e,t){for(let t of e.tools??[]){if("function"!==t.type)throw new tM(`Currently only \`function\` tool types support auto-parsing; Received \`${t.type}\``);if(!0!==t.function.strict)throw new tM(`The \`${t.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`)}return this._client.chat.completions.create(e,{...t,headers:{...t?.headers,"X-Stainless-Helper-Method":"chat.completions.parse"}})._thenUnwrap(t=>sn(t,e))}runTools(e,t){return e.stream?sw.runTools(this._client,e,t):sd.runTools(this._client,e,t)}stream(e,t){return sg.createChatCompletion(this._client,e,t)}}sv.Messages=se;class sI extends r6{constructor(){super(...arguments),this.completions=new sv(this._client)}}sI.Completions=sv;let sk=Symbol("brand.privateNullableHeaders"),sx=e=>{let t=new Headers,r=new Set;for(let s of e){let e=new Set;for(let[n,i]of function*(e){let t;if(!e)return;if(sk in e){let{values:t,nulls:r}=e;for(let e of(yield*t.entries(),r))yield[e,null];return}let r=!1;for(let s of(e instanceof Headers?t=e.entries():t9(e)?t=e:(r=!0,t=Object.entries(e??{})),t)){let e=s[0];if("string"!=typeof e)throw TypeError("expected header name to be a string");let t=t9(s[1])?s[1]:[s[1]],n=!1;for(let s of t)void 0!==s&&(r&&!n&&(n=!0,yield[e,null]),yield[e,s])}}(s)){let s=n.toLowerCase();e.has(s)||(t.delete(n),e.add(s)),null===i?(t.delete(n),r.add(s)):(t.append(n,i),r.delete(s))}}return{[sk]:!0,values:t,nulls:r}};class sT extends r6{create(e,t){return this._client.post("/audio/speech",{body:e,...t,headers:sx([{Accept:"application/octet-stream"},t?.headers]),__binaryResponse:!0})}}class sE extends r6{create(e,t){return this._client.post("/audio/transcriptions",rJ({body:e,...t,stream:e.stream??!1,__metadata:{model:e.model}},this._client))}}class sz extends r6{create(e,t){return this._client.post("/audio/translations",rJ({body:e,...t,__metadata:{model:e.model}},this._client))}}class sA extends r6{constructor(){super(...arguments),this.transcriptions=new sE(this._client),this.translations=new sz(this._client),this.speech=new sT(this._client)}}sA.Transcriptions=sE,sA.Translations=sz,sA.Speech=sT;class sS extends r6{create(e,t){return this._client.post("/batches",{body:e,...t})}retrieve(e,t){return this._client.get(r7`/batches/${e}`,t)}list(e={},t){return this._client.getAPIList("/batches",rZ,{query:e,...t})}cancel(e,t){return this._client.post(r7`/batches/${e}/cancel`,t)}}class sC extends r6{create(e,t){return this._client.post("/assistants",{body:e,...t,headers:sx([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}retrieve(e,t){return this._client.get(r7`/assistants/${e}`,{...t,headers:sx([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}update(e,t,r){return this._client.post(r7`/assistants/${e}`,{body:t,...r,headers:sx([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}list(e={},t){return this._client.getAPIList("/assistants",rZ,{query:e,...t,headers:sx([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}delete(e,t){return this._client.delete(r7`/assistants/${e}`,{...t,headers:sx([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}}class sO extends r6{create(e,t){return this._client.post("/realtime/sessions",{body:e,...t,headers:sx([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}}class sP extends r6{create(e,t){return this._client.post("/realtime/transcription_sessions",{body:e,...t,headers:sx([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}}class sR extends r6{constructor(){super(...arguments),this.sessions=new sO(this._client),this.transcriptionSessions=new sP(this._client)}}sR.Sessions=sO,sR.TranscriptionSessions=sP;class s$ extends r6{create(e,t){return this._client.post("/chatkit/sessions",{body:e,...t,headers:sx([{"OpenAI-Beta":"chatkit_beta=v1"},t?.headers])})}cancel(e,t){return this._client.post(r7`/chatkit/sessions/${e}/cancel`,{...t,headers:sx([{"OpenAI-Beta":"chatkit_beta=v1"},t?.headers])})}}class sN extends r6{retrieve(e,t){return this._client.get(r7`/chatkit/threads/${e}`,{...t,headers:sx([{"OpenAI-Beta":"chatkit_beta=v1"},t?.headers])})}list(e={},t){return this._client.getAPIList("/chatkit/threads",rB,{query:e,...t,headers:sx([{"OpenAI-Beta":"chatkit_beta=v1"},t?.headers])})}delete(e,t){return this._client.delete(r7`/chatkit/threads/${e}`,{...t,headers:sx([{"OpenAI-Beta":"chatkit_beta=v1"},t?.headers])})}listItems(e,t={},r){return this._client.getAPIList(r7`/chatkit/threads/${e}/items`,rB,{query:t,...r,headers:sx([{"OpenAI-Beta":"chatkit_beta=v1"},r?.headers])})}}class sj extends r6{constructor(){super(...arguments),this.sessions=new s$(this._client),this.threads=new sN(this._client)}}sj.Sessions=s$,sj.Threads=sN;class sL extends r6{create(e,t,r){return this._client.post(r7`/threads/${e}/messages`,{body:t,...r,headers:sx([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}retrieve(e,t,r){let{thread_id:s}=t;return this._client.get(r7`/threads/${s}/messages/${e}`,{...r,headers:sx([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}update(e,t,r){let{thread_id:s,...n}=t;return this._client.post(r7`/threads/${s}/messages/${e}`,{body:n,...r,headers:sx([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}list(e,t={},r){return this._client.getAPIList(r7`/threads/${e}/messages`,rZ,{query:t,...r,headers:sx([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}delete(e,t,r){let{thread_id:s}=t;return this._client.delete(r7`/threads/${s}/messages/${e}`,{...r,headers:sx([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}}class sD extends r6{retrieve(e,t,r){let{thread_id:s,run_id:n,...i}=t;return this._client.get(r7`/threads/${s}/runs/${n}/steps/${e}`,{query:i,...r,headers:sx([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}list(e,t,r){let{thread_id:s,...n}=t;return this._client.getAPIList(r7`/threads/${s}/runs/${e}/steps`,rZ,{query:n,...r,headers:sx([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}}class sU extends sc{constructor(){super(...arguments),B.add(this),W.set(this,[]),K.set(this,{}),q.set(this,{}),H.set(this,void 0),G.set(this,void 0),X.set(this,void 0),J.set(this,void 0),Y.set(this,void 0),Q.set(this,void 0),ee.set(this,void 0),et.set(this,void 0),er.set(this,void 0)}[(W=new WeakMap,K=new WeakMap,q=new WeakMap,H=new WeakMap,G=new WeakMap,X=new WeakMap,J=new WeakMap,Y=new WeakMap,Q=new WeakMap,ee=new WeakMap,et=new WeakMap,er=new WeakMap,B=new WeakSet,Symbol.asyncIterator)](){let e=[],t=[],r=!1;return this.on("event",r=>{let s=t.shift();s?s.resolve(r):e.push(r)}),this.on("end",()=>{for(let e of(r=!0,t))e.resolve(void 0);t.length=0}),this.on("abort",e=>{for(let s of(r=!0,t))s.reject(e);t.length=0}),this.on("error",e=>{for(let s of(r=!0,t))s.reject(e);t.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:r?{value:void 0,done:!0}:new Promise((e,r)=>t.push({resolve:e,reject:r})).then(e=>e?{value:e,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}static fromReadableStream(e){let t=new V;return t._run(()=>t._fromReadableStream(e)),t}async _fromReadableStream(e,t){let r=t?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),this._connected();let s=rP.fromReadableStream(e,this.controller);for await(let e of s)tL(this,B,"m",es).call(this,e);if(s.controller.signal?.aborted)throw new tB;return this._addRun(tL(this,B,"m",en).call(this))}toReadableStream(){return new rP(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}static createToolAssistantStream(e,t,r,s){let n=new V;return n._run(()=>n._runToolAssistantStream(e,t,r,{...s,headers:{...s?.headers,"X-Stainless-Helper-Method":"stream"}})),n}async _createToolAssistantStream(e,t,r,s){let n=s?.signal;n&&(n.aborted&&this.controller.abort(),n.addEventListener("abort",()=>this.controller.abort()));let i={...r,stream:!0},o=await e.submitToolOutputs(t,i,{...s,signal:this.controller.signal});for await(let e of(this._connected(),o))tL(this,B,"m",es).call(this,e);if(o.controller.signal?.aborted)throw new tB;return this._addRun(tL(this,B,"m",en).call(this))}static createThreadAssistantStream(e,t,r){let s=new V;return s._run(()=>s._threadAssistantStream(e,t,{...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"stream"}})),s}static createAssistantStream(e,t,r,s){let n=new V;return n._run(()=>n._runAssistantStream(e,t,r,{...s,headers:{...s?.headers,"X-Stainless-Helper-Method":"stream"}})),n}currentEvent(){return tL(this,ee,"f")}currentRun(){return tL(this,et,"f")}currentMessageSnapshot(){return tL(this,H,"f")}currentRunStepSnapshot(){return tL(this,er,"f")}async finalRunSteps(){return await this.done(),Object.values(tL(this,K,"f"))}async finalMessages(){return await this.done(),Object.values(tL(this,q,"f"))}async finalRun(){if(await this.done(),!tL(this,G,"f"))throw Error("Final run was not received.");return tL(this,G,"f")}async _createThreadAssistantStream(e,t,r){let s=r?.signal;s&&(s.aborted&&this.controller.abort(),s.addEventListener("abort",()=>this.controller.abort()));let n={...t,stream:!0},i=await e.createAndRun(n,{...r,signal:this.controller.signal});for await(let e of(this._connected(),i))tL(this,B,"m",es).call(this,e);if(i.controller.signal?.aborted)throw new tB;return this._addRun(tL(this,B,"m",en).call(this))}async _createAssistantStream(e,t,r,s){let n=s?.signal;n&&(n.aborted&&this.controller.abort(),n.addEventListener("abort",()=>this.controller.abort()));let i={...r,stream:!0},o=await e.create(t,i,{...s,signal:this.controller.signal});for await(let e of(this._connected(),o))tL(this,B,"m",es).call(this,e);if(o.controller.signal?.aborted)throw new tB;return this._addRun(tL(this,B,"m",en).call(this))}static accumulateDelta(e,t){for(let[r,s]of Object.entries(t)){if(!e.hasOwnProperty(r)){e[r]=s;continue}let t=e[r];if(null==t||"index"===r||"type"===r){e[r]=s;continue}if("string"==typeof t&&"string"==typeof s)t+=s;else if("number"==typeof t&&"number"==typeof s)t+=s;else if(re(t)&&re(s))t=this.accumulateDelta(t,s);else if(Array.isArray(t)&&Array.isArray(s)){if(t.every(e=>"string"==typeof e||"number"==typeof e)){t.push(...s);continue}for(let e of s){if(!re(e))throw Error(`Expected array delta entry to be an object but got: ${e}`);let r=e.index;if(null==r)throw console.error(e),Error("Expected array delta entry to have an `index` property");if("number"!=typeof r)throw Error(`Expected array delta entry \`index\` property to be a number but got ${r}`);let s=t[r];null==s?t.push(e):t[r]=this.accumulateDelta(s,e)}continue}else throw Error(`Unhandled record type: ${r}, deltaValue: ${s}, accValue: ${t}`);e[r]=t}return e}_addRun(e){return e}async _threadAssistantStream(e,t,r){return await this._createThreadAssistantStream(t,e,r)}async _runAssistantStream(e,t,r,s){return await this._createAssistantStream(t,e,r,s)}async _runToolAssistantStream(e,t,r,s){return await this._createToolAssistantStream(t,e,r,s)}}V=sU,es=function(e){if(!this.ended)switch(tj(this,ee,e,"f"),tL(this,B,"m",ea).call(this,e),e.event){case"thread.created":break;case"thread.run.created":case"thread.run.queued":case"thread.run.in_progress":case"thread.run.requires_action":case"thread.run.completed":case"thread.run.incomplete":case"thread.run.failed":case"thread.run.cancelling":case"thread.run.cancelled":case"thread.run.expired":tL(this,B,"m",ed).call(this,e);break;case"thread.run.step.created":case"thread.run.step.in_progress":case"thread.run.step.delta":case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":tL(this,B,"m",eo).call(this,e);break;case"thread.message.created":case"thread.message.in_progress":case"thread.message.delta":case"thread.message.completed":case"thread.message.incomplete":tL(this,B,"m",ei).call(this,e);break;case"error":throw Error("Encountered an error event in event processing - errors should be processed earlier")}},en=function(){if(this.ended)throw new tM("stream has ended, this shouldn't happen");if(!tL(this,G,"f"))throw Error("Final run has not been received");return tL(this,G,"f")},ei=function(e){let[t,r]=tL(this,B,"m",ec).call(this,e,tL(this,H,"f"));for(let e of(tj(this,H,t,"f"),tL(this,q,"f")[t.id]=t,r)){let r=t.content[e.index];r?.type=="text"&&this._emit("textCreated",r.text)}switch(e.event){case"thread.message.created":this._emit("messageCreated",e.data);break;case"thread.message.in_progress":break;case"thread.message.delta":if(this._emit("messageDelta",e.data.delta,t),e.data.delta.content)for(let r of e.data.delta.content){if("text"==r.type&&r.text){let e=r.text,s=t.content[r.index];if(s&&"text"==s.type)this._emit("textDelta",e,s.text);else throw Error("The snapshot associated with this text delta is not text or missing")}if(r.index!=tL(this,X,"f")){if(tL(this,J,"f"))switch(tL(this,J,"f").type){case"text":this._emit("textDone",tL(this,J,"f").text,tL(this,H,"f"));break;case"image_file":this._emit("imageFileDone",tL(this,J,"f").image_file,tL(this,H,"f"))}tj(this,X,r.index,"f")}tj(this,J,t.content[r.index],"f")}break;case"thread.message.completed":case"thread.message.incomplete":if(void 0!==tL(this,X,"f")){let t=e.data.content[tL(this,X,"f")];if(t)switch(t.type){case"image_file":this._emit("imageFileDone",t.image_file,tL(this,H,"f"));break;case"text":this._emit("textDone",t.text,tL(this,H,"f"))}}tL(this,H,"f")&&this._emit("messageDone",e.data),tj(this,H,void 0,"f")}},eo=function(e){let t=tL(this,B,"m",el).call(this,e);switch(tj(this,er,t,"f"),e.event){case"thread.run.step.created":this._emit("runStepCreated",e.data);break;case"thread.run.step.delta":let r=e.data.delta;if(r.step_details&&"tool_calls"==r.step_details.type&&r.step_details.tool_calls&&"tool_calls"==t.step_details.type)for(let e of r.step_details.tool_calls)e.index==tL(this,Y,"f")?this._emit("toolCallDelta",e,t.step_details.tool_calls[e.index]):(tL(this,Q,"f")&&this._emit("toolCallDone",tL(this,Q,"f")),tj(this,Y,e.index,"f"),tj(this,Q,t.step_details.tool_calls[e.index],"f"),tL(this,Q,"f")&&this._emit("toolCallCreated",tL(this,Q,"f")));this._emit("runStepDelta",e.data.delta,t);break;case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":tj(this,er,void 0,"f"),"tool_calls"==e.data.step_details.type&&tL(this,Q,"f")&&(this._emit("toolCallDone",tL(this,Q,"f")),tj(this,Q,void 0,"f")),this._emit("runStepDone",e.data,t)}},ea=function(e){tL(this,W,"f").push(e),this._emit("event",e)},el=function(e){switch(e.event){case"thread.run.step.created":return tL(this,K,"f")[e.data.id]=e.data,e.data;case"thread.run.step.delta":let t=tL(this,K,"f")[e.data.id];if(!t)throw Error("Received a RunStepDelta before creation of a snapshot");let r=e.data;if(r.delta){let s=V.accumulateDelta(t,r.delta);tL(this,K,"f")[e.data.id]=s}return tL(this,K,"f")[e.data.id];case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":case"thread.run.step.in_progress":tL(this,K,"f")[e.data.id]=e.data}if(tL(this,K,"f")[e.data.id])return tL(this,K,"f")[e.data.id];throw Error("No snapshot available")},ec=function(e,t){let r=[];switch(e.event){case"thread.message.created":return[e.data,r];case"thread.message.delta":if(!t)throw Error("Received a delta with no existing snapshot (there should be one from message creation)");let s=e.data;if(s.delta.content)for(let e of s.delta.content)if(e.index in t.content){let r=t.content[e.index];t.content[e.index]=tL(this,B,"m",eu).call(this,e,r)}else t.content[e.index]=e,r.push(e);return[t,r];case"thread.message.in_progress":case"thread.message.completed":case"thread.message.incomplete":if(t)return[t,r];throw Error("Received thread message event with no existing snapshot")}throw Error("Tried to accumulate a non-message event")},eu=function(e,t){return V.accumulateDelta(t,e)},ed=function(e){switch(tj(this,et,e.data,"f"),e.event){case"thread.run.created":case"thread.run.queued":case"thread.run.in_progress":break;case"thread.run.requires_action":case"thread.run.cancelled":case"thread.run.failed":case"thread.run.completed":case"thread.run.expired":case"thread.run.incomplete":tj(this,G,e.data,"f"),tL(this,Q,"f")&&(this._emit("toolCallDone",tL(this,Q,"f")),tj(this,Q,void 0,"f"))}};class sF extends r6{constructor(){super(...arguments),this.steps=new sD(this._client)}create(e,t,r){let{include:s,...n}=t;return this._client.post(r7`/threads/${e}/runs`,{query:{include:s},body:n,...r,headers:sx([{"OpenAI-Beta":"assistants=v2"},r?.headers]),stream:t.stream??!1,__synthesizeEventData:!0})}retrieve(e,t,r){let{thread_id:s}=t;return this._client.get(r7`/threads/${s}/runs/${e}`,{...r,headers:sx([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}update(e,t,r){let{thread_id:s,...n}=t;return this._client.post(r7`/threads/${s}/runs/${e}`,{body:n,...r,headers:sx([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}list(e,t={},r){return this._client.getAPIList(r7`/threads/${e}/runs`,rZ,{query:t,...r,headers:sx([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}cancel(e,t,r){let{thread_id:s}=t;return this._client.post(r7`/threads/${s}/runs/${e}/cancel`,{...r,headers:sx([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}async createAndPoll(e,t,r){let s=await this.create(e,t,r);return await this.poll(s.id,{thread_id:e},r)}createAndStream(e,t,r){return sU.createAssistantStream(e,this._client.beta.threads.runs,t,r)}async poll(e,t,r){let s=sx([r?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":r?.pollIntervalMs?.toString()??void 0}]);for(;;){let{data:n,response:i}=await this.retrieve(e,t,{...r,headers:{...r?.headers,...s}}).withResponse();switch(n.status){case"queued":case"in_progress":case"cancelling":let o=5e3;if(r?.pollIntervalMs)o=r.pollIntervalMs;else{let e=i.headers.get("openai-poll-after-ms");if(e){let t=parseInt(e);isNaN(t)||(o=t)}}await rt(o);break;case"requires_action":case"incomplete":case"cancelled":case"completed":case"failed":case"expired":return n}}}stream(e,t,r){return sU.createAssistantStream(e,this._client.beta.threads.runs,t,r)}submitToolOutputs(e,t,r){let{thread_id:s,...n}=t;return this._client.post(r7`/threads/${s}/runs/${e}/submit_tool_outputs`,{body:n,...r,headers:sx([{"OpenAI-Beta":"assistants=v2"},r?.headers]),stream:t.stream??!1,__synthesizeEventData:!0})}async submitToolOutputsAndPoll(e,t,r){let s=await this.submitToolOutputs(e,t,r);return await this.poll(s.id,t,r)}submitToolOutputsStream(e,t,r){return sU.createToolAssistantStream(e,this._client.beta.threads.runs,t,r)}}sF.Steps=sD;class sM extends r6{constructor(){super(...arguments),this.runs=new sF(this._client),this.messages=new sL(this._client)}create(e={},t){return this._client.post("/threads",{body:e,...t,headers:sx([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}retrieve(e,t){return this._client.get(r7`/threads/${e}`,{...t,headers:sx([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}update(e,t,r){return this._client.post(r7`/threads/${e}`,{body:t,...r,headers:sx([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}delete(e,t){return this._client.delete(r7`/threads/${e}`,{...t,headers:sx([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}createAndRun(e,t){return this._client.post("/threads/runs",{body:e,...t,headers:sx([{"OpenAI-Beta":"assistants=v2"},t?.headers]),stream:e.stream??!1,__synthesizeEventData:!0})}async createAndRunPoll(e,t){let r=await this.createAndRun(e,t);return await this.runs.poll(r.id,{thread_id:r.thread_id},t)}createAndRunStream(e,t){return sU.createThreadAssistantStream(e,this._client.beta.threads,t)}}sM.Runs=sF,sM.Messages=sL;class sZ extends r6{constructor(){super(...arguments),this.realtime=new sR(this._client),this.chatkit=new sj(this._client),this.assistants=new sC(this._client),this.threads=new sM(this._client)}}sZ.Realtime=sR,sZ.ChatKit=sj,sZ.Assistants=sC,sZ.Threads=sM;class sB extends r6{retrieve(e,t,r){let{container_id:s}=t;return this._client.get(r7`/containers/${s}/files/${e}/content`,{...r,headers:sx([{Accept:"application/binary"},r?.headers]),__binaryResponse:!0})}}class sV extends r6{constructor(){super(...arguments),this.content=new sB(this._client)}create(e,t,r){return this._client.post(r7`/containers/${e}/files`,rX({body:t,...r},this._client))}retrieve(e,t,r){let{container_id:s}=t;return this._client.get(r7`/containers/${s}/files/${e}`,r)}list(e,t={},r){return this._client.getAPIList(r7`/containers/${e}/files`,rZ,{query:t,...r})}delete(e,t,r){let{container_id:s}=t;return this._client.delete(r7`/containers/${s}/files/${e}`,{...r,headers:sx([{Accept:"*/*"},r?.headers])})}}sV.Content=sB;class sW extends r6{constructor(){super(...arguments),this.files=new sV(this._client)}create(e,t){return this._client.post("/containers",{body:e,...t})}retrieve(e,t){return this._client.get(r7`/containers/${e}`,t)}list(e={},t){return this._client.getAPIList("/containers",rZ,{query:e,...t})}delete(e,t){return this._client.delete(r7`/containers/${e}`,{...t,headers:sx([{Accept:"*/*"},t?.headers])})}}sW.Files=sV;class sK extends r6{create(e,t,r){let{include:s,...n}=t;return this._client.post(r7`/conversations/${e}/items`,{query:{include:s},body:n,...r})}retrieve(e,t,r){let{conversation_id:s,...n}=t;return this._client.get(r7`/conversations/${s}/items/${e}`,{query:n,...r})}list(e,t={},r){return this._client.getAPIList(r7`/conversations/${e}/items`,rB,{query:t,...r})}delete(e,t,r){let{conversation_id:s}=t;return this._client.delete(r7`/conversations/${s}/items/${e}`,r)}}class sq extends r6{constructor(){super(...arguments),this.items=new sK(this._client)}create(e={},t){return this._client.post("/conversations",{body:e,...t})}retrieve(e,t){return this._client.get(r7`/conversations/${e}`,t)}update(e,t,r){return this._client.post(r7`/conversations/${e}`,{body:t,...r})}delete(e,t){return this._client.delete(r7`/conversations/${e}`,t)}}sq.Items=sK;class sH extends r6{retrieve(e,t,r){let{eval_id:s,run_id:n}=t;return this._client.get(r7`/evals/${s}/runs/${n}/output_items/${e}`,r)}list(e,t,r){let{eval_id:s,...n}=t;return this._client.getAPIList(r7`/evals/${s}/runs/${e}/output_items`,rZ,{query:n,...r})}}class sG extends r6{constructor(){super(...arguments),this.outputItems=new sH(this._client)}create(e,t,r){return this._client.post(r7`/evals/${e}/runs`,{body:t,...r})}retrieve(e,t,r){let{eval_id:s}=t;return this._client.get(r7`/evals/${s}/runs/${e}`,r)}list(e,t={},r){return this._client.getAPIList(r7`/evals/${e}/runs`,rZ,{query:t,...r})}delete(e,t,r){let{eval_id:s}=t;return this._client.delete(r7`/evals/${s}/runs/${e}`,r)}cancel(e,t,r){let{eval_id:s}=t;return this._client.post(r7`/evals/${s}/runs/${e}`,r)}}sG.OutputItems=sH;class sX extends r6{constructor(){super(...arguments),this.runs=new sG(this._client)}create(e,t){return this._client.post("/evals",{body:e,...t})}retrieve(e,t){return this._client.get(r7`/evals/${e}`,t)}update(e,t,r){return this._client.post(r7`/evals/${e}`,{body:t,...r})}list(e={},t){return this._client.getAPIList("/evals",rZ,{query:e,...t})}delete(e,t){return this._client.delete(r7`/evals/${e}`,t)}}sX.Runs=sG;class sJ extends r6{create(e,t){return this._client.post("/files",rJ({body:e,...t},this._client))}retrieve(e,t){return this._client.get(r7`/files/${e}`,t)}list(e={},t){return this._client.getAPIList("/files",rZ,{query:e,...t})}delete(e,t){return this._client.delete(r7`/files/${e}`,t)}content(e,t){return this._client.get(r7`/files/${e}/content`,{...t,headers:sx([{Accept:"application/binary"},t?.headers]),__binaryResponse:!0})}async waitForProcessing(e,{pollInterval:t=5e3,maxWait:r=18e5}={}){let s=new Set(["processed","error","deleted"]),n=Date.now(),i=await this.retrieve(e);for(;!i.status||!s.has(i.status);)if(await rt(t),i=await this.retrieve(e),Date.now()-n>r)throw new tW({message:`Giving up on waiting for file ${e} to finish processing after ${r} milliseconds.`});return i}}class sY extends r6{}class sQ extends r6{run(e,t){return this._client.post("/fine_tuning/alpha/graders/run",{body:e,...t})}validate(e,t){return this._client.post("/fine_tuning/alpha/graders/validate",{body:e,...t})}}class s0 extends r6{constructor(){super(...arguments),this.graders=new sQ(this._client)}}s0.Graders=sQ;class s1 extends r6{create(e,t,r){return this._client.getAPIList(r7`/fine_tuning/checkpoints/${e}/permissions`,rM,{body:t,method:"post",...r})}retrieve(e,t={},r){return this._client.get(r7`/fine_tuning/checkpoints/${e}/permissions`,{query:t,...r})}list(e,t={},r){return this._client.getAPIList(r7`/fine_tuning/checkpoints/${e}/permissions`,rB,{query:t,...r})}delete(e,t,r){let{fine_tuned_model_checkpoint:s}=t;return this._client.delete(r7`/fine_tuning/checkpoints/${s}/permissions/${e}`,r)}}class s2 extends r6{constructor(){super(...arguments),this.permissions=new s1(this._client)}}s2.Permissions=s1;class s5 extends r6{list(e,t={},r){return this._client.getAPIList(r7`/fine_tuning/jobs/${e}/checkpoints`,rZ,{query:t,...r})}}class s3 extends r6{constructor(){super(...arguments),this.checkpoints=new s5(this._client)}create(e,t){return this._client.post("/fine_tuning/jobs",{body:e,...t})}retrieve(e,t){return this._client.get(r7`/fine_tuning/jobs/${e}`,t)}list(e={},t){return this._client.getAPIList("/fine_tuning/jobs",rZ,{query:e,...t})}cancel(e,t){return this._client.post(r7`/fine_tuning/jobs/${e}/cancel`,t)}listEvents(e,t={},r){return this._client.getAPIList(r7`/fine_tuning/jobs/${e}/events`,rZ,{query:t,...r})}pause(e,t){return this._client.post(r7`/fine_tuning/jobs/${e}/pause`,t)}resume(e,t){return this._client.post(r7`/fine_tuning/jobs/${e}/resume`,t)}}s3.Checkpoints=s5;class s4 extends r6{constructor(){super(...arguments),this.methods=new sY(this._client),this.jobs=new s3(this._client),this.checkpoints=new s2(this._client),this.alpha=new s0(this._client)}}s4.Methods=sY,s4.Jobs=s3,s4.Checkpoints=s2,s4.Alpha=s0;class s6 extends r6{}class s9 extends r6{constructor(){super(...arguments),this.graderModels=new s6(this._client)}}s9.GraderModels=s6;class s8 extends r6{retrieve(e,t){return this._client.get(r7`/models/${e}`,t)}list(e){return this._client.getAPIList("/models",rM,e)}delete(e,t){return this._client.delete(r7`/models/${e}`,t)}}class s7 extends r6{accept(e,t,r){return this._client.post(r7`/realtime/calls/${e}/accept`,{body:t,...r,headers:sx([{Accept:"*/*"},r?.headers])})}hangup(e,t){return this._client.post(r7`/realtime/calls/${e}/hangup`,{...t,headers:sx([{Accept:"*/*"},t?.headers])})}refer(e,t,r){return this._client.post(r7`/realtime/calls/${e}/refer`,{body:t,...r,headers:sx([{Accept:"*/*"},r?.headers])})}reject(e,t={},r){return this._client.post(r7`/realtime/calls/${e}/reject`,{body:t,...r,headers:sx([{Accept:"*/*"},r?.headers])})}}class ne extends r6{create(e,t){return this._client.post("/realtime/client_secrets",{body:e,...t})}}class nt extends r6{constructor(){super(...arguments),this.clientSecrets=new ne(this._client),this.calls=new s7(this._client)}}function nr(e,t){let r=e.output.map(e=>{if("function_call"===e.type)return{...e,parsed_arguments:function(e,t){var r,s;let n=(r=e.tools??[],s=t.name,r.find(e=>"function"===e.type&&e.name===s));return{...t,...t,parsed_arguments:n?.$brand==="auto-parseable-tool"?n.$parseRaw(t.arguments):n?.strict?JSON.parse(t.arguments):null}}(t,e)};if("message"===e.type){let r=e.content.map(e=>{var r,s;return"output_text"===e.type?{...e,parsed:(r=t,s=e.text,r.text?.format?.type!=="json_schema"?null:"$parseRaw"in r.text?.format?(r.text?.format).$parseRaw(s):JSON.parse(s))}:e});return{...e,content:r}}return e}),s=Object.assign({},e,{output:r});return Object.getOwnPropertyDescriptor(e,"output_text")||ns(s),Object.defineProperty(s,"output_parsed",{enumerable:!0,get(){for(let e of s.output)if("message"===e.type){for(let t of e.content)if("output_text"===t.type&&null!==t.parsed)return t.parsed}return null}}),s}function ns(e){let t=[];for(let r of e.output)if("message"===r.type)for(let e of r.content)"output_text"===e.type&&t.push(e.text);e.output_text=t.join("")}nt.ClientSecrets=ne,nt.Calls=s7;class nn extends sc{constructor(e){super(),eh.add(this),ep.set(this,void 0),ef.set(this,void 0),em.set(this,void 0),tj(this,ep,e,"f")}static createResponse(e,t,r){let s=new nn(t);return s._run(()=>s._createOrRetrieveResponse(e,t,{...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"stream"}})),s}async _createOrRetrieveResponse(e,t,r){let s,n=r?.signal;n&&(n.aborted&&this.controller.abort(),n.addEventListener("abort",()=>this.controller.abort())),tL(this,eh,"m",eg).call(this);let i=null;for await(let n of("response_id"in t?(s=await e.responses.retrieve(t.response_id,{stream:!0},{...r,signal:this.controller.signal,stream:!0}),i=t.starting_after??null):s=await e.responses.create({...t,stream:!0},{...r,signal:this.controller.signal}),this._connected(),s))tL(this,eh,"m",ey).call(this,n,i);if(s.controller.signal?.aborted)throw new tB;return tL(this,eh,"m",eb).call(this)}[(ep=new WeakMap,ef=new WeakMap,em=new WeakMap,eh=new WeakSet,eg=function(){this.ended||tj(this,ef,void 0,"f")},ey=function(e,t){if(this.ended)return;let r=(e,r)=>{(null==t||r.sequence_number>t)&&this._emit(e,r)},s=tL(this,eh,"m",e_).call(this,e);switch(r("event",e),e.type){case"response.output_text.delta":{let t=s.output[e.output_index];if(!t)throw new tM(`missing output at index ${e.output_index}`);if("message"===t.type){let s=t.content[e.content_index];if(!s)throw new tM(`missing content at index ${e.content_index}`);if("output_text"!==s.type)throw new tM(`expected content to be 'output_text', got ${s.type}`);r("response.output_text.delta",{...e,snapshot:s.text})}break}case"response.function_call_arguments.delta":{let t=s.output[e.output_index];if(!t)throw new tM(`missing output at index ${e.output_index}`);"function_call"===t.type&&r("response.function_call_arguments.delta",{...e,snapshot:t.arguments});break}default:r(e.type,e)}},eb=function(){if(this.ended)throw new tM("stream has ended, this shouldn't happen");let e=tL(this,ef,"f");if(!e)throw new tM("request ended without sending any events");tj(this,ef,void 0,"f");let t=function(e,t){var r;return t&&(r=t,sr(r.text?.format))?nr(e,t):{...e,output_parsed:null,output:e.output.map(e=>"function_call"===e.type?{...e,parsed_arguments:null}:"message"===e.type?{...e,content:e.content.map(e=>({...e,parsed:null}))}:e)}}(e,tL(this,ep,"f"));return tj(this,em,t,"f"),t},e_=function(e){let t=tL(this,ef,"f");if(!t){if("response.created"!==e.type)throw new tM(`When snapshot hasn't been set yet, expected 'response.created' event, got ${e.type}`);return tj(this,ef,e.response,"f")}switch(e.type){case"response.output_item.added":t.output.push(e.item);break;case"response.content_part.added":{let r=t.output[e.output_index];if(!r)throw new tM(`missing output at index ${e.output_index}`);let s=r.type,n=e.part;"message"===s&&"reasoning_text"!==n.type?r.content.push(n):"reasoning"===s&&"reasoning_text"===n.type&&(r.content||(r.content=[]),r.content.push(n));break}case"response.output_text.delta":{let r=t.output[e.output_index];if(!r)throw new tM(`missing output at index ${e.output_index}`);if("message"===r.type){let t=r.content[e.content_index];if(!t)throw new tM(`missing content at index ${e.content_index}`);if("output_text"!==t.type)throw new tM(`expected content to be 'output_text', got ${t.type}`);t.text+=e.delta}break}case"response.function_call_arguments.delta":{let r=t.output[e.output_index];if(!r)throw new tM(`missing output at index ${e.output_index}`);"function_call"===r.type&&(r.arguments+=e.delta);break}case"response.reasoning_text.delta":{let r=t.output[e.output_index];if(!r)throw new tM(`missing output at index ${e.output_index}`);if("reasoning"===r.type){let t=r.content?.[e.content_index];if(!t)throw new tM(`missing content at index ${e.content_index}`);if("reasoning_text"!==t.type)throw new tM(`expected content to be 'reasoning_text', got ${t.type}`);t.text+=e.delta}break}case"response.completed":tj(this,ef,e.response,"f")}return t},Symbol.asyncIterator)](){let e=[],t=[],r=!1;return this.on("event",r=>{let s=t.shift();s?s.resolve(r):e.push(r)}),this.on("end",()=>{for(let e of(r=!0,t))e.resolve(void 0);t.length=0}),this.on("abort",e=>{for(let s of(r=!0,t))s.reject(e);t.length=0}),this.on("error",e=>{for(let s of(r=!0,t))s.reject(e);t.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:r?{value:void 0,done:!0}:new Promise((e,r)=>t.push({resolve:e,reject:r})).then(e=>e?{value:e,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}async finalResponse(){await this.done();let e=tL(this,em,"f");if(!e)throw new tM("stream ended without producing a ChatCompletion");return e}}class ni extends r6{list(e,t={},r){return this._client.getAPIList(r7`/responses/${e}/input_items`,rZ,{query:t,...r})}}class no extends r6{count(e={},t){return this._client.post("/responses/input_tokens",{body:e,...t})}}class na extends r6{constructor(){super(...arguments),this.inputItems=new ni(this._client),this.inputTokens=new no(this._client)}create(e,t){return this._client.post("/responses",{body:e,...t,stream:e.stream??!1})._thenUnwrap(e=>("object"in e&&"response"===e.object&&ns(e),e))}retrieve(e,t={},r){return this._client.get(r7`/responses/${e}`,{query:t,...r,stream:t?.stream??!1})._thenUnwrap(e=>("object"in e&&"response"===e.object&&ns(e),e))}delete(e,t){return this._client.delete(r7`/responses/${e}`,{...t,headers:sx([{Accept:"*/*"},t?.headers])})}parse(e,t){return this._client.responses.create(e,t)._thenUnwrap(t=>nr(t,e))}stream(e,t){return nn.createResponse(this._client,e,t)}cancel(e,t){return this._client.post(r7`/responses/${e}/cancel`,t)}compact(e,t){return this._client.post("/responses/compact",{body:e,...t})}}na.InputItems=ni,na.InputTokens=no;class nl extends r6{retrieve(e,t){return this._client.get(r7`/skills/${e}/content`,{...t,headers:sx([{Accept:"application/binary"},t?.headers]),__binaryResponse:!0})}}class nc extends r6{retrieve(e,t,r){let{skill_id:s}=t;return this._client.get(r7`/skills/${s}/versions/${e}/content`,{...r,headers:sx([{Accept:"application/binary"},r?.headers]),__binaryResponse:!0})}}class nu extends r6{constructor(){super(...arguments),this.content=new nc(this._client)}create(e,t={},r){return this._client.post(r7`/skills/${e}/versions`,rX({body:t,...r},this._client))}retrieve(e,t,r){let{skill_id:s}=t;return this._client.get(r7`/skills/${s}/versions/${e}`,r)}list(e,t={},r){return this._client.getAPIList(r7`/skills/${e}/versions`,rZ,{query:t,...r})}delete(e,t,r){let{skill_id:s}=t;return this._client.delete(r7`/skills/${s}/versions/${e}`,r)}}nu.Content=nc;class nd extends r6{constructor(){super(...arguments),this.content=new nl(this._client),this.versions=new nu(this._client)}create(e={},t){return this._client.post("/skills",rX({body:e,...t},this._client))}retrieve(e,t){return this._client.get(r7`/skills/${e}`,t)}update(e,t,r){return this._client.post(r7`/skills/${e}`,{body:t,...r})}list(e={},t){return this._client.getAPIList("/skills",rZ,{query:e,...t})}delete(e,t){return this._client.delete(r7`/skills/${e}`,t)}}nd.Content=nl,nd.Versions=nu;class nh extends r6{create(e,t,r){return this._client.post(r7`/uploads/${e}/parts`,rJ({body:t,...r},this._client))}}class np extends r6{constructor(){super(...arguments),this.parts=new nh(this._client)}create(e,t){return this._client.post("/uploads",{body:e,...t})}cancel(e,t){return this._client.post(r7`/uploads/${e}/cancel`,t)}complete(e,t,r){return this._client.post(r7`/uploads/${e}/complete`,{body:t,...r})}}np.Parts=nh;let nf=async e=>{let t=await Promise.allSettled(e),r=t.filter(e=>"rejected"===e.status);if(r.length){for(let e of r)console.error(e.reason);throw Error(`${r.length} promise(s) failed - see the above errors`)}let s=[];for(let e of t)"fulfilled"===e.status&&s.push(e.value);return s};class nm extends r6{create(e,t,r){return this._client.post(r7`/vector_stores/${e}/file_batches`,{body:t,...r,headers:sx([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}retrieve(e,t,r){let{vector_store_id:s}=t;return this._client.get(r7`/vector_stores/${s}/file_batches/${e}`,{...r,headers:sx([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}cancel(e,t,r){let{vector_store_id:s}=t;return this._client.post(r7`/vector_stores/${s}/file_batches/${e}/cancel`,{...r,headers:sx([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}async createAndPoll(e,t,r){let s=await this.create(e,t);return await this.poll(e,s.id,r)}listFiles(e,t,r){let{vector_store_id:s,...n}=t;return this._client.getAPIList(r7`/vector_stores/${s}/file_batches/${e}/files`,rZ,{query:n,...r,headers:sx([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}async poll(e,t,r){let s=sx([r?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":r?.pollIntervalMs?.toString()??void 0}]);for(;;){let{data:n,response:i}=await this.retrieve(t,{vector_store_id:e},{...r,headers:s}).withResponse();switch(n.status){case"in_progress":let o=5e3;if(r?.pollIntervalMs)o=r.pollIntervalMs;else{let e=i.headers.get("openai-poll-after-ms");if(e){let t=parseInt(e);isNaN(t)||(o=t)}}await rt(o);break;case"failed":case"cancelled":case"completed":return n}}}async uploadAndPoll(e,{files:t,fileIds:r=[]},s){if(null==t||0==t.length)throw Error("No `files` provided to process. If you've already uploaded files you should use `.createAndPoll()` instead");let n=Math.min(s?.maxConcurrency??5,t.length),i=this._client,o=t.values(),a=[...r];async function l(e){for(let t of e){let e=await i.files.create({file:t,purpose:"assistants"},s);a.push(e.id)}}let c=Array(n).fill(o).map(l);return await nf(c),await this.createAndPoll(e,{file_ids:a})}}class ng extends r6{create(e,t,r){return this._client.post(r7`/vector_stores/${e}/files`,{body:t,...r,headers:sx([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}retrieve(e,t,r){let{vector_store_id:s}=t;return this._client.get(r7`/vector_stores/${s}/files/${e}`,{...r,headers:sx([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}update(e,t,r){let{vector_store_id:s,...n}=t;return this._client.post(r7`/vector_stores/${s}/files/${e}`,{body:n,...r,headers:sx([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}list(e,t={},r){return this._client.getAPIList(r7`/vector_stores/${e}/files`,rZ,{query:t,...r,headers:sx([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}delete(e,t,r){let{vector_store_id:s}=t;return this._client.delete(r7`/vector_stores/${s}/files/${e}`,{...r,headers:sx([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}async createAndPoll(e,t,r){let s=await this.create(e,t,r);return await this.poll(e,s.id,r)}async poll(e,t,r){let s=sx([r?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":r?.pollIntervalMs?.toString()??void 0}]);for(;;){let n=await this.retrieve(t,{vector_store_id:e},{...r,headers:s}).withResponse(),i=n.data;switch(i.status){case"in_progress":let o=5e3;if(r?.pollIntervalMs)o=r.pollIntervalMs;else{let e=n.response.headers.get("openai-poll-after-ms");if(e){let t=parseInt(e);isNaN(t)||(o=t)}}await rt(o);break;case"failed":case"completed":return i}}}async upload(e,t,r){let s=await this._client.files.create({file:t,purpose:"assistants"},r);return this.create(e,{file_id:s.id},r)}async uploadAndPoll(e,t,r){let s=await this.upload(e,t,r);return await this.poll(e,s.id,r)}content(e,t,r){let{vector_store_id:s}=t;return this._client.getAPIList(r7`/vector_stores/${s}/files/${e}/content`,rM,{...r,headers:sx([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}}class ny extends r6{constructor(){super(...arguments),this.files=new ng(this._client),this.fileBatches=new nm(this._client)}create(e,t){return this._client.post("/vector_stores",{body:e,...t,headers:sx([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}retrieve(e,t){return this._client.get(r7`/vector_stores/${e}`,{...t,headers:sx([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}update(e,t,r){return this._client.post(r7`/vector_stores/${e}`,{body:t,...r,headers:sx([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}list(e={},t){return this._client.getAPIList("/vector_stores",rZ,{query:e,...t,headers:sx([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}delete(e,t){return this._client.delete(r7`/vector_stores/${e}`,{...t,headers:sx([{"OpenAI-Beta":"assistants=v2"},t?.headers])})}search(e,t,r){return this._client.getAPIList(r7`/vector_stores/${e}/search`,rM,{body:t,method:"post",...r,headers:sx([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}}ny.Files=ng,ny.FileBatches=nm;class nb extends r6{create(e,t){return this._client.post("/videos",rJ({body:e,...t},this._client))}retrieve(e,t){return this._client.get(r7`/videos/${e}`,t)}list(e={},t){return this._client.getAPIList("/videos",rB,{query:e,...t})}delete(e,t){return this._client.delete(r7`/videos/${e}`,t)}createCharacter(e,t){return this._client.post("/videos/characters",rJ({body:e,...t},this._client))}downloadContent(e,t={},r){return this._client.get(r7`/videos/${e}/content`,{query:t,...r,headers:sx([{Accept:"application/binary"},r?.headers]),__binaryResponse:!0})}edit(e,t){return this._client.post("/videos/edits",rJ({body:e,...t},this._client))}extend(e,t){return this._client.post("/videos/extensions",rJ({body:e,...t},this._client))}getCharacter(e,t){return this._client.get(r7`/videos/characters/${e}`,t)}remix(e,t,r){return this._client.post(r7`/videos/${e}/remix`,rX({body:t,...r},this._client))}}class n_ extends r6{constructor(){super(...arguments),ew.add(this)}async unwrap(e,t,r=this._client.webhookSecret,s=300){return await this.verifySignature(e,t,r,s),JSON.parse(e)}async verifySignature(e,t,r=this._client.webhookSecret,s=300){if("u"<typeof crypto||"function"!=typeof crypto.subtle.importKey||"function"!=typeof crypto.subtle.verify)throw Error("Webhook signature verification is only supported when the `crypto` global is defined");tL(this,ew,"m",ev).call(this,r);let n=sx([t]).values,i=tL(this,ew,"m",eI).call(this,n,"webhook-signature"),o=tL(this,ew,"m",eI).call(this,n,"webhook-timestamp"),a=tL(this,ew,"m",eI).call(this,n,"webhook-id"),l=parseInt(o,10);if(isNaN(l))throw new t2("Invalid webhook timestamp format");let c=Math.floor(Date.now()/1e3);if(c-l>s)throw new t2("Webhook timestamp is too old");if(l>c+s)throw new t2("Webhook timestamp is too new");let u=i.split(" ").map(e=>e.startsWith("v1,")?e.substring(3):e),d=r.startsWith("whsec_")?Buffer.from(r.replace("whsec_",""),"base64"):Buffer.from(r,"utf-8"),h=a?`${a}.${o}.${e}`:`${o}.${e}`,p=await crypto.subtle.importKey("raw",d,{name:"HMAC",hash:"SHA-256"},!1,["verify"]);for(let e of u)try{let t=Buffer.from(e,"base64");if(await crypto.subtle.verify("HMAC",p,t,new TextEncoder().encode(h)))return}catch{continue}throw new t2("The given webhook signature does not match the expected signature")}}ew=new WeakSet,ev=function(e){if("string"!=typeof e||0===e.length)throw Error("The webhook secret must either be set using the env var, OPENAI_WEBHOOK_SECRET, on the client class, OpenAI({ webhookSecret: '123' }), or passed to this function")},eI=function(e,t){if(!e)throw Error("Headers are required");let r=e.get(t);if(null==r)throw Error(`Missing required header: ${t}`);return r};class nw extends r6{create(e,t){return this._client.post("/completions",{body:e,...t,stream:e.stream??!1})}}class nv extends r6{create(e,t){let r=!!e.encoding_format,s=r?e.encoding_format:"base64";r&&rC(this._client).debug("embeddings/user defined encoding_format:",e.encoding_format);let n=this._client.post("/embeddings",{body:{...e,encoding_format:s},...t});return r?n:(rC(this._client).debug("embeddings/decoding base64 embeddings from base64"),n._thenUnwrap(e=>(e&&e.data&&e.data.forEach(e=>{let t=e.embedding;e.embedding=(e=>{if("u">typeof Buffer){let t=Buffer.from(e,"base64");return Array.from(new Float32Array(t.buffer,t.byteOffset,t.length/Float32Array.BYTES_PER_ELEMENT))}{let t=atob(e),r=t.length,s=new Uint8Array(r);for(let e=0;e<r;e++)s[e]=t.charCodeAt(e);return Array.from(new Float32Array(s.buffer))}})(t)}),e)))}}class nI extends r6{createVariation(e,t){return this._client.post("/images/variations",rJ({body:e,...t},this._client))}edit(e,t){return this._client.post("/images/edits",rJ({body:e,...t,stream:e.stream??!1},this._client))}generate(e,t){return this._client.post("/images/generations",{body:e,...t,stream:e.stream??!1})}}class nk extends r6{create(e,t){return this._client.post("/moderations",{body:e,...t})}}let nx=e=>void 0!==globalThis.process?globalThis.process.env?.[e]?.trim()||void 0:void 0!==globalThis.Deno&&globalThis.Deno.env?.get?.(e)?.trim()||void 0,nT="workload-identity-auth";class nE{constructor({baseURL:e=nx("OPENAI_BASE_URL"),apiKey:t=nx("OPENAI_API_KEY"),organization:r=nx("OPENAI_ORG_ID")??null,project:s=nx("OPENAI_PROJECT_ID")??null,webhookSecret:n=nx("OPENAI_WEBHOOK_SECRET")??null,workloadIdentity:i,...o}={}){if(ek.add(this),eT.set(this,void 0),this.completions=new nw(this),this.chat=new sI(this),this.embeddings=new nv(this),this.files=new sJ(this),this.images=new nI(this),this.audio=new sA(this),this.moderations=new nk(this),this.models=new s8(this),this.fineTuning=new s4(this),this.graders=new s9(this),this.vectorStores=new ny(this),this.webhooks=new n_(this),this.beta=new sZ(this),this.batches=new sS(this),this.uploads=new np(this),this.responses=new na(this),this.realtime=new nt(this),this.conversations=new sq(this),this.evals=new sX(this),this.containers=new sW(this),this.skills=new nd(this),this.videos=new nb(this),i){if(t&&t!==nT)throw new tM("The `apiKey` and `workloadIdentity` arguments are mutually exclusive; only one can be passed at a time.");t=nT}else if(void 0===t)throw new tM("Missing credentials. Please pass an `apiKey`, `workloadIdentity`, or set the `OPENAI_API_KEY` environment variable.");const a={apiKey:t,organization:r,project:s,webhookSecret:n,workloadIdentity:i,...o,baseURL:e||"https://api.openai.com/v1"};a.dangerouslyAllowBrowser,this.baseURL=a.baseURL,this.timeout=a.timeout??ex.DEFAULT_TIMEOUT,this.logger=a.logger??console;const l="warn";this.logLevel=l,this.logLevel=rT(a.logLevel,"ClientOptions.logLevel",this)??rT(nx("OPENAI_LOG"),"process.env['OPENAI_LOG']",this)??l,this.fetchOptions=a.fetchOptions,this.maxRetries=a.maxRetries??2,this.fetch=a.fetch??ri(),tj(this,eT,ru,"f"),this._options=a,i&&(this._workloadIdentityAuth=new rW(i,this.fetch)),this.apiKey="string"==typeof t?t:"Missing Key",this.organization=r,this.project=s,this.webhookSecret=n}withOptions(e){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,workloadIdentity:this._options.workloadIdentity,organization:this.organization,project:this.project,webhookSecret:this.webhookSecret,...e})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:t}){}async authHeaders(e){return sx([{Authorization:`Bearer ${this.apiKey}`}])}stringifyQuery(e){return function(e,t={}){let r,s=e,n=function(e=r_){let t;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.encodeDotInKeys&&"boolean"!=typeof e.encodeDotInKeys)throw TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw TypeError("Encoder has to be a function.");let r=e.charset||r_.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let s=rd;if(void 0!==e.format){if(!rf(rp,e.format))throw TypeError("Unknown format option provided.");s=e.format}let n=rp[s],i=r_.filter;if(("function"==typeof e.filter||t6(e.filter))&&(i=e.filter),t=e.arrayFormat&&e.arrayFormat in ry?e.arrayFormat:"indices"in e?e.indices?"indices":"repeat":r_.arrayFormat,"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw TypeError("`commaRoundTrip` must be a boolean, or absent");let o=void 0===e.allowDots?!0==!!e.encodeDotInKeys||r_.allowDots:!!e.allowDots;return{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:r_.addQueryPrefix,allowDots:o,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:r_.allowEmptyArrays,arrayFormat:t,charset:r,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:r_.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:void 0===e.delimiter?r_.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:r_.encode,encodeDotInKeys:"boolean"==typeof e.encodeDotInKeys?e.encodeDotInKeys:r_.encodeDotInKeys,encoder:"function"==typeof e.encoder?e.encoder:r_.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:r_.encodeValuesOnly,filter:i,format:s,formatter:n,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:r_.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:r_.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:r_.strictNullHandling}}(t);"function"==typeof n.filter?s=(0,n.filter)("",s):t6(n.filter)&&(r=n.filter);let i=[];if("object"!=typeof s||null===s)return"";let o=ry[n.arrayFormat],a="comma"===o&&n.commaRoundTrip;r||(r=Object.keys(s)),n.sort&&r.sort(n.sort);let l=new WeakMap;for(let e=0;e<r.length;++e){let t=r[e];n.skipNulls&&null===s[t]||rb(i,function e(t,r,s,n,i,o,a,l,c,u,d,h,p,f,m,g,y,b){var _,w;let v,I=t,k=b,x=0,T=!1;for(;void 0!==(k=k.get(rw))&&!T;){let e=k.get(t);if(x+=1,void 0!==e)if(e===x)throw RangeError("Cyclic object value");else T=!0;void 0===k.get(rw)&&(x=0)}if("function"==typeof u?I=u(r,I):I instanceof Date?I=p?.(I):"comma"===s&&t6(I)&&(I=rg(I,function(e){return e instanceof Date?p?.(e):e})),null===I){if(o)return c&&!g?c(r,r_.encoder,y,"key",f):r;I=""}if("string"==typeof(_=I)||"number"==typeof _||"boolean"==typeof _||"symbol"==typeof _||"bigint"==typeof _||(w=I)&&"object"==typeof w&&w.constructor&&w.constructor.isBuffer&&w.constructor.isBuffer(w)){if(c){let e=g?r:c(r,r_.encoder,y,"key",f);return[m?.(e)+"="+m?.(c(I,r_.encoder,y,"value",f))]}return[m?.(r)+"="+m?.(String(I))]}let E=[];if(void 0===I)return E;if("comma"===s&&t6(I))g&&c&&(I=rg(I,c)),v=[{value:I.length>0?I.join(",")||null:void 0}];else if(t6(u))v=u;else{let e=Object.keys(I);v=d?e.sort(d):e}let z=l?String(r).replace(/\./g,"%2E"):String(r),A=n&&t6(I)&&1===I.length?z+"[]":z;if(i&&t6(I)&&0===I.length)return A+"[]";for(let r=0;r<v.length;++r){let _=v[r],w="object"==typeof _&&void 0!==_.value?_.value:I[_];if(a&&null===w)continue;let k=h&&l?_.replace(/\./g,"%2E"):_,T=t6(I)?"function"==typeof s?s(A,k):A:A+(h?"."+k:"["+k+"]");b.set(t,x);let z=new WeakMap;z.set(rw,b),rb(E,e(w,T,s,n,i,o,a,l,"comma"===s&&g&&t6(I)?null:c,u,d,h,p,f,m,g,y,z))}return E}(s[t],t,o,a,n.allowEmptyArrays,n.strictNullHandling,n.skipNulls,n.encodeDotInKeys,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,l))}let c=i.join(n.delimiter),u=!0===n.addQueryPrefix?"?":"";return n.charsetSentinel&&("iso-8859-1"===n.charset?u+="utf8=%26%2310003%3B&":u+="utf8=%E2%9C%93&"),c.length>0?u+c:""}(e,{arrayFormat:"brackets"})}getUserAgent(){return`${this.constructor.name}/JS ${rr}`}defaultIdempotencyKey(){return`stainless-node-retry-${tD()}`}makeStatusError(e,t,r,s){return tZ.generate(e,t,r,s)}async _callApiKey(){let e,t=this._options.apiKey;if("function"!=typeof t)return!1;try{e=await t()}catch(e){if(e instanceof tM)throw e;throw new tM(`Failed to get token from 'apiKey' function: ${e.message}`,{cause:e})}if("string"!=typeof e||!e)throw new tM(`Expected 'apiKey' function argument to return a string but it returned ${e}`);return this.apiKey=e,!0}buildURL(e,t,r){let s=!tL(this,ek,"m",eE).call(this)&&r||this.baseURL,n=new URL(t4.test(e)?e:s+(s.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),i=this.defaultQuery(),o=Object.fromEntries(n.searchParams);return t7(i)&&t7(o)||(t={...o,...i,...t}),"object"==typeof t&&t&&!Array.isArray(t)&&(n.search=this.stringifyQuery(t)),n.toString()}async prepareOptions(e){await this._callApiKey()}async prepareRequest(e,{url:t,options:r}){}get(e,t){return this.methodRequest("get",e,t)}post(e,t){return this.methodRequest("post",e,t)}patch(e,t){return this.methodRequest("patch",e,t)}put(e,t){return this.methodRequest("put",e,t)}delete(e,t){return this.methodRequest("delete",e,t)}methodRequest(e,t,r){return this.request(Promise.resolve(r).then(r=>({method:e,path:t,...r})))}request(e,t=null){return new rD(this,this.makeRequest(e,t,void 0))}async makeRequest(e,t,r){let s=await e,n=s.maxRetries??this.maxRetries;null==t&&(t=n),await this.prepareOptions(s);let{req:i,url:o,timeout:a}=await this.buildRequest(s,{retryCount:n-t});await this.prepareRequest(i,{url:o,options:s});let l="log_"+(0x1000000*Math.random()|0).toString(16).padStart(6,"0"),c=void 0===r?"":`, retryOf: ${r}`,u=Date.now();if(rC(this).debug(`[${l}] sending request`,rO({retryOfRequestLogID:r,method:s.method,url:o,options:s,headers:i.headers})),s.signal?.aborted)throw new tB;let d=new AbortController,h=await this.fetchWithAuth(o,i,a,d).catch(tF),p=Date.now();if(h instanceof globalThis.Error){let e=`retrying, ${t} attempts remaining`;if(s.signal?.aborted)throw new tB;let n=tU(h)||/timed? ?out/i.test(String(h)+("cause"in h?String(h.cause):""));if(t)return rC(this).info(`[${l}] connection ${n?"timed out":"failed"} - ${e}`),rC(this).debug(`[${l}] connection ${n?"timed out":"failed"} (${e})`,rO({retryOfRequestLogID:r,url:o,durationMs:p-u,message:h.message})),this.retryRequest(s,t,r??l);if(rC(this).info(`[${l}] connection ${n?"timed out":"failed"} - error; no more retries left`),rC(this).debug(`[${l}] connection ${n?"timed out":"failed"} (error; no more retries left)`,rO({retryOfRequestLogID:r,url:o,durationMs:p-u,message:h.message})),h instanceof t5||h instanceof t3)throw h;if(n)throw new tW;throw new tV({cause:h})}let f=[...h.headers.entries()].filter(([e])=>"x-request-id"===e).map(([e,t])=>", "+e+": "+JSON.stringify(t)).join(""),m=`[${l}${c}${f}] ${i.method} ${o} ${h.ok?"succeeded":"failed"} with status ${h.status} in ${p-u}ms`;if(!h.ok){if(401===h.status&&this._workloadIdentityAuth&&!s.__metadata?.hasStreamingBody&&!s.__metadata?.workloadIdentityTokenRefreshed)return await rc(h.body),this._workloadIdentityAuth.invalidateToken(),this.makeRequest({...s,__metadata:{...s.__metadata,workloadIdentityTokenRefreshed:!0}},t,r??l);let e=await this.shouldRetry(h);if(t&&e){let e=`retrying, ${t} attempts remaining`;return await rc(h.body),rC(this).info(`${m} - ${e}`),rC(this).debug(`[${l}] response error (${e})`,rO({retryOfRequestLogID:r,url:h.url,status:h.status,headers:h.headers,durationMs:p-u})),this.retryRequest(s,t,r??l,h.headers)}let n=e?"error; no more retries left":"error; not retryable";rC(this).info(`${m} - ${n}`);let i=await h.text().catch(e=>tF(e).message),o=(e=>{try{return JSON.parse(e)}catch(e){return}})(i),a=o?void 0:i;throw rC(this).debug(`[${l}] response error (${n})`,rO({retryOfRequestLogID:r,url:h.url,status:h.status,headers:h.headers,message:a,durationMs:Date.now()-u})),this.makeStatusError(h.status,o,a,h.headers)}return rC(this).info(m),rC(this).debug(`[${l}] response start`,rO({retryOfRequestLogID:r,url:h.url,status:h.status,headers:h.headers,durationMs:p-u})),{response:h,options:s,controller:d,requestLogID:l,retryOfRequestLogID:r,startTime:u}}getAPIList(e,t,r){return this.requestAPIList(t,r&&"then"in r?r.then(t=>({method:"get",path:e,...t})):{method:"get",path:e,...r})}requestAPIList(e,t){return new rF(this,this.makeRequest(t,null,void 0),e)}async fetchWithAuth(e,t,r,s){if(this._workloadIdentityAuth){let e=t.headers,r=e.get("Authorization");if(!r||r===`Bearer ${nT}`){let t=await this._workloadIdentityAuth.getToken();e.set("Authorization",`Bearer ${t}`)}}return await this.fetchWithTimeout(e,t,r,s)}async fetchWithTimeout(e,t,r,s){let{signal:n,method:i,...o}=t||{},a=this._makeAbort(s);n&&n.addEventListener("abort",a,{once:!0});let l=setTimeout(a,r),c=globalThis.ReadableStream&&o.body instanceof globalThis.ReadableStream||"object"==typeof o.body&&null!==o.body&&Symbol.asyncIterator in o.body,u={signal:s.signal,...c?{duplex:"half"}:{},method:"GET",...o};i&&(u.method=i.toUpperCase());try{return await this.fetch.call(void 0,e,u)}finally{clearTimeout(l)}}async shouldRetry(e){let t=e.headers.get("x-should-retry");return"true"===t||"false"!==t&&(408===e.status||409===e.status||429===e.status||!!(e.status>=500))}async retryRequest(e,t,r,s){let n,i=s?.get("retry-after-ms");if(i){let e=parseFloat(i);Number.isNaN(e)||(n=e)}let o=s?.get("retry-after");if(o&&!n){let e=parseFloat(o);n=Number.isNaN(e)?Date.parse(o)-Date.now():1e3*e}if(void 0===n){let r=e.maxRetries??this.maxRetries;n=this.calculateDefaultRetryTimeoutMillis(t,r)}return await rt(n),this.makeRequest(e,t-1,r)}calculateDefaultRetryTimeoutMillis(e,t){return Math.min(.5*Math.pow(2,t-e),8)*(1-.25*Math.random())*1e3}async buildRequest(e,{retryCount:t=0}={}){let r={...e},{method:s,path:n,query:i,defaultBaseURL:o}=r,a=this.buildURL(n,i,o);"timeout"in r&&((e,t)=>{if("number"!=typeof t||!Number.isInteger(t))throw new tM(`${e} must be an integer`);if(t<0)throw new tM(`${e} must be a positive integer`)})("timeout",r.timeout),r.timeout=r.timeout??this.timeout;let{bodyHeaders:l,body:c,isStreamingBody:u}=this.buildBody({options:r});u&&(e.__metadata={...e.__metadata,hasStreamingBody:!0});let d=await this.buildHeaders({options:e,method:s,bodyHeaders:l,retryCount:t});return{req:{method:s,headers:d,...r.signal&&{signal:r.signal},...globalThis.ReadableStream&&c instanceof globalThis.ReadableStream&&{duplex:"half"},...c&&{body:c},...this.fetchOptions??{},...r.fetchOptions??{}},url:a,timeout:r.timeout}}async buildHeaders({options:e,method:r,bodyHeaders:s,retryCount:n}){let i={};this.idempotencyHeader&&"get"!==r&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),i[this.idempotencyHeader]=e.idempotencyKey);let o=sx([i,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(n),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...t??(t=(()=>{let e="u">typeof Deno&&null!=Deno.build?"deno":"u">typeof EdgeRuntime?"edge":"[object process]"===Object.prototype.toString.call(void 0!==globalThis.process?globalThis.process:0)?"node":"unknown";if("deno"===e)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":rr,"X-Stainless-OS":rn(Deno.build.os),"X-Stainless-Arch":rs(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":"string"==typeof Deno.version?Deno.version:Deno.version?.deno??"unknown"};if("u">typeof EdgeRuntime)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":rr,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if("node"===e)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":rr,"X-Stainless-OS":rn(globalThis.process.platform??"unknown"),"X-Stainless-Arch":rs(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let t=function(){if("u"<typeof navigator||!navigator)return null;for(let{key:e,pattern:t}of[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}]){let r=t.exec(navigator.userAgent);if(r){let t=r[1]||0,s=r[2]||0,n=r[3]||0;return{browser:e,version:`${t}.${s}.${n}`}}}return null}();return t?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":rr,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":rr,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}})()),"OpenAI-Organization":this.organization,"OpenAI-Project":this.project},await this.authHeaders(e),this._options.defaultHeaders,s,e.headers]);return this.validateHeaders(o),o.values}_makeAbort(e){return()=>e.abort()}buildBody({options:{body:e,headers:t}}){if(!e)return{bodyHeaders:void 0,body:void 0,isStreamingBody:!1};let r=sx([t]),s=void 0!==globalThis.ReadableStream&&e instanceof globalThis.ReadableStream,n=!s&&("string"==typeof e||e instanceof ArrayBuffer||ArrayBuffer.isView(e)||void 0!==globalThis.Blob&&e instanceof globalThis.Blob||e instanceof URLSearchParams||e instanceof FormData);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||"string"==typeof e&&r.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||s?{bodyHeaders:void 0,body:e,isStreamingBody:!n}:"object"==typeof e&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&"function"==typeof e.next)?{bodyHeaders:void 0,body:ra(e),isStreamingBody:!0}:"object"==typeof e&&"application/x-www-form-urlencoded"===r.values.get("content-type")?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(e),isStreamingBody:!1}:{...tL(this,eT,"f").call(this,{body:e,headers:r}),isStreamingBody:!1}}}ex=nE,eT=new WeakMap,ek=new WeakSet,eE=function(){return"https://api.openai.com/v1"!==this.baseURL},nE.OpenAI=ex,nE.DEFAULT_TIMEOUT=6e5,nE.OpenAIError=tM,nE.APIError=tZ,nE.APIConnectionError=tV,nE.APIConnectionTimeoutError=tW,nE.APIUserAbortError=tB,nE.NotFoundError=tG,nE.ConflictError=tX,nE.RateLimitError=tY,nE.BadRequestError=tK,nE.AuthenticationError=tq,nE.InternalServerError=tQ,nE.PermissionDeniedError=tH,nE.UnprocessableEntityError=tJ,nE.InvalidWebhookSignatureError=t2,nE.toFile=r3,nE.Completions=nw,nE.Chat=sI,nE.Embeddings=nv,nE.Files=sJ,nE.Images=nI,nE.Audio=sA,nE.Moderations=nk,nE.Models=s8,nE.FineTuning=s4,nE.Graders=s9,nE.VectorStores=ny,nE.Webhooks=n_,nE.Beta=sZ,nE.Batches=sS,nE.Uploads=np,nE.Responses=na,nE.Realtime=nt,nE.Conversations=sq,nE.Evals=sX,nE.Containers=sW,nE.Skills=nd,nE.Videos=nb;var nz=e.i(348680),nA=class{fileOptions;constructor(e,t={}){this.client=e,this.fileOptions=t,tr.instrument(this,"Files")}async upload({file:e,toolSlug:t,toolkitSlug:r}){return await tE(e,{toolSlug:t,toolkitSlug:r,client:this.client,sensitiveFileUploadProtection:this.fileOptions.sensitiveFileUploadProtection,fileUploadPathDenySegments:this.fileOptions.fileUploadPathDenySegments})}async download({toolSlug:e,s3Url:t,mimeType:r}){return await tz({toolSlug:e,s3Url:t,mimeType:r,fileDownloadDir:this.fileOptions.fileDownloadDir})}},nS=e.i(117958);let nC=Symbol("Original index");function nO(e,t){let r;if(0===e.allOf.length)return eO.z.never();if(1===e.allOf.length){let r=e.allOf[0];return nH(r,{...t,path:[...t.path,"allOf",r[nC]]})}let[s,n]=[(r=(e=>{let t=[];for(let r=0;r<e.length;r++){let s=e[r];if("boolean"==typeof s)t.push(s?{[nC]:r}:{[nC]:r,not:{}});else{if(nC in s)return e;t.push({...s,[nC]:r})}}return t})(e.allOf)).slice(0,r.length/2),r.slice(r.length/2)];return eO.z.intersection(nO({allOf:s},t),nO({allOf:n},t))}let nP=(e,t)=>e.anyOf.length?1===e.anyOf.length?nH(e.anyOf[0],{...t,path:[...t.path,"anyOf",0]}):eO.z.union(e.anyOf.map((e,r)=>nH(e,{...t,path:[...t.path,"anyOf",r]}))):eO.z.any();function nR(e,t,r,s){let n=t[r];return void 0!==n?s(e,n,t.errorMessage?.[r]):e}let n$=e=>"object"===e.type||!e.type&&(void 0!==e.properties||void 0!==e.additionalProperties||void 0!==e.patternProperties),nN=e=>"array"===e.type,nj=e=>void 0!==e.anyOf,nL=e=>void 0!==e.allOf,nD=e=>void 0!==e.enum,nU=e=>!0===e.nullable,nF=e=>Array.isArray(e.type),nM=e=>void 0!==e.not,nZ=e=>void 0!==e.const,nB=(e,t)=>e.type===t,nV=e=>!!("if"in e&&e.if&&"then"in e&&"else"in e&&e.then&&e.else),nW=e=>void 0!==e.oneOf,nK=(e,...t)=>Object.keys(e).reduce((r,s)=>(t.includes(s)||(r[s]=e[s]),r),{}),nq=(e,t)=>e.oneOf.length?1===e.oneOf.length?nH(e.oneOf[0],{...t,path:[...t.path,"oneOf",0]}):eO.z.any().superRefine((r,s)=>{let n=e.oneOf.map((e,r)=>nH(e,{...t,path:[...t.path,"oneOf",r]})),i=n.reduce((e,t)=>{let s;return(s=t.safeParse(r)).error?[...e,s.error]:e},[]);n.length-i.length!=1&&s.addIssue({path:s.path,code:"invalid_union",unionErrors:i,message:"Invalid input: Should pass single schema"})}):eO.z.any(),nH=(e,t={seen:new Map,path:[]},r)=>{if("object"!=typeof e)return e?nS.any():nS.never();if(t.parserOverride){let r=t.parserOverride(e,t);if(r instanceof nS.ZodType)return r}let s=t.seen.get(e);if(s){if(void 0!==s.r)return s.r;if(void 0===t.depth||s.n>=t.depth)return nS.any();s.n+=1}else s={r:void 0,n:0},t.seen.set(e,s);let n=((e,t)=>{if(nU(e)){let r,s;return s=nH((r=null===e.default)?nK(nK(e,"nullable"),"default"):nK(e,"nullable"),t,!0).nullable(),r?s.default(null):s}if(n$(e))return function(e,t){let r,s=Object.keys(e.patternProperties??{}).length>0,n="object"===e.type?e:{...e,type:"object"},i=function(e,t){if(!e.properties)return nS.object({});let r=Object.keys(e.properties);if(0===r.length)return nS.object({});let s={};for(let n of r){let r=e.properties[n],i=nH(r,{...t,path:[...t.path,"properties",n]}),o=!!Array.isArray(e.required)&&e.required.includes(n);if(!o&&r&&"object"==typeof r&&"default"in r)if(null===r.default){let e=r.anyOf&&Array.isArray(r.anyOf)&&r.anyOf.some(e=>"object"==typeof e&&null!==e&&"null"===e.type),t=r.oneOf&&Array.isArray(r.oneOf)&&r.oneOf.some(e=>"object"==typeof e&&null!==e&&"null"===e.type),o="nullable"in r&&!0===r.nullable;e||t||o?s[n]=i.optional().default(null):s[n]=i.nullable().optional().default(null)}else s[n]=i.optional().default(r.default);else s[n]=o?i:i.optional()}return nS.object(s)}(n,t),o=i,a=void 0!==n.additionalProperties?nH(n.additionalProperties,{...t,path:[...t.path,"additionalProperties"]}):void 0,l=!0===n.additionalProperties;if(n.patternProperties){let e=Object.fromEntries(Object.entries(n.patternProperties).map(([e,r])=>[e,nH(r,{...t,path:[...t.path,"patternProperties",e]})])),r=Object.values(e);o=i?a?i.catchall(nS.union([...r,a])):Object.keys(e).length>1?i.catchall(nS.union(r)):i.catchall(r[0]):a?nS.record(nS.union([...r,a])):r.length>1?nS.record(nS.union(r)):nS.record(r[0]);let s=new Set(Object.keys(n.properties??{}));o=o.superRefine((t,r)=>{for(let i in t){let o=s.has(i);for(let s in n.patternProperties){let n=new RegExp(s);if(i.match(n)){o=!0;let n=e[s].safeParse(t[i]);n.success||r.addIssue({path:[...r.path,i],code:"custom",message:`Invalid input: Key matching regex /${i}/ must match schema`,params:{issues:n.error.issues}})}}if(!o&&a){let e=a.safeParse(t[i]);e.success||r.addIssue({path:[...r.path,i],code:"custom",message:"Invalid input: must match catchall schema",params:{issues:e.error.issues}})}}})}return r=i?s?o:a?a instanceof nS.ZodNever?i.strict():l?i.passthrough():i.catchall(a):i.strict():s?o:a?a instanceof nS.ZodNever?nS.object({}).strict():l?nS.object({}).passthrough():nS.record(a):nS.object({}).passthrough(),nj(e)&&(r=r.and(nP({...e,anyOf:e.anyOf.map(e=>"object"==typeof e&&!e.type&&(e.properties??e.additionalProperties??e.patternProperties)?{...e,type:"object"}:e)},t))),nW(e)&&(r=r.and(nq({...e,oneOf:e.oneOf.map(e=>"object"==typeof e&&!e.type&&(e.properties??e.additionalProperties??e.patternProperties)?{...e,type:"object"}:e)},t))),nL(e)&&(r=r.and(nO({...e,allOf:e.allOf.map(e=>"object"==typeof e&&!e.type&&(e.properties??e.additionalProperties??e.patternProperties)?{...e,type:"object"}:e)},t))),r}(e,t);if(nN(e))return((e,t)=>{if(nj(e)){let r,s=new Set,n=[];e.anyOf.forEach(e=>{if("object"==typeof e&&e.type&&s.add("string"==typeof e.type?e.type:e.type[0]),"object"==typeof e&&e.items){let t=e.items;Array.isArray(t)||"object"!=typeof t||n.push(t)}}),1===n.length?r=n[0]:n.length>1&&(r={anyOf:n});let i={...s.size>0?{type:Array.from(s)}:{type:"array"},...r&&{items:r}};return["default","description","examples","title"].forEach(t=>{let r=e[t];void 0!==r&&(i[t]=r)}),nH(i,t)}if(Array.isArray(e.items))return eO.z.tuple(e.items.map((e,r)=>nH(e,{...t,path:[...t.path,"items",r]})));let r=e.items?eO.z.array(nH(e.items,{...t,path:[...t.path,"items"]})):eO.z.array(eO.z.any());return r=nR(r,e,"minItems",(e,t,r)=>e.min(t,r)),r=nR(r,e,"maxItems",(e,t,r)=>e.max(t,r)),"number"==typeof e.min&&"number"!=typeof e.minItems&&(r=nR(r,{...e,minItems:e.min},"minItems",(e,t,r)=>e.min(t,r))),"number"==typeof e.max&&"number"!=typeof e.maxItems&&(r=nR(r,{...e,maxItems:e.max},"maxItems",(e,t,r)=>e.max(t,r))),r})(e,t);if(nj(e))return nP(e,t);if(nL(e))return nO(e,t);else if(nW(e))return nq(e,t);else if(nM(e))return eO.z.any().refine(r=>!nH(e.not,{...t,path:[...t.path,"not"]}).safeParse(r).success,"Invalid input: Should NOT be valid against schema");else if(nD(e))return 0===e.enum.length?eO.z.never():1===e.enum.length?eO.z.literal(e.enum[0]):e.enum.every(e=>"string"==typeof e)?eO.z.enum(e.enum):eO.z.union(e.enum.map(e=>eO.z.literal(e)));else if(nZ(e))return eO.z.literal(e.const);else if(nF(e))return eO.z.union(e.type.map(r=>nH({...e,type:r},t)));else if(nB(e,"string")){let t;return t=nR(t=eO.z.string(),e,"format",(e,t,r)=>{switch(t){case"email":return e.email(r);case"ip":return e.ip(r);case"ipv4":return e.ip({version:"v4",message:r});case"ipv6":return e.ip({version:"v6",message:r});case"uri":return e.url(r);case"uuid":return e.uuid(r);case"date-time":return e.datetime({offset:!0,message:r});case"time":return e.time(r);case"date":return e.date(r);case"binary":return e.base64(r);case"duration":return e.duration(r);default:return e}}),t=nR(t,e,"contentEncoding",(e,t,r)=>e.base64(r)),t=nR(t,e,"pattern",(e,t,r)=>e.regex(new RegExp(t),r)),t=nR(t,e,"minLength",(e,t,r)=>e.min(t,r)),t=nR(t,e,"maxLength",(e,t,r)=>e.max(t,r)),"number"==typeof e.min&&"number"!=typeof e.minLength&&(t=nR(t,{...e,minLength:e.min},"minLength",(e,t,r)=>e.min(t,r))),"number"==typeof e.max&&"number"!=typeof e.maxLength&&(t=nR(t,{...e,maxLength:e.max},"maxLength",(e,t,r)=>e.max(t,r))),t}else if(nB(e,"number")||nB(e,"integer")){let t,r;return t=eO.z.number(),r=!1,"integer"===e.type?(r=!0,t=nR(t,e,"type",(e,t,r)=>e.int(r))):"int64"===e.format&&(r=!0,t=nR(t,e,"format",(e,t,r)=>e.int(r))),t=nR(t,e,"multipleOf",(e,t,s)=>1===t?r?e:e.int(s):e.multipleOf(t,s)),"number"==typeof e.minimum?t=!0===e.exclusiveMinimum?nR(t,e,"minimum",(e,t,r)=>e.gt(t,r)):nR(t,e,"minimum",(e,t,r)=>e.gte(t,r)):"number"==typeof e.exclusiveMinimum&&(t=nR(t,e,"exclusiveMinimum",(e,t,r)=>e.gt(t,r))),"number"==typeof e.maximum?t=!0===e.exclusiveMaximum?nR(t,e,"maximum",(e,t,r)=>e.lt(t,r)):nR(t,e,"maximum",(e,t,r)=>e.lte(t,r)):"number"==typeof e.exclusiveMaximum&&(t=nR(t,e,"exclusiveMaximum",(e,t,r)=>e.lt(t,r))),"number"==typeof e.min&&"number"!=typeof e.minimum&&(t=nR(t,{...e,minimum:e.min},"minimum",(e,t,r)=>e.gte(t,r))),"number"==typeof e.max&&"number"!=typeof e.maximum&&(t=nR(t,{...e,maximum:e.max},"maximum",(e,t,r)=>e.lte(t,r))),t}else{let r,s,n;if(nB(e,"boolean"))return eO.z.boolean();if(nB(e,"null"))return eO.z.null();if(!nV(e))return eO.z.any();return r=nH(e.if,{...t,path:[...t.path,"if"]}),s=nH(e.then,{...t,path:[...t.path,"then"]}),n=nH(e.else,{...t,path:[...t.path,"else"]}),eO.z.union([s,n]).superRefine((e,t)=>{let i=r.safeParse(e).success?s.safeParse(e):n.safeParse(e);i.success||i.error.errors.forEach(e=>t.addIssue(e))})}})(e,t);if(!r){var i;t.withoutDescribes||(n=((e,t)=>{let r="";if(e.description?r=e.description:e.title&&(r=e.title),void 0!==e.example){let t=`Example: ${JSON.stringify(e.example)}`;r=r?`${r}
|
|
12
|
-
${t}`:t}else if(void 0!==e.examples&&Array.isArray(e.examples)){let t=e.examples;if(t&&t.length&&t.length>0){let e=1===t.length?`Example: ${JSON.stringify(t[0])}`:`Examples:
|
|
13
|
-
${t.map(e=>` ${JSON.stringify(e)}`).join("\n")}`;r=r?`${r}
|
|
14
|
-
${e}`:e}}return r&&(t=t.describe(r)),t})(e,n)),t.withoutDefaults||(n=((e,t,r)=>{if(void 0!==e.default){if(null===e.default&&r?.path.some(e=>"anyOf"===e||"oneOf"===e)&&e.type&&"null"!==e.type&&!e.nullable)return t;t=t.default(e.default)}return t})(e,n,t)),i=n,e.readOnly&&(i=i.readonly()),n=i}return s.r=n,n},nG={OAUTH1:"OAUTH1",OAUTH2:"OAUTH2",API_KEY:"API_KEY",BASIC:"BASIC",BEARER_TOKEN:"BEARER_TOKEN",BILLCOM_AUTH:"BILLCOM_AUTH",GOOGLE_SERVICE_ACCOUNT:"GOOGLE_SERVICE_ACCOUNT",NO_AUTH:"NO_AUTH",BASIC_WITH_JWT:"BASIC_WITH_JWT",CALCOM_AUTH:"CALCOM_AUTH",SERVICE_ACCOUNT:"SERVICE_ACCOUNT",SAML:"SAML",DCR_OAUTH:"DCR_OAUTH",S2S_OAUTH2:"S2S_OAUTH2"},nX=eO.z.object({toolsForConnectedAccountCreation:eO.z.array(eO.z.string()).optional()}),nJ=eO.z.object({toolsAvailableForExecution:eO.z.array(eO.z.string()).optional(),toolsForConnectedAccountCreation:eO.z.array(eO.z.string()).optional()}),nY=eO.z.enum(["OAUTH2","OAUTH1","API_KEY","BASIC","BILLCOM_AUTH","BEARER_TOKEN","GOOGLE_SERVICE_ACCOUNT","NO_AUTH","BASIC_WITH_JWT","CALCOM_AUTH","SERVICE_ACCOUNT","SAML","DCR_OAUTH","S2S_OAUTH2"]),nQ=eO.z.object({type:eO.z.literal("use_custom_auth"),name:eO.z.string().optional(),credentials:eO.z.record(eO.z.string(),eO.z.union([eO.z.string(),eO.z.number(),eO.z.boolean()])),authScheme:nY,proxyConfig:eO.z.object({proxyUrl:eO.z.string(),proxyAuthKey:eO.z.string().optional()}).optional(),toolAccessConfig:nX.optional(),isEnabledForToolRouter:eO.z.boolean().optional()}),n0=eO.z.object({type:eO.z.literal("use_composio_managed_auth"),name:eO.z.string().optional(),credentials:eO.z.object({scopes:eO.z.union([eO.z.string(),eO.z.array(eO.z.string())]).optional(),user_scopes:eO.z.union([eO.z.string(),eO.z.array(eO.z.string())]).optional()}).passthrough().optional(),toolAccessConfig:nX.optional(),isEnabledForToolRouter:eO.z.boolean().optional()}),n1=eO.z.discriminatedUnion("type",[nQ,n0]),n2=eO.z.object({id:eO.z.string(),authScheme:eO.z.string(),isComposioManaged:eO.z.boolean(),toolkit:eO.z.string()}),n5=eO.z.object({id:eO.z.string(),name:eO.z.string(),toolkit:eO.z.object({logo:eO.z.string(),slug:eO.z.string()}),noOfConnections:eO.z.number(),status:eO.z.enum(["ENABLED","DISABLED"]),uuid:eO.z.string(),authScheme:nY.optional(),credentials:eO.z.record(eO.z.string(),eO.z.unknown()).optional(),expectedInputFields:eO.z.array(eO.z.unknown()).optional(),isEnabledForToolRouter:eO.z.boolean().optional(),restrictToFollowingTools:eO.z.array(eO.z.string()).optional(),isComposioManaged:eO.z.boolean().optional(),createdBy:eO.z.string().optional(),createdAt:eO.z.string().optional(),lastUpdatedAt:eO.z.string().optional(),toolAccessConfig:nJ.optional()}),n3=eO.z.object({cursor:eO.z.string().optional(),isComposioManaged:eO.z.boolean().optional(),limit:eO.z.number().optional(),toolkit:eO.z.string().optional()}),n4=eO.z.object({items:eO.z.array(n5),nextCursor:eO.z.string().nullable(),totalPages:eO.z.number()}),n6=eO.z.object({type:eO.z.literal("custom"),credentials:eO.z.object({scopes:eO.z.union([eO.z.string(),eO.z.array(eO.z.string())]).optional(),user_scopes:eO.z.union([eO.z.string(),eO.z.array(eO.z.string())]).optional()}).passthrough().optional(),isEnabledForToolRouter:eO.z.boolean().optional(),restrictToFollowingTools:eO.z.array(eO.z.string()).optional(),toolAccessConfig:nJ.optional()}),n9=eO.z.object({type:eO.z.literal("default"),scopes:eO.z.string().optional(),isEnabledForToolRouter:eO.z.boolean().optional(),restrictToFollowingTools:eO.z.array(eO.z.string()).optional(),toolAccessConfig:nJ.optional()}),n8=eO.z.discriminatedUnion("type",[n6,n9]),n7={INITIALIZING:"INITIALIZING",INITIATED:"INITIATED",ACTIVE:"ACTIVE",FAILED:"FAILED",EXPIRED:"EXPIRED",INACTIVE:"INACTIVE"};eO.z.enum([nG.OAUTH1,nG.OAUTH2]);let ie=eO.z.object({subdomain:eO.z.string().optional(),"your-domain":eO.z.string().optional(),region:eO.z.string().optional(),shop:eO.z.string().optional(),account_url:eO.z.string().optional(),COMPANYDOMAIN:eO.z.string().optional(),extension:eO.z.string().optional(),form_api_base_url:eO.z.string().optional(),instanceEndpoint:eO.z.string().optional(),api_url:eO.z.string().optional(),borneo_dashboard_url:eO.z.string().optional(),proxy_username:eO.z.string().optional(),proxy_password:eO.z.string().optional(),domain:eO.z.string().optional(),version:eO.z.string().optional(),dc:eO.z.string().optional(),site_name:eO.z.string().optional(),instanceName:eO.z.string().optional(),account_id:eO.z.string().optional(),your_server:eO.z.string().optional(),server_location:eO.z.string().optional(),base_url:eO.z.string().optional(),api_key:eO.z.string().optional(),generic_api_key:eO.z.string().optional(),bearer_token:eO.z.string().optional(),basic_encoded:eO.z.string().optional(),long_redirect_url:eO.z.boolean().optional(),state_prefix:eO.z.string().optional(),registration_access_token:eO.z.string().optional(),registration_client_uri:eO.z.string().optional(),composio_link_redirect_url:eO.z.string().optional()}).catchall(eO.z.unknown()),it=ie.extend({status:eO.z.literal(n7.INITIALIZING)}).catchall(eO.z.unknown()),ir=it.extend({status:eO.z.literal(n7.INITIATED),code_verifier:eO.z.string().optional(),redirectUrl:eO.z.string(),callback_url:eO.z.string().optional(),finalRedirectUri:eO.z.string().optional(),webhook_signature:eO.z.string().optional()}).catchall(eO.z.unknown()),is=it.extend({status:eO.z.literal(n7.ACTIVE),access_token:eO.z.string(),id_token:eO.z.string().optional(),token_type:eO.z.string().optional(),refresh_token:eO.z.string().nullish(),expires_in:eO.z.union([eO.z.string(),eO.z.number(),eO.z.null()]).optional(),scope:eO.z.union([eO.z.string(),eO.z.array(eO.z.string()),eO.z.null()]).optional(),webhook_signature:eO.z.string().optional(),authed_user:eO.z.object({access_token:eO.z.string().optional(),scope:eO.z.string().optional()}).optional().describe("for slack user scopes")}).catchall(eO.z.unknown()),ii=it.extend({status:eO.z.literal(n7.FAILED),error:eO.z.string().optional(),error_description:eO.z.string().optional()}).catchall(eO.z.unknown()),io=it.extend({status:eO.z.literal(n7.EXPIRED),expired_at:eO.z.string().optional()}).catchall(eO.z.unknown()),ia=it.extend({status:eO.z.literal(n7.INACTIVE),access_token:eO.z.string(),id_token:eO.z.string().optional(),token_type:eO.z.string().optional(),refresh_token:eO.z.string().nullish(),expires_in:eO.z.union([eO.z.string(),eO.z.number(),eO.z.null()]).optional(),scope:eO.z.union([eO.z.string(),eO.z.array(eO.z.string()),eO.z.null()]).optional(),webhook_signature:eO.z.string().optional(),authed_user:eO.z.object({access_token:eO.z.string().optional(),scope:eO.z.string().optional()}).optional().describe("for slack user scopes")}).catchall(eO.z.unknown()),il=eO.z.discriminatedUnion("status",[it,ir,is,ii,io,ia]),ic=is.omit({status:!0}),iu=ie.extend({status:eO.z.literal(n7.INITIALIZING)}).catchall(eO.z.unknown()),id=eO.z.discriminatedUnion("status",[iu,iu.extend({status:eO.z.literal(n7.INITIATED)}).catchall(eO.z.unknown()),iu.extend({status:eO.z.literal(n7.ACTIVE),access_token:eO.z.string().optional(),id_token:eO.z.string().optional(),token_type:eO.z.string().optional(),refresh_token:eO.z.string().nullish(),expires_in:eO.z.union([eO.z.string(),eO.z.number(),eO.z.null()]).optional(),scope:eO.z.union([eO.z.string(),eO.z.array(eO.z.string()),eO.z.null()]).optional()}).catchall(eO.z.unknown()),iu.extend({status:eO.z.literal(n7.INACTIVE),access_token:eO.z.string().optional(),id_token:eO.z.string().optional(),token_type:eO.z.string().optional(),refresh_token:eO.z.string().nullish(),expires_in:eO.z.union([eO.z.string(),eO.z.number(),eO.z.null()]).optional(),scope:eO.z.union([eO.z.string(),eO.z.array(eO.z.string()),eO.z.null()]).optional()}).catchall(eO.z.unknown()),iu.extend({status:eO.z.literal(n7.FAILED),error:eO.z.string().optional(),error_description:eO.z.string().optional()}).catchall(eO.z.unknown()),iu.extend({status:eO.z.literal(n7.EXPIRED),expired_at:eO.z.string().optional()}).catchall(eO.z.unknown())]),ih=ie.extend({access_token:eO.z.string().optional(),id_token:eO.z.string().optional(),token_type:eO.z.string().optional(),refresh_token:eO.z.string().nullish().optional(),expires_in:eO.z.union([eO.z.string(),eO.z.number(),eO.z.null()]).optional(),scope:eO.z.union([eO.z.string(),eO.z.array(eO.z.string()),eO.z.null()]).optional()}).catchall(eO.z.unknown()),ip=ie.extend({status:eO.z.literal(n7.INITIALIZING)}).catchall(eO.z.unknown()),im=ip.extend({status:eO.z.literal(n7.INITIATED),authUri:eO.z.string(),oauth_token:eO.z.string(),oauth_token_secret:eO.z.string(),redirectUrl:eO.z.string(),callbackUrl:eO.z.string().optional()}).catchall(eO.z.unknown()),ig=ip.extend({status:eO.z.literal(n7.ACTIVE),oauth_token:eO.z.string(),oauth_token_secret:eO.z.string(),consumer_key:eO.z.string().optional(),oauth_verifier:eO.z.string().optional(),redirectUrl:eO.z.string().optional(),callback_url:eO.z.string().optional()}).catchall(eO.z.unknown()),iy=ip.extend({status:eO.z.literal(n7.FAILED),error:eO.z.string().optional(),error_description:eO.z.string().optional()}).catchall(eO.z.unknown()),ib=ip.extend({status:eO.z.literal(n7.EXPIRED),expired_at:eO.z.string().optional()}).catchall(eO.z.unknown()),i_=ip.extend({status:eO.z.literal(n7.INACTIVE),oauth_token:eO.z.string(),oauth_token_secret:eO.z.string(),consumer_key:eO.z.string().optional(),oauth_verifier:eO.z.string().optional(),redirectUrl:eO.z.string().optional(),callback_url:eO.z.string().optional()}).catchall(eO.z.unknown()),iw=eO.z.discriminatedUnion("status",[ip,im,ig,iy,ib,i_]),iv=ig.omit({status:!0}),iI=ie.extend({status:eO.z.literal(n7.INITIALIZING)}).catchall(eO.z.unknown()),ik=eO.z.discriminatedUnion("status",[iI,iI.extend({status:eO.z.literal(n7.INITIATED),redirectUrl:eO.z.string()}).catchall(eO.z.unknown()),iI.extend({status:eO.z.literal(n7.ACTIVE),sessionId:eO.z.string(),devKey:eO.z.string()}).catchall(eO.z.unknown()),iI.extend({status:eO.z.literal(n7.FAILED),error:eO.z.string().optional(),error_description:eO.z.string().optional()}).catchall(eO.z.unknown()),iI.extend({status:eO.z.literal(n7.EXPIRED),expired_at:eO.z.string().optional()}).catchall(eO.z.unknown()),iI.extend({status:eO.z.literal(n7.INACTIVE)}).catchall(eO.z.unknown())]),ix=ie.extend({status:eO.z.literal(n7.INITIALIZING)}).catchall(eO.z.unknown()),iT=eO.z.discriminatedUnion("status",[ix,ix.extend({status:eO.z.literal(n7.INITIATED)}).catchall(eO.z.unknown()),ix.extend({status:eO.z.literal(n7.ACTIVE),username:eO.z.string(),password:eO.z.string()}).catchall(eO.z.unknown()),ix.extend({status:eO.z.literal(n7.INACTIVE),username:eO.z.string(),password:eO.z.string()}).catchall(eO.z.unknown()),ix.extend({status:eO.z.literal(n7.FAILED),username:eO.z.string(),password:eO.z.string(),error:eO.z.string().optional(),error_description:eO.z.string().optional()}).catchall(eO.z.unknown()),ix.extend({status:eO.z.literal(n7.EXPIRED),username:eO.z.string(),password:eO.z.string(),expired_at:eO.z.string().optional()}).catchall(eO.z.unknown())]),iE=ie.extend({username:eO.z.string(),password:eO.z.string()}).catchall(eO.z.unknown()),iz=ie.extend({status:eO.z.literal(n7.INITIALIZING)}).catchall(eO.z.unknown()),iA=eO.z.discriminatedUnion("status",[iz,iz.extend({status:eO.z.literal(n7.INITIATED)}).catchall(eO.z.unknown()),iz.extend({status:eO.z.literal(n7.ACTIVE),api_key:eO.z.string().optional(),generic_api_key:eO.z.string().optional()}).catchall(eO.z.unknown()),iz.extend({status:eO.z.literal(n7.INACTIVE),api_key:eO.z.string().optional(),generic_api_key:eO.z.string().optional()}).catchall(eO.z.unknown()),iz.extend({status:eO.z.literal(n7.FAILED),error:eO.z.string().optional(),error_description:eO.z.string().optional()}).catchall(eO.z.unknown()),iz.extend({status:eO.z.literal(n7.EXPIRED),expired_at:eO.z.string().optional()}).catchall(eO.z.unknown())]),iS=ie.extend({api_key:eO.z.string().optional(),generic_api_key:eO.z.string().optional()}).catchall(eO.z.unknown()),iC=ie.extend({status:eO.z.literal(n7.INITIALIZING)}).catchall(eO.z.unknown()),iO=eO.z.discriminatedUnion("status",[iC,iC.extend({status:eO.z.literal(n7.INITIATED)}).catchall(eO.z.unknown()),iC.extend({status:eO.z.literal(n7.ACTIVE),token:eO.z.string()}).catchall(eO.z.unknown()),iC.extend({status:eO.z.literal(n7.INACTIVE),token:eO.z.string()}).catchall(eO.z.unknown()),iC.extend({status:eO.z.literal(n7.FAILED),error:eO.z.string().optional(),error_description:eO.z.string().optional()}).catchall(eO.z.unknown()),iC.extend({status:eO.z.literal(n7.EXPIRED),expired_at:eO.z.string().optional()}).catchall(eO.z.unknown())]),iP=ie.extend({token:eO.z.string()}).catchall(eO.z.unknown()),iR=ie.extend({status:eO.z.literal(n7.INITIALIZING)}).catchall(eO.z.unknown()),i$=eO.z.discriminatedUnion("status",[iR,iR.extend({status:eO.z.literal(n7.INITIATED),redirectUrl:eO.z.string(),composio_link_redirect_url:eO.z.string().optional()}).catchall(eO.z.unknown()),iR.extend({status:eO.z.literal(n7.ACTIVE),credentials_json:eO.z.string()}).catchall(eO.z.unknown()),iR.extend({status:eO.z.literal(n7.INACTIVE),credentials_json:eO.z.string()}).catchall(eO.z.unknown()),iR.extend({status:eO.z.literal(n7.FAILED),error:eO.z.string().optional(),error_description:eO.z.string().optional()}).catchall(eO.z.unknown()),iR.extend({status:eO.z.literal(n7.EXPIRED),expired_at:eO.z.string().optional()}).catchall(eO.z.unknown())]),iN=ie.extend({status:eO.z.literal(n7.INITIALIZING)}).catchall(eO.z.unknown()),ij=eO.z.discriminatedUnion("status",[iN,iN.extend({status:eO.z.literal(n7.INITIATED)}).catchall(eO.z.unknown()),iN.extend({status:eO.z.literal(n7.ACTIVE)}).catchall(eO.z.unknown()),iN.extend({status:eO.z.literal(n7.INACTIVE)}).catchall(eO.z.unknown()),iN.extend({status:eO.z.literal(n7.FAILED),error:eO.z.string().optional(),error_description:eO.z.string().optional()}).catchall(eO.z.unknown()),iN.extend({status:eO.z.literal(n7.EXPIRED),expired_at:eO.z.string().optional()}).catchall(eO.z.unknown())]),iL=ie.catchall(eO.z.unknown()),iD=ie.extend({status:eO.z.literal(n7.INITIALIZING)}).catchall(eO.z.unknown()),iU=eO.z.discriminatedUnion("status",[iD,iD.extend({status:eO.z.literal(n7.INITIATED)}).catchall(eO.z.unknown()),iD.extend({status:eO.z.literal(n7.ACTIVE)}).catchall(eO.z.unknown()),iD.extend({status:eO.z.literal(n7.INACTIVE)}).catchall(eO.z.unknown()),iD.extend({status:eO.z.literal(n7.FAILED),error:eO.z.string().optional(),error_description:eO.z.string().optional()}).catchall(eO.z.unknown()),iD.extend({status:eO.z.literal(n7.EXPIRED),expired_at:eO.z.string().optional()}).catchall(eO.z.unknown())]),iF=ie.extend({status:eO.z.literal(n7.INITIALIZING)}).catchall(eO.z.unknown()),iM=eO.z.discriminatedUnion("status",[iF,iF.extend({status:eO.z.literal(n7.INITIATED)}).catchall(eO.z.unknown()),iF.extend({status:eO.z.literal(n7.ACTIVE),username:eO.z.string(),password:eO.z.string()}).catchall(eO.z.unknown()),iF.extend({status:eO.z.literal(n7.INACTIVE),username:eO.z.string(),password:eO.z.string()}).catchall(eO.z.unknown()),iF.extend({status:eO.z.literal(n7.FAILED),username:eO.z.string(),password:eO.z.string(),error:eO.z.string().optional(),error_description:eO.z.string().optional()}).catchall(eO.z.unknown()),iF.extend({status:eO.z.literal(n7.EXPIRED),username:eO.z.string(),password:eO.z.string(),expired_at:eO.z.string().optional()}).catchall(eO.z.unknown())]),iZ=ie.extend({username:eO.z.string(),password:eO.z.string()}).catchall(eO.z.unknown()),iB=ie.extend({status:eO.z.literal(n7.INITIALIZING)}).catchall(eO.z.unknown()),iV=eO.z.discriminatedUnion("status",[iB,iB.extend({status:eO.z.literal(n7.INITIATED)}).catchall(eO.z.unknown()),iB.extend({status:eO.z.literal(n7.ACTIVE),application_id:eO.z.string(),installation_id:eO.z.string(),private_key:eO.z.string()}).catchall(eO.z.unknown()),iB.extend({status:eO.z.literal(n7.INACTIVE),application_id:eO.z.string(),installation_id:eO.z.string(),private_key:eO.z.string()}).catchall(eO.z.unknown())]),iW=eO.z.object({application_id:eO.z.string(),installation_id:eO.z.string(),private_key:eO.z.string()}).merge(ie).catchall(eO.z.unknown()),iK=ie.extend({status:eO.z.literal(n7.INITIALIZING)}).catchall(eO.z.unknown()),iq=eO.z.discriminatedUnion("status",[iK,iK.extend({status:eO.z.literal(n7.INITIATED)}).catchall(eO.z.unknown()),iK.extend({status:eO.z.literal(n7.ACTIVE)}).catchall(eO.z.unknown()),iK.extend({status:eO.z.literal(n7.INACTIVE)}).catchall(eO.z.unknown()),iK.extend({status:eO.z.literal(n7.FAILED),error:eO.z.string().optional(),error_description:eO.z.string().optional()}).catchall(eO.z.unknown()),iK.extend({status:eO.z.literal(n7.EXPIRED),expired_at:eO.z.string().optional()}).catchall(eO.z.unknown())]);ie.catchall(eO.z.unknown());let iH=ie.extend({status:eO.z.literal(n7.INITIALIZING)}).catchall(eO.z.unknown()),iG=eO.z.discriminatedUnion("status",[iH,iH.extend({status:eO.z.literal(n7.INITIATED),client_id:eO.z.string(),redirectUrl:eO.z.string(),client_secret:eO.z.string().optional(),callback_url:eO.z.string().optional(),client_id_issued_at:eO.z.number().optional(),client_secret_expires_at:eO.z.number().optional(),code_verifier:eO.z.string().optional(),finalRedirectUri:eO.z.string().optional()}).catchall(eO.z.unknown()),iH.extend({status:eO.z.literal(n7.ACTIVE),access_token:eO.z.string(),client_id:eO.z.string(),token_type:eO.z.string().optional(),refresh_token:eO.z.string().nullish(),expires_in:eO.z.union([eO.z.string(),eO.z.number(),eO.z.null()]).optional(),scope:eO.z.union([eO.z.string(),eO.z.array(eO.z.string()),eO.z.null()]).optional(),id_token:eO.z.string().optional(),client_secret:eO.z.string().optional(),client_id_issued_at:eO.z.number().optional(),client_secret_expires_at:eO.z.number().optional()}).catchall(eO.z.unknown()),iH.extend({status:eO.z.literal(n7.INACTIVE),access_token:eO.z.string(),client_id:eO.z.string(),token_type:eO.z.string().optional(),refresh_token:eO.z.string().nullish(),expires_in:eO.z.union([eO.z.string(),eO.z.number(),eO.z.null()]).optional(),scope:eO.z.union([eO.z.string(),eO.z.array(eO.z.string()),eO.z.null()]).optional(),id_token:eO.z.string().optional(),client_secret:eO.z.string().optional(),client_id_issued_at:eO.z.number().optional(),client_secret_expires_at:eO.z.number().optional()}).catchall(eO.z.unknown()),iH.extend({status:eO.z.literal(n7.FAILED),error:eO.z.string().optional(),error_description:eO.z.string().optional()}).catchall(eO.z.unknown()),iH.extend({status:eO.z.literal(n7.EXPIRED),expired_at:eO.z.string().optional()}).catchall(eO.z.unknown())]),iX=eO.z.object({access_token:eO.z.string(),client_id:eO.z.string()}).merge(ie).catchall(eO.z.unknown()),iJ=eO.z.discriminatedUnion("authScheme",[eO.z.object({authScheme:eO.z.literal(nG.OAUTH1),val:iw}),eO.z.object({authScheme:eO.z.literal(nG.OAUTH2),val:il}),eO.z.object({authScheme:eO.z.literal(nG.S2S_OAUTH2),val:id}),eO.z.object({authScheme:eO.z.literal(nG.API_KEY),val:iA}),eO.z.object({authScheme:eO.z.literal(nG.BASIC),val:iT}),eO.z.object({authScheme:eO.z.literal(nG.BEARER_TOKEN),val:iO}),eO.z.object({authScheme:eO.z.literal(nG.GOOGLE_SERVICE_ACCOUNT),val:i$}),eO.z.object({authScheme:eO.z.literal(nG.NO_AUTH),val:ij}),eO.z.object({authScheme:eO.z.literal(nG.CALCOM_AUTH),val:iU}),eO.z.object({authScheme:eO.z.literal(nG.BILLCOM_AUTH),val:ik}),eO.z.object({authScheme:eO.z.literal(nG.BASIC_WITH_JWT),val:iM}),eO.z.object({authScheme:eO.z.literal(nG.SERVICE_ACCOUNT),val:iV}),eO.z.object({authScheme:eO.z.literal(nG.SAML),val:iq}),eO.z.object({authScheme:eO.z.literal(nG.DCR_OAUTH),val:iG})]),iY=eO.z.discriminatedUnion("authScheme",[eO.z.object({authScheme:eO.z.literal(nG.OAUTH2),toolkitSlug:eO.z.string(),val:ic}),eO.z.object({authScheme:eO.z.literal(nG.S2S_OAUTH2),toolkitSlug:eO.z.string(),val:ih}),eO.z.object({authScheme:eO.z.literal(nG.DCR_OAUTH),toolkitSlug:eO.z.string(),val:iX}),eO.z.object({authScheme:eO.z.literal(nG.API_KEY),toolkitSlug:eO.z.string(),val:iS}),eO.z.object({authScheme:eO.z.literal(nG.BASIC_WITH_JWT),toolkitSlug:eO.z.string(),val:iZ}),eO.z.object({authScheme:eO.z.literal(nG.BASIC),toolkitSlug:eO.z.string(),val:iE}),eO.z.object({authScheme:eO.z.literal(nG.BEARER_TOKEN),toolkitSlug:eO.z.string(),val:iP}),eO.z.object({authScheme:eO.z.literal(nG.OAUTH1),toolkitSlug:eO.z.string(),val:iv}),eO.z.object({authScheme:eO.z.literal(nG.NO_AUTH),toolkitSlug:eO.z.string(),val:iL}),eO.z.object({authScheme:eO.z.literal(nG.SERVICE_ACCOUNT),toolkitSlug:eO.z.string(),val:iW})]),iQ=eO.z.object({slug:eO.z.string().describe("The slug of the toolkit"),name:eO.z.string().describe("The name of the toolkit"),logo:eO.z.string().describe("The logo of the toolkit").optional()}),i0=eO.z.enum(["string","number","integer","boolean","object","array","null"]),i1=eO.z.object({type:eO.z.union([i0,eO.z.array(i0)]).optional(),description:eO.z.string().optional(),anyOf:eO.z.lazy(()=>eO.z.array(i1)).optional(),oneOf:eO.z.lazy(()=>eO.z.array(i1)).optional(),allOf:eO.z.lazy(()=>eO.z.array(i1)).optional(),not:eO.z.lazy(()=>i1).optional(),title:eO.z.string().optional(),default:eO.z.any().optional(),nullable:eO.z.boolean().optional(),properties:eO.z.lazy(()=>eO.z.record(eO.z.string(),i1)).optional(),required:eO.z.array(eO.z.string()).optional(),file_uploadable:eO.z.boolean().optional(),file_downloadable:eO.z.boolean().optional(),items:eO.z.lazy(()=>eO.z.union([i1,eO.z.array(i1)])).optional(),enum:eO.z.array(eO.z.any()).optional(),const:eO.z.any().optional(),minimum:eO.z.number().optional(),maximum:eO.z.number().optional(),exclusiveMinimum:eO.z.number().optional(),exclusiveMaximum:eO.z.number().optional(),multipleOf:eO.z.number().optional(),minLength:eO.z.number().optional(),maxLength:eO.z.number().optional(),pattern:eO.z.string().optional(),format:eO.z.string().optional(),minItems:eO.z.number().optional(),maxItems:eO.z.number().optional(),uniqueItems:eO.z.boolean().optional(),minProperties:eO.z.number().optional(),maxProperties:eO.z.number().optional(),patternProperties:eO.z.lazy(()=>eO.z.record(eO.z.string(),i1)).optional(),additionalProperties:eO.z.union([eO.z.boolean(),eO.z.lazy(()=>i1)]).optional(),examples:eO.z.array(eO.z.any()).optional(),readOnly:eO.z.boolean().optional(),writeOnly:eO.z.boolean().optional(),if:eO.z.lazy(()=>i1).optional(),then:eO.z.lazy(()=>i1).optional(),else:eO.z.lazy(()=>i1).optional(),$ref:eO.z.string().optional(),definitions:eO.z.record(eO.z.string(),eO.z.lazy(()=>i1)).optional(),$defs:eO.z.record(eO.z.string(),eO.z.lazy(()=>i1)).optional()}),i2=eO.z.object({type:eO.z.literal("object"),anyOf:eO.z.array(i1).optional(),oneOf:eO.z.array(i1).optional(),allOf:eO.z.array(i1).optional(),not:i1.optional(),properties:eO.z.record(eO.z.string(),i1),required:eO.z.array(eO.z.string()).optional(),title:eO.z.string().optional(),default:eO.z.any().optional(),nullable:eO.z.boolean().optional(),description:eO.z.string().optional(),additionalProperties:eO.z.boolean().default(!1).optional()}),i5=eO.z.object({slug:eO.z.string().describe('The slug of the tool. eg. "GOOGLE_SEARCH"'),name:eO.z.string().describe('The name of the tool. eg. "Google Search"'),description:eO.z.string().optional().describe("The description of the tool"),inputParameters:i2.optional().describe("The input parameters of the tool"),outputParameters:i2.optional().describe("The output parameters of the tool"),tags:eO.z.array(eO.z.string()).describe("The tags of the tool. eg: Important").default([]).optional(),toolkit:iQ.describe("The toolkit of the tool").optional(),version:eO.z.string().describe('The version of the tool, e.g. "20250909_00"').optional(),isDeprecated:eO.z.boolean().describe("Whether the tool is deprecated").optional(),availableVersions:eO.z.array(eO.z.string()).describe("Available versions of the tool.").default([]).optional(),scopes:eO.z.array(eO.z.string()).describe('The scopes of the tool. eg: ["task:add"]').optional(),isNoAuth:eO.z.boolean().describe("Do the tool support no auth?").optional()});eO.z.object({items:eO.z.array(i5),nextCursor:eO.z.string().nullable().optional(),totalPages:eO.z.number()});let i3=eO.z.literal("latest"),i4=eO.z.union([i3,eO.z.string()]),i6=eO.z.record(eO.z.string(),i4);eO.z.union([i6,i3,eO.z.undefined()]).describe('The versioning of the toolkits. eg: { "github": "latest", "slack": "20250902_00" }');let i9=eO.z.object({tools:eO.z.array(eO.z.string()).optional(),toolkits:eO.z.array(eO.z.string()).optional(),scopes:eO.z.array(eO.z.string()).optional(),tags:eO.z.array(eO.z.string()).optional(),limit:eO.z.number().optional(),search:eO.z.string().optional(),authConfigIds:eO.z.array(eO.z.string()).optional(),important:eO.z.boolean().optional()}),i8=eO.z.object({baseURL:eO.z.string().optional(),body:eO.z.record(eO.z.string(),eO.z.unknown()).optional(),parameters:eO.z.array(eO.z.object({in:eO.z.enum(["query","header"]),name:eO.z.string(),value:eO.z.union([eO.z.string(),eO.z.number()])}))}),i7=eO.z.object({allowTracing:eO.z.boolean().optional(),connectedAccountId:eO.z.string().optional(),customAuthParams:i8.optional(),customConnectionData:iY.optional(),arguments:eO.z.record(eO.z.string(),eO.z.unknown()).optional(),userId:eO.z.string().optional(),version:eO.z.union([eO.z.literal("latest"),eO.z.string()]).optional(),dangerouslySkipVersionCheck:eO.z.boolean().optional(),text:eO.z.string().optional()}),oe=eO.z.object({sessionId:eO.z.string(),arguments:eO.z.record(eO.z.string(),eO.z.unknown()).optional()}),ot=eO.z.object({data:eO.z.record(eO.z.string(),eO.z.unknown()),error:eO.z.string().nullable(),successful:eO.z.boolean(),logId:eO.z.string().optional(),sessionInfo:eO.z.unknown().optional()}),or=eO.z.object({endpoint:eO.z.string(),method:eO.z.enum(["GET","POST","PUT","DELETE","PATCH"]),body:eO.z.unknown().optional(),parameters:eO.z.array(eO.z.object({in:eO.z.enum(["query","header"]),name:eO.z.string(),value:eO.z.union([eO.z.string(),eO.z.number()])})).optional(),connectedAccountId:eO.z.string().optional(),customConnectionData:iY.describe("DEPRECATED: This field is deprecated and will be removed in the future.").optional()}),os="INITIATED",on="ACTIVE",oi="FAILED",oo="EXPIRED",oa=eO.z.enum(["INITIALIZING",os,on,oi,oo,"INACTIVE"]);eO.z.object({authConfig:eO.z.object({id:eO.z.string()}),connection:eO.z.object({data:eO.z.record(eO.z.string(),eO.z.unknown()).optional(),callbackUrl:eO.z.string().optional(),userId:eO.z.string().optional()})}),eO.z.object({auth_config:eO.z.object({id:eO.z.string()}),connection:eO.z.object({state:iJ.optional(),data:eO.z.record(eO.z.string(),eO.z.unknown()).optional(),callback_url:eO.z.string().optional(),user_id:eO.z.string().optional(),alias:eO.z.string().optional()})}),eO.z.object({allowMultiple:eO.z.boolean().optional(),callbackUrl:eO.z.string().optional(),config:iJ.optional(),alias:eO.z.string().optional()}),eO.z.object({id:eO.z.string(),status:oa,redirectUrl:eO.z.string().nullable()});let ol=eO.z.object({id:eO.z.string(),authScheme:nY.optional(),isComposioManaged:eO.z.boolean(),isDisabled:eO.z.boolean()}),oc=eO.z.object({id:eO.z.string(),authConfig:ol,wordId:eO.z.string().nullable().optional(),alias:eO.z.string().nullable().optional(),data:eO.z.record(eO.z.string(),eO.z.unknown()).optional(),params:eO.z.record(eO.z.string(),eO.z.unknown()).optional(),status:oa,statusReason:eO.z.string().nullable(),toolkit:eO.z.object({slug:eO.z.string()}),state:iJ.optional(),testRequestEndpoint:eO.z.string().optional(),isDisabled:eO.z.boolean(),createdAt:eO.z.string(),updatedAt:eO.z.string()}),ou=eO.z.object({authConfigIds:eO.z.array(eO.z.string()).nullable().optional().describe("The auth config ids of the connected accounts"),cursor:eO.z.string().nullish().describe("The cursor to paginate through the connected accounts"),limit:eO.z.number().nullable().optional().describe("The limit of the connected accounts to return"),orderBy:eO.z.enum(["created_at","updated_at"]).optional().describe("The order by of the connected accounts"),statuses:eO.z.array(oa).nullable().optional().describe("The statuses of the connected accounts"),toolkitSlugs:eO.z.array(eO.z.string()).nullable().optional().describe("The toolkit slugs of the connected accounts"),userIds:eO.z.array(eO.z.string()).nullable().optional().describe("The user ids of the connected accounts")}),od=eO.z.object({items:eO.z.array(oc).describe("The list of connected accounts"),nextCursor:eO.z.string().nullish().describe("The next cursor to paginate through the connected accounts"),totalPages:eO.z.number().describe("The total number of pages of connected accounts")}),oh=eO.z.object({callbackUrl:eO.z.string().optional(),alias:eO.z.string().optional()});eO.z.object({redirectUrl:eO.z.string()});let op=eO.z.object({redirectUrl:eO.z.string().optional(),validateCredentials:eO.z.boolean().optional()}),of=eO.z.object({enabled:eO.z.boolean()});function om(e){return{with:t=>({using(r,s){let n=r(e),i=t.safeParse(n);if(!i.success){let e=s?.label?` for ${s.label}`:"",t=i.error.issues.map(e=>` - ${e.path.join(".")||"parameter"}: ${e.message}`).join("\n");return ez.c.warn(`Transform validation failed${e}:
|
|
15
|
-
${t}`),n}return i.data}})}}function og(e){return om(e).with(oc).using(t=>({...t,authConfig:{...t.auth_config,id:t.auth_config.id,authScheme:t.auth_config.auth_scheme,isComposioManaged:t.auth_config.is_composio_managed,isDisabled:t.auth_config.is_disabled},wordId:e.word_id??null,alias:e.alias??null,data:t.data??void 0,state:(e=>{try{return e?iJ.parse(e):void 0}catch(e){ez.c.warn("Unsupported auth scheme in connected account state, ignoring state field",{error:e});return}})(t.state),status:t.status,statusReason:t.status_reason,isDisabled:t.is_disabled,createdAt:t.created_at,updatedAt:t.updated_at,testRequestEndpoint:t.test_request_endpoint}))}var oy=class{client;customToolsRegistry;constructor(e){if(!e)throw new ez.s("ComposioClient is required");this.client=e,this.customToolsRegistry=new Map,tr.instrument(this,"CustomTools")}async createTool(e){let{slug:t,execute:r,inputParams:s,name:n,description:i}=e;if(!t||!r||!s||!n)throw Error("Invalid tool options");let o=eP(s,{name:"input"}).definitions.input,a={name:n,slug:t,description:i,inputParameters:{title:n,type:"object",description:i,properties:o.properties,required:o.required},outputParameters:{type:"object",title:`Response for ${n}`,properties:{}},tags:[],toolkit:{name:"custom",slug:"custom"}};return this.customToolsRegistry.set(t.toLowerCase(),{options:e,schema:a}),a}async getCustomTools({toolSlugs:e}){let t=[];if(!e)return Array.from(this.customToolsRegistry.values()).map(e=>e.schema);for(let r of e){let e=this.customToolsRegistry.get(r.toLowerCase());e&&t.push(e.schema)}return t}async getCustomToolBySlug(e){try{return this.customToolsRegistry.get(e.toLowerCase())?.schema}catch(e){ez.c.error(`Error getting custom tool: ${e}`);return}}async getConnectedAccountForToolkit(e,t,r){try{if(await this.client.toolkits.retrieve(e),(await this.client.toolkits.retrieve(e)).auth_config_details?.some(e=>e.mode===nG.NO_AUTH))return null}catch(t){throw new eL(`Toolkit with slug ${e} not found`,{cause:t})}let s=await this.client.connectedAccounts.list({toolkit_slugs:[e],user_ids:[t]});if(!s.items.length)throw new eR(`No connected accounts found for toolkit ${e}`);let n=r?s.items.find(e=>e.id===r):s.items[0];if(!n)throw new eR(`Connected account not found for toolkit ${e} for user ${t}`);return og(n)}async executeCustomTool(e,t){let r=this.customToolsRegistry.get(e.toLowerCase());if(!r)throw new eL(`Tool with slug ${e} not found`);let s=null,{toolkitSlug:n,execute:i,inputParams:o}=r.options,a=t.connectedAccountId;if(n&&"custom"!==n&&t.userId){let e=await this.getConnectedAccountForToolkit(n,t.userId,t.connectedAccountId);if(ez.c.debug(`[CustomTool] Connected account for ${n} found for user ${t.userId}`,JSON.stringify(e,null,2)),!e)throw new eR(`Connected account not found for toolkit ${n} for user ${t.userId}`,{meta:{toolkitSlug:n,userId:t.userId}});s=e.state??null,a=e.id}if("function"!=typeof i)throw new eM("Invalid execute function",{meta:{toolSlug:e}});let l=async e=>{if(n&&"custom"===n)throw new eM("Custom tools without a toolkit cannot be executed using the executeToolRequest function",{possibleFixes:["Please manually execute the tool using your logic.","Pass a toolkit slug to execute the tool on behalf of a toolkit credentials"]});let t=e.parameters?.map(e=>({name:e.name,type:e.in,value:e.value.toString()}));return{data:(await this.client.tools.proxy({endpoint:e.endpoint,method:e.method,parameters:t,body:e.body,connected_account_id:a,custom_connection_data:e.customConnectionData})).data,error:null,successful:!0,logId:void 0,sessionInfo:void 0}},c=o.safeParse(t.arguments);if(!c.success)throw new eX("Invalid input parameters",{cause:c.error});return i(c.data,s,l)}};function ob(e){if(!e)return e;let t=e;if("~"===e||e.startsWith("~/")||e.startsWith("~\\")){let r=tp.homedir();if(!r)return;t="~"===e?r:tp.joinPath(r,e.slice(2))}return tp.resolvePath(t)}function o_(e){if(void 0===e)return;if(!1===e)return!1;let t=[];for(let r of e){if("string"!=typeof r||""===r.trim())continue;let e=ob(r);e&&t.push(e)}return t}var ow=class{client;customTools;provider;autoUploadDownloadFiles;toolkitVersions;fileUploadPathOptions;warnedAutoUploadDisabledForTool=new Set;constructor(e,t){if(!e)throw Error("ComposioClient is required");if(!t?.provider)throw new ej("Provider not passed into Tools instance");this.client=e,this.customTools=new oy(e),this.provider=t.provider,this.autoUploadDownloadFiles=t?.dangerouslyAllowAutoUploadDownloadFiles===!0,this.toolkitVersions=t?.toolkitVersions??tN,this.fileUploadPathOptions={sensitiveFileUploadProtection:t?.sensitiveFileUploadProtection,fileUploadPathDenySegments:t?.fileUploadPathDenySegments,fileUploadAllowlist:this.autoUploadDownloadFiles?function(e){if(void 0===e){let e,t=(e=tp.homedir())?tp.resolvePath(tp.joinPath(e,".composio","temp")):null;return t?[t]:[]}if(!1===e)return[];let t=o_(e);return Array.isArray(t)?t:[]}(t?.fileUploadDirs):void 0,fileDownloadDir:t?.fileDownloadDir},this.execute=this.execute.bind(this),this.provider._setExecuteToolFn(this.createExecuteFnForProviders()),this.getRawComposioToolBySlug=this.getRawComposioToolBySlug.bind(this),this.getRawComposioTools=this.getRawComposioTools.bind(this),tr.instrument(this,"Tools")}transformToolCases(e){return i5.parse({...e,inputParameters:e.input_parameters,outputParameters:e.output_parameters,availableVersions:e.available_versions,isDeprecated:e.deprecated?.is_deprecated??!1,isNoAuth:e.no_auth})}transformToolExecuteResponse(e){return ot.parse({data:e.data,error:e.error,successful:e.successful,logId:e.log_id,sessionInfo:e.session_info})}async applyDefaultSchemaModifiers(e){if(!this.autoUploadDownloadFiles)return e;let t=new tR(this.client,this.fileUploadPathOptions);return await Promise.all(e.map(e=>t.modifyToolSchema(e)))}async applyBeforeExecuteModifiers(e,{toolSlug:t,toolkitSlug:r,params:s},n){let i=s;if(this.autoUploadDownloadFiles?i=await new tR(this.client,{...this.fileUploadPathOptions,beforeFileUpload:n?.beforeFileUpload}).fileUploadModifier(e,{toolSlug:t,toolkitSlug:r,params:i}):ta(e.inputParameters)&&!this.warnedAutoUploadDisabledForTool.has(t)&&(this.warnedAutoUploadDisabledForTool.add(t),ez.c.warn(`Tool "${t}" (toolkit "${r}") has a file-uploadable input, but \`dangerouslyAllowAutoUploadDownloadFiles\` is disabled. The SDK will forward the file argument as-is; if it isn't already a staged { name, mimetype, s3key } descriptor, the backend will reject the call. Either:
|
|
16
|
-
1) Stage the file yourself: \`const f = await composio.files.upload({ file, toolSlug, toolkitSlug }); await composio.tools.execute('${t}', { userId, arguments: { <fileField>: f } })\`, or
|
|
17
|
-
2) Enable auto-upload with a scoped allowlist: \`new Composio({ dangerouslyAllowAutoUploadDownloadFiles: true, fileUploadDirs: ['/safe/dir'] })\`.`)),n?.beforeExecute)if("function"==typeof n.beforeExecute)i=await n.beforeExecute({toolSlug:t,toolkitSlug:r,params:i});else throw new eD("Invalid beforeExecute modifier. Not a function.");return i}async applyAfterExecuteModifiers(e,{toolSlug:t,toolkitSlug:r,result:s},n){let i=s;if(this.autoUploadDownloadFiles&&(i=await new tR(this.client,this.fileUploadPathOptions).fileDownloadModifier(e,{toolSlug:t,toolkitSlug:r,result:i})),n)if("function"==typeof n)i=await n({toolSlug:t,toolkitSlug:r,result:i});else throw new eD("Invalid afterExecute modifier. Not a function.");return i}async getRawComposioTools(e,t){if("tools"in e&&"toolkits"in e)throw new eX("Invalid tool list parameters. You should not use tools and toolkits filter together.");let r=i9.safeParse(e);if(r.error)throw new eX("Invalid tool list parameters",{cause:r.error});let s="toolkits"in r.data&&!("tools"in r.data)&&!("tags"in r.data)&&!("search"in r.data)&&!("limit"in r.data)&&!1!==r.data.important,n="important"in r.data?r.data.important:s;if(!("tools"in r.data||"toolkits"in r.data||"search"in r.data||"authConfigIds"in r.data))throw new eX("Invalid tool list parameters, atleast one of the following parameters is required: tools, toolkits, search, authConfigIds");let i="limit"in r.data?r.data.limit:void 0;"tools"in r.data&&(i=9999);let o={..."tools"in r.data?{tool_slugs:r.data.tools?.join(",")}:{},..."toolkits"in r.data?{toolkit_slug:r.data.toolkits?.join(",")}:{},...i?{limit:i}:{},..."tags"in r.data?{tags:r.data.tags}:{},..."scopes"in r.data?{scopes:r.data.scopes}:{},..."search"in r.data?{search:r.data.search}:{},..."authConfigIds"in r.data?{auth_config_ids:r.data.authConfigIds}:{},...n?{important:"true"}:{},toolkit_versions:this.toolkitVersions};ez.c.debug(`Fetching tools with filters: ${JSON.stringify(o,null,2)}`);let a=await this.client.tools.list(o);if(!a)return[];let l=a.items.map(e=>this.transformToolCases(e)),c=await this.customTools.getCustomTools({toolSlugs:"tools"in r.data?r.data.tools:void 0}),u=await this.applyDefaultSchemaModifiers([...l,...c]);if(t?.modifySchema){let e=t.modifySchema;if("function"==typeof e){let t=u.map(t=>e({toolSlug:t.slug,toolkitSlug:t.toolkit?.slug??"unknown",schema:t}));u=await Promise.all(t)}else throw new eD("Invalid schema modifier. Not a function.")}return u}async getRawToolRouterMetaTools(e,t){let r=(await this.client.toolRouter.session.tools(e)).items.map(e=>this.transformToolCases(e));if(t?.modifySchema){let e=t.modifySchema;if("function"==typeof e){let t=r.map(t=>e({toolSlug:t.slug,toolkitSlug:t.toolkit?.slug??"unknown",schema:t}));r=await Promise.all(t)}else throw new eD("Invalid schema modifier. Not a function.")}return r}async getRawComposioToolBySlug(e,t){let r,s=await this.customTools.getCustomToolBySlug(e);if(s)return ez.c.debug(`Found ${e} to be a custom tool`,JSON.stringify(s,null,2)),s;ez.c.debug(`Tool ${e} is not a custom tool. Fetching from Composio API`);try{let s=t?.version?{version:t.version}:{toolkit_versions:this.toolkitVersions};r=await this.client.tools.retrieve(e,s)}catch(t){throw new eL(`Unable to retrieve tool with slug ${e}`,{cause:t})}let[n]=await this.applyDefaultSchemaModifiers([this.transformToolCases(r)]);if(t?.modifySchema){let r=t.modifySchema;if("function"==typeof r)n=await r({toolSlug:e,toolkitSlug:n.toolkit?.slug??"unknown",schema:n});else throw new eD("Invalid schema modifier. Not a function.")}return n}async get(e,t,r){if("string"==typeof t){let s=await this.getRawComposioToolBySlug(t,{modifySchema:r?.modifySchema});return this.wrapToolsForProvider(e,[s],r)}{let s=await this.getRawComposioTools(t,{modifySchema:r?.modifySchema});return this.wrapToolsForProvider(e,s,r)}}createExecuteFnForProviders(){return async(e,t,r)=>await this.execute(e,{...t,dangerouslySkipVersionCheck:t.dangerouslySkipVersionCheck??!0},r)}wrapToolsForProvider(e,t,r){let s=this.createExecuteToolFn(e,r);return this.provider.wrapTools(t,s)}wrapToolsForToolRouter(e,t,r){let s=this.createExecuteToolFnForToolRouter(e,r);return this.provider.wrapTools(t,s)}createExecuteToolFn(e,t){return async(r,s)=>await this.execute(r,{userId:e,arguments:s,dangerouslySkipVersionCheck:!0},t)}createExecuteToolFnForToolRouter(e,t){return async(r,s)=>await this.executeMetaTool(r,{sessionId:e,arguments:s},t)}async executeComposioTool(e,t){var r,s;let n=t.version??(r=e.toolkit?.slug??"unknown","string"==typeof(s=this.toolkitVersions)?s:s&&Object.keys(s).length>0?s[r]??"latest":"latest");if("latest"===n&&!t.dangerouslySkipVersionCheck)throw new eB;try{let r=await this.client.tools.execute(e.slug,{allow_tracing:t.allowTracing,connected_account_id:t.connectedAccountId,custom_auth_params:t.customAuthParams?{base_url:t.customAuthParams.baseURL,body:t.customAuthParams.body,parameters:t.customAuthParams.parameters}:void 0,custom_connection_data:t.customConnectionData,arguments:t.arguments,user_id:t.userId,version:n,text:t.text});return this.transformToolExecuteResponse(r)}catch(t){throw((e,t)=>{if(t instanceof eS.APIError&&t.error){let e=t.error,r=e?.error?.code,s=e?.error?.message;if(r&&eV.has(r))return eV.get(r)(s||"An error occurred")}return new eF(`Error executing the tool ${e}`,{cause:t,possibleFixes:["Ensure the tool slug is correct and the input arguments for the tool is valid"]})})(e.slug,t)}}async execute(e,t,r){if(!this.customTools)throw new eU("CustomTools not initialized. Make sure Tools class is properly constructed.");let s=i7.safeParse(t);if(!s.success)throw new eX("Invalid tool execute parameters",{cause:s.error});let n=await this.customTools.getCustomToolBySlug(e),i=n??await this.getRawComposioToolBySlug(e,{version:t.version}),o=i.toolkit?.slug??"unknown",a=await this.applyBeforeExecuteModifiers(i,{toolSlug:e,toolkitSlug:o,params:s.data},r),l=n?await this.customTools.executeCustomTool(n.slug,a):await this.executeComposioTool(i,a);return await this.applyAfterExecuteModifiers(i,{toolSlug:e,toolkitSlug:o,result:l},r?.afterExecute)}async executeMetaTool(e,t,r){let s=oe.safeParse(t);if(!s.success)throw new eX("Invalid tool execute meta parameters",{cause:s.error});let n=t.arguments??{};r?.beforeExecute&&(n=await r.beforeExecute({toolSlug:e,toolkitSlug:"composio",sessionId:t.sessionId,params:n}));let i=await this.client.toolRouter.session.executeMeta(t.sessionId,{slug:e,arguments:n}),o={data:i.data,error:i.error,successful:!i.error,logId:i.log_id};return r?.afterExecute&&(o=await r.afterExecute({toolSlug:e,toolkitSlug:"composio",sessionId:t.sessionId,result:o})),o}async getToolsEnum(){return this.client.tools.retrieveEnum()}async getInput(e,t){return this.client.tools.getInput(e,t)}async proxyExecute(e){let t=or.safeParse(e);if(!t.success)throw new eX("Invalid tool proxy parameters",{cause:t.error});let r=[];return t.data.parameters&&r.push(...(t.data.parameters??[]).map(e=>({name:e.name,type:"header"===e.in?"header":"query",value:e.value.toString()}))),this.client.tools.proxy({endpoint:t.data.endpoint,method:t.data.method,body:t.data.body,connected_account_id:t.data.connectedAccountId,parameters:r,custom_connection_data:t.data.customConnectionData})}async createCustomTool(e){return this.customTools.createTool(e)}};let ov=eO.z.enum(["all","composio","project"]),oI=eO.z.enum(["usage","alphabetically"]),ok=eO.z.object({category:eO.z.string().optional(),managedBy:ov.optional(),sortBy:oI.optional(),cursor:eO.z.string().optional(),limit:eO.z.number().optional()}),ox=eO.z.object({categories:eO.z.array(eO.z.object({slug:eO.z.string(),name:eO.z.string()})).optional(),appUrl:eO.z.string().optional(),createdAt:eO.z.string().optional(),description:eO.z.string().optional(),logo:eO.z.string().optional(),toolsCount:eO.z.number().optional(),triggersCount:eO.z.number().optional(),updatedAt:eO.z.string().optional(),availableVersions:eO.z.array(eO.z.string()).optional()}),oT=eO.z.object({name:eO.z.string(),slug:eO.z.string(),meta:ox,isLocalToolkit:eO.z.boolean(),authSchemes:eO.z.array(eO.z.string()).optional(),composioManagedAuthSchemes:eO.z.array(eO.z.string()).optional(),noAuth:eO.z.boolean().optional()}),oE=eO.z.array(oT),oz=eO.z.object({description:eO.z.string(),displayName:eO.z.string(),required:eO.z.boolean(),name:eO.z.string(),type:eO.z.string(),default:eO.z.string().nullable().optional()}),oA=eO.z.object({name:eO.z.string(),mode:eO.z.string(),fields:eO.z.object({authConfigCreation:eO.z.object({optional:eO.z.array(oz),required:eO.z.array(oz)}),connectedAccountInitiation:eO.z.object({optional:eO.z.array(oz),required:eO.z.array(oz)})}),proxy:eO.z.object({baseUrl:eO.z.string().optional()}).optional()}),oS=eO.z.object({name:eO.z.string(),slug:eO.z.string(),meta:ox,isLocalToolkit:eO.z.boolean(),composioManagedAuthSchemes:eO.z.array(eO.z.string()).optional(),authConfigDetails:eO.z.array(oA).optional(),baseUrl:eO.z.string().optional(),getCurrentUserEndpoint:eO.z.string().optional(),getCurrentUserEndpointMethod:eO.z.string().optional()}),oC=eO.z.object({id:eO.z.string(),name:eO.z.string()}),oO=eO.z.object({items:eO.z.array(oC),nextCursor:eO.z.string().nullable(),totalPages:eO.z.number()});function oP(e){return om(e).with(n5).using(e=>({id:e.id,name:e.name,noOfConnections:e.no_of_connections,status:e.status,toolkit:{logo:e.toolkit.logo,slug:e.toolkit.slug},isEnabledForToolRouter:e.is_enabled_for_tool_router,uuid:e.uuid,authScheme:e.auth_scheme,credentials:e.credentials,expectedInputFields:e.expected_input_fields,isComposioManaged:e.is_composio_managed,createdBy:e.created_by,createdAt:e.created_at,lastUpdatedAt:e.last_updated_at,restrictToFollowingTools:e.tool_access_config?.tools_for_connected_account_creation,toolAccessConfig:e.tool_access_config?{toolsAvailableForExecution:e.tool_access_config.tools_available_for_execution,toolsForConnectedAccountCreation:e.tool_access_config.tools_for_connected_account_creation}:void 0}))}eO.z.array(oz.extend({required:eO.z.boolean().optional()}));var oR=class{client;constructor(e){this.client=e,tr.instrument(this,"AuthConfigs")}getClient(){return this.client}async list(e){let t=e?n3.parse(e):void 0;return om(await this.client.authConfigs.list({cursor:t?.cursor,is_composio_managed:t?.isComposioManaged,limit:t?.limit,toolkit_slug:t?.toolkit})).with(n4).using(e=>({items:e.items.map(oP),nextCursor:e.next_cursor??null,totalPages:e.total_pages}))}async create(e,t={type:"use_composio_managed_auth"}){let r=n1.safeParse(t);if(r.error)throw new eX("Failed to parse auth config create options",{cause:r.error});return om(await this.client.authConfigs.create({toolkit:{slug:e},auth_config:"use_custom_auth"===r.data.type?{type:r.data.type,name:r.data.name,authScheme:r.data.authScheme,credentials:r.data.credentials,is_enabled_for_tool_router:r.data.isEnabledForToolRouter,proxy_config:r.data.proxyConfig?{proxy_url:r.data.proxyConfig.proxyUrl,proxy_auth_key:r.data.proxyConfig.proxyAuthKey}:void 0,tool_access_config:r.data.toolAccessConfig?{tools_for_connected_account_creation:r.data.toolAccessConfig.toolsForConnectedAccountCreation}:void 0}:{type:r.data.type,credentials:r.data.credentials,name:r.data.name,is_enabled_for_tool_router:r.data.isEnabledForToolRouter,tool_access_config:r.data.toolAccessConfig?{tools_for_connected_account_creation:r.data.toolAccessConfig.toolsForConnectedAccountCreation}:void 0}})).with(n2).using(e=>({id:e.auth_config.id,authScheme:e.auth_config.auth_scheme,isComposioManaged:e.auth_config.is_composio_managed,toolkit:e.toolkit.slug}))}async get(e){return oP(await this.client.authConfigs.retrieve(e))}async update(e,t){let r=n8.safeParse(t);if(r.error)throw new eX("Failed to parse auth config update data",{cause:r.error});return this.client.authConfigs.update(e,"custom"===r.data.type?{type:"custom",credentials:r.data.credentials,is_enabled_for_tool_router:r.data.isEnabledForToolRouter,tool_access_config:{tools_for_connected_account_creation:r.data.toolAccessConfig?.toolsForConnectedAccountCreation,tools_available_for_execution:r.data.toolAccessConfig?.toolsAvailableForExecution??r.data.restrictToFollowingTools}}:{type:"default",scopes:r.data.scopes,is_enabled_for_tool_router:r.data.isEnabledForToolRouter,tool_access_config:{tools_for_connected_account_creation:r.data.toolAccessConfig?.toolsForConnectedAccountCreation,tools_available_for_execution:r.data.toolAccessConfig?.toolsAvailableForExecution??r.data.restrictToFollowingTools}})}async delete(e){return this.client.authConfigs.delete(e)}async updateStatus(e,t){return this.client.authConfigs.updateStatus(e,{nanoid:t})}async enable(e){return this.client.authConfigs.updateStatus("ENABLED",{nanoid:e})}async disable(e){return this.client.authConfigs.updateStatus("DISABLED",{nanoid:e})}};function o$(e,t,r,s){let n={id:t,status:r||os,redirectUrl:s};async function i(t=6e4){try{let t=await e.connectedAccounts.retrieve(n.id);if(t.status===on)return n.status=on,og(t)}catch(e){if(e instanceof tc.Composio.NotFoundError)throw new eR(`Connected account with id ${n.id} not found`,{meta:{connectedAccountId:n.id}});throw e}let r=[oi,oo],s=Date.now();for(;Date.now()-s<t;)try{let t=await e.connectedAccounts.retrieve(n.id);if(n.status=t.status,t.status===on)return og(t);if(r.includes(t.status))throw new eq(`Connection request failed with status: ${t.status}${t.status_reason?`, reason: ${t.status_reason}`:""}`,{meta:{connectedAccountId:n.id,status:t.status,statusReason:t.status_reason}});await new Promise(e=>setTimeout(e,1e3))}catch(e){throw e}throw new eK(`Connection request timed out for ${n.id}`)}return tr.instrument(n,"ConnectionRequest"),{...n,waitForConnection:i,toJSON:()=>({...n}),toString:()=>JSON.stringify(n,null,2)}}var oN=class{client;constructor(e){this.client=e,tr.instrument(this,"ConnectedAccounts")}async list(e){let t;if(e){let r=ou.safeParse(e);if(!r.success)throw new eX("Failed to parse connected account list query",{cause:r.error});t={auth_config_ids:r.data.authConfigIds,cursor:r.data.cursor?.toString(),limit:r.data.limit,order_by:r.data.orderBy,statuses:r.data.statuses,toolkit_slugs:r.data.toolkitSlugs,user_ids:r.data.userIds}}return om(await this.client.connectedAccounts.list(t)).with(od).using(e=>({items:e.items.map(og),nextCursor:e.next_cursor??null,totalPages:e.total_pages}))}async initiate(e,t,r){let s=await this.list({userIds:[e],authConfigIds:[t],statuses:[on]});if(s.items.length>0&&!r?.allowMultiple)throw new e$(`Multiple connected accounts found for user ${e} in auth config ${t}. Please use the allowMultiple option to allow multiple connected accounts.`);s.items.length>0&&ez.c.warn(`[Warn:AllowMultiple] Multiple connected accounts found for user ${e} in auth config ${t}`);let n=r?.config??void 0,i={auth_config:{id:t},connection:{callback_url:r?.callbackUrl,user_id:e,state:n,...r?.alias!=null&&{alias:r.alias}}},o=await this.client.connectedAccounts.create(i),a="string"==typeof o.connectionData?.val?.redirectUrl?o.connectionData.val.redirectUrl:null;return o$(this.client,o.id,o.connectionData.val.status,a)}async link(e,t,r){let s=await oh.safeParse(r||{});if(!s.success)throw new eX("Failed to parse create connected account link options",{cause:s.error});try{let r=await this.client.link.create({auth_config_id:t,user_id:e,...s?.data.callbackUrl&&{callback_url:s.data.callbackUrl},...s?.data.alias!=null&&{alias:s.data.alias}});return o$(this.client,r.connected_account_id,os,r.redirect_url)}catch(e){throw new eN("Failed to create connected account link",{cause:e})}}async waitForConnection(e,t=6e4){return o$(this.client,e).waitForConnection(t)}async get(e){return og(await this.client.connectedAccounts.retrieve(e))}async delete(e){return this.client.connectedAccounts.delete(e)}async refresh(e,t){let r;if(t){let e=op.safeParse(t);if(!e.success)throw new eX("Failed to parse connected account refresh options",{cause:e.error});r={query_redirect_url:e.data.redirectUrl,validate_credentials:e.data.validateCredentials}}return this.client.connectedAccounts.refresh(e,r)}async updateStatus(e,t){return this.client.connectedAccounts.updateStatus(e,t)}async enable(e){return this.client.connectedAccounts.updateStatus(e,{enabled:!0})}async disable(e){return this.client.connectedAccounts.updateStatus(e,{enabled:!1})}async update(e,t){let r=of.safeParse(t);if(!r.success)throw new eX("Failed to parse connected account update params",{cause:r.error});return this.client.connectedAccounts.updateStatus(e,r.data)}},oj=class{client;constructor(e){this.client=e,this.authorize=this.authorize.bind(this),tr.instrument(this,"Toolkits")}async getToolkits(e){try{let t,r=ok.safeParse(e);if(!r.success)throw new eX("Failed to parse toolkit list query",{cause:r.error});return t=await this.client.toolkits.list({category:r.data.category,managed_by:r.data.managedBy,sort_by:r.data.sortBy,cursor:r.data.cursor,limit:r.data.limit}),om(t).with(oE).using(e=>e.items.map(e=>({name:e.name,slug:e.slug,meta:{...e.meta,categories:e.meta.categories?.map(e=>({slug:e.id,name:e.name})),createdAt:e.meta.created_at,description:e.meta.description,logo:e.meta.logo,toolsCount:e.meta.tools_count,triggersCount:e.meta.triggers_count,updatedAt:e.meta.updated_at,appUrl:e.meta.app_url??void 0},isLocalToolkit:e.is_local_toolkit,authSchemes:e.auth_schemes,composioManagedAuthSchemes:e.composio_managed_auth_schemes,noAuth:e.no_auth})))}catch(e){throw new eG("Failed to fetch toolkits",{cause:e})}}async getToolkitBySlug(e){try{let t;return t=await this.client.toolkits.retrieve(e),om(t).with(oS).using(e=>({name:e.name,slug:e.slug,meta:{...e.meta,createdAt:e.meta.created_at,updatedAt:e.meta.updated_at,toolsCount:e.meta.tools_count,triggersCount:e.meta.triggers_count,categories:e.meta.categories?.map(e=>({slug:e.slug,name:e.name})),availableVersions:e.meta.available_versions},isLocalToolkit:e.is_local_toolkit,composioManagedAuthSchemes:e.composio_managed_auth_schemes,authConfigDetails:e.auth_config_details?.map(e=>({name:e.name,mode:e.mode,fields:{authConfigCreation:e.fields.auth_config_creation,connectedAccountInitiation:e.fields.connected_account_initiation},proxy:{baseUrl:e.proxy?.base_url}})),baseUrl:e.base_url,getCurrentUserEndpoint:e.get_current_user_endpoint,getCurrentUserEndpointMethod:e.get_current_user_endpoint_method}))}catch(t){if(t instanceof tZ&&(404===t.status||400===t.status))throw new eH(`Toolkit with slug ${e} not found`,{meta:{slug:e},cause:t});throw new eG(`Couldn't fetch Toolkit with slug: ${e}`,{meta:{slug:e},cause:t})}}async get(e){return"string"==typeof e?this.getToolkitBySlug(e):this.getToolkits(e??{})}async getAuthConfigFields(e,t,r,s){let n=await this.getToolkitBySlug(e);if(!n.authConfigDetails)throw new eW("No auth config found for toolkit",{meta:{toolkitSlug:e}});n.authConfigDetails.length>1&&!t&&ez.c.warn(`Multiple auth configs found for ${e}, please specify the auth scheme to get details of specific auth scheme. Selecting the first scheme by default.`,{meta:{toolkitSlug:e}});let i=t?n.authConfigDetails.find(e=>e.mode===t):n.authConfigDetails[0];if(!i)throw new eW(`Auth schema ${t} not found for toolkit ${e} with auth scheme ${t}`,{meta:{toolkitSlug:e,authScheme:t}});let o=i.fields[r].required.map(e=>({...e,required:!0}));return s?o:[...o,...i.fields[r].optional.map(e=>({...e,required:!1}))]}async getAuthConfigCreationFields(e,t,{requiredOnly:r=!1}={}){return this.getAuthConfigFields(e,t??null,"authConfigCreation",r)}async getConnectedAccountInitiationFields(e,t,{requiredOnly:r=!1}={}){return this.getAuthConfigFields(e,t??null,"connectedAccountInitiation",r)}async listCategories(){return om(await this.client.toolkits.retrieveCategories()).with(oO).using(e=>({items:e.items.map(e=>({id:e.id,name:e.name})),nextCursor:e.next_cursor??null,totalPages:e.total_pages}))}async authorize(e,t,r){let s=await this.getToolkitBySlug(t),n=new oR(this.client),i=r;if(i||(i=(await n.list({toolkit:t})).items[0]?.id),!i)if(s.authConfigDetails&&s.authConfigDetails.length>0)try{i=(await n.create(t,{type:"use_composio_managed_auth",name:`${s.name} Auth Config`})).id}catch(e){if(e instanceof tc.Composio.APIError&&400===e.status)throw new eW(`No Default auth config found for toolkit ${t}`,{meta:{toolkitSlug:t},cause:e,possibleFixes:[`Please Create an auth config for the toolkit ${t} via the dashboard`]});throw e}else throw new eW(`No auth configs found for toolkit ${t}`,{meta:{toolkitSlug:t}});return await new oN(this.client).initiate(e,i,{allowMultiple:!0})}};eO.z.enum(["enable","disable"]);let oL=eO.z.object({toolkits:eO.z.array(eO.z.string()).optional(),triggerId:eO.z.string().optional(),connectedAccountId:eO.z.string().optional(),authConfigId:eO.z.string().optional(),triggerSlug:eO.z.array(eO.z.string()).optional(),triggerData:eO.z.string().optional(),userId:eO.z.string().optional()}),oD=eO.z.object({authConfigIds:eO.z.array(eO.z.string()).nullable().optional(),connectedAccountIds:eO.z.array(eO.z.string()).nullable().optional(),limit:eO.z.number().optional(),cursor:eO.z.string().optional(),showDisabled:eO.z.boolean().nullable().optional(),triggerIds:eO.z.array(eO.z.string()).nullable().optional(),triggerNames:eO.z.array(eO.z.string()).nullable().optional()}),oU=eO.z.object({id:eO.z.string(),connectedAccountId:eO.z.string(),disabledAt:eO.z.string().nullable(),state:eO.z.record(eO.z.unknown()),triggerConfig:eO.z.record(eO.z.unknown()),triggerName:eO.z.string(),updatedAt:eO.z.string(),triggerData:eO.z.string().optional(),uuid:eO.z.string().optional()}),oF=eO.z.object({items:eO.z.array(oU),nextCursor:eO.z.string().nullable(),totalPages:eO.z.number()}),oM=eO.z.object({connectedAccountId:eO.z.string().optional(),triggerConfig:eO.z.record(eO.z.unknown()).optional()});eO.z.object({triggerId:eO.z.string()}),eO.z.object({status:eO.z.enum(["enable","disable"])}),eO.z.object({status:eO.z.enum(["success"])}),eO.z.object({triggerId:eO.z.string()});let oZ=eO.z.object({id:eO.z.string().describe("The ID of the trigger"),uuid:eO.z.string().describe("The UUID of the trigger"),triggerSlug:eO.z.string().describe("The slug of the trigger that triggered the event"),toolkitSlug:eO.z.string().describe("The slug of the toolkit that triggered the event"),userId:eO.z.string().describe("The ID of the user that triggered the event"),payload:eO.z.record(eO.z.unknown()).describe("The payload of the trigger").optional(),originalPayload:eO.z.record(eO.z.unknown()).describe("The original payload of the trigger").optional(),metadata:eO.z.object({id:eO.z.string(),uuid:eO.z.string(),toolkitSlug:eO.z.string(),triggerSlug:eO.z.string(),triggerData:eO.z.string().optional(),triggerConfig:eO.z.record(eO.z.unknown()),connectedAccount:eO.z.object({id:eO.z.string(),uuid:eO.z.string(),authConfigId:eO.z.string(),authConfigUUID:eO.z.string(),userId:eO.z.string(),status:eO.z.enum(["ACTIVE","INACTIVE"])})})}),oB=eO.z.object({cursor:eO.z.string().optional(),limit:eO.z.number().nullish(),toolkits:eO.z.array(eO.z.string()).nullish()}),oV=eO.z.object({slug:eO.z.string(),name:eO.z.string(),description:eO.z.string(),instructions:eO.z.string().optional(),toolkit:eO.z.object({logo:eO.z.string(),slug:eO.z.string(),name:eO.z.string()}),payload:eO.z.record(eO.z.unknown()),config:eO.z.record(eO.z.unknown()),version:eO.z.string().optional()}),oW=eO.z.object({items:eO.z.array(oV),nextCursor:eO.z.string().nullish(),totalPages:eO.z.number()}),oK=eO.z.object({trigger_name:eO.z.string(),connection_id:eO.z.string(),trigger_id:eO.z.string(),payload:eO.z.record(eO.z.unknown()),log_id:eO.z.string()}),oq=eO.z.object({type:eO.z.string(),timestamp:eO.z.string(),log_id:eO.z.string(),data:eO.z.object({connection_id:eO.z.string(),connection_nano_id:eO.z.string(),trigger_nano_id:eO.z.string(),trigger_id:eO.z.string(),user_id:eO.z.string()}).passthrough()}),oH=eO.z.object({id:eO.z.string(),timestamp:eO.z.string(),type:eO.z.string().refine(e=>e.startsWith("composio."),{message:"V3 event type must start with 'composio.'"}),metadata:eO.z.record(eO.z.unknown()),data:eO.z.record(eO.z.unknown())}),oG=eO.z.object({id:eO.z.string(),timestamp:eO.z.string(),type:eO.z.string(),metadata:eO.z.object({log_id:eO.z.string(),trigger_slug:eO.z.string(),trigger_id:eO.z.string(),connected_account_id:eO.z.string(),auth_config_id:eO.z.string(),user_id:eO.z.string()}).passthrough(),data:eO.z.record(eO.z.unknown())});eO.z.union([oH,oq,oK]);let oX=eO.z.object({id:eO.z.string({required_error:"Missing 'id' parameter. Pass the value of the 'webhook-id' HTTP header.",invalid_type_error:"Invalid 'id' parameter. Expected string from 'webhook-id' HTTP header."}),payload:eO.z.string({required_error:"Missing 'payload' parameter. Pass the raw request body as a string (do not parse it).",invalid_type_error:"Invalid 'payload' parameter. Expected string (raw request body)."}),secret:eO.z.string({required_error:"Missing 'secret' parameter. Get your webhook secret from the Composio dashboard.",invalid_type_error:"Invalid 'secret' parameter. Expected string."}),signature:eO.z.string({required_error:"Missing 'signature' parameter. Pass the value of the 'webhook-signature' HTTP header.",invalid_type_error:"Invalid 'signature' parameter. Expected string from 'webhook-signature' HTTP header."}),timestamp:eO.z.string({required_error:"Missing 'timestamp' parameter. Pass the value of the 'webhook-timestamp' HTTP header.",invalid_type_error:"Invalid 'timestamp' parameter. Expected string from 'webhook-timestamp' HTTP header."}),tolerance:eO.z.number().optional().default(300)}),oJ=eO.z.object({projectId:eO.z.string().describe("The project ID"),pusherKey:eO.z.string().describe("The Pusher key"),pusherCluster:eO.z.string().describe("The Pusher cluster")});var oY=class{constructor(e){this.client=e,this.client=e}async getSDKRealtimeCredentials(){let e=await this.client.request({method:"get",path:"/api/v3/internal/sdk/realtime/credentials"}),t=oJ.safeParse({pusherKey:e.pusher_key,projectId:e.project_id,pusherCluster:e.pusher_cluster});if(ez.c.debug(`[InternalService] SDK realtime credentials: ${JSON.stringify(t,null,2)}`),!t.success)throw new eX("Failed to parse SDK realtime credentials",{cause:t.error});return t.data}},oQ=class{clientId;pusherKey;pusherCluster;pusherChannel;pusherBaseURL;apiKey;pusherClient;composioClient;constructor(e){this.composioClient=e,this.pusherBaseURL=e.baseURL,this.apiKey=e.apiKey??process.env.COMPOSIO_API_KEY??"",tr.instrument(this,"PusherService")}async getPusherClient(){if(!this.pusherClient){let t,r=new oY(this.composioClient);try{t=await r.getSDKRealtimeCredentials()}catch(e){throw new eQ("Failed to get SDK realtime credentials",{cause:e})}this.clientId=t.projectId,this.pusherKey=t.pusherKey,this.pusherCluster=t.pusherCluster,this.pusherChannel=`private-${this.clientId}_triggers`,ez.c.debug(`[PusherService] Creating Pusher client for client ID: ${this.clientId} in cluster ${this.pusherCluster}`);try{let{default:t}=await e.A(530887);this.pusherClient=new t(this.pusherKey,{cluster:this.pusherCluster,channelAuthorization:{endpoint:`${this.pusherBaseURL}/api/v3/internal/sdk/realtime/auth`,headers:{"x-api-key":this.apiKey},transport:"ajax"}})}catch(e){throw new e0("Failed to create Pusher client",{cause:e})}}return this.pusherClient}bindWithChunking(e,t,r){try{e.bind(t,r);let s={};e.bind("chunked-"+t,e=>{try{if(!e||"string"!=typeof e.id||"number"!=typeof e.index)throw Error("Invalid chunked trigger data format");s.hasOwnProperty(e.id)||(s[e.id]={chunks:[],receivedFinal:!1});let t=s[e.id];if(t.chunks[e.index]=e.chunk,e.final&&(t.receivedFinal=!0),t.receivedFinal&&t.chunks.length===Object.keys(t.chunks).length)try{r(JSON.parse(t.chunks.join("")))}catch(t){let e=t instanceof Error?t.message:String(t);ez.c.error("Failed to parse chunked data:",e)}finally{delete s[e.id]}}catch(r){let t=r instanceof Error?r.message:String(r);ez.c.error("Error processing chunked trigger data:",t),e&&"object"==typeof e&&"id"in e&&delete s[e.id]}})}catch(t){let e=t instanceof Error?t.message:String(t);throw ez.c.error("Failed to bind chunked events:",t),Error(`Failed to bind chunked events: ${e}`)}}async subscribe(e){try{ez.c.debug(`[PusherService] Subscribing to channel: ${this.pusherChannel}`);let t=await (await this.getPusherClient()).subscribe(this.pusherChannel);t.bind("pusher:subscription_error",e=>{let t=e.error?String(e.error):"Unknown subscription error";throw new e1(`Trigger subscription error: ${t}`,{cause:t})}),this.bindWithChunking(t,"trigger_to_client",t=>{try{e(t)}catch(t){let e=t instanceof Error?t.message:String(t);ez.c.error("❌ Error in trigger callback:",e)}}),ez.c.info("✅ Subscribed to triggers. You should start receiving events now.")}catch(e){throw new e1("Failed to subscribe to Pusher channel",{cause:e})}}async unsubscribe(){try{ez.c.debug(`[PusherService] Unsubscribing from channel: ${this.pusherChannel}`),await (await this.getPusherClient()).unsubscribe(this.pusherChannel),ez.c.info("✅ Unsubscribed from triggers.")}catch(e){throw new e1("Failed to unsubscribe from Pusher channel",{cause:e})}}};async function o0(e,t){let r=new TextEncoder,s=r.encode(e),n=await globalThis.crypto.subtle.importKey("raw",s,{name:"HMAC",hash:"SHA-256"},!1,["sign"]),i=r.encode(t);return function(e){let t=new Uint8Array(e),r="";for(let e=0;e<t.length;e++)r+=String.fromCharCode(t[e]);return btoa(r)}(await globalThis.crypto.subtle.sign("HMAC",n,i))}let o1=(e,t)=>{if(null==e)return t;let r=String(e);return r.length>0?r:t};var o2=class{client;pusherService;toolkitVersions;constructor(e,t){this.client=e,this.pusherService=new oQ(e),this.toolkitVersions=t?.toolkitVersions??tN,tr.instrument(this,"Triggers")}async listActive(e){let t=oD.safeParse(e??{});if(!t.success)throw new eX("Invalid parameters passed to list triggers",{cause:t.error});return om(await this.client.triggerInstances.listActive(e?{auth_config_ids:t.data.authConfigIds,connected_account_ids:t.data.connectedAccountIds,cursor:t.data.cursor,limit:t.data.limit,show_disabled:t.data.showDisabled,trigger_ids:t.data.triggerIds,trigger_names:t.data.triggerNames}:void 0)).with(oF).using(e=>({items:e.items.map(e=>om(e).with(oU).using(e=>({id:e.id,connectedAccountId:e.connected_account_id,disabledAt:e.disabled_at,state:e.state,triggerConfig:e.trigger_config,triggerName:e.trigger_name,updatedAt:e.updated_at,triggerData:e.trigger_data,uuid:e.uuid}))),nextCursor:e.next_cursor??null,totalPages:e.total_pages}))}async create(e,t,r){let s,n=oM.safeParse(r??{});if(!n.success)throw new eX("Invalid parameters passed to create trigger",{cause:n.error});try{s=(await this.getType(t)).toolkit.slug}catch(e){if(e instanceof eS.APIError&&(400===e.status||404===e.status))throw new e2(`Trigger type ${t} not found`,{cause:e,possibleFixes:["Please check the trigger slug","Please check the provided version of toolkit has the trigger","Visit the toolkit page to see the available triggers"]});throw e}let i=r?.connectedAccountId;try{let{items:t}=await this.client.connectedAccounts.list({user_ids:[e],toolkit_slugs:[s]});if(0===t.length)throw new eR(`No connected account found for user ${e} for toolkit ${s}`,{cause:Error(`No connected account found for user ${e}`),possibleFixes:[`Create a new connected account for user ${e}`]});let r=t.some(e=>e.id===i);if(i&&!r)throw new eR(`Connected account ID ${i} not found for user ${e}`,{cause:Error(`Connected account ID ${i} not found for user ${e}`),possibleFixes:[`Create a new connected account for user ${e}`,"Verify the connected account ID"]});i||(i=t[0].id,ez.c.warn(`[Warn] Multiple connected accounts found for user ${e}, using the first one. Pass connectedAccountId to select a specific account.`))}catch(t){if(t instanceof eS.APIError&&[400,404].includes(t.status))throw new eR(`No connected account found for user ${e} for toolkit ${s}`,{cause:t,possibleFixes:[`Create a new connected account for user ${e}`]});throw t}return{triggerId:(await this.client.triggerInstances.upsert(t,{connected_account_id:i,trigger_config:n.data.triggerConfig,toolkit_versions:this.toolkitVersions})).trigger_id}}async update(e,t){return this.client.triggerInstances.manage.update(e,t)}async delete(e){return{triggerId:(await this.client.triggerInstances.manage.delete(e)).trigger_id}}async disable(e){return this.client.triggerInstances.manage.update(e,{status:"disable"})}async enable(e){return this.client.triggerInstances.manage.update(e,{status:"enable"})}async listTypes(e){let t=om(e??{}).with(oB).using(e=>e);return om(await this.client.triggersTypes.list({cursor:t.cursor,limit:t.limit,toolkit_slugs:t.toolkits,toolkit_versions:this.toolkitVersions})).with(oW).using(e=>({items:e.items,nextCursor:e.next_cursor??null,totalPages:e.total_pages}))}async getType(e){return om(await this.client.triggersTypes.retrieve(e,{toolkit_versions:this.toolkitVersions})).with(oV).using(e=>({slug:e.slug,name:e.name,description:e.description,instructions:e.instructions,toolkit:{logo:e.toolkit.logo,slug:e.toolkit.slug,name:e.toolkit.name},version:e.version,payload:e.payload,config:e.config}))}async listEnum(){return this.client.triggersTypes.retrieveEnum()}shouldSendTriggerAfterFilters(e,t){return e.toolkits?.length&&!e.toolkits.map(e=>e.toLowerCase()).includes(t.toolkitSlug.toLowerCase())?(ez.c.debug("Trigger does not match toolkits filter",JSON.stringify(e.toolkits,null,2)),!1):e.triggerId&&e.triggerId!==t.id?(ez.c.debug("Trigger does not match triggerId filter",JSON.stringify(e.triggerId,null,2)),!1):e.connectedAccountId&&e.connectedAccountId!==t.metadata.connectedAccount.id?(ez.c.debug("Trigger does not match connectedAccountId filter",JSON.stringify(e.connectedAccountId,null,2)),!1):e.triggerSlug?.length&&!e.triggerSlug.map(e=>e.toLowerCase()).includes(t.triggerSlug.toLowerCase())?(ez.c.debug("Trigger does not match triggerSlug filter",JSON.stringify(e.triggerSlug,null,2)),!1):e.triggerData&&e.triggerData!==t.metadata.triggerData?(ez.c.debug("Trigger does not match triggerData filter",JSON.stringify(e.triggerData,null,2)),!1):e.userId&&e.userId!==t.metadata.connectedAccount.userId?(ez.c.debug("Trigger does not match userId filter",JSON.stringify(e.userId,null,2)),!1):(ez.c.debug("Trigger matches all filters",JSON.stringify(e,null,2)),!0)}async subscribe(e,t={}){if(!e)throw Error("Function is required for trigger subscription");let r=oL.safeParse(t);if(!r.success)throw new eX("Invalid parameters passed to subscribe to triggers",{cause:r.error});ez.c.debug("🔄 Subscribing to triggers with filters: ",JSON.stringify(t,null,2)),await this.pusherService.subscribe(t=>{ez.c.debug("Received raw trigger data",JSON.stringify(t,null,2));let s=this.parsePusherPayload(t);if(this.shouldSendTriggerAfterFilters(r.data,s))try{e(s)}catch(e){ez.c.error("❌ Error in trigger callback:",e)}else ez.c.debug("Trigger does not match filters",JSON.stringify(r.data,null,2))})}tryParseVersionedPayload(e){let t=oH.safeParse(e);if(t.success)return{ok:!0,version:"V3",rawPayload:t.data,normalizedPayload:this.normalizeV3Payload(t.data)};let r=oq.safeParse(e);if(r.success)return{ok:!0,version:"V2",rawPayload:r.data,normalizedPayload:this.normalizeV2Payload(r.data)};let s=oK.safeParse(e);return s.success?{ok:!0,version:"V1",rawPayload:s.data,normalizedPayload:this.normalizeV1Payload(s.data)}:{ok:!1,v1Error:s.error.message,v2Error:r.error.message,v3Error:t.error.message}}parsePusherPayload(e){let t=this.tryParseVersionedPayload(e);if(t.ok)return ez.c.debug(`Parsed Pusher payload as ${t.version} format`),t.normalizedPayload;if(e.metadata?.nanoId&&e.appName)return ez.c.debug("Parsed Pusher payload as legacy TriggerData format"),om(e).with(oZ).using(e=>({id:e.metadata.nanoId,uuid:e.metadata.id,triggerSlug:e.metadata.triggerName,toolkitSlug:e.appName,userId:e.metadata.connection?.clientUniqueUserId,payload:e.payload,originalPayload:e.originalPayload,metadata:{id:e.metadata.nanoId,uuid:e.metadata.id,triggerConfig:e.metadata.triggerConfig,triggerSlug:e.metadata.triggerName,toolkitSlug:e.appName,triggerData:e.metadata.triggerData,connectedAccount:{id:e.metadata.connection?.connectedAccountNanoId,uuid:e.metadata.connection?.id,authConfigId:e.metadata.connection?.authConfigNanoId,authConfigUUID:e.metadata.connection?.integrationId,userId:e.metadata.connection?.clientUniqueUserId,status:e.metadata.connection?.status}}}));ez.c.warn("Unknown Pusher payload format. Payload keys: "+Object.keys(e).join(", "));let r=o1(e.id,o1(e.trigger_id,"unknown")),s=o1(e.uuid,o1(e.id,"unknown")),n=o1(e.triggerSlug,o1(e.trigger_name,"UNKNOWN")),i=o1(e.toolkitSlug,o1(e.appName,"UNKNOWN"));return{id:r,uuid:s,triggerSlug:n,toolkitSlug:i,userId:o1(e.userId,""),payload:e.payload||e,originalPayload:e.originalPayload||e,metadata:{id:r,uuid:s,triggerSlug:n,toolkitSlug:i,triggerConfig:{},connectedAccount:{id:"",uuid:"",authConfigId:"",authConfigUUID:"",userId:"",status:"ACTIVE"}}}}async unsubscribe(){await this.pusherService.unsubscribe()}async verifyWebhook(e){let t=oX.safeParse(e);if(!t.success){let e=t.error.issues.filter(e=>"invalid_type"===e.code&&"undefined"===e.received).map(e=>{let t=e.path[0],r={id:"webhook-id",timestamp:"webhook-timestamp",signature:"webhook-signature"}[t];return r?`'${t}' (from '${r}' header)`:`'${t}'`});if(e.length>0)throw new eX(`Missing required parameters: ${e.join(", ")}. Extract these values from the HTTP request headers and body.`,{cause:t.error});throw new eX("Invalid parameters passed to verifyWebhook",{cause:t.error})}let{payload:r,signature:s,secret:n,id:i,timestamp:o,tolerance:a}=t.data;a>0&&this.validateWebhookTimestamp(o,a),await this.verifyWebhookSignature(i,o,r,s,n);let{version:l,rawPayload:c,normalizedPayload:u}=this.parseWebhookPayload(r);return{version:l,payload:u,rawPayload:c}}parseWebhookPayload(e){let t;try{t=JSON.parse(e)}catch(e){throw new e3("Failed to parse webhook payload as JSON",{cause:e})}let r=this.tryParseVersionedPayload(t);if(r.ok){let{ok:e,...t}=r;return t}let{v1Error:s,v2Error:n,v3Error:i}=r;throw new e3("Webhook payload does not match any known version (V1, V2, or V3). Please ensure you are using a supported webhook payload format.",{cause:{v1Error:s,v2Error:n,v3Error:i}})}normalizeV1Payload(e){let t=e.trigger_name,r=t.split("_")[0]?.toUpperCase()||"UNKNOWN";return{id:e.trigger_id,uuid:e.trigger_id,triggerSlug:t,toolkitSlug:r,userId:"",payload:e.payload,originalPayload:e.payload,metadata:{id:e.trigger_id,uuid:e.trigger_id,toolkitSlug:r,triggerSlug:t,triggerConfig:{},connectedAccount:{id:e.connection_id,uuid:e.connection_id,authConfigId:"",authConfigUUID:"",userId:"",status:"ACTIVE"}}}}normalizeV2Payload(e){let t=e.type.toUpperCase(),r=t.split("_")[0]||"UNKNOWN",{connection_id:s,connection_nano_id:n,trigger_nano_id:i,trigger_id:o,user_id:a,...l}=e.data;return{id:i,uuid:o,triggerSlug:t,toolkitSlug:r,userId:a,payload:l,originalPayload:l,metadata:{id:i,uuid:o,toolkitSlug:r,triggerSlug:t,triggerConfig:{},connectedAccount:{id:n,uuid:s,authConfigId:"",authConfigUUID:"",userId:a,status:"ACTIVE"}}}}normalizeV3Payload(e){let t=oG.safeParse(e);if(t.success){let r=t.data.metadata.trigger_slug,s=r.split("_")[0]?.toUpperCase()||"UNKNOWN";return{id:t.data.metadata.trigger_id,uuid:t.data.metadata.trigger_id,triggerSlug:r,toolkitSlug:s,userId:t.data.metadata.user_id,payload:e.data,originalPayload:e.data,metadata:{id:t.data.metadata.trigger_id,uuid:t.data.metadata.trigger_id,toolkitSlug:s,triggerSlug:r,triggerConfig:{},connectedAccount:{id:t.data.metadata.connected_account_id,uuid:t.data.metadata.connected_account_id,authConfigId:t.data.metadata.auth_config_id,authConfigUUID:t.data.metadata.auth_config_id,userId:t.data.metadata.user_id,status:"ACTIVE"}}}}return{id:e.id,uuid:e.id,triggerSlug:e.type,toolkitSlug:"COMPOSIO",userId:"",payload:e.data,originalPayload:e,metadata:{id:e.id,uuid:e.id,toolkitSlug:"COMPOSIO",triggerSlug:e.type,triggerConfig:{},connectedAccount:{id:"",uuid:"",authConfigId:"",authConfigUUID:"",userId:"",status:"ACTIVE"}}}}async verifyWebhookSignature(e,t,r,s,n){if(0===r.length)throw new e5("No webhook payload was provided.");if(0===s.length)throw new e5("No signature header value was provided. Please pass the value of the 'webhook-signature' header.");if(0===n.length)throw new e5("No webhook secret was provided. You can find your webhook secret in your Composio dashboard.");if(0===e.length)throw new e5("No webhook ID was provided. Please pass the value of the 'webhook-id' header.");if(0===t.length)throw new e5("No webhook timestamp was provided. Please pass the value of the 'webhook-timestamp' header.");let i=s.split(" "),o=[];for(let e of i){let[t,r]=e.split(",");"v1"===t&&r&&o.push(r)}if(0===o.length)throw new e5("No valid v1 signature found in the webhook-signature header. Expected format: 'v1,base64EncodedSignature'");let a=await o0(n,`${e}.${t}.${r}`),l=!1;for(let e of o)if(function(e,t){if(e.length!==t.length)return!1;let r=0;for(let s=0;s<e.length;s++)r|=e.charCodeAt(s)^t.charCodeAt(s);return 0===r}(e,a)){l=!0;break}if(!l)throw new e5("The signature provided is invalid. Please ensure you are using the correct webhook secret.")}validateWebhookTimestamp(e,t){let r=parseInt(e,10);if(Number.isNaN(r))throw new e3(`Invalid webhook timestamp: ${e}. Expected Unix timestamp in seconds.`);let s=Math.abs(Date.now()-1e3*r);if(s>1e3*t)throw new e5(`The webhook timestamp is outside the allowed tolerance. The webhook was sent ${Math.round(s/1e3)} seconds ago, but the maximum allowed age is ${t} seconds.`)}};let o5=t$.object({id:t$.string(),name:t$.string(),type:t$.literal("streamable_http"),url:t$.string(),userId:t$.string(),allowedTools:t$.array(t$.string()),authConfigs:t$.array(t$.string())}),o3=t$.object({toolkit:t$.string().describe("Id of the toolkit").optional(),authConfigId:t$.string().describe("Id of the auth config").optional()}),o4=t$.object({toolkits:t$.array(t$.union([o3,t$.string()])),allowedTools:t$.array(t$.string()).optional(),manuallyManageConnections:t$.boolean().default(!1).optional().describe(`Whether to manually manage accounts. If true, you need to manage accounts manually connect user accounts.
|
|
18
|
-
If set to false, composio will inject account maangement tools into your mcp server for agents to request and authenticate accounts.
|
|
19
|
-
defaults to false`)}),o6=t$.object({id:t$.string(),name:t$.string(),allowedTools:t$.array(t$.string()),authConfigIds:t$.array(t$.string()),commands:t$.object({claude:t$.string(),cursor:t$.string(),windsurf:t$.string()}),MCPUrl:t$.string()}),o9=t$.object({manuallyManageConnections:t$.boolean().default(!1).optional().describe(`Whether to manually manage accounts. If true, you need to manage accounts manually connect user accounts.
|
|
20
|
-
If set to false, composio will inject account maangement tools into your mcp server for agents to request and authenticate accounts.
|
|
21
|
-
defaults to false`)}),o8=t$.object({page:t$.number().optional().default(1),limit:t$.number().optional().default(10),toolkits:t$.array(t$.string()).optional().default([]),authConfigs:t$.array(t$.string()).optional().default([]),name:t$.string().optional()}),o7=o6.extend({...t$.object({toolkitIcons:t$.record(t$.string(),t$.string()),serverInstanceCount:t$.number(),toolkits:t$.array(t$.string())}).shape}),ae=t$.object({items:t$.array(o7),currentPage:t$.number(),totalPages:t$.number()}),at=t$.object({name:t$.string().optional(),toolkits:t$.array(t$.union([o3,t$.string()])).optional(),allowedTools:t$.array(t$.string()).optional(),manuallyManageConnections:t$.boolean().optional().describe(`Whether to manually manage accounts. If true, you need to manage accounts manually connect user accounts.
|
|
22
|
-
If set to false, composio will inject account maangement tools into your mcp server for agents to request and authenticate accounts.
|
|
23
|
-
defaults to false`)});function ar(e){return om(e).with(o7).using(e=>({name:e.name,allowedTools:e.allowed_tools,id:e.id,authConfigIds:e.auth_config_ids,commands:e.commands,MCPUrl:e.mcp_url,toolkitIcons:e.toolkit_icons,serverInstanceCount:e.server_instance_count,toolkits:e.toolkits}))}t$.object({connected:t$.boolean(),toolkit:t$.string(),connectedAccountId:t$.string()}),t$.record(t$.string(),t$.array(t$.object({toolkit:t$.string(),authConfigId:t$.string(),connectedAccountId:t$.string()})));var as=class{client;constructor(e){this.client=e,tr.instrument(this,"MCP")}async create(e,t){let r=o4.safeParse(t);if(r.error)throw new eX("Invalid parameters passed to create mcp config",{cause:r.error});let s=[],n=[],i=r.data.allowedTools??[];r.data.toolkits.forEach(e=>{"string"==typeof e?s.push(e):e.toolkit?s.push(e.toolkit):e.authConfigId&&n.push(e.authConfigId)});let o=await this.client.mcp.custom.create({name:e,toolkits:s,auth_config_ids:n,custom_tools:i,managed_auth_via_composio:!r.data.manuallyManageConnections});return{...om(o).with(o6).using(e=>({name:e.name,allowedTools:e.allowed_tools,id:e.id,authConfigIds:e.auth_config_ids,commands:e.commands,MCPUrl:e.mcp_url})),generate:async e=>await this.generate(e,o.id,{manuallyManageConnections:r.data.manuallyManageConnections})}}async list(e){let{data:t,error:r}=o8.safeParse(e);if(r)throw new eX("Failed to validate list options",{cause:r});return om(await this.client.mcp.list({page_no:t.page,limit:t.limit,toolkits:t.toolkits?.length>0?t.toolkits.join(","):void 0,auth_config_ids:t.authConfigs?.length>0?t.authConfigs.join(","):void 0,name:t.name})).with(ae).using(e=>({currentPage:e.current_page,totalPages:e.total_pages,items:e.items.map(e=>({name:e.name,allowedTools:e.allowed_tools,id:e.id,authConfigIds:e.auth_config_ids,commands:e.commands,MCPUrl:e.mcp_url,toolkitIcons:e.toolkit_icons,serverInstanceCount:e.server_instance_count,toolkits:e.toolkits}))}))}async get(e){return ar(await this.client.mcp.retrieve(e))}async delete(e){return await this.client.mcp.delete(e)}async update(e,t){let{data:r,error:s}=at.safeParse(t);if(s)throw new eX("Failed to validate update params",{cause:s});let n=[],i=[],o=r.allowedTools??void 0;return r.toolkits?.forEach(e=>{"string"==typeof e?n.push(e):e.toolkit?n.push(e.toolkit):e.authConfigId&&i.push(e.authConfigId)}),ar(await this.client.mcp.update(e,{name:r.name??void 0,...r.toolkits?{custom_tools:o,toolkits:n,auth_config_ids:i}:{},managed_auth_via_composio:r.manuallyManageConnections??void 0}))}async generate(e,t,r){let s=await this.client.mcp.retrieve(t),n=o9.safeParse(r??{manuallyManageConnections:!1});if(n.error)throw new eX("Invalid params passed for Get Instance Params",{cause:n.error});let i=(await this.client.mcp.generate.url({mcp_server_id:t,user_ids:[e],managed_auth_by_composio:!r?.manuallyManageConnections})).user_ids_url[0],o=o5.safeParse({id:s.id,name:s.name,type:"streamable_http",url:i,userId:e,allowedTools:s.allowed_tools,authConfigs:s.auth_config_ids});if(o.error)throw new eX("Failed to parse MCP server instance",{cause:o.error});return o.data}};async function an(e){try{if(!nz.default.valid(e))return;let t=nz.default.prerelease(e);if(t&&(String(t[0]).includes("alpha")||String(t[0]).includes("beta")))return;let r=(await (await fetch("https://registry.npmjs.org/@composio/core/latest")).json()).version;nz.default.gt(r,e)&&!ez.p&&ez.c.info(`🚀 Upgrade available! Your composio-core version (${e}) is behind. Latest version: ${r}.`)}catch(e){}}var ai=class{_globalExecuteToolFn;_setExecuteToolFn(e){this._globalExecuteToolFn=e}executeTool(e,t,r){if(!this._globalExecuteToolFn)throw new eZ("executeToolFn is not set");return this._globalExecuteToolFn(e,t,r)}},ao=class extends ai{_isAgentic=!1},aa=class extends ai{_isAgentic=!0},al=class extends ao{name="openai";constructor(){super()}wrapMcpServerResponse(e){return e.map(e=>({url:new URL(e.url),name:e.name}))}wrapTool=e=>({type:"function",function:{name:e.slug,description:e.description,parameters:e.inputParameters}});wrapTools=e=>e.map(e=>this.wrapTool(e));async executeToolCall(e,t,r,s){let n={arguments:JSON.parse(t.function.arguments),connectedAccountId:r?.connectedAccountId,customAuthParams:r?.customAuthParams,customConnectionData:r?.customConnectionData,userId:e};return JSON.stringify(await this.executeTool(t.function.name,n,s))}async handleToolCalls(e,t,r,s){let n=[];for(let i of t.choices)if(i.message.tool_calls&&"function"===i.message.tool_calls[0].type){let t=await this.executeToolCall(e,i.message.tool_calls[0],r,s);n.push({role:"tool",tool_call_id:i.message.tool_calls[0].id,content:t})}return n}async handleAssistantMessage(e,t,r,s){let n=t.required_action?.submit_tool_outputs?.tool_calls||[];return await Promise.all(n.map(async t=>{ez.c.debug(`Executing tool call: ${t.id}`);let n=await this.executeToolCall(e,t,r,s);return ez.c.debug(`Tool call ${t.id} executed with response: ${n}`),{tool_call_id:t.id,output:JSON.stringify(n)}}))}async *waitAndHandleAssistantStreamToolCalls(e,t,r,s,n,i){let o=null;for await(let a of r){if(yield a,"thread.run.created"===a.event){let{id:e}=a.data;o=e}if(o){if("thread.run.requires_action"===a.event){let r=await this.handleAssistantMessage(e,a.data,n,i);await t.beta.threads.runs.submitToolOutputs(o,{thread_id:s.id,tool_outputs:r})}if(["thread.run.completed","thread.run.failed","thread.run.cancelled","thread.run.expired"].includes(a.event))break}}if(!o)throw Error("No run ID found");let a=await t.beta.threads.runs.retrieve(o,{thread_id:s.id});for(;["queued","in_progress","requires_action"].includes(a.status);)if("requires_action"===a.status){let r=await this.handleAssistantMessage(e,a,n,i);a=await t.beta.threads.runs.submitToolOutputs(o,{thread_id:s.id,tool_outputs:r})}else a=await t.beta.threads.runs.retrieve(o,{thread_id:s.id}),await new Promise(e=>setTimeout(e,500))}async waitAndHandleAssistantToolCalls(e,t,r,s,n,i){for(;["queued","in_progress","requires_action"].includes(r.status);){let o=await this.handleAssistantMessage(e,r,n,i);"requires_action"===r.status?r=await t.beta.threads.runs.submitToolOutputs(r.id,{thread_id:s.id,tool_outputs:o}):(r=await t.beta.threads.runs.retrieve(r.id,{thread_id:s.id}),await new Promise(e=>setTimeout(e,500)))}return r}},ac="0.8.0";let au=function(){let e=globalThis;if("Bun"in e&&void 0!==e.Bun)return"BUN";if("Deno"in e&&void 0!==e.Deno)return"DENO";if("u">typeof process&&process.versions&&process.versions.node)return"NODEJS";if("caches"in e&&void 0!==e.caches&&"WebSocketPair"in e&&void 0!==e.WebSocketPair)return"CLOUDFLARE_WORKERS";if("EdgeRuntime"in e&&void 0!==e.EdgeRuntime)return"VERCEL_EDGE";if("ServiceWorkerGlobalScope"in e&&void 0!==e.ServiceWorkerGlobalScope){let t=e.ServiceWorkerGlobalScope;if(t&&e instanceof t)return"SERVICE_WORKER"}return"WorkerGlobalScope"in e&&void 0!==e.WorkerGlobalScope&&"importScripts"in e&&"function"==typeof e.importScripts?"WEB_WORKER":"u">typeof navigator&&"ReactNative"===navigator.product?"REACT_NATIVE":"UNKNOWN"}(),ad=(e,t)=>{let r={"x-framework":t?.name||"unknown","x-source":"TYPESCRIPT_SDK","x-runtime":au,"x-sdk-version":ac};return{...e||{},...r}},ah=t$.enum(["http","sse"]),ap=t$.object({enable:t$.boolean().default(!0).optional().describe("Whether to use tools to manage connections in the tool router session. Defaults to true, if set to false, you need to manage connections manually"),callbackUrl:t$.string().optional().describe("The callback uri to use in the tool router session"),waitForConnections:t$.boolean().optional().describe("Whether to wait for users to finish authenticating connections before proceeding to the next step. Defaults to false, if set to true, a wait for connections tool call will happen and finish when the connections are ready")}).strict(),af=t$.array(t$.string()).describe("List of toolkits to enable in the tool router session"),am=t$.object({disable:af.describe("List of toolkits to disable in the tool router session")}).strict(),ag=t$.object({enable:af.describe("List of toolkits to enable in the tool router session")}).strict();t$.object({enable:t$.boolean().optional().describe("Whether to use tools to manage connections in the tool router session. Defaults to true, if set to false, you need to manage connections manually").default(!0),callbackUrl:t$.string().optional().describe("The callback url to use in the tool router session")});let ay=t$.array(t$.enum(["readOnlyHint","destructiveHint","idempotentHint","openWorldHint"])).describe("The tags to filter the tools by"),ab=t$.object({enable:ay.optional().describe("The tags to enable in the tool router session"),disable:ay.optional().describe("The tags to disable in the tool router session")}).strict(),a_=t$.union([ay,ab]).describe("The tags to use in the tool router session"),aw=t$.array(t$.string()).describe("The tools to use in the tool router session"),av=t$.union([aw,t$.object({enable:aw.describe("The tools to enable in the tool router session")}).strict(),t$.object({disable:aw.describe("The tools to disable in the tool router session")}).strict(),t$.object({tags:a_.describe("The tags to filter the tools by, this will override the global tags")}).strict()]).superRefine((e,t)=>{if("object"==typeof e&&!Array.isArray(e)){let r=Object.keys(e);r.length>1&&t.addIssue({code:t$.ZodIssueCode.custom,message:`Only one of 'enable', 'disable', or 'tags' can be specified, but found: ${r.join(", ")}`,path:r})}}),aI=t$.object({tools:t$.record(t$.string(),t$.union([aw,av])).optional().describe("The tools to use in the tool router session"),tags:a_.optional().describe("Global tags to filter the tools by"),toolkits:t$.union([af,am,ag]).optional().describe("The toolkits to use in the tool router session"),authConfigs:t$.record(t$.string(),t$.string()).describe("The auth configs to use in the tool router session. The key is the toolkit slug, the value is the auth config id.").default({}),connectedAccounts:t$.record(t$.string(),t$.string()).describe("The connected accounts to use in the tool router session. The key is the toolkit slug, the value is the connected account id.").default({}),manageConnections:t$.union([t$.boolean(),ap]).optional().default(!0).describe("The config for the manage connections in the tool router session. Defaults to true, if set to false, you need to manage connections manually. If set to an object, you can configure the manage connections settings."),workbench:t$.object({enable:t$.boolean().default(!0).describe("Whether to enable the workbench entirely. Defaults to true. When set to false, no code execution tools (COMPOSIO_REMOTE_WORKBENCH, COMPOSIO_REMOTE_BASH_TOOL) are available in the session."),enableProxyExecution:t$.boolean().optional().describe("Whether to enable proxy execution in the tool router session"),autoOffloadThreshold:t$.number().optional().describe("The auto offload threshold in characters for the tool execution to be moved into workbench")}).optional().describe("The workbench config for the tool router session"),multiAccount:t$.object({enable:t$.boolean().default(!1).describe("When true, enables multi-account mode for this session. Defaults to false."),maxAccountsPerToolkit:t$.number().int().min(2).max(10).optional().describe("Maximum number of connected accounts allowed per toolkit. Defaults to 5 when multi-account is enabled."),requireExplicitSelection:t$.boolean().optional().describe("When true, require explicit account selection when multiple accounts are connected. When false (default), use the first/default account.")}).optional().describe("Multi-account configuration for this session"),experimental:t$.object({assistivePrompt:t$.object({userTimezone:t$.string().optional().describe('IANA timezone identifier (e.g., "America/New_York", "Europe/London") for timezone-aware assistive prompts')}).optional().describe("Configuration for assistive prompt generation"),customTools:t$.array(t$.custom()).optional().describe("Custom tools to include in this session. Created via createCustomTool() from @composio/core/experimental."),customToolkits:t$.array(t$.custom()).optional().describe("Custom toolkits to include in this session. Created via createCustomToolkit() from @composio/core/experimental.")}).optional().describe("Experimental features configuration - not stable, may be modified or removed")}).partial().describe("The config for the tool router session"),ak=t$.object({slug:t$.string().describe("The slug of a toolkit"),name:t$.string().describe("The name of a toolkit"),logo:t$.string().optional().describe("The logo of a toolkit"),isNoAuth:t$.boolean().default(!1).describe("Whether the toolkit is no auth or not"),connection:t$.object({isActive:t$.boolean().describe("Whether the connection is active or not"),authConfig:t$.object({id:t$.string().describe("The id of the auth config"),mode:t$.string().describe("The auth scheme used by the auth config"),isComposioManaged:t$.boolean().describe("Whether the auth config is managed by Composio")}).nullish().describe("The auth config of a toolkit"),connectedAccount:t$.object({id:t$.string().describe("The id of the connected account"),status:t$.string().describe("The status of the connected account")}).optional().describe("The connected account of a toolkit")}).optional().describe("The connection of a toolkit")}).describe("The connection state of a toolkit");t$.object({items:t$.array(ak),cursor:t$.string().optional(),totalPages:t$.number()}),t$.object({type:ah,url:t$.string(),headers:t$.record(t$.string(),t$.string()).optional()});let ax=t$.object({toolkits:t$.array(t$.string()).optional(),cursor:t$.string().optional(),limit:t$.number().optional(),isConnected:t$.boolean().optional(),search:t$.string().optional()}),aT=t$.object({code:t$.string(),description:t$.string()}),aE=t$.object({index:t$.number(),useCase:t$.string(),primaryToolSlugs:t$.array(t$.string()),relatedToolSlugs:t$.array(t$.string()),toolkits:t$.array(t$.string()),difficulty:t$.string().optional(),error:t$.string().nullable().optional(),executionGuidance:t$.string().optional(),knownPitfalls:t$.array(t$.string()).optional(),memory:t$.record(t$.string(),t$.array(t$.string())).optional(),planId:t$.string().optional(),recommendedPlanSteps:t$.array(t$.string()).optional(),referenceWorkbenchSnippets:t$.array(aT).optional()}),az=t$.object({id:t$.string(),generateId:t$.boolean(),instructions:t$.string()}),aA=t$.object({currentTimeUtc:t$.string(),currentTimeUtcEpochSeconds:t$.number(),message:t$.string()}),aS=t$.object({args:t$.object({toolSlugs:t$.array(t$.string())}),message:t$.string().optional(),tool:t$.literal("COMPOSIO_GET_TOOL_SCHEMAS")}),aC=t$.object({toolSlug:t$.string(),toolkit:t$.string(),description:t$.string().optional(),hasFullSchema:t$.boolean().optional(),inputSchema:t$.record(t$.string(),t$.unknown()).optional(),outputSchema:t$.record(t$.string(),t$.unknown()).optional(),schemaRef:aS.optional()}),aO=t$.object({toolkit:t$.string(),description:t$.string(),hasActiveConnection:t$.boolean(),statusMessage:t$.string(),connectionDetails:t$.record(t$.string(),t$.unknown()).optional(),currentUserInfo:t$.record(t$.string(),t$.unknown()).optional()}),aP=t$.object({success:t$.boolean(),error:t$.string().nullable(),results:t$.array(aE),toolSchemas:t$.record(t$.string(),aC),toolkitConnectionStatuses:t$.array(aO),nextStepsGuidance:t$.array(t$.string()),session:az,timeInfo:aA}),aR=t$.object({data:t$.record(t$.string(),t$.unknown()),error:t$.string().nullable(),logId:t$.string()}),a$=t$.object({toolkit:t$.string(),endpoint:t$.string(),method:t$.enum(["GET","POST","PUT","DELETE","PATCH"]),body:t$.unknown().optional(),parameters:t$.array(t$.object({in:t$.enum(["query","header"]),name:t$.string(),value:t$.union([t$.string(),t$.number()])})).optional()}),aN=e=>{if(e){if(Array.isArray(e))return{enable:e};else if("object"==typeof e)return{enable:e.enable,disable:e.disable}}};function aj(e){return{index:e.index,useCase:e.use_case,primaryToolSlugs:e.primary_tool_slugs,relatedToolSlugs:e.related_tool_slugs,toolkits:e.toolkits,difficulty:e.difficulty,error:e.error,executionGuidance:e.execution_guidance,knownPitfalls:e.known_pitfalls,memory:e.memory,planId:e.plan_id,recommendedPlanSteps:e.recommended_plan_steps,referenceWorkbenchSnippets:e.reference_workbench_snippets}}function aL(e){return{toolkit:e.toolkit,description:e.description,hasActiveConnection:e.has_active_connection,statusMessage:e.status_message,connectionDetails:e.connection_details,currentUserInfo:e.current_user_info}}function aD(e){return{data:e.data,error:e.error,logId:e.log_id}}let aU=t$.object({path:t$.string().optional(),mountId:t$.string().default(ez.f),cursor:t$.string().optional(),limit:t$.number().min(1).max(500).optional()}),aF=t$.object({last_modified:t$.string(),mount_relative_path:t$.string(),sandbox_mount_prefix:t$.string(),size:t$.number()}),aM=t$.object({items:t$.array(aF),next_cursor:t$.string().optional()}).transform(e=>({items:e.items.map(e=>({lastModified:e.last_modified,mountRelativePath:e.mount_relative_path,sandboxMountPrefix:e.sandbox_mount_prefix,size:e.size})),nextCursor:e.next_cursor})),aZ=t$.object({remotePath:t$.string().optional(),mountId:t$.string().default(ez.f),mimetype:t$.string().optional()}),aB=t$.object({mountId:t$.string().default(ez.f)}),aV=t$.object({mountId:t$.string().default(ez.f)}),aW=t$.object({expires_at:t$.string(),mount_relative_path:t$.string(),sandbox_mount_prefix:t$.string(),download_url:t$.string()}).transform(e=>({expiresAt:e.expires_at,mountRelativePath:e.mount_relative_path,sandboxMountPrefix:e.sandbox_mount_prefix,downloadUrl:e.download_url})),aK=t$.object({mount_relative_path:t$.string(),sandbox_mount_prefix:t$.string()}).transform(e=>({mountRelativePath:e.mount_relative_path,sandboxMountPrefix:e.sandbox_mount_prefix}));var aq=class e{expiresAt;mountRelativePath;sandboxMountPrefix;downloadUrl;constructor(e){this.expiresAt=e.expiresAt,this.mountRelativePath=e.mountRelativePath,this.sandboxMountPrefix=e.sandboxMountPrefix,this.downloadUrl=e.downloadUrl}static parse(t){let r=aW.safeParse(t);if(!r.success)throw new eX("Failed to parse remote file response",{cause:r.error});return new e(r.data)}get filename(){return tp.basename(this.mountRelativePath)}async buffer(){let e=await fetch(this.downloadUrl);if(!e.ok)throw new e4(`Failed to download file: ${e.status} ${e.statusText}`,{statusCode:e.status,statusText:e.statusText,downloadUrl:this.downloadUrl,mountRelativePath:this.mountRelativePath,filename:this.filename,cause:Error(`HTTP ${e.status}: ${e.statusText}`)});return new Uint8Array(await e.arrayBuffer())}async text(){let e=await this.buffer();return new TextDecoder().decode(e)}async blob(){let e=await fetch(this.downloadUrl);if(!e.ok)throw new e4(`Failed to download file: ${e.status} ${e.statusText}`,{statusCode:e.status,statusText:e.statusText,downloadUrl:this.downloadUrl,mountRelativePath:this.mountRelativePath,filename:this.filename,cause:Error(`HTTP ${e.status}: ${e.statusText}`)});return e.blob()}async save(e){let t;if(!tp.supportsFileSystem)throw Error("File system operations are not supported in this runtime (e.g. Cloudflare Workers). Use buffer(), text(), or blob() to work with the file content in memory, or run in Node.js.");let r=await this.buffer(),s=tp.homedir();if(!s)throw Error("Cannot determine save location: home directory is not available");let n=e??tp.joinPath(s,ez.l,ez.m,this.filename),i=null!=e?(t=Math.max(n.lastIndexOf("/"),n.lastIndexOf("\\")))<=0?"":n.slice(0,t):tp.joinPath(s,ez.l,ez.m);return i&&!tp.existsSync(i)&&tp.mkdirSync(i),tp.writeFileSync(n,r),n}};function aH(e){let t={"text/plain":"txt","text/html":"html","text/css":"css","text/javascript":"js","application/json":"json","application/xml":"xml","application/pdf":"pdf","application/zip":"zip","application/x-zip-compressed":"zip","application/gzip":"gz","application/octet-stream":"bin","application/x-tar":"tar","application/msword":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.ms-excel":"xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-powerpoint":"ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","image/jpeg":"jpg","image/jpg":"jpg","image/png":"png","image/gif":"gif","image/svg+xml":"svg","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff","audio/mpeg":"mp3","audio/wav":"wav","audio/ogg":"ogg","video/mp4":"mp4","video/mpeg":"mpeg","video/quicktime":"mov","video/x-msvideo":"avi","video/webm":"webm"},r=e.split(";")[0].toLowerCase().trim();if(t[r])return t[r];let s=r.split("/");if(2===s.length){let e=s[1].toLowerCase();if(e.includes("+")){let t=e.split("+"),r=t[0],s=t[t.length-1];return["svg","atom","rss"].includes(r)?r:(["json","xml","yaml","zip","gzip"].includes(s),s)}return e||"txt"}return"bin"}var aG=class{sessionId;client;constructor(e,t){this.client=e,this.sessionId=t,tr.instrument(this,"ToolRouterSessionFiles")}async list(e){let t=aU.safeParse(e??{});if(!t.success)throw new eX("Failed to parse tool router session files mount list options",{cause:t.error});let r=t.data.path,s=void 0===r||""===r||"/"===r?void 0:r.startsWith("/")?r.slice(1):r,n=await this.client.toolRouter.session.files.list(t.data.mountId,{session_id:this.sessionId,mount_relative_prefix:s,cursor:t.data.cursor,limit:t.data.limit}),i="object"==typeof n&&"body"in n?n.body:n,o=aM.safeParse(i);if(!o.success)throw new eX("Failed to parse file list response",{cause:o.error});return o.data}async normalizeUploadInput(e,t){if("string"==typeof e){if(e.startsWith("http://")||e.startsWith("https://")){let r=await fetch(e);if(!r.ok)throw Error(`Failed to fetch file from URL: ${r.statusText}`);let s=await r.arrayBuffer(),n=(r.headers.get("content-type")||"application/octet-stream").split(";")[0].trim(),i=new URL(e).pathname.split("/").filter(Boolean),o=i.length>0?i[i.length-1]:"";if(!o||!o.includes(".")){let e=aH(n);o=`${e9()}.${e}`}return{fileToUpload:new File([s],o,{type:n}),remotePath:t.remotePath??o,mimetype:n}}let r=tp.readFileSync(e),s=r instanceof Uint8Array?new Uint8Array(r):new TextEncoder().encode(r),n=tp.basename(e),i=t.mimetype??"application/octet-stream";return{fileToUpload:new File([s],n,{type:i}),remotePath:t.remotePath??n,mimetype:i}}if(e instanceof File)return{fileToUpload:e,remotePath:t.remotePath??(e.name||`upload-${e9()}.bin`),mimetype:e.type||"application/octet-stream"};let r=e instanceof ArrayBuffer?new Uint8Array(e):e;if(!t.mimetype&&!t.remotePath)throw Error('When passing a buffer, either mimetype or remotePath (filename) is required. Example: files.upload(buffer, { remotePath: "data.json", mimetype: "application/json" })');let s=t.mimetype??"application/octet-stream",n=aH(s),i=t.remotePath??`upload-${e9()}.${n}`;return{fileToUpload:new File([r],i,{type:s}),remotePath:i,mimetype:s}}async upload(e,t){let r=aZ.safeParse(t??{});if(!r.success)throw new eX("Failed to parse tool router session files mount upload options",{cause:r.error});let{fileToUpload:s,remotePath:n,mimetype:i}=await this.normalizeUploadInput(e,r.data),o=await this.client.toolRouter.session.files.createUploadURL(r.data.mountId,{session_id:this.sessionId,mount_relative_path:n,mimetype:i}),a="object"==typeof o&&"body"in o?o.body:o,l=await fetch(a.upload_url,{method:"PUT",body:await s.arrayBuffer(),headers:{"Content-Type":i}});if(!l.ok)throw Error(`Failed to upload file: ${l.statusText}`);let c=await this.client.toolRouter.session.files.createDownloadURL(r.data.mountId,{session_id:this.sessionId,mount_relative_path:a.mount_relative_path}),u="object"==typeof c&&"body"in c?c.body:c,d=aW.safeParse(u);if(!d.success)throw new eX("Failed to parse remote file properties",{cause:d.error});return new aq(d.data)}async download(e,t){let r=aB.safeParse(t??{});if(!r.success)throw new eX("Failed to parse tool router session files mount download options",{cause:r.error});let s=await this.client.toolRouter.session.files.createDownloadURL(r.data.mountId,{session_id:this.sessionId,mount_relative_path:e}),n="object"==typeof s&&"body"in s?s.body:s,i=aW.safeParse(n);if(!i.success)throw new eX("Failed to parse remote file properties",{cause:i.error});return new aq(i.data)}async delete(e,t){let r=aV.safeParse(t??{});if(!r.success)throw new eX("Failed to parse tool router session files mount delete options",{cause:r.error});let s=await this.client.toolRouter.session.files.delete(r.data.mountId,{session_id:this.sessionId,mount_relative_path:e}),n=aK.safeParse(s);if(!n.success)throw new eX("Failed to parse file delete response",{cause:n.error});return n.data}};function aX(e){let t=e.parameters?.map(e=>({name:e.name,type:e.in,value:e.value.toString()}));return{toolkit_slug:e.toolkit,endpoint:e.endpoint,method:e.method,...void 0!==e.body?{body:e.body}:{},...t?.length?{parameters:t}:{}}}function aJ(e,t){if(!e)return;let r=t.toUpperCase();return e.byFinalSlug.get(r)??e.byOriginalSlug.get(r)}async function aY(e,t,r){let{handle:s}=e,n=s.inputParams.safeParse(t);if(!n.success)return{data:{},error:`Input validation failed: ${n.error.message}`,successful:!1};try{return{data:await s.execute(n.data,r)??{},error:null,successful:!0}}catch(e){return{data:{},error:e instanceof Error?e.message:String(e),successful:!1}}}var aQ=class{userId;constructor(e,t,r,s){this.client=e,this.sessionId=r,this.customToolsMap=s,this.userId=t}async execute(e,t){let r=aJ(this.customToolsMap,e);if(r){let e=await aY(r,t,this);return aR.parse({data:e.data,error:e.error,logId:""})}let s=await this.client.toolRouter.session.execute(this.sessionId,{tool_slug:e,arguments:t});return aR.parse(aD(s))}async proxyExecute(e){let t=a$.safeParse(e);if(!t.success)throw new eX("Invalid proxy execute parameters",{cause:t.error});let r=aX(t.data),s=await this.client.toolRouter.session.proxyExecute(this.sessionId,r);return{status:s.status,data:s.data,headers:s.headers,...s.binary_data?{binaryData:{contentType:s.binary_data.content_type,size:s.binary_data.size,url:s.binary_data.url,expiresAt:s.binary_data.expires_at}}:{}}}};let a0="COMPOSIO_MULTI_EXECUTE_TOOL";var a1=class{sessionId;mcp;experimental;sessionContext;constructor(e,t,r,s,n,i,o){if(this.client=e,this.config=t,this.customToolsMap=i,this.userId=o,i&&!o)throw Error("userId is required when custom tools are bound to a session.");this.sessionId=r,this.mcp=s,this.experimental={assistivePrompt:n?.assistivePrompt,files:new aG(e,r)},i&&o&&(this.sessionContext=new aQ(e,o,r,i)),tr.instrument(this,"ToolRouterSession")}async tools(e){let t=new ow(this.client,this.config),r=await t.getRawToolRouterMetaTools(this.sessionId,e?.modifySchema?{modifySchema:e.modifySchema}:void 0);if(this.hasCustomTools()){let s=async(r,s)=>r===a0?this.routeMultiExecute(s,t,e):t.executeMetaTool(r,{sessionId:this.sessionId,arguments:s},e);if(!this.config?.provider)throw Error("A provider is required when using custom tools with session.tools(). Pass a provider in the Composio constructor.");return this.config.provider.wrapTools(r,s)}return t.wrapToolsForToolRouter(this.sessionId,r,e)}customTools(e){if(!this.customToolsMap)return[];let t=Array.from(this.customToolsMap.byFinalSlug.values());return(e?.toolkit?t.filter(t=>t.toolkit?.toLowerCase()===e.toolkit.toLowerCase()):t).map(e=>({slug:e.finalSlug,name:e.handle.name,description:e.handle.description,toolkit:e.toolkit,inputSchema:e.handle.inputSchema,outputSchema:e.handle.outputSchema}))}customToolkits(){let e=this.customToolsMap?.toolkits;return e?.length?e.map(e=>({slug:e.slug,name:e.name,description:e.description,tools:e.tools.map(t=>({slug:this.customToolsMap.byOriginalSlug.get(t.slug.toUpperCase())?.finalSlug??t.slug,name:t.name,description:t.description,toolkit:e.slug,inputSchema:t.inputSchema,outputSchema:t.outputSchema}))})):[]}async authorize(e,t){let r=await this.client.toolRouter.session.link(this.sessionId,{toolkit:e,...t?.callbackUrl&&{callback_url:t.callbackUrl},...t?.alias!=null&&{alias:t.alias}});return o$(this.client,r.connected_account_id,os,r.redirect_url)}async toolkits(e){let t=ax.safeParse(e??{});if(!t.success)throw new eX("Failed to parse toolkits options",{cause:t.error});let r=await this.client.toolRouter.session.toolkits(this.sessionId,{cursor:t.data.cursor,limit:t.data.limit,toolkits:t.data.toolkits,is_connected:t.data.isConnected,search:t.data.search});return{items:r.items.map(e=>om(e).with(ak).using(e=>({slug:e.slug,name:e.name,logo:e.meta?.logo,isNoAuth:e.is_no_auth,connection:e.is_no_auth?void 0:{isActive:e.connected_account?.status==="ACTIVE",authConfig:e.connected_account&&{id:e.connected_account?.auth_config.id,mode:e.connected_account?.auth_config.auth_scheme,isComposioManaged:e.connected_account?.auth_config.is_composio_managed},connectedAccount:e.connected_account?{id:e.connected_account.id,status:e.connected_account.status}:void 0}}))),cursor:r.next_cursor??void 0,totalPages:r.total_pages}}async search(e){let t=function(e){let t={};for(let[r,s]of Object.entries(e.tool_schemas))t[r]={toolSlug:s.tool_slug,toolkit:s.toolkit,description:s.description,hasFullSchema:s.hasFullSchema,inputSchema:s.input_schema,outputSchema:s.output_schema,schemaRef:s.schemaRef?{args:{toolSlugs:s.schemaRef.args.tool_slugs},message:s.schemaRef.message,tool:s.schemaRef.tool}:void 0};return{success:e.success,error:e.error,results:e.results.map(aj),toolSchemas:t,toolkitConnectionStatuses:e.toolkit_connection_statuses.map(aL),nextStepsGuidance:e.next_steps_guidance,session:{id:e.session.id,generateId:e.session.generate_id,instructions:e.session.instructions},timeInfo:{currentTimeUtc:e.time_info.current_time_utc,currentTimeUtcEpochSeconds:e.time_info.current_time_utc_epoch_seconds,message:e.time_info.message}}}(await this.client.toolRouter.session.search(this.sessionId,{queries:[{use_case:e.query}],...e.toolkits?.length?{toolkits:e.toolkits}:{}}));return aP.parse(t)}async execute(e,t){let r=aJ(this.customToolsMap,e);if(r){let e=await aY(r,t??{},this.sessionContext);return{data:e.data,error:e.error,logId:""}}let s=aD(await this.client.toolRouter.session.execute(this.sessionId,{tool_slug:e,arguments:t??{}}));return aR.parse(s)}async proxyExecute(e){let t=a$.safeParse(e);if(!t.success)throw new eX("Invalid proxy execute parameters",{cause:t.error});let r=aX(t.data),s=await this.client.toolRouter.session.proxyExecute(this.sessionId,r);return{status:s.status,data:s.data,headers:s.headers,...s.binary_data?{binaryData:{contentType:s.binary_data.content_type,size:s.binary_data.size,url:s.binary_data.url,expiresAt:s.binary_data.expires_at}}:{}}}hasCustomTools(){return(this.customToolsMap?.byFinalSlug.size??0)>0}parseToolItem(e){return"object"!=typeof e||null===e?{tool_slug:"",arguments:{}}:{tool_slug:String(e.tool_slug??""),arguments:e.arguments??{}}}async routeMultiExecute(e,t,r){let s,n=e.tools;if(!Array.isArray(n)||0===n.length)return t.executeMetaTool(a0,{sessionId:this.sessionId,arguments:e},r);let i=n.map(e=>this.parseToolItem(e)),o=[],a=[];for(let e=0;e<i.length;e++){let t=aJ(this.customToolsMap,i[e].tool_slug);t?o.push({index:e,entry:t}):a.push(e)}if(0===o.length)return t.executeMetaTool(a0,{sessionId:this.sessionId,arguments:e},r);let l=this.sessionContext,c=o.map(async({index:e,entry:t})=>({index:e,result:await aY(t,i[e].arguments,l)}));if(a.length>0){let i=a.map(e=>n[e]),o={...e,tools:i};s=t.executeMetaTool(a0,{sessionId:this.sessionId,arguments:o},r)}let[u,d]=await Promise.all([Promise.all(c),s]);if(0===a.length&&1===u.length)return u[0].result;let h=d?.data&&"object"==typeof d.data&&!Array.isArray(d.data)?d.data:{},p=Array.isArray(h.results)?h.results:[],f=u.map(({index:e,result:t})=>({response:{successful:t.successful,data:t.data,...t.error?{error:t.error}:{}},tool_slug:i[e].tool_slug,...t.error?{error:t.error}:{}})),m=[...p,...f].map((e,t)=>({...e,index:t})),g=m.filter(e=>e.error).length,y={...h,results:m};f.length>0&&["total_count","success_count","error_count"].some(e=>e in h)&&(y.total_count=m.length,y.success_count=m.length-g,y.error_count=g);let b="string"==typeof d?.error?d.error:null,_=u.some(e=>e.result.error)||!!b;return{data:y,error:_?b&&0===g?b:`${g} out of ${m.length} tools failed`:null,successful:!_}}},a2=class{constructor(e,t){this.client=e,this.config=t,tr.instrument(this,"ToolRouter")}createMCPServerConfig({type:e,url:t}){return{type:e,url:t,headers:{...this.config?.apiKey?{"x-api-key":this.config.apiKey}:{}}}}async create(e,t){let r,s=aI.parse(t??{}),n=s.experimental?.customTools,i=s.experimental?.customToolkits,o={};s.experimental?.assistivePrompt?.userTimezone&&(o.assistive_prompt_config={user_timezone:s.experimental.assistivePrompt.userTimezone}),n?.length&&(o.custom_tools=n.map(e=>({slug:e.slug,name:e.name,description:e.description,input_schema:e.inputSchema,...e.outputSchema?{output_schema:e.outputSchema}:{},...e.extendsToolkit?{extends_toolkit:e.extendsToolkit}:{}}))),i?.length&&(o.custom_toolkits=i.map(e=>({slug:e.slug,name:e.name,description:e.description,tools:e.tools.map(e=>({slug:e.slug,name:e.name,description:e.description,input_schema:e.inputSchema,...e.outputSchema?{output_schema:e.outputSchema}:{}}))})));let a=(e=>{if(!e)return;let t={enable:e.enable,max_accounts_per_toolkit:e.maxAccountsPerToolkit,require_explicit_selection:e.requireExplicitSelection};if(void 0!==t.enable||void 0!==t.max_accounts_per_toolkit||void 0!==t.require_explicit_selection)return t})(s.multiAccount),l={user_id:e,auth_configs:s.authConfigs,connected_accounts:s.connectedAccounts,toolkits:(e=>{if(e)return Array.isArray(e)?{enable:e}:e})(s.toolkits),tools:(e=>{if(e&&"object"==typeof e)return Object.keys(e).reduce((t,r)=>{if(Array.isArray(e[r]))t[r]={enable:e[r]};else if("object"==typeof e[r]){let s=av.safeParse(e[r]);if(s.success){let e=s.data;if(Array.isArray(e))t[r]={enable:e};else if("enable"in e)t[r]={enable:e.enable};else if("disable"in e)t[r]={disable:e.disable};else if("tags"in e){let s=aN(e.tags);s&&(t[r]={tags:s})}}else throw new eX(s.error.message)}else t[r]={enable:e[r]};return t},{})})(s.tools),tags:aN(s.tags),manage_connections:(e=>{if(void 0===e)return{enable:!0};if("boolean"==typeof e)return{enable:e};let t=ap.safeParse(e);if(!t.success)throw new eX("Failed to parse manage connections config",{cause:t.error});let r=t.data;return{enable:r.enable??!0,callback_url:r.callbackUrl,enable_wait_for_connections:r.waitForConnections}})(s.manageConnections),workbench:(e=>{if(e)return{enable:e.enable??!0,enable_proxy_execution:e.enableProxyExecution,auto_offload_threshold:e.autoOffloadThreshold}})(s.workbench),multi_account:a,experimental:Object.keys(o).length>0?o:void 0},c=await this.client.toolRouter.session.create(l);(n?.length||i?.length)&&(r=function(e,t,r){let s=new Map,n=new Map,i=new Map;for(let t of e)i.set(t.slug.toUpperCase(),{handle:t,toolkit:t.extendsToolkit});if(t)for(let e of t)for(let t of e.tools)i.set(t.slug.toUpperCase(),{handle:t,toolkit:e.slug});let o=(e,t,r)=>{let o=i.get(t.toUpperCase());if(!o)return;let a={handle:o.handle,finalSlug:e,toolkit:r??o.toolkit};s.set(e,a),n.set(t.toUpperCase(),a)};if(r?.custom_tools)for(let e of r.custom_tools)o(e.slug,e.original_slug,e.extends_toolkit);if(r?.custom_toolkits)for(let e of r.custom_toolkits)for(let t of e.tools)o(t.slug,t.original_slug,e.slug);return{byFinalSlug:s,byOriginalSlug:n,toolkits:t}}(n??[],i,c.experimental));let u=c.experimental?.assistive_prompt;return new a1(this.client,this.config,c.session_id,this.createMCPServerConfig(c.mcp),{assistivePrompt:u},r,e)}async use(e){let t=await this.client.toolRouter.session.retrieve(e);return new a1(this.client,this.config,t.session_id,this.createMCPServerConfig(t.mcp))}},a5=class e{client;config;tools;toolkits;triggers;provider;files;authConfigs;connectedAccounts;mcp;toolRouter;create;use;constructor(e){const{baseURL:t,apiKey:r}=function(e,t){let{api_key:r,base_url:s}=(()=>{try{let e=(()=>{try{let e=tp.homedir();if(!e)return null;return tp.joinPath(e,ez.l,ez.h)}catch(e){return ez.c.debug("Environment","Unable to get user data path"),null}})();if(!e||!tp.supportsFileSystem)return{};let t=tp.readFileSync(e,"utf8");return JSON.parse(t)}catch(e){return ez.c.debug("Environment","No user data file found"),{}}})(),n=e||(0,ez._)("COMPOSIO_BASE_URL")||s||ez.d,i=t||(0,ez._)("COMPOSIO_API_KEY")||r||"";return i||ez.s.handleAndThrow(new eY),ez.c.debug("Environment",`API Key: ${i}`),ez.c.debug("Environment",`Base URL: ${n}`),{baseURL:n,apiKey:i}}(e?.baseURL,e?.apiKey);ez.p&&ez.c.debug(`Initializing Composio w API Key: [REDACTED] and baseURL: ${t}`),this.provider=e?.provider??new al,this.config={...e,baseURL:t,apiKey:r,toolkitVersions:function(e){if(e&&"string"==typeof e)return e;let t=Object.entries((0,ez.v)("COMPOSIO_TOOLKIT_VERSION_")).reduce((e,[t,r])=>(e[t.replace("COMPOSIO_TOOLKIT_VERSION_","").toLowerCase()]=r,e),{}),r={};e&&"object"==typeof e&&(r=Object.fromEntries(Object.entries(e).map(([e,t])=>[e.toLowerCase(),t])));let s={...t,...r};return 0===Object.keys(s).length?"latest":s}(e?.toolkitVersions),allowTracking:e?.allowTracking??!0,dangerouslyAllowAutoUploadDownloadFiles:e?.dangerouslyAllowAutoUploadDownloadFiles??!1,sensitiveFileUploadProtection:e?.sensitiveFileUploadProtection,fileUploadPathDenySegments:e?.fileUploadPathDenySegments,fileUploadDirs:o_(e?.fileUploadDirs),fileDownloadDir:ob(e?.fileDownloadDir),provider:e?.provider??this.provider},this.client=new tc.Composio({apiKey:r,baseURL:t,defaultHeaders:ad(this.config.defaultHeaders,this.provider),logLevel:ez.u}),this.tools=new ow(this.client,this.config),this.mcp=new as(this.client),this.toolkits=new oj(this.client),this.triggers=new o2(this.client,this.config),this.authConfigs=new oR(this.client),this.files=new nA(this.client,{sensitiveFileUploadProtection:this.config.sensitiveFileUploadProtection,fileUploadPathDenySegments:this.config.fileUploadPathDenySegments,fileDownloadDir:this.config.fileDownloadDir}),this.connectedAccounts=new oN(this.client),this.toolRouter=new a2(this.client,this.config),this.create=this.toolRouter.create.bind(this.toolRouter),this.use=this.toolRouter.use.bind(this.toolRouter),this.config.allowTracking&&tr.setup({apiKey:r??"",baseUrl:t??"",isAgentic:this.provider?._isAgentic||!1,version:ac,isBrowser:!1,provider:this.provider?.name??"openai",host:this.config.host}),tr.instrument(this,"Composio"),tr.instrument(this.provider,this.provider.name??this.provider.constructor.name??"unknown"),this.config.disableVersionCheck||an(ac)}getClient(){if(!this.client)throw Error("Composio client is not initialized. Please initialize it first.");return this.client}getConfig(){return Object.freeze({...this.config})}createSession(t){let r=ad(t?.headers,this.provider);return new e({...this.config,defaultHeaders:r})}async flush(){await tr.flush()}};function a3(e,{strict:t}={strict:!1}){try{var r;let s=e;return t&&s&&((r=s)&&"object"===r.type&&r.required?.length&&(r.properties=Object.fromEntries(Object.entries(r.properties||{}).filter(([e])=>r.required.includes(e)))),r.additionalProperties=!1,s=r),((e,t={})=>nH(e,{path:[],seen:new Map,...t}))(s)}catch(e){throw new eJ("Failed to convert JSON Schema to Zod Schema",{cause:e})}}let a4=eO.z.object({id:eO.z.string(),auth_scheme:eO.z.nativeEnum(nG),is_composio_managed:eO.z.boolean(),is_disabled:eO.z.boolean(),deprecated:eO.z.object({uuid:eO.z.string()}).optional()}).passthrough(),a6=eO.z.object({authScheme:eO.z.nativeEnum(nG),val:eO.z.record(eO.z.unknown())}).passthrough(),a9=eO.z.object({toolkit:eO.z.object({slug:eO.z.string().describe("The slug of the toolkit")}).passthrough(),auth_config:a4,id:eO.z.string(),user_id:eO.z.string(),status:eO.z.nativeEnum(n7),created_at:eO.z.string(),updated_at:eO.z.string(),state:a6,data:eO.z.record(eO.z.unknown()),params:eO.z.record(eO.z.unknown()),status_reason:eO.z.string().nullable(),is_disabled:eO.z.boolean(),test_request_endpoint:eO.z.string().optional(),deprecated:eO.z.object({labels:eO.z.array(eO.z.string()),uuid:eO.z.string()}).optional()}).passthrough(),a8=eO.z.object({project_id:eO.z.string(),org_id:eO.z.string()}).passthrough(),a7=eO.z.object({id:eO.z.string(),timestamp:eO.z.string(),type:eO.z.literal("composio.connected_account.expired"),data:a9,metadata:a8}).passthrough();eO.z.discriminatedUnion("type",[a7]);let le=eO.z.object({toolkit:eO.z.string().min(1,"Toolkit name cannot be empty"),authConfigId:eO.z.string().min(1,"Auth config ID cannot be empty"),allowedTools:eO.z.array(eO.z.string().min(1,"Tool name cannot be empty")).min(1,"At least one tool must be specified")});eO.z.array(le).min(1,"At least one toolkit configuration is required").refine(e=>{let t=e.map(e=>e.toolkit);return new Set(t).size===t.length},"Duplicate toolkits are not allowed. Each toolkit must be unique."),eO.z.object({isChatAuth:eO.z.boolean().optional()}),eO.z.object({userId:eO.z.string().min(1,"User ID cannot be empty").optional(),connectedAccountIds:eO.z.record(eO.z.string(),eO.z.string().min(1,"Account ID cannot be empty")).optional()}).refine(e=>!!e.userId!=(!!e.connectedAccountIds&&Object.keys(e.connectedAccountIds).length>0),{message:"Must provide either userId or connectedAccountIds, but not both"}),eO.z.object({userIds:eO.z.array(eO.z.string()).optional(),connectedAccountIds:eO.z.array(eO.z.string()).optional(),isChatAuth:eO.z.boolean().optional()}),eO.z.object({user_ids:eO.z.array(eO.z.string()).optional(),connected_account_ids:eO.z.array(eO.z.string()).optional(),mcp_server_id:eO.z.string(),managed_auth_by_composio:eO.z.boolean().optional()}),eO.z.object({userIds:eO.z.array(eO.z.string()).optional(),connectedAccountIds:eO.z.array(eO.z.string()).optional(),mcpServerId:eO.z.string(),composioManagedAuth:eO.z.boolean().optional()}),eO.z.object({connectedAccountUrls:eO.z.array(eO.z.string()).optional(),userIdsUrl:eO.z.array(eO.z.string()).optional(),mcpUrl:eO.z.string().min(1,"MCP URL cannot be empty")}),eO.z.object({connected_account_urls:eO.z.array(eO.z.string()).optional(),user_ids_url:eO.z.array(eO.z.string()).optional(),mcp_url:eO.z.string().min(1,"MCP URL cannot be empty")});let lt=eO.z.object({name:eO.z.string().describe("Name of the MCP server"),tools:eO.z.array(eO.z.string()).describe("List of allowed tools"),authConfigId:eO.z.string().optional().describe("Auth config ID for the server")}),lr=eO.z.object({name:eO.z.string().describe("Name of the MCP server"),tools:eO.z.array(eO.z.string()).describe("List of allowed tools across toolkits"),toolkits:eO.z.array(eO.z.string()).describe("List of allowed toolkits")}),ls=eO.z.object({id:eO.z.string().describe("Unique identifier for the MCP server"),type:eO.z.enum(["single","multi"]).describe("Type of MCP server"),createdAt:eO.z.string().describe("Creation timestamp"),updatedAt:eO.z.string().describe("Last update timestamp"),status:eO.z.enum(["active","inactive","error"]).default("active"),config:eO.z.union([lt,lr])});eO.z.object({items:eO.z.array(ls),total:eO.z.number(),page:eO.z.number(),pageSize:eO.z.number()}),eO.z.object({name:eO.z.string().optional().describe("New name for the server"),toolkits:eO.z.array(eO.z.string()).optional().describe("Updated list of toolkits"),allowedTools:eO.z.array(eO.z.string()).optional().describe("Updated list of allowed tools")}),eO.z.object({id:eO.z.string().min(1,"Server ID cannot be empty"),name:eO.z.string().min(1,"Server name cannot be empty"),createdAt:eO.z.string().nullish(),updatedAt:eO.z.string().nullish(),status:eO.z.string().nullish()}),eO.z.object({id:eO.z.string().min(1,"Server ID cannot be empty"),name:eO.z.string().min(1,"Server name cannot be empty"),created_at:eO.z.string().nullish(),updated_at:eO.z.string().nullish(),status:eO.z.string().nullish()}),eO.z.object({items:eO.z.array(eO.z.object({id:eO.z.string().min(1,"Server ID cannot be empty"),name:eO.z.string().min(1,"Server name cannot be empty"),createdAt:eO.z.string().optional(),updatedAt:eO.z.string().optional(),status:eO.z.string().optional()})).optional()}),eO.z.object({items:eO.z.array(eO.z.object({id:eO.z.string().min(1,"Server ID cannot be empty"),name:eO.z.string().min(1,"Server name cannot be empty"),created_at:eO.z.string().optional(),updated_at:eO.z.string().optional(),status:eO.z.string().optional()})).optional()}),eO.z.object({id:eO.z.string().min(1,"Server ID cannot be empty"),name:eO.z.string().min(1,"Server name cannot be empty"),createdAt:eO.z.string().optional(),updatedAt:eO.z.string().optional(),status:eO.z.string().optional(),toolkits:eO.z.array(eO.z.string()).optional(),tools:eO.z.array(eO.z.string()).optional(),managedAuthViaComposio:eO.z.boolean().optional(),authConfigIds:eO.z.array(eO.z.string()).optional(),mcpUrl:eO.z.string(),commands:eO.z.object({claude:eO.z.string(),cursor:eO.z.string(),windsurf:eO.z.string()})}),eO.z.object({id:eO.z.string().min(1,"Server ID cannot be empty"),name:eO.z.string().min(1,"Server name cannot be empty"),created_at:eO.z.string().optional(),updated_at:eO.z.string().optional(),status:eO.z.string().optional(),toolkits:eO.z.array(eO.z.string()).optional(),tools:eO.z.array(eO.z.string()).optional(),managed_auth_via_composio:eO.z.boolean().optional()}),eO.z.object({id:eO.z.string().min(1,"Server ID cannot be empty"),deleted:eO.z.boolean().optional(),message:eO.z.string().optional()}),eO.z.object({id:eO.z.string().min(1,"Server ID cannot be empty"),deleted:eO.z.boolean().optional(),message:eO.z.string().optional()}),eO.z.object({id:eO.z.string().min(1,"Server ID cannot be empty"),name:eO.z.string().min(1,"Server name cannot be empty"),createdAt:eO.z.string().optional(),updatedAt:eO.z.string().optional(),status:eO.z.string().optional(),toolkits:eO.z.array(eO.z.string()).optional(),tools:eO.z.array(eO.z.string()).optional()}),eO.z.object({id:eO.z.string().min(1,"Server ID cannot be empty"),name:eO.z.string().min(1,"Server name cannot be empty"),created_at:eO.z.string().optional(),updated_at:eO.z.string().optional(),status:eO.z.string().optional(),toolkits:eO.z.array(eO.z.string()).optional(),tools:eO.z.array(eO.z.string()).optional()}),e.s(["BaseAgenticProvider",0,aa,"Composio",0,a5,"jsonSchemaToZodSchema",0,a3],13336);var ln=e.i(825289),li=class extends aa{name="claude-agent-sdk";wrapTool(e,t){let r=a3(e.inputParameters??{type:"object",properties:{}}).shape;return(0,ln.tool)(e.slug,e.description??`Execute ${e.slug}`,r,async r=>{try{let s=await t(e.slug,r);return{content:[{type:"text",text:"string"==typeof s?s:JSON.stringify(s)??""}]}}catch(e){return{content:[{type:"text",text:JSON.stringify({successful:!1,error:e instanceof Error?e.message:String(e),data:null})}]}}})}wrapTools(e,t){return e.map(e=>this.wrapTool(e,t))}wrapMcpServerResponse(e){return e.map(e=>({url:new URL(e.url),name:e.name}))}};e.s(["ClaudeAgentSDKProvider",0,li],129487)},12842,(e,t,r)=>{"use strict";let s=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,n=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,i=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,o=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,a=new Map([["n","\n"],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1b"],["a","\x07"]]);function l(e){let t="u"===e[0],r="{"===e[1];return t&&!r&&5===e.length||"x"===e[0]&&3===e.length?String.fromCharCode(parseInt(e.slice(1),16)):t&&r?String.fromCodePoint(parseInt(e.slice(2,-1),16)):a.get(e)||e}function c(e,t){let r={};for(let e of t)for(let t of e.styles)r[t[0]]=e.inverse?null:t.slice(1);let s=e;for(let[e,t]of Object.entries(r))if(Array.isArray(t)){if(!(e in s))throw Error(`Unknown Chalk style: ${e}`);s=t.length>0?s[e](...t):s[e]}return s}t.exports=(e,t)=>{let r=[],a=[],u=[];if(t.replace(s,(t,s,d,h,p,f)=>{if(s)u.push(l(s));else if(h){let t=u.join("");u=[],a.push(0===r.length?t:c(e,r)(t)),r.push({inverse:d,styles:function(e){let t;n.lastIndex=0;let r=[];for(;null!==(t=n.exec(e));){let e=t[1];if(t[2]){let s=function(e,t){let r,s=[];for(let n of t.trim().split(/\s*,\s*/g)){let t=Number(n);if(Number.isNaN(t))if(r=n.match(i))s.push(r[2].replace(o,(e,t,r)=>t?l(t):r));else throw Error(`Invalid Chalk template style argument: ${n} (in style '${e}')`);else s.push(t)}return s}(e,t[2]);r.push([e].concat(s))}else r.push([e])}return r}(h)})}else if(p){if(0===r.length)throw Error("Found extraneous } in Chalk template literal");a.push(c(e,r)(u.join(""))),u=[],r.pop()}else u.push(f)}),a.push(u.join("")),r.length>0)throw Error(`Chalk template literal is missing ${r.length} closing bracket${1===r.length?"":"s"} (\`}\`)`);return a.join("")}},977235,(e,t,r)=>{"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},349779,(e,t,r)=>{let s=e.r(977235),n={};for(let e of Object.keys(s))n[s[e]]=e;let i={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(let e of(t.exports=i,Object.keys(i))){if(!("channels"in i[e]))throw Error("missing channels property: "+e);if(!("labels"in i[e]))throw Error("missing channel labels property: "+e);if(i[e].labels.length!==i[e].channels)throw Error("channel and label counts mismatch: "+e);let{channels:t,labels:r}=i[e];delete i[e].channels,delete i[e].labels,Object.defineProperty(i[e],"channels",{value:t}),Object.defineProperty(i[e],"labels",{value:r})}i.rgb.hsl=function(e){let t,r=e[0]/255,s=e[1]/255,n=e[2]/255,i=Math.min(r,s,n),o=Math.max(r,s,n),a=o-i;o===i?t=0:r===o?t=(s-n)/a:s===o?t=2+(n-r)/a:n===o&&(t=4+(r-s)/a),(t=Math.min(60*t,360))<0&&(t+=360);let l=(i+o)/2;return[t,100*(o===i?0:l<=.5?a/(o+i):a/(2-o-i)),100*l]},i.rgb.hsv=function(e){let t,r,s,n,i,o=e[0]/255,a=e[1]/255,l=e[2]/255,c=Math.max(o,a,l),u=c-Math.min(o,a,l),d=function(e){return(c-e)/6/u+.5};return 0===u?(n=0,i=0):(i=u/c,t=d(o),r=d(a),s=d(l),o===c?n=s-r:a===c?n=1/3+t-s:l===c&&(n=2/3+r-t),n<0?n+=1:n>1&&(n-=1)),[360*n,100*i,100*c]},i.rgb.hwb=function(e){let t=e[0],r=e[1],s=e[2];return[i.rgb.hsl(e)[0],1/255*Math.min(t,Math.min(r,s))*100,100*(s=1-1/255*Math.max(t,Math.max(r,s)))]},i.rgb.cmyk=function(e){let t=e[0]/255,r=e[1]/255,s=e[2]/255,n=Math.min(1-t,1-r,1-s);return[100*((1-t-n)/(1-n)||0),100*((1-r-n)/(1-n)||0),100*((1-s-n)/(1-n)||0),100*n]},i.rgb.keyword=function(e){let t,r=n[e];if(r)return r;let i=1/0;for(let r of Object.keys(s)){let n=s[r],o=(e[0]-n[0])**2+(e[1]-n[1])**2+(e[2]-n[2])**2;o<i&&(i=o,t=r)}return t},i.keyword.rgb=function(e){return s[e]},i.rgb.xyz=function(e){let t=e[0]/255,r=e[1]/255,s=e[2]/255;return[100*(.4124*(t=t>.04045?((t+.055)/1.055)**2.4:t/12.92)+.3576*(r=r>.04045?((r+.055)/1.055)**2.4:r/12.92)+.1805*(s=s>.04045?((s+.055)/1.055)**2.4:s/12.92)),100*(.2126*t+.7152*r+.0722*s),100*(.0193*t+.1192*r+.9505*s)]},i.rgb.lab=function(e){let t=i.rgb.xyz(e),r=t[0],s=t[1],n=t[2];return r/=95.047,s/=100,n/=108.883,[116*(s=s>.008856?s**(1/3):7.787*s+16/116)-16,500*((r=r>.008856?r**(1/3):7.787*r+16/116)-s),200*(s-(n=n>.008856?n**(1/3):7.787*n+16/116))]},i.hsl.rgb=function(e){let t,r,s,n=e[0]/360,i=e[1]/100,o=e[2]/100;if(0===i)return[s=255*o,s,s];t=o<.5?o*(1+i):o+i-o*i;let a=2*o-t,l=[0,0,0];for(let e=0;e<3;e++)(r=n+-(1/3*(e-1)))<0&&r++,r>1&&r--,s=6*r<1?a+(t-a)*6*r:2*r<1?t:3*r<2?a+(t-a)*(2/3-r)*6:a,l[e]=255*s;return l},i.hsl.hsv=function(e){let t=e[0],r=e[1]/100,s=e[2]/100,n=r,i=Math.max(s,.01);s*=2,r*=s<=1?s:2-s,n*=i<=1?i:2-i;let o=(s+r)/2;return[t,100*(0===s?2*n/(i+n):2*r/(s+r)),100*o]},i.hsv.rgb=function(e){let t=e[0]/60,r=e[1]/100,s=e[2]/100,n=Math.floor(t)%6,i=t-Math.floor(t),o=255*s*(1-r),a=255*s*(1-r*i),l=255*s*(1-r*(1-i));switch(s*=255,n){case 0:return[s,l,o];case 1:return[a,s,o];case 2:return[o,s,l];case 3:return[o,a,s];case 4:return[l,o,s];case 5:return[s,o,a]}},i.hsv.hsl=function(e){let t,r,s=e[0],n=e[1]/100,i=e[2]/100,o=Math.max(i,.01);r=(2-n)*i;let a=(2-n)*o;return[s,100*(t=(t=n*o/(a<=1?a:2-a))||0),100*(r/=2)]},i.hwb.rgb=function(e){let t,r,s,n,i=e[0]/360,o=e[1]/100,a=e[2]/100,l=o+a;l>1&&(o/=l,a/=l);let c=Math.floor(6*i),u=1-a;t=6*i-c,(1&c)!=0&&(t=1-t);let d=o+t*(u-o);switch(c){default:case 6:case 0:r=u,s=d,n=o;break;case 1:r=d,s=u,n=o;break;case 2:r=o,s=u,n=d;break;case 3:r=o,s=d,n=u;break;case 4:r=d,s=o,n=u;break;case 5:r=u,s=o,n=d}return[255*r,255*s,255*n]},i.cmyk.rgb=function(e){let t=e[0]/100,r=e[1]/100,s=e[2]/100,n=e[3]/100;return[255*(1-Math.min(1,t*(1-n)+n)),255*(1-Math.min(1,r*(1-n)+n)),255*(1-Math.min(1,s*(1-n)+n))]},i.xyz.rgb=function(e){let t,r,s,n=e[0]/100,i=e[1]/100,o=e[2]/100;return t=(t=3.2406*n+-1.5372*i+-.4986*o)>.0031308?1.055*t**(1/2.4)-.055:12.92*t,r=(r=-.9689*n+1.8758*i+.0415*o)>.0031308?1.055*r**(1/2.4)-.055:12.92*r,s=(s=.0557*n+-.204*i+1.057*o)>.0031308?1.055*s**(1/2.4)-.055:12.92*s,[255*(t=Math.min(Math.max(0,t),1)),255*(r=Math.min(Math.max(0,r),1)),255*(s=Math.min(Math.max(0,s),1))]},i.xyz.lab=function(e){let t=e[0],r=e[1],s=e[2];return t/=95.047,r/=100,s/=108.883,[116*(r=r>.008856?r**(1/3):7.787*r+16/116)-16,500*((t=t>.008856?t**(1/3):7.787*t+16/116)-r),200*(r-(s=s>.008856?s**(1/3):7.787*s+16/116))]},i.lab.xyz=function(e){let t,r,s,n=e[0],i=e[1],o=e[2];t=i/500+(r=(n+16)/116),s=r-o/200;let a=r**3,l=t**3,c=s**3;return r=(a>.008856?a:(r-16/116)/7.787)*100,[t=(l>.008856?l:(t-16/116)/7.787)*95.047,r,s=(c>.008856?c:(s-16/116)/7.787)*108.883]},i.lab.lch=function(e){let t,r=e[0],s=e[1],n=e[2];return(t=360*Math.atan2(n,s)/2/Math.PI)<0&&(t+=360),[r,Math.sqrt(s*s+n*n),t]},i.lch.lab=function(e){let t=e[0],r=e[1],s=e[2]/360*2*Math.PI;return[t,r*Math.cos(s),r*Math.sin(s)]},i.rgb.ansi16=function(e,t=null){let[r,s,n]=e,o=null===t?i.rgb.hsv(e)[2]:t;if(0===(o=Math.round(o/50)))return 30;let a=30+(Math.round(n/255)<<2|Math.round(s/255)<<1|Math.round(r/255));return 2===o&&(a+=60),a},i.hsv.ansi16=function(e){return i.rgb.ansi16(i.hsv.rgb(e),e[2])},i.rgb.ansi256=function(e){let t=e[0],r=e[1],s=e[2];return t===r&&r===s?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(s/255*5)},i.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];let r=(~~(e>50)+1)*.5;return[(1&t)*r*255,(t>>1&1)*r*255,(t>>2&1)*r*255]},i.ansi256.rgb=function(e){let t;if(e>=232){let t=(e-232)*10+8;return[t,t,t]}return[Math.floor((e-=16)/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},i.rgb.hex=function(e){let t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},i.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let r=t[0];3===t[0].length&&(r=r.split("").map(e=>e+e).join(""));let s=parseInt(r,16);return[s>>16&255,s>>8&255,255&s]},i.rgb.hcg=function(e){let t,r=e[0]/255,s=e[1]/255,n=e[2]/255,i=Math.max(Math.max(r,s),n),o=Math.min(Math.min(r,s),n),a=i-o;return t=a<1?o/(1-a):0,[360*((a<=0?0:i===r?(s-n)/a%6:i===s?2+(n-r)/a:4+(r-s)/a)/6%1),100*a,100*t]},i.hsl.hcg=function(e){let t=e[1]/100,r=e[2]/100,s=r<.5?2*t*r:2*t*(1-r),n=0;return s<1&&(n=(r-.5*s)/(1-s)),[e[0],100*s,100*n]},i.hsv.hcg=function(e){let t=e[1]/100,r=e[2]/100,s=t*r,n=0;return s<1&&(n=(r-s)/(1-s)),[e[0],100*s,100*n]},i.hcg.rgb=function(e){let t=e[0]/360,r=e[1]/100,s=e[2]/100;if(0===r)return[255*s,255*s,255*s];let n=[0,0,0],i=t%1*6,o=i%1,a=1-o,l=0;switch(Math.floor(i)){case 0:n[0]=1,n[1]=o,n[2]=0;break;case 1:n[0]=a,n[1]=1,n[2]=0;break;case 2:n[0]=0,n[1]=1,n[2]=o;break;case 3:n[0]=0,n[1]=a,n[2]=1;break;case 4:n[0]=o,n[1]=0,n[2]=1;break;default:n[0]=1,n[1]=0,n[2]=a}return l=(1-r)*s,[(r*n[0]+l)*255,(r*n[1]+l)*255,(r*n[2]+l)*255]},i.hcg.hsv=function(e){let t=e[1]/100,r=t+e[2]/100*(1-t),s=0;return r>0&&(s=t/r),[e[0],100*s,100*r]},i.hcg.hsl=function(e){let t=e[1]/100,r=e[2]/100*(1-t)+.5*t,s=0;return r>0&&r<.5?s=t/(2*r):r>=.5&&r<1&&(s=t/(2*(1-r))),[e[0],100*s,100*r]},i.hcg.hwb=function(e){let t=e[1]/100,r=t+e[2]/100*(1-t);return[e[0],(r-t)*100,(1-r)*100]},i.hwb.hcg=function(e){let t=e[1]/100,r=1-e[2]/100,s=r-t,n=0;return s<1&&(n=(r-s)/(1-s)),[e[0],100*s,100*n]},i.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},i.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},i.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},i.gray.hsl=function(e){return[0,0,e[0]]},i.gray.hsv=i.gray.hsl,i.gray.hwb=function(e){return[0,100,e[0]]},i.gray.cmyk=function(e){return[0,0,0,e[0]]},i.gray.lab=function(e){return[e[0],0,0]},i.gray.hex=function(e){let t=255&Math.round(e[0]/100*255),r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r},i.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}},661443,(e,t,r)=>{let s=e.r(349779);t.exports=function(e){let t=function(e){let t=function(){let e={},t=Object.keys(s);for(let r=t.length,s=0;s<r;s++)e[t[s]]={distance:-1,parent:null};return e}(),r=[e];for(t[e].distance=0;r.length;){let e=r.pop(),n=Object.keys(s[e]);for(let s=n.length,i=0;i<s;i++){let s=n[i],o=t[s];-1===o.distance&&(o.distance=t[e].distance+1,o.parent=e,r.unshift(s))}}return t}(e),r={},n=Object.keys(t);for(let e=n.length,i=0;i<e;i++){let e=n[i];null!==t[e].parent&&(r[e]=function(e,t){let r=[t[e].parent,e],n=s[t[e].parent][e],i=t[e].parent;for(;t[i].parent;)r.unshift(t[i].parent),n=function(e,t){return function(r){return t(e(r))}}(s[t[i].parent][i],n),i=t[i].parent;return n.conversion=r,n}(e,t))}return r}},879559,(e,t,r)=>{let s=e.r(349779),n=e.r(661443),i={};Object.keys(s).forEach(e=>{i[e]={},Object.defineProperty(i[e],"channels",{value:s[e].channels}),Object.defineProperty(i[e],"labels",{value:s[e].labels});let t=n(e);Object.keys(t).forEach(r=>{let s,n,o=t[r];i[e][r]=(s=function(...e){let t=e[0];if(null==t)return t;t.length>1&&(e=t);let r=o(e);if("object"==typeof r)for(let e=r.length,t=0;t<e;t++)r[t]=Math.round(r[t]);return r},"conversion"in o&&(s.conversion=o.conversion),s),i[e][r].raw=(n=function(...e){let t=e[0];return null==t?t:(t.length>1&&(e=t),o(e))},"conversion"in o&&(n.conversion=o.conversion),n)})}),t.exports=i},704567,(e,t,r)=>{"use strict";let s,n=(e,t)=>(...r)=>{let s=e(...r);return`\u001B[${s+t}m`},i=(e,t)=>(...r)=>{let s=e(...r);return`\u001B[${38+t};5;${s}m`},o=(e,t)=>(...r)=>{let s=e(...r);return`\u001B[${38+t};2;${s[0]};${s[1]};${s[2]}m`},a=e=>e,l=(e,t,r)=>[e,t,r],c=(e,t,r)=>{Object.defineProperty(e,t,{get:()=>{let s=r();return Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0}),s},enumerable:!0,configurable:!0})},u=(t,r,n,i)=>{void 0===s&&(s=e.r(879559));let o=10*!!i,a={};for(let[e,i]of Object.entries(s)){let s="ansi16"===e?"ansi":e;e===r?a[s]=t(n,o):"object"==typeof i&&(a[s]=t(i[r],o))}return a};Object.defineProperty(t,"exports",{enumerable:!0,get:function(){let e=new Map,t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};for(let[r,s]of(t.color.gray=t.color.blackBright,t.bgColor.bgGray=t.bgColor.bgBlackBright,t.color.grey=t.color.blackBright,t.bgColor.bgGrey=t.bgColor.bgBlackBright,Object.entries(t))){for(let[r,n]of Object.entries(s))t[r]={open:`\u001B[${n[0]}m`,close:`\u001B[${n[1]}m`},s[r]=t[r],e.set(n[0],n[1]);Object.defineProperty(t,r,{value:s,enumerable:!1})}return Object.defineProperty(t,"codes",{value:e,enumerable:!1}),t.color.close="\x1b[39m",t.bgColor.close="\x1b[49m",c(t.color,"ansi",()=>u(n,"ansi16",a,!1)),c(t.color,"ansi256",()=>u(i,"ansi256",a,!1)),c(t.color,"ansi16m",()=>u(o,"rgb",l,!1)),c(t.bgColor,"ansi",()=>u(n,"ansi16",a,!0)),c(t.bgColor,"ansi256",()=>u(i,"ansi256",a,!0)),c(t.bgColor,"ansi16m",()=>u(o,"rgb",l,!0)),t}})},855225,(e,t,r)=>{"use strict";t.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":1===e.length?"-":"--",s=t.indexOf(r+e),n=t.indexOf("--");return -1!==s&&(-1===n||s<n)}},181042,(e,t,r)=>{"use strict";let s;e.r(446786);let n=e.r(870722),i=e.r(855225),{env:o}=process;function a(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function l(e,t){if(0===s)return 0;if(i("color=16m")||i("color=full")||i("color=truecolor"))return 3;if(i("color=256"))return 2;if(e&&!t&&void 0===s)return 0;let r=s||0;if("dumb"===o.TERM)return r;if("CI"in o)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(e=>e in o)||"codeship"===o.CI_NAME?1:r;if("TEAMCITY_VERSION"in o)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION);if("truecolor"===o.COLORTERM)return 3;if("TERM_PROGRAM"in o){let e=parseInt((o.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(o.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(o.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM)||"COLORTERM"in o?1:r}i("no-color")||i("no-colors")||i("color=false")||i("color=never")?s=0:(i("color")||i("colors")||i("color=true")||i("color=always"))&&(s=1),"FORCE_COLOR"in o&&(s="true"===o.FORCE_COLOR?1:"false"===o.FORCE_COLOR?0:0===o.FORCE_COLOR.length?1:Math.min(parseInt(o.FORCE_COLOR,10),3)),t.exports={supportsColor:function(e){return a(l(e,e&&e.isTTY))},stdout:a(l(!0,n.isatty(1))),stderr:a(l(!0,n.isatty(2)))}},981018,(e,t,r)=>{"use strict";t.exports={stringReplaceAll:(e,t,r)=>{let s=e.indexOf(t);if(-1===s)return e;let n=t.length,i=0,o="";do o+=e.substr(i,s-i)+t+r,i=s+n,s=e.indexOf(t,i);while(-1!==s)return o+e.substr(i)},stringEncaseCRLFWithFirstIndex:(e,t,r,s)=>{let n=0,i="";do{let o="\r"===e[s-1];i+=e.substr(n,(o?s-1:s)-n)+t+(o?"\r\n":"\n")+r,n=s+1,s=e.indexOf("\n",n)}while(-1!==s)return i+e.substr(n)}}},529166,(e,t,r)=>{"use strict";let s,n=e.r(704567),{stdout:i,stderr:o}=e.r(181042),{stringReplaceAll:a,stringEncaseCRLFWithFirstIndex:l}=e.r(981018),{isArray:c}=Array,u=["ansi","ansi","ansi256","ansi16m"],d=Object.create(null);class h{constructor(e){return p(e)}}let p=e=>{let t={};return((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let r=i?i.level:0;e.level=void 0===t.level?r:t.level})(t,e),t.template=(...e)=>w(t.template,...e),Object.setPrototypeOf(t,f.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=h,t.template};function f(e){return p(e)}for(let[e,t]of Object.entries(n))d[e]={get(){let r=b(this,y(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:r}),r}};d.visible={get(){let e=b(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};let m=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let e of m)d[e]={get(){let{level:t}=this;return function(...r){return b(this,y(n.color[u[t]][e](...r),n.color.close,this._styler),this._isEmpty)}}};for(let e of m)d["bg"+e[0].toUpperCase()+e.slice(1)]={get(){let{level:t}=this;return function(...r){return b(this,y(n.bgColor[u[t]][e](...r),n.bgColor.close,this._styler),this._isEmpty)}}};let g=Object.defineProperties(()=>{},{...d,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),y=(e,t,r)=>{let s,n;return void 0===r?(s=e,n=t):(s=r.openAll+e,n=t+r.closeAll),{open:e,close:t,openAll:s,closeAll:n,parent:r}},b=(e,t,r)=>{let s=(...e)=>c(e[0])&&c(e[0].raw)?_(s,w(s,...e)):_(s,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(s,g),s._generator=e,s._styler=t,s._isEmpty=r,s},_=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let r=e._styler;if(void 0===r)return t;let{openAll:s,closeAll:n}=r;if(-1!==t.indexOf("\x1b"))for(;void 0!==r;)t=a(t,r.close,r.open),r=r.parent;let i=t.indexOf("\n");return -1!==i&&(t=l(t,n,s,i)),s+t+n},w=(t,...r)=>{let[n]=r;if(!c(n)||!c(n.raw))return r.join(" ");let i=r.slice(1),o=[n.raw[0]];for(let e=1;e<n.length;e++)o.push(String(i[e-1]).replace(/[{}\\]/g,"\\$&"),String(n.raw[e]));return void 0===s&&(s=e.r(12842)),s(t,o.join(""))};Object.defineProperties(f.prototype,d);let v=p(void 0);v.supportsColor=i,v.stderr=p({level:o?o.level:0}),v.stderr.supportsColor=o,t.exports=v},859290,254033,e=>{"use strict";var t=e.i(740507);e.i(988169);var r=e.i(488318),s=e.i(115235),n=e.i(529166);let i=(e,t)=>{try{return process.env[e]||t}catch(e){return t}};var o=(0,t.t)({CLIENT_PUSHER_KEY:()=>p,COMPOSIO_DIR:()=>a,COMPOSIO_LOG_LEVEL:()=>f,DEFAULT_BASE_URL:()=>u,DEFAULT_TOOL_ROUTER_SESSION_FILES_MOUNT_ID:()=>g,DEFAULT_WEB_URL:()=>d,IS_DEVELOPMENT_OR_CI:()=>m,TELEMETRY_URL:()=>h,TEMP_FILES_DIRECTORY_NAME:()=>c,USER_DATA_FILE_NAME:()=>l});let a=".composio",l="user_data.json",c="files",u="https://backend.composio.dev",d="https://dashboard.composio.dev/",h="https://app.composio.dev",p=i("CLIENT_PUSHER_KEY")||"ff9f18c208855d77a152",f=i("COMPOSIO_LOG_LEVEL"),m=i("DEVELOPMENT")||i("CI")||!1,g="files",y={silent:-1,error:0,warn:1,info:2,debug:3},b=new class{level;includeTimestamp;console;constructor(e={}){this.level=e.level??(()=>{let e=(f??"info")?.toLowerCase();return e&&e in y?e:"info"})(),this.includeTimestamp=e.includeTimestamp??!0,this.console=console}formatMessage(e){let t=e.map((t,r)=>"object"==typeof t?JSON.stringify(t):0===r&&e.length>1?n.default.yellow(`${t}`):String(t)).join("\n");if(!this.includeTimestamp)return t;let r=new Date().toISOString();return`${n.default.gray(r)} - ${t}`}shouldLog(e){return y[e]<=y[this.level]}error(...e){this.shouldLog("error")&&this.console.error(this.formatMessage(e))}warn(...e){this.shouldLog("warn")&&this.console.warn(this.formatMessage(e))}info(...e){this.shouldLog("info")&&this.console.info(this.formatMessage(e))}debug(...e){this.shouldLog("debug")&&this.console.debug(this.formatMessage(e))}};var _=class e extends Error{name="ComposioError";code;possibleFixes;errorId;constructor(t,s={}){super(t),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor);const n=s.statusCode||(s.cause instanceof r.BadRequestError?s.cause.status:void 0);this.code=`TS-SDK::${s.code}`,this.possibleFixes=s.possibleFixes,this.definePropertyIfExists("statusCode",n),this.definePropertyIfExists("cause",s.cause);const i=s.cause instanceof Error?e.combineStackTraces(s.cause.stack,this.stack):s.stack??this.stack;this.definePropertyIfExists("stack",i),s.meta&&Object.keys(s.meta).length>0&&this.definePropertyIfExists("meta",s.meta)}definePropertyIfExists(e,t){void 0!==t&&Object.defineProperty(this,e,{value:t,enumerable:!0,writable:!1,configurable:!0})}static combineStackTraces(e,t){if(!e)return t;if(!t)return e;let r=t.split("\n")[0],s=e.split("\n").slice(1).join("\n");return`${r}
|
|
24
|
-
${t.split("\n").slice(1).join("\n")}
|
|
25
|
-
|
|
26
|
-
Caused by:
|
|
27
|
-
${s}`}getErrorData(e=!1){let t={name:this.name,message:this.message},{cause:r,code:s,stack:n,statusCode:i,meta:o,possibleFixes:a}=this;if(void 0!==r&&(t.cause=r instanceof Error?r.message:String(r)),s&&(t.code=s),void 0!==i&&(t.statusCode=i),o&&(t.meta=o),a&&(t.possibleFixes=a),e&&n)if(n.includes("Caused by:")){let[e,r]=n.split("Caused by:");t.stack=[...e.split("\n").slice(1),"Caused by:",...r.split("\n")]}else t.stack=n.split("\n").slice(1);return t}prettyPrint(e=!1){let t=this.getErrorData(e),r="\n"+n.default.bgRed.white.bold(" ERROR ")+" "+n.default.white.bold(t.message)+"\n";if(t.code&&(r+=n.default.yellow(`Error Code: ${t.code}`)+"\n"),void 0!==t.statusCode&&(r+=n.default.yellow(`Status: ${t.statusCode}`)+"\n"),t.cause&&(r+=n.default.gray("Reason:")+"\n"+(" "+n.default.white(t.cause))+"\n"),t.meta&&(r+=n.default.gray("Additional Information:")+"\n"+(" "+n.default.white(JSON.stringify(t.meta,null,2).replace(/\n/g,"\n ")))+"\n"),t.possibleFixes?.length){r+="\n"+n.default.cyan.bold("Try the following:")+"\n";let e=t.possibleFixes?.map((e,t)=>` ${t+1}. `+n.default.white(e));r+=e?.join("\n")+"\n"}t.stack?.length&&(r+="\n"+n.default.gray("Stack Trace:")+"\n"+n.default.gray(t.stack.join("\n"))+"\n"),r+="\n",b.error(r)}static createAndPrint(t,r={},s=!1){let n=new e(t,r);return n.prettyPrint(s),n}static handle(t,r={}){let{includeStack:n=!1,exitProcess:i=!1}=r;t instanceof e?t.prettyPrint(n):t instanceof s.ZodError?this.handleZodError(t,n):t instanceof Error?this.handleStandardError(t,n):this.handleUnknownError(t),i&&this.throwError(t)}static handleAndThrow(e,t=!1){this.handle(e,{includeStack:t}),this.throwError(e)}static throwError(t){if(t instanceof e)throw t;if(t instanceof Error)throw new e(t.message,{cause:t});throw new e(String(t))}static handleZodError(e,t){if(b.error("\n"+n.default.bgRed.white.bold(" ERROR ")+" "+n.default.white.bold(e.message)),b.error(n.default.gray("Invalid parameters:")),e.errors.forEach(e=>{b.error(n.default.yellow(e.path.join("."))+" "+n.default.white(e.message))}),b.error(n.default.gray("Expected parameters:")),e.errors.forEach(e=>{b.error(n.default.yellow(e.path.join("."))+" "+n.default.white(e.message))}),t&&(b.error("\n"+n.default.gray("Validation Errors:")),e.errors.forEach(e=>{let t=e.path.join(".");b.error(n.default.gray(" • ")+n.default.yellow(t?`${t}: `:"")+n.default.white(e.message))}),e.stack)){b.error("\n"+n.default.gray("Stack Trace:"));let t=e.stack.split("\n").slice(1);b.error(n.default.gray(t.join("\n")))}b.error("")}static handleStandardError(e,t){if(b.error("\n"+n.default.bgRed.white.bold(" ERROR ")+" "+n.default.white.bold(e.message)),t&&e.stack){b.error("\n"+n.default.gray("Stack Trace:"));let t=e.stack.split("\n").slice(1);b.error(n.default.gray(t.join("\n")))}b.error("")}static handleUnknownError(e){b.error("\n"+n.default.bgRed.white.bold(" ERROR ")+" "+n.default.white.bold("Unknown error occurred")),null!=e&&(b.error(n.default.gray("Error details:")),b.error(" "+n.default.white(String(e)))),b.error("")}};let w={FILE_UPLOAD_FAILED:"FILE_UPLOAD_FAILED",SENSITIVE_FILE_PATH_BLOCKED:"SENSITIVE_FILE_PATH_BLOCKED",FILE_UPLOAD_ABORTED:"FILE_UPLOAD_ABORTED",FILE_UPLOAD_PATH_NOT_ALLOWED:"FILE_UPLOAD_PATH_NOT_ALLOWED",FILE_NOT_FOUND:"FILE_NOT_FOUND"};var v=class extends _{constructor(e="Failed to upload file",t={}){super(e,{...t,code:t.code??w.FILE_UPLOAD_FAILED,possibleFixes:t.possibleFixes||["Check if the file exists in the location provided"]}),this.name="ComposioFileUploadError"}},I=class extends v{constructor(e,t={}){super(e,{...t,code:w.SENSITIVE_FILE_PATH_BLOCKED,possibleFixes:t.possibleFixes??["Use a file outside ~/.ssh, ~/.aws, and other credential locations","Set sensitiveFileUploadProtection: false only if you understand the risk","Add path segments to block with fileUploadPathDenySegments"]}),this.name="ComposioSensitiveFilePathBlockedError"}},k=class extends v{constructor(e,t={}){super(e,{...t,code:w.FILE_UPLOAD_ABORTED,possibleFixes:t.possibleFixes??["Change beforeFileUpload to return a file path to upload, or allow the upload to proceed"]}),this.name="ComposioFileUploadAbortedError"}},x=class extends v{constructor(e,t={}){super(e,{...t,code:w.FILE_UPLOAD_PATH_NOT_ALLOWED,possibleFixes:t.possibleFixes??["Move the file under one of the directories in `fileUploadDirs`","Stage the file under the default upload dir (`~/.composio/temp`)","Add the containing directory to `fileUploadDirs` when constructing Composio","Pass the file by URL or as a File/Blob object instead of a filesystem path"]}),this.name="ComposioFileUploadPathNotAllowedError"}},T=class extends v{constructor(e,t={}){super(e,{...t,code:w.FILE_NOT_FOUND,possibleFixes:t.possibleFixes??["Double-check the path for typos","Remember relative paths are resolved against process.cwd() at upload time","Verify the file exists and the process has read permission"]}),this.name="ComposioFileNotFoundError"}};e.s(["_",0,i,"a",0,I,"c",0,b,"d",0,u,"f",0,g,"g",0,o,"h",0,l,"i",0,x,"l",0,a,"m",0,c,"n",0,k,"o",0,w,"p",0,m,"r",0,v,"s",0,_,"t",0,T,"u",0,f,"v",0,e=>{try{return Object.fromEntries(Object.entries(process.env).filter(([t])=>t.startsWith(e)))}catch(e){return{}}}],859290),e.s([],254033)},138703,(e,t,r)=>{"use strict";t.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||0x1fffffffffffff,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},591130,(e,t,r)=>{"use strict";t.exports="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{}},70547,(e,t,r)=>{"use strict";let{MAX_SAFE_COMPONENT_LENGTH:s,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=e.r(138703),o=e.r(591130),a=(r=t.exports={}).re=[],l=r.safeRe=[],c=r.src=[],u=r.safeSrc=[],d=r.t={},h=0,p="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",i],[p,n]],m=(e,t,r)=>{let s=(e=>{for(let[t,r]of f)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),n=h++;o(e,n,t),d[e]=n,c[n]=t,u[n]=s,a[n]=new RegExp(t,r?"g":void 0),l[n]=new RegExp(s,r?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${p}*`),m("MAINVERSION",`(${c[d.NUMERICIDENTIFIER]})\\.(${c[d.NUMERICIDENTIFIER]})\\.(${c[d.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${c[d.NUMERICIDENTIFIERLOOSE]})\\.(${c[d.NUMERICIDENTIFIERLOOSE]})\\.(${c[d.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${c[d.NONNUMERICIDENTIFIER]}|${c[d.NUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${c[d.NONNUMERICIDENTIFIER]}|${c[d.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASE",`(?:-(${c[d.PRERELEASEIDENTIFIER]}(?:\\.${c[d.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${c[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[d.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${p}+`),m("BUILD",`(?:\\+(${c[d.BUILDIDENTIFIER]}(?:\\.${c[d.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${c[d.MAINVERSION]}${c[d.PRERELEASE]}?${c[d.BUILD]}?`),m("FULL",`^${c[d.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${c[d.MAINVERSIONLOOSE]}${c[d.PRERELEASELOOSE]}?${c[d.BUILD]}?`),m("LOOSE",`^${c[d.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${c[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${c[d.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${c[d.XRANGEIDENTIFIER]})(?:\\.(${c[d.XRANGEIDENTIFIER]})(?:\\.(${c[d.XRANGEIDENTIFIER]})(?:${c[d.PRERELEASE]})?${c[d.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${c[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[d.XRANGEIDENTIFIERLOOSE]})(?:${c[d.PRERELEASELOOSE]})?${c[d.BUILD]}?)?)?`),m("XRANGE",`^${c[d.GTLT]}\\s*${c[d.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${c[d.GTLT]}\\s*${c[d.XRANGEPLAINLOOSE]}$`),m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${s}})(?:\\.(\\d{1,${s}}))?(?:\\.(\\d{1,${s}}))?`),m("COERCE",`${c[d.COERCEPLAIN]}(?:$|[^\\d])`),m("COERCEFULL",c[d.COERCEPLAIN]+`(?:${c[d.PRERELEASE]})?`+`(?:${c[d.BUILD]})?`+"(?:$|[^\\d])"),m("COERCERTL",c[d.COERCE],!0),m("COERCERTLFULL",c[d.COERCEFULL],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${c[d.LONETILDE]}\\s+`,!0),r.tildeTrimReplace="$1~",m("TILDE",`^${c[d.LONETILDE]}${c[d.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${c[d.LONETILDE]}${c[d.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${c[d.LONECARET]}\\s+`,!0),r.caretTrimReplace="$1^",m("CARET",`^${c[d.LONECARET]}${c[d.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${c[d.LONECARET]}${c[d.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${c[d.GTLT]}\\s*(${c[d.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${c[d.GTLT]}\\s*(${c[d.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${c[d.GTLT]}\\s*(${c[d.LOOSEPLAIN]}|${c[d.XRANGEPLAIN]})`,!0),r.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${c[d.XRANGEPLAIN]})\\s+-\\s+(${c[d.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${c[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[d.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},782789,(e,t,r)=>{"use strict";let s=Object.freeze({loose:!0}),n=Object.freeze({});t.exports=e=>e?"object"!=typeof e?s:e:n},318429,(e,t,r)=>{"use strict";let s=/^[0-9]+$/,n=(e,t)=>{if("number"==typeof e&&"number"==typeof t)return e===t?0:e<t?-1:1;let r=s.test(e),n=s.test(t);return r&&n&&(e*=1,t*=1),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1};t.exports={compareIdentifiers:n,rcompareIdentifiers:(e,t)=>n(t,e)}},620326,(e,t,r)=>{"use strict";let s=e.r(591130),{MAX_LENGTH:n,MAX_SAFE_INTEGER:i}=e.r(138703),{safeRe:o,t:a}=e.r(70547),l=e.r(782789),{compareIdentifiers:c}=e.r(318429);t.exports=class e{constructor(t,r){if(r=l(r),t instanceof e)if(!!r.loose===t.loose&&!!r.includePrerelease===t.includePrerelease)return t;else t=t.version;else if("string"!=typeof t)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>n)throw TypeError(`version is longer than ${n} characters`);s("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const c=t.trim().match(r.loose?o[a.LOOSE]:o[a.FULL]);if(!c)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+c[1],this.minor=+c[2],this.patch=+c[3],this.major>i||this.major<0)throw TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw TypeError("Invalid patch version");c[4]?this.prerelease=c[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<i)return t}return e}):this.prerelease=[],this.build=c[5]?c[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(s("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if("string"==typeof t&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return(t instanceof e||(t=new e(t,this.options)),this.major<t.major)?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:+(this.patch>t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return -1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let e=this.prerelease[r],n=t.prerelease[r];if(s("prerelease compare",r,e,n),void 0===e&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===e)return -1;else if(e===n)continue;else return c(e,n)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],n=t.build[r];if(s("build compare",r,e,n),void 0===e&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===e)return -1;else if(e===n)continue;else return c(e,n)}while(++r)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&!1===r)throw Error("invalid increment argument: identifier is empty");if(t){let e=`-${t}`.match(this.options.loose?o[a.PRERELEASELOOSE]:o[a.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(0===this.prerelease.length)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(0!==this.minor||0!==this.patch||0===this.prerelease.length)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(0!==this.patch||0===this.prerelease.length)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{let e=+!!Number(r);if(0===this.prerelease.length)this.prerelease=[e];else{let s=this.prerelease.length;for(;--s>=0;)"number"==typeof this.prerelease[s]&&(this.prerelease[s]++,s=-2);if(-1===s){if(t===this.prerelease.join(".")&&!1===r)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let s=[t,e];!1===r&&(s=[t]),((e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let t=0;t<r.length;t++)if(0!==c(e[t],r[t]))return!1;return!0})(this.prerelease,t)?isNaN(this.prerelease[t.split(".").length])&&(this.prerelease=s):this.prerelease=s}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}},235759,(e,t,r)=>{"use strict";let s=e.r(620326);t.exports=(e,t,r=!1)=>{if(e instanceof s)return e;try{return new s(e,t)}catch(e){if(!r)return null;throw e}}},600032,(e,t,r)=>{"use strict";let s=e.r(235759);t.exports=(e,t)=>{let r=s(e,t);return r?r.version:null}},76730,(e,t,r)=>{"use strict";let s=e.r(235759);t.exports=(e,t)=>{let r=s(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},196161,(e,t,r)=>{"use strict";let s=e.r(620326);t.exports=(e,t,r,n,i)=>{"string"==typeof r&&(i=n,n=r,r=void 0);try{return new s(e instanceof s?e.version:e,r).inc(t,n,i).version}catch(e){return null}}},716022,(e,t,r)=>{"use strict";let s=e.r(235759);t.exports=(e,t)=>{let r=s(e,null,!0),n=s(t,null,!0),i=r.compare(n);if(0===i)return null;let o=i>0,a=o?r:n,l=o?n:r,c=!!a.prerelease.length;if(l.prerelease.length&&!c){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(a))return l.minor&&!l.patch?"minor":"patch"}let u=c?"pre":"";return r.major!==n.major?u+"major":r.minor!==n.minor?u+"minor":r.patch!==n.patch?u+"patch":"prerelease"}},808645,(e,t,r)=>{"use strict";let s=e.r(620326);t.exports=(e,t)=>new s(e,t).major},462196,(e,t,r)=>{"use strict";let s=e.r(620326);t.exports=(e,t)=>new s(e,t).minor},52686,(e,t,r)=>{"use strict";let s=e.r(620326);t.exports=(e,t)=>new s(e,t).patch},613523,(e,t,r)=>{"use strict";let s=e.r(235759);t.exports=(e,t)=>{let r=s(e,t);return r&&r.prerelease.length?r.prerelease:null}},604668,(e,t,r)=>{"use strict";let s=e.r(620326);t.exports=(e,t,r)=>new s(e,r).compare(new s(t,r))},760808,(e,t,r)=>{"use strict";let s=e.r(604668);t.exports=(e,t,r)=>s(t,e,r)},298480,(e,t,r)=>{"use strict";let s=e.r(604668);t.exports=(e,t)=>s(e,t,!0)},579552,(e,t,r)=>{"use strict";let s=e.r(620326);t.exports=(e,t,r)=>{let n=new s(e,r),i=new s(t,r);return n.compare(i)||n.compareBuild(i)}},418817,(e,t,r)=>{"use strict";let s=e.r(579552);t.exports=(e,t)=>e.sort((e,r)=>s(e,r,t))},443007,(e,t,r)=>{"use strict";let s=e.r(579552);t.exports=(e,t)=>e.sort((e,r)=>s(r,e,t))},656381,(e,t,r)=>{"use strict";let s=e.r(604668);t.exports=(e,t,r)=>s(e,t,r)>0},499583,(e,t,r)=>{"use strict";let s=e.r(604668);t.exports=(e,t,r)=>0>s(e,t,r)},66010,(e,t,r)=>{"use strict";let s=e.r(604668);t.exports=(e,t,r)=>0===s(e,t,r)},9282,(e,t,r)=>{"use strict";let s=e.r(604668);t.exports=(e,t,r)=>0!==s(e,t,r)},287709,(e,t,r)=>{"use strict";let s=e.r(604668);t.exports=(e,t,r)=>s(e,t,r)>=0},148467,(e,t,r)=>{"use strict";let s=e.r(604668);t.exports=(e,t,r)=>0>=s(e,t,r)},436269,(e,t,r)=>{"use strict";let s=e.r(66010),n=e.r(9282),i=e.r(656381),o=e.r(287709),a=e.r(499583),l=e.r(148467);t.exports=(e,t,r,c)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return s(e,r,c);case"!=":return n(e,r,c);case">":return i(e,r,c);case">=":return o(e,r,c);case"<":return a(e,r,c);case"<=":return l(e,r,c);default:throw TypeError(`Invalid operator: ${t}`)}}},964166,(e,t,r)=>{"use strict";let s=e.r(620326),n=e.r(235759),{safeRe:i,t:o}=e.r(70547);t.exports=(e,t)=>{if(e instanceof s)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let s,n=t.includePrerelease?i[o.COERCERTLFULL]:i[o.COERCERTL];for(;(s=n.exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&s.index+s[0].length===r.index+r[0].length||(r=s),n.lastIndex=s.index+s[1].length+s[2].length;n.lastIndex=-1}else r=e.match(t.includePrerelease?i[o.COERCEFULL]:i[o.COERCE]);if(null===r)return null;let a=r[2],l=r[3]||"0",c=r[4]||"0",u=t.includePrerelease&&r[5]?`-${r[5]}`:"",d=t.includePrerelease&&r[6]?`+${r[6]}`:"";return n(`${a}.${l}.${c}${u}${d}`,t)}},313277,(e,t,r)=>{"use strict";let s=e.r(235759),n=e.r(138703),i=e.r(620326),o=e=>e.startsWith("pre");t.exports=(e,t,r)=>{let a,l;if(!n.RELEASE_TYPES.includes(t))return null;let c=(a=e,l=r,s(a instanceof i?a.version:a,l));return c&&((e,t)=>{if(o(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0}return e.format()})(c,t)}},980661,(e,t,r)=>{"use strict";t.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(void 0!==t)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},193006,(e,t,r)=>{"use strict";let s=/\s+/g;t.exports=class e{constructor(t,r){if(r=i(r),t instanceof e)if(!!r.loose===t.loose&&!!r.includePrerelease===t.includePrerelease)return t;else return new e(t.raw,r);if(t instanceof o)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(s," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!b(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1){for(const e of this.set)if(1===e.length&&_(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(y,"");let t=((this.options.includePrerelease&&m)|(this.options.loose&&g))+":"+e,r=n.get(t);if(r)return r;let s=this.options.loose,i=s?c[d.HYPHENRANGELOOSE]:c[d.HYPHENRANGE];a("hyphen replace",e=e.replace(i,O(this.options.includePrerelease))),a("comparator trim",e=e.replace(c[d.COMPARATORTRIM],h)),a("tilde trim",e=e.replace(c[d.TILDETRIM],p)),a("caret trim",e=e.replace(c[d.CARETTRIM],f));let l=e.split(" ").map(e=>v(e,this.options)).join(" ").split(/\s+/).map(e=>C(e,this.options));s&&(l=l.filter(e=>(a("loose invalid filter",e,this.options),!!e.match(c[d.COMPARATORLOOSE])))),a("range list",l);let u=new Map;for(let e of l.map(e=>new o(e,this.options))){if(b(e))return[e];u.set(e.value,e)}u.size>1&&u.has("")&&u.delete("");let _=[...u.values()];return n.set(t,_),_}intersects(t,r){if(!(t instanceof e))throw TypeError("a Range is required");return this.set.some(e=>w(e,r)&&t.set.some(t=>w(t,r)&&e.every(e=>t.every(t=>e.intersects(t,r)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(P(this.set[t],e,this.options))return!0;return!1}};let n=new(e.r(980661)),i=e.r(782789),o=e.r(321984),a=e.r(591130),l=e.r(620326),{safeRe:c,src:u,t:d,comparatorTrimReplace:h,tildeTrimReplace:p,caretTrimReplace:f}=e.r(70547),{FLAG_INCLUDE_PRERELEASE:m,FLAG_LOOSE:g}=e.r(138703),y=RegExp(u[d.BUILD],"g"),b=e=>"<0.0.0-0"===e.value,_=e=>""===e.value,w=(e,t)=>{let r=!0,s=e.slice(),n=s.pop();for(;r&&s.length;)r=s.every(e=>n.intersects(e,t)),n=s.pop();return r},v=(e,t)=>(a("comp",e=e.replace(c[d.BUILD],""),t),a("caret",e=T(e,t)),a("tildes",e=k(e,t)),a("xrange",e=z(e,t)),a("stars",e=S(e,t)),e),I=e=>!e||"x"===e.toLowerCase()||"*"===e,k=(e,t)=>e.trim().split(/\s+/).map(e=>x(e,t)).join(" "),x=(e,t)=>{let r=t.loose?c[d.TILDELOOSE]:c[d.TILDE],s=t.includePrerelease?"-0":"";return e.replace(r,(t,r,n,i,o)=>{let l;return a("tilde",e,t,r,n,i,o),I(r)?l="":I(n)?l=`>=${r}.0.0${s} <${+r+1}.0.0-0`:I(i)?l=`>=${r}.${n}.0${s} <${r}.${+n+1}.0-0`:o?(a("replaceTilde pr",o),l=`>=${r}.${n}.${i}-${o} <${r}.${+n+1}.0-0`):l=`>=${r}.${n}.${i} <${r}.${+n+1}.0-0`,a("tilde return",l),l})},T=(e,t)=>e.trim().split(/\s+/).map(e=>E(e,t)).join(" "),E=(e,t)=>{a("caret",e,t);let r=t.loose?c[d.CARETLOOSE]:c[d.CARET],s=t.includePrerelease?"-0":"";return e.replace(r,(t,r,n,i,o)=>{let l;return a("caret",e,t,r,n,i,o),I(r)?l="":I(n)?l=`>=${r}.0.0${s} <${+r+1}.0.0-0`:I(i)?l="0"===r?`>=${r}.${n}.0${s} <${r}.${+n+1}.0-0`:`>=${r}.${n}.0${s} <${+r+1}.0.0-0`:o?(a("replaceCaret pr",o),l="0"===r?"0"===n?`>=${r}.${n}.${i}-${o} <${r}.${n}.${+i+1}-0`:`>=${r}.${n}.${i}-${o} <${r}.${+n+1}.0-0`:`>=${r}.${n}.${i}-${o} <${+r+1}.0.0-0`):(a("no pr"),l="0"===r?"0"===n?`>=${r}.${n}.${i} <${r}.${n}.${+i+1}-0`:`>=${r}.${n}.${i} <${r}.${+n+1}.0-0`:`>=${r}.${n}.${i} <${+r+1}.0.0-0`),a("caret return",l),l})},z=(e,t)=>(a("replaceXRanges",e,t),e.split(/\s+/).map(e=>A(e,t)).join(" ")),A=(e,t)=>{e=e.trim();let r=t.loose?c[d.XRANGELOOSE]:c[d.XRANGE];return e.replace(r,(r,s,n,i,o,l)=>{let c,u,d;if(a("xRange",e,r,s,n,i,o,l),c=n,u=i,d=o,I(c)&&!I(u)||I(u)&&d&&!I(d))return e;let h=I(n),p=h||I(i),f=p||I(o);return"="===s&&f&&(s=""),l=t.includePrerelease?"-0":"",h?r=">"===s||"<"===s?"<0.0.0-0":"*":s&&f?(p&&(i=0),o=0,">"===s?(s=">=",p?(n=+n+1,i=0):i=+i+1,o=0):"<="===s&&(s="<",p?n=+n+1:i=+i+1),"<"===s&&(l="-0"),r=`${s+n}.${i}.${o}${l}`):p?r=`>=${n}.0.0${l} <${+n+1}.0.0-0`:f&&(r=`>=${n}.${i}.0${l} <${n}.${+i+1}.0-0`),a("xRange return",r),r})},S=(e,t)=>(a("replaceStars",e,t),e.trim().replace(c[d.STAR],"")),C=(e,t)=>(a("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?d.GTE0PRE:d.GTE0],"")),O=e=>(t,r,s,n,i,o,a,l,c,u,d,h)=>(r=I(s)?"":I(n)?`>=${s}.0.0${e?"-0":""}`:I(i)?`>=${s}.${n}.0${e?"-0":""}`:o?`>=${r}`:`>=${r}${e?"-0":""}`,l=I(c)?"":I(u)?`<${+c+1}.0.0-0`:I(d)?`<${c}.${+u+1}.0-0`:h?`<=${c}.${u}.${d}-${h}`:e?`<${c}.${u}.${+d+1}-0`:`<=${l}`,`${r} ${l}`.trim()),P=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(a(e[r].semver),e[r].semver!==o.ANY&&e[r].semver.prerelease.length>0){let s=e[r].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}return!1}return!0}},321984,(e,t,r)=>{"use strict";let s=Symbol("SemVer ANY");t.exports=class e{static get ANY(){return s}constructor(t,r){if(r=n(r),t instanceof e)if(!!r.loose===t.loose)return t;else t=t.value;l("comparator",t=t.trim().split(/\s+/).join(" "),r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===s?this.value="":this.value=this.operator+this.semver.version,l("comp",this)}parse(e){let t=this.options.loose?i[o.COMPARATORLOOSE]:i[o.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new c(r[2],this.options.loose):this.semver=s}toString(){return this.value}test(e){if(l("Comparator.test",e,this.options.loose),this.semver===s||e===s)return!0;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}return a(e,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof e))throw TypeError("a Comparator is required");return""===this.operator?""===this.value||new u(t.value,r).test(this.value):""===t.operator?""===t.value||new u(this.value,r).test(t.semver):!((r=n(r)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===t.value)||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0")))&&!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||a(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||a(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">"))}};let n=e.r(782789),{safeRe:i,t:o}=e.r(70547),a=e.r(436269),l=e.r(591130),c=e.r(620326),u=e.r(193006)},870482,(e,t,r)=>{"use strict";let s=e.r(193006);t.exports=(e,t,r)=>{try{t=new s(t,r)}catch(e){return!1}return t.test(e)}},187095,(e,t,r)=>{"use strict";let s=e.r(193006);t.exports=(e,t)=>new s(e,t).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "))},492685,(e,t,r)=>{"use strict";let s=e.r(620326),n=e.r(193006);t.exports=(e,t,r)=>{let i=null,o=null,a=null;try{a=new n(t,r)}catch(e){return null}return e.forEach(e=>{a.test(e)&&(!i||-1===o.compare(e))&&(o=new s(i=e,r))}),i}},492500,(e,t,r)=>{"use strict";let s=e.r(620326),n=e.r(193006);t.exports=(e,t,r)=>{let i=null,o=null,a=null;try{a=new n(t,r)}catch(e){return null}return e.forEach(e=>{a.test(e)&&(!i||1===o.compare(e))&&(o=new s(i=e,r))}),i}},356388,(e,t,r)=>{"use strict";let s=e.r(620326),n=e.r(193006),i=e.r(656381);t.exports=(e,t)=>{e=new n(e,t);let r=new s("0.0.0");if(e.test(r)||(r=new s("0.0.0-0"),e.test(r)))return r;r=null;for(let t=0;t<e.set.length;++t){let n=e.set[t],o=null;n.forEach(e=>{let t=new s(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":(!o||i(t,o))&&(o=t);break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),o&&(!r||i(r,o))&&(r=o)}return r&&e.test(r)?r:null}},404934,(e,t,r)=>{"use strict";let s=e.r(193006);t.exports=(e,t)=>{try{return new s(e,t).range||"*"}catch(e){return null}}},866294,(e,t,r)=>{"use strict";let s=e.r(620326),n=e.r(321984),{ANY:i}=n,o=e.r(193006),a=e.r(870482),l=e.r(656381),c=e.r(499583),u=e.r(148467),d=e.r(287709);t.exports=(e,t,r,h)=>{let p,f,m,g,y;switch(e=new s(e,h),t=new o(t,h),r){case">":p=l,f=u,m=c,g=">",y=">=";break;case"<":p=c,f=d,m=l,g="<",y="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,h))return!1;for(let r=0;r<t.set.length;++r){let s=t.set[r],o=null,a=null;if(s.forEach(e=>{e.semver===i&&(e=new n(">=0.0.0")),o=o||e,a=a||e,p(e.semver,o.semver,h)?o=e:m(e.semver,a.semver,h)&&(a=e)}),o.operator===g||o.operator===y||(!a.operator||a.operator===g)&&f(e,a.semver)||a.operator===y&&m(e,a.semver))return!1}return!0}},778757,(e,t,r)=>{"use strict";let s=e.r(866294);t.exports=(e,t,r)=>s(e,t,">",r)},56605,(e,t,r)=>{"use strict";let s=e.r(866294);t.exports=(e,t,r)=>s(e,t,"<",r)},615029,(e,t,r)=>{"use strict";let s=e.r(193006);t.exports=(e,t,r)=>(e=new s(e,r),t=new s(t,r),e.intersects(t,r))},487138,(e,t,r)=>{"use strict";let s=e.r(870482),n=e.r(604668);t.exports=(e,t,r)=>{let i=[],o=null,a=null,l=e.sort((e,t)=>n(e,t,r));for(let e of l)s(e,t,r)?(a=e,o||(o=e)):(a&&i.push([o,a]),a=null,o=null);o&&i.push([o,null]);let c=[];for(let[e,t]of i)e===t?c.push(e):t||e!==l[0]?t?e===l[0]?c.push(`<=${t}`):c.push(`${e} - ${t}`):c.push(`>=${e}`):c.push("*");let u=c.join(" || "),d="string"==typeof t.raw?t.raw:String(t);return u.length<d.length?u:t}},170414,(e,t,r)=>{"use strict";let s=e.r(193006),n=e.r(321984),{ANY:i}=n,o=e.r(870482),a=e.r(604668),l=[new n(">=0.0.0-0")],c=[new n(">=0.0.0")],u=(e,t,r)=>{let s,n,u,p,f,m,g;if(e===t)return!0;if(1===e.length&&e[0].semver===i)if(1===t.length&&t[0].semver===i)return!0;else e=r.includePrerelease?l:c;if(1===t.length&&t[0].semver===i)if(r.includePrerelease)return!0;else t=c;let y=new Set;for(let t of e)">"===t.operator||">="===t.operator?s=d(s,t,r):"<"===t.operator||"<="===t.operator?n=h(n,t,r):y.add(t.semver);if(y.size>1)return null;if(s&&n&&((u=a(s.semver,n.semver,r))>0||0===u&&(">="!==s.operator||"<="!==n.operator)))return null;for(let e of y){if(s&&!o(e,String(s),r)||n&&!o(e,String(n),r))return null;for(let s of t)if(!o(e,String(s),r))return!1;return!0}let b=!!n&&!r.includePrerelease&&!!n.semver.prerelease.length&&n.semver,_=!!s&&!r.includePrerelease&&!!s.semver.prerelease.length&&s.semver;for(let e of(b&&1===b.prerelease.length&&"<"===n.operator&&0===b.prerelease[0]&&(b=!1),t)){if(g=g||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,s){if(_&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===_.major&&e.semver.minor===_.minor&&e.semver.patch===_.patch&&(_=!1),">"===e.operator||">="===e.operator){if((p=d(s,e,r))===e&&p!==s)return!1}else if(">="===s.operator&&!e.test(s.semver))return!1}if(n){if(b&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===b.major&&e.semver.minor===b.minor&&e.semver.patch===b.patch&&(b=!1),"<"===e.operator||"<="===e.operator){if((f=h(n,e,r))===e&&f!==n)return!1}else if("<="===n.operator&&!e.test(n.semver))return!1}if(!e.operator&&(n||s)&&0!==u)return!1}return(!s||!m||!!n||0===u)&&(!n||!g||!!s||0===u)&&!_&&!b&&!0},d=(e,t,r)=>{if(!e)return t;let s=a(e.semver,t.semver,r);return s>0?e:s<0||">"===t.operator&&">="===e.operator?t:e},h=(e,t,r)=>{if(!e)return t;let s=a(e.semver,t.semver,r);return s<0?e:s>0||"<"===t.operator&&"<="===e.operator?t:e};t.exports=(e,t,r={})=>{if(e===t)return!0;e=new s(e,r),t=new s(t,r);let n=!1;e:for(let s of e.set){for(let e of t.set){let t=u(s,e,r);if(n=n||null!==t,t)continue e}if(n)return!1}return!0}},348680,(e,t,r)=>{"use strict";let s=e.r(70547),n=e.r(138703),i=e.r(620326),o=e.r(318429),a=e.r(235759),l=e.r(600032),c=e.r(76730),u=e.r(196161),d=e.r(716022),h=e.r(808645),p=e.r(462196),f=e.r(52686),m=e.r(613523),g=e.r(604668),y=e.r(760808),b=e.r(298480),_=e.r(579552),w=e.r(418817),v=e.r(443007),I=e.r(656381),k=e.r(499583),x=e.r(66010),T=e.r(9282),E=e.r(287709),z=e.r(148467),A=e.r(436269),S=e.r(964166),C=e.r(313277),O=e.r(321984),P=e.r(193006),R=e.r(870482),$=e.r(187095),N=e.r(492685),j=e.r(492500),L=e.r(356388),D=e.r(404934),U=e.r(866294),F=e.r(778757),M=e.r(56605),Z=e.r(615029);t.exports={parse:a,valid:l,clean:c,inc:u,diff:d,major:h,minor:p,patch:f,prerelease:m,compare:g,rcompare:y,compareLoose:b,compareBuild:_,sort:w,rsort:v,gt:I,lt:k,eq:x,neq:T,gte:E,lte:z,cmp:A,coerce:S,truncate:C,Comparator:O,Range:P,satisfies:R,toComparators:$,maxSatisfying:N,minSatisfying:j,minVersion:L,validRange:D,outside:U,gtr:F,ltr:M,intersects:Z,simplifyRange:e.r(487138),subset:e.r(170414),SemVer:i,re:s.re,src:s.src,tokens:s.t,SEMVER_SPEC_VERSION:n.SEMVER_SPEC_VERSION,RELEASE_TYPES:n.RELEASE_TYPES,compareIdentifiers:o.compareIdentifiers,rcompareIdentifiers:o.rcompareIdentifiers}},901480,e=>{"use strict";let t,r=Symbol("Let zodToJsonSchema decide on which parser to use"),s={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"};var n=e.i(117958);let i=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString(),...t.slice(r)].join("/")};function o(e){if("openAi"!==e.target)return{};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:"relative"===e.$refStrategy?i(t,e.currentPath):t.join("/")}}function a(e,t,r,s){s?.errorMessages&&r&&(e.errorMessage={...e.errorMessage,[t]:r})}function l(e,t,r,s,n){e[t]=r,a(e,t,s,n)}function c(e,t){return C(e.type._def,t)}let u=/^[cC][^\s-]{8,}$/,d=/^[0-9a-z]+$/,h=/^[0-9A-HJKMNP-TV-Z]{26}$/,p=/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,f=()=>(void 0===t&&(t=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),t),m=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,g=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,y=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,b=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,_=/^[a-zA-Z0-9_-]{21}$/,w=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;function v(e,t){let r={type:"string"};if(e.checks)for(let s of e.checks)switch(s.kind){case"min":l(r,"minLength","number"==typeof r.minLength?Math.max(r.minLength,s.value):s.value,s.message,t);break;case"max":l(r,"maxLength","number"==typeof r.maxLength?Math.min(r.maxLength,s.value):s.value,s.message,t);break;case"email":switch(t.emailStrategy){case"format:email":x(r,"email",s.message,t);break;case"format:idn-email":x(r,"idn-email",s.message,t);break;case"pattern:zod":T(r,p,s.message,t)}break;case"url":x(r,"uri",s.message,t);break;case"uuid":x(r,"uuid",s.message,t);break;case"regex":T(r,s.regex,s.message,t);break;case"cuid":T(r,u,s.message,t);break;case"cuid2":T(r,d,s.message,t);break;case"startsWith":T(r,RegExp(`^${I(s.value,t)}`),s.message,t);break;case"endsWith":T(r,RegExp(`${I(s.value,t)}$`),s.message,t);break;case"datetime":x(r,"date-time",s.message,t);break;case"date":x(r,"date",s.message,t);break;case"time":x(r,"time",s.message,t);break;case"duration":x(r,"duration",s.message,t);break;case"length":l(r,"minLength","number"==typeof r.minLength?Math.max(r.minLength,s.value):s.value,s.message,t),l(r,"maxLength","number"==typeof r.maxLength?Math.min(r.maxLength,s.value):s.value,s.message,t);break;case"includes":T(r,RegExp(I(s.value,t)),s.message,t);break;case"ip":"v6"!==s.version&&x(r,"ipv4",s.message,t),"v4"!==s.version&&x(r,"ipv6",s.message,t);break;case"base64url":T(r,b,s.message,t);break;case"jwt":T(r,w,s.message,t);break;case"cidr":"v6"!==s.version&&T(r,m,s.message,t),"v4"!==s.version&&T(r,g,s.message,t);break;case"emoji":T(r,f(),s.message,t);break;case"ulid":T(r,h,s.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":x(r,"binary",s.message,t);break;case"contentEncoding:base64":l(r,"contentEncoding","base64",s.message,t);break;case"pattern:zod":T(r,y,s.message,t)}break;case"nanoid":T(r,_,s.message,t)}return r}function I(e,t){return"escape"===t.patternStrategy?function(e){let t="";for(let r=0;r<e.length;r++)k.has(e[r])||(t+="\\"),t+=e[r];return t}(e):e}let k=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function x(e,t,r,s){e.format||e.anyOf?.some(e=>e.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&s.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,0===Object.keys(e.errorMessage).length&&delete e.errorMessage)),e.anyOf.push({format:t,...r&&s.errorMessages&&{errorMessage:{format:r}}})):l(e,"format",t,r,s)}function T(e,t,r,s){e.pattern||e.allOf?.some(e=>e.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&s.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,0===Object.keys(e.errorMessage).length&&delete e.errorMessage)),e.allOf.push({pattern:E(t,s),...r&&s.errorMessages&&{errorMessage:{pattern:r}}})):l(e,"pattern",E(t,s),r,s)}function E(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},s=r.i?e.source.toLowerCase():e.source,n="",i=!1,o=!1,a=!1;for(let e=0;e<s.length;e++){if(i){n+=s[e],i=!1;continue}if(r.i){if(o){if(s[e].match(/[a-z]/)){a?(n+=s[e],n+=`${s[e-2]}-${s[e]}`.toUpperCase(),a=!1):"-"===s[e+1]&&s[e+2]?.match(/[a-z]/)?(n+=s[e],a=!0):n+=`${s[e]}${s[e].toUpperCase()}`;continue}}else if(s[e].match(/[a-z]/)){n+=`[${s[e]}${s[e].toUpperCase()}]`;continue}}if(r.m){if("^"===s[e]){n+=`(^|(?<=[\r
|
|
28
|
-
]))`;continue}else if("$"===s[e]){n+=`($|(?=[\r
|
|
29
|
-
]))`;continue}}if(r.s&&"."===s[e]){n+=o?`${s[e]}\r
|
|
30
|
-
`:`[${s[e]}\r
|
|
31
|
-
]`;continue}n+=s[e],"\\"===s[e]?i=!0:o&&"]"===s[e]?o=!1:o||"["!==s[e]||(o=!0)}try{new RegExp(n)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return n}function z(e,t){if("openAi"===t.target&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),"openApi3"===t.target&&e.keyType?._def.typeName===n.ZodFirstPartyTypeKind.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((r,s)=>({...r,[s]:C(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",s]})??o(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};let r={type:"object",additionalProperties:C(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if("openApi3"===t.target)return r;if(e.keyType?._def.typeName===n.ZodFirstPartyTypeKind.ZodString&&e.keyType._def.checks?.length){let{type:s,...n}=v(e.keyType._def,t);return{...r,propertyNames:n}}if(e.keyType?._def.typeName===n.ZodFirstPartyTypeKind.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===n.ZodFirstPartyTypeKind.ZodBranded&&e.keyType._def.type._def.typeName===n.ZodFirstPartyTypeKind.ZodString&&e.keyType._def.type._def.checks?.length){let{type:s,...n}=c(e.keyType._def,t);return{...r,propertyNames:n}}return r}let A={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"},S=(e,t)=>{let r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((e,r)=>C(e._def,{...t,currentPath:[...t.currentPath,"anyOf",`${r}`]})).filter(e=>!!e&&(!t.strictUnions||"object"==typeof e&&Object.keys(e).length>0));return r.length?{anyOf:r}:void 0};function C(e,t,s=!1){let i=t.seen.get(e);if(t.override){let n=t.override?.(e,t,i,s);if(n!==r)return n}if(i&&!s){let e=O(i,t);if(void 0!==e)return e}let u={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,u);let d=((e,t,r)=>{switch(t){case n.ZodFirstPartyTypeKind.ZodString:return v(e,r);case n.ZodFirstPartyTypeKind.ZodNumber:let s={type:"number"};if(!e.checks)return s;for(let t of e.checks)switch(t.kind){case"int":s.type="integer",a(s,"type",t.message,r);break;case"min":"jsonSchema7"===r.target?t.inclusive?l(s,"minimum",t.value,t.message,r):l(s,"exclusiveMinimum",t.value,t.message,r):(t.inclusive||(s.exclusiveMinimum=!0),l(s,"minimum",t.value,t.message,r));break;case"max":"jsonSchema7"===r.target?t.inclusive?l(s,"maximum",t.value,t.message,r):l(s,"exclusiveMaximum",t.value,t.message,r):(t.inclusive||(s.exclusiveMaximum=!0),l(s,"maximum",t.value,t.message,r));break;case"multipleOf":l(s,"multipleOf",t.value,t.message,r)}return s;case n.ZodFirstPartyTypeKind.ZodObject:return function(e,t){let r="openAi"===t.target,s={type:"object",properties:{}},n=[],i=e.shape();for(let e in i){let o=i[e];if(void 0===o||void 0===o._def)continue;let a=function(e){try{return e.isOptional()}catch{return!0}}(o);a&&r&&("ZodOptional"===o._def.typeName&&(o=o._def.innerType),o.isNullable()||(o=o.nullable()),a=!1);let l=C(o._def,{...t,currentPath:[...t.currentPath,"properties",e],propertyPath:[...t.currentPath,"properties",e]});void 0!==l&&(s.properties[e]=l,a||n.push(e))}n.length&&(s.required=n);let o=function(e,t){if("ZodNever"!==e.catchall._def.typeName)return C(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return"strict"===t.removeAdditionalStrategy?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}(e,t);return void 0!==o&&(s.additionalProperties=o),s}(e,r);case n.ZodFirstPartyTypeKind.ZodBigInt:let i={type:"integer",format:"int64"};if(!e.checks)return i;for(let t of e.checks)switch(t.kind){case"min":"jsonSchema7"===r.target?t.inclusive?l(i,"minimum",t.value,t.message,r):l(i,"exclusiveMinimum",t.value,t.message,r):(t.inclusive||(i.exclusiveMinimum=!0),l(i,"minimum",t.value,t.message,r));break;case"max":"jsonSchema7"===r.target?t.inclusive?l(i,"maximum",t.value,t.message,r):l(i,"exclusiveMaximum",t.value,t.message,r):(t.inclusive||(i.exclusiveMaximum=!0),l(i,"maximum",t.value,t.message,r));break;case"multipleOf":l(i,"multipleOf",t.value,t.message,r)}return i;case n.ZodFirstPartyTypeKind.ZodBoolean:return{type:"boolean"};case n.ZodFirstPartyTypeKind.ZodDate:return function e(t,r,s){let n=s??r.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((s,n)=>e(t,r,s))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":var i=t,o=r;let a={type:"integer",format:"unix-time"};if("openApi3"===o.target)return a;for(let e of i.checks)switch(e.kind){case"min":l(a,"minimum",e.value,e.message,o);break;case"max":l(a,"maximum",e.value,e.message,o)}return a}}(e,r);case n.ZodFirstPartyTypeKind.ZodUndefined:return{not:o(r)};case n.ZodFirstPartyTypeKind.ZodNull:return"openApi3"===r.target?{enum:["null"],nullable:!0}:{type:"null"};case n.ZodFirstPartyTypeKind.ZodArray:let u;return u={type:"array"},e.type?._def&&e.type?._def?.typeName!==n.ZodFirstPartyTypeKind.ZodAny&&(u.items=C(e.type._def,{...r,currentPath:[...r.currentPath,"items"]})),e.minLength&&l(u,"minItems",e.minLength.value,e.minLength.message,r),e.maxLength&&l(u,"maxItems",e.maxLength.value,e.maxLength.message,r),e.exactLength&&(l(u,"minItems",e.exactLength.value,e.exactLength.message,r),l(u,"maxItems",e.exactLength.value,e.exactLength.message,r)),u;case n.ZodFirstPartyTypeKind.ZodUnion:case n.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:if("openApi3"===r.target)return S(e,r);let d=e.options instanceof Map?Array.from(e.options.values()):e.options;if(d.every(e=>e._def.typeName in A&&(!e._def.checks||!e._def.checks.length))){let e=d.reduce((e,t)=>{let r=A[t._def.typeName];return r&&!e.includes(r)?[...e,r]:e},[]);return{type:e.length>1?e:e[0]}}if(d.every(e=>"ZodLiteral"===e._def.typeName&&!e.description)){let e=d.reduce((e,t)=>{let r=typeof t._def.value;switch(r){case"string":case"number":case"boolean":return[...e,r];case"bigint":return[...e,"integer"];case"object":if(null===t._def.value)return[...e,"null"];default:return e}},[]);if(e.length===d.length){let t=e.filter((e,t,r)=>r.indexOf(e)===t);return{type:t.length>1?t:t[0],enum:d.reduce((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value],[])}}}else if(d.every(e=>"ZodEnum"===e._def.typeName))return{type:"string",enum:d.reduce((e,t)=>[...e,...t._def.values.filter(t=>!e.includes(t))],[])};return S(e,r);case n.ZodFirstPartyTypeKind.ZodIntersection:let h,p,f;return h=[C(e.left._def,{...r,currentPath:[...r.currentPath,"allOf","0"]}),C(e.right._def,{...r,currentPath:[...r.currentPath,"allOf","1"]})].filter(e=>!!e),p="jsonSchema2019-09"===r.target?{unevaluatedProperties:!1}:void 0,f=[],h.forEach(e=>{if((!("type"in e)||"string"!==e.type)&&"allOf"in e)f.push(...e.allOf),void 0===e.unevaluatedProperties&&(p=void 0);else{let t=e;if("additionalProperties"in e&&!1===e.additionalProperties){let{additionalProperties:r,...s}=e;t=s}else p=void 0;f.push(t)}}),f.length?{allOf:f,...p}:void 0;case n.ZodFirstPartyTypeKind.ZodTuple:return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((e,t)=>C(e._def,{...r,currentPath:[...r.currentPath,"items",`${t}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[]),additionalItems:C(e.rest._def,{...r,currentPath:[...r.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((e,t)=>C(e._def,{...r,currentPath:[...r.currentPath,"items",`${t}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[])};case n.ZodFirstPartyTypeKind.ZodRecord:return z(e,r);case n.ZodFirstPartyTypeKind.ZodLiteral:let m;return"bigint"!=(m=typeof e.value)&&"number"!==m&&"boolean"!==m&&"string"!==m?{type:Array.isArray(e.value)?"array":"object"}:"openApi3"===r.target?{type:"bigint"===m?"integer":m,enum:[e.value]}:{type:"bigint"===m?"integer":m,const:e.value};case n.ZodFirstPartyTypeKind.ZodEnum:return{type:"string",enum:Array.from(e.values)};case n.ZodFirstPartyTypeKind.ZodNativeEnum:let g,y,b;return g=e.values,{type:1===(b=Array.from(new Set((y=Object.keys(e.values).filter(e=>"number"!=typeof g[g[e]]).map(e=>g[e])).map(e=>typeof e)))).length?"string"===b[0]?"string":"number":["string","number"],enum:y};case n.ZodFirstPartyTypeKind.ZodNullable:if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return"openApi3"===r.target?{type:A[e.innerType._def.typeName],nullable:!0}:{type:[A[e.innerType._def.typeName],"null"]};if("openApi3"===r.target){let t=C(e.innerType._def,{...r,currentPath:[...r.currentPath]});return t&&"$ref"in t?{allOf:[t],nullable:!0}:t&&{...t,nullable:!0}}let _=C(e.innerType._def,{...r,currentPath:[...r.currentPath,"anyOf","0"]});return _&&{anyOf:[_,{type:"null"}]};case n.ZodFirstPartyTypeKind.ZodOptional:if(r.currentPath.toString()===r.propertyPath?.toString())return C(e.innerType._def,r);let w=C(e.innerType._def,{...r,currentPath:[...r.currentPath,"anyOf","1"]});return w?{anyOf:[{not:o(r)},w]}:o(r);case n.ZodFirstPartyTypeKind.ZodMap:if("record"===r.mapStrategy)return z(e,r);return{type:"array",maxItems:125,items:{type:"array",items:[C(e.keyType._def,{...r,currentPath:[...r.currentPath,"items","items","0"]})||o(r),C(e.valueType._def,{...r,currentPath:[...r.currentPath,"items","items","1"]})||o(r)],minItems:2,maxItems:2}};case n.ZodFirstPartyTypeKind.ZodSet:let I;return I={type:"array",uniqueItems:!0,items:C(e.valueType._def,{...r,currentPath:[...r.currentPath,"items"]})},e.minSize&&l(I,"minItems",e.minSize.value,e.minSize.message,r),e.maxSize&&l(I,"maxItems",e.maxSize.value,e.maxSize.message,r),I;case n.ZodFirstPartyTypeKind.ZodLazy:return()=>e.getter()._def;case n.ZodFirstPartyTypeKind.ZodPromise:return C(e.type._def,r);case n.ZodFirstPartyTypeKind.ZodNaN:case n.ZodFirstPartyTypeKind.ZodNever:return"openAi"===r.target?void 0:{not:o({...r,currentPath:[...r.currentPath,"not"]})};case n.ZodFirstPartyTypeKind.ZodEffects:return"input"===r.effectStrategy?C(e.schema._def,r):o(r);case n.ZodFirstPartyTypeKind.ZodAny:case n.ZodFirstPartyTypeKind.ZodUnknown:return o(r);case n.ZodFirstPartyTypeKind.ZodDefault:return{...C(e.innerType._def,r),default:e.defaultValue()};case n.ZodFirstPartyTypeKind.ZodBranded:return c(e,r);case n.ZodFirstPartyTypeKind.ZodReadonly:case n.ZodFirstPartyTypeKind.ZodCatch:return C(e.innerType._def,r);case n.ZodFirstPartyTypeKind.ZodPipeline:if("input"===r.pipeStrategy)return C(e.in._def,r);if("output"===r.pipeStrategy)return C(e.out._def,r);let k=C(e.in._def,{...r,currentPath:[...r.currentPath,"allOf","0"]}),x=C(e.out._def,{...r,currentPath:[...r.currentPath,"allOf",k?"1":"0"]});return{allOf:[k,x].filter(e=>void 0!==e)};case n.ZodFirstPartyTypeKind.ZodFunction:case n.ZodFirstPartyTypeKind.ZodVoid:case n.ZodFirstPartyTypeKind.ZodSymbol:default:return}})(e,e.typeName,t),h="function"==typeof d?C(d(),t):d;if(h&&P(e,t,h),t.postProcess){let r=t.postProcess(h,e,t);return u.jsonSchema=h,r}return u.jsonSchema=h,h}let O=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:i(t.currentPath,e.path)};case"none":case"seen":if(e.path.length<t.currentPath.length&&e.path.every((e,r)=>t.currentPath[r]===e))return console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),o(t);return"seen"===t.$refStrategy?o(t):void 0}},P=(e,t,r)=>(e.description&&(r.description=e.description,t.markdownDescription&&(r.markdownDescription=e.description)),r);e.s(["zodToJsonSchema",0,(e,t)=>{let r,n,i=(n=void 0!==(r="string"==typeof t?{...s,name:t}:{...s,...t}).name?[...r.basePath,r.definitionPath,r.name]:r.basePath,{...r,flags:{hasReferencedOpenAiAnyType:!1},currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(r.definitions).map(([e,t])=>[t._def,{def:t._def,path:[...r.basePath,r.definitionPath,e],jsonSchema:void 0}]))}),a="object"==typeof t&&t.definitions?Object.entries(t.definitions).reduce((e,[t,r])=>({...e,[t]:C(r._def,{...i,currentPath:[...i.basePath,i.definitionPath,t]},!0)??o(i)}),{}):void 0,l="string"==typeof t?t:t?.nameStrategy==="title"?void 0:t?.name,c=C(e._def,void 0===l?i:{...i,currentPath:[...i.basePath,i.definitionPath,l]},!1)??o(i),u="object"==typeof t&&void 0!==t.name&&"title"===t.nameStrategy?t.name:void 0;void 0!==u&&(c.title=u),i.flags.hasReferencedOpenAiAnyType&&(a||(a={}),a[i.openAiAnyTypeName]||(a[i.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:"relative"===i.$refStrategy?"1":[...i.basePath,i.definitionPath,i.openAiAnyTypeName].join("/")}}));let d=void 0===l?a?{...c,[i.definitionPath]:a}:c:{$ref:[..."relative"===i.$refStrategy?[]:i.basePath,i.definitionPath,l].join("/"),[i.definitionPath]:{...a,[l]:c}};return"jsonSchema7"===i.target?d.$schema="http://json-schema.org/draft-07/schema#":("jsonSchema2019-09"===i.target||"openAi"===i.target)&&(d.$schema="https://json-schema.org/draft/2019-09/schema#"),"openAi"===i.target&&("anyOf"in d||"oneOf"in d||"allOf"in d||"type"in d&&Array.isArray(d.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),d}],901480)},115235,742944,e=>{"use strict";var t,r,s;(s=t||(t={})).assertEqual=e=>{},s.assertIs=function(e){},s.assertNever=function(e){throw Error()},s.arrayToEnum=e=>{let t={};for(let r of e)t[r]=r;return t},s.getValidEnumValues=e=>{let t=s.objectKeys(e).filter(t=>"number"!=typeof e[e[t]]),r={};for(let s of t)r[s]=e[s];return s.objectValues(r)},s.objectValues=e=>s.objectKeys(e).map(function(t){return e[t]}),s.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{let t=[];for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},s.find=(e,t)=>{for(let r of e)if(t(r))return r},s.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,s.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},s.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(r||(r={})).mergeShapes=(e,t)=>({...e,...t});let n=t.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);e.s(["ZodParsedType",0,n,"getParsedType",0,e=>{switch(typeof e){case"undefined":return n.undefined;case"string":return n.string;case"number":return Number.isNaN(e)?n.nan:n.number;case"boolean":return n.boolean;case"function":return n.function;case"bigint":return n.bigint;case"symbol":return n.symbol;case"object":if(Array.isArray(e))return n.array;if(null===e)return n.null;if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return n.promise;if("u">typeof Map&&e instanceof Map)return n.map;if("u">typeof Set&&e instanceof Set)return n.set;if("u">typeof Date&&e instanceof Date)return n.date;return n.object;default:return n.unknown}},"objectUtil",0,r,"util",0,t],742944);let i=t.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class o extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(e){return e.message},r={_errors:[]},s=e=>{for(let n of e.issues)if("invalid_union"===n.code)n.unionErrors.map(s);else if("invalid_return_type"===n.code)s(n.returnTypeError);else if("invalid_arguments"===n.code)s(n.argumentsError);else if(0===n.path.length)r._errors.push(t(n));else{let e=r,s=0;for(;s<n.path.length;){let r=n.path[s],i=s===n.path.length-1;if("_errors"===r){i&&e._errors.push(t(n)),s++;continue}Object.prototype.hasOwnProperty.call(e,r)||("__proto__"===r?Object.defineProperty(e,r,{value:{_errors:[]},writable:!0,enumerable:!0,configurable:!0}):e[r]={_errors:[]}),e=e[r],i&&e._errors.push(t(n)),s++}}};return s(this),r}static assert(e){if(!(e instanceof o))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,t.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){let t=Object.create(null),r=[];for(let s of this.issues)if(s.path.length>0){let r=s.path[0];t[r]=t[r]||[],t[r].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}o.create=e=>new o(e),e.s(["ZodError",0,o,"ZodIssueCode",0,i,"quotelessJson",0,e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:")],115235)},676733,e=>{"use strict";var t=e.i(585676),r=e.i(880264);e.s(["defaultErrorMap",()=>r.default,"getErrorMap",()=>t.getErrorMap,"setErrorMap",()=>t.setErrorMap])},585676,e=>{"use strict";let t=e.i(880264).default;e.s(["getErrorMap",0,function(){return t},"setErrorMap",0,function(e){t=e}])},322632,735907,e=>{"use strict";e.i(254033);var t=e.i(676733),r=e.i(984488);e.i(91316);var s=e.i(742944),n=e.i(117958),i=e.i(115235);e.s(["BRAND",()=>n.BRAND,"DIRTY",()=>r.DIRTY,"EMPTY_PATH",()=>r.EMPTY_PATH,"INVALID",()=>r.INVALID,"NEVER",()=>n.NEVER,"OK",()=>r.OK,"ParseStatus",()=>r.ParseStatus,"Schema",()=>n.Schema,"ZodAny",()=>n.ZodAny,"ZodArray",()=>n.ZodArray,"ZodBigInt",()=>n.ZodBigInt,"ZodBoolean",()=>n.ZodBoolean,"ZodBranded",()=>n.ZodBranded,"ZodCatch",()=>n.ZodCatch,"ZodDate",()=>n.ZodDate,"ZodDefault",()=>n.ZodDefault,"ZodDiscriminatedUnion",()=>n.ZodDiscriminatedUnion,"ZodEffects",()=>n.ZodEffects,"ZodEnum",()=>n.ZodEnum,"ZodError",()=>i.ZodError,"ZodFirstPartyTypeKind",()=>n.ZodFirstPartyTypeKind,"ZodFunction",()=>n.ZodFunction,"ZodIntersection",()=>n.ZodIntersection,"ZodIssueCode",()=>i.ZodIssueCode,"ZodLazy",()=>n.ZodLazy,"ZodLiteral",()=>n.ZodLiteral,"ZodMap",()=>n.ZodMap,"ZodNaN",()=>n.ZodNaN,"ZodNativeEnum",()=>n.ZodNativeEnum,"ZodNever",()=>n.ZodNever,"ZodNull",()=>n.ZodNull,"ZodNullable",()=>n.ZodNullable,"ZodNumber",()=>n.ZodNumber,"ZodObject",()=>n.ZodObject,"ZodOptional",()=>n.ZodOptional,"ZodParsedType",()=>s.ZodParsedType,"ZodPipeline",()=>n.ZodPipeline,"ZodPromise",()=>n.ZodPromise,"ZodReadonly",()=>n.ZodReadonly,"ZodRecord",()=>n.ZodRecord,"ZodSchema",()=>n.ZodSchema,"ZodSet",()=>n.ZodSet,"ZodString",()=>n.ZodString,"ZodSymbol",()=>n.ZodSymbol,"ZodTransformer",()=>n.ZodTransformer,"ZodTuple",()=>n.ZodTuple,"ZodType",()=>n.ZodType,"ZodUndefined",()=>n.ZodUndefined,"ZodUnion",()=>n.ZodUnion,"ZodUnknown",()=>n.ZodUnknown,"ZodVoid",()=>n.ZodVoid,"addIssueToContext",()=>r.addIssueToContext,"any",()=>n.any,"array",()=>n.array,"bigint",()=>n.bigint,"boolean",()=>n.boolean,"coerce",()=>n.coerce,"custom",()=>n.custom,"date",()=>n.date,"datetimeRegex",()=>n.datetimeRegex,"defaultErrorMap",()=>t.defaultErrorMap,"discriminatedUnion",()=>n.discriminatedUnion,"effect",()=>n.effect,"enum",()=>n.enum,"function",()=>n.function,"getErrorMap",()=>t.getErrorMap,"getParsedType",()=>s.getParsedType,"instanceof",()=>n.instanceof,"intersection",()=>n.intersection,"isAborted",()=>r.isAborted,"isAsync",()=>r.isAsync,"isDirty",()=>r.isDirty,"isValid",()=>r.isValid,"late",()=>n.late,"lazy",()=>n.lazy,"literal",()=>n.literal,"makeIssue",()=>r.makeIssue,"map",()=>n.map,"nan",()=>n.nan,"nativeEnum",()=>n.nativeEnum,"never",()=>n.never,"null",()=>n.null,"nullable",()=>n.nullable,"number",()=>n.number,"object",()=>n.object,"objectUtil",()=>s.objectUtil,"oboolean",()=>n.oboolean,"onumber",()=>n.onumber,"optional",()=>n.optional,"ostring",()=>n.ostring,"pipeline",()=>n.pipeline,"preprocess",()=>n.preprocess,"promise",()=>n.promise,"quotelessJson",()=>i.quotelessJson,"record",()=>n.record,"set",()=>n.set,"setErrorMap",()=>t.setErrorMap,"strictObject",()=>n.strictObject,"string",()=>n.string,"symbol",()=>n.symbol,"transformer",()=>n.transformer,"tuple",()=>n.tuple,"undefined",()=>n.undefined,"union",()=>n.union,"unknown",()=>n.unknown,"util",()=>s.util,"void",()=>n.void],735907);var o=e.i(735907);e.s(["z",0,o],322632)},12800,e=>{"use strict";var t,r;(r=t||(t={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},r.toString=e=>"string"==typeof e?e:e?.message,e.s(["errorUtil",0,t])},984488,e=>{"use strict";var t=e.i(585676),r=e.i(880264);let s=e=>{let{data:t,path:r,errorMaps:s,issueData:n}=e,i=[...r,...n.path||[]],o={...n,path:i};if(void 0!==n.message)return{...n,path:i,message:n.message};let a="";for(let e of s.filter(e=>!!e).slice().reverse())a=e(o,{data:t,defaultError:a}).message;return{...n,path:i,message:a}};class n{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){let r=[];for(let s of t){if("aborted"===s.status)return i;"dirty"===s.status&&e.dirty(),r.push(s.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let e of t){let t=await e.key,s=await e.value;r.push({key:t,value:s})}return n.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let s of t){let{key:t,value:n}=s;if("aborted"===t.status||"aborted"===n.status)return i;"dirty"===t.status&&e.dirty(),"dirty"===n.status&&e.dirty(),"__proto__"!==t.value&&(void 0!==n.value||s.alwaysSet)&&(r[t.value]=n.value)}return{status:e.value,value:r}}}let i=Object.freeze({status:"aborted"});e.s(["DIRTY",0,e=>({status:"dirty",value:e}),"EMPTY_PATH",0,[],"INVALID",0,i,"OK",0,e=>({status:"valid",value:e}),"ParseStatus",0,n,"addIssueToContext",0,function(e,n){let i=(0,t.getErrorMap)(),o=s({issueData:n,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,i,i===r.default?void 0:r.default].filter(e=>!!e)});e.common.issues.push(o)},"isAborted",0,e=>"aborted"===e.status,"isAsync",0,e=>"u">typeof Promise&&e instanceof Promise,"isDirty",0,e=>"dirty"===e.status,"isValid",0,e=>"valid"===e.status,"makeIssue",0,s])},91316,e=>{"use strict";e.s([])},880264,e=>{"use strict";var t=e.i(115235),r=e.i(742944);e.s(["default",0,(e,s)=>{let n;switch(e.code){case t.ZodIssueCode.invalid_type:n=e.received===r.ZodParsedType.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case t.ZodIssueCode.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,r.util.jsonStringifyReplacer)}`;break;case t.ZodIssueCode.unrecognized_keys:n=`Unrecognized key(s) in object: ${r.util.joinValues(e.keys,", ")}`;break;case t.ZodIssueCode.invalid_union:n="Invalid input";break;case t.ZodIssueCode.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${r.util.joinValues(e.options)}`;break;case t.ZodIssueCode.invalid_enum_value:n=`Invalid enum value. Expected ${r.util.joinValues(e.options)}, received '${e.received}'`;break;case t.ZodIssueCode.invalid_arguments:n="Invalid function arguments";break;case t.ZodIssueCode.invalid_return_type:n="Invalid function return type";break;case t.ZodIssueCode.invalid_date:n="Invalid date";break;case t.ZodIssueCode.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:r.util.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case t.ZodIssueCode.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case t.ZodIssueCode.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case t.ZodIssueCode.custom:n="Invalid input";break;case t.ZodIssueCode.invalid_intersection_types:n="Intersection results could not be merged";break;case t.ZodIssueCode.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case t.ZodIssueCode.not_finite:n="Number must be finite";break;default:n=s.defaultError,r.util.assertNever(e)}return{message:n}}])},610806,e=>{"use strict";var t=e.i(880264);e.s(["defaultErrorMap",()=>t.default])},117958,e=>{"use strict";let t;var r,s,n=e.i(115235),i=e.i(610806),o=e.i(585676),a=e.i(12800),l=e.i(984488),c=e.i(742944);class u{constructor(e,t,r,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}let d=(e,t)=>{if((0,l.isValid)(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new n.ZodError(e.common.issues);return this._error=t,this._error}}};function h(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:s,description:n}=e;if(t&&(r||s))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:n}:{errorMap:(t,n)=>{let{message:i}=e;return"invalid_enum_value"===t.code?{message:i??n.defaultError}:void 0===n.data?{message:i??s??n.defaultError}:"invalid_type"!==t.code?{message:n.defaultError}:{message:i??r??n.defaultError}},description:n}}class p{get description(){return this._def.description}_getType(e){return(0,c.getParsedType)(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:(0,c.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new l.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0,c.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if((0,l.isAsync)(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){return Promise.resolve(this._parse(e))}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){let r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,c.getParsedType)(e)},s=this._parseSync({data:e,path:r.path,parent:r});return d(r,s)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,c.getParsedType)(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return(0,l.isValid)(r)?{value:r.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>(0,l.isValid)(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,c.getParsedType)(e)},s=this._parse({data:e,path:r.path,parent:r});return d(r,await ((0,l.isAsync)(s)?s:Promise.resolve(s)))}refine(e,t){return this._refinement((r,s)=>{let i=e(r),o=()=>s.addIssue({code:n.ZodIssueCode.custom,..."string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(r):t});return"u">typeof Promise&&i instanceof Promise?i.then(e=>!!e||(o(),!1)):!!i||(o(),!1)})}refinement(e,t){return this._refinement((r,s)=>!!e(r)||(s.addIssue("function"==typeof t?t(r,s):t),!1))}_refinement(e){return new ea({schema:this,typeName:s.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return el.create(this,this._def)}nullable(){return ec.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return V.create(this)}promise(){return eo.create(this,this._def)}or(e){return K.create([this,e],this._def)}and(e){return G.create(this,e,this._def)}transform(e){return new ea({...h(this._def),schema:this,typeName:s.ZodEffects,effect:{type:"transform",transform:e}})}default(e){return new eu({...h(this._def),innerType:this,defaultValue:"function"==typeof e?e:()=>e,typeName:s.ZodDefault})}brand(){return new ef({typeName:s.ZodBranded,type:this,...h(this._def)})}catch(e){return new ed({...h(this._def),innerType:this,catchValue:"function"==typeof e?e:()=>e,typeName:s.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return em.create(this,e)}readonly(){return eg.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let f=/^c[^\s-]{8,}$/i,m=/^[0-9a-z]+$/,g=/^[0-9A-HJKMNP-TV-Z]{26}$/i,y=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,b=/^[a-z0-9_-]{21}$/i,_=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,w=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,v=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,I=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,k=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,x=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,T=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,E=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,z=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,A="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",S=RegExp(`^${A}$`);function C(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function O(e){let t=`${A}T${C(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,RegExp(`^${t}$`)}class P extends p{_parse(e){var r,s,i,o;let a;if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==c.ZodParsedType.string){let t=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(t,{code:n.ZodIssueCode.invalid_type,expected:c.ZodParsedType.string,received:t.parsedType}),l.INVALID}let u=new l.ParseStatus;for(let d of this._def.checks)if("min"===d.kind)e.data.length<d.value&&(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{code:n.ZodIssueCode.too_small,minimum:d.value,type:"string",inclusive:!0,exact:!1,message:d.message}),u.dirty());else if("max"===d.kind)e.data.length>d.value&&(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{code:n.ZodIssueCode.too_big,maximum:d.value,type:"string",inclusive:!0,exact:!1,message:d.message}),u.dirty());else if("length"===d.kind){let t=e.data.length>d.value,r=e.data.length<d.value;(t||r)&&(a=this._getOrReturnCtx(e,a),t?(0,l.addIssueToContext)(a,{code:n.ZodIssueCode.too_big,maximum:d.value,type:"string",inclusive:!0,exact:!0,message:d.message}):r&&(0,l.addIssueToContext)(a,{code:n.ZodIssueCode.too_small,minimum:d.value,type:"string",inclusive:!0,exact:!0,message:d.message}),u.dirty())}else if("email"===d.kind)v.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{validation:"email",code:n.ZodIssueCode.invalid_string,message:d.message}),u.dirty());else if("emoji"===d.kind)t||(t=RegExp("^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$","u")),t.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{validation:"emoji",code:n.ZodIssueCode.invalid_string,message:d.message}),u.dirty());else if("uuid"===d.kind)y.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{validation:"uuid",code:n.ZodIssueCode.invalid_string,message:d.message}),u.dirty());else if("nanoid"===d.kind)b.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{validation:"nanoid",code:n.ZodIssueCode.invalid_string,message:d.message}),u.dirty());else if("cuid"===d.kind)f.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{validation:"cuid",code:n.ZodIssueCode.invalid_string,message:d.message}),u.dirty());else if("cuid2"===d.kind)m.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{validation:"cuid2",code:n.ZodIssueCode.invalid_string,message:d.message}),u.dirty());else if("ulid"===d.kind)g.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{validation:"ulid",code:n.ZodIssueCode.invalid_string,message:d.message}),u.dirty());else if("url"===d.kind)try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{validation:"url",code:n.ZodIssueCode.invalid_string,message:d.message}),u.dirty()}else"regex"===d.kind?(d.regex.lastIndex=0,d.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{validation:"regex",code:n.ZodIssueCode.invalid_string,message:d.message}),u.dirty())):"trim"===d.kind?e.data=e.data.trim():"includes"===d.kind?e.data.includes(d.value,d.position)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{code:n.ZodIssueCode.invalid_string,validation:{includes:d.value,position:d.position},message:d.message}),u.dirty()):"toLowerCase"===d.kind?e.data=e.data.toLowerCase():"toUpperCase"===d.kind?e.data=e.data.toUpperCase():"startsWith"===d.kind?e.data.startsWith(d.value)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{code:n.ZodIssueCode.invalid_string,validation:{startsWith:d.value},message:d.message}),u.dirty()):"endsWith"===d.kind?e.data.endsWith(d.value)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{code:n.ZodIssueCode.invalid_string,validation:{endsWith:d.value},message:d.message}),u.dirty()):"datetime"===d.kind?O(d).test(e.data)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{code:n.ZodIssueCode.invalid_string,validation:"datetime",message:d.message}),u.dirty()):"date"===d.kind?S.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{code:n.ZodIssueCode.invalid_string,validation:"date",message:d.message}),u.dirty()):"time"===d.kind?RegExp(`^${C(d)}$`).test(e.data)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{code:n.ZodIssueCode.invalid_string,validation:"time",message:d.message}),u.dirty()):"duration"===d.kind?w.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{validation:"duration",code:n.ZodIssueCode.invalid_string,message:d.message}),u.dirty()):"ip"===d.kind?(r=e.data,!(("v4"===(s=d.version)||!s)&&I.test(r)||("v6"===s||!s)&&x.test(r))&&1&&(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{validation:"ip",code:n.ZodIssueCode.invalid_string,message:d.message}),u.dirty())):"jwt"===d.kind?!function(e,t){if(!_.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let s=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),n=JSON.parse(atob(s));if("object"!=typeof n||null===n||"typ"in n&&n?.typ!=="JWT"||!n.alg||t&&n.alg!==t)return!1;return!0}catch{return!1}}(e.data,d.alg)&&(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{validation:"jwt",code:n.ZodIssueCode.invalid_string,message:d.message}),u.dirty()):"cidr"===d.kind?(i=e.data,!(("v4"===(o=d.version)||!o)&&k.test(i)||("v6"===o||!o)&&T.test(i))&&1&&(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{validation:"cidr",code:n.ZodIssueCode.invalid_string,message:d.message}),u.dirty())):"base64"===d.kind?E.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{validation:"base64",code:n.ZodIssueCode.invalid_string,message:d.message}),u.dirty()):"base64url"===d.kind?z.test(e.data)||(a=this._getOrReturnCtx(e,a),(0,l.addIssueToContext)(a,{validation:"base64url",code:n.ZodIssueCode.invalid_string,message:d.message}),u.dirty()):c.util.assertNever(d);return{status:u.value,value:e.data}}_regex(e,t,r){return this.refinement(t=>e.test(t),{validation:t,code:n.ZodIssueCode.invalid_string,...a.errorUtil.errToObj(r)})}_addCheck(e){return new P({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...a.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...a.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...a.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...a.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...a.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...a.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...a.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...a.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...a.errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...a.errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...a.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...a.errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...a.errorUtil.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...a.errorUtil.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...a.errorUtil.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...a.errorUtil.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...a.errorUtil.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...a.errorUtil.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...a.errorUtil.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...a.errorUtil.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...a.errorUtil.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...a.errorUtil.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...a.errorUtil.errToObj(t)})}nonempty(e){return this.min(1,a.errorUtil.errToObj(e))}trim(){return new P({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new P({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new P({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}P.create=e=>new P({checks:[],typeName:s.ZodString,coerce:e?.coerce??!1,...h(e)});class R extends p{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){let t;if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==c.ZodParsedType.number){let t=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(t,{code:n.ZodIssueCode.invalid_type,expected:c.ZodParsedType.number,received:t.parsedType}),l.INVALID}let r=new l.ParseStatus;for(let s of this._def.checks)"int"===s.kind?c.util.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),(0,l.addIssueToContext)(t,{code:n.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):"min"===s.kind?(s.inclusive?e.data<s.value:e.data<=s.value)&&(t=this._getOrReturnCtx(e,t),(0,l.addIssueToContext)(t,{code:n.ZodIssueCode.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):"max"===s.kind?(s.inclusive?e.data>s.value:e.data>=s.value)&&(t=this._getOrReturnCtx(e,t),(0,l.addIssueToContext)(t,{code:n.ZodIssueCode.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):"multipleOf"===s.kind?0!==function(e,t){let r=(e.toString().split(".")[1]||"").length,s=(t.toString().split(".")[1]||"").length,n=r>s?r:s;return Number.parseInt(e.toFixed(n).replace(".",""))%Number.parseInt(t.toFixed(n).replace(".",""))/10**n}(e.data,s.value)&&(t=this._getOrReturnCtx(e,t),(0,l.addIssueToContext)(t,{code:n.ZodIssueCode.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):"finite"===s.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),(0,l.addIssueToContext)(t,{code:n.ZodIssueCode.not_finite,message:s.message}),r.dirty()):c.util.assertNever(s);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,a.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,a.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,a.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,a.errorUtil.toString(t))}setLimit(e,t,r,s){return new R({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:a.errorUtil.toString(s)}]})}_addCheck(e){return new R({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:a.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:a.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:a.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:a.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:a.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:a.errorUtil.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:a.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:a.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:a.errorUtil.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&c.util.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks)if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;else"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value);return Number.isFinite(t)&&Number.isFinite(e)}}R.create=e=>new R({checks:[],typeName:s.ZodNumber,coerce:e?.coerce||!1,...h(e)});class $ extends p{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){let t;if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==c.ZodParsedType.bigint)return this._getInvalidInput(e);let r=new l.ParseStatus;for(let s of this._def.checks)"min"===s.kind?(s.inclusive?e.data<s.value:e.data<=s.value)&&(t=this._getOrReturnCtx(e,t),(0,l.addIssueToContext)(t,{code:n.ZodIssueCode.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):"max"===s.kind?(s.inclusive?e.data>s.value:e.data>=s.value)&&(t=this._getOrReturnCtx(e,t),(0,l.addIssueToContext)(t,{code:n.ZodIssueCode.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):"multipleOf"===s.kind?e.data%s.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),(0,l.addIssueToContext)(t,{code:n.ZodIssueCode.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):c.util.assertNever(s);return{status:r.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(t,{code:n.ZodIssueCode.invalid_type,expected:c.ZodParsedType.bigint,received:t.parsedType}),l.INVALID}gte(e,t){return this.setLimit("min",e,!0,a.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,a.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,a.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,a.errorUtil.toString(t))}setLimit(e,t,r,s){return new $({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:a.errorUtil.toString(s)}]})}_addCheck(e){return new $({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:a.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:a.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:a.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:a.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:a.errorUtil.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}$.create=e=>new $({checks:[],typeName:s.ZodBigInt,coerce:e?.coerce??!1,...h(e)});class N extends p{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==c.ZodParsedType.boolean){let t=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(t,{code:n.ZodIssueCode.invalid_type,expected:c.ZodParsedType.boolean,received:t.parsedType}),l.INVALID}return(0,l.OK)(e.data)}}N.create=e=>new N({typeName:s.ZodBoolean,coerce:e?.coerce||!1,...h(e)});class j extends p{_parse(e){let t;if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==c.ZodParsedType.date){let t=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(t,{code:n.ZodIssueCode.invalid_type,expected:c.ZodParsedType.date,received:t.parsedType}),l.INVALID}if(Number.isNaN(e.data.getTime())){let t=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(t,{code:n.ZodIssueCode.invalid_date}),l.INVALID}let r=new l.ParseStatus;for(let s of this._def.checks)"min"===s.kind?e.data.getTime()<s.value&&(t=this._getOrReturnCtx(e,t),(0,l.addIssueToContext)(t,{code:n.ZodIssueCode.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):"max"===s.kind?e.data.getTime()>s.value&&(t=this._getOrReturnCtx(e,t),(0,l.addIssueToContext)(t,{code:n.ZodIssueCode.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):c.util.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new j({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:a.errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:a.errorUtil.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}j.create=e=>new j({checks:[],coerce:e?.coerce||!1,typeName:s.ZodDate,...h(e)});class L extends p{_parse(e){if(this._getType(e)!==c.ZodParsedType.symbol){let t=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(t,{code:n.ZodIssueCode.invalid_type,expected:c.ZodParsedType.symbol,received:t.parsedType}),l.INVALID}return(0,l.OK)(e.data)}}L.create=e=>new L({typeName:s.ZodSymbol,...h(e)});class D extends p{_parse(e){if(this._getType(e)!==c.ZodParsedType.undefined){let t=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(t,{code:n.ZodIssueCode.invalid_type,expected:c.ZodParsedType.undefined,received:t.parsedType}),l.INVALID}return(0,l.OK)(e.data)}}D.create=e=>new D({typeName:s.ZodUndefined,...h(e)});class U extends p{_parse(e){if(this._getType(e)!==c.ZodParsedType.null){let t=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(t,{code:n.ZodIssueCode.invalid_type,expected:c.ZodParsedType.null,received:t.parsedType}),l.INVALID}return(0,l.OK)(e.data)}}U.create=e=>new U({typeName:s.ZodNull,...h(e)});class F extends p{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,l.OK)(e.data)}}F.create=e=>new F({typeName:s.ZodAny,...h(e)});class M extends p{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,l.OK)(e.data)}}M.create=e=>new M({typeName:s.ZodUnknown,...h(e)});class Z extends p{_parse(e){let t=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(t,{code:n.ZodIssueCode.invalid_type,expected:c.ZodParsedType.never,received:t.parsedType}),l.INVALID}}Z.create=e=>new Z({typeName:s.ZodNever,...h(e)});class B extends p{_parse(e){if(this._getType(e)!==c.ZodParsedType.undefined){let t=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(t,{code:n.ZodIssueCode.invalid_type,expected:c.ZodParsedType.void,received:t.parsedType}),l.INVALID}return(0,l.OK)(e.data)}}B.create=e=>new B({typeName:s.ZodVoid,...h(e)});class V extends p{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),s=this._def;if(t.parsedType!==c.ZodParsedType.array)return(0,l.addIssueToContext)(t,{code:n.ZodIssueCode.invalid_type,expected:c.ZodParsedType.array,received:t.parsedType}),l.INVALID;if(null!==s.exactLength){let e=t.data.length>s.exactLength.value,i=t.data.length<s.exactLength.value;(e||i)&&((0,l.addIssueToContext)(t,{code:e?n.ZodIssueCode.too_big:n.ZodIssueCode.too_small,minimum:i?s.exactLength.value:void 0,maximum:e?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(null!==s.minLength&&t.data.length<s.minLength.value&&((0,l.addIssueToContext)(t,{code:n.ZodIssueCode.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),null!==s.maxLength&&t.data.length>s.maxLength.value&&((0,l.addIssueToContext)(t,{code:n.ZodIssueCode.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>s.type._parseAsync(new u(t,e,t.path,r)))).then(e=>l.ParseStatus.mergeArray(r,e));let i=[...t.data].map((e,r)=>s.type._parseSync(new u(t,e,t.path,r)));return l.ParseStatus.mergeArray(r,i)}get element(){return this._def.type}min(e,t){return new V({...this._def,minLength:{value:e,message:a.errorUtil.toString(t)}})}max(e,t){return new V({...this._def,maxLength:{value:e,message:a.errorUtil.toString(t)}})}length(e,t){return new V({...this._def,exactLength:{value:e,message:a.errorUtil.toString(t)}})}nonempty(e){return this.min(1,e)}}V.create=(e,t)=>new V({type:e,minLength:null,maxLength:null,exactLength:null,typeName:s.ZodArray,...h(t)});class W extends p{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let e=this._def.shape(),t=c.util.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==c.ZodParsedType.object){let t=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(t,{code:n.ZodIssueCode.invalid_type,expected:c.ZodParsedType.object,received:t.parsedType}),l.INVALID}let{status:t,ctx:r}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof Z&&"strip"===this._def.unknownKeys))for(let e in r.data)i.includes(e)||o.push(e);let a=[];for(let e of i){let t=s[e],n=r.data[e];a.push({key:{status:"valid",value:e},value:t._parse(new u(r,n,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof Z){let e=this._def.unknownKeys;if("passthrough"===e)for(let e of o)a.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)o.length>0&&((0,l.addIssueToContext)(r,{code:n.ZodIssueCode.unrecognized_keys,keys:o}),t.dirty());else if("strip"===e);else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let e=this._def.catchall;for(let t of o){let s=r.data[t];a.push({key:{status:"valid",value:t},value:e._parse(new u(r,s,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of a){let r=await t.key,s=await t.value;e.push({key:r,value:s,alwaysSet:t.alwaysSet})}return e}).then(e=>l.ParseStatus.mergeObjectSync(t,e)):l.ParseStatus.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return a.errorUtil.errToObj,new W({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{let s=this._def.errorMap?.(t,r).message??r.defaultError;return"unrecognized_keys"===t.code?{message:a.errorUtil.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new W({...this._def,unknownKeys:"strip"})}passthrough(){return new W({...this._def,unknownKeys:"passthrough"})}extend(e){return new W({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new W({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:s.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new W({...this._def,catchall:e})}pick(e){let t={};for(let r of c.util.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new W({...this._def,shape:()=>t})}omit(e){let t={};for(let r of c.util.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new W({...this._def,shape:()=>t})}deepPartial(){return function e(t){if(t instanceof W){let r={};for(let s in t.shape){let n=t.shape[s];r[s]=el.create(e(n))}return new W({...t._def,shape:()=>r})}if(t instanceof V)return new V({...t._def,type:e(t.element)});if(t instanceof el)return el.create(e(t.unwrap()));if(t instanceof ec)return ec.create(e(t.unwrap()));if(t instanceof X)return X.create(t.items.map(t=>e(t)));else return t}(this)}partial(e){let t={};for(let r of c.util.objectKeys(this.shape)){let s=this.shape[r];e&&!e[r]?t[r]=s:t[r]=s.optional()}return new W({...this._def,shape:()=>t})}required(e){let t={};for(let r of c.util.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof el;)e=e._def.innerType;t[r]=e}return new W({...this._def,shape:()=>t})}keyof(){return es(c.util.objectKeys(this.shape))}}W.create=(e,t)=>new W({shape:()=>e,unknownKeys:"strip",catchall:Z.create(),typeName:s.ZodObject,...h(t)}),W.strictCreate=(e,t)=>new W({shape:()=>e,unknownKeys:"strict",catchall:Z.create(),typeName:s.ZodObject,...h(t)}),W.lazycreate=(e,t)=>new W({shape:e,unknownKeys:"strip",catchall:Z.create(),typeName:s.ZodObject,...h(t)});class K extends p{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{let r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(let t of e)if("valid"===t.result.status)return t.result;for(let r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;let r=e.map(e=>new n.ZodError(e.ctx.common.issues));return(0,l.addIssueToContext)(t,{code:n.ZodIssueCode.invalid_union,unionErrors:r}),l.INVALID});{let e,s=[];for(let n of r){let r={...t,common:{...t.common,issues:[]},parent:null},i=n._parseSync({data:t.data,path:t.path,parent:r});if("valid"===i.status)return i;"dirty"!==i.status||e||(e={result:i,ctx:r}),r.common.issues.length&&s.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=s.map(e=>new n.ZodError(e));return(0,l.addIssueToContext)(t,{code:n.ZodIssueCode.invalid_union,unionErrors:i}),l.INVALID}}get options(){return this._def.options}}K.create=(e,t)=>new K({options:e,typeName:s.ZodUnion,...h(t)});let q=e=>{if(e instanceof et)return q(e.schema);if(e instanceof ea)return q(e.innerType());if(e instanceof er)return[e.value];if(e instanceof en)return e.options;if(e instanceof ei)return c.util.objectValues(e.enum);else if(e instanceof eu)return q(e._def.innerType);else if(e instanceof D)return[void 0];else if(e instanceof U)return[null];else if(e instanceof el)return[void 0,...q(e.unwrap())];else if(e instanceof ec)return[null,...q(e.unwrap())];else if(e instanceof ef)return q(e.unwrap());else if(e instanceof eg)return q(e.unwrap());else if(e instanceof ed)return q(e._def.innerType);else return[]};class H extends p{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==c.ZodParsedType.object)return(0,l.addIssueToContext)(t,{code:n.ZodIssueCode.invalid_type,expected:c.ZodParsedType.object,received:t.parsedType}),l.INVALID;let r=this.discriminator,s=t.data[r],i=this.optionsMap.get(s);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):((0,l.addIssueToContext)(t,{code:n.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),l.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let n=new Map;for(let r of t){let t=q(r.shape[e]);if(!t.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of t){if(n.has(s))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);n.set(s,r)}}return new H({typeName:s.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...h(r)})}}class G extends p{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),s=(e,s)=>{if((0,l.isAborted)(e)||(0,l.isAborted)(s))return l.INVALID;let i=function e(t,r){let s=(0,c.getParsedType)(t),n=(0,c.getParsedType)(r);if(t===r)return{valid:!0,data:t};if(s===c.ZodParsedType.object&&n===c.ZodParsedType.object){let s=c.util.objectKeys(r),n=c.util.objectKeys(t).filter(e=>-1!==s.indexOf(e)),i={...t,...r};for(let s of(Object.prototype.hasOwnProperty.call(i,"__proto__")&&delete i.__proto__,n)){if("__proto__"===s)continue;let n=e(t[s],r[s]);if(!n.valid)return{valid:!1};i[s]=n.data}return{valid:!0,data:i}}if(s===c.ZodParsedType.array&&n===c.ZodParsedType.array){if(t.length!==r.length)return{valid:!1};let s=[];for(let n=0;n<t.length;n++){let i=e(t[n],r[n]);if(!i.valid)return{valid:!1};s.push(i.data)}return{valid:!0,data:s}}if(s===c.ZodParsedType.date&&n===c.ZodParsedType.date&&+t==+r)return{valid:!0,data:t};return{valid:!1}}(e.value,s.value);return i.valid?(((0,l.isDirty)(e)||(0,l.isDirty)(s))&&t.dirty(),{status:t.value,value:i.data}):((0,l.addIssueToContext)(r,{code:n.ZodIssueCode.invalid_intersection_types}),l.INVALID)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>s(e,t)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}G.create=(e,t,r)=>new G({left:e,right:t,typeName:s.ZodIntersection,...h(r)});class X extends p{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==c.ZodParsedType.array)return(0,l.addIssueToContext)(r,{code:n.ZodIssueCode.invalid_type,expected:c.ZodParsedType.array,received:r.parsedType}),l.INVALID;if(r.data.length<this._def.items.length)return(0,l.addIssueToContext)(r,{code:n.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),l.INVALID;!this._def.rest&&r.data.length>this._def.items.length&&((0,l.addIssueToContext)(r,{code:n.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let s=[...r.data].map((e,t)=>{let s=this._def.items[t]||this._def.rest;return s?s._parse(new u(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(s).then(e=>l.ParseStatus.mergeArray(t,e)):l.ParseStatus.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new X({...this._def,rest:e})}}X.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new X({items:e,typeName:s.ZodTuple,rest:null,...h(t)})};class J extends p{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==c.ZodParsedType.object)return(0,l.addIssueToContext)(r,{code:n.ZodIssueCode.invalid_type,expected:c.ZodParsedType.object,received:r.parsedType}),l.INVALID;let s=[],i=this._def.keyType,o=this._def.valueType;for(let e in r.data)s.push({key:i._parse(new u(r,e,r.path,e)),value:o._parse(new u(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?l.ParseStatus.mergeObjectAsync(t,s):l.ParseStatus.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,r){return new J(t instanceof p?{keyType:e,valueType:t,typeName:s.ZodRecord,...h(r)}:{keyType:P.create(),valueType:e,typeName:s.ZodRecord,...h(t)})}}class Y extends p{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==c.ZodParsedType.map)return(0,l.addIssueToContext)(r,{code:n.ZodIssueCode.invalid_type,expected:c.ZodParsedType.map,received:r.parsedType}),l.INVALID;let s=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([e,t],n)=>({key:s._parse(new u(r,e,r.path,[n,"key"])),value:i._parse(new u(r,t,r.path,[n,"value"]))}));if(r.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let r of o){let s=await r.key,n=await r.value;if("aborted"===s.status||"aborted"===n.status)return l.INVALID;("dirty"===s.status||"dirty"===n.status)&&t.dirty(),e.set(s.value,n.value)}return{status:t.value,value:e}})}{let e=new Map;for(let r of o){let s=r.key,n=r.value;if("aborted"===s.status||"aborted"===n.status)return l.INVALID;("dirty"===s.status||"dirty"===n.status)&&t.dirty(),e.set(s.value,n.value)}return{status:t.value,value:e}}}}Y.create=(e,t,r)=>new Y({valueType:t,keyType:e,typeName:s.ZodMap,...h(r)});class Q extends p{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==c.ZodParsedType.set)return(0,l.addIssueToContext)(r,{code:n.ZodIssueCode.invalid_type,expected:c.ZodParsedType.set,received:r.parsedType}),l.INVALID;let s=this._def;null!==s.minSize&&r.data.size<s.minSize.value&&((0,l.addIssueToContext)(r,{code:n.ZodIssueCode.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),null!==s.maxSize&&r.data.size>s.maxSize.value&&((0,l.addIssueToContext)(r,{code:n.ZodIssueCode.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());let i=this._def.valueType;function o(e){let r=new Set;for(let s of e){if("aborted"===s.status)return l.INVALID;"dirty"===s.status&&t.dirty(),r.add(s.value)}return{status:t.value,value:r}}let a=[...r.data.values()].map((e,t)=>i._parse(new u(r,e,r.path,t)));return r.common.async?Promise.all(a).then(e=>o(e)):o(a)}min(e,t){return new Q({...this._def,minSize:{value:e,message:a.errorUtil.toString(t)}})}max(e,t){return new Q({...this._def,maxSize:{value:e,message:a.errorUtil.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Q.create=(e,t)=>new Q({valueType:e,minSize:null,maxSize:null,typeName:s.ZodSet,...h(t)});class ee extends p{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==c.ZodParsedType.function)return(0,l.addIssueToContext)(t,{code:n.ZodIssueCode.invalid_type,expected:c.ZodParsedType.function,received:t.parsedType}),l.INVALID;function r(e,r){return(0,l.makeIssue)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,o.getErrorMap)(),i.defaultErrorMap].filter(e=>!!e),issueData:{code:n.ZodIssueCode.invalid_arguments,argumentsError:r}})}function s(e,r){return(0,l.makeIssue)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,o.getErrorMap)(),i.defaultErrorMap].filter(e=>!!e),issueData:{code:n.ZodIssueCode.invalid_return_type,returnTypeError:r}})}let a={errorMap:t.common.contextualErrorMap},u=t.data;if(this._def.returns instanceof eo){let e=this;return(0,l.OK)(async function(...t){let i=new n.ZodError([]),o=await e._def.args.parseAsync(t,a).catch(e=>{throw i.addIssue(r(t,e)),i}),l=await Reflect.apply(u,this,o);return await e._def.returns._def.type.parseAsync(l,a).catch(e=>{throw i.addIssue(s(l,e)),i})})}{let e=this;return(0,l.OK)(function(...t){let i=e._def.args.safeParse(t,a);if(!i.success)throw new n.ZodError([r(t,i.error)]);let o=Reflect.apply(u,this,i.data),l=e._def.returns.safeParse(o,a);if(!l.success)throw new n.ZodError([s(o,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ee({...this._def,args:X.create(e).rest(M.create())})}returns(e){return new ee({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new ee({args:e||X.create([]).rest(M.create()),returns:t||M.create(),typeName:s.ZodFunction,...h(r)})}}class et extends p{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}et.create=(e,t)=>new et({getter:e,typeName:s.ZodLazy,...h(t)});class er extends p{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(t,{received:t.data,code:n.ZodIssueCode.invalid_literal,expected:this._def.value}),l.INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}}function es(e,t){return new en({values:e,typeName:s.ZodEnum,...h(t)})}er.create=(e,t)=>new er({value:e,typeName:s.ZodLiteral,...h(t)});class en extends p{_parse(e){if("string"!=typeof e.data){let t=this._getOrReturnCtx(e),r=this._def.values;return(0,l.addIssueToContext)(t,{expected:c.util.joinValues(r),received:t.parsedType,code:n.ZodIssueCode.invalid_type}),l.INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return(0,l.addIssueToContext)(t,{received:t.data,code:n.ZodIssueCode.invalid_enum_value,options:r}),l.INVALID}return(0,l.OK)(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return en.create(e,{...this._def,...t})}exclude(e,t=this._def){return en.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}en.create=es;class ei extends p{_parse(e){let t=c.util.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==c.ZodParsedType.string&&r.parsedType!==c.ZodParsedType.number){let e=c.util.objectValues(t);return(0,l.addIssueToContext)(r,{expected:c.util.joinValues(e),received:r.parsedType,code:n.ZodIssueCode.invalid_type}),l.INVALID}if(this._cache||(this._cache=new Set(c.util.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let e=c.util.objectValues(t);return(0,l.addIssueToContext)(r,{received:r.data,code:n.ZodIssueCode.invalid_enum_value,options:e}),l.INVALID}return(0,l.OK)(e.data)}get enum(){return this._def.values}}ei.create=(e,t)=>new ei({values:e,typeName:s.ZodNativeEnum,...h(t)});class eo extends p{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==c.ZodParsedType.promise&&!1===t.common.async)return(0,l.addIssueToContext)(t,{code:n.ZodIssueCode.invalid_type,expected:c.ZodParsedType.promise,received:t.parsedType}),l.INVALID;let r=t.parsedType===c.ZodParsedType.promise?t.data:Promise.resolve(t.data);return(0,l.OK)(r.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}eo.create=(e,t)=>new eo({type:e,typeName:s.ZodPromise,...h(t)});class ea extends p{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===s.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),s=this._def.effect||null,n={addIssue:e=>{(0,l.addIssueToContext)(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(n.addIssue=n.addIssue.bind(n),"preprocess"===s.type){let e=s.transform(r.data,n);if(r.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return l.INVALID;let s=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===s.status?l.INVALID:"dirty"===s.status||"dirty"===t.value?(0,l.DIRTY)(s.value):s});{if("aborted"===t.value)return l.INVALID;let s=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===s.status?l.INVALID:"dirty"===s.status||"dirty"===t.value?(0,l.DIRTY)(s.value):s}}if("refinement"===s.type){let e=e=>{let t=s.refinement(e,n);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(r=>"aborted"===r.status?l.INVALID:("dirty"===r.status&&t.dirty(),e(r.value).then(()=>({status:t.value,value:r.value}))));{let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===s.status?l.INVALID:("dirty"===s.status&&t.dirty(),e(s.value),{status:t.value,value:s.value})}}if("transform"===s.type)if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>(0,l.isValid)(e)?Promise.resolve(s.transform(e.value,n)).then(e=>({status:t.value,value:e})):l.INVALID);else{let e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!(0,l.isValid)(e))return l.INVALID;let i=s.transform(e.value,n);if(i instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}c.util.assertNever(s)}}ea.create=(e,t,r)=>new ea({schema:e,typeName:s.ZodEffects,effect:t,...h(r)}),ea.createWithPreprocess=(e,t,r)=>new ea({schema:t,effect:{type:"preprocess",transform:e},typeName:s.ZodEffects,...h(r)});class el extends p{_parse(e){return this._getType(e)===c.ZodParsedType.undefined?(0,l.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}el.create=(e,t)=>new el({innerType:e,typeName:s.ZodOptional,...h(t)});class ec extends p{_parse(e){return this._getType(e)===c.ZodParsedType.null?(0,l.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ec.create=(e,t)=>new ec({innerType:e,typeName:s.ZodNullable,...h(t)});class eu extends p{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return t.parsedType===c.ZodParsedType.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}eu.create=(e,t)=>new eu({innerType:e,typeName:s.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...h(t)});class ed extends p{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return(0,l.isAsync)(s)?s.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new n.ZodError(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===s.status?s.value:this._def.catchValue({get error(){return new n.ZodError(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ed.create=(e,t)=>new ed({innerType:e,typeName:s.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...h(t)});class eh extends p{_parse(e){if(this._getType(e)!==c.ZodParsedType.nan){let t=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(t,{code:n.ZodIssueCode.invalid_type,expected:c.ZodParsedType.nan,received:t.parsedType}),l.INVALID}return{status:"valid",value:e.data}}}eh.create=e=>new eh({typeName:s.ZodNaN,...h(e)});let ep=Symbol("zod_brand");class ef extends p{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class em extends p{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?l.INVALID:"dirty"===e.status?(t.dirty(),(0,l.DIRTY)(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{let e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?l.INVALID:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new em({in:e,out:t,typeName:s.ZodPipeline})}}class eg extends p{_parse(e){let t=this._def.innerType._parse(e),r=e=>((0,l.isValid)(e)&&(e.value=Object.freeze(e.value)),e);return(0,l.isAsync)(t)?t.then(e=>r(e)):r(t)}unwrap(){return this._def.innerType}}function ey(e,t){let r="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof r?{message:r}:r}function eb(e,t={},r){return e?F.create().superRefine((s,n)=>{let i=e(s);if(i instanceof Promise)return i.then(e=>{if(!e){let e=ey(t,s),i=e.fatal??r??!0;n.addIssue({code:"custom",...e,fatal:i})}});if(!i){let e=ey(t,s),i=e.fatal??r??!0;n.addIssue({code:"custom",...e,fatal:i})}}):F.create()}eg.create=(e,t)=>new eg({innerType:e,typeName:s.ZodReadonly,...h(t)});let e_={object:W.lazycreate};(r=s||(s={})).ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly";let ew=P.create,ev=R.create,eI=eh.create,ek=$.create,ex=N.create,eT=j.create,eE=L.create,ez=D.create,eA=U.create,eS=F.create,eC=M.create,eO=Z.create,eP=B.create,eR=V.create,e$=W.create,eN=W.strictCreate,ej=K.create,eL=H.create,eD=G.create,eU=X.create,eF=J.create,eM=Y.create,eZ=Q.create,eB=ee.create,eV=et.create,eW=er.create,eK=en.create,eq=ei.create,eH=eo.create,eG=ea.create,eX=el.create,eJ=ec.create,eY=ea.createWithPreprocess,eQ=em.create,e0=l.INVALID;e.s(["BRAND",0,ep,"NEVER",0,e0,"Schema",0,p,"ZodAny",0,F,"ZodArray",0,V,"ZodBigInt",0,$,"ZodBoolean",0,N,"ZodBranded",0,ef,"ZodCatch",0,ed,"ZodDate",0,j,"ZodDefault",0,eu,"ZodDiscriminatedUnion",0,H,"ZodEffects",0,ea,"ZodEnum",0,en,"ZodFirstPartyTypeKind",0,s,"ZodFunction",0,ee,"ZodIntersection",0,G,"ZodLazy",0,et,"ZodLiteral",0,er,"ZodMap",0,Y,"ZodNaN",0,eh,"ZodNativeEnum",0,ei,"ZodNever",0,Z,"ZodNull",0,U,"ZodNullable",0,ec,"ZodNumber",0,R,"ZodObject",0,W,"ZodOptional",0,el,"ZodPipeline",0,em,"ZodPromise",0,eo,"ZodReadonly",0,eg,"ZodRecord",0,J,"ZodSchema",0,p,"ZodSet",0,Q,"ZodString",0,P,"ZodSymbol",0,L,"ZodTransformer",0,ea,"ZodTuple",0,X,"ZodType",0,p,"ZodUndefined",0,D,"ZodUnion",0,K,"ZodUnknown",0,M,"ZodVoid",0,B,"any",0,eS,"array",0,eR,"bigint",0,ek,"boolean",0,ex,"coerce",0,{string:e=>P.create({...e,coerce:!0}),number:e=>R.create({...e,coerce:!0}),boolean:e=>N.create({...e,coerce:!0}),bigint:e=>$.create({...e,coerce:!0}),date:e=>j.create({...e,coerce:!0})},"custom",0,eb,"date",0,eT,"datetimeRegex",0,O,"discriminatedUnion",0,eL,"effect",0,eG,"enum",0,eK,"function",0,eB,"instanceof",0,(e,t={message:`Input not instance of ${e.name}`})=>eb(t=>t instanceof e,t),"intersection",0,eD,"late",0,e_,"lazy",0,eV,"literal",0,eW,"map",0,eM,"nan",0,eI,"nativeEnum",0,eq,"never",0,eO,"null",0,eA,"nullable",0,eJ,"number",0,ev,"object",0,e$,"oboolean",0,()=>ex().optional(),"onumber",0,()=>ev().optional(),"optional",0,eX,"ostring",0,()=>ew().optional(),"pipeline",0,eQ,"preprocess",0,eY,"promise",0,eH,"record",0,eF,"set",0,eZ,"strictObject",0,eN,"string",0,ew,"symbol",0,eE,"transformer",0,eG,"tuple",0,eU,"undefined",0,ez,"union",0,ej,"unknown",0,eC,"void",0,eP])},92741,762209,e=>{"use strict";e.s(["buildEmployeeMcpServer",()=>j,"composioUserIdFor",()=>k,"disconnectAllToolkits",()=>N,"disconnectToolkit",()=>$,"getComposio",()=>S,"getEmployeeToolkits",()=>I,"initiateConnection",()=>P,"isComposioConfigured",()=>C,"readState",()=>E,"refreshConnections",()=>R],92741),e.s(["disableSlackTrigger",()=>_,"ensureSlackTrigger",()=>b,"slackTriggerFor",()=>m],762209);var t=e.i(814747),r=e.i(924868),s=e.i(13336),n=e.i(129487),i=e.i(825289),o=e.i(625100),a=e.i(207867),l=e.i(318091),c=e.i(239870),u=e.i(522734);let d=()=>(0,o.dataDir)("org","slack-triggers.json"),h="SLACK_NEW_MESSAGE",p=()=>{try{return JSON.parse(u.default.readFileSync(d(),"utf8"))}catch{return{}}},f=e=>{let r=d();u.default.mkdirSync(t.default.dirname(r),{recursive:!0}),u.default.writeFileSync(r,JSON.stringify(e,null,2)+"\n")},m=e=>p()[e],g=e=>{let t=Array.isArray(e)?e:e&&"object"==typeof e?e.items:[];return Array.isArray(t)?t.filter(e=>!!e&&"object"==typeof e):[]},y=(e,...t)=>t.map(t=>e[t]).find(e=>"string"==typeof e&&!!e);async function b(e){if(!(0,c.publicWebhookUrl)(process.env,"/api/slack/composio"))return{armed:!1,reason:"no public HTTPS APP_URL/EMPLOYEE001_PUBLIC_URL"};if(!process.env.COMPOSIO_WEBHOOK_SECRET)return{armed:!1,reason:"COMPOSIO_WEBHOOK_SECRET is not set"};try{let t,r=(await E(e)).connections.slack;if(r?.status!=="ACTIVE")return{armed:!1,reason:"Slack is not active"};let s=S(),n=g(await s.triggers.listActive({connectedAccountIds:r.connectedAccountId?[r.connectedAccountId]:void 0,showDisabled:!0,limit:200})).find(e=>y(e,"connectedAccountId","connected_account_id")===r.connectedAccountId),i=y(n??{},"id","triggerId");if(i){let t=p();return t[e]={triggerId:i,triggerSlug:y(n,"triggerName","triggerSlug")??h,connectedAccountId:r.connectedAccountId,updatedAt:new Date().toISOString()},f(t),{armed:!0}}let o=(t=g(await s.triggers.listTypes({toolkits:["slack"],limit:200})).map(e=>({slug:y(e,"slug","name"),text:`${y(e,"slug","name")??""} ${y(e,"description")??""}`.toUpperCase()})).find(e=>e.slug&&/SLACK/.test(e.text)&&/(NEW|MESSAGE|MENTION|DM|DIRECT)/.test(e.text)&&!/(REACTION|DELETE|EDIT)/.test(e.text)),t?.slug??null??h),a=await s.triggers.create(k(e),o,{connectedAccountId:r.connectedAccountId}),l=y(a,"id","triggerId");if(!l)return{armed:!1,reason:"Composio did not return a trigger id"};let c=p();return c[e]={triggerId:l,triggerSlug:o,connectedAccountId:r.connectedAccountId,updatedAt:new Date().toISOString()},f(c),{armed:!0}}catch(e){return{armed:!1,reason:e instanceof Error?e.message:String(e)}}}async function _(e){let t=m(e),r=p();if(delete r[e],f(r),t)try{await S().triggers.disable(t.triggerId)}catch{}}let w={},v=["slack","gmail"];function I(e){return w[e]??v}function k(e){return`employee:${e}`}let x=e=>(0,o.dataDir)("employees",e),T=e=>t.default.join(x(e),".composio.json");async function E(e){try{let t=await r.default.readFile(T(e),"utf-8");return JSON.parse(t)}catch{return{composioUserId:k(e),connections:{}}}}async function z(e,t){await r.default.mkdir(x(e),{recursive:!0}),await r.default.writeFile(T(e),JSON.stringify(t,null,2))}let A=null;function S(){if(A)return A;if(!process.env.COMPOSIO_API_KEY)throw Error("COMPOSIO_API_KEY is not set");return A=new s.Composio({apiKey:process.env.COMPOSIO_API_KEY,provider:new n.ClaudeAgentSDKProvider})}function C(){return!!process.env.COMPOSIO_API_KEY}async function O(e){let t=S(),r=(await t.authConfigs.list({toolkit:e})).items??[];return r.length>0?r[0].id:(await t.authConfigs.create(e,{type:"use_composio_managed_auth"})).id}async function P(e,t,r){let s=S(),n=k(e),i=await O(t),o=await s.connectedAccounts.link(n,i,{callbackUrl:r}),a=o.redirectUrl??"",l=o.connectedAccountId??o.id??"",c=await E(e);return c.connections[t]={toolkit:t,status:"INITIALIZING",authConfigId:i,connectedAccountId:l,redirectUrl:a,initiatedAt:new Date().toISOString()},await z(e,c),{redirectUrl:a,connectedAccountId:l,authConfigId:i}}async function R(e){if(!C())return E(e);let t=S(),r=k(e),s=(await t.connectedAccounts.list({userIds:[r]})).items??[],n=await E(e),i=e=>{let t=e.toUpperCase();return"ACTIVE"===t?3:"INITIATED"===t||"INITIALIZING"===t?2:1};for(let e of s){let t="string"==typeof e.toolkit?e.toolkit:e.toolkit?.slug??"";if(!t)continue;let r=e.status?.toUpperCase?.()??"INITIALIZING",s=n.connections[t];s&&i(r)<i(s.status)||(n.connections[t]={toolkit:t,status:r,authConfigId:e.authConfig?.id??s?.authConfigId,connectedAccountId:e.id,redirectUrl:s?.redirectUrl,initiatedAt:s?.initiatedAt??new Date().toISOString(),activatedAt:"ACTIVE"!==r||s?.activatedAt?s?.activatedAt:new Date().toISOString(),..."slack"===t?{slackUserId:"string"==typeof e.metadata?.user_id?e.metadata.user_id:s?.slackUserId,slackWorkspaceId:"string"==typeof e.metadata?.team_id?e.metadata.team_id:s?.slackWorkspaceId}:{}})}return await z(e,n),n.connections.gmail?.status==="ACTIVE"&&(0,c.ensureEmailTrigger)(e),n.connections.slack?.status==="ACTIVE"&&b(e),n}async function $(e,t){if(!C())return;let r=S(),s=await E(e),n=s.connections[t];if(n?.connectedAccountId){try{await r.connectedAccounts.delete(n.connectedAccountId)}catch{}delete s.connections[t],await z(e,s),"gmail"===t&&await (0,c.disableEmailTrigger)(e),"slack"===t&&await _(e)}}async function N(e){let t;if(!C())return 0;let r=S(),s=[];for(let n=0;n<50;n++){let n=await r.connectedAccounts.list({userIds:[k(e)],...t?{cursor:t}:{}});if(s.push(...(n.items??[]).map(e=>e.id)),!(t=n.nextCursor))break}for(let e of s)await r.connectedAccounts.delete(e);let n=await E(e);return Object.keys(n.connections).length&&(n.connections={},await z(e,n)),s.length}async function j(e){if(!C())return null;let t=S(),r=k(e),s=await R(e),n=(0,l.loadConsentStatus)(e),o=Object.values(s.connections).filter(e=>"ACTIVE"===e.status).map(e=>e.toolkit).filter(e=>(0,a.toolkitAllowed)(n,e));if(0===o.length)return null;let c=await Promise.all(o.map(e=>t.tools.get(r,{toolkits:[e],important:!0,limit:50}))),u=new Set,d=[];for(let e of c)for(let t of Array.isArray(e)?e:[e]){let e=t.name??t.slug??JSON.stringify(t);u.has(e)||(u.add(e),d.push(t))}return(0,i.createSdkMcpServer)({name:"composio",version:"1.0.0",tools:d})}},207867,318091,e=>{"use strict";let t=new Set(["zoom","meet","googlemeet","google_meet","microsoft_teams","teams","fireflies","otter","gong","fathom","tldv","read_ai","grain","avoma"]);function r(e,t){if(t)return{kind:"exempt"};let r=e.consent?.scopes;return Array.isArray(r)?{kind:"recorded",scopes:new Set(r)}:{kind:"legacy"}}let s=(e,t)=>"recorded"!==e.kind||e.scopes.has(t);e.s(["actionsAllowed",0,function(e){return s(e,"third-party-actions")},"applyConsent",0,function(e,t,r){return"ask"!==e.kind||s(r,"third-party-actions")||!/^mcp__composio__/i.test(t)?e:{kind:"block",reason:"This employee's consent doesn't let the twin act on their behalf (send, post or change anything)."}},"buildBlockReason",0,function(e,t){return"exempt"===e.kind?null:"legacy"===e.kind?`${t} hasn't recorded consent, so the twin can't be trained on their data. Request consent from their profile first.`:e.scopes.has("data-collection")&&e.scopes.has("integrations")?null:`${t}'s consent doesn't cover training on their work data.`},"consentStatusFor",0,r,"toolkitAllowed",0,function(e,r){return!(!s(e,"integrations")||t.has(r.toLowerCase())&&!s(e,"transcripts"))}],207867);var n=e.i(522734),i=e.i(625100),o=e.i(951474);e.s(["loadConsentStatus",0,function(e){let t;try{t=JSON.parse(n.default.readFileSync((0,i.dataDir)("employees",e,"employee.json"),"utf8")).consent}catch{}return r({consent:t},(0,o.getHiredAgentIds)().includes(e))}],318091)},239870,e=>{"use strict";e.s(["disableEmailTrigger",()=>y,"emailPollIntervalMs",()=>p,"emailTriggerFor",()=>u,"ensureEmailTrigger",()=>g,"publicWebhookUrl",()=>h,"verifyComposioWebhook",()=>b]);var t=e.i(522734),r=e.i(625100),s=e.i(814747),n=e.i(92741);let i=()=>(0,r.dataDir)("org","email-triggers.json"),o="GMAIL_NEW_GMAIL_MESSAGE",a=new Map;function l(){try{let e=JSON.parse(t.default.readFileSync(i(),"utf8"));return e&&"object"==typeof e&&!Array.isArray(e)?e:{}}catch{return{}}}function c(e){let r=i();t.default.mkdirSync(s.default.dirname(r),{recursive:!0});let n=`${r}.tmp`;t.default.writeFileSync(n,`${JSON.stringify(e,null,2)}
|
|
32
|
-
`,"utf8"),t.default.renameSync(n,r)}function u(e){return l()[e]}function d(e,t){let r=l();r[e]=t,c(r)}function h(e=process.env,t="/api/email/composio"){let r=(e.EMPLOYEE001_PUBLIC_URL??e.APP_URL??"").trim().replace(/\/$/,"");if(!r)return null;try{let e=new URL(r);return"https:"!==e.protocol||["localhost","127.0.0.1","::1"].includes(e.hostname)?null:`${e.toString().replace(/\/$/,"")}${t}`}catch{return null}}function p(e){return e?18e5:3e5}function f(e){let t=Array.isArray(e)?e:e&&"object"==typeof e?e.items:void 0;return Array.isArray(t)?t.filter(e=>!!e&&"object"==typeof e&&!Array.isArray(e)):[]}function m(e,...t){for(let r of t)if("string"==typeof e[r]&&e[r])return e[r]}async function g(e){if(!h())return{armed:!1,reason:"no public HTTPS APP_URL/EMPLOYEE001_PUBLIC_URL"};if(!process.env.COMPOSIO_WEBHOOK_SECRET)return{armed:!1,reason:"COMPOSIO_WEBHOOK_SECRET is not set"};let t=Date.now();if(t-(a.get(e)??0)<3e5)return{armed:!1,reason:"trigger setup retry is deferred"};a.set(e,t);try{let t=(await (0,n.readState)(e)).connections.gmail;if(t?.status!=="ACTIVE")return{armed:!1,reason:"Gmail is not active"};let r=(0,n.getComposio)(),s=f(await r.triggers.listActive({connectedAccountIds:t.connectedAccountId?[t.connectedAccountId]:void 0,showDisabled:!0,limit:200})).find(e=>m(e,"connectedAccountId","connected_account_id")===t.connectedAccountId&&m(e,"id","triggerId"));if(s)return d(e,{triggerId:m(s,"id","triggerId"),triggerSlug:m(s,"triggerName","triggerSlug","trigger_name")??o,connectedAccountId:t.connectedAccountId,updatedAt:new Date().toISOString()}),{armed:!0};let i=null;try{i=function(e){let t=null;for(let r of e){let e=m(r,"slug","name");if(!e)continue;let s=`${e} ${m(r,"description")??""}`.toUpperCase(),n=3*!!/NEW/.test(s)+3*!!/MESSAGE|MAIL|EMAIL/.test(s)+ +!!/RECEIV|ARRIV|INBOX/.test(s);/DRAFT|LABEL|ATTACHMENT|THREAD|SENT|DELETE|TRASH/.test(s)&&(n-=5),n>=6&&(!t||n>t.score)&&(t={slug:e,score:n})}return t?.slug??null}(f(await r.triggers.listTypes({toolkits:["gmail"],limit:200})))}catch{}i??=o;let a=await r.triggers.create((0,n.composioUserIdFor)(e),i,{connectedAccountId:t.connectedAccountId}),l=m(a&&"object"==typeof a?a:{},"id","triggerId");if(!l)return{armed:!1,reason:"Composio did not return a trigger id"};return d(e,{triggerId:l,triggerSlug:i,connectedAccountId:t.connectedAccountId,updatedAt:new Date().toISOString()}),console.log(`[email-intake] ${e}: Composio push trigger armed`),{armed:!0}}catch(r){let t=r instanceof Error?r.message:String(r);return console.warn(`[email-intake] ${e}: push unavailable; using 5-minute polling (${t.slice(0,160)})`),{armed:!1,reason:t}}}async function y(e){let t,r=u(e);if(t=l(),delete t[e],c(t),r)try{await (0,n.getComposio)().triggers.disable(r.triggerId)}catch{}}async function b(e,t){if(!e.secret||!e.signature||!e.id||!e.timestamp)return null;try{let r=t??(e=>(0,n.getComposio)().triggers.verifyWebhook(e));return await r({payload:e.payload,signature:e.signature,id:e.id,timestamp:e.timestamp,secret:e.secret})}catch{return null}}}];
|
|
33
|
-
|
|
34
|
-
//# sourceMappingURL=_1td1smt._.js.map
|