eve 0.13.0 → 0.13.2

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.
Files changed (85) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/src/chunks/use-eve-agent-B18LYpfZ.js +5765 -0
  3. package/dist/src/chunks/use-eve-agent-BPI1nbo5.js +5795 -0
  4. package/dist/src/cli/dev/tui/provider-picker.d.ts +64 -0
  5. package/dist/src/cli/dev/tui/provider-picker.js +1 -0
  6. package/dist/src/cli/dev/tui/remote-auth-result.d.ts +21 -0
  7. package/dist/src/cli/dev/tui/remote-auth-result.js +1 -0
  8. package/dist/src/cli/dev/tui/remote-connection-probe.d.ts +9 -0
  9. package/dist/src/cli/dev/tui/remote-connection-probe.js +1 -0
  10. package/dist/src/cli/dev/tui/remote-connection-types.d.ts +67 -0
  11. package/dist/src/cli/dev/tui/remote-connection-types.js +1 -0
  12. package/dist/src/cli/dev/tui/remote-connection.d.ts +3 -0
  13. package/dist/src/cli/dev/tui/remote-connection.js +1 -0
  14. package/dist/src/cli/dev/tui/runner.js +1 -1
  15. package/dist/src/cli/dev/tui/setup-commands.d.ts +1 -1
  16. package/dist/src/cli/dev/tui/setup-commands.js +2 -2
  17. package/dist/src/cli/dev/tui/setup-flow.d.ts +3 -0
  18. package/dist/src/cli/dev/tui/setup-issues.d.ts +7 -0
  19. package/dist/src/cli/dev/tui/setup-issues.js +1 -1
  20. package/dist/src/cli/dev/tui/setup-panel.d.ts +25 -12
  21. package/dist/src/cli/dev/tui/setup-panel.js +3 -2
  22. package/dist/src/cli/dev/tui/target.d.ts +2 -0
  23. package/dist/src/cli/dev/tui/target.js +1 -1
  24. package/dist/src/cli/dev/tui/terminal-renderer.js +9 -9
  25. package/dist/src/cli/dev/tui/test/fake-setup-flow-renderer.js +1 -1
  26. package/dist/src/cli/dev/tui/tui.js +1 -1
  27. package/dist/src/cli/dev/tui/vercel-trusted-sources-policy.d.ts +22 -0
  28. package/dist/src/cli/dev/tui/vercel-trusted-sources-policy.js +1 -0
  29. package/dist/src/cli/dev/tui/vercel-trusted-sources.d.ts +48 -0
  30. package/dist/src/cli/dev/tui/vercel-trusted-sources.js +1 -0
  31. package/dist/src/client/agent-info-schema.d.ts +532 -0
  32. package/dist/src/client/agent-info-schema.js +1 -0
  33. package/dist/src/client/client.js +1 -1
  34. package/dist/src/client/types.d.ts +11 -169
  35. package/dist/src/client/types.js +1 -1
  36. package/dist/src/execution/durable-session-store.d.ts +3 -2
  37. package/dist/src/execution/session.d.ts +4 -10
  38. package/dist/src/execution/session.js +2 -2
  39. package/dist/src/execution/workflow-steps.js +1 -1
  40. package/dist/src/internal/application/package.js +1 -1
  41. package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.1/node_modules/@vercel/sdk/esm/lib/primitives.js +1 -0
  42. package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.1/node_modules/@vercel/sdk/esm/lib/schemas.js +1 -0
  43. package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.1/node_modules/@vercel/sdk/esm/models/aclaction.js +1 -0
  44. package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.1/node_modules/@vercel/sdk/esm/models/sdkvalidationerror.js +1 -0
  45. package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.1/node_modules/@vercel/sdk/esm/models/updateprojectprojectsaction.js +1 -0
  46. package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.1/node_modules/@vercel/sdk/esm/models/updateprojectprojectsoptionsallowlist.js +1 -0
  47. package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.1/node_modules/@vercel/sdk/esm/types/defaultToZeroValue.js +1 -0
  48. package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.1/node_modules/@vercel/sdk/esm/types/fp.js +1 -0
  49. package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.1/node_modules/@vercel/sdk/esm/types/primitives.js +1 -0
  50. package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.1/node_modules/@vercel/sdk/esm/types/rfcdate.js +1 -0
  51. package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.1/node_modules/@vercel/sdk/esm/types/smartUnion.js +1 -0
  52. package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.1/node_modules/@vercel/sdk/esm/types/unrecognized.js +1 -0
  53. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/ZodError.js +1 -0
  54. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/errors.js +1 -0
  55. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/external.js +1 -0
  56. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/helpers/errorUtil.js +1 -0
  57. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/helpers/parseUtil.js +1 -0
  58. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/helpers/typeAliases.js +1 -0
  59. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/helpers/util.js +1 -0
  60. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/index.js +1 -0
  61. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/locales/en.js +1 -0
  62. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/types.js +1 -0
  63. package/dist/src/services/dev-client/client-options.js +1 -1
  64. package/dist/src/services/dev-client/credential-gate.d.ts +11 -6
  65. package/dist/src/services/dev-client/credential-gate.js +1 -1
  66. package/dist/src/services/dev-client/request-headers.d.ts +0 -12
  67. package/dist/src/services/dev-client/request-headers.js +1 -1
  68. package/dist/src/services/dev-client/vercel-auth-error.js +1 -1
  69. package/dist/src/setup/flows/model.d.ts +5 -5
  70. package/dist/src/setup/flows/model.js +1 -1
  71. package/dist/src/setup/flows/provider.d.ts +57 -0
  72. package/dist/src/setup/flows/provider.js +4 -0
  73. package/dist/src/setup/scaffold/create/project.js +1 -1
  74. package/dist/src/svelte/index.js +1 -1
  75. package/dist/src/svelte/use-eve-agent.js +1 -1
  76. package/dist/src/vue/index.js +1 -1
  77. package/dist/src/vue/use-eve-agent.js +1 -1
  78. package/docs/concepts/execution-model-and-durability.md +2 -0
  79. package/docs/guides/client/overview.mdx +24 -0
  80. package/docs/guides/dev-tui.md +4 -4
  81. package/package.json +2 -1
  82. package/dist/src/chunks/use-eve-agent-DEm_Jg4k.js +0 -1343
  83. package/dist/src/chunks/use-eve-agent-DsXOQMFZ.js +0 -1313
  84. package/dist/src/setup/flows/vercel.d.ts +0 -37
  85. package/dist/src/setup/flows/vercel.js +0 -2
