palmagent 0.1.0-alpha.63 → 0.1.0-alpha.64

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 (65) hide show
  1. package/build-info.json +4 -4
  2. package/cli.js +1 -1
  3. package/package.json +3 -3
  4. package/server.js +2 -2
  5. package/web/assets/{MermaidViewport-BxR4JnD1.js → MermaidViewport-Cee9k_MV.js} +1 -1
  6. package/web/assets/{abnfDiagram-O67JEVCF-D0G8u2Yz.js → abnfDiagram-O67JEVCF-CJNoPqe-.js} +1 -1
  7. package/web/assets/{arc-B-fR2Y-K.js → arc-Du3DyD7M.js} +1 -1
  8. package/web/assets/{architectureDiagram-NJMV4G6O-lOFz-3tz.js → architectureDiagram-NJMV4G6O-CL-vDNQ1.js} +1 -1
  9. package/web/assets/{blockDiagram-BEXU5L5S-CkOL62S7.js → blockDiagram-BEXU5L5S-Yp16T3t4.js} +1 -1
  10. package/web/assets/{c4Diagram-YGBWAQC7-CcGliXL-.js → c4Diagram-YGBWAQC7-CiG_HoSB.js} +1 -1
  11. package/web/assets/channel-BC1CBsyC.js +1 -0
  12. package/web/assets/{chunk-2Q5K7J3B-DHdPdWJ1.js → chunk-2Q5K7J3B-D-3DEb3i.js} +1 -1
  13. package/web/assets/{chunk-3FUC2YCW-DWy7zE1b.js → chunk-3FUC2YCW-DDFvwiq5.js} +2 -2
  14. package/web/assets/{chunk-5VM5RSS4-BEKTPjj-.js → chunk-5VM5RSS4-Bf9RCSWm.js} +1 -1
  15. package/web/assets/{chunk-GTNCS2PH-W6gKb8bf.js → chunk-GTNCS2PH-aJsshCyN.js} +1 -1
  16. package/web/assets/{chunk-GWA4HPMP-DSGAWF4G.js → chunk-GWA4HPMP-B3O-NUFx.js} +1 -1
  17. package/web/assets/{chunk-JWPE2WC7-tUz-YlZz.js → chunk-JWPE2WC7-DHiIZ7CE.js} +1 -1
  18. package/web/assets/{chunk-NETBCI7D-7LbOGf21.js → chunk-NETBCI7D-B9Nn75gX.js} +1 -1
  19. package/web/assets/{chunk-WEXAMYUT-GKkPJiOo.js → chunk-WEXAMYUT-I3QxYPRw.js} +1 -1
  20. package/web/assets/{chunk-XXDRQBXY-D0GGzVXt.js → chunk-XXDRQBXY-gqUO7rJf.js} +1 -1
  21. package/web/assets/{classDiagram-v2-NBCMYWYE-CPy5jdXS.js → classDiagram-v2-NBCMYWYE-zCjNJVxV.js} +1 -1
  22. package/web/assets/{cose-bilkent-JH36ORCC-Dbr3mvm3.js → cose-bilkent-JH36ORCC-DIeJFUft.js} +1 -1
  23. package/web/assets/{cynefin-OW5HDTMX-CAz-Qhap.js → cynefin-OW5HDTMX-Dj2xToRG.js} +1 -1
  24. package/web/assets/{cynefinDiagram-VND7K2PF-PTsDtRYC.js → cynefinDiagram-VND7K2PF-Btqj3mZ0.js} +1 -1
  25. package/web/assets/{dagre-6A5THRUB-CDBiiP5I.js → dagre-6A5THRUB-yDsuuvZn.js} +1 -1
  26. package/web/assets/{diagram-22UHCM2B-DwmsXF4i.js → diagram-22UHCM2B-E9v_XhQQ.js} +1 -1
  27. package/web/assets/{diagram-3UASUU5V-BeL2p4OI.js → diagram-3UASUU5V-BVpu5aPU.js} +1 -1
  28. package/web/assets/{diagram-ATOU4E4O-D8OaxPz_.js → diagram-ATOU4E4O-B-JcEET_.js} +1 -1
  29. package/web/assets/{diagram-CDSNMT55-DIO23_iH.js → diagram-CDSNMT55-BZta1zRx.js} +1 -1
  30. package/web/assets/{diagram-MLGK6HIB-DAZjxBks.js → diagram-MLGK6HIB-CAK7R8yU.js} +1 -1
  31. package/web/assets/{diagram-MPIPVDR6-BEoVTXkB.js → diagram-MPIPVDR6-BWS2mJY-.js} +1 -1
  32. package/web/assets/{ebnfDiagram-ZINNZB2B-D8LnvtWn.js → ebnfDiagram-ZINNZB2B-CgJvqhHV.js} +1 -1
  33. package/web/assets/{elk-276RUBZZ-6o3Z1Z9B.js → elk-276RUBZZ-DfkdXRoi.js} +1 -1
  34. package/web/assets/{erDiagram-OPXOYQCR-DAo45i6P.js → erDiagram-OPXOYQCR-6bphZ_5q.js} +1 -1
  35. package/web/assets/{flowDiagram-KWPJA3E3-YibM8Dp6.js → flowDiagram-KWPJA3E3-wv0eUYY4.js} +1 -1
  36. package/web/assets/{ganttDiagram-FUAMR5RP-6JoF7T-A.js → ganttDiagram-FUAMR5RP-DHP4hHkP.js} +1 -1
  37. package/web/assets/{gitGraphDiagram-X574FWY7-D9zdeE51.js → gitGraphDiagram-X574FWY7-zy3oR00N.js} +1 -1
  38. package/web/assets/{index-1nnrLs_k.js → index-D-V06h3u.js} +2 -2
  39. package/web/assets/{infoDiagram-VRGFBTTK-iogSf7_N.js → infoDiagram-VRGFBTTK-Dcz5i1Pc.js} +1 -1
  40. package/web/assets/{ishikawaDiagram-OU5B5YK6-BaAkBU-4.js → ishikawaDiagram-OU5B5YK6-Do0Rrevx.js} +1 -1
  41. package/web/assets/{journeyDiagram-ZHPQQLJL-BVY3YOXm.js → journeyDiagram-ZHPQQLJL-BiMK0IWc.js} +1 -1
  42. package/web/assets/{kanban-definition-PNTS6WVX-BqTIYEFw.js → kanban-definition-PNTS6WVX-DyKmSz2E.js} +1 -1
  43. package/web/assets/{linear-DxuON8TV.js → linear-BSp9BMT-.js} +1 -1
  44. package/web/assets/{mermaid.core-D_CBS6CH.js → mermaid.core-BaZRsRbe.js} +4 -4
  45. package/web/assets/{mindmap-definition-NLK3R4M7-CEIAzXwp.js → mindmap-definition-NLK3R4M7-Cux5bO_X.js} +1 -1
  46. package/web/assets/{pegDiagram-GJSIUBJH-vV9ePjcc.js → pegDiagram-GJSIUBJH-Dt6MK0zT.js} +1 -1
  47. package/web/assets/{pieDiagram-5QR66LMP-CzCw1MxM.js → pieDiagram-5QR66LMP-JBsWNBZ4.js} +1 -1
  48. package/web/assets/{quadrantDiagram-O4NWA36T-1q99-qtr.js → quadrantDiagram-O4NWA36T--1O7KT0C.js} +1 -1
  49. package/web/assets/{railroadDiagram-XR7U4H2S-DVgeZFjx.js → railroadDiagram-XR7U4H2S-DxFQqJLy.js} +1 -1
  50. package/web/assets/{requirementDiagram-PLB6GJNP-BFOPbhUJ.js → requirementDiagram-PLB6GJNP-CQE13pKR.js} +1 -1
  51. package/web/assets/{sankeyDiagram-IPEJSGJF-Clt0xwmN.js → sankeyDiagram-IPEJSGJF-uAmeSrc4.js} +1 -1
  52. package/web/assets/{sequenceDiagram-PO4LG4MO-DOVkxu2q.js → sequenceDiagram-PO4LG4MO-DPgJC290.js} +1 -1
  53. package/web/assets/{sizeCapture-INFHLROL-7OxYyI72.js → sizeCapture-INFHLROL-DPAsVhlF.js} +1 -1
  54. package/web/assets/{stateDiagram-v2-GCMORJYK-CvEU3jod.js → stateDiagram-v2-GCMORJYK-bVfMfGdD.js} +1 -1
  55. package/web/assets/{swimlanes-2SLR337P-Djh_V_Og.js → swimlanes-2SLR337P-BG-7Swk7.js} +1 -1
  56. package/web/assets/swimlanesDiagram-TC7HE7FX-4Lsz_KwI.js +8 -0
  57. package/web/assets/{timeline-definition-EJHVYXUP-Caahc540.js → timeline-definition-EJHVYXUP-DuD40x2u.js} +1 -1
  58. package/web/assets/{usecaseDiagram-POWQR4AR-BwaeTpb9.js → usecaseDiagram-POWQR4AR-DZGygZP3.js} +1 -1
  59. package/web/assets/{vennDiagram-UO4OBE2U-N0egjQbT.js → vennDiagram-UO4OBE2U-CLEXRGEV.js} +1 -1
  60. package/web/assets/{wardleyDiagram-VNRHLVJA-7JrhkNs8.js → wardleyDiagram-VNRHLVJA-4Pvn_G_8.js} +1 -1
  61. package/web/assets/{xychartDiagram-PMCCYNJV-9b0xBoCm.js → xychartDiagram-PMCCYNJV-BOIutUYy.js} +1 -1
  62. package/web/index.html +1 -1
  63. package/web/sw.js +1 -1
  64. package/web/assets/channel-CinjYkaT.js +0 -1
  65. package/web/assets/swimlanesDiagram-TC7HE7FX-XsN3y1U1.js +0 -8
package/build-info.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.0-alpha.63",
2
+ "version": "0.1.0-alpha.64",
3
3
  "agentCliCompatibility": {
4
4
  "claude": {
5
5
  "range": ">=2.1.268 <2.2.0",
@@ -7,11 +7,11 @@
7
7
  "exclusiveMaximum": "2.2.0"
8
8
  },
9
9
  "codex": {
10
- "range": ">=0.154.0 <0.155.0",
10
+ "range": ">=0.154.0 <0.156.0",
11
11
  "minimum": "0.154.0",
12
- "exclusiveMaximum": "0.155.0"
12
+ "exclusiveMaximum": "0.156.0"
13
13
  }
14
14
  },
15
- "sourceCommit": "e7f2d0584ea41953d5c831708718e91e353738cc",
15
+ "sourceCommit": "341590f4436aae49ef381ed6a9b0e62d25e6a682",
16
16
  "dirty": false
17
17
  }
