eve 0.13.1 → 0.13.3
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/CHANGELOG.md +13 -0
- package/dist/src/chunks/use-eve-agent-B18LYpfZ.js +5765 -0
- package/dist/src/chunks/use-eve-agent-BPI1nbo5.js +5795 -0
- package/dist/src/cli/dev/tui/provider-picker.d.ts +64 -0
- package/dist/src/cli/dev/tui/provider-picker.js +1 -0
- package/dist/src/cli/dev/tui/remote-auth-result.d.ts +21 -0
- package/dist/src/cli/dev/tui/remote-auth-result.js +1 -0
- package/dist/src/cli/dev/tui/remote-connection-probe.d.ts +9 -0
- package/dist/src/cli/dev/tui/remote-connection-probe.js +1 -0
- package/dist/src/cli/dev/tui/remote-connection-types.d.ts +67 -0
- package/dist/src/cli/dev/tui/remote-connection-types.js +1 -0
- package/dist/src/cli/dev/tui/remote-connection.d.ts +3 -0
- package/dist/src/cli/dev/tui/remote-connection.js +1 -0
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/dev/tui/setup-commands.d.ts +1 -1
- package/dist/src/cli/dev/tui/setup-commands.js +2 -2
- package/dist/src/cli/dev/tui/setup-flow.d.ts +3 -0
- package/dist/src/cli/dev/tui/setup-issues.d.ts +7 -0
- package/dist/src/cli/dev/tui/setup-issues.js +1 -1
- package/dist/src/cli/dev/tui/setup-panel.d.ts +25 -12
- package/dist/src/cli/dev/tui/setup-panel.js +3 -2
- package/dist/src/cli/dev/tui/target.d.ts +2 -0
- package/dist/src/cli/dev/tui/target.js +1 -1
- package/dist/src/cli/dev/tui/terminal-renderer.js +9 -9
- package/dist/src/cli/dev/tui/test/fake-setup-flow-renderer.js +1 -1
- package/dist/src/cli/dev/tui/tui.js +1 -1
- package/dist/src/cli/dev/tui/vercel-trusted-sources-policy.d.ts +22 -0
- package/dist/src/cli/dev/tui/vercel-trusted-sources-policy.js +1 -0
- package/dist/src/cli/dev/tui/vercel-trusted-sources.d.ts +48 -0
- package/dist/src/cli/dev/tui/vercel-trusted-sources.js +1 -0
- package/dist/src/client/agent-info-schema.d.ts +532 -0
- package/dist/src/client/agent-info-schema.js +1 -0
- package/dist/src/client/client.js +1 -1
- package/dist/src/client/types.d.ts +11 -169
- package/dist/src/client/types.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +4 -4
- package/dist/src/compiled/@chat-adapter/slack/_slack-web-api.d.ts +1 -0
- package/dist/src/compiled/@chat-adapter/slack/blocks.d.ts +160 -0
- package/dist/src/compiled/@chat-adapter/slack/blocks.js +8 -0
- package/dist/src/compiled/@chat-adapter/slack/index.d.ts +28 -3
- package/dist/src/compiled/@chat-adapter/slack/index.js +26 -26
- package/dist/src/compiled/_chunks/node/chunk-AYN7QRWH-Csu8sG38.js +1 -0
- package/dist/src/compiled/_chunks/node/{dist-BQYUcBqu.js → dist-W8yle6rh.js} +3 -3
- package/dist/src/compiled/chat/index.d.ts +4 -4
- package/dist/src/compiled/chat/index.js +1 -1
- package/dist/src/compiled/chat/{jsx-runtime-CFq1K_Ve.d.ts → jsx-runtime-CzthIo1o.d.ts} +6 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.1/node_modules/@vercel/sdk/esm/lib/primitives.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.1/node_modules/@vercel/sdk/esm/lib/schemas.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.1/node_modules/@vercel/sdk/esm/models/aclaction.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.1/node_modules/@vercel/sdk/esm/models/sdkvalidationerror.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.1/node_modules/@vercel/sdk/esm/models/updateprojectprojectsaction.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.1/node_modules/@vercel/sdk/esm/models/updateprojectprojectsoptionsallowlist.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.1/node_modules/@vercel/sdk/esm/types/defaultToZeroValue.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.1/node_modules/@vercel/sdk/esm/types/fp.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.1/node_modules/@vercel/sdk/esm/types/primitives.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.1/node_modules/@vercel/sdk/esm/types/rfcdate.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.1/node_modules/@vercel/sdk/esm/types/smartUnion.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.1/node_modules/@vercel/sdk/esm/types/unrecognized.js +1 -0
- package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/ZodError.js +1 -0
- package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/errors.js +1 -0
- package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/external.js +1 -0
- package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/helpers/errorUtil.js +1 -0
- package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/helpers/parseUtil.js +1 -0
- package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/helpers/util.js +1 -0
- package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/index.js +1 -0
- package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/locales/en.js +1 -0
- package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/types.js +1 -0
- package/dist/src/public/channels/slack/blocks.d.ts +3 -41
- package/dist/src/public/channels/slack/blocks.js +2 -3
- package/dist/src/public/channels/slack/defaults.js +3 -3
- package/dist/src/services/dev-client/client-options.js +1 -1
- package/dist/src/services/dev-client/credential-gate.d.ts +11 -6
- package/dist/src/services/dev-client/credential-gate.js +1 -1
- package/dist/src/services/dev-client/request-headers.d.ts +0 -12
- package/dist/src/services/dev-client/request-headers.js +1 -1
- package/dist/src/services/dev-client/vercel-auth-error.js +1 -1
- package/dist/src/setup/flows/model.d.ts +5 -5
- package/dist/src/setup/flows/model.js +1 -1
- package/dist/src/setup/flows/provider.d.ts +57 -0
- package/dist/src/setup/flows/provider.js +4 -0
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/guides/client/overview.mdx +24 -0
- package/docs/guides/dev-tui.md +4 -4
- package/docs/guides/instrumentation.md +1 -1
- package/package.json +5 -4
- package/dist/src/chunks/use-eve-agent-DEm_Jg4k.js +0 -1343
- package/dist/src/chunks/use-eve-agent-DsXOQMFZ.js +0 -1313
- package/dist/src/setup/flows/vercel.d.ts +0 -37
- package/dist/src/setup/flows/vercel.js +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{anyType,arrayType,booleanType,lazyType,literalType,nativeEnumType,nullableType,numberType,objectType,recordType,stringType,unionType}from"../../../../../../zod@4.4.3/node_modules/zod/v3/types.js";import"../../../../../../zod@4.4.3/node_modules/zod/v3/index.js";import{remap}from"../lib/primitives.js";import"../lib/schemas.js";import{boolean,literal,nullable,number,optional,string}from"../types/primitives.js";import{smartUnion}from"../types/smartUnion.js";const UpdateProjectFramework={Blitzjs:`blitzjs`,Nextjs:`nextjs`,Gatsby:`gatsby`,Remix:`remix`,ReactRouter:`react-router`,Astro:`astro`,Hexo:`hexo`,Eleventy:`eleventy`,Docusaurus2:`docusaurus-2`,Docusaurus:`docusaurus`,Preact:`preact`,Solidstart1:`solidstart-1`,Solidstart:`solidstart`,Dojo:`dojo`,Ember:`ember`,Vue:`vue`,Scully:`scully`,IonicAngular:`ionic-angular`,Angular:`angular`,Polymer:`polymer`,Svelte:`svelte`,Sveltekit:`sveltekit`,Sveltekit1:`sveltekit-1`,IonicReact:`ionic-react`,CreateReactApp:`create-react-app`,Gridsome:`gridsome`,Umijs:`umijs`,Sapper:`sapper`,Saber:`saber`,Stencil:`stencil`,Nuxtjs:`nuxtjs`,Redwoodjs:`redwoodjs`,Hugo:`hugo`,Jekyll:`jekyll`,Brunch:`brunch`,Middleman:`middleman`,Zola:`zola`,Hydrogen:`hydrogen`,Vite:`vite`,TanstackStart:`tanstack-start`,Vitepress:`vitepress`,Vuepress:`vuepress`,Parcel:`parcel`,Fastapi:`fastapi`,Flask:`flask`,Fasthtml:`fasthtml`,Django:`django`,Ash:`ash`,Eve:`eve`,Sanity:`sanity`,SanityV2:`sanity-v2`,Storybook:`storybook`,Nitro:`nitro`,Hono:`hono`,Express:`express`,H3:`h3`,Koa:`koa`,Nestjs:`nestjs`,Elysia:`elysia`,Fastify:`fastify`,Xmcp:`xmcp`,Python:`python`,Ruby:`ruby`,Rust:`rust`,Axum:`axum`,ActixWeb:`actix-web`,Bun:`bun`,Node:`node`,Go:`go`,Services:`services`,Mastra:`mastra`},UpdateProjectNodeVersion={TwentyFourDotX:`24.x`,TwentyTwoDotX:`22.x`,TwentyDotX:`20.x`,EighteenDotX:`18.x`,SixteenDotX:`16.x`,FourteenDotX:`14.x`,TwelveDotX:`12.x`,TenDotX:`10.x`},UpdateProjectBuildMachineType={Enhanced:`enhanced`,Turbo:`turbo`,Standard:`standard`,Elastic:`elastic`},UpdateProjectConfiguration={SkipNamespaceQueue:`SKIP_NAMESPACE_QUEUE`,WaitForNamespaceQueue:`WAIT_FOR_NAMESPACE_QUEUE`},UpdateProjectFunctionDefaultMemoryType={StandardLegacy:`standard_legacy`,Standard:`standard`,Performance:`performance`,PerformanceXl:`performance_xl`},UpdateProjectBuildMachineSelection={Elastic:`elastic`,Fixed:`fixed`},UpdateProjectEnv={Production:`production`,Preview:`preview`},UpdateProjectIssuerMode={Team:`team`,Global:`global`},UpdateProjectDeploymentType={All:`all`,Preview:`preview`,ProdDeploymentUrlsAndAllPreviews:`prod_deployment_urls_and_all_previews`,AllExceptCustomDomains:`all_except_custom_domains`},UpdateProjectProjectsDeploymentType={All:`all`,Preview:`preview`,ProdDeploymentUrlsAndAllPreviews:`prod_deployment_urls_and_all_previews`,AllExceptCustomDomains:`all_except_custom_domains`},UpdateProjectProjectsRequestDeploymentType={All:`all`,Preview:`preview`,ProdDeploymentUrlsAndAllPreviews:`prod_deployment_urls_and_all_previews`,AllExceptCustomDomains:`all_except_custom_domains`},UpdateProjectProjectsRequestRequestBodyDeploymentType={All:`all`,Preview:`preview`,Production:`production`,ProdDeploymentUrlsAndAllPreviews:`prod_deployment_urls_and_all_previews`,AllExceptCustomDomains:`all_except_custom_domains`},ProtectionMode={Exclusive:`exclusive`,Additional:`additional`},ToPreset={AllCustom:`all-custom`},Preset={AllCustom:`all-custom`},UpdateProjectFromPreset={AllCustom:`all-custom`},FromPreset={AllCustom:`all-custom`},UpdateProjectToProjectsPreset={AllCustom:`all-custom`},UpdateProjectToPreset={AllCustom:`all-custom`},UpdateProjectEnvironmentsProjectsTarget={Production:`production`,Preview:`preview`},UpdateProjectSourcesProjectsProvider={Github:`github`,Bitbucket:`bitbucket`},UpdateProjectEnvironmentsTarget={Production:`production`,Preview:`preview`},DeploymentSourcesSources={Git:`git`,Cli:`cli`,RestApi:`rest-api`,DeployHook:`deploy-hook`,Integration:`integration`,V0:`v0`},UpdateProjectAction={Cancel:`cancel`,Accept:`accept`,Delete:`delete`},UpdateProjectEnvId2={Preview:`preview`,Production:`production`},UpdateProjectSource={Api:`api`},UpdateProjectTarget2={Production:`production`,Preview:`preview`,Development:`development`},UpdateProjectType={Encrypted:`encrypted`,Plain:`plain`,Secret:`secret`,Sensitive:`sensitive`,System:`system`},UpdateProjectProjectsResponse200ApplicationJSONType={FlagsSecret:`flags-secret`},UpdateProjectProjectsType={Development:`development`,Preview:`preview`,Production:`production`},UpdateProjectProjectsResponse200Type={EndsWith:`endsWith`,Equals:`equals`,StartsWith:`startsWith`},UpdateProjectProjectsFramework={ActixWeb:`actix-web`,Angular:`angular`,Ash:`ash`,Astro:`astro`,Axum:`axum`,Blitzjs:`blitzjs`,Brunch:`brunch`,Bun:`bun`,CreateReactApp:`create-react-app`,Django:`django`,Docusaurus:`docusaurus`,Docusaurus2:`docusaurus-2`,Dojo:`dojo`,Eleventy:`eleventy`,Elysia:`elysia`,Ember:`ember`,Eve:`eve`,Express:`express`,Fastapi:`fastapi`,Fasthtml:`fasthtml`,Fastify:`fastify`,Flask:`flask`,Gatsby:`gatsby`,Go:`go`,Gridsome:`gridsome`,H3:`h3`,Hexo:`hexo`,Hono:`hono`,Hugo:`hugo`,Hydrogen:`hydrogen`,IonicAngular:`ionic-angular`,IonicReact:`ionic-react`,Jekyll:`jekyll`,Koa:`koa`,Mastra:`mastra`,Middleman:`middleman`,Nestjs:`nestjs`,Nextjs:`nextjs`,Nitro:`nitro`,Node:`node`,Nuxtjs:`nuxtjs`,Parcel:`parcel`,Polymer:`polymer`,Preact:`preact`,Python:`python`,ReactRouter:`react-router`,Redwoodjs:`redwoodjs`,Remix:`remix`,Ruby:`ruby`,Rust:`rust`,Saber:`saber`,Sanity:`sanity`,SanityV2:`sanity-v2`,Sapper:`sapper`,Scully:`scully`,Services:`services`,Solidstart:`solidstart`,Solidstart1:`solidstart-1`,Stencil:`stencil`,Storybook:`storybook`,Svelte:`svelte`,Sveltekit:`sveltekit`,Sveltekit1:`sveltekit-1`,TanstackStart:`tanstack-start`,Umijs:`umijs`,Vite:`vite`,Vitepress:`vitepress`,Vue:`vue`,Vuepress:`vuepress`,Xmcp:`xmcp`,Zola:`zola`},UpdateProjectServiceType={Cron:`cron`,Job:`job`,Web:`web`,Worker:`worker`},UpdateProjectProjectsResponseFramework={ActixWeb:`actix-web`,Angular:`angular`,Ash:`ash`,Astro:`astro`,Axum:`axum`,Blitzjs:`blitzjs`,Brunch:`brunch`,Bun:`bun`,CreateReactApp:`create-react-app`,Django:`django`,Docusaurus:`docusaurus`,Docusaurus2:`docusaurus-2`,Dojo:`dojo`,Eleventy:`eleventy`,Elysia:`elysia`,Ember:`ember`,Eve:`eve`,Express:`express`,Fastapi:`fastapi`,Fasthtml:`fasthtml`,Fastify:`fastify`,Flask:`flask`,Gatsby:`gatsby`,Go:`go`,Gridsome:`gridsome`,H3:`h3`,Hexo:`hexo`,Hono:`hono`,Hugo:`hugo`,Hydrogen:`hydrogen`,IonicAngular:`ionic-angular`,IonicReact:`ionic-react`,Jekyll:`jekyll`,Koa:`koa`,Mastra:`mastra`,Middleman:`middleman`,Nestjs:`nestjs`,Nextjs:`nextjs`,Nitro:`nitro`,Node:`node`,Nuxtjs:`nuxtjs`,Parcel:`parcel`,Polymer:`polymer`,Preact:`preact`,Python:`python`,ReactRouter:`react-router`,Redwoodjs:`redwoodjs`,Remix:`remix`,Ruby:`ruby`,Rust:`rust`,Saber:`saber`,Sanity:`sanity`,SanityV2:`sanity-v2`,Sapper:`sapper`,Scully:`scully`,Services:`services`,Solidstart:`solidstart`,Solidstart1:`solidstart-1`,Stencil:`stencil`,Storybook:`storybook`,Svelte:`svelte`,Sveltekit:`sveltekit`,Sveltekit1:`sveltekit-1`,TanstackStart:`tanstack-start`,Umijs:`umijs`,Vite:`vite`,Vitepress:`vitepress`,Vue:`vue`,Vuepress:`vuepress`,Xmcp:`xmcp`,Zola:`zola`},UpdateProjectProjectsNodeVersion={TenDotX:`10.x`,TwelveDotX:`12.x`,FourteenDotX:`14.x`,SixteenDotX:`16.x`,EighteenDotX:`18.x`,TwentyDotX:`20.x`,TwentyTwoDotX:`22.x`,TwentyFourDotX:`24.x`,EightDot10DotX:`8.10.x`},UpdateProjectFramework$outboundSchema=nativeEnumType(UpdateProjectFramework),UpdateProjectNodeVersion$outboundSchema=nativeEnumType(UpdateProjectNodeVersion),UpdateProjectBuildMachineType$outboundSchema=nativeEnumType(UpdateProjectBuildMachineType),UpdateProjectBuildQueue$outboundSchema=objectType({configuration:nativeEnumType(UpdateProjectConfiguration).optional()}),UpdateProjectFunctionDefaultMemoryType$outboundSchema=nativeEnumType(UpdateProjectFunctionDefaultMemoryType),UpdateProjectBuildMachineSelection$outboundSchema=nativeEnumType(UpdateProjectBuildMachineSelection),UpdateProjectResourceConfig$outboundSchema=objectType({buildMachineType:UpdateProjectBuildMachineType$outboundSchema.optional(),buildQueue:lazyType(()=>UpdateProjectBuildQueue$outboundSchema).optional(),fluid:booleanType().optional(),functionDefaultRegions:arrayType(stringType()).optional(),functionDefaultTimeout:numberType().optional(),functionDefaultMemoryType:UpdateProjectFunctionDefaultMemoryType$outboundSchema.optional(),functionZeroConfigFailover:booleanType().optional(),elasticConcurrencyEnabled:booleanType().optional(),buildMachineSelection:UpdateProjectBuildMachineSelection$outboundSchema.optional(),buildMachineElasticLastUpdated:numberType().optional(),isNSNBDisabled:booleanType().optional(),enableFunctionsBeta:booleanType().optional()}),UpdateProjectStaticIps$outboundSchema=objectType({enabled:booleanType()}),UpdateProjectEnv$outboundSchema=nativeEnumType(UpdateProjectEnv),SamplingRules$outboundSchema=objectType({rate:numberType(),env:UpdateProjectEnv$outboundSchema.optional(),requestPath:stringType().optional()}),Tracing$outboundSchema=objectType({domains:stringType().optional(),ignorePaths:arrayType(stringType()).optional(),samplingRules:arrayType(lazyType(()=>SamplingRules$outboundSchema)).optional()}),UpdateProjectIssuerMode$outboundSchema=nativeEnumType(UpdateProjectIssuerMode),UpdateProjectOidcTokenConfig$outboundSchema=objectType({enabled:booleanType().default(!0),issuerMode:UpdateProjectIssuerMode$outboundSchema.default(`team`)}),UpdateProjectPasswordProtection$outboundSchema=objectType({deploymentType:nativeEnumType(UpdateProjectDeploymentType),password:nullableType(stringType()).optional()}),UpdateProjectProjectsDeploymentType$outboundSchema=nativeEnumType(UpdateProjectProjectsDeploymentType),UpdateProjectPassport$outboundSchema=objectType({connectorId:stringType(),deploymentType:UpdateProjectProjectsDeploymentType$outboundSchema}),UpdateProjectSsoProtection$outboundSchema=objectType({deploymentType:nativeEnumType(UpdateProjectProjectsRequestDeploymentType).default(`preview`)}),UpdateProjectProjectsRequestRequestBodyDeploymentType$outboundSchema=nativeEnumType(UpdateProjectProjectsRequestRequestBodyDeploymentType),Addresses$outboundSchema=objectType({value:stringType(),note:stringType().optional()}),ProtectionMode$outboundSchema=nativeEnumType(ProtectionMode),UpdateProjectTrustedIps$outboundSchema=objectType({deploymentType:UpdateProjectProjectsRequestRequestBodyDeploymentType$outboundSchema,addresses:arrayType(lazyType(()=>Addresses$outboundSchema)),protectionMode:ProtectionMode$outboundSchema}),ToPreset$outboundSchema=nativeEnumType(ToPreset),To2$outboundSchema=objectType({slugs:arrayType(stringType()).optional(),preset:ToPreset$outboundSchema}),Preset$outboundSchema=nativeEnumType(Preset),To1$outboundSchema=objectType({slugs:arrayType(stringType()),preset:Preset$outboundSchema.optional()});smartUnion([lazyType(()=>To1$outboundSchema),lazyType(()=>To2$outboundSchema)]);const UpdateProjectFromPreset$outboundSchema=nativeEnumType(UpdateProjectFromPreset),From2$outboundSchema=objectType({slugs:arrayType(stringType()).optional(),preset:UpdateProjectFromPreset$outboundSchema}),FromPreset$outboundSchema=nativeEnumType(FromPreset),From1$outboundSchema=objectType({slugs:arrayType(stringType()),preset:FromPreset$outboundSchema.optional()});smartUnion([lazyType(()=>From1$outboundSchema),lazyType(()=>From2$outboundSchema)]);const CustomAllow$outboundSchema=objectType({to:smartUnion([lazyType(()=>To1$outboundSchema),lazyType(()=>To2$outboundSchema)]),from:smartUnion([lazyType(()=>From1$outboundSchema),lazyType(()=>From2$outboundSchema)])}),UpdateProjectProjects$outboundSchema=objectType({label:stringType().optional(),customAllow:arrayType(lazyType(()=>CustomAllow$outboundSchema)).optional()}),UpdateProjectToProjectsPreset$outboundSchema=nativeEnumType(UpdateProjectToProjectsPreset),UpdateProjectTo2$outboundSchema=objectType({slugs:arrayType(stringType()).optional(),preset:UpdateProjectToProjectsPreset$outboundSchema}),UpdateProjectToPreset$outboundSchema=nativeEnumType(UpdateProjectToPreset),UpdateProjectTo1$outboundSchema=objectType({slugs:arrayType(stringType()),preset:UpdateProjectToPreset$outboundSchema.optional()});smartUnion([lazyType(()=>UpdateProjectTo1$outboundSchema),lazyType(()=>UpdateProjectTo2$outboundSchema)]);const OidcProviders$outboundSchema=objectType({label:stringType().optional(),to:smartUnion([lazyType(()=>UpdateProjectTo1$outboundSchema),lazyType(()=>UpdateProjectTo2$outboundSchema)]),claims:recordType(arrayType(stringType()))}),TrustedSources$outboundSchema=objectType({projects:recordType(lazyType(()=>UpdateProjectProjects$outboundSchema)).optional(),oidcProviders:recordType(arrayType(lazyType(()=>OidcProviders$outboundSchema))).optional()});function trustedSourcesToJSON(e){return JSON.stringify(TrustedSources$outboundSchema.parse(e))}const UpdateProjectEnvironmentsProjects2$outboundSchema=objectType({type:literalType(`custom`),environmentId:stringType()}),UpdateProjectEnvironmentsProjectsTarget$outboundSchema=nativeEnumType(UpdateProjectEnvironmentsProjectsTarget),UpdateProjectEnvironmentsProjects1$outboundSchema=objectType({type:literalType(`system`),target:UpdateProjectEnvironmentsProjectsTarget$outboundSchema});unionType([lazyType(()=>UpdateProjectEnvironmentsProjects1$outboundSchema),lazyType(()=>UpdateProjectEnvironmentsProjects2$outboundSchema)]);const UpdateProjectSources2$outboundSchema=objectType({provider:literalType(`gitlab`),namespace:stringType(),project:stringType().optional()}),UpdateProjectSources1$outboundSchema=objectType({provider:nativeEnumType(UpdateProjectSourcesProjectsProvider),org:stringType(),repo:stringType().optional()});unionType([lazyType(()=>UpdateProjectSources1$outboundSchema).and(objectType({provider:literalType(`github`)})),lazyType(()=>UpdateProjectSources1$outboundSchema).and(objectType({provider:literalType(`bitbucket`)})),lazyType(()=>UpdateProjectSources2$outboundSchema)]);const GitSources1$outboundSchema=objectType({enabled:booleanType(),environments:arrayType(unionType([lazyType(()=>UpdateProjectEnvironmentsProjects1$outboundSchema),lazyType(()=>UpdateProjectEnvironmentsProjects2$outboundSchema)])),sources:arrayType(unionType([lazyType(()=>UpdateProjectSources1$outboundSchema).and(objectType({provider:literalType(`github`)})),lazyType(()=>UpdateProjectSources1$outboundSchema).and(objectType({provider:literalType(`bitbucket`)})),lazyType(()=>UpdateProjectSources2$outboundSchema)]))});smartUnion([arrayType(lazyType(()=>GitSources1$outboundSchema)),stringType()]);const UpdateProjectEnvironments2$outboundSchema=objectType({type:literalType(`custom`),environmentId:stringType()}),UpdateProjectEnvironmentsTarget$outboundSchema=nativeEnumType(UpdateProjectEnvironmentsTarget),UpdateProjectEnvironments1$outboundSchema=objectType({type:literalType(`system`),target:UpdateProjectEnvironmentsTarget$outboundSchema});unionType([lazyType(()=>UpdateProjectEnvironments1$outboundSchema),lazyType(()=>UpdateProjectEnvironments2$outboundSchema)]);const DeploymentSourcesSources$outboundSchema=nativeEnumType(DeploymentSourcesSources),DeploymentSources1$outboundSchema=objectType({enabled:booleanType(),environments:arrayType(unionType([lazyType(()=>UpdateProjectEnvironments1$outboundSchema),lazyType(()=>UpdateProjectEnvironments2$outboundSchema)])),sources:arrayType(DeploymentSourcesSources$outboundSchema)});smartUnion([arrayType(lazyType(()=>DeploymentSources1$outboundSchema)),stringType()]);const DeploymentPolicy1$outboundSchema=objectType({gitSources:smartUnion([arrayType(lazyType(()=>GitSources1$outboundSchema)),stringType()]).optional(),deploymentSources:smartUnion([arrayType(lazyType(()=>DeploymentSources1$outboundSchema)),stringType()]).optional()});smartUnion([lazyType(()=>DeploymentPolicy1$outboundSchema),stringType()]);const UpdateProjectPaths$outboundSchema=objectType({value:stringType()}),UpdateProjectOptionsAllowlist$outboundSchema=objectType({paths:arrayType(lazyType(()=>UpdateProjectPaths$outboundSchema))}),ConnectConfigurations1$outboundSchema=objectType({envId:stringType(),connectConfigurationId:stringType(),passive:booleanType(),buildsEnabled:booleanType()});lazyType(()=>ConnectConfigurations1$outboundSchema);const UpdateProjectAction$outboundSchema=nativeEnumType(UpdateProjectAction);smartUnion([numberType(),booleanType(),stringType()]),smartUnion([numberType(),booleanType(),stringType()]),objectType({previousValue:smartUnion([numberType(),booleanType(),stringType()]),currentValue:smartUnion([numberType(),booleanType(),stringType()])});const UpdateProjectDismissedToasts$outboundSchema=objectType({key:stringType(),dismissedAt:numberType(),action:UpdateProjectAction$outboundSchema,value:anyType().optional()}),UpdateProjectRequestBody$outboundSchema=objectType({autoExposeSystemEnvs:booleanType().optional(),autoAssignCustomDomains:booleanType().optional(),autoAssignCustomDomainsUpdatedBy:stringType().optional(),buildCommand:nullableType(stringType()).optional(),commandForIgnoringBuildStep:nullableType(stringType()).optional(),customerSupportCodeVisibility:booleanType().optional(),devCommand:nullableType(stringType()).optional(),directoryListing:booleanType().optional(),framework:nullableType(UpdateProjectFramework$outboundSchema).optional(),gitForkProtection:booleanType().optional(),gitLFS:booleanType().optional(),protectedSourcemaps:booleanType().optional(),installCommand:nullableType(stringType()).optional(),name:stringType().optional(),nodeVersion:UpdateProjectNodeVersion$outboundSchema.optional(),outputDirectory:nullableType(stringType()).optional(),previewDeploymentsDisabled:nullableType(booleanType()).optional(),previewDeploymentSuffix:nullableType(stringType()).optional(),resourceConfig:lazyType(()=>UpdateProjectResourceConfig$outboundSchema).optional(),publicSource:nullableType(booleanType()).optional(),rootDirectory:nullableType(stringType()).optional(),serverlessFunctionRegion:nullableType(stringType()).optional(),serverlessFunctionZeroConfigFailover:booleanType().optional(),skewProtectionBoundaryAt:numberType().int().optional(),skewProtectionMaxAge:numberType().int().optional(),skewProtectionAllowedDomains:arrayType(stringType()).optional(),skipGitConnectDuringLink:booleanType().optional(),sourceFilesOutsideRootDirectory:booleanType().optional(),enablePreviewFeedback:nullableType(booleanType()).optional(),enableProductionFeedback:nullableType(booleanType()).optional(),enableAffectedProjectsDeployments:booleanType().optional(),enableExternalRewriteCaching:booleanType().optional(),staticIps:lazyType(()=>UpdateProjectStaticIps$outboundSchema).optional(),tracing:nullableType(lazyType(()=>Tracing$outboundSchema)).optional(),oidcTokenConfig:lazyType(()=>UpdateProjectOidcTokenConfig$outboundSchema).optional(),passwordProtection:nullableType(lazyType(()=>UpdateProjectPasswordProtection$outboundSchema)).optional(),passport:nullableType(lazyType(()=>UpdateProjectPassport$outboundSchema)).optional(),ssoProtection:nullableType(lazyType(()=>UpdateProjectSsoProtection$outboundSchema)).optional(),trustedIps:nullableType(lazyType(()=>UpdateProjectTrustedIps$outboundSchema)).optional(),trustedSources:nullableType(lazyType(()=>TrustedSources$outboundSchema)).optional(),deploymentPolicy:smartUnion([lazyType(()=>DeploymentPolicy1$outboundSchema),stringType()]).optional(),optionsAllowlist:nullableType(lazyType(()=>UpdateProjectOptionsAllowlist$outboundSchema)).optional(),connectConfigurations:nullableType(arrayType(lazyType(()=>ConnectConfigurations1$outboundSchema))).optional(),dismissedToasts:arrayType(lazyType(()=>UpdateProjectDismissedToasts$outboundSchema)).optional()});objectType({idOrName:stringType(),teamId:stringType().optional(),slug:stringType().optional(),requestBody:lazyType(()=>UpdateProjectRequestBody$outboundSchema)}).transform(e=>remap(e,{requestBody:`RequestBody`})),objectType({id:string(),canceledAt:nullableType(number()).optional(),disabledAt:number(),enabledAt:number(),paidAt:optional(number()),sampleRatePercent:nullableType(number()).optional(),spendLimitInDollars:nullableType(number()).optional()}),objectType({id:string(),enabledAt:optional(number()),disabledAt:optional(number()),canceledAt:optional(number()),hasData:optional(boolean()),paidAt:optional(number())});const UpdateProjectEnvId2$inboundSchema=nativeEnumType(UpdateProjectEnvId2);smartUnion([string(),UpdateProjectEnvId2$inboundSchema]);const UpdateProjectAws$inboundSchema=objectType({subnetIds:arrayType(string()),securityGroupId:optional(string())});objectType({envId:smartUnion([string(),UpdateProjectEnvId2$inboundSchema]),connectConfigurationId:string(),dc:optional(string()),passive:boolean(),buildsEnabled:boolean(),aws:optional(lazyType(()=>UpdateProjectAws$inboundSchema)),createdAt:number(),updatedAt:number()});const UpdateProjectSource$inboundSchema=nativeEnumType(UpdateProjectSource),UpdateProjectDefinitions$inboundSchema=objectType({host:string(),path:string(),schedule:string(),source:optional(UpdateProjectSource$inboundSchema),description:optional(string()),hostInferred:optional(boolean())});objectType({enabledAt:number(),disabledAt:nullable(number()),updatedAt:number(),deploymentId:nullable(string()),definitions:arrayType(lazyType(()=>UpdateProjectDefinitions$inboundSchema))}),objectType({userDisabled:boolean(),storageSizeBytes:nullableType(number()).optional(),unlimited:optional(boolean())}),objectType({expirationDays:optional(number()),expirationDaysProduction:optional(number()),expirationDaysCanceled:optional(number()),expirationDaysErrored:optional(number()),deploymentsToKeep:optional(number())});const UpdateProjectExpiration2$inboundSchema=objectType({lockedAt:number(),lockedBy:string()}),UpdateProjectExpiration1$inboundSchema=objectType({expiresAt:number()});smartUnion([lazyType(()=>UpdateProjectExpiration2$inboundSchema),lazyType(()=>UpdateProjectExpiration1$inboundSchema)]);const UpdateProjectTarget2$inboundSchema=nativeEnumType(UpdateProjectTarget2);smartUnion([arrayType(string()),UpdateProjectTarget2$inboundSchema]);const UpdateProjectType$inboundSchema=nativeEnumType(UpdateProjectType),UpdateProjectContentHint17$inboundSchema=objectType({type:literal(`flags-connection-string`),projectId:string()}),UpdateProjectContentHint16$inboundSchema=objectType({type:literal(`integration-store-secret`),storeId:string(),integrationId:string(),integrationProductId:string(),integrationConfigurationId:string()}),UpdateProjectContentHint15$inboundSchema=objectType({type:literal(`postgres-url-no-ssl`),storeId:string()}),UpdateProjectContentHint14$inboundSchema=objectType({type:literal(`postgres-database`),storeId:string()}),UpdateProjectContentHint13$inboundSchema=objectType({type:literal(`postgres-password`),storeId:string()}),UpdateProjectContentHint12$inboundSchema=objectType({type:literal(`postgres-host`),storeId:string()}),UpdateProjectContentHint11$inboundSchema=objectType({type:literal(`postgres-user`),storeId:string()}),UpdateProjectContentHint10$inboundSchema=objectType({type:literal(`postgres-prisma-url`),storeId:string()}),UpdateProjectContentHint9$inboundSchema=objectType({type:literal(`postgres-url-non-pooling`),storeId:string()}),UpdateProjectContentHint8$inboundSchema=objectType({type:literal(`postgres-url`),storeId:string()}),UpdateProjectContentHint7$inboundSchema=objectType({type:literal(`blob-webhook-public-key`),storeId:string()}),UpdateProjectContentHint6$inboundSchema=objectType({type:literal(`blob-store-id`),storeId:string()}),UpdateProjectContentHint5$inboundSchema=objectType({type:literal(`blob-read-write-token`),storeId:string()}),UpdateProjectContentHint4$inboundSchema=objectType({type:literal(`redis-rest-api-read-only-token`),storeId:string()}),UpdateProjectContentHint3$inboundSchema=objectType({type:literal(`redis-rest-api-token`),storeId:string()}),UpdateProjectContentHint2$inboundSchema=objectType({type:literal(`redis-rest-api-url`),storeId:string()}),UpdateProjectContentHint1$inboundSchema=objectType({type:literal(`redis-url`),storeId:string()});unionType([lazyType(()=>UpdateProjectContentHint1$inboundSchema),lazyType(()=>UpdateProjectContentHint2$inboundSchema),lazyType(()=>UpdateProjectContentHint3$inboundSchema),lazyType(()=>UpdateProjectContentHint4$inboundSchema),lazyType(()=>UpdateProjectContentHint5$inboundSchema),lazyType(()=>UpdateProjectContentHint6$inboundSchema),lazyType(()=>UpdateProjectContentHint7$inboundSchema),lazyType(()=>UpdateProjectContentHint8$inboundSchema),lazyType(()=>UpdateProjectContentHint9$inboundSchema),lazyType(()=>UpdateProjectContentHint10$inboundSchema),lazyType(()=>UpdateProjectContentHint11$inboundSchema),lazyType(()=>UpdateProjectContentHint12$inboundSchema),lazyType(()=>UpdateProjectContentHint13$inboundSchema),lazyType(()=>UpdateProjectContentHint14$inboundSchema),lazyType(()=>UpdateProjectContentHint15$inboundSchema),lazyType(()=>UpdateProjectContentHint16$inboundSchema),lazyType(()=>UpdateProjectContentHint17$inboundSchema)]);const UpdateProjectInternalContentHint$inboundSchema=objectType({type:nativeEnumType(UpdateProjectProjectsResponse200ApplicationJSONType),encryptedValue:string()});objectType({target:optional(smartUnion([arrayType(string()),UpdateProjectTarget2$inboundSchema])),type:UpdateProjectType$inboundSchema,sunsetSecretId:optional(string()),legacyValue:optional(string()),decrypted:optional(boolean()),value:string(),vsmValue:optional(string()),id:optional(string()),key:string(),configurationId:nullableType(string()).optional(),createdAt:optional(number()),updatedAt:optional(number()),createdBy:nullableType(string()).optional(),updatedBy:nullableType(string()).optional(),gitBranch:optional(string()),edgeConfigId:nullableType(string()).optional(),edgeConfigTokenId:nullableType(string()).optional(),contentHint:nullableType(unionType([lazyType(()=>UpdateProjectContentHint1$inboundSchema),lazyType(()=>UpdateProjectContentHint2$inboundSchema),lazyType(()=>UpdateProjectContentHint3$inboundSchema),lazyType(()=>UpdateProjectContentHint4$inboundSchema),lazyType(()=>UpdateProjectContentHint5$inboundSchema),lazyType(()=>UpdateProjectContentHint6$inboundSchema),lazyType(()=>UpdateProjectContentHint7$inboundSchema),lazyType(()=>UpdateProjectContentHint8$inboundSchema),lazyType(()=>UpdateProjectContentHint9$inboundSchema),lazyType(()=>UpdateProjectContentHint10$inboundSchema),lazyType(()=>UpdateProjectContentHint11$inboundSchema),lazyType(()=>UpdateProjectContentHint12$inboundSchema),lazyType(()=>UpdateProjectContentHint13$inboundSchema),lazyType(()=>UpdateProjectContentHint14$inboundSchema),lazyType(()=>UpdateProjectContentHint15$inboundSchema),lazyType(()=>UpdateProjectContentHint16$inboundSchema),lazyType(()=>UpdateProjectContentHint17$inboundSchema)])).optional(),internalContentHint:nullableType(lazyType(()=>UpdateProjectInternalContentHint$inboundSchema)).optional(),comment:optional(string()),customEnvironmentIds:optional(arrayType(string()))});const UpdateProjectProjectsType$inboundSchema=nativeEnumType(UpdateProjectProjectsType),UpdateProjectBranchMatcher$inboundSchema=objectType({type:nativeEnumType(UpdateProjectProjectsResponse200Type),pattern:string()}),UpdateProjectVerification$inboundSchema=objectType({type:string(),domain:string(),value:string(),reason:string()}),UpdateProjectDomains$inboundSchema=objectType({name:string(),apexName:string(),projectId:string(),redirect:nullableType(string()).optional(),redirectStatusCode:nullableType(number()).optional(),gitBranch:nullableType(string()).optional(),customEnvironmentId:nullableType(string()).optional(),updatedAt:optional(number()),createdAt:optional(number()),verified:boolean(),verification:optional(arrayType(lazyType(()=>UpdateProjectVerification$inboundSchema)))});objectType({id:string(),slug:string(),type:UpdateProjectProjectsType$inboundSchema,description:optional(string()),branchMatcher:optional(lazyType(()=>UpdateProjectBranchMatcher$inboundSchema)),domains:optional(arrayType(lazyType(()=>UpdateProjectDomains$inboundSchema))),currentDeploymentAliases:optional(arrayType(string())),createdAt:number(),updatedAt:number()}),nativeEnumType(UpdateProjectProjectsFramework);const UpdateProjectServiceType$inboundSchema=nativeEnumType(UpdateProjectServiceType),UpdateProjectProjectsResponseFramework$inboundSchema=nativeEnumType(UpdateProjectProjectsResponseFramework);objectType({serviceName:string(),serviceType:optional(UpdateProjectServiceType$inboundSchema),framework:optional(UpdateProjectProjectsResponseFramework$inboundSchema),runtime:optional(string())}),objectType({bucket:string(),default:optional(boolean()),supportUntil:optional(number())});const UpdateProjectLint$inboundSchema=objectType({targets:arrayType(string())}),UpdateProjectTypecheck$inboundSchema=objectType({targets:arrayType(string())}),UpdateProjectMfeConfigPresent$inboundSchema=objectType({targets:arrayType(string())});objectType({lint:optional(lazyType(()=>UpdateProjectLint$inboundSchema)),typecheck:optional(lazyType(()=>UpdateProjectTypecheck$inboundSchema)),"mfe-config-present":optional(lazyType(()=>UpdateProjectMfeConfigPresent$inboundSchema))}).transform(e=>remap(e,{"mfe-config-present":`mfeConfigPresent`})),smartUnion([number(),boolean()]);const UpdateProjectBuilds$inboundSchema=objectType({use:string(),src:optional(string()),dest:optional(string())}),UpdateProjectCreator$inboundSchema=objectType({email:string(),githubLogin:optional(string()),gitlabLogin:optional(string()),uid:string(),username:string()});objectType({alias:optional(arrayType(string())),aliasAssigned:nullableType(smartUnion([number(),boolean()])).optional(),builds:optional(arrayType(lazyType(()=>UpdateProjectBuilds$inboundSchema))),createdAt:number(),createdIn:string(),creator:nullable(lazyType(()=>UpdateProjectCreator$inboundSchema)),deploymentHostname:string(),name:string(),forced:optional(boolean()),id:string(),meta:optional(recordType(string())),plan:string(),private:boolean(),readyState:string(),requestedAt:optional(number()),target:nullableType(string()).optional(),teamId:nullableType(string()).optional(),type:string(),url:string(),userId:string(),withCache:optional(boolean())});const UpdateProjectLinkProjectsResponse200ApplicationJSONResponseBodyDeployHooks$inboundSchema=objectType({createdAt:optional(number()),id:string(),name:string(),ref:string(),url:string()}),UpdateProjectLink6$inboundSchema=objectType({org:string(),repo:string(),type:literal(`vercel`),createdAt:optional(number()),deployHooks:arrayType(lazyType(()=>UpdateProjectLinkProjectsResponse200ApplicationJSONResponseBodyDeployHooks$inboundSchema)),gitCredentialId:string(),updatedAt:optional(number()),sourceless:optional(boolean()),productionBranch:string()}),UpdateProjectLinkProjectsResponse200ApplicationJSONDeployHooks$inboundSchema=objectType({createdAt:optional(number()),id:string(),name:string(),ref:string(),url:string()}),UpdateProjectLink5$inboundSchema=objectType({name:string(),slug:string(),owner:string(),type:literal(`bitbucket`),uuid:string(),workspaceUuid:string(),createdAt:optional(number()),deployHooks:arrayType(lazyType(()=>UpdateProjectLinkProjectsResponse200ApplicationJSONDeployHooks$inboundSchema)),gitCredentialId:string(),updatedAt:optional(number()),sourceless:optional(boolean()),productionBranch:string()}),UpdateProjectLinkProjectsResponse200DeployHooks$inboundSchema=objectType({createdAt:optional(number()),id:string(),name:string(),ref:string(),url:string()}),UpdateProjectLink4$inboundSchema=objectType({projectId:string(),projectName:string(),projectNameWithNamespace:string(),projectNamespace:string(),projectOwnerId:optional(number()),projectUrl:string(),type:literal(`gitlab`),createdAt:optional(number()),deployHooks:arrayType(lazyType(()=>UpdateProjectLinkProjectsResponse200DeployHooks$inboundSchema)),gitCredentialId:string(),updatedAt:optional(number()),sourceless:optional(boolean()),productionBranch:string()}),UpdateProjectLinkProjectsResponseDeployHooks$inboundSchema=objectType({createdAt:optional(number()),id:string(),name:string(),ref:string(),url:string()}),UpdateProjectLink3$inboundSchema=objectType({org:string(),repoOwnerId:optional(number()),repo:optional(string()),repoId:optional(number()),type:literal(`github-custom-host`),host:string(),createdAt:optional(number()),deployHooks:arrayType(lazyType(()=>UpdateProjectLinkProjectsResponseDeployHooks$inboundSchema)),gitCredentialId:string(),updatedAt:optional(number()),sourceless:optional(boolean()),productionBranch:string()}),UpdateProjectLinkProjectsDeployHooks$inboundSchema=objectType({createdAt:optional(number()),id:string(),name:string(),ref:string(),url:string()}),UpdateProjectLink2$inboundSchema=objectType({type:literal(`github-limited`),repo:optional(string()),repoId:optional(number()),createdAt:optional(number()),updatedAt:optional(number()),org:string(),repoOwnerId:optional(number()),deployHooks:arrayType(lazyType(()=>UpdateProjectLinkProjectsDeployHooks$inboundSchema)),gitCredentialId:string(),sourceless:optional(boolean()),productionBranch:string()}),UpdateProjectLinkDeployHooks$inboundSchema=objectType({createdAt:optional(number()),id:string(),name:string(),ref:string(),url:string()}),UpdateProjectLink1$inboundSchema=objectType({org:string(),repoOwnerId:optional(number()),repo:optional(string()),repoId:optional(number()),type:literal(`github`),createdAt:optional(number()),deployHooks:arrayType(lazyType(()=>UpdateProjectLinkDeployHooks$inboundSchema)),gitCredentialId:string(),updatedAt:optional(number()),sourceless:optional(boolean()),productionBranch:string()});unionType([lazyType(()=>UpdateProjectLink1$inboundSchema),lazyType(()=>UpdateProjectLink2$inboundSchema),lazyType(()=>UpdateProjectLink3$inboundSchema),lazyType(()=>UpdateProjectLink4$inboundSchema),lazyType(()=>UpdateProjectLink5$inboundSchema),lazyType(()=>UpdateProjectLink6$inboundSchema)]);const UpdateProjectMicrofrontends3$inboundSchema=objectType({updatedAt:number(),groupIds:arrayType(anyType()),enabled:literal(!1),freeProjectForLegacyLimits:optional(boolean())}),UpdateProjectMicrofrontends2$inboundSchema=objectType({isDefaultApp:optional(literal(!1)),routeObservabilityToThisProject:optional(boolean()),doNotRouteWithMicrofrontendsRouting:optional(boolean()),updatedAt:number(),groupIds:arrayType(string()),enabled:literal(!0),defaultRoute:optional(string()),freeProjectForLegacyLimits:optional(boolean())}),UpdateProjectMicrofrontends1$inboundSchema=objectType({isDefaultApp:literal(!0),updatedAt:number(),groupIds:arrayType(string()),enabled:literal(!0),defaultRoute:optional(string()),freeProjectForLegacyLimits:optional(boolean())});smartUnion([lazyType(()=>UpdateProjectMicrofrontends1$inboundSchema),lazyType(()=>UpdateProjectMicrofrontends2$inboundSchema),lazyType(()=>UpdateProjectMicrofrontends3$inboundSchema)]),nativeEnumType(UpdateProjectProjectsNodeVersion);const UpdateProjectProjectsPaths$inboundSchema=objectType({value:string()});objectType({paths:arrayType(lazyType(()=>UpdateProjectProjectsPaths$inboundSchema))});export{trustedSourcesToJSON};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{unrecognized}from"./unrecognized.js";let globalCount=0,refCount=0;function defaultToZeroValue(t){return globalCount++,unrecognized(t)}function startCountingDefaultToZeroValue(){refCount++;let e=globalCount;return{end:n=>{let r=globalCount-e;return globalCount=e+(n??r),--refCount===0&&(globalCount=0),r}}}export{defaultToZeroValue,startCountingDefaultToZeroValue};
|
package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.1/node_modules/@vercel/sdk/esm/types/fp.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function OK(e){return{ok:!0,value:e}}function ERR(e){return{ok:!1,error:e}}export{ERR,OK};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{NEVER,anyType,booleanType,literalType,nullType,numberType,stringType,undefinedType,unionType}from"../../../../../../zod@4.4.3/node_modules/zod/v3/types.js";import"../../../../../../zod@4.4.3/node_modules/zod/v3/index.js";import{unrecognized}from"./unrecognized.js";import{defaultToZeroValue}from"./defaultToZeroValue.js";function string(){return unionType([stringType(),zodDefaultToZeroValue(``),anyType().transform(e=>unrecognized(JSON.stringify(e)))])}function boolean(){return unionType([booleanType(),stringType().transform((t,n)=>{let r=t.toLowerCase();return r===`true`?unrecognized(!0):r===`false`?unrecognized(!1):(n.addIssue({code:`invalid_type`,expected:`boolean`,received:`string`}),NEVER)}),zodDefaultToZeroValue(!1)])}function number(){return unionType([numberType(),stringType().transform((t,n)=>{let r=Number(t);return isNaN(r)?(n.addIssue({code:`invalid_type`,expected:`number`,received:`string`}),NEVER):unrecognized(r)}),zodDefaultToZeroValue(0)])}function literal(e){return unionType([literalType(e),zodDefaultToZeroValue(e)])}function optional(e){return unionType([nullType().transform(()=>unrecognized(void 0)),e]).optional()}function nullable(e){return unionType([nullType(),undefinedType().transform(()=>defaultToZeroValue(null)),e])}function zodDefaultToZeroValue(n){return anyType().transform((t,r)=>t==null?defaultToZeroValue(n):(r.addIssue({code:`invalid_type`,expected:`undefined`,received:`unknown`}),NEVER))}export{boolean,literal,nullable,number,optional,string};
|
package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.1/node_modules/@vercel/sdk/esm/types/rfcdate.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const dateRE=/^\d{4}-\d{2}-\d{2}$/;var RFCDate=class RFCDate{serialized;static today(){return new RFCDate(new Date)}constructor(e){if(typeof e==`string`&&!dateRE.test(e))throw RangeError(`RFCDate: date strings must be in the format YYYY-MM-DD: `+e);let t=new Date(e);if(isNaN(+t))throw RangeError(`RFCDate: invalid date provided: `+e);if(this.serialized=t.toISOString().slice(0,10),!dateRE.test(this.serialized))throw TypeError(`RFCDate: failed to build valid date with given value: ${e} serialized to ${this.serialized}`)}toJSON(){return this.toString()}toString(){return this.serialized}};export{RFCDate};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ZodError}from"../../../../../../zod@4.4.3/node_modules/zod/v3/ZodError.js";import{NEVER,unknownType}from"../../../../../../zod@4.4.3/node_modules/zod/v3/types.js";import"../../../../../../zod@4.4.3/node_modules/zod/v3/index.js";import{startCountingUnrecognized}from"./unrecognized.js";import{startCountingDefaultToZeroValue}from"./defaultToZeroValue.js";import{RFCDate}from"./rfcdate.js";function smartUnion(a){return unknownType().transform((n,o)=>{let s=[],c=a.map(()=>[]),l=startCountingUnrecognized(),u=startCountingDefaultToZeroValue();for(let[e,t]of a.entries()){let a=startCountingUnrecognized(),o=startCountingDefaultToZeroValue(),l=t.safeParse(n),u=a.end(),d=o.end();if(l.success){s.push({data:l.data,inexactCount:u,zeroDefaultCount:d,fieldCount:-1});continue}c[e].push(...l.error.issues)}if(s.length===0)return l.end(0),u.end(0),o.addIssue({code:`invalid_union`,unionErrors:c.map(t=>new ZodError(t))}),NEVER;let d=s[0];for(let e of s)s.length>1&&(e.fieldCount=countFieldsRecursive(e.data)),d=better(e,d);return l.end(d.inexactCount),u.end(d.zeroDefaultCount),d.data})}function better(e,t){let n=e.inexactCount===0;if(n!==(t.inexactCount===0))return n?e:t;let r=e.fieldCount-e.zeroDefaultCount,i=t.fieldCount-t.zeroDefaultCount;return r===i?e.inexactCount<t.inexactCount?e:t:r>i?e:t}function countFieldsRecursive(e){let t=0,n=[e],r=0;for(;r<n.length;){let e=n[r++];if(e===void 0)continue;let i=typeof e;if(e===null||i===`number`||i===`string`||i===`boolean`||i===`bigint`||e instanceof Date||e instanceof RFCDate){t++;continue}if(Array.isArray(e)){n.push(...e);continue}i===`object`&&n.push(...Object.values(e))}return t}export{smartUnion};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function unrecognized(e){return globalCount++,e}let globalCount=0,refCount=0;function startCountingUnrecognized(){refCount++;let t=globalCount;return{end:n=>{let r=globalCount-t;return globalCount=t+(n??r),--refCount===0&&(globalCount=0),r}}}export{startCountingUnrecognized,unrecognized};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{util}from"./helpers/util.js";const ZodIssueCode=util.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`]),quotelessJson=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,`$1:`);var ZodError=class ZodError 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]};let 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},n={_errors:[]},processError=e=>{for(let r of e.issues)if(r.code===`invalid_union`)r.unionErrors.map(processError);else if(r.code===`invalid_return_type`)processError(r.returnTypeError);else if(r.code===`invalid_arguments`)processError(r.argumentsError);else if(r.path.length===0)n._errors.push(t(r));else{let e=n,i=0;for(;i<r.path.length;){let n=r.path[i];i===r.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(r))):e[n]=e[n]||{_errors:[]},e=e[n],i++}}};return processError(this),n}static assert(e){if(!(e instanceof ZodError))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t=Object.create(null),n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};ZodError.create=e=>new ZodError(e);export{ZodError,ZodIssueCode,quotelessJson};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import errorMap from"./locales/en.js";let overrideErrorMap=errorMap;function setErrorMap(e){overrideErrorMap=e}function getErrorMap(){return overrideErrorMap}export{getErrorMap,setErrorMap};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__exportAll}from"../../../../../../_virtual/_rolldown/runtime.js";import{ZodParsedType,getParsedType,objectUtil,util}from"./helpers/util.js";import{ZodError,ZodIssueCode,quotelessJson}from"./ZodError.js";import errorMap from"./locales/en.js";import{getErrorMap,setErrorMap}from"./errors.js";import{DIRTY,EMPTY_PATH,INVALID,OK,ParseStatus,addIssueToContext,isAborted,isAsync,isDirty,isValid,makeIssue}from"./helpers/parseUtil.js";import"./helpers/typeAliases.js";import{BRAND,NEVER,ZodAny,ZodArray,ZodBigInt,ZodBoolean,ZodBranded,ZodCatch,ZodDate,ZodDefault,ZodDiscriminatedUnion,ZodEffects,ZodEnum,ZodFirstPartyTypeKind,ZodFunction,ZodIntersection,ZodLazy,ZodLiteral,ZodMap,ZodNaN,ZodNativeEnum,ZodNever,ZodNull,ZodNullable,ZodNumber,ZodObject,ZodOptional,ZodPipeline,ZodPromise,ZodReadonly,ZodRecord,ZodSet,ZodString,ZodSymbol,ZodTuple,ZodType,ZodUndefined,ZodUnion,ZodUnknown,ZodVoid,anyType,arrayType,bigIntType,booleanType,coerce,custom,dateType,datetimeRegex,discriminatedUnionType,effectsType,enumType,functionType,instanceOfType,intersectionType,late,lazyType,literalType,mapType,nanType,nativeEnumType,neverType,nullType,nullableType,numberType,objectType,oboolean,onumber,optionalType,ostring,pipelineType,preprocessType,promiseType,recordType,setType,strictObjectType,stringType,symbolType,tupleType,undefinedType,unionType,unknownType,voidType}from"./types.js";var external_exports=__exportAll({BRAND:()=>BRAND,DIRTY:()=>DIRTY,EMPTY_PATH:()=>EMPTY_PATH,INVALID:()=>INVALID,NEVER:()=>NEVER,OK:()=>OK,ParseStatus:()=>ParseStatus,Schema:()=>ZodType,ZodAny:()=>ZodAny,ZodArray:()=>ZodArray,ZodBigInt:()=>ZodBigInt,ZodBoolean:()=>ZodBoolean,ZodBranded:()=>ZodBranded,ZodCatch:()=>ZodCatch,ZodDate:()=>ZodDate,ZodDefault:()=>ZodDefault,ZodDiscriminatedUnion:()=>ZodDiscriminatedUnion,ZodEffects:()=>ZodEffects,ZodEnum:()=>ZodEnum,ZodError:()=>ZodError,ZodFirstPartyTypeKind:()=>ZodFirstPartyTypeKind,ZodFunction:()=>ZodFunction,ZodIntersection:()=>ZodIntersection,ZodIssueCode:()=>ZodIssueCode,ZodLazy:()=>ZodLazy,ZodLiteral:()=>ZodLiteral,ZodMap:()=>ZodMap,ZodNaN:()=>ZodNaN,ZodNativeEnum:()=>ZodNativeEnum,ZodNever:()=>ZodNever,ZodNull:()=>ZodNull,ZodNullable:()=>ZodNullable,ZodNumber:()=>ZodNumber,ZodObject:()=>ZodObject,ZodOptional:()=>ZodOptional,ZodParsedType:()=>ZodParsedType,ZodPipeline:()=>ZodPipeline,ZodPromise:()=>ZodPromise,ZodReadonly:()=>ZodReadonly,ZodRecord:()=>ZodRecord,ZodSchema:()=>ZodType,ZodSet:()=>ZodSet,ZodString:()=>ZodString,ZodSymbol:()=>ZodSymbol,ZodTransformer:()=>ZodEffects,ZodTuple:()=>ZodTuple,ZodType:()=>ZodType,ZodUndefined:()=>ZodUndefined,ZodUnion:()=>ZodUnion,ZodUnknown:()=>ZodUnknown,ZodVoid:()=>ZodVoid,addIssueToContext:()=>addIssueToContext,any:()=>anyType,array:()=>arrayType,bigint:()=>bigIntType,boolean:()=>booleanType,coerce:()=>coerce,custom:()=>custom,date:()=>dateType,datetimeRegex:()=>datetimeRegex,defaultErrorMap:()=>errorMap,discriminatedUnion:()=>discriminatedUnionType,effect:()=>effectsType,enum:()=>enumType,function:()=>functionType,getErrorMap:()=>getErrorMap,getParsedType:()=>getParsedType,instanceof:()=>instanceOfType,intersection:()=>intersectionType,isAborted:()=>isAborted,isAsync:()=>isAsync,isDirty:()=>isDirty,isValid:()=>isValid,late:()=>late,lazy:()=>lazyType,literal:()=>literalType,makeIssue:()=>makeIssue,map:()=>mapType,nan:()=>nanType,nativeEnum:()=>nativeEnumType,never:()=>neverType,null:()=>nullType,nullable:()=>nullableType,number:()=>numberType,object:()=>objectType,objectUtil:()=>objectUtil,oboolean:()=>oboolean,onumber:()=>onumber,optional:()=>optionalType,ostring:()=>ostring,pipeline:()=>pipelineType,preprocess:()=>preprocessType,promise:()=>promiseType,quotelessJson:()=>quotelessJson,record:()=>recordType,set:()=>setType,setErrorMap:()=>setErrorMap,strictObject:()=>strictObjectType,string:()=>stringType,symbol:()=>symbolType,transformer:()=>effectsType,tuple:()=>tupleType,undefined:()=>undefinedType,union:()=>unionType,unknown:()=>unknownType,util:()=>util,void:()=>voidType});export{external_exports};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var errorUtil;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(errorUtil||={});export{errorUtil};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import errorMap from"../locales/en.js";import{getErrorMap}from"../errors.js";const makeIssue=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}},EMPTY_PATH=[];function addIssueToContext(n,r){let i=getErrorMap(),a=makeIssue({issueData:r,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,i,i===errorMap?void 0:errorMap].filter(e=>!!e)});n.common.issues.push(a)}var ParseStatus=class ParseStatus{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return INVALID;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let e of t){let t=await e.key,r=await e.value;n.push({key:t,value:r})}return ParseStatus.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:a}=r;if(t.status===`aborted`||a.status===`aborted`)return INVALID;t.status===`dirty`&&e.dirty(),a.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(a.value!==void 0||r.alwaysSet)&&(n[t.value]=a.value)}return{status:e.value,value:n}}};const INVALID=Object.freeze({status:`aborted`}),DIRTY=e=>({status:`dirty`,value:e}),OK=e=>({status:`valid`,value:e}),isAborted=e=>e.status===`aborted`,isDirty=e=>e.status===`dirty`,isValid=e=>e.status===`valid`,isAsync=e=>typeof Promise<`u`&&e instanceof Promise;export{DIRTY,EMPTY_PATH,INVALID,OK,ParseStatus,addIssueToContext,isAborted,isAsync,isDirty,isValid,makeIssue};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var util;(function(e){e.assertEqual=e=>{};function assertIs(e){}e.assertIs=assertIs;function assertNever(e){throw Error()}e.assertNever=assertNever,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function joinValues(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=joinValues,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(util||={});var objectUtil;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(objectUtil||={});const ZodParsedType=util.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),getParsedType=e=>{switch(typeof e){case`undefined`:return ZodParsedType.undefined;case`string`:return ZodParsedType.string;case`number`:return Number.isNaN(e)?ZodParsedType.nan:ZodParsedType.number;case`boolean`:return ZodParsedType.boolean;case`function`:return ZodParsedType.function;case`bigint`:return ZodParsedType.bigint;case`symbol`:return ZodParsedType.symbol;case`object`:return Array.isArray(e)?ZodParsedType.array:e===null?ZodParsedType.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?ZodParsedType.promise:typeof Map<`u`&&e instanceof Map?ZodParsedType.map:typeof Set<`u`&&e instanceof Set?ZodParsedType.set:typeof Date<`u`&&e instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}};export{ZodParsedType,getParsedType,objectUtil,util};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./helpers/util.js";import"./ZodError.js";import"./locales/en.js";import"./errors.js";import"./helpers/parseUtil.js";import"./types.js";import"./external.js";export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ZodParsedType,util}from"../helpers/util.js";import{ZodIssueCode}from"../ZodError.js";const errorMap=(e,t)=>{let n;switch(e.code){case ZodIssueCode.invalid_type:n=e.received===ZodParsedType.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case ZodIssueCode.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,util.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:n=`Unrecognized key(s) in object: ${util.joinValues(e.keys,`, `)}`;break;case ZodIssueCode.invalid_union:n=`Invalid input`;break;case ZodIssueCode.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${util.joinValues(e.options)}`;break;case ZodIssueCode.invalid_enum_value:n=`Invalid enum value. Expected ${util.joinValues(e.options)}, received '${e.received}'`;break;case ZodIssueCode.invalid_arguments:n=`Invalid function arguments`;break;case ZodIssueCode.invalid_return_type:n=`Invalid function return type`;break;case ZodIssueCode.invalid_date:n=`Invalid date`;break;case ZodIssueCode.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(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}"`:util.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case ZodIssueCode.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`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 ZodIssueCode.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case ZodIssueCode.custom:n=`Invalid input`;break;case ZodIssueCode.invalid_intersection_types:n=`Intersection results could not be merged`;break;case ZodIssueCode.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ZodIssueCode.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,util.assertNever(e)}return{message:n}};export{errorMap as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ZodParsedType,getParsedType,util}from"./helpers/util.js";import{ZodError,ZodIssueCode}from"./ZodError.js";import errorMap from"./locales/en.js";import{getErrorMap}from"./errors.js";import{DIRTY,INVALID,OK,ParseStatus,addIssueToContext,isAborted,isAsync,isDirty,isValid,makeIssue}from"./helpers/parseUtil.js";import{errorUtil}from"./helpers/errorUtil.js";var ParseInputLazyPath=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}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}};const handleResult=(e,t)=>{if(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 ZodError(e.common.issues);return this._error=t,this._error}}};function processCreateParams(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var ZodType=class{get description(){return this._def.description}_getType(e){return getParsedType(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(isAsync(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,n){let r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:getParsedType(e)};return handleResult(r,this._parseSync({data:e,path:r.path,parent:r}))}"~validate"(e){let n={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:getParsedType(e)};if(!this[`~standard`].async)try{let t=this._parseSync({data:e,path:[],parent:n});return isValid(t)?{value:t.value}:{issues:n.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(e=>isValid(e)?{value:e.value}:{issues:n.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:getParsedType(e)},i=this._parse({data:e,path:r.path,parent:r});return handleResult(r,await(isAsync(i)?i:Promise.resolve(i)))}refine(e,t){let getIssueProperties=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,n)=>{let r=e(t),setError=()=>n.addIssue({code:ZodIssueCode.custom,...getIssueProperties(t)});return typeof Promise<`u`&&r instanceof Promise?r.then(e=>e?!0:(setError(),!1)):r?!0:(setError(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.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 ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(e){return ZodUnion.create([this,e],this._def)}and(e){return ZodIntersection.create(this,e,this._def)}transform(e){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:t,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:t,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return ZodPipeline.create(this,e)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[0-9a-z]+$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/i,uuidRegex=/^[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,nanoidRegex=/^[a-z0-9_-]{21}$/i,jwtRegex=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,durationRegex=/^[-+]?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)?)??$/,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let emojiRegex;const ipv4Regex=/^(?:(?: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])$/,ipv4CidrRegex=/^(?:(?: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])$/,ipv6Regex=/^(([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]))$/,ipv6CidrRegex=/^(([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])$/,base64Regex=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64urlRegex=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,dateRegexSource=`((\\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])))`,dateRegex=RegExp(`^${dateRegexSource}$`);function timeRegexSource(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function timeRegex(e){return RegExp(`^${timeRegexSource(e)}$`)}function datetimeRegex(e){let t=`${dateRegexSource}T${timeRegexSource(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function isValidIP(e,t){return!!((t===`v4`||!t)&&ipv4Regex.test(e)||(t===`v6`||!t)&&ipv6Regex.test(e))}function isValidJWT(e,t){if(!jwtRegex.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function isValidCidr(e,t){return!!((t===`v4`||!t)&&ipv4CidrRegex.test(e)||(t===`v6`||!t)&&ipv6CidrRegex.test(e))}var ZodString=class ZodString extends ZodType{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ZodParsedType.string){let n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:n.parsedType}),INVALID}let r=new ParseStatus,a;for(let e of this._def.checks)if(e.kind===`min`)t.data.length<e.value&&(a=this._getOrReturnCtx(t,a),addIssueToContext(a,{code:ZodIssueCode.too_small,minimum:e.value,type:`string`,inclusive:!0,exact:!1,message:e.message}),r.dirty());else if(e.kind===`max`)t.data.length>e.value&&(a=this._getOrReturnCtx(t,a),addIssueToContext(a,{code:ZodIssueCode.too_big,maximum:e.value,type:`string`,inclusive:!0,exact:!1,message:e.message}),r.dirty());else if(e.kind===`length`){let n=t.data.length>e.value,o=t.data.length<e.value;(n||o)&&(a=this._getOrReturnCtx(t,a),n?addIssueToContext(a,{code:ZodIssueCode.too_big,maximum:e.value,type:`string`,inclusive:!0,exact:!0,message:e.message}):o&&addIssueToContext(a,{code:ZodIssueCode.too_small,minimum:e.value,type:`string`,inclusive:!0,exact:!0,message:e.message}),r.dirty())}else if(e.kind===`email`)emailRegex.test(t.data)||(a=this._getOrReturnCtx(t,a),addIssueToContext(a,{validation:`email`,code:ZodIssueCode.invalid_string,message:e.message}),r.dirty());else if(e.kind===`emoji`)emojiRegex||=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`),emojiRegex.test(t.data)||(a=this._getOrReturnCtx(t,a),addIssueToContext(a,{validation:`emoji`,code:ZodIssueCode.invalid_string,message:e.message}),r.dirty());else if(e.kind===`uuid`)uuidRegex.test(t.data)||(a=this._getOrReturnCtx(t,a),addIssueToContext(a,{validation:`uuid`,code:ZodIssueCode.invalid_string,message:e.message}),r.dirty());else if(e.kind===`nanoid`)nanoidRegex.test(t.data)||(a=this._getOrReturnCtx(t,a),addIssueToContext(a,{validation:`nanoid`,code:ZodIssueCode.invalid_string,message:e.message}),r.dirty());else if(e.kind===`cuid`)cuidRegex.test(t.data)||(a=this._getOrReturnCtx(t,a),addIssueToContext(a,{validation:`cuid`,code:ZodIssueCode.invalid_string,message:e.message}),r.dirty());else if(e.kind===`cuid2`)cuid2Regex.test(t.data)||(a=this._getOrReturnCtx(t,a),addIssueToContext(a,{validation:`cuid2`,code:ZodIssueCode.invalid_string,message:e.message}),r.dirty());else if(e.kind===`ulid`)ulidRegex.test(t.data)||(a=this._getOrReturnCtx(t,a),addIssueToContext(a,{validation:`ulid`,code:ZodIssueCode.invalid_string,message:e.message}),r.dirty());else if(e.kind===`url`)try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),addIssueToContext(a,{validation:`url`,code:ZodIssueCode.invalid_string,message:e.message}),r.dirty()}else e.kind===`regex`?(e.regex.lastIndex=0,e.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),addIssueToContext(a,{validation:`regex`,code:ZodIssueCode.invalid_string,message:e.message}),r.dirty())):e.kind===`trim`?t.data=t.data.trim():e.kind===`includes`?t.data.includes(e.value,e.position)||(a=this._getOrReturnCtx(t,a),addIssueToContext(a,{code:ZodIssueCode.invalid_string,validation:{includes:e.value,position:e.position},message:e.message}),r.dirty()):e.kind===`toLowerCase`?t.data=t.data.toLowerCase():e.kind===`toUpperCase`?t.data=t.data.toUpperCase():e.kind===`startsWith`?t.data.startsWith(e.value)||(a=this._getOrReturnCtx(t,a),addIssueToContext(a,{code:ZodIssueCode.invalid_string,validation:{startsWith:e.value},message:e.message}),r.dirty()):e.kind===`endsWith`?t.data.endsWith(e.value)||(a=this._getOrReturnCtx(t,a),addIssueToContext(a,{code:ZodIssueCode.invalid_string,validation:{endsWith:e.value},message:e.message}),r.dirty()):e.kind===`datetime`?datetimeRegex(e).test(t.data)||(a=this._getOrReturnCtx(t,a),addIssueToContext(a,{code:ZodIssueCode.invalid_string,validation:`datetime`,message:e.message}),r.dirty()):e.kind===`date`?dateRegex.test(t.data)||(a=this._getOrReturnCtx(t,a),addIssueToContext(a,{code:ZodIssueCode.invalid_string,validation:`date`,message:e.message}),r.dirty()):e.kind===`time`?timeRegex(e).test(t.data)||(a=this._getOrReturnCtx(t,a),addIssueToContext(a,{code:ZodIssueCode.invalid_string,validation:`time`,message:e.message}),r.dirty()):e.kind===`duration`?durationRegex.test(t.data)||(a=this._getOrReturnCtx(t,a),addIssueToContext(a,{validation:`duration`,code:ZodIssueCode.invalid_string,message:e.message}),r.dirty()):e.kind===`ip`?isValidIP(t.data,e.version)||(a=this._getOrReturnCtx(t,a),addIssueToContext(a,{validation:`ip`,code:ZodIssueCode.invalid_string,message:e.message}),r.dirty()):e.kind===`jwt`?isValidJWT(t.data,e.alg)||(a=this._getOrReturnCtx(t,a),addIssueToContext(a,{validation:`jwt`,code:ZodIssueCode.invalid_string,message:e.message}),r.dirty()):e.kind===`cidr`?isValidCidr(t.data,e.version)||(a=this._getOrReturnCtx(t,a),addIssueToContext(a,{validation:`cidr`,code:ZodIssueCode.invalid_string,message:e.message}),r.dirty()):e.kind===`base64`?base64Regex.test(t.data)||(a=this._getOrReturnCtx(t,a),addIssueToContext(a,{validation:`base64`,code:ZodIssueCode.invalid_string,message:e.message}),r.dirty()):e.kind===`base64url`?base64urlRegex.test(t.data)||(a=this._getOrReturnCtx(t,a),addIssueToContext(a,{validation:`base64url`,code:ZodIssueCode.invalid_string,message:e.message}),r.dirty()):util.assertNever(e);return{status:r.value,value:t.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(n)})}_addCheck(e){return new ZodString({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:`email`,...errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...errorUtil.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...errorUtil.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...errorUtil.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...errorUtil.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...errorUtil.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...errorUtil.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...errorUtil.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...errorUtil.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...errorUtil.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...errorUtil.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...errorUtil.errToObj(t)})}nonempty(e){return this.min(1,errorUtil.errToObj(e))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};ZodString.create=e=>new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:e?.coerce??!1,...processCreateParams(e)});function floatSafeRemainder(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var ZodNumber=class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ZodParsedType.number){let n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:n.parsedType}),INVALID}let r,a=new ParseStatus;for(let e of this._def.checks)e.kind===`int`?util.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:`integer`,received:`float`,message:e.message}),a.dirty()):e.kind===`min`?(e.inclusive?t.data<e.value:t.data<=e.value)&&(r=this._getOrReturnCtx(t,r),addIssueToContext(r,{code:ZodIssueCode.too_small,minimum:e.value,type:`number`,inclusive:e.inclusive,exact:!1,message:e.message}),a.dirty()):e.kind===`max`?(e.inclusive?t.data>e.value:t.data>=e.value)&&(r=this._getOrReturnCtx(t,r),addIssueToContext(r,{code:ZodIssueCode.too_big,maximum:e.value,type:`number`,inclusive:e.inclusive,exact:!1,message:e.message}),a.dirty()):e.kind===`multipleOf`?floatSafeRemainder(t.data,e.value)!==0&&(r=this._getOrReturnCtx(t,r),addIssueToContext(r,{code:ZodIssueCode.not_multiple_of,multipleOf:e.value,message:e.message}),a.dirty()):e.kind===`finite`?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),addIssueToContext(r,{code:ZodIssueCode.not_finite,message:e.message}),a.dirty()):util.assertNever(e);return{status:a.value,value:t.data}}gte(e,t){return this.setLimit(`min`,e,!0,errorUtil.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,errorUtil.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,errorUtil.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,errorUtil.toString(t))}setLimit(e,t,n,r){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:errorUtil.toString(r)}]})}_addCheck(e){return new ZodNumber({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:`int`,message:errorUtil.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:errorUtil.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:errorUtil.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:errorUtil.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:errorUtil.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:errorUtil.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&util.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks){if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}};ZodNumber.create=e=>new ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:e?.coerce||!1,...processCreateParams(e)});var ZodBigInt=class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==ZodParsedType.bigint)return this._getInvalidInput(t);let r,a=new ParseStatus;for(let e of this._def.checks)e.kind===`min`?(e.inclusive?t.data<e.value:t.data<=e.value)&&(r=this._getOrReturnCtx(t,r),addIssueToContext(r,{code:ZodIssueCode.too_small,type:`bigint`,minimum:e.value,inclusive:e.inclusive,message:e.message}),a.dirty()):e.kind===`max`?(e.inclusive?t.data>e.value:t.data>=e.value)&&(r=this._getOrReturnCtx(t,r),addIssueToContext(r,{code:ZodIssueCode.too_big,type:`bigint`,maximum:e.value,inclusive:e.inclusive,message:e.message}),a.dirty()):e.kind===`multipleOf`?t.data%e.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),addIssueToContext(r,{code:ZodIssueCode.not_multiple_of,multipleOf:e.value,message:e.message}),a.dirty()):util.assertNever(e);return{status:a.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:n.parsedType}),INVALID}gte(e,t){return this.setLimit(`min`,e,!0,errorUtil.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,errorUtil.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,errorUtil.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,errorUtil.toString(t))}setLimit(e,t,n,r){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:errorUtil.toString(r)}]})}_addCheck(e){return new ZodBigInt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:errorUtil.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:errorUtil.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};ZodBigInt.create=e=>new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:e?.coerce??!1,...processCreateParams(e)});var ZodBoolean=class extends ZodType{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ZodParsedType.boolean){let n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:n.parsedType}),INVALID}return OK(t.data)}};ZodBoolean.create=e=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:e?.coerce||!1,...processCreateParams(e)});var ZodDate=class ZodDate extends ZodType{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ZodParsedType.date){let n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:n.parsedType}),INVALID}if(Number.isNaN(t.data.getTime()))return addIssueToContext(this._getOrReturnCtx(t),{code:ZodIssueCode.invalid_date}),INVALID;let r=new ParseStatus,a;for(let e of this._def.checks)e.kind===`min`?t.data.getTime()<e.value&&(a=this._getOrReturnCtx(t,a),addIssueToContext(a,{code:ZodIssueCode.too_small,message:e.message,inclusive:!0,exact:!1,minimum:e.value,type:`date`}),r.dirty()):e.kind===`max`?t.data.getTime()>e.value&&(a=this._getOrReturnCtx(t,a),addIssueToContext(a,{code:ZodIssueCode.too_big,message:e.message,inclusive:!0,exact:!1,maximum:e.value,type:`date`}),r.dirty()):util.assertNever(e);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(e){return new ZodDate({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:errorUtil.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};ZodDate.create=e=>new ZodDate({checks:[],coerce:e?.coerce||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(e)});var ZodSymbol=class extends ZodType{_parse(t){if(this._getType(t)!==ZodParsedType.symbol){let n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:n.parsedType}),INVALID}return OK(t.data)}};ZodSymbol.create=e=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(e)});var ZodUndefined=class extends ZodType{_parse(t){if(this._getType(t)!==ZodParsedType.undefined){let n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:n.parsedType}),INVALID}return OK(t.data)}};ZodUndefined.create=e=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(e)});var ZodNull=class extends ZodType{_parse(t){if(this._getType(t)!==ZodParsedType.null){let n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:n.parsedType}),INVALID}return OK(t.data)}};ZodNull.create=e=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(e)});var ZodAny=class extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(e){return OK(e.data)}};ZodAny.create=e=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(e)});var ZodUnknown=class extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(e){return OK(e.data)}};ZodUnknown.create=e=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(e)});var ZodNever=class extends ZodType{_parse(t){let n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:n.parsedType}),INVALID}};ZodNever.create=e=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(e)});var ZodVoid=class extends ZodType{_parse(t){if(this._getType(t)!==ZodParsedType.undefined){let n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:n.parsedType}),INVALID}return OK(t.data)}};ZodVoid.create=e=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(e)});var ZodArray=class ZodArray extends ZodType{_parse(t){let{ctx:n,status:r}=this._processInputParams(t),a=this._def;if(n.parsedType!==ZodParsedType.array)return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:n.parsedType}),INVALID;if(a.exactLength!==null){let e=n.data.length>a.exactLength.value,t=n.data.length<a.exactLength.value;(e||t)&&(addIssueToContext(n,{code:e?ZodIssueCode.too_big:ZodIssueCode.too_small,minimum:t?a.exactLength.value:void 0,maximum:e?a.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&n.data.length<a.minLength.value&&(addIssueToContext(n,{code:ZodIssueCode.too_small,minimum:a.minLength.value,type:`array`,inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&n.data.length>a.maxLength.value&&(addIssueToContext(n,{code:ZodIssueCode.too_big,maximum:a.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((e,t)=>a.type._parseAsync(new ParseInputLazyPath(n,e,n.path,t)))).then(e=>ParseStatus.mergeArray(r,e));let o=[...n.data].map((e,t)=>a.type._parseSync(new ParseInputLazyPath(n,e,n.path,t)));return ParseStatus.mergeArray(r,o)}get element(){return this._def.type}min(e,t){return new ZodArray({...this._def,minLength:{value:e,message:errorUtil.toString(t)}})}max(e,t){return new ZodArray({...this._def,maxLength:{value:e,message:errorUtil.toString(t)}})}length(e,t){return new ZodArray({...this._def,exactLength:{value:e,message:errorUtil.toString(t)}})}nonempty(e){return this.min(1,e)}};ZodArray.create=(e,t)=>new ZodArray({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(t)});function deepPartialify(e){if(e instanceof ZodObject){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=ZodOptional.create(deepPartialify(r))}return new ZodObject({...e._def,shape:()=>t})}else if(e instanceof ZodArray)return new ZodArray({...e._def,type:deepPartialify(e.element)});else if(e instanceof ZodOptional)return ZodOptional.create(deepPartialify(e.unwrap()));else if(e instanceof ZodNullable)return ZodNullable.create(deepPartialify(e.unwrap()));else if(e instanceof ZodTuple)return ZodTuple.create(e.items.map(e=>deepPartialify(e)));else return e}var ZodObject=class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=util.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(t){if(this._getType(t)!==ZodParsedType.object){let n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:n.parsedType}),INVALID}let{status:n,ctx:r}=this._processInputParams(t),{shape:a,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys===`strip`))for(let e in r.data)o.includes(e)||s.push(e);let c=[];for(let e of o){let t=a[e],n=r.data[e];c.push({key:{status:`valid`,value:e},value:t._parse(new ParseInputLazyPath(r,n,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof ZodNever){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of s)c.push({key:{status:`valid`,value:e},value:{status:`valid`,value:r.data[e]}});else if(e===`strict`)s.length>0&&(addIssueToContext(r,{code:ZodIssueCode.unrecognized_keys,keys:s}),n.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of s){let n=r.data[t];c.push({key:{status:`valid`,value:t},value:e._parse(new ParseInputLazyPath(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of c){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>ParseStatus.mergeObjectSync(n,e)):ParseStatus.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:`strict`,...e===void 0?{}:{errorMap:(t,n)=>{let r=this._def.errorMap?.(t,n).message??n.defaultError;return t.code===`unrecognized_keys`?{message:errorUtil.errToObj(e).message??r}:{message:r}}}})}strip(){return new ZodObject({...this._def,unknownKeys:`strip`})}passthrough(){return new ZodObject({...this._def,unknownKeys:`passthrough`})}extend(e){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ZodObject({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ZodObject({...this._def,catchall:e})}pick(e){let t={};for(let r of util.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new ZodObject({...this._def,shape:()=>t})}omit(e){let t={};for(let r of util.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new ZodObject({...this._def,shape:()=>t})}deepPartial(){return deepPartialify(this)}partial(e){let t={};for(let r of util.objectKeys(this.shape)){let n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}return new ZodObject({...this._def,shape:()=>t})}required(e){let t={};for(let r of util.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof ZodOptional;)e=e._def.innerType;t[r]=e}return new ZodObject({...this._def,shape:()=>t})}keyof(){return createZodEnum(util.objectKeys(this.shape))}};ZodObject.create=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:`strip`,catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)}),ZodObject.strictCreate=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:`strict`,catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)}),ZodObject.lazycreate=(e,t)=>new ZodObject({shape:e,unknownKeys:`strip`,catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)});var ZodUnion=class extends ZodType{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function handleResults(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new ZodError(e.ctx.common.issues));return addIssueToContext(t,{code:ZodIssueCode.invalid_union,unionErrors:n}),INVALID}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(handleResults);{let e,a=[];for(let r of n){let n={...t,common:{...t.common,issues:[]},parent:null},i=r._parseSync({data:t.data,path:t.path,parent:n});if(i.status===`valid`)return i;i.status===`dirty`&&!e&&(e={result:i,ctx:n}),n.common.issues.length&&a.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let o=a.map(e=>new ZodError(e));return addIssueToContext(t,{code:ZodIssueCode.invalid_union,unionErrors:o}),INVALID}}get options(){return this._def.options}};ZodUnion.create=(e,t)=>new ZodUnion({options:e,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(t)});const getDiscriminator=e=>e instanceof ZodLazy?getDiscriminator(e.schema):e instanceof ZodEffects?getDiscriminator(e.innerType()):e instanceof ZodLiteral?[e.value]:e instanceof ZodEnum?e.options:e instanceof ZodNativeEnum?util.objectValues(e.enum):e instanceof ZodDefault?getDiscriminator(e._def.innerType):e instanceof ZodUndefined?[void 0]:e instanceof ZodNull?[null]:e instanceof ZodOptional?[void 0,...getDiscriminator(e.unwrap())]:e instanceof ZodNullable?[null,...getDiscriminator(e.unwrap())]:e instanceof ZodBranded||e instanceof ZodReadonly?getDiscriminator(e.unwrap()):e instanceof ZodCatch?getDiscriminator(e._def.innerType):[];var ZodDiscriminatedUnion=class ZodDiscriminatedUnion extends ZodType{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==ZodParsedType.object)return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:n.parsedType}),INVALID;let r=this.discriminator,a=n.data[r],o=this.optionsMap.get(a);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(addIssueToContext(n,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let r=new Map;for(let n of t){let t=getDiscriminator(n.shape[e]);if(!t.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of t){if(r.has(i))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);r.set(i,n)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...processCreateParams(n)})}};function mergeValues(r,i){let a=getParsedType(r),o=getParsedType(i);if(r===i)return{valid:!0,data:r};if(a===ZodParsedType.object&&o===ZodParsedType.object){let e=util.objectKeys(i),t=util.objectKeys(r).filter(t=>e.indexOf(t)!==-1),a={...r,...i};for(let e of t){let t=mergeValues(r[e],i[e]);if(!t.valid)return{valid:!1};a[e]=t.data}return{valid:!0,data:a}}else if(a===ZodParsedType.array&&o===ZodParsedType.array){if(r.length!==i.length)return{valid:!1};let e=[];for(let t=0;t<r.length;t++){let n=r[t],a=i[t],o=mergeValues(n,a);if(!o.valid)return{valid:!1};e.push(o.data)}return{valid:!0,data:e}}else if(a===ZodParsedType.date&&o===ZodParsedType.date&&+r==+i)return{valid:!0,data:r};else return{valid:!1}}var ZodIntersection=class extends ZodType{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),handleParsed=(e,r)=>{if(isAborted(e)||isAborted(r))return INVALID;let a=mergeValues(e.value,r.value);return a.valid?((isDirty(e)||isDirty(r))&&t.dirty(),{status:t.value,value:a.data}):(addIssueToContext(n,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>handleParsed(e,t)):handleParsed(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};ZodIntersection.create=(e,t,n)=>new ZodIntersection({left:e,right:t,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams(n)});var ZodTuple=class ZodTuple extends ZodType{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ZodParsedType.array)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:r.parsedType}),INVALID;if(r.data.length<this._def.items.length)return addIssueToContext(r,{code:ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),INVALID;!this._def.rest&&r.data.length>this._def.items.length&&(addIssueToContext(r,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),n.dirty());let a=[...r.data].map((e,t)=>{let n=this._def.items[t]||this._def.rest;return n?n._parse(new ParseInputLazyPath(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(a).then(e=>ParseStatus.mergeArray(n,e)):ParseStatus.mergeArray(n,a)}get items(){return this._def.items}rest(e){return new ZodTuple({...this._def,rest:e})}};ZodTuple.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new ZodTuple({items:e,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(t)})};var ZodRecord=class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ZodParsedType.object)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:r.parsedType}),INVALID;let a=[],o=this._def.keyType,s=this._def.valueType;for(let e in r.data)a.push({key:o._parse(new ParseInputLazyPath(r,e,r.path,e)),value:s._parse(new ParseInputLazyPath(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?ParseStatus.mergeObjectAsync(n,a):ParseStatus.mergeObjectSync(n,a)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof ZodType?new ZodRecord({keyType:e,valueType:t,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(n)}):new ZodRecord({keyType:ZodString.create(),valueType:e,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(t)})}},ZodMap=class extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ZodParsedType.map)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:r.parsedType}),INVALID;let a=this._def.keyType,o=this._def.valueType,s=[...r.data.entries()].map(([e,t],n)=>({key:a._parse(new ParseInputLazyPath(r,e,r.path,[n,`key`])),value:o._parse(new ParseInputLazyPath(r,t,r.path,[n,`value`]))}));if(r.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let t of s){let r=await t.key,i=await t.value;if(r.status===`aborted`||i.status===`aborted`)return INVALID;(r.status===`dirty`||i.status===`dirty`)&&n.dirty(),e.set(r.value,i.value)}return{status:n.value,value:e}})}else{let e=new Map;for(let t of s){let r=t.key,i=t.value;if(r.status===`aborted`||i.status===`aborted`)return INVALID;(r.status===`dirty`||i.status===`dirty`)&&n.dirty(),e.set(r.value,i.value)}return{status:n.value,value:e}}}};ZodMap.create=(e,t,n)=>new ZodMap({valueType:t,keyType:e,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams(n)});var ZodSet=class ZodSet extends ZodType{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ZodParsedType.set)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:r.parsedType}),INVALID;let a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(addIssueToContext(r,{code:ZodIssueCode.too_small,minimum:a.minSize.value,type:`set`,inclusive:!0,exact:!1,message:a.minSize.message}),n.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(addIssueToContext(r,{code:ZodIssueCode.too_big,maximum:a.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:a.maxSize.message}),n.dirty());let o=this._def.valueType;function finalizeSet(e){let t=new Set;for(let r of e){if(r.status===`aborted`)return INVALID;r.status===`dirty`&&n.dirty(),t.add(r.value)}return{status:n.value,value:t}}let s=[...r.data.values()].map((e,t)=>o._parse(new ParseInputLazyPath(r,e,r.path,t)));return r.common.async?Promise.all(s).then(e=>finalizeSet(e)):finalizeSet(s)}min(e,t){return new ZodSet({...this._def,minSize:{value:e,message:errorUtil.toString(t)}})}max(e,t){return new ZodSet({...this._def,maxSize:{value:e,message:errorUtil.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};ZodSet.create=(e,t)=>new ZodSet({valueType:e,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(t)});var ZodFunction=class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==ZodParsedType.function)return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:n.parsedType}),INVALID;function makeArgsIssue(e,t){return makeIssue({data:e,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,getErrorMap(),errorMap].filter(e=>!!e),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:t}})}function makeReturnsIssue(e,t){return makeIssue({data:e,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,getErrorMap(),errorMap].filter(e=>!!e),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:t}})}let s={errorMap:n.common.contextualErrorMap},l=n.data;if(this._def.returns instanceof ZodPromise){let e=this;return OK(async function(...t){let n=new ZodError([]),i=await e._def.args.parseAsync(t,s).catch(e=>{throw n.addIssue(makeArgsIssue(t,e)),n}),a=await Reflect.apply(l,this,i);return await e._def.returns._def.type.parseAsync(a,s).catch(e=>{throw n.addIssue(makeReturnsIssue(a,e)),n})})}else{let e=this;return OK(function(...t){let n=e._def.args.safeParse(t,s);if(!n.success)throw new ZodError([makeArgsIssue(t,n.error)]);let i=Reflect.apply(l,this,n.data),a=e._def.returns.safeParse(i,s);if(!a.success)throw new ZodError([makeReturnsIssue(i,a.error)]);return a.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ZodFunction({...this._def,args:ZodTuple.create(e).rest(ZodUnknown.create())})}returns(e){return new ZodFunction({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new ZodFunction({args:e||ZodTuple.create([]).rest(ZodUnknown.create()),returns:t||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(n)})}},ZodLazy=class extends ZodType{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})}};ZodLazy.create=(e,t)=>new ZodLazy({getter:e,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(t)});var ZodLiteral=class extends ZodType{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return addIssueToContext(t,{received:t.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:`valid`,value:e.data}}get value(){return this._def.value}};ZodLiteral.create=(e,t)=>new ZodLiteral({value:e,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(t)});function createZodEnum(e,t){return new ZodEnum({values:e,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(t)})}var ZodEnum=class ZodEnum extends ZodType{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),r=this._def.values;return addIssueToContext(t,{expected:util.joinValues(r),received:t.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return addIssueToContext(t,{received:t.data,code:ZodIssueCode.invalid_enum_value,options:n}),INVALID}return 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 ZodEnum.create(e,{...this._def,...t})}exclude(e,t=this._def){return ZodEnum.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}};ZodEnum.create=createZodEnum;var ZodNativeEnum=class extends ZodType{_parse(t){let r=util.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(t);if(a.parsedType!==ZodParsedType.string&&a.parsedType!==ZodParsedType.number){let e=util.objectValues(r);return addIssueToContext(a,{expected:util.joinValues(e),received:a.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(this._cache||=new Set(util.getValidEnumValues(this._def.values)),!this._cache.has(t.data)){let e=util.objectValues(r);return addIssueToContext(a,{received:a.data,code:ZodIssueCode.invalid_enum_value,options:e}),INVALID}return OK(t.data)}get enum(){return this._def.values}};ZodNativeEnum.create=(e,t)=>new ZodNativeEnum({values:e,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(t)});var ZodPromise=class extends ZodType{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);return n.parsedType!==ZodParsedType.promise&&n.common.async===!1?(addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:n.parsedType}),INVALID):OK((n.parsedType===ZodParsedType.promise?n.data:Promise.resolve(n.data)).then(e=>this._def.type.parseAsync(e,{path:n.path,errorMap:n.common.contextualErrorMap})))}};ZodPromise.create=(e,t)=>new ZodPromise({type:e,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(t)});var ZodEffects=class extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),i=this._def.effect||null,a={addIssue:e=>{addIssueToContext(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),i.type===`preprocess`){let e=i.transform(r.data,a);if(r.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return INVALID;let n=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return n.status===`aborted`?INVALID:n.status===`dirty`||t.value===`dirty`?DIRTY(n.value):n});{if(t.value===`aborted`)return INVALID;let n=this._def.schema._parseSync({data:e,path:r.path,parent:r});return n.status===`aborted`?INVALID:n.status===`dirty`||t.value===`dirty`?DIRTY(n.value):n}}if(i.type===`refinement`){let executeRefinement=e=>{let t=i.refinement(e,a);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(r.common.async===!1){let e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return e.status===`aborted`?INVALID:(e.status===`dirty`&&t.dirty(),executeRefinement(e.value),{status:t.value,value:e.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>e.status===`aborted`?INVALID:(e.status===`dirty`&&t.dirty(),executeRefinement(e.value).then(()=>({status:t.value,value:e.value}))))}if(i.type===`transform`)if(r.common.async===!1){let e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!isValid(e))return INVALID;let n=i.transform(e.value,a);if(n instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:n}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>isValid(e)?Promise.resolve(i.transform(e.value,a)).then(e=>({status:t.value,value:e})):INVALID);util.assertNever(i)}};ZodEffects.create=(e,t,n)=>new ZodEffects({schema:e,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:t,...processCreateParams(n)}),ZodEffects.createWithPreprocess=(e,t,n)=>new ZodEffects({schema:t,effect:{type:`preprocess`,transform:e},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams(n)});var ZodOptional=class extends ZodType{_parse(t){return this._getType(t)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};ZodOptional.create=(e,t)=>new ZodOptional({innerType:e,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(t)});var ZodNullable=class extends ZodType{_parse(t){return this._getType(t)===ZodParsedType.null?OK(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};ZodNullable.create=(e,t)=>new ZodNullable({innerType:e,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(t)});var ZodDefault=class extends ZodType{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return n.parsedType===ZodParsedType.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};ZodDefault.create=(e,t)=>new ZodDefault({innerType:e,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...processCreateParams(t)});var ZodCatch=class extends ZodType{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return isAsync(i)?i.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new ZodError(n.common.issues)},input:n.data})})):{status:`valid`,value:i.status===`valid`?i.value:this._def.catchValue({get error(){return new ZodError(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};ZodCatch.create=(e,t)=>new ZodCatch({innerType:e,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...processCreateParams(t)});var ZodNaN=class extends ZodType{_parse(t){if(this._getType(t)!==ZodParsedType.nan){let n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:n.parsedType}),INVALID}return{status:`valid`,value:t.data}}};ZodNaN.create=e=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(e)});const BRAND=Symbol(`zod_brand`);var ZodBranded=class extends ZodType{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},ZodPipeline=class ZodPipeline extends ZodType{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?INVALID:e.status===`dirty`?(t.dirty(),DIRTY(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?INVALID:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new ZodPipeline({in:e,out:t,typeName:ZodFirstPartyTypeKind.ZodPipeline})}},ZodReadonly=class extends ZodType{_parse(e){let t=this._def.innerType._parse(e),freeze=e=>(isValid(e)&&(e.value=Object.freeze(e.value)),e);return isAsync(t)?t.then(e=>freeze(e)):freeze(t)}unwrap(){return this._def.innerType}};ZodReadonly.create=(e,t)=>new ZodReadonly({innerType:e,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(t)});function cleanParams(e,t){let n=typeof e==`function`?e(t):typeof e==`string`?{message:e}:e;return typeof n==`string`?{message:n}:n}function custom(e,t={},n){return e?ZodAny.create().superRefine((r,i)=>{let a=e(r);if(a instanceof Promise)return a.then(e=>{if(!e){let e=cleanParams(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}});if(!a){let e=cleanParams(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}}):ZodAny.create()}const late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(ZodFirstPartyTypeKind||={});const instanceOfType=(e,t={message:`Input not instance of ${e.name}`})=>custom(t=>t instanceof e,t),stringType=ZodString.create,numberType=ZodNumber.create,nanType=ZodNaN.create,bigIntType=ZodBigInt.create,booleanType=ZodBoolean.create,dateType=ZodDate.create,symbolType=ZodSymbol.create,undefinedType=ZodUndefined.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,neverType=ZodNever.create,voidType=ZodVoid.create,arrayType=ZodArray.create,objectType=ZodObject.create,strictObjectType=ZodObject.strictCreate,unionType=ZodUnion.create,discriminatedUnionType=ZodDiscriminatedUnion.create,intersectionType=ZodIntersection.create,tupleType=ZodTuple.create,recordType=ZodRecord.create,mapType=ZodMap.create,setType=ZodSet.create,functionType=ZodFunction.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,nativeEnumType=ZodNativeEnum.create,promiseType=ZodPromise.create,effectsType=ZodEffects.create,optionalType=ZodOptional.create,nullableType=ZodNullable.create,preprocessType=ZodEffects.createWithPreprocess,pipelineType=ZodPipeline.create,ostring=()=>stringType().optional(),onumber=()=>numberType().optional(),oboolean=()=>booleanType().optional(),coerce={string:(e=>ZodString.create({...e,coerce:!0})),number:(e=>ZodNumber.create({...e,coerce:!0})),boolean:(e=>ZodBoolean.create({...e,coerce:!0})),bigint:(e=>ZodBigInt.create({...e,coerce:!0})),date:(e=>ZodDate.create({...e,coerce:!0}))},NEVER=INVALID;export{BRAND,NEVER,ZodAny,ZodArray,ZodBigInt,ZodBoolean,ZodBranded,ZodCatch,ZodDate,ZodDefault,ZodDiscriminatedUnion,ZodEffects,ZodEnum,ZodFirstPartyTypeKind,ZodFunction,ZodIntersection,ZodLazy,ZodLiteral,ZodMap,ZodNaN,ZodNativeEnum,ZodNever,ZodNull,ZodNullable,ZodNumber,ZodObject,ZodOptional,ZodPipeline,ZodPromise,ZodReadonly,ZodRecord,ZodSet,ZodString,ZodSymbol,ZodTuple,ZodType,ZodUndefined,ZodUnion,ZodUnknown,ZodVoid,anyType,arrayType,bigIntType,booleanType,coerce,custom,dateType,datetimeRegex,discriminatedUnionType,effectsType,enumType,functionType,instanceOfType,intersectionType,late,lazyType,literalType,mapType,nanType,nativeEnumType,neverType,nullType,nullableType,numberType,objectType,oboolean,onumber,optionalType,ostring,pipelineType,preprocessType,promiseType,recordType,setType,strictObjectType,stringType,symbolType,tupleType,undefinedType,unionType,unknownType,voidType};
|
|
@@ -1,45 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Card → Slack Block Kit converter.
|
|
3
|
-
*
|
|
4
|
-
* The chat SDK's Slack adapter used to walk the cross-platform
|
|
5
|
-
* `CardElement` AST (the data shape produced by `Card({...})`,
|
|
6
|
-
* `Actions([...])`, `Button({...})`, etc.) and emit Slack Block Kit
|
|
7
|
-
* JSON for `chat.postMessage`. We replicate just that conversion here
|
|
8
|
-
* so authors can keep using the ergonomic card builders without the
|
|
9
|
-
* `@chat-adapter/slack` runtime.
|
|
10
|
-
*
|
|
11
|
-
* Supported shapes:
|
|
12
|
-
* Card → header + context + image header + children blocks
|
|
13
|
-
* TextElement → `section`/`context` (style: plain | bold | muted)
|
|
14
|
-
* ImageElement → `image` block
|
|
15
|
-
* DividerElement → `divider`
|
|
16
|
-
* ActionsElement → `actions` with buttons / link buttons /
|
|
17
|
-
* static_select / radio_buttons
|
|
18
|
-
* SectionElement → recurses into a sequence of blocks
|
|
19
|
-
* FieldsElement → `section` with fields
|
|
20
|
-
* LinkElement → `section` with a `<url|label>` mrkdwn
|
|
21
|
-
* TableElement → `section` with a mrkdwn approximation
|
|
22
|
-
* ButtonElement → `button` action element
|
|
23
|
-
* LinkButtonElement → `button` action element with `url`
|
|
24
|
-
*
|
|
25
|
-
* Anything else falls back to the chat SDK's
|
|
26
|
-
* `cardChildToFallbackText` (a string description) wrapped in a
|
|
27
|
-
* section block so the message is never silently dropped.
|
|
28
|
-
*/
|
|
29
1
|
import { type CardElement } from "#compiled/chat/index.js";
|
|
30
|
-
/**
|
|
31
|
-
* One Slack Block Kit block. Slack accepts a wide enum and adds new
|
|
32
|
-
* block types over time, so this type stays open-ended.
|
|
33
|
-
*/
|
|
2
|
+
/** A Slack Block Kit block emitted by {@link cardToBlocks}. */
|
|
34
3
|
export type BlockKitBlock = Record<string, unknown>;
|
|
35
|
-
/**
|
|
36
|
-
* Converts a {@link CardElement} into a list of Slack Block Kit blocks
|
|
37
|
-
* ready to pass to `chat.postMessage`'s `blocks` parameter.
|
|
38
|
-
*/
|
|
4
|
+
/** Converts a Chat SDK card into Slack Block Kit blocks. */
|
|
39
5
|
export declare function cardToBlocks(card: CardElement): BlockKitBlock[];
|
|
40
|
-
/**
|
|
41
|
-
* Best-effort fallback text for a card. `chat.postMessage` sends this
|
|
42
|
-
* as the `text` field so notifications and accessibility readers still
|
|
43
|
-
* see something meaningful.
|
|
44
|
-
*/
|
|
6
|
+
/** Creates the plain-text fallback used for notifications and accessibility. */
|
|
45
7
|
export declare function cardToFallbackText(card: CardElement): string;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import{cardChildToFallbackText}from"#compiled/chat/index.js";import{
|
|
2
|
-
`).trim()}function
|
|
3
|
-
`)}}}export{cardToBlocks,cardToFallbackText};
|
|
1
|
+
import{cardChildToFallbackText}from"#compiled/chat/index.js";import{cardToSlackBlocks}from"#compiled/@chat-adapter/slack/blocks.js";function cardToBlocks(e){return cardToSlackBlocks({...e,children:e.children.map(preserveLinkActionId)})}function cardToFallbackText(t){let n=[];t.title&&n.push(t.title),t.subtitle&&n.push(t.subtitle);for(let r of t.children){let t=cardChildToFallbackText(r);t&&n.push(t)}return n.join(`
|
|
2
|
+
`).trim()}function preserveLinkActionId(e){return e.type===`section`?{...e,children:e.children.map(preserveLinkActionId)}:e.type===`actions`?{...e,children:e.children.map(e=>e.type===`link-button`&&e.id===void 0?{...e,id:`link:${e.url}`}:e)}:e}export{cardToBlocks,cardToFallbackText};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createLogger,extractErrorId,formatErrorHint}from"#internal/logging.js";import{
|
|
2
|
-
`));await t.thread.post({blocks:e.requests.flatMap(renderInputRequestBlocks),text:
|
|
1
|
+
import{createLogger,extractErrorId,formatErrorHint}from"#internal/logging.js";import{buildSlackAuthContext}from"#public/channels/slack/auth.js";import{buildAuthCompletedText,buildAuthEphemeralBlocks,buildAuthRequiredPublicText,formatConnectionDisplayName}from"#public/channels/slack/connections.js";import{renderInputRequestBlocks}from"#public/channels/slack/hitl.js";import{truncateMessageText,truncateTypingStatus}from"#public/channels/slack/limits.js";const log=createLogger(`slack.defaults`);function defaultSlackAuth(e,t){let n=e.author;return n?buildSlackAuthContext({channelId:t.slack.channelId,fullName:n.fullName,isBot:n.isBot,teamId:e.teamId,threadTs:t.slack.threadTs,userId:n.userId,userName:n.userName}):null}async function defaultOnAppMention(e,t){return await e.thread.startTyping(`Thinking...`),{auth:defaultSlackAuth(t,e)}}async function defaultOnDirectMessage(e,t){return await e.thread.startTyping(`Thinking...`),{auth:defaultSlackAuth(t,e)}}function firstNonEmptyLine(e){for(let t of e.split(/\r?\n/u)){let e=t.trim();if(e.length>0)return e}}function defaultInputRequestedHandler(){return async(e,t,n)=>{if(e.requests.length===0)return;let r=truncateMessageText(e.requests.map(e=>e.prompt).join(`
|
|
2
|
+
`));await t.thread.post({blocks:e.requests.flatMap(renderInputRequestBlocks),text:r})}}const defaultEvents={async"turn.started"(e,t,n){t.state.pendingToolCallMessage=null,t.state.lastReasoningTypingAtMs=null,t.state.lastReasoningTypingStatus=null,await t.thread.startTyping(`Working...`)},async"reasoning.appended"(e,t,n){let r=firstNonEmptyLine(e.reasoningSoFar);if(r===void 0)return;let i=truncateTypingStatus(r),a=t.state.lastReasoningTypingStatus,o=a!=null&&i.startsWith(a)&&i.length>=a.length+4,s=Date.now(),c=t.state.lastReasoningTypingAtMs;if(!o&&c!=null){let e=s-c;if(e>=0&&e<5e3)return}await t.thread.startTyping(i),t.state.lastReasoningTypingAtMs=s,t.state.lastReasoningTypingStatus=i},async"actions.requested"(e,t,n){let r=t.state.pendingToolCallMessage;if(t.state.pendingToolCallMessage=null,r){await t.thread.startTyping(truncateTypingStatus(r));return}let i=e.actions.map(e=>e.kind===`tool-call`?e.toolName:e.kind);await t.thread.startTyping(truncateTypingStatus(`Running ${i.join(`, `)}...`))},async"message.completed"(e,t,n){if(e.finishReason===`tool-calls`){t.state.pendingToolCallMessage=e.message?firstNonEmptyLine(e.message)??null:null;return}t.state.pendingToolCallMessage=null,e.message&&await t.thread.post(e.message)},async"turn.failed"(e,r,i){let a=formatErrorHint(e),o=extractErrorId(e.details);await r.thread.post([`I hit an error while handling your request${a}.`,``,`Please try again, rephrase, or reach out if it keeps failing.`,...o?[``,`_Error id: \`${o}\`_`]:[]].join(`
|
|
3
3
|
`))},async"session.failed"(e,r){let i=formatErrorHint(e),a=extractErrorId(e.details);await r.thread.post([`This session couldn't recover from an error${i}.`,``,`Start a new thread to continue — I can't pick this one back up.`,...a?[``,`_Error id: \`${a}\`_`]:[]].join(`
|
|
4
|
-
`))},async"authorization.required"(e,t,n){let r=e.authorization?.displayName??formatConnectionDisplayName(e.name),i=t.state.triggeringUserId??null,
|
|
4
|
+
`))},async"authorization.required"(e,t,n){let r=e.authorization?.displayName??formatConnectionDisplayName(e.name),i=t.state.triggeringUserId??null,c=e.authorization?.url,l=t.state.pendingAuthMessageTs??{};if(l[e.name]===void 0){let n=buildAuthRequiredPublicText({displayName:r,hasUser:i!==null});try{let r=await t.thread.post(n);r.id&&(t.state.pendingAuthMessageTs={...l,[e.name]:r.id})}catch(t){log.error(`Slack auth public message delivery failed`,{name:e.name,error:t})}}if(i&&c){let n=e.authorization?.userCode;try{await t.thread.postEphemeral(i,{blocks:buildAuthEphemeralBlocks({displayName:r,url:c,userCode:n}),text:n?`Sign in with ${r}: ${c} (code: ${n})`:`Sign in with ${r}: ${c}`})}catch(t){log.error(`Slack auth ephemeral delivery failed`,{name:e.name,error:t})}}},async"authorization.completed"(e,t,n){let r=t.state.pendingAuthMessageTs??{},a=r[e.name];if(a===void 0)return;let o=buildAuthCompletedText({displayName:e.authorization?.displayName??formatConnectionDisplayName(e.name),outcome:e.outcome,reason:e.reason});try{await t.slack.request(`chat.update`,{channel:t.slack.channelId,ts:a,text:o})}catch(t){log.error(`Slack auth status edit failed`,{name:e.name,error:t})}let c={...r};delete c[e.name],t.state.pendingAuthMessageTs=c}};export{defaultEvents,defaultInputRequestedHandler,defaultOnAppMention,defaultOnDirectMessage,defaultSlackAuth};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function resolveDevelopmentClientOptions(e){return{host:e}}function resolveRemoteDevelopmentClientOptions(e){let t=new URL(e.serverUrl).origin;if(e.credentials.serverOrigin!==t)throw Error(`Credential gate origin ${e.credentials.serverOrigin} does not match client origin ${t}.`);return{headers:e.credentials.
|
|
1
|
+
function resolveDevelopmentClientOptions(e){return{host:e}}function resolveRemoteDevelopmentClientOptions(e){let t=new URL(e.serverUrl).origin;if(e.credentials.serverOrigin!==t)throw Error(`Credential gate origin ${e.credentials.serverOrigin} does not match client origin ${t}.`);return{auth:{vercelOidc:{token:()=>e.credentials.resolveToken()}},headers:e.credentials.resolveBypassHeaders,host:e.serverUrl,redirect:`manual`}}export{resolveDevelopmentClientOptions,resolveRemoteDevelopmentClientOptions};
|
|
@@ -2,17 +2,22 @@ import type { VerifiedVercelTarget } from "#setup/vercel-deployment.js";
|
|
|
2
2
|
import { type DevelopmentOidcTokenFailure, type DevelopmentOidcTokenResolution } from "./request-headers.js";
|
|
3
3
|
export interface DevelopmentCredentialGrant {
|
|
4
4
|
readonly target: VerifiedVercelTarget;
|
|
5
|
-
readonly resolveToken: () => Promise<DevelopmentOidcTokenResolution>;
|
|
5
|
+
readonly resolveToken: () => Promise<DevelopmentOidcTokenResolution | string>;
|
|
6
6
|
}
|
|
7
7
|
/** Per-client authority for resolving and emitting remote Vercel credentials. */
|
|
8
8
|
export interface DevelopmentCredentialGate {
|
|
9
9
|
/** The origin this gate is permanently bound to. */
|
|
10
10
|
readonly serverOrigin: string;
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Installs authority after Vercel verifies the exact origin.
|
|
13
|
+
* Returns a rollback that restores the prior grant if this grant is still current.
|
|
14
|
+
*/
|
|
15
|
+
authorize(grant: DevelopmentCredentialGrant): () => void;
|
|
16
|
+
/** The verified target's OIDC token for one request, or "" when unavailable. */
|
|
17
|
+
resolveToken(): Promise<string>;
|
|
18
|
+
/** Non-credential Vercel headers (protection bypass), or {} when anonymous. */
|
|
19
|
+
resolveBypassHeaders(): Promise<Readonly<Record<string, string>>>;
|
|
20
|
+
/** Token failure from the most recent {@link resolveToken}, or `undefined` if it resolved one. */
|
|
16
21
|
lastTokenFailure(): DevelopmentOidcTokenFailure | undefined;
|
|
17
22
|
}
|
|
18
23
|
/** Creates an anonymous credential gate bound to one client origin. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{VERCEL_PROTECTION_BYPASS_HEADER
|
|
1
|
+
import{VERCEL_PROTECTION_BYPASS_HEADER}from"./request-headers.js";function createDevelopmentCredentialGate(t){let n=new URL(t).origin,r={kind:`anonymous`},i;return{authorize:e=>{if(e.target.origin!==n)throw Error(`Verified Vercel origin ${e.target.origin} does not match client origin ${n}.`);let t=r,a=i,o={kind:`vercel`,resolveToken:e.resolveToken};return r=o,i=void 0,()=>{r===o&&(r=t,i=a)}},lastTokenFailure:()=>i,resolveBypassHeaders:async()=>{if(r.kind===`anonymous`)return{};let t=process.env.VERCEL_AUTOMATION_BYPASS_SECRET?.trim();return t?{[VERCEL_PROTECTION_BYPASS_HEADER]:t}:{}},resolveToken:async()=>{let e=r;if(e.kind===`anonymous`)return``;let t=await e.resolveToken(),n=typeof t==`string`||t.kind===`resolved`?void 0:t;return r===e&&(i=n),typeof t==`string`?t.trim():t.kind===`resolved`?t.token.trim():``},serverOrigin:n}}export{createDevelopmentCredentialGate};
|
|
@@ -41,16 +41,4 @@ export declare function resolveDevelopmentOidcToken(input: DevelopmentOidcTarget
|
|
|
41
41
|
* Automation token issued from Project Settings.
|
|
42
42
|
*/
|
|
43
43
|
export declare const VERCEL_PROTECTION_BYPASS_HEADER = "x-vercel-protection-bypass";
|
|
44
|
-
/**
|
|
45
|
-
* Vercel header used to bypass deployment protection by presenting a
|
|
46
|
-
* trusted OIDC token issued by Vercel for the linked project. When the
|
|
47
|
-
* CLI is `vercel link`-ed (or running inside a Vercel function), the
|
|
48
|
-
* platform mints an OIDC token whose audience and subject match the
|
|
49
|
-
* deployment, and accepts it as proof that the caller is authorized.
|
|
50
|
-
*
|
|
51
|
-
* This is preferred over {@link VERCEL_PROTECTION_BYPASS_HEADER} because
|
|
52
|
-
* it requires no per-project secret — the token is already available via
|
|
53
|
-
* `@vercel/oidc`.
|
|
54
|
-
*/
|
|
55
|
-
export declare const VERCEL_TRUSTED_OIDC_IDP_TOKEN_HEADER = "x-vercel-trusted-oidc-idp-token";
|
|
56
44
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{object,string}from"../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/schemas.js";import"../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/index.js";import{toErrorMessage}from"#shared/errors.js";import{getVercelOidcToken}from"#compiled/@vercel/oidc/index.js";const VercelOidcClaimsSchema=object({owner_id:string().min(1),project_id:string().min(1)});async function resolveDevelopmentOidcToken(e){try{return validateDevelopmentOidcToken((await getVercelOidcToken({team:e.ownerId,project:e.projectId})).trim(),e)}catch(e){return{kind:`resolution-failed`,message:toErrorMessage(e)}}}function validateDevelopmentOidcToken(e,t){let n=e.split(`.`)[1];if(!n)return{kind:`malformed-token`,reason:`missing-payload`};let r;try{r=JSON.parse(Buffer.from(n,`base64url`).toString(`utf8`))}catch{return{kind:`malformed-token`,reason:`invalid-json-payload`}}let i=VercelOidcClaimsSchema.safeParse(r);if(!i.success)return{kind:`invalid-claims`,invalidClaims:i.error.issues.map(e=>{let t=e.path[0];return t===`owner_id`||t===`project_id`?t:`claims`})};let a=[];return i.data.owner_id!==t.ownerId&&a.push(`owner_id`),i.data.project_id!==t.projectId&&a.push(`project_id`),a.length>0?{kind:`target-mismatch`,mismatchedClaims:a}:{kind:`resolved`,token:e}}const VERCEL_PROTECTION_BYPASS_HEADER=`x-vercel-protection-bypass
|
|
1
|
+
import{object,string}from"../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/schemas.js";import"../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/index.js";import{toErrorMessage}from"#shared/errors.js";import{getVercelOidcToken}from"#compiled/@vercel/oidc/index.js";const VercelOidcClaimsSchema=object({owner_id:string().min(1),project_id:string().min(1)});async function resolveDevelopmentOidcToken(e){try{return validateDevelopmentOidcToken((await getVercelOidcToken({team:e.ownerId,project:e.projectId})).trim(),e)}catch(e){return{kind:`resolution-failed`,message:toErrorMessage(e)}}}function validateDevelopmentOidcToken(e,t){let n=e.split(`.`)[1];if(!n)return{kind:`malformed-token`,reason:`missing-payload`};let r;try{r=JSON.parse(Buffer.from(n,`base64url`).toString(`utf8`))}catch{return{kind:`malformed-token`,reason:`invalid-json-payload`}}let i=VercelOidcClaimsSchema.safeParse(r);if(!i.success)return{kind:`invalid-claims`,invalidClaims:i.error.issues.map(e=>{let t=e.path[0];return t===`owner_id`||t===`project_id`?t:`claims`})};let a=[];return i.data.owner_id!==t.ownerId&&a.push(`owner_id`),i.data.project_id!==t.projectId&&a.push(`project_id`),a.length>0?{kind:`target-mismatch`,mismatchedClaims:a}:{kind:`resolved`,token:e}}const VERCEL_PROTECTION_BYPASS_HEADER=`x-vercel-protection-bypass`;export{VERCEL_PROTECTION_BYPASS_HEADER,resolveDevelopmentOidcToken};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ClientError}from"#client/client-error.js";const VERCEL_AUTH_CHALLENGE_MARKERS=[`vercel.com/sso-api`,`<title>Authentication Required</title>`,`Vercel Authentication`];function bodyLooksLikeVercelAuthChallenge(e){
|
|
1
|
+
import{isObject}from"#shared/guards.js";import{ClientError}from"#client/client-error.js";const VERCEL_AUTH_CHALLENGE_MARKERS=[`vercel.com/sso-api`,`<title>Authentication Required</title>`,`Vercel Authentication`];function bodyLooksLikeVercelAuthChallenge(e){return e.length>0&&VERCEL_AUTH_CHALLENGE_MARKERS.every(t=>e.includes(t))}function isVercelAuthChallenge(n){return n instanceof ClientError?n.status===401&&bodyLooksLikeVercelAuthChallenge(n.body):isObject(n)&&n.status===401&&typeof n.body==`string`&&bodyLooksLikeVercelAuthChallenge(n.body)}function formatVercelAuthChallengeMessage(e){let t=[`Vercel Deployment Protection blocked the request to ${e.serverUrl}.`];return e.oidcTokenFailure!==void 0&&t.push(``,formatOidcTokenFailure(e.oidcTokenFailure)),t.push(``,"To access the deployment from `eve dev`, do one of:"," • Run `vercel link` in this project so the CLI can mint an OIDC",` token for the deployment automatically.`,` • Set VERCEL_AUTOMATION_BYPASS_SECRET to a Protection Bypass for`,` Automation token (Project Settings → Deployment Protection).`,` • Disable Deployment Protection on the target deployment.`,``,`Docs: https://vercel.com/docs/deployment-protection`),t.join(`
|
|
2
2
|
`)}function formatOidcTokenFailure(e){switch(e.kind){case`resolution-failed`:return`The local Vercel OIDC token could not be resolved: ${e.message}`;case`malformed-token`:return e.reason===`missing-payload`?`Vercel returned a local OIDC token without a JWT payload.`:`Vercel returned a local OIDC token whose payload is not valid JSON.`;case`invalid-claims`:return`The local Vercel OIDC token has invalid claims: ${e.invalidClaims.join(`, `)}.`;case`target-mismatch`:return`The local Vercel OIDC token does not match the resolved deployment: ${e.mismatchedClaims.join(`, `)}.`;default:return e}}export{formatVercelAuthChallengeMessage,isVercelAuthChallenge};
|
|
@@ -3,7 +3,7 @@ import { type SelectModelDeps } from "../boxes/select-model.js";
|
|
|
3
3
|
import { type VercelProjectOperationOptions } from "../project-resolution.js";
|
|
4
4
|
import type { ModelRouting } from "#shared/agent-definition.js";
|
|
5
5
|
import type { Prompter } from "../prompter.js";
|
|
6
|
-
import {
|
|
6
|
+
import { runProviderFlow } from "./provider.js";
|
|
7
7
|
/** The current model id, its routing, and whether `/model` can rewrite it. */
|
|
8
8
|
export interface CurrentAgentModel {
|
|
9
9
|
id: string | null;
|
|
@@ -32,7 +32,7 @@ export interface ModelFlowDeps {
|
|
|
32
32
|
/** Reads how the model is backed right now, for the menu's provider row. */
|
|
33
33
|
detectProviderStatus: typeof detectModelProviderStatus;
|
|
34
34
|
/** The provider sub-flow behind the menu's provider row. */
|
|
35
|
-
|
|
35
|
+
runProviderFlow: typeof runProviderFlow;
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
38
|
* How the agent's model is backed right now, as far as the local directory
|
|
@@ -87,9 +87,9 @@ export declare function detectModelProviderStatus(appRoot: string, options?: Ver
|
|
|
87
87
|
* onboarding uses ({@link selectModel}), pre-selected on the model the
|
|
88
88
|
* runtime currently serves, then the static source edit that bakes the
|
|
89
89
|
* choice into `agent.ts` (activation is the dev server's HMR watcher).
|
|
90
|
-
* The provider row runs {@link
|
|
91
|
-
*
|
|
92
|
-
*
|
|
90
|
+
* The provider row runs {@link runProviderFlow}, whose single menu chooses a
|
|
91
|
+
* project-backed gateway, an inline gateway key, or an external provider.
|
|
92
|
+
* A completed model or provider change returns to the prompt with its result.
|
|
93
93
|
* Cancelled flows and external-provider instructions return to the menu.
|
|
94
94
|
*/
|
|
95
95
|
export declare function runModelFlow(input: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__toESM}from"../../_virtual/_rolldown/runtime.js";import{require_picocolors}from"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js";import{AI_GATEWAY_API_KEY_ENV_VAR}from"../ai-gateway-api-key.js";import{interactiveAsker}from"../ask.js";import{detectProjectIdentity}from"../project-resolution.js";import{snapshotSetupState}from"../state.js";import{WizardCancelledError}from"../step.js";import{withSpinner}from"../with-spinner.js";import{findEnvFileWithKey}from"../boxes/detect-ai-gateway.js";import{fetchGatewayCatalog,selectModel}from"../boxes/select-model.js";import{runInteractive}from"../runner.js";import{inProjectSetupState,prompterSink}from"./in-project.js";import{
|
|
1
|
+
import{__toESM}from"../../_virtual/_rolldown/runtime.js";import{require_picocolors}from"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js";import{AI_GATEWAY_API_KEY_ENV_VAR}from"../ai-gateway-api-key.js";import{interactiveAsker}from"../ask.js";import{detectProjectIdentity}from"../project-resolution.js";import{snapshotSetupState}from"../state.js";import{WizardCancelledError}from"../step.js";import{withSpinner}from"../with-spinner.js";import{findEnvFileWithKey}from"../boxes/detect-ai-gateway.js";import{fetchGatewayCatalog,selectModel}from"../boxes/select-model.js";import{runInteractive}from"../runner.js";import{inProjectSetupState,prompterSink}from"./in-project.js";import{runProviderFlow}from"./provider.js";import{join}from"node:path";import{discoverAgent}from"#discover/discover-agent.js";import{inspectApplication}from"#services/inspect-application.js";import{formatLanguageModelGatewayId}from"#internal/runtime-model.js";import{createCompiledRuntimeModelCatalogLoader}from"#compiler/model-catalog.js";import{createStaticSourceChange}from"#source-change/static-source-change.js";var import_picocolors=__toESM(require_picocolors(),1);const MODEL_MENU_MESSAGE=``;function providerStatusHint(e,t=e=>e){return e.kind===`gateway-project`?`AI Gateway (Linked to ${e.teamName===void 0?t(e.projectName):`${t(e.projectName)} in ${t(e.teamName)}`})`:`AI Gateway (${e.envKey} in ${e.envFile})`}function modelMenuRows(e,t,n,r){let i;r?(i={value:`model`,label:`Change model`,description:`The model your agent uses`},e!==null&&(i.hint=e)):i={value:`model`,label:`Change model`,disabled:!0,description:`Set via an SDK model call in agent.ts; edit the source to change it`};let a;return a=n?.kind===`external`?{disabled:!0,value:`provider`,label:`Change provider`,description:`Disabled in external endpoint mode`}:t.kind===`unset`?{value:`provider`,label:import_picocolors.default.bold(`Configure model access`),hint:import_picocolors.default.yellow(`Not configured`),description:`How your agent reaches the model provider`,accent:`warning`}:{value:`provider`,label:`Change provider`,hint:providerStatusHint(t,import_picocolors.default.bold),description:`How your agent reaches the model provider`},[i,a,{value:`done`,label:`Done`,description:`Return to the prompt`}]}async function detectModelProviderStatus(e,t={}){let[r,a,o]=await Promise.all([detectProjectIdentity(e,t),findEnvFileWithKey(e,AI_GATEWAY_API_KEY_ENV_VAR),findEnvFileWithKey(e,`VERCEL_OIDC_TOKEN`)]);if(r!==void 0){let e={kind:`gateway-project`,projectName:r.projectName};return r.teamName!==void 0&&(e.teamName=r.teamName),e}return a===void 0?o===void 0?{kind:`unset`}:{kind:`gateway-key`,envKey:`VERCEL_OIDC_TOKEN`,envFile:o}:{kind:`gateway-key`,envKey:AI_GATEWAY_API_KEY_ENV_VAR,envFile:a}}async function runModelFlow(e){let{appRoot:t,prompter:n,signal:r}=e,i={readCurrentModel:readCurrentAgentModel,applyModel:changeAgentModel,detectProviderStatus:detectModelProviderStatus,runProviderFlow,...e.deps},detectProvider=(e=!0)=>i.detectProviderStatus(t,e&&r!==void 0?{signal:r}:{}),[{id:a,routing:s,editable:c},l]=await withSpinner(n,`Checking the project…`,()=>Promise.all([i.readCurrentModel(t),detectProvider()]));r?.throwIfAborted();let u,d,f=s?.kind===`external`?{tone:`warning`,text:"`agent.ts` specifies a model provider directly. In-TUI configuration is restricted to AI Gateway endpoints."}:void 0,m=l.kind===`unset`&&s?.kind!==`external`?`provider`:c?`model`:s?.kind===`external`?`done`:`provider`,h=s?.kind!==`external`&&(e.initialStep===`provider`||l.kind===`unset`);for(;;){let e;if(h)h=!1,e=`provider`;else try{e=await n.select({message:``,options:modelMenuRows(a,l,s,c),hintLayout:`stacked`,initialValue:m,notices:f===void 0?[]:[f]})}catch(e){if(!(e instanceof WizardCancelledError))throw e;break}if(e===`done`)break;if(e===`model`){let e=await pickModelFromCatalog({appRoot:t,prompter:n,current:a,signal:r,deps:i.selectModel});if(e===void 0){m=`model`;continue}r?.throwIfAborted(),u=await i.applyModel({appRoot:t,slug:e}),r?.throwIfAborted();break}let p=await i.runProviderFlow({appRoot:t,prompter:n,signal:r});if(p.kind===`cancelled`){if(r?.aborted)return{kind:`cancelled`};m=`provider`;continue}if(p.kind===`external-provider`){if(r?.aborted)return{kind:`cancelled`};m=`done`;continue}l=await withSpinner(n,`Checking the project…`,()=>detectProvider(!1)),d={status:l},p.credential!==void 0&&(d.credential=p.credential);break}if(u===void 0&&d===void 0)return{kind:`cancelled`};let g={kind:`done`};return u!==void 0&&(g.modelMessage=formatApplyModelOutcome(u)),d!==void 0&&(g.providerOutcome=d),g}async function pickModelFromCatalog(e){let{appRoot:t,prompter:n,current:i,signal:o}=e,s=e.deps?.fetchModels??fetchGatewayCatalog,p={asker:interactiveAsker(n),deps:{fetchModels:e=>withSpinner(n,`Loading the model catalog...`,()=>s(e))}};i!==null&&(p.defaultModel=i);let m=await runInteractive([selectModel(p)],inProjectSetupState(t,{kind:`unresolved`}),prompterSink(n),{snapshot:snapshotSetupState,signal:o});return m.kind===`cancelled`?void 0:m.state.modelId}function formatApplyModelOutcome(e){switch(e.kind){case`changed`:return`Model changed to ${import_picocolors.default.bold(e.to)}. Live on your next prompt.`;case`unchanged`:return`Model is already \`${e.model}\`.`;case`rejected`:return e.message}}async function changeAgentModel(e){let{appRoot:t,slug:n}=e,r=await validateModelSlug(t,n);if(r!==null)return{kind:`rejected`,message:r};let{manifest:i}=await discoverAgent({agentRoot:join(t,`agent`),appRoot:t}),a=await createStaticSourceChange(i).updateModelName(n);return a.kind===`bail`?{kind:`rejected`,message:`Couldn't edit ${a.at.logicalPath}: ${a.reason}. Change \`model\` by hand.`}:a.from===a.to?{kind:`unchanged`,model:a.to}:{kind:`changed`,to:a.to}}async function validateModelSlug(e,t){if(!t.includes(`/`))return`\`${t}\` isn't a provider/model id (e.g. anthropic/claude-sonnet-4.6).`;let n=createCompiledRuntimeModelCatalogLoader(e);try{if(await n.getModelLimits(formatLanguageModelGatewayId(t))===null)return`I couldn't confirm \`${t}\` in the AI Gateway model catalog, so I didn't change agent.ts.`}catch{return null}return null}async function readCurrentAgentModel(e){try{let{compiledState:t}=await inspectApplication(e),n=t?.manifest.config.model;return{id:n?.id??null,routing:n?.routing??null,editable:n!==void 0&&n.source===void 0}}catch{return{id:null,routing:null,editable:!1}}}async function modelChangeRefusalForUneditableModel(e){let{editable:t,routing:n}=await readCurrentAgentModel(e);return t?null:`Model is set via ${n?.kind===`external`?`the external provider \`${n.provider}\``:`an SDK model call`} in agent.ts, not a string literal; /model can't rewrite it. Edit \`model\` in agent.ts.`}export{MODEL_MENU_MESSAGE,changeAgentModel,detectModelProviderStatus,formatApplyModelOutcome,modelChangeRefusalForUneditableModel,runModelFlow};
|