@@ -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
+ 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 +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.resolveHeaders,host:e.serverUrl,redirect:`manual`}}export{resolveDevelopmentClientOptions,resolveRemoteDevelopmentClientOptions};
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
- /** Installs authority after Vercel verifies the exact origin. */
12
- authorize(grant: DevelopmentCredentialGrant): void;
13
- /** Resolves headers for one request. */
14
- resolveHeaders(): Promise<Readonly<Record<string, string>>>;
15
- /** Token failure from the most recent {@link resolveHeaders}, or `undefined` if it resolved one. */
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,VERCEL_TRUSTED_OIDC_IDP_TOKEN_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}.`);r={kind:`vercel`,resolveToken:e.resolveToken}},resolveHeaders:async()=>{let t=r;if(t.kind===`anonymous`)return{};let n={},a=process.env.VERCEL_AUTOMATION_BYPASS_SECRET?.trim();a&&(n[VERCEL_PROTECTION_BYPASS_HEADER]=a);let o=await t.resolveToken();if(i=o.kind===`resolved`?void 0:o,o.kind!==`resolved`)return n;let s=o.token.trim();return s.length>0&&(n.authorization=`Bearer ${s}`,n[VERCEL_TRUSTED_OIDC_IDP_TOKEN_HEADER]=s),n},serverOrigin:n,lastTokenFailure:()=>i}}export{createDevelopmentCredentialGate};
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`,VERCEL_TRUSTED_OIDC_IDP_TOKEN_HEADER=`x-vercel-trusted-oidc-idp-token`;export{VERCEL_PROTECTION_BYPASS_HEADER,VERCEL_TRUSTED_OIDC_IDP_TOKEN_HEADER,resolveDevelopmentOidcToken};
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){if(e.length===0)return!1;for(let n of VERCEL_AUTH_CHALLENGE_MARKERS)if(e.includes(n))return!0;return!1}function isVercelAuthChallenge(t){return t instanceof ClientError||typeof t==`object`&&t&&`body`in t&&typeof t.body==`string`?bodyLooksLikeVercelAuthChallenge(t.body):!1}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(`
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 { runVercelFlow } from "./vercel.js";
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
- runVercelFlow: typeof runVercelFlow;
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 runVercelFlow} the provider gate (AI
91
- * Gateway or your own), then link-or-paste-a-key.
92
- * Completed model and provider changes return to the prompt with their result.
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{runVercelFlow}from"./vercel.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`},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`?{value:`provider`,label:`Change provider`,disabled:!0,description:`Disabled in external endpoint mode`}:t.kind===`unset`?{value:`provider`,label:import_picocolors.default.bold(import_picocolors.default.yellow(`Configure provider`)),hint:`Required to enable the agent`,accent:`warning`}:{value:`provider`,label:`Change provider`,hint:providerStatusHint(t,import_picocolors.default.bold)},[i,a,{value:`done`,label:`Done`}]}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,runVercelFlow,...e.deps},detectProvider=()=>i.detectProviderStatus(t,{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.runVercelFlow({appRoot:t,prompter:n,signal:r});if(r?.throwIfAborted(),p.kind===`cancelled`){m=`provider`;continue}if(`outcome`in p){m=`done`;continue}l=await withSpinner(n,`Checking the project…`,detectProvider),r?.throwIfAborted(),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};
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};
@@ -0,0 +1,57 @@
1
+ import { appendEnv } from "../append-env.js";
2
+ import type { Prompter, SelectOption } from "../prompter.js";
3
+ import { validateGatewayApiKey, type GatewayKeyValidation } from "../validate-gateway-key.js";
4
+ import { getVercelAuthStatus } from "../vercel-project.js";
5
+ import { runLinkFlow, type LinkFlowResult } from "./link.js";
6
+ export type ProviderConnection = "project" | "own-key" | "external";
7
+ export declare const PROVIDER_QUESTION = "Which model provider do you want to use?";
8
+ export declare const EXTERNAL_PROVIDER_INSTRUCTIONS_TITLE = "Using another model provider";
9
+ export declare const EXTERNAL_PROVIDER_INSTRUCTIONS: readonly string[];
10
+ /** Injected for tests; defaults to the real link flow, env write, and key check. */
11
+ export interface ProviderFlowDeps {
12
+ getVercelAuthStatus: typeof getVercelAuthStatus;
13
+ runLinkFlow: typeof runLinkFlow;
14
+ appendEnv: typeof appendEnv;
15
+ validateGatewayApiKey: typeof validateGatewayApiKey;
16
+ }
17
+ export type ProviderFlowResult = LinkFlowResult | {
18
+ kind: "external-provider";
19
+ };
20
+ type AcceptedGatewayKeyValidation = Exclude<GatewayKeyValidation, {
21
+ kind: "invalid";
22
+ }>;
23
+ /** A provider choice, including the accepted evidence for an inline key. */
24
+ export type ProviderPickerChoice = {
25
+ kind: "project";
26
+ } | {
27
+ kind: "external";
28
+ } | {
29
+ kind: "inline-key";
30
+ key: string;
31
+ validation: AcceptedGatewayKeyValidation;
32
+ };
33
+ /** Private Dev TUI request for the provider's one-screen chooser. */
34
+ export interface ProviderPickerRequest {
35
+ message: string;
36
+ options: readonly SelectOption<ProviderConnection>[];
37
+ initialValue: ProviderConnection;
38
+ validateInlineKey(key: string, signal: AbortSignal): Promise<GatewayKeyValidation>;
39
+ }
40
+ /** Renderer-owned provider chooser; only the Dev TUI invokes this flow. */
41
+ export type ProviderPicker = (request: ProviderPickerRequest) => Promise<ProviderPickerChoice | undefined>;
42
+ /**
43
+ * THE PROVIDER FLOW behind the dev TUI `/model` menu's provider row
44
+ * (`eve link` keeps {@link runLinkFlow}'s shape). One question chooses a
45
+ * project-backed AI Gateway connection, an `AI_GATEWAY_API_KEY`, or an
46
+ * external provider. The project branch runs the link flow in create-or-link
47
+ * mode, so a project-less agent can create its first project rather than
48
+ * dead-end on an empty list.
49
+ */
50
+ export declare function runProviderFlow(input: {
51
+ appRoot: string;
52
+ prompter: Prompter;
53
+ signal?: AbortSignal;
54
+ picker?: ProviderPicker;
55
+ deps?: Partial<ProviderFlowDeps>;
56
+ }): Promise<ProviderFlowResult>;
57
+ export {};
@@ -0,0 +1,4 @@
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{appendEnv}from"../append-env.js";import{AI_GATEWAY_API_KEY_ENV_FILE,AI_GATEWAY_API_KEY_ENV_VAR,writeAiGatewayApiKey}from"../ai-gateway-api-key.js";import{WizardCancelledError}from"../step.js";import{withSpinner}from"../with-spinner.js";import{getVercelAuthStatus,vercelAuthBlockerReason}from"../vercel-project.js";import{runLinkFlow}from"./link.js";import{validateGatewayApiKey}from"../validate-gateway-key.js";var import_picocolors=__toESM(require_picocolors(),1);const PROVIDER_QUESTION=`Which model provider do you want to use?`,EXTERNAL_PROVIDER_INSTRUCTIONS_TITLE=`Using another model provider`,EXTERNAL_PROVIDER_INSTRUCTIONS=[`Set your provider's API key in ${AI_GATEWAY_API_KEY_ENV_FILE} — e.g. ANTHROPIC_API_KEY or OPENAI_API_KEY.`,'In agent/agent.ts, set `model` to a provider-authored model — e.g. `anthropic("claude-opus-4.8")` from `@ai-sdk/anthropic`.',`See https://eve.dev/docs/agent-config for details.`,"A running `eve dev` reloads env files automatically — no restart needed."];function projectConnectionOption(e){let t={value:`project`,label:`AI Gateway via Project`,hint:`Authenticates with AI Gateway automatically
2
+ in a new or existing project. No keys to manage.`},n=e===void 0?void 0:vercelAuthBlockerReason(e);return n===void 0?t:{...t,disabled:!0,disabledReason:n,disabledReasonTone:`warning`}}function providerOptions(e){return[projectConnectionOption(e),{value:`own-key`,label:`AI Gateway via ${AI_GATEWAY_API_KEY_ENV_VAR}`,hint:`> type your key`},{value:`external`,label:`Other providers`,hint:`Connect directly to a model provider
3
+ via OPENAI_API_KEY or ANTHROPIC_API_KEY.`}]}async function selectProvider(e){let t={message:PROVIDER_QUESTION,options:e.options,initialValue:e.initialValue,validateInlineKey:e.validateInlineKey};if(e.picker===void 0)throw Error(`The provider flow requires the Dev TUI provider picker.`);let n=await e.picker(t);if(n===void 0)throw new WizardCancelledError;return n}async function runProviderFlow(e){let{appRoot:t,prompter:r,signal:i}=e,o={getVercelAuthStatus,runLinkFlow,appendEnv,validateGatewayApiKey,...e.deps},s,c=`project`,l;try{for(;;){let n=await selectProvider({picker:e.picker,options:providerOptions(s),initialValue:c,validateInlineKey:(e,t)=>o.validateGatewayApiKey(e,i===void 0?t:AbortSignal.any([i,t]))});if(n.kind===`external`)return r.acknowledge?await r.acknowledge({message:EXTERNAL_PROVIDER_INSTRUCTIONS_TITLE,lines:EXTERNAL_PROVIDER_INSTRUCTIONS}):r.note(EXTERNAL_PROVIDER_INSTRUCTIONS.join(`
4
+ `),EXTERNAL_PROVIDER_INSTRUCTIONS_TITLE),{kind:`external-provider`};if(n.kind===`inline-key`){l=n;break}let a=await withSpinner(r,`Checking your Vercel login…`,()=>o.getVercelAuthStatus(t,{signal:i}));if(i?.throwIfAborted(),s=a,vercelAuthBlockerReason(s)!==void 0){c=`own-key`;continue}return await o.runLinkFlow({appRoot:t,prompter:r,signal:i,projectSelection:`create-or-link`})}}catch(e){if(e instanceof WizardCancelledError)return{kind:`cancelled`};throw e}let u=l.key.trim(),d=l.validation;i?.throwIfAborted(),d.kind===`inconclusive`?r.log.warning(`Couldn't reach the gateway to validate (${d.message}). Saving the key anyway.`):r.log.success(`${import_picocolors.default.green(`✓`)} ${import_picocolors.default.bold(`Valid key`)}`);let f=await writeAiGatewayApiKey({projectRoot:t,apiKey:u,appendEnv:o.appendEnv});return r.log.success(`Saved ${f.envKey} to ${f.envFile}.`),{kind:`done`,credential:f.envKey}}export{EXTERNAL_PROVIDER_INSTRUCTIONS,EXTERNAL_PROVIDER_INSTRUCTIONS_TITLE,PROVIDER_QUESTION,runProviderFlow};
@@ -1,4 +1,4 @@
1
- import{pinnedNodeEngineMajor}from"../../node-engine.js";import{pathExists,writeTextFile}from"../files.js";import{resolveVersionToken}from"../version-tokens.js";import{applyPackageManagerWorkspaceConfiguration,isPackageManagerWorkspaceMember,patchWorkspaceRootPackageJson}from"../workspace-root.js";import{SUPPORTED_AUTHORED_MODULE_FILE_EXTENSIONS}from"../update/module-files.js";import{WEB_APP_TEMPLATE_FILES}from"./web-template.js";import{basename,join,resolve}from"node:path";import{mkdir,readdir,stat}from"node:fs/promises";const CURRENT_DIRECTORY_PROJECT_NAME=`.`,ALLOWED_CREATE_IN_PLACE_ENTRIES=new Set([`.DS_Store`,`.git`,`.gitkeep`,`.hg`]),DEFAULT_AI_PACKAGE_VERSION=`7.0.0-beta.178`,DEFAULT_CONNECT_PACKAGE_VERSION=`0.2.2`,DEFAULT_ZOD_PACKAGE_VERSION=`4.4.3`,DEFAULT_EVE_PACKAGE_CONTRACT={version:`0.13.0`,nodeEngine:`>=24`};function resolveEvePackageContract(e=DEFAULT_EVE_PACKAGE_CONTRACT){return{version:resolveVersionToken(`evePackage.version`,e.version),nodeEngine:resolveVersionToken(`evePackage.nodeEngine`,e.nodeEngine)}}function modelProviderSlug(e){let t=(e.split(`/`)[0]??``).replaceAll(/[^A-Za-z0-9._-]/gu,``);return t.length>0?t:`anthropic`}function byokProviderEnvVar(e){let t=modelProviderSlug(e).toUpperCase().replaceAll(/[^A-Z0-9]/gu,`_`);return`${/^[0-9]/.test(t)?`_`:``}${t}_API_KEY`}function agentTemplateFiles(e){return{"agent/agent.ts":BASE_AGENT_TEMPLATE.replaceAll(`__EVE_INIT_MODEL__`,e),"agent/channels/eve.ts":WEB_APP_TEMPLATE_FILES[`agent/channels/eve.ts`],"agent/instructions.md":AGENT_INSTRUCTIONS_TEMPLATE}}function renderTemplate(e,t){return e.replaceAll(`__EVE_INIT_APP_NAME__`,t.appName).replaceAll(`__EVE_INIT_MODEL__`,t.model).replaceAll(`__EVE_INIT_BYOK_PROVIDER__`,modelProviderSlug(t.model)).replaceAll(`__EVE_INIT_BYOK_ENV_VAR__`,byokProviderEnvVar(t.model)).replaceAll(`__EVE_INIT_PACKAGE_VERSION__`,formatEveDependencySpecifier(t.eveVersion)).replaceAll(`__EVE_INIT_AI_SDK_VERSION__`,t.aiPackageVersion).replaceAll(`__EVE_INIT_CONNECT_VERSION__`,t.connectPackageVersion).replaceAll(`__EVE_INIT_ZOD_VERSION__`,t.zodPackageVersion).replaceAll(`__EVE_INIT_TYPESCRIPT_VERSION__`,t.typescriptPackageVersion).replaceAll(`__EVE_INIT_TYPES_NODE_VERSION__`,t.nodeTypesVersion).replaceAll(`__EVE_INIT_NODE_ENGINE__`,t.nodeEngine)}function formatEveDependencySpecifier(e){return/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z-.]+)?$/.test(e)?`^${e}`:e}const BASE_AGENT_TEMPLATE=`import { defineAgent } from "eve";
1
+ import{pinnedNodeEngineMajor}from"../../node-engine.js";import{pathExists,writeTextFile}from"../files.js";import{resolveVersionToken}from"../version-tokens.js";import{applyPackageManagerWorkspaceConfiguration,isPackageManagerWorkspaceMember,patchWorkspaceRootPackageJson}from"../workspace-root.js";import{SUPPORTED_AUTHORED_MODULE_FILE_EXTENSIONS}from"../update/module-files.js";import{WEB_APP_TEMPLATE_FILES}from"./web-template.js";import{basename,join,resolve}from"node:path";import{mkdir,readdir,stat}from"node:fs/promises";const CURRENT_DIRECTORY_PROJECT_NAME=`.`,ALLOWED_CREATE_IN_PLACE_ENTRIES=new Set([`.DS_Store`,`.git`,`.gitkeep`,`.hg`]),DEFAULT_AI_PACKAGE_VERSION=`7.0.0-beta.178`,DEFAULT_CONNECT_PACKAGE_VERSION=`0.2.2`,DEFAULT_ZOD_PACKAGE_VERSION=`4.4.3`,DEFAULT_EVE_PACKAGE_CONTRACT={version:`0.13.2`,nodeEngine:`>=24`};function resolveEvePackageContract(e=DEFAULT_EVE_PACKAGE_CONTRACT){return{version:resolveVersionToken(`evePackage.version`,e.version),nodeEngine:resolveVersionToken(`evePackage.nodeEngine`,e.nodeEngine)}}function modelProviderSlug(e){let t=(e.split(`/`)[0]??``).replaceAll(/[^A-Za-z0-9._-]/gu,``);return t.length>0?t:`anthropic`}function byokProviderEnvVar(e){let t=modelProviderSlug(e).toUpperCase().replaceAll(/[^A-Z0-9]/gu,`_`);return`${/^[0-9]/.test(t)?`_`:``}${t}_API_KEY`}function agentTemplateFiles(e){return{"agent/agent.ts":BASE_AGENT_TEMPLATE.replaceAll(`__EVE_INIT_MODEL__`,e),"agent/channels/eve.ts":WEB_APP_TEMPLATE_FILES[`agent/channels/eve.ts`],"agent/instructions.md":AGENT_INSTRUCTIONS_TEMPLATE}}function renderTemplate(e,t){return e.replaceAll(`__EVE_INIT_APP_NAME__`,t.appName).replaceAll(`__EVE_INIT_MODEL__`,t.model).replaceAll(`__EVE_INIT_BYOK_PROVIDER__`,modelProviderSlug(t.model)).replaceAll(`__EVE_INIT_BYOK_ENV_VAR__`,byokProviderEnvVar(t.model)).replaceAll(`__EVE_INIT_PACKAGE_VERSION__`,formatEveDependencySpecifier(t.eveVersion)).replaceAll(`__EVE_INIT_AI_SDK_VERSION__`,t.aiPackageVersion).replaceAll(`__EVE_INIT_CONNECT_VERSION__`,t.connectPackageVersion).replaceAll(`__EVE_INIT_ZOD_VERSION__`,t.zodPackageVersion).replaceAll(`__EVE_INIT_TYPESCRIPT_VERSION__`,t.typescriptPackageVersion).replaceAll(`__EVE_INIT_TYPES_NODE_VERSION__`,t.nodeTypesVersion).replaceAll(`__EVE_INIT_NODE_ENGINE__`,t.nodeEngine)}function formatEveDependencySpecifier(e){return/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z-.]+)?$/.test(e)?`^${e}`:e}const BASE_AGENT_TEMPLATE=`import { defineAgent } from "eve";
2
2
 