package/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- var Bc=Object.defineProperty;var A=(t,e)=>()=>(t&&(e=t(t=0)),e);var Bn=(t,e)=>{for(var r in e)Bc(t,r,{get:e[r],enumerable:!0})};var pi=A(()=>{});function Vc(t){let e=Wc.exec(t);return e?{repo:e[1],number:Number(e[2])}:null}function Br(t){let e=Vc(t);return e?{url:t,number:e.number,repo:e.repo,status:"open",checks:"unknown"}:null}var Wc,hi=A(()=>{Wc=/^https:\/\/github\.com\/([\w.-]+\/[\w.-]+)\/pull\/(\d+)/});var Wn,fi=A(()=>{Wn={claude:"acceptEdits",codex:"workspace-write"}});var mi=A(()=>{});var R,gi=A(()=>{R={productName:"Palmagent",displayName:"PalmAgent",packageName:"palmagent",cliName:"palmagent",unitBase:"palmagent",stateDirName:"palmagent"}});var dt,Vn=A(()=>{dt={claude:{range:">=2.1.268 <2.2.0",minimum:"2.1.268",exclusiveMaximum:"2.2.0"},codex:{range:">=0.154.0 <0.155.0",minimum:"0.154.0",exclusiveMaximum:"0.155.0"}}});function yi(t,e){let r=o=>/^\d+\.\d+\.\d+$/.test(o)?o.split(".").map(Number):void 0,n=r(e);if(!n)return!1;let s=o=>{let a=r(o);for(let d=0;d<3;d++)if(n[d]!==a[d])return n[d]-a[d];return 0},i=dt[t];return s(i.minimum)>=0&&s(i.exclusiveMaximum)<0}var bi=A(()=>{Vn();Vn()});var M,zn,b,Te,ir=A(()=>{(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function r(s){throw new Error}t.assertNever=r,t.arrayToEnum=s=>{let i={};for(let o of s)i[o]=o;return i},t.getValidEnumValues=s=>{let i=t.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),o={};for(let a of i)o[a]=s[a];return t.objectValues(o)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let i=[];for(let o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},t.find=(s,i)=>{for(let o of s)if(i(o))return o},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=n,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(M||(M={}));(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(zn||(zn={}));b=M.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Te=t=>{switch(typeof t){case"undefined":return b.undefined;case"string":return b.string;case"number":return Number.isNaN(t)?b.nan:b.number;case"boolean":return b.boolean;case"function":return b.function;case"bigint":return b.bigint;case"symbol":return b.symbol;case"object":return Array.isArray(t)?b.array:t===null?b.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?b.promise:typeof Map<"u"&&t instanceof Map?b.map:typeof Set<"u"&&t instanceof Set?b.set:typeof Date<"u"&&t instanceof Date?b.date:b.object;default:return b.unknown}}});var f,Gc,ae,Wr=A(()=>{ir();f=M.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Gc=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),ae=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(i){return i.message},n={_errors:[]},s=i=>{for(let o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let a=n,d=0;for(;d<o.path.length;){let l=o.path[d];d===o.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(r(o))):a[l]=a[l]||{_errors:[]},a=a[l],d++}}};return s(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,M.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let s of this.issues)if(s.path.length>0){let i=s.path[0];r[i]=r[i]||[],r[i].push(e(s))}else n.push(e(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};ae.create=t=>new ae(t)});var Jc,Oe,Gn=A(()=>{Wr();ir();Jc=(t,e)=>{let r;switch(t.code){case f.invalid_type:t.received===b.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case f.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,M.jsonStringifyReplacer)}`;break;case f.unrecognized_keys:r=`Unrecognized key(s) in object: ${M.joinValues(t.keys,", ")}`;break;case f.invalid_union:r="Invalid input";break;case f.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${M.joinValues(t.options)}`;break;case f.invalid_enum_value:r=`Invalid enum value. Expected ${M.joinValues(t.options)}, received '${t.received}'`;break;case f.invalid_arguments:r="Invalid function arguments";break;case f.invalid_return_type:r="Invalid function return type";break;case f.invalid_date:r="Invalid date";break;case f.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:M.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case f.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case f.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case f.custom:r="Invalid input";break;case f.invalid_intersection_types:r="Intersection results could not be merged";break;case f.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case f.not_finite:r="Number must be finite";break;default:r=e.defaultError,M.assertNever(t)}return{message:r}},Oe=Jc});function Xc(t){Ei=t}function Lt(){return Ei}var Ei,Vr=A(()=>{Gn();Ei=Oe});function g(t,e){let r=Lt(),n=or({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Oe?void 0:Oe].filter(s=>!!s)});t.common.issues.push(n)}var or,Kc,Z,T,lt,re,zr,Gr,Je,Ut,Jn=A(()=>{Vr();Gn();or=t=>{let{data:e,path:r,errorMaps:n,issueData:s}=t,i=[...r,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let a="",d=n.filter(l=>!!l).slice().reverse();for(let l of d)a=l(o,{data:e,defaultError:a}).message;return{...s,path:i,message:a}},Kc=[];Z=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let s of r){if(s.status==="aborted")return T;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let s of r){let i=await s.key,o=await s.value;n.push({key:i,value:o})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let s of r){let{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return T;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(n[i.value]=o.value)}return{status:e.value,value:n}}},T=Object.freeze({status:"aborted"}),lt=t=>({status:"dirty",value:t}),re=t=>({status:"valid",value:t}),zr=t=>t.status==="aborted",Gr=t=>t.status==="dirty",Je=t=>t.status==="valid",Ut=t=>typeof Promise<"u"&&t instanceof Promise});var vi=A(()=>{});var w,wi=A(()=>{(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(w||(w={}))});function N(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:s}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(o,a)=>{let{message:d}=t;return o.code==="invalid_enum_value"?{message:d??a.defaultError}:typeof a.data>"u"?{message:d??n??a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:d??r??a.defaultError}},description:s}}function xi(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function hd(t){return new RegExp(`^${xi(t)}$`)}function ki(t){let e=`${Ti}T${xi(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function fd(t,e){return!!((e==="v4"||!e)&&od.test(t)||(e==="v6"||!e)&&cd.test(t))}function md(t,e){if(!rd.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function gd(t,e){return!!((e==="v4"||!e)&&ad.test(t)||(e==="v6"||!e)&&dd.test(t))}function yd(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=r>n?r:n,i=Number.parseInt(t.toFixed(s).replace(".","")),o=Number.parseInt(e.toFixed(s).replace(".",""));return i%o/10**s}function Mt(t){if(t instanceof ce){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=ue.create(Mt(n))}return new ce({...t._def,shape:()=>e})}else return t instanceof Le?new Le({...t._def,type:Mt(t.element)}):t instanceof ue?ue.create(Mt(t.unwrap())):t instanceof ke?ke.create(Mt(t.unwrap())):t instanceof xe?xe.create(t.items.map(e=>Mt(e))):t}function Kn(t,e){let r=Te(t),n=Te(e);if(t===e)return{valid:!0,data:t};if(r===b.object&&n===b.object){let s=M.objectKeys(e),i=M.objectKeys(t).filter(a=>s.indexOf(a)!==-1),o={...t,...e};for(let a of i){let d=Kn(t[a],e[a]);if(!d.valid)return{valid:!1};o[a]=d.data}return{valid:!0,data:o}}else if(r===b.array&&n===b.array){if(t.length!==e.length)return{valid:!1};let s=[];for(let i=0;i<t.length;i++){let o=t[i],a=e[i],d=Kn(o,a);if(!d.valid)return{valid:!1};s.push(d.data)}return{valid:!0,data:s}}else return r===b.date&&n===b.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}function Ri(t,e){return new wt({values:t,typeName:x.ZodEnum,...N(e)})}function _i(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function Ai(t,e={},r){return t?Ke.create().superRefine((n,s)=>{let i=t(n);if(i instanceof Promise)return i.then(o=>{if(!o){let a=_i(e,n),d=a.fatal??r??!0;s.addIssue({code:"custom",...a,fatal:d})}});if(!i){let o=_i(e,n),a=o.fatal??r??!0;s.addIssue({code:"custom",...o,fatal:a})}}):Ke.create()}var pe,Si,P,Yc,Zc,Qc,ed,td,rd,nd,sd,id,Xn,od,ad,cd,dd,ld,ud,Ti,pd,Xe,ut,pt,ht,ft,jt,mt,gt,Ke,Pe,be,$t,Le,ce,yt,De,Jr,bt,xe,Xr,Ht,qt,Kr,Et,vt,wt,St,Ye,he,ue,ke,_t,Tt,Ft,bd,ar,cr,xt,Ed,x,vd,Ii,Ci,wd,Sd,Ni,_d,Td,xd,kd,Rd,Ad,Id,Cd,Nd,Od,Dd,Pd,Ld,Ud,Md,jd,$d,Hd,qd,Fd,Bd,Wd,Vd,zd,Gd,Jd,Xd,Kd,Yd,Zd,Qd,el,tl,rl,Oi=A(()=>{Wr();Vr();wi();Jn();ir();pe=class{constructor(e,r,n,s){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Si=(t,e)=>{if(Je(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new ae(t.common.issues);return this._error=r,this._error}}};P=class{get description(){return this._def.description}_getType(e){return Te(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Te(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Z,ctx:{common:e.parent.common,data:e.data,parsedType:Te(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Ut(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Te(e)},s=this._parseSync({data:e,path:n.path,parent:n});return Si(n,s)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Te(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return Je(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>Je(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Te(e)},s=this._parse({data:e,path:n.path,parent:n}),i=await(Ut(s)?s:Promise.resolve(s));return Si(n,i)}refine(e,r){let n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,i)=>{let o=e(s),a=()=>i.addIssue({code:f.custom,...n(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(d=>d?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(e){return new he({schema:this,typeName:x.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:r=>this["~validate"](r)}}optional(){return ue.create(this,this._def)}nullable(){return ke.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Le.create(this)}promise(){return Ye.create(this,this._def)}or(e){return yt.create([this,e],this._def)}and(e){return bt.create(this,e,this._def)}transform(e){return new he({...N(this._def),schema:this,typeName:x.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new _t({...N(this._def),innerType:this,defaultValue:r,typeName:x.ZodDefault})}brand(){return new ar({typeName:x.ZodBranded,type:this,...N(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Tt({...N(this._def),innerType:this,catchValue:r,typeName:x.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return cr.create(this,e)}readonly(){return xt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Yc=/^c[^\s-]{8,}$/i,Zc=/^[0-9a-z]+$/,Qc=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ed=/^[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,td=/^[a-z0-9_-]{21}$/i,rd=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,nd=/^[-+]?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)?)??$/,sd=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,id="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",od=/^(?:(?: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])$/,ad=/^(?:(?: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])$/,cd=/^(([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]))$/,dd=/^(([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])$/,ld=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ud=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ti="((\\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])))",pd=new RegExp(`^${Ti}$`);Xe=class t extends P{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==b.string){let i=this._getOrReturnCtx(e);return g(i,{code:f.invalid_type,expected:b.string,received:i.parsedType}),T}let n=new Z,s;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),g(s,{code:f.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(s=this._getOrReturnCtx(e,s),g(s,{code:f.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let o=e.data.length>i.value,a=e.data.length<i.value;(o||a)&&(s=this._getOrReturnCtx(e,s),o?g(s,{code:f.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&g(s,{code:f.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")sd.test(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{validation:"email",code:f.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Xn||(Xn=new RegExp(id,"u")),Xn.test(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{validation:"emoji",code:f.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")ed.test(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{validation:"uuid",code:f.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")td.test(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{validation:"nanoid",code:f.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")Yc.test(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{validation:"cuid",code:f.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")Zc.test(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{validation:"cuid2",code:f.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")Qc.test(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{validation:"ulid",code:f.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),g(s,{validation:"url",code:f.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{validation:"regex",code:f.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),g(s,{code:f.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(s=this._getOrReturnCtx(e,s),g(s,{code:f.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),g(s,{code:f.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?ki(i).test(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{code:f.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?pd.test(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{code:f.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?hd(i).test(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{code:f.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?nd.test(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{validation:"duration",code:f.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?fd(e.data,i.version)||(s=this._getOrReturnCtx(e,s),g(s,{validation:"ip",code:f.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?md(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),g(s,{validation:"jwt",code:f.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?gd(e.data,i.version)||(s=this._getOrReturnCtx(e,s),g(s,{validation:"cidr",code:f.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?ld.test(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{validation:"base64",code:f.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?ud.test(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{validation:"base64url",code:f.invalid_string,message:i.message}),n.dirty()):M.assertNever(i);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(s=>e.test(s),{validation:r,code:f.invalid_string,...w.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...w.errToObj(e)})}url(e){return this._addCheck({kind:"url",...w.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...w.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...w.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...w.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...w.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...w.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...w.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...w.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...w.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...w.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...w.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...w.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:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...w.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:typeof e?.precision>"u"?null:e?.precision,...w.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...w.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...w.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...w.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...w.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...w.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...w.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...w.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...w.errToObj(r)})}nonempty(e){return this.min(1,w.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...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 r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Xe.create=t=>new Xe({checks:[],typeName:x.ZodString,coerce:t?.coerce??!1,...N(t)});ut=class t extends P{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==b.number){let i=this._getOrReturnCtx(e);return g(i,{code:f.invalid_type,expected:b.number,received:i.parsedType}),T}let n,s=new Z;for(let i of this._def.checks)i.kind==="int"?M.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),g(n,{code:f.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),g(n,{code:f.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),g(n,{code:f.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?yd(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),g(n,{code:f.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),g(n,{code:f.not_finite,message:i.message}),s.dirty()):M.assertNever(i);return{status:s.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,w.toString(r))}gt(e,r){return this.setLimit("min",e,!1,w.toString(r))}lte(e,r){return this.setLimit("max",e,!0,w.toString(r))}lt(e,r){return this.setLimit("max",e,!1,w.toString(r))}setLimit(e,r,n,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:w.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:w.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:w.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:w.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:w.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:w.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:w.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:w.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:w.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:w.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&M.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};ut.create=t=>new ut({checks:[],typeName:x.ZodNumber,coerce:t?.coerce||!1,...N(t)});pt=class t extends P{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==b.bigint)return this._getInvalidInput(e);let n,s=new Z;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),g(n,{code:f.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),g(n,{code:f.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),g(n,{code:f.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):M.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return g(r,{code:f.invalid_type,expected:b.bigint,received:r.parsedType}),T}gte(e,r){return this.setLimit("min",e,!0,w.toString(r))}gt(e,r){return this.setLimit("min",e,!1,w.toString(r))}lte(e,r){return this.setLimit("max",e,!0,w.toString(r))}lt(e,r){return this.setLimit("max",e,!1,w.toString(r))}setLimit(e,r,n,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:w.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:w.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:w.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:w.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:w.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:w.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};pt.create=t=>new pt({checks:[],typeName:x.ZodBigInt,coerce:t?.coerce??!1,...N(t)});ht=class extends P{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==b.boolean){let n=this._getOrReturnCtx(e);return g(n,{code:f.invalid_type,expected:b.boolean,received:n.parsedType}),T}return re(e.data)}};ht.create=t=>new ht({typeName:x.ZodBoolean,coerce:t?.coerce||!1,...N(t)});ft=class t extends P{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==b.date){let i=this._getOrReturnCtx(e);return g(i,{code:f.invalid_type,expected:b.date,received:i.parsedType}),T}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return g(i,{code:f.invalid_date}),T}let n=new Z,s;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),g(s,{code:f.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),g(s,{code:f.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):M.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:w.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:w.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};ft.create=t=>new ft({checks:[],coerce:t?.coerce||!1,typeName:x.ZodDate,...N(t)});jt=class extends P{_parse(e){if(this._getType(e)!==b.symbol){let n=this._getOrReturnCtx(e);return g(n,{code:f.invalid_type,expected:b.symbol,received:n.parsedType}),T}return re(e.data)}};jt.create=t=>new jt({typeName:x.ZodSymbol,...N(t)});mt=class extends P{_parse(e){if(this._getType(e)!==b.undefined){let n=this._getOrReturnCtx(e);return g(n,{code:f.invalid_type,expected:b.undefined,received:n.parsedType}),T}return re(e.data)}};mt.create=t=>new mt({typeName:x.ZodUndefined,...N(t)});gt=class extends P{_parse(e){if(this._getType(e)!==b.null){let n=this._getOrReturnCtx(e);return g(n,{code:f.invalid_type,expected:b.null,received:n.parsedType}),T}return re(e.data)}};gt.create=t=>new gt({typeName:x.ZodNull,...N(t)});Ke=class extends P{constructor(){super(...arguments),this._any=!0}_parse(e){return re(e.data)}};Ke.create=t=>new Ke({typeName:x.ZodAny,...N(t)});Pe=class extends P{constructor(){super(...arguments),this._unknown=!0}_parse(e){return re(e.data)}};Pe.create=t=>new Pe({typeName:x.ZodUnknown,...N(t)});be=class extends P{_parse(e){let r=this._getOrReturnCtx(e);return g(r,{code:f.invalid_type,expected:b.never,received:r.parsedType}),T}};be.create=t=>new be({typeName:x.ZodNever,...N(t)});$t=class extends P{_parse(e){if(this._getType(e)!==b.undefined){let n=this._getOrReturnCtx(e);return g(n,{code:f.invalid_type,expected:b.void,received:n.parsedType}),T}return re(e.data)}};$t.create=t=>new $t({typeName:x.ZodVoid,...N(t)});Le=class t extends P{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),s=this._def;if(r.parsedType!==b.array)return g(r,{code:f.invalid_type,expected:b.array,received:r.parsedType}),T;if(s.exactLength!==null){let o=r.data.length>s.exactLength.value,a=r.data.length<s.exactLength.value;(o||a)&&(g(r,{code:o?f.too_big:f.too_small,minimum:a?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(g(r,{code:f.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(g(r,{code:f.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>s.type._parseAsync(new pe(r,o,r.path,a)))).then(o=>Z.mergeArray(n,o));let i=[...r.data].map((o,a)=>s.type._parseSync(new pe(r,o,r.path,a)));return Z.mergeArray(n,i)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:w.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:w.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:w.toString(r)}})}nonempty(e){return this.min(1,e)}};Le.create=(t,e)=>new Le({type:t,minLength:null,maxLength:null,exactLength:null,typeName:x.ZodArray,...N(e)});ce=class t extends P{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(),r=M.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==b.object){let l=this._getOrReturnCtx(e);return g(l,{code:f.invalid_type,expected:b.object,received:l.parsedType}),T}let{status:n,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof be&&this._def.unknownKeys==="strip"))for(let l in s.data)o.includes(l)||a.push(l);let d=[];for(let l of o){let p=i[l],u=s.data[l];d.push({key:{status:"valid",value:l},value:p._parse(new pe(s,u,s.path,l)),alwaysSet:l in s.data})}if(this._def.catchall instanceof be){let l=this._def.unknownKeys;if(l==="passthrough")for(let p of a)d.push({key:{status:"valid",value:p},value:{status:"valid",value:s.data[p]}});else if(l==="strict")a.length>0&&(g(s,{code:f.unrecognized_keys,keys:a}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let p of a){let u=s.data[p];d.push({key:{status:"valid",value:p},value:l._parse(new pe(s,u,s.path,p)),alwaysSet:p in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let l=[];for(let p of d){let u=await p.key,h=await p.value;l.push({key:u,value:h,alwaysSet:p.alwaysSet})}return l}).then(l=>Z.mergeObjectSync(n,l)):Z.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(e){return w.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{let s=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:w.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:x.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of M.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let n of M.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return Mt(this)}partial(e){let r={};for(let n of M.objectKeys(this.shape)){let s=this.shape[n];e&&!e[n]?r[n]=s:r[n]=s.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let n of M.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof ue;)i=i._def.innerType;r[n]=i}return new t({...this._def,shape:()=>r})}keyof(){return Ri(M.objectKeys(this.shape))}};ce.create=(t,e)=>new ce({shape:()=>t,unknownKeys:"strip",catchall:be.create(),typeName:x.ZodObject,...N(e)});ce.strictCreate=(t,e)=>new ce({shape:()=>t,unknownKeys:"strict",catchall:be.create(),typeName:x.ZodObject,...N(e)});ce.lazycreate=(t,e)=>new ce({shape:t,unknownKeys:"strip",catchall:be.create(),typeName:x.ZodObject,...N(e)});yt=class extends P{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function s(i){for(let a of i)if(a.result.status==="valid")return a.result;for(let a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let o=i.map(a=>new ae(a.ctx.common.issues));return g(r,{code:f.invalid_union,unionErrors:o}),T}if(r.common.async)return Promise.all(n.map(async i=>{let o={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(s);{let i,o=[];for(let d of n){let l={...r,common:{...r.common,issues:[]},parent:null},p=d._parseSync({data:r.data,path:r.path,parent:l});if(p.status==="valid")return p;p.status==="dirty"&&!i&&(i={result:p,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let a=o.map(d=>new ae(d));return g(r,{code:f.invalid_union,unionErrors:a}),T}}get options(){return this._def.options}};yt.create=(t,e)=>new yt({options:t,typeName:x.ZodUnion,...N(e)});De=t=>t instanceof Et?De(t.schema):t instanceof he?De(t.innerType()):t instanceof vt?[t.value]:t instanceof wt?t.options:t instanceof St?M.objectValues(t.enum):t instanceof _t?De(t._def.innerType):t instanceof mt?[void 0]:t instanceof gt?[null]:t instanceof ue?[void 0,...De(t.unwrap())]:t instanceof ke?[null,...De(t.unwrap())]:t instanceof ar||t instanceof xt?De(t.unwrap()):t instanceof Tt?De(t._def.innerType):[],Jr=class t extends P{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==b.object)return g(r,{code:f.invalid_type,expected:b.object,received:r.parsedType}),T;let n=this.discriminator,s=r.data[n],i=this.optionsMap.get(s);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(g(r,{code:f.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),T)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let s=new Map;for(let i of r){let o=De(i.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of o){if(s.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);s.set(a,i)}}return new t({typeName:x.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:s,...N(n)})}};bt=class extends P{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),s=(i,o)=>{if(zr(i)||zr(o))return T;let a=Kn(i.value,o.value);return a.valid?((Gr(i)||Gr(o))&&r.dirty(),{status:r.value,value:a.data}):(g(n,{code:f.invalid_intersection_types}),T)};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(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};bt.create=(t,e,r)=>new bt({left:t,right:e,typeName:x.ZodIntersection,...N(r)});xe=class t extends P{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==b.array)return g(n,{code:f.invalid_type,expected:b.array,received:n.parsedType}),T;if(n.data.length<this._def.items.length)return g(n,{code:f.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),T;!this._def.rest&&n.data.length>this._def.items.length&&(g(n,{code:f.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((o,a)=>{let d=this._def.items[a]||this._def.rest;return d?d._parse(new pe(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>Z.mergeArray(r,o)):Z.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};xe.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new xe({items:t,typeName:x.ZodTuple,rest:null,...N(e)})};Xr=class t extends P{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==b.object)return g(n,{code:f.invalid_type,expected:b.object,received:n.parsedType}),T;let s=[],i=this._def.keyType,o=this._def.valueType;for(let a in n.data)s.push({key:i._parse(new pe(n,a,n.path,a)),value:o._parse(new pe(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?Z.mergeObjectAsync(r,s):Z.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof P?new t({keyType:e,valueType:r,typeName:x.ZodRecord,...N(n)}):new t({keyType:Xe.create(),valueType:e,typeName:x.ZodRecord,...N(r)})}},Ht=class extends P{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==b.map)return g(n,{code:f.invalid_type,expected:b.map,received:n.parsedType}),T;let s=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([a,d],l)=>({key:s._parse(new pe(n,a,n.path,[l,"key"])),value:i._parse(new pe(n,d,n.path,[l,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let d of o){let l=await d.key,p=await d.value;if(l.status==="aborted"||p.status==="aborted")return T;(l.status==="dirty"||p.status==="dirty")&&r.dirty(),a.set(l.value,p.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let d of o){let l=d.key,p=d.value;if(l.status==="aborted"||p.status==="aborted")return T;(l.status==="dirty"||p.status==="dirty")&&r.dirty(),a.set(l.value,p.value)}return{status:r.value,value:a}}}};Ht.create=(t,e,r)=>new Ht({valueType:e,keyType:t,typeName:x.ZodMap,...N(r)});qt=class t extends P{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==b.set)return g(n,{code:f.invalid_type,expected:b.set,received:n.parsedType}),T;let s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(g(n,{code:f.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(g(n,{code:f.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let i=this._def.valueType;function o(d){let l=new Set;for(let p of d){if(p.status==="aborted")return T;p.status==="dirty"&&r.dirty(),l.add(p.value)}return{status:r.value,value:l}}let a=[...n.data.values()].map((d,l)=>i._parse(new pe(n,d,n.path,l)));return n.common.async?Promise.all(a).then(d=>o(d)):o(a)}min(e,r){return new t({...this._def,minSize:{value:e,message:w.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:w.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};qt.create=(t,e)=>new qt({valueType:t,minSize:null,maxSize:null,typeName:x.ZodSet,...N(e)});Kr=class t extends P{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==b.function)return g(r,{code:f.invalid_type,expected:b.function,received:r.parsedType}),T;function n(a,d){return or({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Lt(),Oe].filter(l=>!!l),issueData:{code:f.invalid_arguments,argumentsError:d}})}function s(a,d){return or({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Lt(),Oe].filter(l=>!!l),issueData:{code:f.invalid_return_type,returnTypeError:d}})}let i={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof Ye){let a=this;return re(async function(...d){let l=new ae([]),p=await a._def.args.parseAsync(d,i).catch(E=>{throw l.addIssue(n(d,E)),l}),u=await Reflect.apply(o,this,p);return await a._def.returns._def.type.parseAsync(u,i).catch(E=>{throw l.addIssue(s(u,E)),l})})}else{let a=this;return re(function(...d){let l=a._def.args.safeParse(d,i);if(!l.success)throw new ae([n(d,l.error)]);let p=Reflect.apply(o,this,l.data),u=a._def.returns.safeParse(p,i);if(!u.success)throw new ae([s(p,u.error)]);return u.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:xe.create(e).rest(Pe.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||xe.create([]).rest(Pe.create()),returns:r||Pe.create(),typeName:x.ZodFunction,...N(n)})}},Et=class extends P{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Et.create=(t,e)=>new Et({getter:t,typeName:x.ZodLazy,...N(e)});vt=class extends P{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return g(r,{received:r.data,code:f.invalid_literal,expected:this._def.value}),T}return{status:"valid",value:e.data}}get value(){return this._def.value}};vt.create=(t,e)=>new vt({value:t,typeName:x.ZodLiteral,...N(e)});wt=class t extends P{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return g(r,{expected:M.joinValues(n),received:r.parsedType,code:f.invalid_type}),T}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return g(r,{received:r.data,code:f.invalid_enum_value,options:n}),T}return re(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};wt.create=Ri;St=class extends P{_parse(e){let r=M.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==b.string&&n.parsedType!==b.number){let s=M.objectValues(r);return g(n,{expected:M.joinValues(s),received:n.parsedType,code:f.invalid_type}),T}if(this._cache||(this._cache=new Set(M.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let s=M.objectValues(r);return g(n,{received:n.data,code:f.invalid_enum_value,options:s}),T}return re(e.data)}get enum(){return this._def.values}};St.create=(t,e)=>new St({values:t,typeName:x.ZodNativeEnum,...N(e)});Ye=class extends P{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==b.promise&&r.common.async===!1)return g(r,{code:f.invalid_type,expected:b.promise,received:r.parsedType}),T;let n=r.parsedType===b.promise?r.data:Promise.resolve(r.data);return re(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Ye.create=(t,e)=>new Ye({type:t,typeName:x.ZodPromise,...N(e)});he=class extends P{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===x.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:o=>{g(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){let o=s.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async a=>{if(r.value==="aborted")return T;let d=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return d.status==="aborted"?T:d.status==="dirty"?lt(d.value):r.value==="dirty"?lt(d.value):d});{if(r.value==="aborted")return T;let a=this._def.schema._parseSync({data:o,path:n.path,parent:n});return a.status==="aborted"?T:a.status==="dirty"?lt(a.value):r.value==="dirty"?lt(a.value):a}}if(s.type==="refinement"){let o=a=>{let d=s.refinement(a,i);if(n.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?T:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?T:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(s.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Je(o))return T;let a=s.transform(o.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Je(o)?Promise.resolve(s.transform(o.value,i)).then(a=>({status:r.value,value:a})):T);M.assertNever(s)}};he.create=(t,e,r)=>new he({schema:t,typeName:x.ZodEffects,effect:e,...N(r)});he.createWithPreprocess=(t,e,r)=>new he({schema:e,effect:{type:"preprocess",transform:t},typeName:x.ZodEffects,...N(r)});ue=class extends P{_parse(e){return this._getType(e)===b.undefined?re(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ue.create=(t,e)=>new ue({innerType:t,typeName:x.ZodOptional,...N(e)});ke=class extends P{_parse(e){return this._getType(e)===b.null?re(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ke.create=(t,e)=>new ke({innerType:t,typeName:x.ZodNullable,...N(e)});_t=class extends P{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===b.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};_t.create=(t,e)=>new _t({innerType:t,typeName:x.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...N(e)});Tt=class extends P{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Ut(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ae(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ae(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Tt.create=(t,e)=>new Tt({innerType:t,typeName:x.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...N(e)});Ft=class extends P{_parse(e){if(this._getType(e)!==b.nan){let n=this._getOrReturnCtx(e);return g(n,{code:f.invalid_type,expected:b.nan,received:n.parsedType}),T}return{status:"valid",value:e.data}}};Ft.create=t=>new Ft({typeName:x.ZodNaN,...N(t)});bd=Symbol("zod_brand"),ar=class extends P{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},cr=class t extends P{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?T:i.status==="dirty"?(r.dirty(),lt(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?T:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:x.ZodPipeline})}},xt=class extends P{_parse(e){let r=this._def.innerType._parse(e),n=s=>(Je(s)&&(s.value=Object.freeze(s.value)),s);return Ut(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}};xt.create=(t,e)=>new xt({innerType:t,typeName:x.ZodReadonly,...N(e)});Ed={object:ce.lazycreate};(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(x||(x={}));vd=(t,e={message:`Input not instance of ${t.name}`})=>Ai(r=>r instanceof t,e),Ii=Xe.create,Ci=ut.create,wd=Ft.create,Sd=pt.create,Ni=ht.create,_d=ft.create,Td=jt.create,xd=mt.create,kd=gt.create,Rd=Ke.create,Ad=Pe.create,Id=be.create,Cd=$t.create,Nd=Le.create,Od=ce.create,Dd=ce.strictCreate,Pd=yt.create,Ld=Jr.create,Ud=bt.create,Md=xe.create,jd=Xr.create,$d=Ht.create,Hd=qt.create,qd=Kr.create,Fd=Et.create,Bd=vt.create,Wd=wt.create,Vd=St.create,zd=Ye.create,Gd=he.create,Jd=ue.create,Xd=ke.create,Kd=he.createWithPreprocess,Yd=cr.create,Zd=()=>Ii().optional(),Qd=()=>Ci().optional(),el=()=>Ni().optional(),tl={string:t=>Xe.create({...t,coerce:!0}),number:t=>ut.create({...t,coerce:!0}),boolean:t=>ht.create({...t,coerce:!0}),bigint:t=>pt.create({...t,coerce:!0}),date:t=>ft.create({...t,coerce:!0})},rl=T});var c={};Bn(c,{BRAND:()=>bd,DIRTY:()=>lt,EMPTY_PATH:()=>Kc,INVALID:()=>T,NEVER:()=>rl,OK:()=>re,ParseStatus:()=>Z,Schema:()=>P,ZodAny:()=>Ke,ZodArray:()=>Le,ZodBigInt:()=>pt,ZodBoolean:()=>ht,ZodBranded:()=>ar,ZodCatch:()=>Tt,ZodDate:()=>ft,ZodDefault:()=>_t,ZodDiscriminatedUnion:()=>Jr,ZodEffects:()=>he,ZodEnum:()=>wt,ZodError:()=>ae,ZodFirstPartyTypeKind:()=>x,ZodFunction:()=>Kr,ZodIntersection:()=>bt,ZodIssueCode:()=>f,ZodLazy:()=>Et,ZodLiteral:()=>vt,ZodMap:()=>Ht,ZodNaN:()=>Ft,ZodNativeEnum:()=>St,ZodNever:()=>be,ZodNull:()=>gt,ZodNullable:()=>ke,ZodNumber:()=>ut,ZodObject:()=>ce,ZodOptional:()=>ue,ZodParsedType:()=>b,ZodPipeline:()=>cr,ZodPromise:()=>Ye,ZodReadonly:()=>xt,ZodRecord:()=>Xr,ZodSchema:()=>P,ZodSet:()=>qt,ZodString:()=>Xe,ZodSymbol:()=>jt,ZodTransformer:()=>he,ZodTuple:()=>xe,ZodType:()=>P,ZodUndefined:()=>mt,ZodUnion:()=>yt,ZodUnknown:()=>Pe,ZodVoid:()=>$t,addIssueToContext:()=>g,any:()=>Rd,array:()=>Nd,bigint:()=>Sd,boolean:()=>Ni,coerce:()=>tl,custom:()=>Ai,date:()=>_d,datetimeRegex:()=>ki,defaultErrorMap:()=>Oe,discriminatedUnion:()=>Ld,effect:()=>Gd,enum:()=>Wd,function:()=>qd,getErrorMap:()=>Lt,getParsedType:()=>Te,instanceof:()=>vd,intersection:()=>Ud,isAborted:()=>zr,isAsync:()=>Ut,isDirty:()=>Gr,isValid:()=>Je,late:()=>Ed,lazy:()=>Fd,literal:()=>Bd,makeIssue:()=>or,map:()=>$d,nan:()=>wd,nativeEnum:()=>Vd,never:()=>Id,null:()=>kd,nullable:()=>Xd,number:()=>Ci,object:()=>Od,objectUtil:()=>zn,oboolean:()=>el,onumber:()=>Qd,optional:()=>Jd,ostring:()=>Zd,pipeline:()=>Yd,preprocess:()=>Kd,promise:()=>zd,quotelessJson:()=>Gc,record:()=>jd,set:()=>Hd,setErrorMap:()=>Xc,strictObject:()=>Dd,string:()=>Ii,symbol:()=>Td,transformer:()=>Gd,tuple:()=>Md,undefined:()=>xd,union:()=>Pd,unknown:()=>Ad,util:()=>M,void:()=>Cd});var Yn=A(()=>{Vr();Jn();vi();ir();Oi();Wr()});var ie=A(()=>{Yn();Yn()});var nl,Re,Di,Bt=A(()=>{ie();nl=c.object({id:c.string().min(1).max(128),name:c.string().min(1).max(200),source:c.string().max(200),pluginId:c.string().max(200).optional(),path:c.string().max(4096).optional()}),Re=c.array(nl).max(1).optional(),Di=c.object({taskId:c.string().min(1).optional(),repoId:c.string().min(1).optional(),agent:c.enum(["claude","codex"]).optional()}).refine(t=>t.taskId?!t.repoId&&!t.agent:!!t.repoId&&!!t.agent,"Select a task or a repository and agent")});var Ze,Zn,Yr,_m,Qn,es,sl,Tm,kt=A(()=>{"use strict";ie();Ze=c.enum(["stable","preview"]),Zn=c.object({schemaVersion:c.literal(1),status:c.enum(["applying","succeeded","failed","deferred"]),previousVersion:c.string(),targetVersion:c.string(),reason:c.string(),checkedAt:c.string()}),Yr=c.union([c.object({channel:Ze}).strict(),c.object({autoUpdate:c.boolean()}).strict()]),_m=c.union([c.object({action:c.enum(["visit","check"])}).strict(),c.object({action:c.literal("install"),version:c.string().min(1).max(100)}).strict()]),Qn=c.object({channel:Ze,currentVersion:c.string(),targetVersion:c.string().nullable(),checkedAt:c.string().datetime(),eligible:c.boolean(),error:c.boolean()}),es=c.object({id:c.string().uuid(),channel:Ze,currentVersion:c.string(),targetVersion:c.string(),automatic:c.boolean()}),sl=c.object({availability:c.enum(["available","not-installed","source-install","installation-mismatch","permission-required","authentication-required","unavailable"]),settings:c.object({channel:Ze,autoUpdate:c.boolean(),independentExecutions:c.boolean().optional(),discovery:Qn.nullable(),pending:es.nullable(),lastUpdate:Zn.nullable()}).nullable()}),Tm=c.union([c.object({ok:c.literal(!0),state:sl}),c.object({ok:c.literal(!1),error:c.enum(["busy","unavailable","save-failed","stale-update","update-failed"])})])});var il,Wt,ts,Pi=A(()=>{ie();il=c.string().trim().min(1).max(4096).refine(t=>!/[\x00-\x1f\x7f]/.test(t),"Path contains control characters"),Wt=c.array(il).max(64),ts=c.discriminatedUnion("action",[c.object({action:c.literal("set"),paths:Wt}).strict(),c.object({action:c.literal("add"),paths:Wt.min(1)}).strict(),c.object({action:c.literal("remove"),paths:Wt.min(1)}).strict(),c.object({action:c.literal("reset")}).strict()])});var rs,F,J,dr,Qe,ns,Cm,Nm,Om,Dm,Pm,Lm,ol,Li,Ui,Um,Mm,al,jm,$m,cl,dl,Hm,ll,qm,Fm,Bm,Wm,Vm,ul,zm,Gm,Jm,Mi,Xm,Km,lr=A(()=>{"use strict";Bt();ie();kt();Pi();rs=c.enum(["claude","codex"]),F=c.string(),J=F.min(1),dr={permission:F.optional(),model:F.optional(),effort:F.optional()},Qe=c.object({mediaType:F,data:F}),ns=c.array(Qe).optional(),Cm=c.object({path:J,name:F.optional(),defaultBaseRef:F.optional()}),Nm=c.object({repoId:J,agent:rs,prompt:F,skills:Re,...dr,title:F.optional(),images:ns,isolate:c.boolean().optional()}),Om=c.object({prompt:F,images:ns,...dr}),Dm=c.object({title:F.trim().min(1,"Enter a session name.").max(200,"Use 200 characters or fewer.").regex(/^[^\r\n]*$/,"Use a single line for the session name.")}),Pm=c.object({text:F,images:ns,...dr}),Lm=c.object({decision:c.enum(["approve","deny"]),scope:F.optional()}),ol=c.object({questionId:J.optional(),question:F,selected:c.array(F),notes:F.optional()}),Li=c.object({requestId:J,answers:c.array(ol),response:F.optional()}),Ui={preset:c.enum(["hourly","daily","weekly","weekdays","manual","custom"]).optional(),schedule:F.optional(),hour:c.number().int().min(0).max(23).optional(),dayOfWeek:c.number().int().min(0).max(6).optional()},Um=c.object({repoId:J,agent:rs,prompt:J,...Ui,...dr,title:F.optional()}),Mm=c.object({prompt:J.optional(),...Ui,...dr,title:F.optional(),enabled:c.boolean().optional()}),al=c.object({endpoint:J,expirationTime:c.number().nullable().optional(),keys:c.record(F).optional()}),jm=c.object({subscription:al}),$m=c.object({endpoint:J}),cl=c.object({agent:rs,sessionId:J,cwd:J,home:J,waitPid:c.number().int().positive()}),dl=c.enum(["queued","running","awaiting_approval","awaiting_input","idle","archived","failed","cancelled"]),Hm=c.object({status:dl.optional()}),ll=c.coerce.number().int().min(1).max(Number.MAX_SAFE_INTEGER),qm=c.object({before:ll}),Fm=c.object({path:F.min(1).max(4096).regex(/^[^\u0000-\u001f\u007f]*$/)}),Bm=c.object({task:F.optional(),lastEventId:F.optional(),tail:c.literal("1").optional(),snapshots:c.literal("1").optional()}),Wm=c.object({path:F.optional()}),Vm=c.object({refresh:c.enum(["0","1"]).optional()}),ul=c.object({id:J}),zm=ul.extend({messageId:J}),Gm=c.object({}),Jm=c.object({token:F.optional()}),Mi={id:J,rawId:J,type:c.literal("public-key"),authenticatorAttachment:c.enum(["platform","cross-platform"]).optional(),clientExtensionResults:c.object({}).passthrough()},Xm=c.object({...Mi,response:c.object({clientDataJSON:J,authenticatorData:J,signature:J,userHandle:F.optional()})}),Km=c.object({response:c.object({...Mi,response:c.object({clientDataJSON:J,attestationObject:J,transports:c.array(c.enum(["ble","cable","hybrid","internal","nfc","smart-card","usb"])).optional(),publicKeyAlgorithm:c.number().optional(),publicKey:F.optional(),authenticatorData:F.optional()})}),label:F.optional()})});var pl,ng,sg,ji=A(()=>{Bt();ie();lr();pl=c.object({model:c.string().optional(),effort:c.string().optional(),permission:c.string().optional()}),ng=c.object({clientMessageId:c.string().uuid(),mode:c.enum(["send","queue"]),text:c.string().trim().min(1).max(1e5),skills:Re,images:c.array(Qe).optional(),expectedRunId:c.string().nullable(),settings:pl.optional()}),sg=c.discriminatedUnion("action",[c.object({action:c.literal("edit"),version:c.number().int(),token:c.string().uuid()}),c.object({action:c.literal("renew"),token:c.string().uuid()}),c.object({action:c.literal("save"),token:c.string().uuid(),version:c.number().int(),text:c.string().trim().min(1).max(1e5),skills:Re,images:c.array(Qe).optional()}),c.object({action:c.literal("release"),token:c.string().uuid()}),c.object({action:c.literal("delete"),version:c.number().int()}),c.object({action:c.literal("send"),version:c.number().int(),expectedRunId:c.string().nullable()})])});var $i,Hi=A(()=>{$i={preserveHost:!0,publicHttpsRequired:!0,cacheApi:!1,maxBodyBytes:48e6,sse:{path:"/api/stream",buffering:!1,readTimeoutSeconds:3600},websocket:{pathPattern:"/api/terminals/:id/stream",upgrade:!0,idleTimeoutSeconds:60},perClientLimits:{authRequestsPerSecond:5,authBurst:10,apiRequestsPerSecond:20,apiBurst:40,apiConnections:30,terminalConnections:16}}});var cg,dg,qi=A(()=>{ie();cg=c.object({id:c.string().uuid(),mediaType:c.enum(["image/png","image/jpeg","image/gif","image/webp"]),size:c.number().int().positive()}),dg=c.object({id:c.string().min(1),attachmentId:c.string().uuid()})});var hg,Fi=A(()=>{ie();Bt();hg=c.object({context:Di,sdp:c.string().min(1).max(65536).startsWith("v=0")})});var oe=A(()=>{"use strict";pi();hi();fi();mi();gi();bi();ji();Hi();Bt();qi();Fi()});import{chmodSync as Gi,mkdirSync as Ji,openSync as Bi,closeSync as Wi,fsyncSync as Vi,writeFileSync as hl,renameSync as fl,unlinkSync as ml}from"node:fs";import{dirname as zi}from"node:path";import{randomUUID as gl}from"node:crypto";function K(t){Ji(t,{recursive:!0,mode:448}),Gi(t,448)}function Ee(t){Ji(t,{recursive:!0,mode:448})}function Ae(t){Gi(t,384)}function ve(t,e){Ee(zi(t));let r=`${t}.${gl()}.tmp`,n=Bi(r,"wx",384);try{try{hl(n,e),Vi(n)}finally{Wi(n)}fl(r,t);let s=Bi(zi(t),"r");try{Vi(s)}finally{Wi(s)}}finally{try{ml(r)}catch(s){if(s.code!=="ENOENT")throw s}}}var Q=A(()=>{});var un,su,gs=A(()=>{un={maxBytes:1073741824,minFreeBytes:268435456,unusedGraceMs:864e5,retentionMs:0},su=60*60*1e3});import{homedir as yo}from"node:os";import{join as iu}from"node:path";function Ot(t){return t==="~"?yo():t.startsWith("~/")?iu(yo(),t.slice(2)):t}var pn=A(()=>{});import{homedir as ou}from"node:os";import{existsSync as bo}from"node:fs";import{dirname as So,join as Zt,resolve as Dt}from"node:path";import{fileURLToPath as au}from"node:url";function uu(t){let e={};for(let[r,n]of Object.entries(t))n!==void 0&&n!==""&&(e[r]=n);return e}var cu,du,lu,L,_o,ys,bs,Eo,vo,wo,Qt,hr=A(()=>{ie();oe();gs();pn();cu=So(au(import.meta.url)),du=t=>t==="localhost"||t==="::1"||/^127(?:\.\d{1,3}){3}$/.test(t),lu=c.object({PORT:c.coerce.number().int().positive().default(4e3),HOST:c.string().min(1).refine(du,"HOST must be loopback; terminate public HTTPS at the reverse proxy").default("localhost"),ATTACHMENT_MAX_BYTES:c.coerce.number().int().positive().safe().default(un.maxBytes),ATTACHMENT_MIN_FREE_BYTES:c.coerce.number().int().nonnegative().safe().default(un.minFreeBytes),ATTACHMENT_UNUSED_GRACE_HOURS:c.coerce.number().int().min(1).max(8760).default(24),ATTACHMENT_RETENTION_DAYS:c.coerce.number().int().min(0).max(36500).default(0),DISPATCH_CONCURRENCY:c.coerce.number().int().min(1).default(8),SSE_KEEPALIVE_MS:c.coerce.number().int().positive().default(15e3),AUTH_SESSION_TTL_MS:c.coerce.number().int().positive().default(30*24*60*60*1e3),AUTH_COOKIE_NAME:c.string().min(1).default("palmagent_session"),AUTH_RP_ID:c.string().min(1).regex(/^[A-Za-z0-9.-]+$/,"AUTH_RP_ID must be a hostname without a scheme, path, or port").optional(),AUTH_RP_NAME:c.string().min(1).optional(),AUTH_ORIGIN:c.string().url().startsWith("https://","AUTH_ORIGIN must use https://").optional(),AUTH_ENABLED:c.string().optional(),AUTH_DISABLED:c.string().optional(),PUSH_SUBJECT:c.string().regex(/^(mailto:|https:\/\/)/,"PUSH_SUBJECT must be a mailto: or https:// URL").optional(),DISPATCHER_DATA_DIR:c.string().min(1).optional(),XDG_STATE_HOME:c.string().min(1).optional(),DISPATCHER_DB:c.string().min(1).optional(),VAPID_KEY_PATH:c.string().min(1).optional(),STATIC_DIR:c.string().min(1).optional(),REPO_ROOTS:c.string().optional(),GITHUB_TOKEN:c.string().min(1).optional(),RUNNER_SOCKET:c.string().min(1).optional(),EXECUTION_RELEASE:c.string().min(1).optional(),EXECUTION_NODE:c.string().min(1).optional(),CLAUDE_MODEL:c.string().min(1).optional(),CODEX_MODEL:c.string().min(1).optional(),CLAUDE_EFFORT:c.string().min(1).optional(),CODEX_EFFORT:c.string().min(1).optional(),CLAUDE_CONFIG_DIR:c.string().min(1).optional(),NODE_ENV:c.string().optional()}).passthrough();L=lu.parse(uu(process.env)),_o=L.AUTH_DISABLED==="1"?!1:L.AUTH_ENABLED==="1"?!0:L.NODE_ENV==="production",ys=L.AUTH_RP_ID??(_o?"":"localhost"),bs=L.DISPATCHER_DATA_DIR?Dt(L.DISPATCHER_DATA_DIR):L.XDG_STATE_HOME?Zt(Dt(L.XDG_STATE_HOME),R.stateDirName):Zt(ou(),".local","state",R.stateDirName),Eo=Zt(bs,"palmagent.db"),vo=Zt(bs,"dispatcher.db"),wo=L.DISPATCHER_DB?Dt(L.DISPATCHER_DB):bo(Eo)||!bo(vo)?Eo:vo,Qt={port:L.PORT,host:L.HOST,concurrency:L.DISPATCH_CONCURRENCY,attachmentStorage:{maxBytes:L.ATTACHMENT_MAX_BYTES,minFreeBytes:L.ATTACHMENT_MIN_FREE_BYTES,unusedGraceMs:L.ATTACHMENT_UNUSED_GRACE_HOURS*60*60*1e3,retentionMs:L.ATTACHMENT_RETENTION_DAYS*24*60*60*1e3},dataDir:bs,dbPath:wo,keepAliveMs:L.SSE_KEEPALIVE_MS,claudeModel:L.CLAUDE_MODEL,codexModel:L.CODEX_MODEL,claudeEffort:L.CLAUDE_EFFORT,codexEffort:L.CODEX_EFFORT,claudeConfigDir:L.CLAUDE_CONFIG_DIR?Dt(Ot(L.CLAUDE_CONFIG_DIR)):void 0,vapidKeyPath:L.VAPID_KEY_PATH?Dt(L.VAPID_KEY_PATH):Zt(So(wo),"vapid.json"),pushSubject:L.PUSH_SUBJECT,staticDir:L.STATIC_DIR?Dt(L.STATIC_DIR):Zt(cu,"..","..","web","dist"),repoRoots:(L.REPO_ROOTS??"").split(":").filter(Boolean).map(t=>Dt(Ot(t))),runnerSocket:L.RUNNER_SOCKET,executionRelease:L.EXECUTION_RELEASE,executionNode:L.EXECUTION_NODE,githubToken:L.GITHUB_TOKEN,authEnabled:_o,rpId:ys,rpName:L.AUTH_RP_NAME??R.displayName,authOrigin:L.AUTH_ORIGIN??(ys?`https://${ys}`:""),sessionTtlMs:L.AUTH_SESSION_TTL_MS,cookieName:L.AUTH_COOKIE_NAME,nodeEnv:L.NODE_ENV}});var hn=A(()=>{});import{createHash as hu}from"node:crypto";import{readFileSync as To,readdirSync as Fy,realpathSync as By,statSync as Wy}from"node:fs";function Es(t){if(!Number.isSafeInteger(t)||t<=1)throw new Error("A valid local CLI process id is required");try{let e=To(`/proc/${t}/stat`,"utf8"),r=e.slice(e.lastIndexOf(")")+2).split(" ");return r[0]==="Z"?void 0:`${To("/proc/sys/kernel/random/boot_id","utf8").trim()}:${r[19]}`}catch(e){if(e.code==="ENOENT")return;throw new Error("Cannot verify the local CLI process; ownership is retained")}}var fu,mu,vs=A(()=>{hr();hn();fu=t=>hu("sha256").update(t).digest("hex");mu=fu(Buffer.alloc(0))});var z,Tr=A(()=>{z=class extends Error{constructor(r,n){super(n);this.status=r}}});var ia=A(()=>{Tr()});var LE,Ls=A(()=>{gs();Tr();hn();Q();LE=4.5*1024*1024});var oa=A(()=>{});var Us=A(()=>{Ls()});var aa=A(()=>{});function Rp({permission:t,model:e,effort:r,resumeId:n}){let s=["-p","--input-format","stream-json","--output-format","stream-json","--verbose","--include-partial-messages","--permission-mode",kp(t),"--permission-prompt-tool","stdio"];return e&&s.push("--model",e),r&&s.push("--effort",r),n&&s.push("--resume",n),s}function Ap(t,e=[]){let r=e.map(n=>({type:"image",source:{type:"base64",media_type:n.mediaType,data:n.data}}));return r.push({type:"text",text:t}),{type:"user",message:{role:"user",content:r}}}function da(t,e){return e?.length?`/${e[0].name} ${t}`:t}var xp,ca,kp,Sn,la=A(()=>{oe();hr();xp=1500,ca={plan:"plan",acceptEdits:"acceptEdits",dontAsk:"dontAsk",bypassPermissions:"bypassPermissions",readonly:"plan","auto-edit":"acceptEdits",full:"bypassPermissions"},kp=t=>ca[t??""]??ca[Wn.claude];Sn=class{agent="claude";start(e,r,n){let{taskId:s,cwd:i,prompt:o,images:a,resumeId:d,permission:l,model:p,effort:u,reattach:h,resumeFromSeq:E,pendingInput:S}=e,I=Rp({permission:l,model:p,effort:u,resumeId:d});e.interactive&&I.push("--replay-user-messages");let m=d,O=e.providerHome??Qt.claudeConfigDir,B=O?{CLAUDE_CONFIG_DIR:O}:void 0,q=h?n.attach(s,0):n.start({turnId:s,command:"claude",argv:I,cwd:i,env:B});if(!q)return r({taskId:s,kind:"status",sessionId:m,payload:{subtype:"reattach_failed"}}),{steer:()=>!1,interrupt:()=>!1,approve:()=>!1,answer:()=>!1,cancel:()=>{},done:Promise.resolve()};let v,D=W=>{v&&(clearTimeout(v.timer),v.resolve(W),v=void 0,k=!1)},_,k=!1,C,j,ge=!1,_e=0,sr=new Map;h&&S&&sr.set(S.requestId,{questions:S.questions});let ct=W=>q.writeStdin(JSON.stringify(W)+`
2
+ var Bc=Object.defineProperty;var A=(t,e)=>()=>(t&&(e=t(t=0)),e);var Bn=(t,e)=>{for(var r in e)Bc(t,r,{get:e[r],enumerable:!0})};var pi=A(()=>{});function Vc(t){let e=Wc.exec(t);return e?{repo:e[1],number:Number(e[2])}:null}function Br(t){let e=Vc(t);return e?{url:t,number:e.number,repo:e.repo,status:"open",checks:"unknown"}:null}var Wc,hi=A(()=>{Wc=/^https:\/\/github\.com\/([\w.-]+\/[\w.-]+)\/pull\/(\d+)/});var Wn,fi=A(()=>{Wn={claude:"acceptEdits",codex:"workspace-write"}});var mi=A(()=>{});var R,gi=A(()=>{R={productName:"Palmagent",displayName:"PalmAgent",packageName:"palmagent",cliName:"palmagent",unitBase:"palmagent",stateDirName:"palmagent"}});var dt,Vn=A(()=>{dt={claude:{range:">=2.1.268 <2.2.0",minimum:"2.1.268",exclusiveMaximum:"2.2.0"},codex:{range:">=0.154.0 <0.156.0",minimum:"0.154.0",exclusiveMaximum:"0.156.0"}}});function yi(t,e){let r=o=>/^\d+\.\d+\.\d+$/.test(o)?o.split(".").map(Number):void 0,n=r(e);if(!n)return!1;let s=o=>{let a=r(o);for(let d=0;d<3;d++)if(n[d]!==a[d])return n[d]-a[d];return 0},i=dt[t];return s(i.minimum)>=0&&s(i.exclusiveMaximum)<0}var bi=A(()=>{Vn();Vn()});var M,zn,b,Te,ir=A(()=>{(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function r(s){throw new Error}t.assertNever=r,t.arrayToEnum=s=>{let i={};for(let o of s)i[o]=o;return i},t.getValidEnumValues=s=>{let i=t.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),o={};for(let a of i)o[a]=s[a];return t.objectValues(o)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let i=[];for(let o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},t.find=(s,i)=>{for(let o of s)if(i(o))return o},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=n,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(M||(M={}));(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(zn||(zn={}));b=M.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Te=t=>{switch(typeof t){case"undefined":return b.undefined;case"string":return b.string;case"number":return Number.isNaN(t)?b.nan:b.number;case"boolean":return b.boolean;case"function":return b.function;case"bigint":return b.bigint;case"symbol":return b.symbol;case"object":return Array.isArray(t)?b.array:t===null?b.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?b.promise:typeof Map<"u"&&t instanceof Map?b.map:typeof Set<"u"&&t instanceof Set?b.set:typeof Date<"u"&&t instanceof Date?b.date:b.object;default:return b.unknown}}});var f,Gc,ae,Wr=A(()=>{ir();f=M.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Gc=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),ae=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(i){return i.message},n={_errors:[]},s=i=>{for(let o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let a=n,d=0;for(;d<o.path.length;){let l=o.path[d];d===o.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(r(o))):a[l]=a[l]||{_errors:[]},a=a[l],d++}}};return s(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,M.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let s of this.issues)if(s.path.length>0){let i=s.path[0];r[i]=r[i]||[],r[i].push(e(s))}else n.push(e(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};ae.create=t=>new ae(t)});var Jc,Oe,Gn=A(()=>{Wr();ir();Jc=(t,e)=>{let r;switch(t.code){case f.invalid_type:t.received===b.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case f.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,M.jsonStringifyReplacer)}`;break;case f.unrecognized_keys:r=`Unrecognized key(s) in object: ${M.joinValues(t.keys,", ")}`;break;case f.invalid_union:r="Invalid input";break;case f.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${M.joinValues(t.options)}`;break;case f.invalid_enum_value:r=`Invalid enum value. Expected ${M.joinValues(t.options)}, received '${t.received}'`;break;case f.invalid_arguments:r="Invalid function arguments";break;case f.invalid_return_type:r="Invalid function return type";break;case f.invalid_date:r="Invalid date";break;case f.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:M.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case f.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case f.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case f.custom:r="Invalid input";break;case f.invalid_intersection_types:r="Intersection results could not be merged";break;case f.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case f.not_finite:r="Number must be finite";break;default:r=e.defaultError,M.assertNever(t)}return{message:r}},Oe=Jc});function Xc(t){Ei=t}function Lt(){return Ei}var Ei,Vr=A(()=>{Gn();Ei=Oe});function g(t,e){let r=Lt(),n=or({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Oe?void 0:Oe].filter(s=>!!s)});t.common.issues.push(n)}var or,Kc,Z,T,lt,re,zr,Gr,Je,Ut,Jn=A(()=>{Vr();Gn();or=t=>{let{data:e,path:r,errorMaps:n,issueData:s}=t,i=[...r,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let a="",d=n.filter(l=>!!l).slice().reverse();for(let l of d)a=l(o,{data:e,defaultError:a}).message;return{...s,path:i,message:a}},Kc=[];Z=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let s of r){if(s.status==="aborted")return T;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let s of r){let i=await s.key,o=await s.value;n.push({key:i,value:o})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let s of r){let{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return T;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(n[i.value]=o.value)}return{status:e.value,value:n}}},T=Object.freeze({status:"aborted"}),lt=t=>({status:"dirty",value:t}),re=t=>({status:"valid",value:t}),zr=t=>t.status==="aborted",Gr=t=>t.status==="dirty",Je=t=>t.status==="valid",Ut=t=>typeof Promise<"u"&&t instanceof Promise});var vi=A(()=>{});var w,wi=A(()=>{(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(w||(w={}))});function N(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:s}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(o,a)=>{let{message:d}=t;return o.code==="invalid_enum_value"?{message:d??a.defaultError}:typeof a.data>"u"?{message:d??n??a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:d??r??a.defaultError}},description:s}}function xi(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function hd(t){return new RegExp(`^${xi(t)}$`)}function ki(t){let e=`${Ti}T${xi(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function fd(t,e){return!!((e==="v4"||!e)&&od.test(t)||(e==="v6"||!e)&&cd.test(t))}function md(t,e){if(!rd.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function gd(t,e){return!!((e==="v4"||!e)&&ad.test(t)||(e==="v6"||!e)&&dd.test(t))}function yd(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=r>n?r:n,i=Number.parseInt(t.toFixed(s).replace(".","")),o=Number.parseInt(e.toFixed(s).replace(".",""));return i%o/10**s}function Mt(t){if(t instanceof ce){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=ue.create(Mt(n))}return new ce({...t._def,shape:()=>e})}else return t instanceof Le?new Le({...t._def,type:Mt(t.element)}):t instanceof ue?ue.create(Mt(t.unwrap())):t instanceof ke?ke.create(Mt(t.unwrap())):t instanceof xe?xe.create(t.items.map(e=>Mt(e))):t}function Kn(t,e){let r=Te(t),n=Te(e);if(t===e)return{valid:!0,data:t};if(r===b.object&&n===b.object){let s=M.objectKeys(e),i=M.objectKeys(t).filter(a=>s.indexOf(a)!==-1),o={...t,...e};for(let a of i){let d=Kn(t[a],e[a]);if(!d.valid)return{valid:!1};o[a]=d.data}return{valid:!0,data:o}}else if(r===b.array&&n===b.array){if(t.length!==e.length)return{valid:!1};let s=[];for(let i=0;i<t.length;i++){let o=t[i],a=e[i],d=Kn(o,a);if(!d.valid)return{valid:!1};s.push(d.data)}return{valid:!0,data:s}}else return r===b.date&&n===b.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}function Ri(t,e){return new wt({values:t,typeName:x.ZodEnum,...N(e)})}function _i(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function Ai(t,e={},r){return t?Ke.create().superRefine((n,s)=>{let i=t(n);if(i instanceof Promise)return i.then(o=>{if(!o){let a=_i(e,n),d=a.fatal??r??!0;s.addIssue({code:"custom",...a,fatal:d})}});if(!i){let o=_i(e,n),a=o.fatal??r??!0;s.addIssue({code:"custom",...o,fatal:a})}}):Ke.create()}var pe,Si,P,Yc,Zc,Qc,ed,td,rd,nd,sd,id,Xn,od,ad,cd,dd,ld,ud,Ti,pd,Xe,ut,pt,ht,ft,jt,mt,gt,Ke,Pe,be,$t,Le,ce,yt,De,Jr,bt,xe,Xr,Ht,qt,Kr,Et,vt,wt,St,Ye,he,ue,ke,_t,Tt,Ft,bd,ar,cr,xt,Ed,x,vd,Ii,Ci,wd,Sd,Ni,_d,Td,xd,kd,Rd,Ad,Id,Cd,Nd,Od,Dd,Pd,Ld,Ud,Md,jd,$d,Hd,qd,Fd,Bd,Wd,Vd,zd,Gd,Jd,Xd,Kd,Yd,Zd,Qd,el,tl,rl,Oi=A(()=>{Wr();Vr();wi();Jn();ir();pe=class{constructor(e,r,n,s){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Si=(t,e)=>{if(Je(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new ae(t.common.issues);return this._error=r,this._error}}};P=class{get description(){return this._def.description}_getType(e){return Te(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Te(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Z,ctx:{common:e.parent.common,data:e.data,parsedType:Te(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Ut(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Te(e)},s=this._parseSync({data:e,path:n.path,parent:n});return Si(n,s)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Te(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return Je(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>Je(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Te(e)},s=this._parse({data:e,path:n.path,parent:n}),i=await(Ut(s)?s:Promise.resolve(s));return Si(n,i)}refine(e,r){let n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,i)=>{let o=e(s),a=()=>i.addIssue({code:f.custom,...n(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(d=>d?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(e){return new he({schema:this,typeName:x.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:r=>this["~validate"](r)}}optional(){return ue.create(this,this._def)}nullable(){return ke.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Le.create(this)}promise(){return Ye.create(this,this._def)}or(e){return yt.create([this,e],this._def)}and(e){return bt.create(this,e,this._def)}transform(e){return new he({...N(this._def),schema:this,typeName:x.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new _t({...N(this._def),innerType:this,defaultValue:r,typeName:x.ZodDefault})}brand(){return new ar({typeName:x.ZodBranded,type:this,...N(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Tt({...N(this._def),innerType:this,catchValue:r,typeName:x.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return cr.create(this,e)}readonly(){return xt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Yc=/^c[^\s-]{8,}$/i,Zc=/^[0-9a-z]+$/,Qc=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ed=/^[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,td=/^[a-z0-9_-]{21}$/i,rd=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,nd=/^[-+]?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)?)??$/,sd=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,id="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",od=/^(?:(?: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])$/,ad=/^(?:(?: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])$/,cd=/^(([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]))$/,dd=/^(([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])$/,ld=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ud=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ti="((\\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])))",pd=new RegExp(`^${Ti}$`);Xe=class t extends P{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==b.string){let i=this._getOrReturnCtx(e);return g(i,{code:f.invalid_type,expected:b.string,received:i.parsedType}),T}let n=new Z,s;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),g(s,{code:f.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(s=this._getOrReturnCtx(e,s),g(s,{code:f.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let o=e.data.length>i.value,a=e.data.length<i.value;(o||a)&&(s=this._getOrReturnCtx(e,s),o?g(s,{code:f.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&g(s,{code:f.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")sd.test(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{validation:"email",code:f.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Xn||(Xn=new RegExp(id,"u")),Xn.test(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{validation:"emoji",code:f.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")ed.test(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{validation:"uuid",code:f.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")td.test(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{validation:"nanoid",code:f.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")Yc.test(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{validation:"cuid",code:f.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")Zc.test(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{validation:"cuid2",code:f.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")Qc.test(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{validation:"ulid",code:f.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),g(s,{validation:"url",code:f.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{validation:"regex",code:f.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),g(s,{code:f.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(s=this._getOrReturnCtx(e,s),g(s,{code:f.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),g(s,{code:f.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?ki(i).test(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{code:f.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?pd.test(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{code:f.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?hd(i).test(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{code:f.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?nd.test(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{validation:"duration",code:f.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?fd(e.data,i.version)||(s=this._getOrReturnCtx(e,s),g(s,{validation:"ip",code:f.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?md(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),g(s,{validation:"jwt",code:f.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?gd(e.data,i.version)||(s=this._getOrReturnCtx(e,s),g(s,{validation:"cidr",code:f.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?ld.test(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{validation:"base64",code:f.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?ud.test(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{validation:"base64url",code:f.invalid_string,message:i.message}),n.dirty()):M.assertNever(i);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(s=>e.test(s),{validation:r,code:f.invalid_string,...w.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...w.errToObj(e)})}url(e){return this._addCheck({kind:"url",...w.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...w.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...w.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...w.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...w.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...w.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...w.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...w.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...w.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...w.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...w.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...w.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:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...w.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:typeof e?.precision>"u"?null:e?.precision,...w.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...w.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...w.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...w.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...w.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...w.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...w.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...w.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...w.errToObj(r)})}nonempty(e){return this.min(1,w.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...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 r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Xe.create=t=>new Xe({checks:[],typeName:x.ZodString,coerce:t?.coerce??!1,...N(t)});ut=class t extends P{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==b.number){let i=this._getOrReturnCtx(e);return g(i,{code:f.invalid_type,expected:b.number,received:i.parsedType}),T}let n,s=new Z;for(let i of this._def.checks)i.kind==="int"?M.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),g(n,{code:f.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),g(n,{code:f.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),g(n,{code:f.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?yd(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),g(n,{code:f.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),g(n,{code:f.not_finite,message:i.message}),s.dirty()):M.assertNever(i);return{status:s.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,w.toString(r))}gt(e,r){return this.setLimit("min",e,!1,w.toString(r))}lte(e,r){return this.setLimit("max",e,!0,w.toString(r))}lt(e,r){return this.setLimit("max",e,!1,w.toString(r))}setLimit(e,r,n,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:w.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:w.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:w.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:w.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:w.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:w.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:w.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:w.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:w.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:w.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&M.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};ut.create=t=>new ut({checks:[],typeName:x.ZodNumber,coerce:t?.coerce||!1,...N(t)});pt=class t extends P{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==b.bigint)return this._getInvalidInput(e);let n,s=new Z;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),g(n,{code:f.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),g(n,{code:f.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),g(n,{code:f.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):M.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return g(r,{code:f.invalid_type,expected:b.bigint,received:r.parsedType}),T}gte(e,r){return this.setLimit("min",e,!0,w.toString(r))}gt(e,r){return this.setLimit("min",e,!1,w.toString(r))}lte(e,r){return this.setLimit("max",e,!0,w.toString(r))}lt(e,r){return this.setLimit("max",e,!1,w.toString(r))}setLimit(e,r,n,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:w.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:w.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:w.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:w.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:w.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:w.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};pt.create=t=>new pt({checks:[],typeName:x.ZodBigInt,coerce:t?.coerce??!1,...N(t)});ht=class extends P{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==b.boolean){let n=this._getOrReturnCtx(e);return g(n,{code:f.invalid_type,expected:b.boolean,received:n.parsedType}),T}return re(e.data)}};ht.create=t=>new ht({typeName:x.ZodBoolean,coerce:t?.coerce||!1,...N(t)});ft=class t extends P{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==b.date){let i=this._getOrReturnCtx(e);return g(i,{code:f.invalid_type,expected:b.date,received:i.parsedType}),T}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return g(i,{code:f.invalid_date}),T}let n=new Z,s;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),g(s,{code:f.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),g(s,{code:f.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):M.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:w.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:w.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};ft.create=t=>new ft({checks:[],coerce:t?.coerce||!1,typeName:x.ZodDate,...N(t)});jt=class extends P{_parse(e){if(this._getType(e)!==b.symbol){let n=this._getOrReturnCtx(e);return g(n,{code:f.invalid_type,expected:b.symbol,received:n.parsedType}),T}return re(e.data)}};jt.create=t=>new jt({typeName:x.ZodSymbol,...N(t)});mt=class extends P{_parse(e){if(this._getType(e)!==b.undefined){let n=this._getOrReturnCtx(e);return g(n,{code:f.invalid_type,expected:b.undefined,received:n.parsedType}),T}return re(e.data)}};mt.create=t=>new mt({typeName:x.ZodUndefined,...N(t)});gt=class extends P{_parse(e){if(this._getType(e)!==b.null){let n=this._getOrReturnCtx(e);return g(n,{code:f.invalid_type,expected:b.null,received:n.parsedType}),T}return re(e.data)}};gt.create=t=>new gt({typeName:x.ZodNull,...N(t)});Ke=class extends P{constructor(){super(...arguments),this._any=!0}_parse(e){return re(e.data)}};Ke.create=t=>new Ke({typeName:x.ZodAny,...N(t)});Pe=class extends P{constructor(){super(...arguments),this._unknown=!0}_parse(e){return re(e.data)}};Pe.create=t=>new Pe({typeName:x.ZodUnknown,...N(t)});be=class extends P{_parse(e){let r=this._getOrReturnCtx(e);return g(r,{code:f.invalid_type,expected:b.never,received:r.parsedType}),T}};be.create=t=>new be({typeName:x.ZodNever,...N(t)});$t=class extends P{_parse(e){if(this._getType(e)!==b.undefined){let n=this._getOrReturnCtx(e);return g(n,{code:f.invalid_type,expected:b.void,received:n.parsedType}),T}return re(e.data)}};$t.create=t=>new $t({typeName:x.ZodVoid,...N(t)});Le=class t extends P{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),s=this._def;if(r.parsedType!==b.array)return g(r,{code:f.invalid_type,expected:b.array,received:r.parsedType}),T;if(s.exactLength!==null){let o=r.data.length>s.exactLength.value,a=r.data.length<s.exactLength.value;(o||a)&&(g(r,{code:o?f.too_big:f.too_small,minimum:a?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(g(r,{code:f.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(g(r,{code:f.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>s.type._parseAsync(new pe(r,o,r.path,a)))).then(o=>Z.mergeArray(n,o));let i=[...r.data].map((o,a)=>s.type._parseSync(new pe(r,o,r.path,a)));return Z.mergeArray(n,i)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:w.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:w.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:w.toString(r)}})}nonempty(e){return this.min(1,e)}};Le.create=(t,e)=>new Le({type:t,minLength:null,maxLength:null,exactLength:null,typeName:x.ZodArray,...N(e)});ce=class t extends P{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(),r=M.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==b.object){let l=this._getOrReturnCtx(e);return g(l,{code:f.invalid_type,expected:b.object,received:l.parsedType}),T}let{status:n,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof be&&this._def.unknownKeys==="strip"))for(let l in s.data)o.includes(l)||a.push(l);let d=[];for(let l of o){let p=i[l],u=s.data[l];d.push({key:{status:"valid",value:l},value:p._parse(new pe(s,u,s.path,l)),alwaysSet:l in s.data})}if(this._def.catchall instanceof be){let l=this._def.unknownKeys;if(l==="passthrough")for(let p of a)d.push({key:{status:"valid",value:p},value:{status:"valid",value:s.data[p]}});else if(l==="strict")a.length>0&&(g(s,{code:f.unrecognized_keys,keys:a}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let p of a){let u=s.data[p];d.push({key:{status:"valid",value:p},value:l._parse(new pe(s,u,s.path,p)),alwaysSet:p in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let l=[];for(let p of d){let u=await p.key,h=await p.value;l.push({key:u,value:h,alwaysSet:p.alwaysSet})}return l}).then(l=>Z.mergeObjectSync(n,l)):Z.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(e){return w.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{let s=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:w.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:x.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of M.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let n of M.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return Mt(this)}partial(e){let r={};for(let n of M.objectKeys(this.shape)){let s=this.shape[n];e&&!e[n]?r[n]=s:r[n]=s.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let n of M.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof ue;)i=i._def.innerType;r[n]=i}return new t({...this._def,shape:()=>r})}keyof(){return Ri(M.objectKeys(this.shape))}};ce.create=(t,e)=>new ce({shape:()=>t,unknownKeys:"strip",catchall:be.create(),typeName:x.ZodObject,...N(e)});ce.strictCreate=(t,e)=>new ce({shape:()=>t,unknownKeys:"strict",catchall:be.create(),typeName:x.ZodObject,...N(e)});ce.lazycreate=(t,e)=>new ce({shape:t,unknownKeys:"strip",catchall:be.create(),typeName:x.ZodObject,...N(e)});yt=class extends P{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function s(i){for(let a of i)if(a.result.status==="valid")return a.result;for(let a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let o=i.map(a=>new ae(a.ctx.common.issues));return g(r,{code:f.invalid_union,unionErrors:o}),T}if(r.common.async)return Promise.all(n.map(async i=>{let o={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(s);{let i,o=[];for(let d of n){let l={...r,common:{...r.common,issues:[]},parent:null},p=d._parseSync({data:r.data,path:r.path,parent:l});if(p.status==="valid")return p;p.status==="dirty"&&!i&&(i={result:p,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let a=o.map(d=>new ae(d));return g(r,{code:f.invalid_union,unionErrors:a}),T}}get options(){return this._def.options}};yt.create=(t,e)=>new yt({options:t,typeName:x.ZodUnion,...N(e)});De=t=>t instanceof Et?De(t.schema):t instanceof he?De(t.innerType()):t instanceof vt?[t.value]:t instanceof wt?t.options:t instanceof St?M.objectValues(t.enum):t instanceof _t?De(t._def.innerType):t instanceof mt?[void 0]:t instanceof gt?[null]:t instanceof ue?[void 0,...De(t.unwrap())]:t instanceof ke?[null,...De(t.unwrap())]:t instanceof ar||t instanceof xt?De(t.unwrap()):t instanceof Tt?De(t._def.innerType):[],Jr=class t extends P{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==b.object)return g(r,{code:f.invalid_type,expected:b.object,received:r.parsedType}),T;let n=this.discriminator,s=r.data[n],i=this.optionsMap.get(s);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(g(r,{code:f.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),T)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let s=new Map;for(let i of r){let o=De(i.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of o){if(s.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);s.set(a,i)}}return new t({typeName:x.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:s,...N(n)})}};bt=class extends P{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),s=(i,o)=>{if(zr(i)||zr(o))return T;let a=Kn(i.value,o.value);return a.valid?((Gr(i)||Gr(o))&&r.dirty(),{status:r.value,value:a.data}):(g(n,{code:f.invalid_intersection_types}),T)};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(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};bt.create=(t,e,r)=>new bt({left:t,right:e,typeName:x.ZodIntersection,...N(r)});xe=class t extends P{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==b.array)return g(n,{code:f.invalid_type,expected:b.array,received:n.parsedType}),T;if(n.data.length<this._def.items.length)return g(n,{code:f.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),T;!this._def.rest&&n.data.length>this._def.items.length&&(g(n,{code:f.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((o,a)=>{let d=this._def.items[a]||this._def.rest;return d?d._parse(new pe(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>Z.mergeArray(r,o)):Z.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};xe.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new xe({items:t,typeName:x.ZodTuple,rest:null,...N(e)})};Xr=class t extends P{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==b.object)return g(n,{code:f.invalid_type,expected:b.object,received:n.parsedType}),T;let s=[],i=this._def.keyType,o=this._def.valueType;for(let a in n.data)s.push({key:i._parse(new pe(n,a,n.path,a)),value:o._parse(new pe(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?Z.mergeObjectAsync(r,s):Z.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof P?new t({keyType:e,valueType:r,typeName:x.ZodRecord,...N(n)}):new t({keyType:Xe.create(),valueType:e,typeName:x.ZodRecord,...N(r)})}},Ht=class extends P{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==b.map)return g(n,{code:f.invalid_type,expected:b.map,received:n.parsedType}),T;let s=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([a,d],l)=>({key:s._parse(new pe(n,a,n.path,[l,"key"])),value:i._parse(new pe(n,d,n.path,[l,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let d of o){let l=await d.key,p=await d.value;if(l.status==="aborted"||p.status==="aborted")return T;(l.status==="dirty"||p.status==="dirty")&&r.dirty(),a.set(l.value,p.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let d of o){let l=d.key,p=d.value;if(l.status==="aborted"||p.status==="aborted")return T;(l.status==="dirty"||p.status==="dirty")&&r.dirty(),a.set(l.value,p.value)}return{status:r.value,value:a}}}};Ht.create=(t,e,r)=>new Ht({valueType:e,keyType:t,typeName:x.ZodMap,...N(r)});qt=class t extends P{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==b.set)return g(n,{code:f.invalid_type,expected:b.set,received:n.parsedType}),T;let s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(g(n,{code:f.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(g(n,{code:f.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let i=this._def.valueType;function o(d){let l=new Set;for(let p of d){if(p.status==="aborted")return T;p.status==="dirty"&&r.dirty(),l.add(p.value)}return{status:r.value,value:l}}let a=[...n.data.values()].map((d,l)=>i._parse(new pe(n,d,n.path,l)));return n.common.async?Promise.all(a).then(d=>o(d)):o(a)}min(e,r){return new t({...this._def,minSize:{value:e,message:w.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:w.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};qt.create=(t,e)=>new qt({valueType:t,minSize:null,maxSize:null,typeName:x.ZodSet,...N(e)});Kr=class t extends P{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==b.function)return g(r,{code:f.invalid_type,expected:b.function,received:r.parsedType}),T;function n(a,d){return or({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Lt(),Oe].filter(l=>!!l),issueData:{code:f.invalid_arguments,argumentsError:d}})}function s(a,d){return or({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Lt(),Oe].filter(l=>!!l),issueData:{code:f.invalid_return_type,returnTypeError:d}})}let i={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof Ye){let a=this;return re(async function(...d){let l=new ae([]),p=await a._def.args.parseAsync(d,i).catch(E=>{throw l.addIssue(n(d,E)),l}),u=await Reflect.apply(o,this,p);return await a._def.returns._def.type.parseAsync(u,i).catch(E=>{throw l.addIssue(s(u,E)),l})})}else{let a=this;return re(function(...d){let l=a._def.args.safeParse(d,i);if(!l.success)throw new ae([n(d,l.error)]);let p=Reflect.apply(o,this,l.data),u=a._def.returns.safeParse(p,i);if(!u.success)throw new ae([s(p,u.error)]);return u.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:xe.create(e).rest(Pe.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||xe.create([]).rest(Pe.create()),returns:r||Pe.create(),typeName:x.ZodFunction,...N(n)})}},Et=class extends P{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Et.create=(t,e)=>new Et({getter:t,typeName:x.ZodLazy,...N(e)});vt=class extends P{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return g(r,{received:r.data,code:f.invalid_literal,expected:this._def.value}),T}return{status:"valid",value:e.data}}get value(){return this._def.value}};vt.create=(t,e)=>new vt({value:t,typeName:x.ZodLiteral,...N(e)});wt=class t extends P{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return g(r,{expected:M.joinValues(n),received:r.parsedType,code:f.invalid_type}),T}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return g(r,{received:r.data,code:f.invalid_enum_value,options:n}),T}return re(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};wt.create=Ri;St=class extends P{_parse(e){let r=M.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==b.string&&n.parsedType!==b.number){let s=M.objectValues(r);return g(n,{expected:M.joinValues(s),received:n.parsedType,code:f.invalid_type}),T}if(this._cache||(this._cache=new Set(M.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let s=M.objectValues(r);return g(n,{received:n.data,code:f.invalid_enum_value,options:s}),T}return re(e.data)}get enum(){return this._def.values}};St.create=(t,e)=>new St({values:t,typeName:x.ZodNativeEnum,...N(e)});Ye=class extends P{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==b.promise&&r.common.async===!1)return g(r,{code:f.invalid_type,expected:b.promise,received:r.parsedType}),T;let n=r.parsedType===b.promise?r.data:Promise.resolve(r.data);return re(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Ye.create=(t,e)=>new Ye({type:t,typeName:x.ZodPromise,...N(e)});he=class extends P{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===x.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:o=>{g(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){let o=s.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async a=>{if(r.value==="aborted")return T;let d=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return d.status==="aborted"?T:d.status==="dirty"?lt(d.value):r.value==="dirty"?lt(d.value):d});{if(r.value==="aborted")return T;let a=this._def.schema._parseSync({data:o,path:n.path,parent:n});return a.status==="aborted"?T:a.status==="dirty"?lt(a.value):r.value==="dirty"?lt(a.value):a}}if(s.type==="refinement"){let o=a=>{let d=s.refinement(a,i);if(n.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?T:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?T:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(s.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Je(o))return T;let a=s.transform(o.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Je(o)?Promise.resolve(s.transform(o.value,i)).then(a=>({status:r.value,value:a})):T);M.assertNever(s)}};he.create=(t,e,r)=>new he({schema:t,typeName:x.ZodEffects,effect:e,...N(r)});he.createWithPreprocess=(t,e,r)=>new he({schema:e,effect:{type:"preprocess",transform:t},typeName:x.ZodEffects,...N(r)});ue=class extends P{_parse(e){return this._getType(e)===b.undefined?re(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ue.create=(t,e)=>new ue({innerType:t,typeName:x.ZodOptional,...N(e)});ke=class extends P{_parse(e){return this._getType(e)===b.null?re(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ke.create=(t,e)=>new ke({innerType:t,typeName:x.ZodNullable,...N(e)});_t=class extends P{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===b.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};_t.create=(t,e)=>new _t({innerType:t,typeName:x.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...N(e)});Tt=class extends P{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Ut(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ae(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ae(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Tt.create=(t,e)=>new Tt({innerType:t,typeName:x.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...N(e)});Ft=class extends P{_parse(e){if(this._getType(e)!==b.nan){let n=this._getOrReturnCtx(e);return g(n,{code:f.invalid_type,expected:b.nan,received:n.parsedType}),T}return{status:"valid",value:e.data}}};Ft.create=t=>new Ft({typeName:x.ZodNaN,...N(t)});bd=Symbol("zod_brand"),ar=class extends P{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},cr=class t extends P{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?T:i.status==="dirty"?(r.dirty(),lt(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?T:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:x.ZodPipeline})}},xt=class extends P{_parse(e){let r=this._def.innerType._parse(e),n=s=>(Je(s)&&(s.value=Object.freeze(s.value)),s);return Ut(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}};xt.create=(t,e)=>new xt({innerType:t,typeName:x.ZodReadonly,...N(e)});Ed={object:ce.lazycreate};(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(x||(x={}));vd=(t,e={message:`Input not instance of ${t.name}`})=>Ai(r=>r instanceof t,e),Ii=Xe.create,Ci=ut.create,wd=Ft.create,Sd=pt.create,Ni=ht.create,_d=ft.create,Td=jt.create,xd=mt.create,kd=gt.create,Rd=Ke.create,Ad=Pe.create,Id=be.create,Cd=$t.create,Nd=Le.create,Od=ce.create,Dd=ce.strictCreate,Pd=yt.create,Ld=Jr.create,Ud=bt.create,Md=xe.create,jd=Xr.create,$d=Ht.create,Hd=qt.create,qd=Kr.create,Fd=Et.create,Bd=vt.create,Wd=wt.create,Vd=St.create,zd=Ye.create,Gd=he.create,Jd=ue.create,Xd=ke.create,Kd=he.createWithPreprocess,Yd=cr.create,Zd=()=>Ii().optional(),Qd=()=>Ci().optional(),el=()=>Ni().optional(),tl={string:t=>Xe.create({...t,coerce:!0}),number:t=>ut.create({...t,coerce:!0}),boolean:t=>ht.create({...t,coerce:!0}),bigint:t=>pt.create({...t,coerce:!0}),date:t=>ft.create({...t,coerce:!0})},rl=T});var c={};Bn(c,{BRAND:()=>bd,DIRTY:()=>lt,EMPTY_PATH:()=>Kc,INVALID:()=>T,NEVER:()=>rl,OK:()=>re,ParseStatus:()=>Z,Schema:()=>P,ZodAny:()=>Ke,ZodArray:()=>Le,ZodBigInt:()=>pt,ZodBoolean:()=>ht,ZodBranded:()=>ar,ZodCatch:()=>Tt,ZodDate:()=>ft,ZodDefault:()=>_t,ZodDiscriminatedUnion:()=>Jr,ZodEffects:()=>he,ZodEnum:()=>wt,ZodError:()=>ae,ZodFirstPartyTypeKind:()=>x,ZodFunction:()=>Kr,ZodIntersection:()=>bt,ZodIssueCode:()=>f,ZodLazy:()=>Et,ZodLiteral:()=>vt,ZodMap:()=>Ht,ZodNaN:()=>Ft,ZodNativeEnum:()=>St,ZodNever:()=>be,ZodNull:()=>gt,ZodNullable:()=>ke,ZodNumber:()=>ut,ZodObject:()=>ce,ZodOptional:()=>ue,ZodParsedType:()=>b,ZodPipeline:()=>cr,ZodPromise:()=>Ye,ZodReadonly:()=>xt,ZodRecord:()=>Xr,ZodSchema:()=>P,ZodSet:()=>qt,ZodString:()=>Xe,ZodSymbol:()=>jt,ZodTransformer:()=>he,ZodTuple:()=>xe,ZodType:()=>P,ZodUndefined:()=>mt,ZodUnion:()=>yt,ZodUnknown:()=>Pe,ZodVoid:()=>$t,addIssueToContext:()=>g,any:()=>Rd,array:()=>Nd,bigint:()=>Sd,boolean:()=>Ni,coerce:()=>tl,custom:()=>Ai,date:()=>_d,datetimeRegex:()=>ki,defaultErrorMap:()=>Oe,discriminatedUnion:()=>Ld,effect:()=>Gd,enum:()=>Wd,function:()=>qd,getErrorMap:()=>Lt,getParsedType:()=>Te,instanceof:()=>vd,intersection:()=>Ud,isAborted:()=>zr,isAsync:()=>Ut,isDirty:()=>Gr,isValid:()=>Je,late:()=>Ed,lazy:()=>Fd,literal:()=>Bd,makeIssue:()=>or,map:()=>$d,nan:()=>wd,nativeEnum:()=>Vd,never:()=>Id,null:()=>kd,nullable:()=>Xd,number:()=>Ci,object:()=>Od,objectUtil:()=>zn,oboolean:()=>el,onumber:()=>Qd,optional:()=>Jd,ostring:()=>Zd,pipeline:()=>Yd,preprocess:()=>Kd,promise:()=>zd,quotelessJson:()=>Gc,record:()=>jd,set:()=>Hd,setErrorMap:()=>Xc,strictObject:()=>Dd,string:()=>Ii,symbol:()=>Td,transformer:()=>Gd,tuple:()=>Md,undefined:()=>xd,union:()=>Pd,unknown:()=>Ad,util:()=>M,void:()=>Cd});var Yn=A(()=>{Vr();Jn();vi();ir();Oi();Wr()});var ie=A(()=>{Yn();Yn()});var nl,Re,Di,Bt=A(()=>{ie();nl=c.object({id:c.string().min(1).max(128),name:c.string().min(1).max(200),source:c.string().max(200),pluginId:c.string().max(200).optional(),path:c.string().max(4096).optional()}),Re=c.array(nl).max(1).optional(),Di=c.object({taskId:c.string().min(1).optional(),repoId:c.string().min(1).optional(),agent:c.enum(["claude","codex"]).optional()}).refine(t=>t.taskId?!t.repoId&&!t.agent:!!t.repoId&&!!t.agent,"Select a task or a repository and agent")});var Ze,Zn,Yr,_m,Qn,es,sl,Tm,kt=A(()=>{"use strict";ie();Ze=c.enum(["stable","preview"]),Zn=c.object({schemaVersion:c.literal(1),status:c.enum(["applying","succeeded","failed","deferred"]),previousVersion:c.string(),targetVersion:c.string(),reason:c.string(),checkedAt:c.string()}),Yr=c.union([c.object({channel:Ze}).strict(),c.object({autoUpdate:c.boolean()}).strict()]),_m=c.union([c.object({action:c.enum(["visit","check"])}).strict(),c.object({action:c.literal("install"),version:c.string().min(1).max(100)}).strict()]),Qn=c.object({channel:Ze,currentVersion:c.string(),targetVersion:c.string().nullable(),checkedAt:c.string().datetime(),eligible:c.boolean(),error:c.boolean()}),es=c.object({id:c.string().uuid(),channel:Ze,currentVersion:c.string(),targetVersion:c.string(),automatic:c.boolean()}),sl=c.object({availability:c.enum(["available","not-installed","source-install","installation-mismatch","permission-required","authentication-required","unavailable"]),settings:c.object({channel:Ze,autoUpdate:c.boolean(),independentExecutions:c.boolean().optional(),discovery:Qn.nullable(),pending:es.nullable(),lastUpdate:Zn.nullable()}).nullable()}),Tm=c.union([c.object({ok:c.literal(!0),state:sl}),c.object({ok:c.literal(!1),error:c.enum(["busy","unavailable","save-failed","stale-update","update-failed"])})])});var il,Wt,ts,Pi=A(()=>{ie();il=c.string().trim().min(1).max(4096).refine(t=>!/[\x00-\x1f\x7f]/.test(t),"Path contains control characters"),Wt=c.array(il).max(64),ts=c.discriminatedUnion("action",[c.object({action:c.literal("set"),paths:Wt}).strict(),c.object({action:c.literal("add"),paths:Wt.min(1)}).strict(),c.object({action:c.literal("remove"),paths:Wt.min(1)}).strict(),c.object({action:c.literal("reset")}).strict()])});var rs,F,J,dr,Qe,ns,Cm,Nm,Om,Dm,Pm,Lm,ol,Li,Ui,Um,Mm,al,jm,$m,cl,dl,Hm,ll,qm,Fm,Bm,Wm,Vm,ul,zm,Gm,Jm,Mi,Xm,Km,lr=A(()=>{"use strict";Bt();ie();kt();Pi();rs=c.enum(["claude","codex"]),F=c.string(),J=F.min(1),dr={permission:F.optional(),model:F.optional(),effort:F.optional()},Qe=c.object({mediaType:F,data:F}),ns=c.array(Qe).optional(),Cm=c.object({path:J,name:F.optional(),defaultBaseRef:F.optional()}),Nm=c.object({repoId:J,agent:rs,prompt:F,skills:Re,...dr,title:F.optional(),images:ns,isolate:c.boolean().optional()}),Om=c.object({prompt:F,images:ns,...dr}),Dm=c.object({title:F.trim().min(1,"Enter a session name.").max(200,"Use 200 characters or fewer.").regex(/^[^\r\n]*$/,"Use a single line for the session name.")}),Pm=c.object({text:F,images:ns,...dr}),Lm=c.object({decision:c.enum(["approve","deny"]),scope:F.optional()}),ol=c.object({questionId:J.optional(),question:F,selected:c.array(F),notes:F.optional()}),Li=c.object({requestId:J,answers:c.array(ol),response:F.optional()}),Ui={preset:c.enum(["hourly","daily","weekly","weekdays","manual","custom"]).optional(),schedule:F.optional(),hour:c.number().int().min(0).max(23).optional(),dayOfWeek:c.number().int().min(0).max(6).optional()},Um=c.object({repoId:J,agent:rs,prompt:J,...Ui,...dr,title:F.optional()}),Mm=c.object({prompt:J.optional(),...Ui,...dr,title:F.optional(),enabled:c.boolean().optional()}),al=c.object({endpoint:J,expirationTime:c.number().nullable().optional(),keys:c.record(F).optional()}),jm=c.object({subscription:al}),$m=c.object({endpoint:J}),cl=c.object({agent:rs,sessionId:J,cwd:J,home:J,waitPid:c.number().int().positive()}),dl=c.enum(["queued","running","awaiting_approval","awaiting_input","idle","archived","failed","cancelled"]),Hm=c.object({status:dl.optional()}),ll=c.coerce.number().int().min(1).max(Number.MAX_SAFE_INTEGER),qm=c.object({before:ll}),Fm=c.object({path:F.min(1).max(4096).regex(/^[^\u0000-\u001f\u007f]*$/)}),Bm=c.object({task:F.optional(),lastEventId:F.optional(),tail:c.literal("1").optional(),snapshots:c.literal("1").optional()}),Wm=c.object({path:F.optional()}),Vm=c.object({refresh:c.enum(["0","1"]).optional()}),ul=c.object({id:J}),zm=ul.extend({messageId:J}),Gm=c.object({}),Jm=c.object({token:F.optional()}),Mi={id:J,rawId:J,type:c.literal("public-key"),authenticatorAttachment:c.enum(["platform","cross-platform"]).optional(),clientExtensionResults:c.object({}).passthrough()},Xm=c.object({...Mi,response:c.object({clientDataJSON:J,authenticatorData:J,signature:J,userHandle:F.optional()})}),Km=c.object({response:c.object({...Mi,response:c.object({clientDataJSON:J,attestationObject:J,transports:c.array(c.enum(["ble","cable","hybrid","internal","nfc","smart-card","usb"])).optional(),publicKeyAlgorithm:c.number().optional(),publicKey:F.optional(),authenticatorData:F.optional()})}),label:F.optional()})});var pl,ng,sg,ji=A(()=>{Bt();ie();lr();pl=c.object({model:c.string().optional(),effort:c.string().optional(),permission:c.string().optional()}),ng=c.object({clientMessageId:c.string().uuid(),mode:c.enum(["send","queue"]),text:c.string().trim().min(1).max(1e5),skills:Re,images:c.array(Qe).optional(),expectedRunId:c.string().nullable(),settings:pl.optional()}),sg=c.discriminatedUnion("action",[c.object({action:c.literal("edit"),version:c.number().int(),token:c.string().uuid()}),c.object({action:c.literal("renew"),token:c.string().uuid()}),c.object({action:c.literal("save"),token:c.string().uuid(),version:c.number().int(),text:c.string().trim().min(1).max(1e5),skills:Re,images:c.array(Qe).optional()}),c.object({action:c.literal("release"),token:c.string().uuid()}),c.object({action:c.literal("delete"),version:c.number().int()}),c.object({action:c.literal("send"),version:c.number().int(),expectedRunId:c.string().nullable()})])});var $i,Hi=A(()=>{$i={preserveHost:!0,publicHttpsRequired:!0,cacheApi:!1,maxBodyBytes:48e6,sse:{path:"/api/stream",buffering:!1,readTimeoutSeconds:3600},websocket:{pathPattern:"/api/terminals/:id/stream",upgrade:!0,idleTimeoutSeconds:60},perClientLimits:{authRequestsPerSecond:5,authBurst:10,apiRequestsPerSecond:20,apiBurst:40,apiConnections:30,terminalConnections:16}}});var cg,dg,qi=A(()=>{ie();cg=c.object({id:c.string().uuid(),mediaType:c.enum(["image/png","image/jpeg","image/gif","image/webp"]),size:c.number().int().positive()}),dg=c.object({id:c.string().min(1),attachmentId:c.string().uuid()})});var hg,Fi=A(()=>{ie();Bt();hg=c.object({context:Di,sdp:c.string().min(1).max(65536).startsWith("v=0")})});var oe=A(()=>{"use strict";pi();hi();fi();mi();gi();bi();ji();Hi();Bt();qi();Fi()});import{chmodSync as Gi,mkdirSync as Ji,openSync as Bi,closeSync as Wi,fsyncSync as Vi,writeFileSync as hl,renameSync as fl,unlinkSync as ml}from"node:fs";import{dirname as zi}from"node:path";import{randomUUID as gl}from"node:crypto";function K(t){Ji(t,{recursive:!0,mode:448}),Gi(t,448)}function Ee(t){Ji(t,{recursive:!0,mode:448})}function Ae(t){Gi(t,384)}function ve(t,e){Ee(zi(t));let r=`${t}.${gl()}.tmp`,n=Bi(r,"wx",384);try{try{hl(n,e),Vi(n)}finally{Wi(n)}fl(r,t);let s=Bi(zi(t),"r");try{Vi(s)}finally{Wi(s)}}finally{try{ml(r)}catch(s){if(s.code!=="ENOENT")throw s}}}var Q=A(()=>{});var un,su,gs=A(()=>{un={maxBytes:1073741824,minFreeBytes:268435456,unusedGraceMs:864e5,retentionMs:0},su=60*60*1e3});import{homedir as yo}from"node:os";import{join as iu}from"node:path";function Ot(t){return t==="~"?yo():t.startsWith("~/")?iu(yo(),t.slice(2)):t}var pn=A(()=>{});import{homedir as ou}from"node:os";import{existsSync as bo}from"node:fs";import{dirname as So,join as Zt,resolve as Dt}from"node:path";import{fileURLToPath as au}from"node:url";function uu(t){let e={};for(let[r,n]of Object.entries(t))n!==void 0&&n!==""&&(e[r]=n);return e}var cu,du,lu,L,_o,ys,bs,Eo,vo,wo,Qt,hr=A(()=>{ie();oe();gs();pn();cu=So(au(import.meta.url)),du=t=>t==="localhost"||t==="::1"||/^127(?:\.\d{1,3}){3}$/.test(t),lu=c.object({PORT:c.coerce.number().int().positive().default(4e3),HOST:c.string().min(1).refine(du,"HOST must be loopback; terminate public HTTPS at the reverse proxy").default("localhost"),ATTACHMENT_MAX_BYTES:c.coerce.number().int().positive().safe().default(un.maxBytes),ATTACHMENT_MIN_FREE_BYTES:c.coerce.number().int().nonnegative().safe().default(un.minFreeBytes),ATTACHMENT_UNUSED_GRACE_HOURS:c.coerce.number().int().min(1).max(8760).default(24),ATTACHMENT_RETENTION_DAYS:c.coerce.number().int().min(0).max(36500).default(0),DISPATCH_CONCURRENCY:c.coerce.number().int().min(1).default(8),SSE_KEEPALIVE_MS:c.coerce.number().int().positive().default(15e3),AUTH_SESSION_TTL_MS:c.coerce.number().int().positive().default(30*24*60*60*1e3),AUTH_COOKIE_NAME:c.string().min(1).default("palmagent_session"),AUTH_RP_ID:c.string().min(1).regex(/^[A-Za-z0-9.-]+$/,"AUTH_RP_ID must be a hostname without a scheme, path, or port").optional(),AUTH_RP_NAME:c.string().min(1).optional(),AUTH_ORIGIN:c.string().url().startsWith("https://","AUTH_ORIGIN must use https://").optional(),AUTH_ENABLED:c.string().optional(),AUTH_DISABLED:c.string().optional(),PUSH_SUBJECT:c.string().regex(/^(mailto:|https:\/\/)/,"PUSH_SUBJECT must be a mailto: or https:// URL").optional(),DISPATCHER_DATA_DIR:c.string().min(1).optional(),XDG_STATE_HOME:c.string().min(1).optional(),DISPATCHER_DB:c.string().min(1).optional(),VAPID_KEY_PATH:c.string().min(1).optional(),STATIC_DIR:c.string().min(1).optional(),REPO_ROOTS:c.string().optional(),GITHUB_TOKEN:c.string().min(1).optional(),RUNNER_SOCKET:c.string().min(1).optional(),EXECUTION_RELEASE:c.string().min(1).optional(),EXECUTION_NODE:c.string().min(1).optional(),CLAUDE_MODEL:c.string().min(1).optional(),CODEX_MODEL:c.string().min(1).optional(),CLAUDE_EFFORT:c.string().min(1).optional(),CODEX_EFFORT:c.string().min(1).optional(),CLAUDE_CONFIG_DIR:c.string().min(1).optional(),NODE_ENV:c.string().optional()}).passthrough();L=lu.parse(uu(process.env)),_o=L.AUTH_DISABLED==="1"?!1:L.AUTH_ENABLED==="1"?!0:L.NODE_ENV==="production",ys=L.AUTH_RP_ID??(_o?"":"localhost"),bs=L.DISPATCHER_DATA_DIR?Dt(L.DISPATCHER_DATA_DIR):L.XDG_STATE_HOME?Zt(Dt(L.XDG_STATE_HOME),R.stateDirName):Zt(ou(),".local","state",R.stateDirName),Eo=Zt(bs,"palmagent.db"),vo=Zt(bs,"dispatcher.db"),wo=L.DISPATCHER_DB?Dt(L.DISPATCHER_DB):bo(Eo)||!bo(vo)?Eo:vo,Qt={port:L.PORT,host:L.HOST,concurrency:L.DISPATCH_CONCURRENCY,attachmentStorage:{maxBytes:L.ATTACHMENT_MAX_BYTES,minFreeBytes:L.ATTACHMENT_MIN_FREE_BYTES,unusedGraceMs:L.ATTACHMENT_UNUSED_GRACE_HOURS*60*60*1e3,retentionMs:L.ATTACHMENT_RETENTION_DAYS*24*60*60*1e3},dataDir:bs,dbPath:wo,keepAliveMs:L.SSE_KEEPALIVE_MS,claudeModel:L.CLAUDE_MODEL,codexModel:L.CODEX_MODEL,claudeEffort:L.CLAUDE_EFFORT,codexEffort:L.CODEX_EFFORT,claudeConfigDir:L.CLAUDE_CONFIG_DIR?Dt(Ot(L.CLAUDE_CONFIG_DIR)):void 0,vapidKeyPath:L.VAPID_KEY_PATH?Dt(L.VAPID_KEY_PATH):Zt(So(wo),"vapid.json"),pushSubject:L.PUSH_SUBJECT,staticDir:L.STATIC_DIR?Dt(L.STATIC_DIR):Zt(cu,"..","..","web","dist"),repoRoots:(L.REPO_ROOTS??"").split(":").filter(Boolean).map(t=>Dt(Ot(t))),runnerSocket:L.RUNNER_SOCKET,executionRelease:L.EXECUTION_RELEASE,executionNode:L.EXECUTION_NODE,githubToken:L.GITHUB_TOKEN,authEnabled:_o,rpId:ys,rpName:L.AUTH_RP_NAME??R.displayName,authOrigin:L.AUTH_ORIGIN??(ys?`https://${ys}`:""),sessionTtlMs:L.AUTH_SESSION_TTL_MS,cookieName:L.AUTH_COOKIE_NAME,nodeEnv:L.NODE_ENV}});var hn=A(()=>{});import{createHash as hu}from"node:crypto";import{readFileSync as To,readdirSync as Fy,realpathSync as By,statSync as Wy}from"node:fs";function Es(t){if(!Number.isSafeInteger(t)||t<=1)throw new Error("A valid local CLI process id is required");try{let e=To(`/proc/${t}/stat`,"utf8"),r=e.slice(e.lastIndexOf(")")+2).split(" ");return r[0]==="Z"?void 0:`${To("/proc/sys/kernel/random/boot_id","utf8").trim()}:${r[19]}`}catch(e){if(e.code==="ENOENT")return;throw new Error("Cannot verify the local CLI process; ownership is retained")}}var fu,mu,vs=A(()=>{hr();hn();fu=t=>hu("sha256").update(t).digest("hex");mu=fu(Buffer.alloc(0))});var z,Tr=A(()=>{z=class extends Error{constructor(r,n){super(n);this.status=r}}});var ia=A(()=>{Tr()});var LE,Ls=A(()=>{gs();Tr();hn();Q();LE=4.5*1024*1024});var oa=A(()=>{});var Us=A(()=>{Ls()});var aa=A(()=>{});function Rp({permission:t,model:e,effort:r,resumeId:n}){let s=["-p","--input-format","stream-json","--output-format","stream-json","--verbose","--include-partial-messages","--permission-mode",kp(t),"--permission-prompt-tool","stdio"];return e&&s.push("--model",e),r&&s.push("--effort",r),n&&s.push("--resume",n),s}function Ap(t,e=[]){let r=e.map(n=>({type:"image",source:{type:"base64",media_type:n.mediaType,data:n.data}}));return r.push({type:"text",text:t}),{type:"user",message:{role:"user",content:r}}}function da(t,e){return e?.length?`/${e[0].name} ${t}`:t}var xp,ca,kp,Sn,la=A(()=>{oe();hr();xp=1500,ca={plan:"plan",acceptEdits:"acceptEdits",dontAsk:"dontAsk",bypassPermissions:"bypassPermissions",readonly:"plan","auto-edit":"acceptEdits",full:"bypassPermissions"},kp=t=>ca[t??""]??ca[Wn.claude];Sn=class{agent="claude";start(e,r,n){let{taskId:s,cwd:i,prompt:o,images:a,resumeId:d,permission:l,model:p,effort:u,reattach:h,resumeFromSeq:E,pendingInput:S}=e,I=Rp({permission:l,model:p,effort:u,resumeId:d});e.interactive&&I.push("--replay-user-messages");let m=d,O=e.providerHome??Qt.claudeConfigDir,B=O?{CLAUDE_CONFIG_DIR:O}:void 0,q=h?n.attach(s,0):n.start({turnId:s,command:"claude",argv:I,cwd:i,env:B});if(!q)return r({taskId:s,kind:"status",sessionId:m,payload:{subtype:"reattach_failed"}}),{steer:()=>!1,interrupt:()=>!1,approve:()=>!1,answer:()=>!1,cancel:()=>{},done:Promise.resolve()};let v,D=W=>{v&&(clearTimeout(v.timer),v.resolve(W),v=void 0,k=!1)},_,k=!1,C,j,ge=!1,_e=0,sr=new Map;h&&S&&sr.set(S.requestId,{questions:S.questions});let ct=W=>q.writeStdin(JSON.stringify(W)+`
3
3
  `),qn=(W,de,U)=>{ct({...Ap(W,de),...U?{uuid:U}:{}})},Fn=(W=!1)=>{j&&clearTimeout(j),ge=W,j=setTimeout(()=>{!k&&q.stdinWritable()&&q.closeStdin()},xp)},Fr=()=>{j&&clearTimeout(j),j=void 0,ge=!1};q.onLine((W,de)=>{let U;try{U=JSON.parse(de)}catch{return}U.session_id&&(m=U.session_id);let te=H=>r(H,W),Ce=h&&W<=(E??0);switch(ge&&["stream_event","assistant","user","control_request"].includes(U.type)&&Fr(),U.type){case"system":te({taskId:s,kind:"status",sessionId:m,payload:{subtype:U.subtype,model:U.model,cwd:U.cwd,tools:U.tools?.length}});break;case"rate_limit_event":te({taskId:s,kind:"status",sessionId:m,payload:{subtype:"rate_limit",info:U}});break;case"stream_event":{let H=U.event;if(H?.type==="message_start"&&(_=H.message?.id),H?.type==="message_delta"&&_){let Ge=H.delta?.stop_reason,Ne=Ge==="tool_use"?"progress":Ge==="end_turn"?"final":void 0;Ne&&te({taskId:s,kind:"status",sessionId:m,payload:{subtype:"assistant_message",messageId:_,phase:Ne}})}H?.type==="message_stop"&&(_=void 0),H?.type==="content_block_delta"&&H.delta?.type==="text_delta"&&te({taskId:s,kind:"assistant_text",sessionId:m,payload:{text:H.delta.text,..._?{messageId:_}:{}}});break}case"assistant":{for(let H of U.message?.content??[])H.type==="tool_use"&&te({taskId:s,kind:"tool_call",sessionId:m,payload:{id:H.id,name:H.name,input:H.input}});break}case"user":{typeof U.uuid=="string"&&(U.uuid===e.messageId||U.uuid===v?.id||e.interactive&&U.message?.role==="user"&&U.message?.content?.some(H=>H.type==="text"))&&(te({taskId:s,kind:"status",sessionId:m,payload:{subtype:"message_delivered",messageId:U.uuid}}),v?.id===U.uuid&&D("delivered"));for(let H of U.message?.content??[])H.type==="tool_result"&&te({taskId:s,kind:"tool_result",sessionId:m,payload:{tool_use_id:H.tool_use_id,content:H.content,is_error:H.is_error}});break}case"result":te({taskId:s,kind:"result",sessionId:m,payload:{subtype:U.subtype,is_error:U.is_error,result:U.result,num_turns:U.num_turns,duration_ms:U.duration_ms,total_cost_usd:U.total_cost_usd}}),v&&!v.sent&&(v.sent=!0,qn(v.text,v.images,v.id)),k||Fn(!!Ce);break;case"control_response":te({taskId:s,kind:"status",sessionId:m,payload:{subtype:"control_response",response:U.response}});break;case"control_request":{if(Ce)break;let H=U.request_id,Ge=U.request??{};if(Ge.subtype!=="can_use_tool")break;if(Ge.tool_name==="AskUserQuestion"&&Array.isArray(Ge.input?.questions)){let Ne=Ge.input.questions;sr.set(H,{questions:Ne}),te({taskId:s,kind:"question",sessionId:m,payload:{requestId:H,questions:Ne}})}else ct({type:"control_response",response:{subtype:"success",request_id:H,response:{behavior:"deny",message:"Auto-denied (non-interactive dispatch)."}}});break}default:break}}),q.onStderr(W=>{r({taskId:s,kind:"status",sessionId:m,payload:{subtype:"stderr",text:W}})});let Fc=new Promise(W=>{q.onExit(de=>{Fr(),D("unknown"),r({taskId:s,kind:"status",sessionId:m,payload:{subtype:"process_exit",code:de}}),W()})});return h||qn(da(o,e.skills),a,e.messageId),{send:(W,de,U,te)=>!q.stdinWritable()||v||j||!e.interactive?Promise.resolve("rejected"):(k=!0,Fr(),new Promise(Ce=>{let H=setTimeout(()=>{D("unknown"),Fn()},15e3);H.unref(),v={id:U,text:da(W,te),images:de,sent:!1,resolve:Ce,timer:H},ct({type:"control_request",request_id:`send_${U}`,request:{subtype:"interrupt"}})})),steer:(W,de)=>q.stdinWritable()?(k=!0,Fr(),ct({type:"control_request",request_id:`int_${++_e}`,request:{subtype:"interrupt"}}),C=setTimeout(()=>{qn(W,de),k=!1},250),!0):!1,interrupt:()=>q.stdinWritable()?(C&&clearTimeout(C),D(v?.sent?"unknown":"rejected"),k=!1,ct({type:"control_request",request_id:`int_${++_e}`,request:{subtype:"interrupt"}}),Fn(),!0):!1,approve:()=>!1,answer:W=>{let de=sr.get(W.requestId);if(!de||!q.stdinWritable())return!1;let U=new Map(de.questions.map(ye=>[ye.question,ye])),te={},Ce={};for(let ye of W.answers??[])ye.selected?.length&&(te[ye.question]=U.get(ye.question)?.multiSelect?ye.selected:ye.selected[0]),ye.notes?.trim()&&(Ce[ye.question]={notes:ye.notes.trim()});let H=W.response?.trim();if(!(Object.keys(te).length>0||Object.keys(Ce).length>0||!!H))return ct({type:"control_response",response:{subtype:"success",request_id:W.requestId,response:{behavior:"deny",message:"User declined to answer."}}})?(sr.delete(W.requestId),!0):!1;let Ne={questions:de.questions,answers:te};return Object.keys(Ce).length&&(Ne.annotations=Ce),H&&(Ne.response=H),ct({type:"control_response",response:{subtype:"success",request_id:W.requestId,response:{behavior:"allow",updatedInput:Ne}}})?(sr.delete(W.requestId),!0):!1},cancel:()=>q.kill("SIGINT"),done:Fc}}}});function pa(t,e,r){let{taskId:n,reattach:s}=t,i=t.resumeId,o,a=!1,d,l=new Map,p=new Map;s&&t.pendingInput&&p.set(t.pendingInput.requestId,t.pendingInput);let u=t.permission,h=u==="read-only"||u==="readonly"?"read-only":u==="danger-full-access"||u==="full"?"danger-full-access":"workspace-write",E=s?r.attach(n,0):r.start({turnId:n,command:"codex",cwd:t.cwd,argv:["app-server","--listen","stdio://","-c",'approval_policy="never"',"-c",`sandbox_mode=${JSON.stringify(h)}`,...u==="workspace-write-net"?["-c","sandbox_workspace_write.network_access=true"]:[]],...t.providerHome?{env:{CODEX_HOME:t.providerHome}}:{}});if(!E)return e({taskId:n,kind:"status",sessionId:i,payload:{subtype:"reattach_failed"}}),{steer:()=>!1,interrupt:()=>!1,approve:()=>!1,answer:()=>!1,cancel(){},done:Promise.resolve()};let S=v=>E.writeStdin(JSON.stringify(v)+`
4
4
  `),I=(v,D,_)=>S({jsonrpc:"2.0",id:v,method:D,params:_}),m=(v,D,_)=>e({taskId:n,sessionId:i,kind:v,payload:D},_),O=(v,D)=>{m("status",{subtype:"message_delivered",messageId:v},D);let _=l.get(v);_&&(clearTimeout(_.timer),l.delete(v),_.resolve("delivered"))},B=setTimeout(()=>{!o&&!a&&(m("error",{message:"Codex did not start a turn; the request will not be replayed automatically."}),E.kill("SIGINT"))},3e4);B.unref(),E.onLine((v,D)=>{let _;try{_=JSON.parse(D)}catch{return}let k=_.params??{};if(typeof _.id=="string"&&("result"in _||"error"in _)){if(_.id.startsWith("message:")){let C=_.id.slice(8),j=l.get(C);_.error?j&&(clearTimeout(j.timer),l.delete(C),j.resolve("rejected")):O(C,v)}else _.error?(m("error",{message:_.error.message??"Codex request failed"},v),a=!0,E.closeStdin()):_.id==="initialize"&&!s?(S({jsonrpc:"2.0",method:"initialized",params:{}}),I("session",t.resumeId?"thread/resume":"thread/start",{...t.resumeId?{threadId:t.resumeId}:{},cwd:t.cwd,approvalPolicy:"never",sandbox:h,...t.model?{model:t.model}:{},...t.effort?{config:{model_reasoning_effort:t.effort}}:{}})):_.id==="session"?(i=_.result.thread.id,m("status",{subtype:"thread_started"},v),s||I("start","turn/start",{threadId:i,input:ua(t.prompt,t.images,t.skills),...t.messageId?{clientUserMessageId:t.messageId}:{},...t.effort?{effort:t.effort}:{}})):_.id==="start"&&(o=_.result.turn.id,clearTimeout(B),t.messageId&&O(t.messageId,v));return}if(!(k.threadId&&i&&k.threadId!==i))switch(_.method){case"thread/started":i=k.thread.id,m("status",{subtype:"thread_started"},v);break;case"turn/started":o=k.turn.id,clearTimeout(B),m("status",{subtype:"turn_started",turnId:o},v);break;case"item/agentMessage/delta":m("assistant_text",{text:k.delta,messageId:k.itemId},v);break;case"item/started":k.item?.type==="commandExecution"&&m("tool_call",{id:k.item.id,name:"bash",command:k.item.command},v);break;case"item/completed":{let C=k.item;C?.type==="userMessage"&&C.clientId?O(C.clientId,v):C?.type==="agentMessage"?m("status",{subtype:"assistant_message",messageId:C.id,phase:C.phase==="commentary"?"progress":C.phase==="final_answer"?"final":void 0},v):C?.type==="commandExecution"?m("tool_result",{tool_use_id:C.id,output:C.aggregatedOutput,exit_code:C.exitCode},v):C?.type==="fileChange"?m("tool_call",{id:C.id,name:"file_change",changes:C.changes},v):(C?.type==="mcpToolCall"||C?.type==="webSearch")&&m("tool_result",{tool_use_id:C.id,content:C.result??C.action,name:C.tool??C.type},v);break}case"turn/completed":a=!0,o=void 0,p.clear(),clearTimeout(B),k.turn.status==="failed"&&m("error",{message:k.turn.error?.message??"Codex turn failed."},v),m("result",{is_error:k.turn.status!=="completed",subtype:k.turn.status,error:k.turn.error,usage:d},v),E.closeStdin();break;case"thread/tokenUsage/updated":k.tokenUsage?.last&&(d={input_tokens:k.tokenUsage.last.inputTokens,cached_input_tokens:k.tokenUsage.last.cachedInputTokens,output_tokens:k.tokenUsage.last.outputTokens}),m("status",{subtype:"usage",usage:k.tokenUsage},v);break;case"error":m("error",{message:k.error?.message??k.message},v);break;case"item/commandExecution/requestApproval":case"item/fileChange/requestApproval":S({jsonrpc:"2.0",id:_.id,result:{decision:"decline"}});break;case"item/tool/requestUserInput":{if(typeof _.id!="string"&&typeof _.id!="number")break;let C=JSON.stringify(_.id);if(s&&v<=(t.resumeFromSeq??0)||!Array.isArray(k.questions))break;let j={requestId:C,questions:k.questions.map(ge=>({id:ge.id,question:ge.question,header:ge.header,options:ge.options??[]}))};p.set(C,j),m("question",j,v);break}case"serverRequest/resolved":{let C=JSON.stringify(k.requestId);p.delete(C),m("status",{subtype:"input_resolved",requestId:C},v);break}}}),E.onStderr(v=>m("status",{subtype:"stderr",text:v}));let q=new Promise(v=>E.onExit(D=>{clearTimeout(B);for(let _ of l.values())clearTimeout(_.timer),_.resolve("unknown");l.clear(),p.clear(),a||m("error",{message:"Codex exited before a terminal turn result."}),m("status",{subtype:"process_exit",code:D}),v()}));return s||I("initialize","initialize",{clientInfo:{name:"palmagent",version:"1.0.0"},capabilities:{}}),{send:(v,D,_,k)=>!o||a||!E.stdinWritable()?Promise.resolve("rejected"):new Promise(C=>{let j=setTimeout(()=>{l.delete(_),C("unknown")},15e3);j.unref(),l.set(_,{resolve:C,timer:j}),I(`message:${_}`,"turn/steer",{threadId:i,expectedTurnId:o,clientUserMessageId:_,input:ua(v,D,k)})||(clearTimeout(j),l.delete(_),C("unknown"))}),steer:()=>!1,interrupt:()=>!!o&&!a&&I(`stop:${o}`,"turn/interrupt",{threadId:i,turnId:o}),approve:()=>!1,answer:v=>{let D=p.get(v.requestId);if(!D||a||!E.stdinWritable())return!1;let _={};for(let k of D.questions){if(!k.id)return!1;let C=v.answers.filter(_e=>_e.questionId?_e.questionId===k.id:_e.question===k.question),j=C[0];if(C.length>1||j&&!j.questionId&&D.questions.filter(_e=>_e.question===k.question).length>1)return!1;let ge=[...j?.selected??[],...[j?.notes?.trim(),v.response?.trim()].filter(_e=>!!_e)];ge.length&&(_[k.id]={answers:ge})}return S({jsonrpc:"2.0",id:JSON.parse(v.requestId),result:{answers:_}})?(p.delete(v.requestId),!0):!1},cancel:()=>E.kill("SIGINT"),done:q}}var ua,ha=A(()=>{ua=(t,e,r)=>[{type:"text",text:[...(r??[]).map(n=>`$${n.name}`),t].join(`
5
5
  `),text_elements:[]},...(r??[]).map(n=>({type:"skill",name:n.name,path:n.path})),...(e??[]).map(n=>({type:"image",url:`data:${n.mediaType};base64,${n.data}`}))]});import{mkdtempSync as Ip,rmSync as Cp,writeFileSync as Np}from"node:fs";import{tmpdir as Op}from"node:os";import{join as fa}from"node:path";function Pp(t){if(!t?.length)return{argv:[],cleanup:()=>{}};let e=Ip(fa(Op(),"palmagent-img-")),r=[];return t.forEach((n,s)=>{let i=fa(e,`img-${s}${Dp[n.mediaType]??".png"}`);Np(i,Buffer.from(n.data,"base64")),r.push("-i",i)}),{argv:r,cleanup:()=>Cp(e,{recursive:!0,force:!0})}}function Lp(t){return ma[t??""]??ma["workspace-write"]}function Up({prompt:t,resumeId:e,permission:r,model:n,effort:s},i=[]){let o=[...n?["-c",`model=${n}`]:[],...s?["-c",`model_reasoning_effort=${s}`]:[]],a=Lp(r),d=e?["-c",`sandbox_mode=${a.mode}`]:["--sandbox",a.mode],l=a.network?["-c","sandbox_workspace_write.network_access=true"]:[],p=["--json","--skip-git-repo-check","-c","approval_policy=never",...d,...l,...o,...i];return e?["exec","resume",e,t,...p]:["exec",t,...p]}var Dp,ma,_n,ga=A(()=>{ha();Dp={"image/png":".png","image/jpeg":".jpg","image/webp":".webp","image/gif":".gif"};ma={"read-only":{mode:"read-only"},"workspace-write":{mode:"workspace-write"},"workspace-write-net":{mode:"workspace-write",network:!0},"danger-full-access":{mode:"danger-full-access"},readonly:{mode:"read-only"},"auto-edit":{mode:"workspace-write"},full:{mode:"danger-full-access"}};_n=class{agent="codex";start(e,r,n){if(e.interactive)return pa(e,r,n);let{taskId:s,cwd:i,prompt:o,images:a,resumeId:d,permission:l,model:p,effort:u,reattach:h}=e,E=d;if(h){let B=n.attach(s,0);return B?this.wire(s,B,r,()=>{},()=>E,q=>{E=q}):(r({taskId:s,kind:"status",sessionId:E,payload:{subtype:"reattach_failed"}}),{steer:()=>!1,interrupt:()=>!1,approve:()=>!1,answer:()=>!1,cancel:()=>{},done:Promise.resolve()})}let S=Pp(a),I=e.skills?.length?e.skills.map(B=>`$${B.name} (${B.path})`).join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "palmagent",
3
- "version": "0.1.0-alpha.63",
3
+ "version": "0.1.0-alpha.64",
4
4
  "palmagent": {
5
5
  "agentCliCompatibility": {
6
6
  "claude": {
@@ -9,9 +9,9 @@
9
9
  "exclusiveMaximum": "2.2.0"
10
10
  },
11
11
  "codex": {
12
- "range": ">=0.154.0 <0.155.0",
12
+ "range": ">=0.154.0 <0.156.0",
13
13
  "minimum": "0.154.0",
14
- "exclusiveMaximum": "0.155.0"
14
+ "exclusiveMaximum": "0.156.0"
15
15
  }
16
16
  }
17
17
  },