3
3
  export default defineAgent({
4
4
  model: "__EVE_INIT_MODEL__",
@@ -1,3 +1,3 @@
1
- import { n as defaultMessageReducer, t as useEveAgent } from "../chunks/use-eve-agent-DEm_Jg4k.js";
1
+ import { n as defaultMessageReducer, t as useEveAgent } from "../chunks/use-eve-agent-BPI1nbo5.js";
2
2
 
3
3
  export { defaultMessageReducer, useEveAgent };
@@ -1,3 +1,3 @@
1
- import { t as useEveAgent } from "../chunks/use-eve-agent-DEm_Jg4k.js";
1
+ import { t as useEveAgent } from "../chunks/use-eve-agent-BPI1nbo5.js";
2
2
 
3
3
  export { useEveAgent };
@@ -1,3 +1,3 @@
1
- import { n as defaultMessageReducer, t as useEveAgent } from "../chunks/use-eve-agent-DsXOQMFZ.js";
1
+ import { n as defaultMessageReducer, t as useEveAgent } from "../chunks/use-eve-agent-B18LYpfZ.js";
2
2
 
3
3
  export { defaultMessageReducer, useEveAgent };
@@ -1,3 +1,3 @@
1
- import { t as useEveAgent } from "../chunks/use-eve-agent-DsXOQMFZ.js";
1
+ import { t as useEveAgent } from "../chunks/use-eve-agent-B18LYpfZ.js";
2
2
 
3
3
  export { useEveAgent };
@@ -17,6 +17,8 @@ Every turn runs as a durable workflow, built on the open-source [Workflow SDK](h
17
17
 
18
18
  The Workflow SDK is not inherently tied to Vercel. In local development and in a self-deployed `eve start` process, eve uses the SDK's local world by default; that world persists workflow runs on disk, normally under `.workflow-data`, and dispatches through the same Nitro-hosted workflow routes. On Vercel, the same workflow code runs against Vercel Workflow instead, which adds platform features such as latest production deployment routing and dashboard run metadata.
19
19
 
20
+ When a Vercel production deployment changes, the next model turn in an existing session uses that deployment's current instructions, model, and tools. The durable session keeps its conversation history and authored state, so identity-based channels such as Telegram private chats and Twilio phone-number conversations adopt agent updates without requiring a new session.
21
+
20
22
  Nitro hosts the HTTP routes and workflow entrypoints. It does not supply the workflow state store or the sandbox runtime. Those are separate adapters: Workflow uses the active world implementation, and Sandbox uses the backend from `agent/sandbox` or `defaultBackend()`.
21
23
 
22
24
  For advanced self-hosted deployments, the root `agent.ts` can select the installed Workflow world package to use with `experimental.workflow.world`:
@@ -32,6 +32,15 @@ console.log(health.status, health.workflowId);
32
32
 
33
33
  Non-2xx responses throw `ClientError`, which carries the HTTP `status` and response `body`.
34
34
 
35
+ ## Inspect an agent
36
+
37
+ Use `info()` to inspect a development agent. The client parses and validates the complete response before returning it:
38
+
39
+ ```ts
40
+ const info = await client.info();
41
+ console.log(info.agent.name, info.agent.model.id);
42
+ ```
43
+
35
44
  ## Authentication
36
45
 
37
46
  Pass `auth` when the [eve channel](../../channels/eve) route requires credentials:
@@ -59,6 +68,21 @@ const client = new Client({
59
68
  });
60
69
  ```
61
70
 
71
+ For a Vercel OIDC-protected deployment, use `vercelOidc`. The client resolves the token once per request and sends it as both the bearer credential and Vercel's trusted-OIDC header:
72
+
73
+ ```ts
74
+ import { getVercelOidcToken } from "@vercel/oidc";
75
+
76
+ const client = new Client({
77
+ host: "https://agent.example.com",
78
+ auth: {
79
+ vercelOidc: {
80
+ token: async () => await getVercelOidcToken(),
81
+ },
82
+ },
83
+ });
84
+ ```
85
+
62
86
  Use `headers` for route-specific credentials such as bypass tokens or tenant hints. Like `auth`, it can be static or dynamic:
63
87
 
64
88
  ```ts
@@ -16,7 +16,7 @@ On startup the TUI prints a brand line with your agent's name, plus a rotating t
16
16
  Use /channels to add more ways to reach your agent.
17
17
  ```
18
18
 
19
- If agent discovery reported problems, an error and warning count renders between the two lines. Instructions, tools, skills, and subagents are one `eve info` away, and `/help` lists every command. The TUI also runs a startup check. When the runtime confirms that no model provider is configured, it opens the `/model` provider questions before the first prompt. When the available evidence cannot confirm that state, missing setup remains visible as an attention line, with each command's outcome hanging under it on a `⎿` connector.
19
+ If agent discovery reported problems, an error and warning count renders between the two lines. Instructions, tools, skills, and subagents are one `eve info` away, and `/help` lists every command. The TUI also runs a startup check. When the runtime confirms that no model provider is configured, it opens the `/model` provider picker before the first prompt. Unknown or linked-but-incomplete credential states remain visible as an attention line, with each command's outcome hanging under it on a `⎿` connector.
20
20
 
21
21
  ## Reading the transcript
22
22
 
@@ -46,11 +46,11 @@ Each command echoes as an invocation line, asks through a bordered panel that ta
46
46
 
47
47
  ### Configure the model and provider
48
48
 
49
- Bare `/model` opens the configure menu. When no provider is configured, it opens the provider questions directly; Esc returns to the configure menu. "Change model" runs the same searchable model picker setup uses (the Vercel AI Gateway catalog, pre-selected on the model the runtime is serving). A model change is written into your agent's authored source, and the command reports success only after eve confirms the new id. `/model <provider/model-id>` applies one directly, skipping the menu.
49
+ Bare `/model` opens the configure menu. When no provider is configured, it opens the provider picker directly and Esc returns to the configure menu. "Change model" runs the same searchable model picker setup uses (the Vercel AI Gateway catalog, pre-selected on the model the runtime is serving). A model change is written into your agent's authored source, and the command reports success only after eve confirms the new id. A completed model or provider change closes the menu and returns its result to the transcript; Done or Esc closes it without a change. `/model <provider/model-id>` applies one directly, skipping the menu.
50
50
 
51
- The provider row opens the provider questions: which model provider to use, and how to connect. Picking something other than Vercel AI Gateway shows wiring instructions for your own provider and stops there, leaving any existing setup untouched. For Vercel AI Gateway, you either paste your own `AI_GATEWAY_API_KEY` (saved straight to `.env.local`) or connect via a project. Connecting via a project asks for a Vercel team, opens that team's recent projects, and lets you search all projects for older matches. Vercel links the selected project, eve verifies its project ID, then pulls its environment into `.env.local`. The dev TUI reloads env files, re-reads the runtime's model endpoint, and clears the setup warning automatically; no restart is needed.
51
+ The provider row opens one menu: AI Gateway via a project, AI Gateway via `AI_GATEWAY_API_KEY`, or **Other providers**. The key option becomes a masked input when highlighted. Enter validates it without replacing the menu. A rejected key shows a red `⨯ Invalid key` beside the masked value; retrying or editing clears that result. With a non-empty key, the first Esc or Ctrl-C clears the input and the second cancels the menu. An accepted key is saved to `.env.local`. The project option asks for a Vercel team, opens that team's recent projects, and lets you search all projects for older matches. Vercel links the selected project, eve verifies its project ID, then pulls its environment into `.env.local`. The **Other providers** option shows direct-provider wiring instructions and leaves the existing setup untouched. The dev server reloads env files and refreshes the status bar automatically, with no restart needed.
52
52
 
53
- The provider row demands attention (a bold yellow "Configure provider" with "Required to enable the agent") until a link or gateway credential is detected, then names the connection afterward (for example "AI Gateway (Linked to my-project in my-team)"). Each action's latest outcome stays visible beneath the menu (for example "✓ Model changed to openai/gpt-5.5"). When a turn fails because AI Gateway authentication is missing or stale, the error points you at `/model` directly.
53
+ The provider row demands attention (a bold yellow "Configure model access" with a yellow "Not configured" hint that dims when unselected and uses the terminal foreground when selected) until a link or gateway credential is detected, then names the connection afterward (for example "AI Gateway (Linked to my-project in my-team)"). Setup menus mark the cursor row with a padded, filled-arrow inverse label that inherits the row's accent: blue normally and yellow for warning rows. In stacked menus, the selected row's description appears directly beneath that option. The completed command's outcome stays in the transcript after the panel closes. When a turn fails because AI Gateway authentication is missing or stale, the error points you at `/model` directly.
54
54
 
55
55
  ### Add a channel
56
56
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eve",
3
- "version": "0.13.0",
3
+ "version": "0.13.2",
4
4
  "private": false,
5
5
  "description": "Filesystem-first framework for durable backend AI agents that run anywhere.",
6
6
  "keywords": [
@@ -285,6 +285,7 @@
285
285
  "@vercel/detect-agent": "1.2.3",
286
286
  "@vercel/oidc": "3.5.0",
287
287
  "@vercel/sandbox": "2.2.1",
288
+ "@vercel/sdk": "1.28.1",
288
289
  "@workflow/core": "5.0.0-beta.19",
289
290
  "@workflow/errors": "5.0.0-beta.8",
290
291
  "@workflow/world": "5.0.0-beta.10",