local-operator-ui 0.35.2 → 0.36.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/main/index.js +11857 -160
- package/out/preload/index.js +240 -4
- package/out/renderer/assets/{_basePickBy-NBZVf3x_.js → _basePickBy-Bb37xTRz.js} +1 -1
- package/out/renderer/assets/{_baseUniq-BpOXfy9b.js → _baseUniq-Dni9iHST.js} +1 -1
- package/out/renderer/assets/{agent-details-page-CI5V0mco.js → agent-details-page-CgHbzH_i.js} +1 -1
- package/out/renderer/assets/{agent-hub-page-C7UV5Z02.js → agent-hub-page-2Ga-oDu_.js} +1 -1
- package/out/renderer/assets/{agents-page-BHUCzpZE.js → agents-page-D9lw4aXB.js} +3 -3
- package/out/renderer/assets/{arc-DTlm2-sN.js → arc-ova03XOc.js} +1 -1
- package/out/renderer/assets/{architectureDiagram-IEHRJDOE-uA5hYBWO.js → architectureDiagram-IEHRJDOE-BqEEHStp.js} +1 -1
- package/out/renderer/assets/arrow-up-CQI5PWkj.js +6 -0
- package/out/renderer/assets/{blockDiagram-JOT3LUYC-Awo08lrR.js → blockDiagram-JOT3LUYC-CGDwWpMK.js} +1 -1
- package/out/renderer/assets/{book-open-DBUibLWP.js → book-open-BSyul6vT.js} +1 -1
- package/out/renderer/assets/browser-page-BokpB_3E.js +1 -0
- package/out/renderer/assets/{browser-webauthn-prompt-egKdqzbk.js → browser-webauthn-prompt-B6aF1Dhh.js} +1 -1
- package/out/renderer/assets/{c4Diagram-VJAJSXHY-DAHoIxNf.js → c4Diagram-VJAJSXHY-B_diNzWl.js} +1 -1
- package/out/renderer/assets/channel-BzDZCdO-.js +1 -0
- package/out/renderer/assets/{chunk-4BMEZGHF-QvFtu74J.js → chunk-4BMEZGHF-C9SwUS8n.js} +1 -1
- package/out/renderer/assets/{chunk-A2AXSNBT-EcRDJZN6.js → chunk-A2AXSNBT-DaBX04_5.js} +1 -1
- package/out/renderer/assets/{chunk-AEK57VVT-CKf_yBAg.js → chunk-AEK57VVT-qbLu6qUx.js} +1 -1
- package/out/renderer/assets/{chunk-D6G4REZN-CoixV4aq.js → chunk-D6G4REZN-DvK2vlg2.js} +1 -1
- package/out/renderer/assets/{chunk-RZ5BOZE2-CtEEDTp-.js → chunk-RZ5BOZE2-BJ0QjQ_v.js} +1 -1
- package/out/renderer/assets/{chunk-XZIHB7SX-BOgT03N8.js → chunk-XZIHB7SX-n65ojqSW.js} +1 -1
- package/out/renderer/assets/classDiagram-GIVACNV2-CvOU5M3P.js +1 -0
- package/out/renderer/assets/classDiagram-v2-COTLJTTW-CvOU5M3P.js +1 -0
- package/out/renderer/assets/clone-DHxQeWmi.js +1 -0
- package/out/renderer/assets/{console-mirror-D7dfGxrD.js → console-mirror-D0KKDQl3.js} +1 -1
- package/out/renderer/assets/{consoleCapture-DczATgZh.js → consoleCapture-F0nqNi_2.js} +1 -1
- package/out/renderer/assets/{conversation-input-sync-GlFEQKuo.js → conversation-input-sync-BaU2f8nc.js} +258 -258
- package/out/renderer/assets/{dagre-OKDRZEBW-CijtV3o0.js → dagre-OKDRZEBW-CE5mY9Av.js} +1 -1
- package/out/renderer/assets/{diagram-SSKATNLV-Dxx1RpmY.js → diagram-SSKATNLV-EmZWZBnZ.js} +1 -1
- package/out/renderer/assets/{diagram-VNBRO52H-DZg2hjvO.js → diagram-VNBRO52H-BgRKuGa5.js} +1 -1
- package/out/renderer/assets/{erDiagram-Q7BY3M3F-CjvMMGLo.js → erDiagram-Q7BY3M3F-1tQnA6hA.js} +1 -1
- package/out/renderer/assets/{error-boundary-CLT6U8jT.js → error-boundary-h4sP8tdS.js} +2 -2
- package/out/renderer/assets/{flowDiagram-4HSFHLVR-EjagIE01.js → flowDiagram-4HSFHLVR-DqCLQ87c.js} +1 -1
- package/out/renderer/assets/{ganttDiagram-APWFNJXF-OfsWfUyW.js → ganttDiagram-APWFNJXF-CsYNZe0u.js} +1 -1
- package/out/renderer/assets/{gitGraphDiagram-7IBYFJ6S-nYTyKs0s.js → gitGraphDiagram-7IBYFJ6S-DLnRaxVs.js} +1 -1
- package/out/renderer/assets/{graph-BnL8m22f.js → graph-BKUD4S8x.js} +1 -1
- package/out/renderer/assets/index-CU8sWhx0.css +1 -0
- package/out/renderer/assets/index-DnJx-GT2.js +829 -0
- package/out/renderer/assets/{index-CO7sxKWb.js → index-DsdX_gGL.js} +1 -1
- package/out/renderer/assets/{index-C866kR_k.js → index-JwCvHr79.js} +1 -1
- package/out/renderer/assets/index-jSdScOuX.js +57 -0
- package/out/renderer/assets/{infoDiagram-PH2N3AL5-LE2dCnxc.js → infoDiagram-PH2N3AL5-BgvR1kcA.js} +1 -1
- package/out/renderer/assets/{installer-Wpfa8xHM.js → installer-9-IkNP6M.js} +1 -1
- package/out/renderer/assets/{journeyDiagram-U35MCT3I-BhpegMd0.js → journeyDiagram-U35MCT3I-THzpQ4f_.js} +1 -1
- package/out/renderer/assets/{kanban-definition-NDS4AKOZ-OoMW68Bt.js → kanban-definition-NDS4AKOZ-Dkrr1AV_.js} +1 -1
- package/out/renderer/assets/{layout-BdaXfJXz.js → layout-BqAKXOXc.js} +1 -1
- package/out/renderer/assets/legacy-agents-page-6-ryob8H.js +33 -0
- package/out/renderer/assets/library-page-Bq2GfKjB.js +162 -0
- package/out/renderer/assets/{mermaid.core-DmdT5IgP.js → mermaid.core-BtMOwfxh.js} +5 -5
- package/out/renderer/assets/mesh-page-DCnkCtuI.js +1 -0
- package/out/renderer/assets/{mindmap-definition-ALO5MXBD-BCXX8n68.js → mindmap-definition-ALO5MXBD-Ci3FJP8j.js} +1 -1
- package/out/renderer/assets/{mini-DsJCW_H3.js → mini-BtcMFfoh.js} +1 -1
- package/out/renderer/assets/{notebook-pen-CAZF-xgd.js → notebook-pen--Xi3fV6p.js} +1 -1
- package/out/renderer/assets/{org-access-DCQGHh2Y.js → org-access-CLHvmuSm.js} +1 -1
- package/out/renderer/assets/{org-surface-gate-Cq3kOR7u.js → org-surface-gate-BvVBCRMH.js} +1 -1
- package/out/renderer/assets/{page-header-CQ6qN4O4.js → page-header-BC5wA_0S.js} +1 -1
- package/out/renderer/assets/{pieDiagram-IB7DONF6-BRK1MBQO.js → pieDiagram-IB7DONF6-C8ihg5ur.js} +1 -1
- package/out/renderer/assets/{projects-page-DpAhuoA7.js → projects-page-D0SNgdlC.js} +12 -17
- package/out/renderer/assets/{publication-validation-CZn6wbD0.js → publication-validation-Cz7fxfa-.js} +1 -1
- package/out/renderer/assets/{quadrantDiagram-7GDLP6J5-CtQwUI4m.js → quadrantDiagram-7GDLP6J5-DYzTpBbR.js} +1 -1
- package/out/renderer/assets/{radar-MK3ICKWK-o9_lRR0v.js → radar-MK3ICKWK-CqXcPbUD.js} +1 -1
- package/out/renderer/assets/{radient-auth-buttons-BWhD8ldO.js → radient-auth-buttons-FUVVHa4X.js} +1 -1
- package/out/renderer/assets/{requirementDiagram-KVF5MWMF-aEEiUjHx.js → requirementDiagram-KVF5MWMF-DJm-bxrM.js} +1 -1
- package/out/renderer/assets/{sankeyDiagram-QLVOVGJD-CtjAQQYG.js → sankeyDiagram-QLVOVGJD-Dw05QUfu.js} +1 -1
- package/out/renderer/assets/{schedules-page-C4-FWwsb.js → schedules-page-Czido6cv.js} +1 -1
- package/out/renderer/assets/{sequenceDiagram-X6HHIX6F-QOpgwrwA.js → sequenceDiagram-X6HHIX6F-CgwdpctZ.js} +1 -1
- package/out/renderer/assets/settings-page--rl5E5Gf.js +287 -0
- package/out/renderer/assets/smartart-CMc4mYHj.js +1 -0
- package/out/renderer/assets/{stateDiagram-DGXRK772-D99A_n2H.js → stateDiagram-DGXRK772-uxab6dZ6.js} +1 -1
- package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-DFAfO8jf.js +1 -0
- package/out/renderer/assets/tags-input-chips-TaE87pEw.js +1 -0
- package/out/renderer/assets/{timeline-definition-BDJGKUSR-C_Op_i7D.js → timeline-definition-BDJGKUSR-C18eACei.js} +1 -1
- package/out/renderer/assets/ui-preferences-store-SQZFW3cf.js +1 -0
- package/out/renderer/assets/{use-download-agent-mutation-PP3ZbZ7V.js → use-download-agent-mutation-DavUIoqV.js} +1 -1
- package/out/renderer/assets/{use-memberships-query-TOFQHH-q.js → use-memberships-query-DlpZRSwv.js} +1 -1
- package/out/renderer/assets/{use-session-snapshot-BOMni_bJ.js → use-session-snapshot-CJ2UW6J0.js} +1 -1
- package/out/renderer/assets/{xychartDiagram-VJFVF3MP-Bq2H6JYU.js → xychartDiagram-VJFVF3MP-uWlww-vq.js} +1 -1
- package/out/renderer/console-capture.html +5 -5
- package/out/renderer/index.html +7 -7
- package/out/renderer/installer.html +4 -4
- package/out/renderer/mini.html +7 -7
- package/package.json +3 -2
- package/out/renderer/assets/browser-page-DuKCLrh5.js +0 -1
- package/out/renderer/assets/channel-BZ9uCAQo.js +0 -1
- package/out/renderer/assets/classDiagram-GIVACNV2-D6kkk-4_.js +0 -1
- package/out/renderer/assets/classDiagram-v2-COTLJTTW-D6kkk-4_.js +0 -1
- package/out/renderer/assets/clone-BgCd73kI.js +0 -1
- package/out/renderer/assets/index-CGcU9-Py.css +0 -1
- package/out/renderer/assets/index-Cj2bZws8.js +0 -57
- package/out/renderer/assets/index-p3NO0LL-.js +0 -824
- package/out/renderer/assets/legacy-agents-page-lVj0d18U.js +0 -33
- package/out/renderer/assets/mesh-page-D0-4HVNk.js +0 -1
- package/out/renderer/assets/settings-page-BJZ7ozTY.js +0 -287
- package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-D0CTAsLQ.js +0 -1
- package/out/renderer/assets/ui-preferences-store-Dz1Kg_SA.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as Dt,D as ds}from"./index-jSdScOuX.js";var I;(function(e){e.assertEqual=a=>a;function t(a){}e.assertIs=t;function s(a){throw new Error}e.assertNever=s,e.arrayToEnum=a=>{const o={};for(const r of a)o[r]=r;return o},e.getValidEnumValues=a=>{const o=e.objectKeys(a).filter(c=>typeof a[a[c]]!="number"),r={};for(const c of o)r[c]=a[c];return e.objectValues(r)},e.objectValues=a=>e.objectKeys(a).map(function(o){return a[o]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const o=[];for(const r in a)Object.prototype.hasOwnProperty.call(a,r)&&o.push(r);return o},e.find=(a,o)=>{for(const r of a)if(o(r))return r},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function i(a,o=" | "){return a.map(r=>typeof r=="string"?`'${r}'`:r).join(o)}e.joinValues=i,e.jsonStringifyReplacer=(a,o)=>typeof o=="bigint"?o.toString():o})(I||(I={}));var bt;(function(e){e.mergeShapes=(t,s)=>({...t,...s})})(bt||(bt={}));const h=I.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),G=e=>{switch(typeof e){case"undefined":return h.undefined;case"string":return h.string;case"number":return isNaN(e)?h.nan:h.number;case"boolean":return h.boolean;case"function":return h.function;case"bigint":return h.bigint;case"symbol":return h.symbol;case"object":return Array.isArray(e)?h.array:e===null?h.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?h.promise:typeof Map<"u"&&e instanceof Map?h.map:typeof Set<"u"&&e instanceof Set?h.set:typeof Date<"u"&&e instanceof Date?h.date:h.object;default:return h.unknown}},u=I.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"]),us=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class A extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=t}format(t){const s=t||function(o){return o.message},i={_errors:[]},a=o=>{for(const r of o.issues)if(r.code==="invalid_union")r.unionErrors.map(a);else if(r.code==="invalid_return_type")a(r.returnTypeError);else if(r.code==="invalid_arguments")a(r.argumentsError);else if(r.path.length===0)i._errors.push(s(r));else{let c=i,d=0;for(;d<r.path.length;){const l=r.path[d];d===r.path.length-1?(c[l]=c[l]||{_errors:[]},c[l]._errors.push(s(r))):c[l]=c[l]||{_errors:[]},c=c[l],d++}}};return a(this),i}static assert(t){if(!(t instanceof A))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,I.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=s=>s.message){const s={},i=[];for(const a of this.issues)a.path.length>0?(s[a.path[0]]=s[a.path[0]]||[],s[a.path[0]].push(t(a))):i.push(t(a));return{formErrors:i,fieldErrors:s}}get formErrors(){return this.flatten()}}A.create=e=>new A(e);const ce=(e,t)=>{let s;switch(e.code){case u.invalid_type:e.received===h.undefined?s="Required":s=`Expected ${e.expected}, received ${e.received}`;break;case u.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(e.expected,I.jsonStringifyReplacer)}`;break;case u.unrecognized_keys:s=`Unrecognized key(s) in object: ${I.joinValues(e.keys,", ")}`;break;case u.invalid_union:s="Invalid input";break;case u.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${I.joinValues(e.options)}`;break;case u.invalid_enum_value:s=`Invalid enum value. Expected ${I.joinValues(e.options)}, received '${e.received}'`;break;case u.invalid_arguments:s="Invalid function arguments";break;case u.invalid_return_type:s="Invalid function return type";break;case u.invalid_date:s="Invalid date";break;case u.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(s=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?s=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?s=`Invalid input: must end with "${e.validation.endsWith}"`:I.assertNever(e.validation):e.validation!=="regex"?s=`Invalid ${e.validation}`:s="Invalid";break;case u.too_small:e.type==="array"?s=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?s=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?s=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?s=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:s="Invalid input";break;case u.too_big:e.type==="array"?s=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?s=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?s=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?s=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?s=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:s="Invalid input";break;case u.custom:s="Invalid input";break;case u.invalid_intersection_types:s="Intersection results could not be merged";break;case u.not_multiple_of:s=`Number must be a multiple of ${e.multipleOf}`;break;case u.not_finite:s="Number must be finite";break;default:s=t.defaultError,I.assertNever(e)}return{message:s}};let On=ce;function ps(e){On=e}function We(){return On}const Ke=e=>{const{data:t,path:s,errorMaps:i,issueData:a}=e,o=[...s,...a.path||[]],r={...a,path:o};if(a.message!==void 0)return{...a,path:o,message:a.message};let c="";const d=i.filter(l=>!!l).slice().reverse();for(const l of d)c=l(r,{data:t,defaultError:c}).message;return{...a,path:o,message:c}},ms=[];function m(e,t){const s=We(),i=Ke({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,s,s===ce?void 0:ce].filter(a=>!!a)});e.common.issues.push(i)}class O{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,s){const i=[];for(const a of s){if(a.status==="aborted")return _;a.status==="dirty"&&t.dirty(),i.push(a.value)}return{status:t.value,value:i}}static async mergeObjectAsync(t,s){const i=[];for(const a of s){const o=await a.key,r=await a.value;i.push({key:o,value:r})}return O.mergeObjectSync(t,i)}static mergeObjectSync(t,s){const i={};for(const a of s){const{key:o,value:r}=a;if(o.status==="aborted"||r.status==="aborted")return _;o.status==="dirty"&&t.dirty(),r.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof r.value<"u"||a.alwaysSet)&&(i[o.value]=r.value)}return{status:t.value,value:i}}}const _=Object.freeze({status:"aborted"}),ae=e=>({status:"dirty",value:e}),C=e=>({status:"valid",value:e}),vt=e=>e.status==="aborted",_t=e=>e.status==="dirty",q=e=>e.status==="valid",ye=e=>typeof Promise<"u"&&e instanceof Promise;function Ye(e,t,s,i){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function Pn(e,t,s,i,a){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,s),s}var g;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(g||(g={}));var be,ve;class L{constructor(t,s,i,a){this._cachedPath=[],this.parent=t,this.data=s,this._path=i,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Lt=(e,t)=>{if(q(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const s=new A(e.common.issues);return this._error=s,this._error}}};function k(e){if(!e)return{};const{errorMap:t,invalid_type_error:s,required_error:i,description:a}=e;if(t&&(s||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(r,c)=>{var d,l;const{message:p}=e;return r.code==="invalid_enum_value"?{message:p??c.defaultError}:typeof c.data>"u"?{message:(d=p??i)!==null&&d!==void 0?d:c.defaultError}:r.code!=="invalid_type"?{message:c.defaultError}:{message:(l=p??s)!==null&&l!==void 0?l:c.defaultError}},description:a}}class S{get description(){return this._def.description}_getType(t){return G(t.data)}_getOrReturnCtx(t,s){return s||{common:t.parent.common,data:t.data,parsedType:G(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new O,ctx:{common:t.parent.common,data:t.data,parsedType:G(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const s=this._parse(t);if(ye(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(t){const s=this._parse(t);return Promise.resolve(s)}parse(t,s){const i=this.safeParse(t,s);if(i.success)return i.data;throw i.error}safeParse(t,s){var i;const a={common:{issues:[],async:(i=s?.async)!==null&&i!==void 0?i:!1,contextualErrorMap:s?.errorMap},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:G(t)},o=this._parseSync({data:t,path:a.path,parent:a});return Lt(a,o)}"~validate"(t){var s,i;const a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:G(t)};if(!this["~standard"].async)try{const o=this._parseSync({data:t,path:[],parent:a});return q(o)?{value:o.value}:{issues:a.common.issues}}catch(o){!((i=(s=o?.message)===null||s===void 0?void 0:s.toLowerCase())===null||i===void 0)&&i.includes("encountered")&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:a}).then(o=>q(o)?{value:o.value}:{issues:a.common.issues})}async parseAsync(t,s){const i=await this.safeParseAsync(t,s);if(i.success)return i.data;throw i.error}async safeParseAsync(t,s){const i={common:{issues:[],contextualErrorMap:s?.errorMap,async:!0},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:G(t)},a=this._parse({data:t,path:i.path,parent:i}),o=await(ye(a)?a:Promise.resolve(a));return Lt(i,o)}refine(t,s){const i=a=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(a):s;return this._refinement((a,o)=>{const r=t(a),c=()=>o.addIssue({code:u.custom,...i(a)});return typeof Promise<"u"&&r instanceof Promise?r.then(d=>d?!0:(c(),!1)):r?!0:(c(),!1)})}refinement(t,s){return this._refinement((i,a)=>t(i)?!0:(a.addIssue(typeof s=="function"?s(i,a):s),!1))}_refinement(t){return new N({schema:this,typeName:v.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,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:s=>this["~validate"](s)}}optional(){return D.create(this,this._def)}nullable(){return Y.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return M.create(this)}promise(){return de.create(this,this._def)}or(t){return Ie.create([this,t],this._def)}and(t){return xe.create(this,t,this._def)}transform(t){return new N({...k(this._def),schema:this,typeName:v.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const s=typeof t=="function"?t:()=>t;return new Pe({...k(this._def),innerType:this,defaultValue:s,typeName:v.ZodDefault})}brand(){return new Ot({typeName:v.ZodBranded,type:this,...k(this._def)})}catch(t){const s=typeof t=="function"?t:()=>t;return new Ce({...k(this._def),innerType:this,catchValue:s,typeName:v.ZodCatch})}describe(t){const s=this.constructor;return new s({...this._def,description:t})}pipe(t){return $e.create(this,t)}readonly(){return je.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const hs=/^c[^\s-]{8,}$/i,fs=/^[0-9a-z]+$/,gs=/^[0-9A-HJKMNP-TV-Z]{26}$/i,bs=/^[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,vs=/^[a-z0-9_-]{21}$/i,_s=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ys=/^[-+]?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)?)??$/,ks=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ss="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let rt;const ws=/^(?:(?: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])$/,Is=/^(?:(?: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])$/,xs=/^(([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]))$/,Ts=/^(([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])$/,Es=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Rs=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Cn="((\\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])))",Os=new RegExp(`^${Cn}$`);function jn(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function Ps(e){return new RegExp(`^${jn(e)}$`)}function An(e){let t=`${Cn}T${jn(e)}`;const s=[];return s.push(e.local?"Z?":"Z"),e.offset&&s.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${s.join("|")})`,new RegExp(`^${t}$`)}function Cs(e,t){return!!((t==="v4"||!t)&&ws.test(e)||(t==="v6"||!t)&&xs.test(e))}function js(e,t){if(!_s.test(e))return!1;try{const[s]=e.split("."),i=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),a=JSON.parse(atob(i));return!(typeof a!="object"||a===null||!a.typ||!a.alg||t&&a.alg!==t)}catch{return!1}}function As(e,t){return!!((t==="v4"||!t)&&Is.test(e)||(t==="v6"||!t)&&Ts.test(e))}class $ extends S{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==h.string){const o=this._getOrReturnCtx(t);return m(o,{code:u.invalid_type,expected:h.string,received:o.parsedType}),_}const i=new O;let a;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(a=this._getOrReturnCtx(t,a),m(a,{code:u.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="max")t.data.length>o.value&&(a=this._getOrReturnCtx(t,a),m(a,{code:u.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){const r=t.data.length>o.value,c=t.data.length<o.value;(r||c)&&(a=this._getOrReturnCtx(t,a),r?m(a,{code:u.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):c&&m(a,{code:u.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")ks.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"email",code:u.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")rt||(rt=new RegExp(Ss,"u")),rt.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"emoji",code:u.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")bs.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"uuid",code:u.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")vs.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"nanoid",code:u.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")hs.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"cuid",code:u.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")fs.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"cuid2",code:u.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")gs.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"ulid",code:u.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),m(a,{validation:"url",code:u.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"regex",code:u.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(a=this._getOrReturnCtx(t,a),m(a,{code:u.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(a=this._getOrReturnCtx(t,a),m(a,{code:u.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(a=this._getOrReturnCtx(t,a),m(a,{code:u.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?An(o).test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{code:u.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?Os.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{code:u.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?Ps(o).test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{code:u.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?ys.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"duration",code:u.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?Cs(t.data,o.version)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"ip",code:u.invalid_string,message:o.message}),i.dirty()):o.kind==="jwt"?js(t.data,o.alg)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"jwt",code:u.invalid_string,message:o.message}),i.dirty()):o.kind==="cidr"?As(t.data,o.version)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"cidr",code:u.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?Es.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"base64",code:u.invalid_string,message:o.message}),i.dirty()):o.kind==="base64url"?Rs.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"base64url",code:u.invalid_string,message:o.message}),i.dirty()):I.assertNever(o);return{status:i.value,value:t.data}}_regex(t,s,i){return this.refinement(a=>t.test(a),{validation:s,code:u.invalid_string,...g.errToObj(i)})}_addCheck(t){return new $({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...g.errToObj(t)})}url(t){return this._addCheck({kind:"url",...g.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...g.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...g.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...g.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...g.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...g.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...g.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...g.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...g.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...g.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...g.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...g.errToObj(t)})}datetime(t){var s,i;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:(s=t?.offset)!==null&&s!==void 0?s:!1,local:(i=t?.local)!==null&&i!==void 0?i:!1,...g.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...g.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...g.errToObj(t)})}regex(t,s){return this._addCheck({kind:"regex",regex:t,...g.errToObj(s)})}includes(t,s){return this._addCheck({kind:"includes",value:t,position:s?.position,...g.errToObj(s?.message)})}startsWith(t,s){return this._addCheck({kind:"startsWith",value:t,...g.errToObj(s)})}endsWith(t,s){return this._addCheck({kind:"endsWith",value:t,...g.errToObj(s)})}min(t,s){return this._addCheck({kind:"min",value:t,...g.errToObj(s)})}max(t,s){return this._addCheck({kind:"max",value:t,...g.errToObj(s)})}length(t,s){return this._addCheck({kind:"length",value:t,...g.errToObj(s)})}nonempty(t){return this.min(1,g.errToObj(t))}trim(){return new $({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new $({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new $({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t}get maxLength(){let t=null;for(const s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t}}$.create=e=>{var t;return new $({checks:[],typeName:v.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...k(e)})};function $s(e,t){const s=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,a=s>i?s:i,o=parseInt(e.toFixed(a).replace(".","")),r=parseInt(t.toFixed(a).replace(".",""));return o%r/Math.pow(10,a)}class V extends S{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==h.number){const o=this._getOrReturnCtx(t);return m(o,{code:u.invalid_type,expected:h.number,received:o.parsedType}),_}let i;const a=new O;for(const o of this._def.checks)o.kind==="int"?I.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),m(i,{code:u.invalid_type,expected:"integer",received:"float",message:o.message}),a.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),m(i,{code:u.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),m(i,{code:u.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty()):o.kind==="multipleOf"?$s(t.data,o.value)!==0&&(i=this._getOrReturnCtx(t,i),m(i,{code:u.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),m(i,{code:u.not_finite,message:o.message}),a.dirty()):I.assertNever(o);return{status:a.value,value:t.data}}gte(t,s){return this.setLimit("min",t,!0,g.toString(s))}gt(t,s){return this.setLimit("min",t,!1,g.toString(s))}lte(t,s){return this.setLimit("max",t,!0,g.toString(s))}lt(t,s){return this.setLimit("max",t,!1,g.toString(s))}setLimit(t,s,i,a){return new V({...this._def,checks:[...this._def.checks,{kind:t,value:s,inclusive:i,message:g.toString(a)}]})}_addCheck(t){return new V({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:g.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:g.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:g.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:g.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:g.toString(t)})}multipleOf(t,s){return this._addCheck({kind:"multipleOf",value:t,message:g.toString(s)})}finite(t){return this._addCheck({kind:"finite",message:g.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:g.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:g.toString(t)})}get minValue(){let t=null;for(const s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t}get maxValue(){let t=null;for(const s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&I.isInteger(t.value))}get isFinite(){let t=null,s=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(s===null||i.value>s)&&(s=i.value):i.kind==="max"&&(t===null||i.value<t)&&(t=i.value)}return Number.isFinite(s)&&Number.isFinite(t)}}V.create=e=>new V({checks:[],typeName:v.ZodNumber,coerce:e?.coerce||!1,...k(e)});class W extends S{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==h.bigint)return this._getInvalidInput(t);let i;const a=new O;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),m(i,{code:u.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),m(i,{code:u.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(t,i),m(i,{code:u.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):I.assertNever(o);return{status:a.value,value:t.data}}_getInvalidInput(t){const s=this._getOrReturnCtx(t);return m(s,{code:u.invalid_type,expected:h.bigint,received:s.parsedType}),_}gte(t,s){return this.setLimit("min",t,!0,g.toString(s))}gt(t,s){return this.setLimit("min",t,!1,g.toString(s))}lte(t,s){return this.setLimit("max",t,!0,g.toString(s))}lt(t,s){return this.setLimit("max",t,!1,g.toString(s))}setLimit(t,s,i,a){return new W({...this._def,checks:[...this._def.checks,{kind:t,value:s,inclusive:i,message:g.toString(a)}]})}_addCheck(t){return new W({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:g.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:g.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:g.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:g.toString(t)})}multipleOf(t,s){return this._addCheck({kind:"multipleOf",value:t,message:g.toString(s)})}get minValue(){let t=null;for(const s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t}get maxValue(){let t=null;for(const s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t}}W.create=e=>{var t;return new W({checks:[],typeName:v.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...k(e)})};class ke extends S{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==h.boolean){const i=this._getOrReturnCtx(t);return m(i,{code:u.invalid_type,expected:h.boolean,received:i.parsedType}),_}return C(t.data)}}ke.create=e=>new ke({typeName:v.ZodBoolean,coerce:e?.coerce||!1,...k(e)});class ee extends S{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==h.date){const o=this._getOrReturnCtx(t);return m(o,{code:u.invalid_type,expected:h.date,received:o.parsedType}),_}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return m(o,{code:u.invalid_date}),_}const i=new O;let a;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(a=this._getOrReturnCtx(t,a),m(a,{code:u.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),i.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(a=this._getOrReturnCtx(t,a),m(a,{code:u.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):I.assertNever(o);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ee({...this._def,checks:[...this._def.checks,t]})}min(t,s){return this._addCheck({kind:"min",value:t.getTime(),message:g.toString(s)})}max(t,s){return this._addCheck({kind:"max",value:t.getTime(),message:g.toString(s)})}get minDate(){let t=null;for(const s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t!=null?new Date(t):null}}ee.create=e=>new ee({checks:[],coerce:e?.coerce||!1,typeName:v.ZodDate,...k(e)});class Xe extends S{_parse(t){if(this._getType(t)!==h.symbol){const i=this._getOrReturnCtx(t);return m(i,{code:u.invalid_type,expected:h.symbol,received:i.parsedType}),_}return C(t.data)}}Xe.create=e=>new Xe({typeName:v.ZodSymbol,...k(e)});class Se extends S{_parse(t){if(this._getType(t)!==h.undefined){const i=this._getOrReturnCtx(t);return m(i,{code:u.invalid_type,expected:h.undefined,received:i.parsedType}),_}return C(t.data)}}Se.create=e=>new Se({typeName:v.ZodUndefined,...k(e)});class we extends S{_parse(t){if(this._getType(t)!==h.null){const i=this._getOrReturnCtx(t);return m(i,{code:u.invalid_type,expected:h.null,received:i.parsedType}),_}return C(t.data)}}we.create=e=>new we({typeName:v.ZodNull,...k(e)});class le extends S{constructor(){super(...arguments),this._any=!0}_parse(t){return C(t.data)}}le.create=e=>new le({typeName:v.ZodAny,...k(e)});class Q extends S{constructor(){super(...arguments),this._unknown=!0}_parse(t){return C(t.data)}}Q.create=e=>new Q({typeName:v.ZodUnknown,...k(e)});class z extends S{_parse(t){const s=this._getOrReturnCtx(t);return m(s,{code:u.invalid_type,expected:h.never,received:s.parsedType}),_}}z.create=e=>new z({typeName:v.ZodNever,...k(e)});class Je extends S{_parse(t){if(this._getType(t)!==h.undefined){const i=this._getOrReturnCtx(t);return m(i,{code:u.invalid_type,expected:h.void,received:i.parsedType}),_}return C(t.data)}}Je.create=e=>new Je({typeName:v.ZodVoid,...k(e)});class M extends S{_parse(t){const{ctx:s,status:i}=this._processInputParams(t),a=this._def;if(s.parsedType!==h.array)return m(s,{code:u.invalid_type,expected:h.array,received:s.parsedType}),_;if(a.exactLength!==null){const r=s.data.length>a.exactLength.value,c=s.data.length<a.exactLength.value;(r||c)&&(m(s,{code:r?u.too_big:u.too_small,minimum:c?a.exactLength.value:void 0,maximum:r?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),i.dirty())}if(a.minLength!==null&&s.data.length<a.minLength.value&&(m(s,{code:u.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),i.dirty()),a.maxLength!==null&&s.data.length>a.maxLength.value&&(m(s,{code:u.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),i.dirty()),s.common.async)return Promise.all([...s.data].map((r,c)=>a.type._parseAsync(new L(s,r,s.path,c)))).then(r=>O.mergeArray(i,r));const o=[...s.data].map((r,c)=>a.type._parseSync(new L(s,r,s.path,c)));return O.mergeArray(i,o)}get element(){return this._def.type}min(t,s){return new M({...this._def,minLength:{value:t,message:g.toString(s)}})}max(t,s){return new M({...this._def,maxLength:{value:t,message:g.toString(s)}})}length(t,s){return new M({...this._def,exactLength:{value:t,message:g.toString(s)}})}nonempty(t){return this.min(1,t)}}M.create=(e,t)=>new M({type:e,minLength:null,maxLength:null,exactLength:null,typeName:v.ZodArray,...k(t)});function ie(e){if(e instanceof E){const t={};for(const s in e.shape){const i=e.shape[s];t[s]=D.create(ie(i))}return new E({...e._def,shape:()=>t})}else return e instanceof M?new M({...e._def,type:ie(e.element)}):e instanceof D?D.create(ie(e.unwrap())):e instanceof Y?Y.create(ie(e.unwrap())):e instanceof U?U.create(e.items.map(t=>ie(t))):e}class E extends S{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),s=I.objectKeys(t);return this._cached={shape:t,keys:s}}_parse(t){if(this._getType(t)!==h.object){const l=this._getOrReturnCtx(t);return m(l,{code:u.invalid_type,expected:h.object,received:l.parsedType}),_}const{status:i,ctx:a}=this._processInputParams(t),{shape:o,keys:r}=this._getCached(),c=[];if(!(this._def.catchall instanceof z&&this._def.unknownKeys==="strip"))for(const l in a.data)r.includes(l)||c.push(l);const d=[];for(const l of r){const p=o[l],w=a.data[l];d.push({key:{status:"valid",value:l},value:p._parse(new L(a,w,a.path,l)),alwaysSet:l in a.data})}if(this._def.catchall instanceof z){const l=this._def.unknownKeys;if(l==="passthrough")for(const p of c)d.push({key:{status:"valid",value:p},value:{status:"valid",value:a.data[p]}});else if(l==="strict")c.length>0&&(m(a,{code:u.unrecognized_keys,keys:c}),i.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const p of c){const w=a.data[p];d.push({key:{status:"valid",value:p},value:l._parse(new L(a,w,a.path,p)),alwaysSet:p in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const l=[];for(const p of d){const w=await p.key,y=await p.value;l.push({key:w,value:y,alwaysSet:p.alwaysSet})}return l}).then(l=>O.mergeObjectSync(i,l)):O.mergeObjectSync(i,d)}get shape(){return this._def.shape()}strict(t){return g.errToObj,new E({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(s,i)=>{var a,o,r,c;const d=(r=(o=(a=this._def).errorMap)===null||o===void 0?void 0:o.call(a,s,i).message)!==null&&r!==void 0?r:i.defaultError;return s.code==="unrecognized_keys"?{message:(c=g.errToObj(t).message)!==null&&c!==void 0?c:d}:{message:d}}}:{}})}strip(){return new E({...this._def,unknownKeys:"strip"})}passthrough(){return new E({...this._def,unknownKeys:"passthrough"})}extend(t){return new E({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new E({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:v.ZodObject})}setKey(t,s){return this.augment({[t]:s})}catchall(t){return new E({...this._def,catchall:t})}pick(t){const s={};return I.objectKeys(t).forEach(i=>{t[i]&&this.shape[i]&&(s[i]=this.shape[i])}),new E({...this._def,shape:()=>s})}omit(t){const s={};return I.objectKeys(this.shape).forEach(i=>{t[i]||(s[i]=this.shape[i])}),new E({...this._def,shape:()=>s})}deepPartial(){return ie(this)}partial(t){const s={};return I.objectKeys(this.shape).forEach(i=>{const a=this.shape[i];t&&!t[i]?s[i]=a:s[i]=a.optional()}),new E({...this._def,shape:()=>s})}required(t){const s={};return I.objectKeys(this.shape).forEach(i=>{if(t&&!t[i])s[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof D;)o=o._def.innerType;s[i]=o}}),new E({...this._def,shape:()=>s})}keyof(){return $n(I.objectKeys(this.shape))}}E.create=(e,t)=>new E({shape:()=>e,unknownKeys:"strip",catchall:z.create(),typeName:v.ZodObject,...k(t)});E.strictCreate=(e,t)=>new E({shape:()=>e,unknownKeys:"strict",catchall:z.create(),typeName:v.ZodObject,...k(t)});E.lazycreate=(e,t)=>new E({shape:e,unknownKeys:"strip",catchall:z.create(),typeName:v.ZodObject,...k(t)});class Ie extends S{_parse(t){const{ctx:s}=this._processInputParams(t),i=this._def.options;function a(o){for(const c of o)if(c.result.status==="valid")return c.result;for(const c of o)if(c.result.status==="dirty")return s.common.issues.push(...c.ctx.common.issues),c.result;const r=o.map(c=>new A(c.ctx.common.issues));return m(s,{code:u.invalid_union,unionErrors:r}),_}if(s.common.async)return Promise.all(i.map(async o=>{const r={...s,common:{...s.common,issues:[]},parent:null};return{result:await o._parseAsync({data:s.data,path:s.path,parent:r}),ctx:r}})).then(a);{let o;const r=[];for(const d of i){const l={...s,common:{...s.common,issues:[]},parent:null},p=d._parseSync({data:s.data,path:s.path,parent:l});if(p.status==="valid")return p;p.status==="dirty"&&!o&&(o={result:p,ctx:l}),l.common.issues.length&&r.push(l.common.issues)}if(o)return s.common.issues.push(...o.ctx.common.issues),o.result;const c=r.map(d=>new A(d));return m(s,{code:u.invalid_union,unionErrors:c}),_}}get options(){return this._def.options}}Ie.create=(e,t)=>new Ie({options:e,typeName:v.ZodUnion,...k(t)});const B=e=>e instanceof Ee?B(e.schema):e instanceof N?B(e.innerType()):e instanceof Re?[e.value]:e instanceof K?e.options:e instanceof Oe?I.objectValues(e.enum):e instanceof Pe?B(e._def.innerType):e instanceof Se?[void 0]:e instanceof we?[null]:e instanceof D?[void 0,...B(e.unwrap())]:e instanceof Y?[null,...B(e.unwrap())]:e instanceof Ot||e instanceof je?B(e.unwrap()):e instanceof Ce?B(e._def.innerType):[];class et extends S{_parse(t){const{ctx:s}=this._processInputParams(t);if(s.parsedType!==h.object)return m(s,{code:u.invalid_type,expected:h.object,received:s.parsedType}),_;const i=this.discriminator,a=s.data[i],o=this.optionsMap.get(a);return o?s.common.async?o._parseAsync({data:s.data,path:s.path,parent:s}):o._parseSync({data:s.data,path:s.path,parent:s}):(m(s,{code:u.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),_)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,s,i){const a=new Map;for(const o of s){const r=B(o.shape[t]);if(!r.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const c of r){if(a.has(c))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(c)}`);a.set(c,o)}}return new et({typeName:v.ZodDiscriminatedUnion,discriminator:t,options:s,optionsMap:a,...k(i)})}}function yt(e,t){const s=G(e),i=G(t);if(e===t)return{valid:!0,data:e};if(s===h.object&&i===h.object){const a=I.objectKeys(t),o=I.objectKeys(e).filter(c=>a.indexOf(c)!==-1),r={...e,...t};for(const c of o){const d=yt(e[c],t[c]);if(!d.valid)return{valid:!1};r[c]=d.data}return{valid:!0,data:r}}else if(s===h.array&&i===h.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let o=0;o<e.length;o++){const r=e[o],c=t[o],d=yt(r,c);if(!d.valid)return{valid:!1};a.push(d.data)}return{valid:!0,data:a}}else return s===h.date&&i===h.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class xe extends S{_parse(t){const{status:s,ctx:i}=this._processInputParams(t),a=(o,r)=>{if(vt(o)||vt(r))return _;const c=yt(o.value,r.value);return c.valid?((_t(o)||_t(r))&&s.dirty(),{status:s.value,value:c.data}):(m(i,{code:u.invalid_intersection_types}),_)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,r])=>a(o,r)):a(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}xe.create=(e,t,s)=>new xe({left:e,right:t,typeName:v.ZodIntersection,...k(s)});class U extends S{_parse(t){const{status:s,ctx:i}=this._processInputParams(t);if(i.parsedType!==h.array)return m(i,{code:u.invalid_type,expected:h.array,received:i.parsedType}),_;if(i.data.length<this._def.items.length)return m(i,{code:u.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_;!this._def.rest&&i.data.length>this._def.items.length&&(m(i,{code:u.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());const o=[...i.data].map((r,c)=>{const d=this._def.items[c]||this._def.rest;return d?d._parse(new L(i,r,i.path,c)):null}).filter(r=>!!r);return i.common.async?Promise.all(o).then(r=>O.mergeArray(s,r)):O.mergeArray(s,o)}get items(){return this._def.items}rest(t){return new U({...this._def,rest:t})}}U.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new U({items:e,typeName:v.ZodTuple,rest:null,...k(t)})};class Te extends S{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:s,ctx:i}=this._processInputParams(t);if(i.parsedType!==h.object)return m(i,{code:u.invalid_type,expected:h.object,received:i.parsedType}),_;const a=[],o=this._def.keyType,r=this._def.valueType;for(const c in i.data)a.push({key:o._parse(new L(i,c,i.path,c)),value:r._parse(new L(i,i.data[c],i.path,c)),alwaysSet:c in i.data});return i.common.async?O.mergeObjectAsync(s,a):O.mergeObjectSync(s,a)}get element(){return this._def.valueType}static create(t,s,i){return s instanceof S?new Te({keyType:t,valueType:s,typeName:v.ZodRecord,...k(i)}):new Te({keyType:$.create(),valueType:t,typeName:v.ZodRecord,...k(s)})}}class Qe extends S{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:s,ctx:i}=this._processInputParams(t);if(i.parsedType!==h.map)return m(i,{code:u.invalid_type,expected:h.map,received:i.parsedType}),_;const a=this._def.keyType,o=this._def.valueType,r=[...i.data.entries()].map(([c,d],l)=>({key:a._parse(new L(i,c,i.path,[l,"key"])),value:o._parse(new L(i,d,i.path,[l,"value"]))}));if(i.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const d of r){const l=await d.key,p=await d.value;if(l.status==="aborted"||p.status==="aborted")return _;(l.status==="dirty"||p.status==="dirty")&&s.dirty(),c.set(l.value,p.value)}return{status:s.value,value:c}})}else{const c=new Map;for(const d of r){const l=d.key,p=d.value;if(l.status==="aborted"||p.status==="aborted")return _;(l.status==="dirty"||p.status==="dirty")&&s.dirty(),c.set(l.value,p.value)}return{status:s.value,value:c}}}}Qe.create=(e,t,s)=>new Qe({valueType:t,keyType:e,typeName:v.ZodMap,...k(s)});class te extends S{_parse(t){const{status:s,ctx:i}=this._processInputParams(t);if(i.parsedType!==h.set)return m(i,{code:u.invalid_type,expected:h.set,received:i.parsedType}),_;const a=this._def;a.minSize!==null&&i.data.size<a.minSize.value&&(m(i,{code:u.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),s.dirty()),a.maxSize!==null&&i.data.size>a.maxSize.value&&(m(i,{code:u.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),s.dirty());const o=this._def.valueType;function r(d){const l=new Set;for(const p of d){if(p.status==="aborted")return _;p.status==="dirty"&&s.dirty(),l.add(p.value)}return{status:s.value,value:l}}const c=[...i.data.values()].map((d,l)=>o._parse(new L(i,d,i.path,l)));return i.common.async?Promise.all(c).then(d=>r(d)):r(c)}min(t,s){return new te({...this._def,minSize:{value:t,message:g.toString(s)}})}max(t,s){return new te({...this._def,maxSize:{value:t,message:g.toString(s)}})}size(t,s){return this.min(t,s).max(t,s)}nonempty(t){return this.min(1,t)}}te.create=(e,t)=>new te({valueType:e,minSize:null,maxSize:null,typeName:v.ZodSet,...k(t)});class oe extends S{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:s}=this._processInputParams(t);if(s.parsedType!==h.function)return m(s,{code:u.invalid_type,expected:h.function,received:s.parsedType}),_;function i(c,d){return Ke({data:c,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,We(),ce].filter(l=>!!l),issueData:{code:u.invalid_arguments,argumentsError:d}})}function a(c,d){return Ke({data:c,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,We(),ce].filter(l=>!!l),issueData:{code:u.invalid_return_type,returnTypeError:d}})}const o={errorMap:s.common.contextualErrorMap},r=s.data;if(this._def.returns instanceof de){const c=this;return C(async function(...d){const l=new A([]),p=await c._def.args.parseAsync(d,o).catch(P=>{throw l.addIssue(i(d,P)),l}),w=await Reflect.apply(r,this,p);return await c._def.returns._def.type.parseAsync(w,o).catch(P=>{throw l.addIssue(a(w,P)),l})})}else{const c=this;return C(function(...d){const l=c._def.args.safeParse(d,o);if(!l.success)throw new A([i(d,l.error)]);const p=Reflect.apply(r,this,l.data),w=c._def.returns.safeParse(p,o);if(!w.success)throw new A([a(p,w.error)]);return w.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new oe({...this._def,args:U.create(t).rest(Q.create())})}returns(t){return new oe({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,s,i){return new oe({args:t||U.create([]).rest(Q.create()),returns:s||Q.create(),typeName:v.ZodFunction,...k(i)})}}class Ee extends S{get schema(){return this._def.getter()}_parse(t){const{ctx:s}=this._processInputParams(t);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}}Ee.create=(e,t)=>new Ee({getter:e,typeName:v.ZodLazy,...k(t)});class Re extends S{_parse(t){if(t.data!==this._def.value){const s=this._getOrReturnCtx(t);return m(s,{received:s.data,code:u.invalid_literal,expected:this._def.value}),_}return{status:"valid",value:t.data}}get value(){return this._def.value}}Re.create=(e,t)=>new Re({value:e,typeName:v.ZodLiteral,...k(t)});function $n(e,t){return new K({values:e,typeName:v.ZodEnum,...k(t)})}class K extends S{constructor(){super(...arguments),be.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const s=this._getOrReturnCtx(t),i=this._def.values;return m(s,{expected:I.joinValues(i),received:s.parsedType,code:u.invalid_type}),_}if(Ye(this,be)||Pn(this,be,new Set(this._def.values)),!Ye(this,be).has(t.data)){const s=this._getOrReturnCtx(t),i=this._def.values;return m(s,{received:s.data,code:u.invalid_enum_value,options:i}),_}return C(t.data)}get options(){return this._def.values}get enum(){const t={};for(const s of this._def.values)t[s]=s;return t}get Values(){const t={};for(const s of this._def.values)t[s]=s;return t}get Enum(){const t={};for(const s of this._def.values)t[s]=s;return t}extract(t,s=this._def){return K.create(t,{...this._def,...s})}exclude(t,s=this._def){return K.create(this.options.filter(i=>!t.includes(i)),{...this._def,...s})}}be=new WeakMap;K.create=$n;class Oe extends S{constructor(){super(...arguments),ve.set(this,void 0)}_parse(t){const s=I.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==h.string&&i.parsedType!==h.number){const a=I.objectValues(s);return m(i,{expected:I.joinValues(a),received:i.parsedType,code:u.invalid_type}),_}if(Ye(this,ve)||Pn(this,ve,new Set(I.getValidEnumValues(this._def.values))),!Ye(this,ve).has(t.data)){const a=I.objectValues(s);return m(i,{received:i.data,code:u.invalid_enum_value,options:a}),_}return C(t.data)}get enum(){return this._def.values}}ve=new WeakMap;Oe.create=(e,t)=>new Oe({values:e,typeName:v.ZodNativeEnum,...k(t)});class de extends S{unwrap(){return this._def.type}_parse(t){const{ctx:s}=this._processInputParams(t);if(s.parsedType!==h.promise&&s.common.async===!1)return m(s,{code:u.invalid_type,expected:h.promise,received:s.parsedType}),_;const i=s.parsedType===h.promise?s.data:Promise.resolve(s.data);return C(i.then(a=>this._def.type.parseAsync(a,{path:s.path,errorMap:s.common.contextualErrorMap})))}}de.create=(e,t)=>new de({type:e,typeName:v.ZodPromise,...k(t)});class N extends S{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===v.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:s,ctx:i}=this._processInputParams(t),a=this._def.effect||null,o={addIssue:r=>{m(i,r),r.fatal?s.abort():s.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),a.type==="preprocess"){const r=a.transform(i.data,o);if(i.common.async)return Promise.resolve(r).then(async c=>{if(s.value==="aborted")return _;const d=await this._def.schema._parseAsync({data:c,path:i.path,parent:i});return d.status==="aborted"?_:d.status==="dirty"||s.value==="dirty"?ae(d.value):d});{if(s.value==="aborted")return _;const c=this._def.schema._parseSync({data:r,path:i.path,parent:i});return c.status==="aborted"?_:c.status==="dirty"||s.value==="dirty"?ae(c.value):c}}if(a.type==="refinement"){const r=c=>{const d=a.refinement(c,o);if(i.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(i.common.async===!1){const c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return c.status==="aborted"?_:(c.status==="dirty"&&s.dirty(),r(c.value),{status:s.value,value:c.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>c.status==="aborted"?_:(c.status==="dirty"&&s.dirty(),r(c.value).then(()=>({status:s.value,value:c.value}))))}if(a.type==="transform")if(i.common.async===!1){const r=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!q(r))return r;const c=a.transform(r.value,o);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:c}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(r=>q(r)?Promise.resolve(a.transform(r.value,o)).then(c=>({status:s.value,value:c})):r);I.assertNever(a)}}N.create=(e,t,s)=>new N({schema:e,typeName:v.ZodEffects,effect:t,...k(s)});N.createWithPreprocess=(e,t,s)=>new N({schema:t,effect:{type:"preprocess",transform:e},typeName:v.ZodEffects,...k(s)});class D extends S{_parse(t){return this._getType(t)===h.undefined?C(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}D.create=(e,t)=>new D({innerType:e,typeName:v.ZodOptional,...k(t)});class Y extends S{_parse(t){return this._getType(t)===h.null?C(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Y.create=(e,t)=>new Y({innerType:e,typeName:v.ZodNullable,...k(t)});class Pe extends S{_parse(t){const{ctx:s}=this._processInputParams(t);let i=s.data;return s.parsedType===h.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:s.path,parent:s})}removeDefault(){return this._def.innerType}}Pe.create=(e,t)=>new Pe({innerType:e,typeName:v.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...k(t)});class Ce extends S{_parse(t){const{ctx:s}=this._processInputParams(t),i={...s,common:{...s.common,issues:[]}},a=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return ye(a)?a.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new A(i.common.issues)},input:i.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new A(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}Ce.create=(e,t)=>new Ce({innerType:e,typeName:v.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...k(t)});class qe extends S{_parse(t){if(this._getType(t)!==h.nan){const i=this._getOrReturnCtx(t);return m(i,{code:u.invalid_type,expected:h.nan,received:i.parsedType}),_}return{status:"valid",value:t.data}}}qe.create=e=>new qe({typeName:v.ZodNaN,...k(e)});const Ms=Symbol("zod_brand");class Ot extends S{_parse(t){const{ctx:s}=this._processInputParams(t),i=s.data;return this._def.type._parse({data:i,path:s.path,parent:s})}unwrap(){return this._def.type}}class $e extends S{_parse(t){const{status:s,ctx:i}=this._processInputParams(t);if(i.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?_:o.status==="dirty"?(s.dirty(),ae(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})})();{const a=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return a.status==="aborted"?_:a.status==="dirty"?(s.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:i.path,parent:i})}}static create(t,s){return new $e({in:t,out:s,typeName:v.ZodPipeline})}}class je extends S{_parse(t){const s=this._def.innerType._parse(t),i=a=>(q(a)&&(a.value=Object.freeze(a.value)),a);return ye(s)?s.then(a=>i(a)):i(s)}unwrap(){return this._def.innerType}}je.create=(e,t)=>new je({innerType:e,typeName:v.ZodReadonly,...k(t)});function Ut(e,t){const s=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof s=="string"?{message:s}:s}function Mn(e,t={},s){return e?le.create().superRefine((i,a)=>{var o,r;const c=e(i);if(c instanceof Promise)return c.then(d=>{var l,p;if(!d){const w=Ut(t,i),y=(p=(l=w.fatal)!==null&&l!==void 0?l:s)!==null&&p!==void 0?p:!0;a.addIssue({code:"custom",...w,fatal:y})}});if(!c){const d=Ut(t,i),l=(r=(o=d.fatal)!==null&&o!==void 0?o:s)!==null&&r!==void 0?r:!0;a.addIssue({code:"custom",...d,fatal:l})}}):le.create()}const Ns={object:E.lazycreate};var v;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(v||(v={}));const Ds=(e,t={message:`Input not instance of ${e.name}`})=>Mn(s=>s instanceof e,t),Nn=$.create,Dn=V.create,Ls=qe.create,Us=W.create,Ln=ke.create,Zs=ee.create,Bs=Xe.create,Gs=Se.create,zs=we.create,Fs=le.create,Hs=Q.create,Vs=z.create,Ws=Je.create,Ks=M.create,Ys=E.create,Xs=E.strictCreate,Js=Ie.create,Qs=et.create,qs=xe.create,ei=U.create,ti=Te.create,ni=Qe.create,si=te.create,ii=oe.create,ai=Ee.create,oi=Re.create,ri=K.create,ci=Oe.create,li=de.create,Zt=N.create,di=D.create,ui=Y.create,pi=N.createWithPreprocess,mi=$e.create,hi=()=>Nn().optional(),fi=()=>Dn().optional(),gi=()=>Ln().optional(),bi={string:e=>$.create({...e,coerce:!0}),number:e=>V.create({...e,coerce:!0}),boolean:e=>ke.create({...e,coerce:!0}),bigint:e=>W.create({...e,coerce:!0}),date:e=>ee.create({...e,coerce:!0})},vi=_;var n=Object.freeze({__proto__:null,defaultErrorMap:ce,setErrorMap:ps,getErrorMap:We,makeIssue:Ke,EMPTY_PATH:ms,addIssueToContext:m,ParseStatus:O,INVALID:_,DIRTY:ae,OK:C,isAborted:vt,isDirty:_t,isValid:q,isAsync:ye,get util(){return I},get objectUtil(){return bt},ZodParsedType:h,getParsedType:G,ZodType:S,datetimeRegex:An,ZodString:$,ZodNumber:V,ZodBigInt:W,ZodBoolean:ke,ZodDate:ee,ZodSymbol:Xe,ZodUndefined:Se,ZodNull:we,ZodAny:le,ZodUnknown:Q,ZodNever:z,ZodVoid:Je,ZodArray:M,ZodObject:E,ZodUnion:Ie,ZodDiscriminatedUnion:et,ZodIntersection:xe,ZodTuple:U,ZodRecord:Te,ZodMap:Qe,ZodSet:te,ZodFunction:oe,ZodLazy:Ee,ZodLiteral:Re,ZodEnum:K,ZodNativeEnum:Oe,ZodPromise:de,ZodEffects:N,ZodTransformer:N,ZodOptional:D,ZodNullable:Y,ZodDefault:Pe,ZodCatch:Ce,ZodNaN:qe,BRAND:Ms,ZodBranded:Ot,ZodPipeline:$e,ZodReadonly:je,custom:Mn,Schema:S,ZodSchema:S,late:Ns,get ZodFirstPartyTypeKind(){return v},coerce:bi,any:Fs,array:Ks,bigint:Us,boolean:Ln,date:Zs,discriminatedUnion:Qs,effect:Zt,enum:ri,function:ii,instanceof:Ds,intersection:qs,lazy:ai,literal:oi,map:ni,nan:Ls,nativeEnum:ci,never:Vs,null:zs,nullable:ui,number:Dn,object:Ys,oboolean:gi,onumber:fi,optional:di,ostring:hi,pipeline:mi,preprocess:pi,promise:li,record:ti,set:si,strictObject:Xs,string:Nn,symbol:Bs,transformer:Zt,tuple:ei,undefined:Gs,union:Js,unknown:Hs,void:Ws,NEVER:vi,ZodIssueCode:u,quotelessJson:us,ZodError:A});const _i=n.enum(["app_start","sign_in","window_focus","surface_open"]),Un=n.object({id:n.string().min(1),state:n.enum(["active","paused","disabled"])}).passthrough(),yi=n.object({tenant_id:n.string().min(1),tenant_name:n.string().optional(),eligible:n.boolean(),endpoint:Un.nullable()}).passthrough(),ki=n.object({code:n.string(),message:n.string(),details:n.record(n.unknown()).optional(),retry_after_seconds:n.number().optional()}).passthrough(),gr=n.object({capability:n.number(),consent_account_guard:n.boolean().optional(),state:n.enum(["ready","signed_out","unavailable","update_required"]),account_id:n.string().nullable(),tenant_id:n.string().nullable(),surface_state:n.enum(["A","B","C","D","E","F","G"]).nullable(),visibility:n.object({settings:n.boolean(),inbox:n.boolean(),account_door:n.boolean(),onboarding:n.boolean()}),update_required:n.boolean(),local:n.object({enabled:n.boolean(),onboarding:n.string(),session:n.string()}),status:n.object({tenants:n.array(yi)}).passthrough().nullable(),consent:n.object({version:n.string().min(1).max(128),text:n.string().min(1).refine(e=>new TextEncoder().encode(e).length<=2048,"Consent exceeds the served-text contract"),source:n.enum(["served","cached","embedded"])}).nullable(),error:ki.nullable(),state_note:n.string().nullable().optional(),read_only:n.boolean().optional()}).passthrough(),Si=n.object({version:n.string().min(1),consented_at:n.string().min(1),consented_via:n.enum(["dialog","settings"]),current:n.boolean()}).passthrough(),br=n.object({endpoint:Un.extend({tenant_id:n.string().min(1),label:n.string().optional(),consent:Si.nullable().optional(),created_at:n.string().optional(),updated_at:n.string().optional()}).nullable(),settings:n.object({tenant_id:n.string().min(1),eligible:n.boolean(),consent_version:n.string().optional(),consent_required:n.boolean()}).passthrough()}).passthrough(),wi=n.object({kind:n.enum(["endpoint","account"]).optional(),endpoint_id:n.string().min(1).optional(),account_id:n.string().min(1).optional()}).passthrough().refine(e=>!!e.endpoint_id!=!!e.account_id,"An allowlist target names exactly one of endpoint_id or account_id").refine(e=>e.kind===void 0||(e.kind==="endpoint"?e.endpoint_id!==void 0:e.account_id!==void 0),"An allowlist target's kind must agree with the id it carries"),Bt=n.object({direction:n.enum(["send","receive"]),effect:n.enum(["allow","deny"]),target:wi,id:n.string().optional()}).passthrough(),Gt=n.object({mode:n.enum(["class_default","listed_only"]),allow:n.number(),deny:n.number()}).passthrough(),vr=n.object({allowlist:n.object({tenant_id:n.string().min(1),entries:n.array(Bt)}).passthrough(),view:n.object({tenant_id:n.string().nullable(),entries:n.array(Bt),directions:n.object({send:Gt,receive:Gt}),class_default:n.literal("cos_cos"),cues:n.object({allow_entry_switches_direction_to_listed_only:n.boolean(),listed_only_affects:n.string(),removing_allow_does_not_stop_open_thread:n.boolean(),deny_stops_pair_both_directions:n.boolean()}).passthrough()}).passthrough()}).passthrough();function _r(e,t){if(!e||!t||e.account_id!==t||e.capability<1||e.state!=="ready"||e.update_required||e.surface_state!=="B"||!e.visibility.onboarding||!e.tenant_id)return null;const s=e.status?.tenants.filter(i=>i.tenant_id===e.tenant_id);return s?.length!==1||s[0].eligible!==!0||s[0].endpoint!==null?null:{accountId:t,tenantId:e.tenant_id}}function yr(e){const t=e?.consent;return t&&(t.source==="served"||t.source==="cached")?t:null}const Ii=6*1024,xi=512;function kt(e,t,s){let i=new TextEncoder().encode(`${t}${e.size?`?${e}`:""}`).length;const a=[];for(const o of s){if(a.length===xi)break;const c=new URLSearchParams({order_ids:o}).toString().length+1;if(i+c>Ii)break;e.append("order_ids",o),a.push(o),i+=c}return a}function kr(e,t,s){return kt(new URLSearchParams(s),t,e)}const f=n.string().min(1).max(128).regex(/^[a-zA-Z0-9_-]+$/),Ue=n.string().min(1).max(256).regex(/^[a-zA-Z0-9_][a-zA-Z0-9_.-]*$/),Ze=n.string().min(1).max(32768),Ti=/^[a-f0-9]{12}$/,b=n.string().regex(Ti),ct=n.string().regex(/^[a-f0-9]{12}$/),lt=n.string().min(1).max(128),Ei=n.string().min(1).max(4096),dt=n.string().regex(/^[A-Za-z0-9_.:-]{1,100}$/),Be=n.string().regex(/^\$\{[A-Za-z_][A-Za-z0-9_]*\}$/),zt=n.string().regex(/^[a-f0-9]{32}$/),Ri=/^(\/|[A-Za-z]:[\\/])/,ut=n.string().min(1).max(4096).regex(Ri),Ft=/^[a-f0-9]{32}$/,x=n.string().regex(/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/),Ht=n.string().min(1).max(512).nullish(),se=n.string().regex(/^[A-Za-z0-9_-]{1,128}$/),Vt=n.string().regex(/^ap_[0-9a-hjkmnp-tv-z]{1,64}$/),pe=n.string().regex(/^la_[0-9a-f]{16}$/),me=n.string().min(1).max(128).regex(/^[A-Za-z0-9_.:-]+$/),Wt=n.object({data_b64:n.string().min(1).max(1e6),mime_type:n.enum(["image/png","image/jpeg","image/gif","image/webp"])}).strict(),Kt=2e5,Yt=8,Oi=256,Pi=100,Xt=16,Ci=256,ji=100,Ai=200,$i=1e6,Mi=n.enum(["auto","none","minimal","low","medium","high","xhigh","max"]),R=n.string().min(1).max(128).refine(e=>e!=="."&&e!==".."&&!e.includes("/")&&!e.includes("\\")&&[...e].every(t=>t.charCodeAt(0)>=32&&t.charCodeAt(0)!==127)),Ge=n.object({kind:n.enum(["agent","team"]),name:R}).strict(),Zn=n.enum(["claude","codex","omp"]),Ni=n.record(n.string(),n.array(n.string().min(1).max(512)).max(5e3)),Jt={sources:n.array(Zn).max(3).optional(),sessionIds:Ni.optional(),all:n.boolean().optional(),includeSubagents:n.boolean().optional(),includeClearedSegments:n.boolean().optional(),includeMemory:n.boolean().optional(),includeInstructions:n.boolean().optional(),maxSessions:n.number().int().min(1).max(5e3).optional()},pt=n.object({provider:n.string().min(1).max(128),model_id:n.string().min(1).max(512),reasoning_effort:n.string().min(1).max(64).nullable()}).strict(),Qt=n.object({kind:n.enum(["role","specialist"]).optional(),description:n.string().max(8e3).optional(),instructions:n.string().max(8e3).optional(),tools:n.array(n.string().min(1).max(128)).max(256).optional(),effort:n.string().max(64).optional(),delegate:n.boolean().optional(),action_class:n.enum(["reactive","proactive"]).optional()}).strict(),qt=n.object({name:n.string().min(1).max(64).optional(),description:n.string().max(8e3).optional(),manager:R.optional(),members:n.array(n.object({role:R,count:n.number().int().min(1).max(16),kind:n.enum(["agent","team"]),tier:n.enum(["lo","med","hi"]).nullable().optional(),effort:Mi.nullable().optional()}).strict()).max(128).optional(),instructions:n.string().max(8e3).optional(),project:n.string().max(8e3).optional()}).strict(),Di=n.record(n.array(n.string().max(1024)).max(100)),en=n.enum(["minutes","hours","days"]);function Li(e){return!/^\.+$/.test(e)}const Sr=e=>Ve.safeParse(e).success,Ve=n.string().min(1).max(128).refine(e=>[...e].every(t=>t.charCodeAt(0)>=32&&t.charCodeAt(0)!==127&&t!=="/"&&t!=="\\")).refine(Li),tn=n.enum(["str","int","float","bool","list","dict"]),nn=n.string().max(16384),Ui=2e3,sn=n.string().min(1).max(Ui),an=n.string().min(1).max(64),Zi=n.string().min(1).max(64),Bi=n.string().min(1).max(64),on=n.object({is_active:n.boolean().nullish(),one_time:n.boolean().nullish(),start_time_utc:n.string().max(64).nullish(),end_time_utc:n.string().max(64).nullish()}).strict(),Gi=n.object({conversation_length:n.number().int().optional(),detail_length:n.number().int().optional(),max_learnings_history:n.number().int().optional(),hosting:n.string().max(256).optional(),model_name:n.string().max(1024).optional(),auto_save_conversation:n.boolean().optional()}).strict(),St=128,rn=2e3,cn=8e3,ln=64,dn=64,tt=e=>[...e].length,wt=e=>e>=9&&e<=13||e>=28&&e<=32||e===133||e===160||e===5760||e>=8192&&e<=8202||e===8232||e===8233||e===8239||e===8287||e===12288,zi=e=>e===9||e===10||e===11||e===12||e===13||e===133,Fi=e=>e<=31||e>=127&&e<=159,Hi=e=>new RegExp("\\p{Cf}","u").test(String.fromCodePoint(e)),Vi=e=>e>=8234&&e<=8238||e>=8294&&e<=8297,ze=(e,t)=>{for(const s of e)if(t(s.codePointAt(0)??0))return!0;return!1},Bn=e=>{const t=[...e];let s=0,i=t.length;for(;s<i&&wt(t[s].codePointAt(0)??0);)s++;for(;i>s&&wt(t[i-1].codePointAt(0)??0);)i--;return t.slice(s,i).join("")},Wi=e=>{let t="",s=!1;for(const i of e){if(wt(i.codePointAt(0)??0)){s=t.length>0;continue}s&&(t+=" ",s=!1),t+=i}return t};function Ki(e){const t=Bn(e);if(!t)return"must not be empty";if(tt(t)>St)return`must be at most ${St} characters`;if(/[/\\:]/.test(t))return'must not contain "/", "\\" or ":"';if(ze(t,Vi))return"must not contain Unicode bidirectional override characters";if(ze(t,zi))return"must not contain whitespace";if(ze(t,Fi))return"must not contain control characters";if(ze(t,Hi))return"must not contain invisible Unicode formatting characters";const s=[...t];return"-.".includes(s[0])||"-.".includes(s[s.length-1])?'must not begin or end with "-" or "."':null}function wr(e){return Wi(Bn(e).normalize("NFKC").toLowerCase())}function Yi(e){return e.trim()?tt(e)>rn?`must be at most ${rn} characters`:null:"must not be empty"}function Xi(e){return e.trim()?tt(e)>cn?`must be at most ${cn} characters`:null:"must not be empty"}function Ji(e){if(e.length>dn)return`must hold at most ${dn} items`;for(const t of e)if(!t.trim()||tt(t)>ln)return`must hold items of 1 to ${ln} characters`;return null}const Qi=e=>Ki(e)===null,qi=n.string().refine(Qi,{message:"That is not a name the hub can publish."}),ea=n.string().refine(e=>Xi(e)===null,{message:"That instruction body cannot be published."}),ta=n.string().refine(e=>Yi(e)===null,{message:"That description cannot be published."}),na=n.array(n.string()).refine(e=>Ji(e)===null,{message:"That tool list cannot be published."}),mt={requestId:x.optional(),subscribe:n.boolean().optional(),autoPush:n.boolean().optional(),confirmPublicEgress:n.boolean().optional()},un=n.object({name:qi,description:ta,instructions:ea,kind:n.enum(["role","specialist"]),when_to_use:n.string(),tools:na,effort:n.string(),delegate:n.boolean(),version:n.string(),categories:n.array(n.string()),tags:n.array(n.string())}).partial().strict(),sa=n.enum(["team","agent"]),ia=n.string().min(1).max(64),aa=n.string().min(1).max(256),Gn=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/,ht=n.string().regex(Gn,{message:"Letters, digits, dot, underscore and dash; no spaces."}),oa=["planning","active","qa","validation","done","paused","archived"],pn=n.enum(oa),Fe=n.string().regex(/^$|^\d{4}-\d{2}-\d{2}$/,"Dates are YYYY-MM-DD, or empty to clear."),mn=n.array(n.string().min(1).max(24)).max(8),F=n.string().min(1).max(64),ra=1e3,hn=240,fn=80,ca=256,la=100,da=200,ua=/^[a-z0-9][a-z0-9_-]{0,23}$/;function Ir(e){return e?Gn.test(e)?null:"Names start with a letter or digit and may use letters, digits, dot, underscore or dash.":"Give the project a name."}function xr(e){return ua.test(e)?null:"Tags are 1-24 characters of lowercase letters, digits, underscore or dash."}const He=n.enum(["agent","team"]),pa=n.discriminatedUnion("op",[n.object({op:n.literal("capabilities")}).strict(),n.object({op:n.literal("runtimes.list")}).strict(),n.object({op:n.literal("profiles.list")}).strict(),n.object({op:n.literal("profiles.get"),name:R}).strict(),n.object({op:n.literal("imports.sources")}).strict(),n.object({op:n.literal("imports.sessions"),source:Zn,includeSubagents:n.boolean().optional()}).strict(),n.object({op:n.literal("imports.preview"),...Jt}).strict(),n.object({op:n.literal("imports.start"),...Jt}).strict(),n.object({op:n.literal("imports.status"),jobId:n.string().min(1).max(128)}).strict(),n.object({op:n.literal("imports.cancel"),jobId:n.string().min(1).max(128)}).strict(),n.object({op:n.literal("profiles.update"),name:R,requestId:x,fields:Qt,expectedDefinitionRevision:Ht.optional()}).strict(),n.object({op:n.literal("profiles.install"),name:R,requestId:x}).strict(),n.object({op:n.literal("profiles.create"),name:R,requestId:x,fields:Qt.extend({description:n.string().max(8e3),instructions:n.string().min(1).max(8e3)})}).strict(),n.object({op:n.literal("hub.updates")}).strict(),n.object({op:n.literal("hub.skillPull"),requestId:x,hubId:f,hubSource:n.string().min(1).max(2048),visibility:n.enum(["public","org"]),tenantId:f.nullable(),localAlias:R,subscribe:n.boolean().optional(),autoPush:n.boolean().optional(),confirmPublicEgress:n.boolean().optional()}).strict(),n.object({op:n.literal("hub.skillPublish"),requestId:x,dryRun:n.boolean(),sourceSkill:R,localAlias:R,visibility:n.enum(["public","org"]),tenantId:f.nullable(),subscribe:n.boolean(),autoPush:n.boolean(),confirmPublicEgress:n.boolean(),previewReceipt:n.string().min(1).max(4096).optional(),confirmPublish:n.literal(!0).optional()}).strict(),n.object({op:n.literal("hub.links"),kind:n.enum(["agent","team","skill"]).optional()}).strict(),n.object({op:n.literal("hub.policy"),requestId:x,linkId:n.string().min(1).max(256),expectedPolicyRevision:n.string().min(1).max(256),subscribe:n.boolean().optional(),autoPush:n.boolean().optional(),confirmPublicEgress:n.boolean().optional()}).strict(),n.object({op:n.literal("hub.check"),requestId:x,linkId:n.string().min(1).max(256).optional(),direction:n.enum(["pull","push"]).optional(),kind:He.optional(),name:R.optional()}).strict(),n.object({op:n.literal("hub.apply"),requestId:x,previewReceipt:n.string().min(1).max(4096).optional(),confirmApply:n.literal(!0).optional(),linkId:n.string().min(1).max(256).optional(),direction:n.literal("pull").optional(),kind:He.optional(),name:R.optional(),prefer:n.enum(["local","remote"]).optional(),acknowledgeUnknownBaseline:n.boolean().optional(),dryRun:n.boolean().optional(),resolveSource:n.literal(!0).optional(),hubSource:n.string().min(1).max(2048).optional(),visibility:n.enum(["public","org"]).optional(),tenantId:n.string().min(1).max(128).nullable().optional()}).strict(),n.object({op:n.literal("hub.applyAll"),requestId:x,kind:He.optional()}).strict(),n.object({op:n.literal("hub.retry"),requestId:x,linkId:n.string().min(1).max(256).optional(),direction:n.enum(["pull","push"]).optional(),kind:He.optional(),name:R.optional()}).strict(),n.object({op:n.literal("hub.push"),requestId:x,linkId:n.string().min(1).max(256),direction:n.literal("push"),dryRun:n.boolean(),previewReceipt:n.string().min(1).max(4096).optional(),confirmPublish:n.literal(!0).optional()}).strict(),n.object({op:n.literal("teams.list")}).strict(),n.object({op:n.literal("teams.get"),name:R}).strict(),n.object({op:n.literal("teams.effective"),name:R}).strict(),n.object({op:n.literal("teams.update"),name:R,requestId:x,fields:qt,expectedDefinitionRevision:Ht.optional()}).strict(),n.object({op:n.literal("teams.create"),requestId:x,fields:qt.extend({name:n.string().min(1).max(64)})}).strict(),n.object({op:n.literal("sessions.list"),limit:n.number().int().min(1).max(500).optional(),include_archived:n.boolean().optional(),include_peers:n.boolean().optional(),scope_kind:sa.optional(),scope_name:ia.optional(),cursor:aa.optional(),with_counts:n.boolean().optional(),sort:n.literal("activity").optional()}).strict(),n.object({op:n.literal("delegated_cleanup_notice.ack")}).strict(),n.object({op:n.literal("sessions.search"),q:n.string().min(1).max(Oi),limit:n.number().int().min(1).max(500).optional(),include_archived:n.boolean().optional()}).strict(),n.object({op:n.literal("sessions.archive"),sessionId:b,archived:n.boolean()}).strict(),n.object({op:n.literal("sessions.delete"),sessionId:b,confirmed:n.literal(!0)}).strict(),n.object({op:n.literal("sessions.create"),requestId:x,cwd:n.string().min(1).max(4096).optional(),target:Ge.optional(),purpose:n.literal("agents-config").optional(),model:pt.optional(),draftId:b.optional(),peer:se.optional()}).strict(),n.object({op:n.literal("sessions.preview"),requestId:x,cwd:n.string().min(1).max(4096),target:Ge.optional(),model:pt.optional()}).strict(),n.object({op:n.literal("sessions.draft"),requestId:x,cwd:n.string().min(1).max(4096),target:Ge.optional(),model:pt.optional()}).strict(),n.object({op:n.literal("sessions.get"),sessionId:b,journalOrder:n.boolean().optional(),orderIds:n.array(n.string().min(1).max(128)).max(512).optional(),peerJournalSource:n.boolean().optional()}).strict(),n.object({op:n.literal("sessions.files"),sessionId:b,scope:n.enum(["family","self"]).optional(),kind:n.string().max(256).optional(),q:n.string().max(256).optional(),sort:n.enum(["recent","name","kind","modified","created","size"]).optional(),order:n.enum(["asc","desc"]).optional(),limit:n.number().int().min(1).max(200).optional(),cursor:n.string().max(8192).optional()}).strict(),n.object({op:n.literal("sessions.files.materialise"),sessionId:b,fileId:n.string().regex(/^[a-f0-9]{16}$/)}).strict(),n.object({op:n.literal("sessions.history"),sessionId:b,beforeId:f.optional(),limit:n.number().int().min(1).max(500).optional(),openFrame:n.boolean().optional(),journalOrder:n.boolean().optional(),orderIds:n.array(n.string().min(1).max(128)).max(512).optional(),peerJournalSource:n.boolean().optional(),sourceRead:n.enum(["metadata","payload"]).optional(),expectedJournalGeneration:n.string().min(1).max(128).optional()}).strict(),n.object({op:n.literal("sessions.checkpoints"),sessionId:b}).strict(),n.object({op:n.literal("sessions.checkpoints.warm"),sessionId:b,ids:n.array(f).max(Xt).optional(),limit:n.number().int().min(1).max(Xt).optional()}).strict(),n.object({op:n.literal("sessions.find"),sessionId:b,q:n.string().min(1).max(Ci),limit:n.number().int().min(1).max(Ai).optional()}).strict(),n.object({op:n.literal("subagents.transcript"),sessionId:b,childId:b,beforeId:f.optional(),limit:n.number().int().min(1).max(500).optional()}).strict(),n.object({op:n.literal("sessions.message"),sessionId:b,requestId:x,text:n.string().max(Kt),images:n.array(Wt).max(Yt).optional(),mode:n.enum(["prompt","steer"]).optional(),inputMode:n.enum(["typed","dictated","mixed"]).optional(),inputPath:n.string().max(1024).optional()}).strict(),n.object({op:n.literal("sessions.command"),sessionId:b,requestId:x,command:n.string().regex(/^\/?[A-Za-z]+$/).max(64),args:n.string().max(Kt).optional(),images:n.array(Wt).max(Yt).optional()}).strict(),n.object({op:n.literal("sessions.move"),sessionId:b,requestId:x,cwd:n.string().min(1).max(4096)}).strict(),n.object({op:n.literal("sessions.answer"),sessionId:b,epoch:f.optional(),requestId:f.optional(),value:n.string().max(32768).optional(),approved:n.boolean().optional(),questionIndex:n.number().int().min(0).optional(),askId:f.optional(),answers:n.record(n.string(),n.array(n.string().max(32768))).optional(),decline:n.boolean().optional(),revise:n.boolean().optional()}).strict(),n.object({op:n.literal("sessions.seen"),sessionId:b,completionToken:n.string().uuid()}).strict(),n.object({op:n.literal("attention.seen"),items:n.array(n.object({sessionId:b,completionToken:n.string().uuid()}).strict()).min(1).max(500)}).strict(),n.object({op:n.literal("sessions.notified"),sessionId:b,completionToken:n.string().uuid()}).strict(),n.object({op:n.literal("tags.list")}).strict(),n.object({op:n.literal("tags.replace"),tags:n.array(n.object({id:n.string().optional(),name:n.string()}).strict())}).strict(),n.object({op:n.literal("sessions.tags"),sessionId:b,tags:n.array(n.string()),primary:n.string().nullable()}).strict(),n.object({op:n.literal("sessions.pin"),sessionId:b,pinned:n.boolean()}).strict(),n.object({op:n.literal("sessions.watch"),sessionId:b,subscriptionId:n.string().regex(Ft),visible:n.boolean(),canNotify:n.boolean()}).strict(),n.object({op:n.literal("sessions.warm"),sessionId:b}).strict(),n.object({op:n.literal("sessions.interrupt"),sessionId:b,requestId:x}).strict(),n.object({op:n.literal("supplements.cancel"),sessionId:b,job:ct,anchor:lt}).strict(),n.object({op:n.literal("supplements.restart"),sessionId:b,job:ct,anchor:lt}).strict(),n.object({op:n.literal("supplements.steer"),sessionId:b,job:ct,anchor:lt,text:n.string().min(1).max(500)}).strict(),n.object({op:n.literal("sessions.variables.list"),sessionId:b}).strict(),n.object({op:n.literal("sessions.variables.create"),sessionId:b,key:Ve,value:nn,type:tn}).strict(),n.object({op:n.literal("sessions.variables.update"),sessionId:b,key:Ve,value:nn,type:tn}).strict(),n.object({op:n.literal("sessions.variables.delete"),sessionId:b,key:Ve}).strict(),n.object({op:n.literal("sessions.presence"),subscriptionId:n.string().regex(/^[a-f0-9]{1,64}$/),canNotify:n.boolean(),canNotifyKinds:n.array(n.enum(["complete","error"])).max(4),sessionId:n.string().regex(/^([a-f0-9]{12})?$/),window:n.object({exists:n.boolean(),focused:n.boolean(),visible:n.boolean(),minimized:n.boolean()}).strict()}).strict(),n.object({op:n.literal("legacy.models"),provider:n.string().max(128).optional(),sort:n.enum(["id","name","provider","recommended"]).optional(),direction:n.enum(["ascending","descending"]).optional()}).strict(),n.object({op:n.literal("legacy.models.providers")}).strict(),n.object({op:n.literal("auth.probe"),provider:f}).strict(),n.object({op:n.literal("legacy.agent.upload"),agentId:f}).strict(),n.object({op:n.literal("agent.publish"),agentId:f,document:un.optional(),...mt,visibility:n.literal("org").optional(),tenantId:f.optional()}).strict(),n.object({op:n.literal("agent.republish"),agentId:f,hubAgentId:f,expectedRemoteRevision:n.string().min(1).max(512).optional(),document:un.optional(),...mt,visibility:n.literal("org").optional(),tenantId:f.optional()}).strict(),n.object({op:n.literal("team.publish"),teamId:f,...mt,visibility:n.literal("org").optional(),tenantId:f.optional()}).strict(),n.object({op:n.literal("team.pull"),teamId:f,tenantId:f.optional()}).strict(),n.object({op:n.literal("agent.nameAvailability"),name:n.string().min(1).max(St)}).strict(),n.object({op:n.literal("legacy.agents.list"),page:n.number().int().min(1).optional(),perPage:n.number().int().min(1).max(500).optional(),name:n.string().max(256).optional(),sort:n.string().max(64).optional(),direction:n.enum(["asc","desc"]).optional()}).strict(),n.object({op:n.literal("legacy.agent.get"),agentId:f}).strict(),n.object({op:n.literal("legacy.agent.history"),agentId:f,page:n.number().int().min(1).optional(),perPage:n.number().int().min(1).max(500).optional()}).strict(),n.object({op:n.literal("legacy.jobs.list"),agentId:f.optional(),status:n.string().max(64).optional()}).strict(),n.object({op:n.literal("legacy.job.get"),jobId:f}).strict(),n.object({op:n.literal("legacy.schedules.list"),page:n.number().int().min(1).optional(),perPage:n.number().int().min(1).max(100).optional()}).strict(),n.object({op:n.literal("legacy.agent.schedules.list"),agentId:f,page:n.number().int().min(1).optional(),perPage:n.number().int().min(1).max(100).optional()}).strict(),n.object({op:n.literal("legacy.agent.schedule.create"),agentId:f,schedule:on.extend({prompt:n.string().max(64e3),interval:n.number().int().min(1),unit:en})}).strict(),n.object({op:n.literal("legacy.schedule.get"),scheduleId:f}).strict(),n.object({op:n.literal("legacy.schedule.edit"),scheduleId:f,schedule:on.extend({prompt:n.string().max(64e3).nullish(),interval:n.number().int().min(1).nullish(),unit:en.nullish()})}).strict(),n.object({op:n.literal("legacy.schedule.remove"),scheduleId:f}).strict(),n.object({op:n.literal("legacy.agent.create"),agent:n.record(n.unknown())}).strict(),n.object({op:n.literal("legacy.agent.update"),agentId:f,update:n.record(n.unknown())}).strict(),n.object({op:n.literal("legacy.agent.delete"),agentId:f}).strict(),n.object({op:n.literal("legacy.agent.conversation.clear"),agentId:f}).strict(),n.object({op:n.literal("legacy.agent.systemPrompt.get"),agentId:f}).strict(),n.object({op:n.literal("legacy.agent.systemPrompt.update"),agentId:f,systemPrompt:n.string().max($i)}).strict(),n.object({op:n.literal("legacy.agent.download"),agentId:f}).strict(),n.object({op:n.literal("legacy.job.cancel"),jobId:f}).strict(),n.object({op:n.literal("commands.list")}).strict(),n.object({op:n.literal("commands.entities"),sessionId:b,command:f,name:n.string().max(128).optional()}).strict(),n.object({op:n.literal("models.catalogue"),live:n.boolean().optional(),scope:n.enum(["usable","all"]).optional()}).strict(),n.object({op:n.literal("usage.get"),provider:f.optional(),live:n.boolean().optional(),refresh:n.boolean().optional()}).strict(),n.object({op:n.literal("quota.notice"),provider:f.optional(),model:n.string().min(1).max(200).optional(),refresh:n.boolean().optional()}).strict(),n.object({op:n.literal("analytics.get"),sessionId:b.optional(),sinceMs:n.number().int().nonnegative().optional(),untilMs:n.number().int().nonnegative().optional(),days:n.number().int().min(1).max(366).optional()}).strict(),n.object({op:n.literal("analytics.models"),sessionId:b.optional(),sinceMs:n.number().int().nonnegative().optional(),untilMs:n.number().int().nonnegative().optional(),days:n.number().int().min(1).max(366).optional()}).strict(),n.object({op:n.literal("info.get")}).strict(),n.object({op:n.literal("sessions.report"),sessionId:b,recentLimit:n.number().int().min(0).max(50).optional()}).strict(),n.object({op:n.literal("skills.list"),sessionId:b.optional(),cwd:Ei.optional(),name:f.optional()}).strict(),n.object({op:n.literal("sessions.failovers"),sessionId:b}).strict(),n.object({op:n.literal("sessions.credential"),sessionId:b,action:n.enum(["list","store","forget"]),key:Ue.optional(),value:Ze.optional(),confirmed:n.boolean().optional()}).strict(),n.object({op:n.literal("sessions.fork"),sessionId:b,requestId:x,message:n.string().max(2e5).optional(),boundary:n.enum(["next_safe","at_entry"]).optional(),entryId:n.string().max(128).optional()}).strict(),n.object({op:n.literal("sessions.stop"),requestId:x,targets:n.array(b).min(1).max(100),confirmed:n.literal(!0)}).strict(),n.object({op:n.literal("sessions.aside"),sessionId:b,requestId:x,text:n.string().min(1).max(32768),asideId:x.optional(),subscriptionId:n.string().regex(Ft).optional()}).strict(),n.object({op:n.literal("sessions.adopt"),sessionId:b,requestId:x,asideId:x,confirmed:n.literal(!0)}).strict(),n.object({op:n.literal("sessions.aside.get"),sessionId:b,asideId:x}).strict(),n.object({op:n.literal("sessions.aside.close"),sessionId:b,asideId:x}).strict(),n.object({op:n.literal("wakes.list"),limit:n.number().int().min(1).max(500).optional(),includeDormant:n.boolean().optional()}).strict(),n.object({op:n.literal("wakes.create"),requestId:x,sessionId:b.optional(),cwd:n.string().min(1).max(4096).optional(),target:Ge.optional(),message:sn,in:n.string().min(1).max(64).optional(),at:n.string().min(1).max(64).optional(),every:n.string().min(1).max(64).optional(),until:n.string().min(1).max(64).optional(),limit:n.number().int().min(1).optional(),title:n.string().min(1).max(200).optional()}).strict(),n.object({op:n.literal("wakes.edit"),sessionId:b,wakeId:an,message:sn.optional(),in:n.string().min(1).max(64).optional(),at:n.string().min(1).max(64).optional(),every:n.string().min(1).max(64).optional(),until:n.string().min(1).max(64).optional(),limit:n.number().int().min(1).optional()}).strict(),n.object({op:n.literal("wakes.remove"),sessionId:b,wakeId:an}).strict(),n.object({op:n.literal("monitors.cancel"),sessionId:b,monitorId:Zi}).strict(),n.object({op:n.literal("jobs.cancel"),sessionId:b,jobId:Bi}).strict(),n.object({op:n.literal("mcp.list"),sessionId:b}).strict(),n.object({op:n.literal("mcp.credentials.store"),sessionId:b,name:n.string().min(1).max(256),values:n.record(n.string().min(1).max(128),n.string().min(1).max(32768)).refine(e=>Object.keys(e).length<=32&&Object.values(e).reduce((t,s)=>t+s.length,0)<=65536,{message:"Too many secret values, or too much secret text, for one MCP credential write."}),confirmedReplace:n.array(n.string().min(1).max(128)).max(32)}).strict(),n.object({op:n.literal("mcp.control"),sessionId:b,control:n.object({action:n.enum(["list","add","remove","reload","connect","probe","disconnect","login","logout","reauth","status","cancel"]),name:dt.optional(),scope:n.enum(["global","project"]).optional(),command:n.string().min(1).max(4096).optional(),args:n.array(n.string().max(8192)).max(128).optional(),env:n.record(Be).optional(),url:n.string().max(4096).optional(),headers:n.record(Be).optional(),oauth:n.boolean().optional(),confirmed:n.boolean().optional(),operation_id:zt.optional()}).strict()}).strict(),n.object({op:n.literal("mcp.catalog"),cwd:ut.optional(),sessionId:b.optional()}).strict(),n.object({op:n.literal("mcp.catalog.control"),cwd:ut.optional(),control:n.object({action:n.enum(["add","remove","test","login","reauth","logout","status","cancel"]),name:dt.optional(),scope:n.enum(["global","project"]).optional(),command:n.string().min(1).max(4096).optional(),args:n.array(n.string().max(8192)).max(128).optional(),env:n.record(Be).optional(),url:n.string().max(4096).optional(),headers:n.record(Be).optional(),confirmed:n.boolean().optional(),operation_id:zt.optional()}).strict()}).strict(),n.object({op:n.literal("mcp.catalog.credentials"),header:n.string().min(1).max(128).optional(),cwd:ut.optional(),name:dt,values:n.record(n.string().min(1).max(128),n.string().min(1).max(32768)).refine(e=>Object.keys(e).length<=32&&Object.values(e).reduce((t,s)=>t+s.length,0)<=65536,{message:"Too many secret values, or too much secret text, for one MCP credential write."}),confirmedReplace:n.array(n.string().min(1).max(128)).max(32)}).strict(),n.object({op:n.literal("radient.request"),control:n.object({operation:n.enum(["account","prices","credits","usage","provision","application.create","agents.list","agents.get","agents.create","agents.update","agents.delete","agents.like","agents.unlike","agents.liked","agents.like_count","agents.favourite","agents.unfavourite","agents.favourited","agents.favourite_count","agents.download_count","agents.statuses","comments.list","comments.create","comments.update","comments.delete","account.agents","memberships.list","org_agents.list","org_team.get","org_teams.list","org_skills.list","org_skill.get","signup.resend"]),request_id:x.optional(),tenant_id:f.optional(),account_id:f.optional(),agent_id:f.optional(),comment_id:f.optional(),team_id:f.optional(),skill_id:f.optional(),query:n.record(n.union([n.string().max(1024),n.number().int()])).optional(),payload:n.record(n.unknown()).optional(),confirmed:n.boolean().optional()}).strict()}).strict(),n.object({op:n.literal("providers.list")}).strict(),n.object({op:n.literal("accounts.list")}).strict(),n.object({op:n.literal("accounts.remove"),accountId:n.number().int().positive(),confirmed:n.literal(!0)}).strict(),n.object({op:n.literal("tunnel.setup.read"),credentialId:n.number().int().positive().optional()}).strict(),n.object({op:n.literal("tunnel.setup.plan"),credentialId:n.number().int().positive().optional()}).strict(),n.object({op:n.literal("tunnel.setup.run"),credentialId:n.number().int().positive(),acceptMonthlyPrice:n.string().min(1).max(64).optional()}).strict(),n.object({op:n.literal("auth.start"),provider:f}).strict(),n.object({op:n.literal("auth.status"),id:f}).strict(),n.object({op:n.literal("auth.input"),id:f,promptId:f,value:Ze}).strict(),n.object({op:n.literal("auth.cancel"),id:f}).strict(),n.object({op:n.literal("auth.key"),provider:f,value:Ze}).strict(),n.object({op:n.literal("auth.logout"),provider:f}).strict(),n.object({op:n.literal("agent_messages.status"),boundary:_i}).strict(),n.object({op:n.literal("agent_messages.enable"),expected_account_id:f,tenant_id:f,state:n.literal("active"),consent_version:n.string().min(1).max(128),consented_via:n.literal("dialog")}).strict(),n.object({op:n.literal("agent_messages.settings"),tenant_id:f.optional()}).strict(),n.object({op:n.literal("agent_messages.settings.put"),expected_account_id:f,tenant_id:f.optional(),consent_version:n.string().min(1).max(128).optional(),consented_via:n.enum(["dialog","settings"]).optional(),label:n.string().min(1).max(128).optional(),state:n.enum(["active","paused","disabled"])}).strict(),n.object({op:n.literal("agent_messages.allowlist.get"),tenant_id:f.optional()}).strict(),n.object({op:n.literal("agent_messages.allowlist.put"),expected_account_id:f,tenant_id:f.optional(),entries:n.array(n.object({direction:n.enum(["send","receive"]),effect:n.enum(["allow","deny"]),target:n.object({endpoint_id:f.optional(),account_id:f.optional()}).strict().refine(e=>!!e.endpoint_id!=!!e.account_id,"An allowlist target names exactly one of endpoint_id or account_id")}).strict()).max(200)}).strict(),n.object({op:n.literal("settings.list")}).strict(),n.object({op:n.literal("settings.edit"),key:Ue,value:n.unknown().refine(e=>e!==void 0,"A setting value is required."),base:Di.optional()}).strict(),n.object({op:n.literal("settings.reset"),key:Ue}).strict(),n.object({op:n.literal("tts.paths")}).strict(),n.object({op:n.literal("config.get")}).strict(),n.object({op:n.literal("config.update"),value:Gi}).strict(),n.object({op:n.literal("instructions.get")}).strict(),n.object({op:n.literal("instructions.update"),content:n.string().max(64e3)}).strict(),n.object({op:n.literal("credentials.list")}).strict(),n.object({op:n.literal("credentials.update"),key:Ue,value:Ze}).strict(),n.object({op:n.literal("peers.list")}).strict(),n.object({op:n.literal("networks.list")}).strict(),n.object({op:n.literal("networks.invite"),networkId:se,role:n.enum(["read","drive","admin"]),deviceId:se.optional()}).strict(),n.object({op:n.literal("networks.member.remove"),networkId:se,deviceId:se,confirm:n.string().min(1).max(256)}).strict(),n.object({op:n.literal("sessions.transfer"),sessionId:b,to:n.union([n.literal("local"),se]),keep:n.boolean().optional(),waitS:n.number().min(0).max(300).optional(),requestId:x.optional()}).strict(),n.object({op:n.literal("approvals.list")}).strict(),n.object({op:n.literal("approvals.approve"),approvalId:Vt}).strict(),n.object({op:n.literal("approvals.deny"),approvalId:Vt}).strict(),n.object({op:n.literal("asks.list")}).strict(),n.object({op:n.literal("projects.list")}).strict(),n.object({op:n.literal("projects.get"),key:F}).strict(),n.object({op:n.literal("projects.create"),name:ht,description:n.string().max(hn).optional(),status:pn.optional(),tags:mn.optional()}).strict(),n.object({op:n.literal("projects.update"),key:F,fields:n.object({name:ht.optional(),title:n.string().max(80).optional(),owner:n.string().max(80).optional(),team:n.string().max(80).optional(),description:n.string().max(hn).optional(),status:pn.optional(),progress:n.string().max(ra).optional(),tags:mn.optional(),start_date:Fe.optional(),target_date:Fe.optional(),completed_at:Fe.optional(),estimate:n.number().positive().max(1e3).optional(),estimate_unit:n.enum(["points","days"]).optional()}).strict(),force_done:n.boolean().optional()}).strict(),n.object({op:n.literal("projects.delete"),key:F,confirmed_name:ht}).strict(),n.object({op:n.literal("projects.link"),key:F,sessionId:b}).strict(),n.object({op:n.literal("projects.unlink"),key:F,sessionId:b}).strict(),n.object({op:n.literal("projects.milestone"),key:F,name:n.string().min(1).max(fn),targetDate:Fe.optional(),completed:n.boolean().optional()}).strict(),n.object({op:n.literal("projects.milestone.remove"),key:F,name:n.string().min(1).max(fn)}).strict(),n.object({op:n.literal("projects.request_update"),key:F}).strict(),n.object({op:n.literal("projects.search"),q:n.string().min(1).max(ca),limit:n.number().int().min(1).max(da).optional()}).strict(),n.object({op:n.literal("aida.status")}).strict(),n.object({op:n.literal("aida.control"),action:n.enum(["open","pause","resume","greet","status"])}).strict(),n.object({op:n.literal("code_requests.list"),sessionId:b}).strict(),n.object({op:n.literal("code_requests.refresh"),sessionId:b,keys:n.array(n.string().min(1).max(512)).max(256).optional(),force:n.boolean().optional()}).strict(),n.object({op:n.literal("static.sign"),route:n.enum(["images","videos","audio","html"]),path:n.string().min(1),ttlS:n.number().int().min(1).max(3600).optional()}).strict(),n.object({op:n.literal("library.list"),q:n.string().max(512).optional(),category:n.string().min(1).max(64).optional(),kind:n.string().min(1).max(64).optional(),origin_group:n.enum(["generated","created","mentioned"]).optional(),origin:n.string().min(1).max(64).optional(),tag:n.string().min(1).max(128).optional(),tag_mode:n.enum(["all","any"]).optional(),highlighted:n.boolean().optional(),organized:n.boolean().optional(),favorite:n.boolean().optional(),session:n.string().min(1).max(12).optional(),session_id:n.string().min(1).max(512).optional(),sort:n.enum(["recent","name","kind","size","created","modified","organized"]).optional(),order:n.enum(["asc","desc"]).optional(),limit:n.number().int().min(1).max(200).optional(),cursor:n.string().max(512).optional()}).strict(),n.object({op:n.literal("library.get"),id:pe}).strict(),n.object({op:n.literal("library.update"),id:pe,fields:n.object({name:n.string().max(200).optional(),description:n.string().max(2e3).optional(),favorite:n.boolean().optional(),locked:n.boolean().optional(),archived:n.boolean().optional()}).strict()}).strict(),n.object({op:n.literal("library.tags")}).strict(),n.object({op:n.literal("library.tags.create"),name:n.string().trim().min(1).max(24),category:n.string().min(1).max(64).optional()}).strict(),n.object({op:n.literal("library.tags.update"),id:me,name:n.string().trim().min(1).max(24).optional(),category:n.string().min(1).max(64).optional()}).strict(),n.object({op:n.literal("library.tags.delete"),id:me}).strict(),n.object({op:n.literal("library.tags.merge"),id:me,into:me}).strict(),n.object({op:n.literal("library.tags.assign"),id:pe,tags:n.array(me).max(64),primary:n.string().max(128).optional()}).strict(),n.object({op:n.literal("library.chat.link"),id:pe,sessionId:b}).strict(),n.object({op:n.literal("library.chat.clear"),id:pe}).strict(),n.object({op:n.literal("library.librarian"),action:n.enum(["status","open","pause","resume","run"]).optional()}).strict()]);pa.superRefine((e,t)=>{if(e.op==="hub.skillPull"||e.op==="hub.skillPublish"){if(e.visibility==="public"&&e.tenantId!==null||e.visibility==="org"&&!e.tenantId){t.addIssue({code:n.ZodIssueCode.custom,message:"A skill destination requires explicit paired scope",path:["tenantId"]});return}if(e.op==="hub.skillPublish"&&(e.dryRun?e.previewReceipt!==void 0||e.confirmPublish!==void 0:!e.previewReceipt||e.confirmPublish!==!0)){t.addIssue({code:n.ZodIssueCode.custom,message:"An initial skill publication requires its reviewed draft receipt",path:["previewReceipt"]});return}}if(e.op==="hub.check"||e.op==="hub.apply"||e.op==="hub.retry"){const s=e.linkId!==void 0,i=e.kind!==void 0||e.name!==void 0;if(s&&i||e.op!=="hub.check"&&!s&&(!e.kind||!e.name)||e.op==="hub.retry"&&s&&!e.direction||e.direction==="push"&&!s){t.addIssue({code:n.ZodIssueCode.custom,message:"A hub action requires one unambiguous selector and an explicit retry direction",path:["linkId"]});return}}if(e.op==="hub.apply"&&(e.previewReceipt!==void 0||e.confirmApply!==void 0)&&(!e.linkId||e.dryRun||!e.previewReceipt||e.confirmApply!==!0)){t.addIssue({code:n.ZodIssueCode.custom,message:"A viewed incoming application requires its scoped preview receipt and confirmation",path:["previewReceipt"]});return}if(e.op==="hub.apply"&&e.resolveSource===!0){const s=e.visibility==="public"&&e.tenantId===null||e.visibility==="org"&&typeof e.tenantId=="string"&&e.tenantId.length>0;if(!e.hubSource||!s||e.acknowledgeUnknownBaseline!==!0||e.linkId!==void 0||e.previewReceipt!==void 0||e.confirmApply!==void 0||e.prefer!==void 0){t.addIssue({code:n.ZodIssueCode.custom,message:"Confirming a source requires its exact stated destination and the unknown-baseline acknowledgement, with no link, preview or preference",path:["hubSource"]});return}}if(e.op==="hub.push"&&(e.dryRun?e.previewReceipt!==void 0||e.confirmPublish!==void 0:!e.previewReceipt||e.confirmPublish!==!0)){t.addIssue({code:n.ZodIssueCode.custom,message:"A confirmed publication requires its reviewed preview receipt",path:["previewReceipt"]});return}if(e.op==="hub.policy"&&e.subscribe===void 0&&e.autoPush===void 0){t.addIssue({code:n.ZodIssueCode.custom,message:"A hub policy change must name subscribe or autoPush",path:["subscribe"]});return}if(e.op==="sessions.answer"){if(e.askId!==void 0){e.askId||t.addIssue({code:n.ZodIssueCode.custom,message:"ask_id must be a non-empty string",path:["askId"]}),e.decline!==!0&&!e.answers?t.addIssue({code:n.ZodIssueCode.custom,message:"A queued-ask answer needs answers or decline",path:["answers"]}):e.decline===!0&&e.answers!==void 0?t.addIssue({code:n.ZodIssueCode.custom,message:"Supply either answers or decline",path:["decline"]}):e.revise===!0&&e.decline===!0?t.addIssue({code:n.ZodIssueCode.custom,message:"Supply either decline or revise",path:["revise"]}):e.answers!==void 0&&Object.keys(e.answers).length===0&&t.addIssue({code:n.ZodIssueCode.custom,message:"answers must name at least one question",path:["answers"]});return}e.epoch||t.addIssue({code:n.ZodIssueCode.custom,message:"An epoch is required to answer a gate",path:["epoch"]}),e.requestId||t.addIssue({code:n.ZodIssueCode.custom,message:"A request id is required to answer a gate",path:["requestId"]}),e.revise===!0&&t.addIssue({code:n.ZodIssueCode.custom,message:"revise applies to a queued ask",path:["revise"]});return}if(e.op==="sessions.create"&&e.purpose===void 0){e.cwd===void 0&&t.addIssue({code:n.ZodIssueCode.custom,message:"A conversation needs a working directory: only a configuration run (`purpose`) may omit `cwd`.",path:["cwd"]});return}if(e.op==="sessions.create"&&e.purpose!==void 0){for(const s of["cwd","target","model","draftId"])e[s]!==void 0&&t.addIssue({code:n.ZodIssueCode.custom,message:`A configuration run resolves its own \`${s}\`: send \`purpose\` alone.`,path:[s]});return}if(!(e.op!=="agent.publish"&&e.op!=="agent.republish"&&e.op!=="team.publish")){if((e.subscribe!==void 0||e.autoPush!==void 0||e.confirmPublicEgress!==void 0)&&!e.requestId){t.addIssue({code:n.ZodIssueCode.custom,message:"Initial link policy needs a durable publication request ID",path:["requestId"]});return}e.visibility==="org"!=!!e.tenantId&&t.addIssue({code:n.ZodIssueCode.custom,message:'A publication target needs both `visibility: "org"` and `tenantId`, or neither: one half would publish to the public hub.'})}});const J={noCredential:"pairing.no-credential",refused:"pairing.refused",planeClosed:"pairing.plane-closed",transportFailed:"transport.failed"},Tr={runtimeUnreachable:"runtime_unreachable"},Er="runtime_busy",Rr="runtime_retiring";n.object({data:n.object({aside_id:n.string().optional(),status:n.union([n.enum(["adopted","queued"]),n.string()]).optional()}).passthrough()}).passthrough();const Or="aside_adopt_refused",ma=["session_closed","open_tool_batch","turn_running"];function Pr(e){if(typeof e!="object"||e===null)return;const t=e.reason;return ma.find(s=>s===t)}const Cr={[J.noCredential]:"This app is not paired with the running Local Operator server, so this control is unavailable.",[J.refused]:"This app's credential for the running Local Operator server was refused, so this control is unavailable.",[J.planeClosed]:"The running Local Operator server does not accept this app's desktop controls.",[J.transportFailed]:"The Local Operator server did not answer this request."},jr={noCredential:"Restart with a desktop-managed backend to use these controls.",transportFailed:"The backend could not complete this request. Check its connection and try again."};function Ar(e){return e!==void 0&&Object.values(J).includes(e)}function $r(e,t){if(e.startsWith("/v1/desktop/")){if(t===401||t===403)return J.refused;if(t===503)return J.planeClosed}}const Mr=n.object({step:n.string(),blocked_on:n.string(),configured:n.boolean(),ready:n.boolean(),verified:n.boolean(),url:n.string().nullable(),credential_id:n.number().int().positive().nullable(),identity_label:n.string().nullable(),credential_choices:n.array(n.object({id:n.number().int().positive(),identity_label:n.string().nullable().optional()}).passthrough()).default([]),quote:n.object({monthly_price_usd:n.string().nullable(),positive_balance:n.boolean(),eligible:n.boolean(),account_valid:n.boolean()}).passthrough().nullable(),receipts:n.array(n.object({step:n.string(),ok:n.boolean(),text:n.string()})).default([]),remedy:n.object({kind:n.string(),text:n.string(),command:n.string().nullable().optional(),url:n.string().nullable().optional()}).nullable(),source:n.string(),in_progress:n.boolean().default(!1),progress:n.array(n.string()).default([]),active_credential_id:n.number().int().positive().nullable().default(null),billing_outcome:n.string().optional(),reservation_outcome:n.string().optional(),failure_stage:n.string().optional()}).passthrough(),Nr=new Set(["setup_in_progress","setup_deadline","setup_unavailable","setup_intent_corrupt"]),ha=88e4,fa=11e5,ga=2e4,ba=9e4,va=new Set(["analytics.get","analytics.models","sessions.report"]),_a=new Set(["usage.get"]),ya=new Set(["networks.list","peers.list"]),ka=new Set([...va,..._a,...ya]),Sa=90,wa=30,Ia=300,xa=10,zn=15,Ta=1e4;function Ea(e){const s=e.to==="local"||e.keep?Ia:wa,i=Math.max(0,e.waitS??0);return(Sa+s+xa+zn)*1e3+i*1e3}const Ra=18e4,Oa=Ra+15e3,Pa=120,Ca=135e3,ja=93e4,Fn=(Pa+30+zn)*1e3,Aa=6e4,$a=5*Fn,Ma=new Set(["hub.apply","hub.retry","hub.push","hub.skillPublish","hub.skillPull","hub.check","hub.applyAll"]);function Na(e){switch(e){case"hub.apply":case"hub.retry":case"hub.push":case"hub.skillPublish":case"hub.skillPull":return Fn;case"hub.check":return Aa;case"hub.applyAll":return $a;default:return null}}function Da(e){if(typeof e!="string"&&e.op==="sessions.transfer")return Ea(e)+Ta;const t=typeof e=="string"?e:e.op;if(t==="approvals.approve")return Oa;if(t==="tunnel.setup.run")return ja;if(t==="tunnel.setup.plan")return Ca;const s=Na(t);return s!==null?s:ka.has(t)?ba:ga}const La=5e3;function Dr(e){return Da(e)+La}const Ua="deadline_exceeded",Lr="foreground_required",Ur="View these completions in the foreground before marking them read.",Za=new Set(["capabilities","agent_messages.status","agent_messages.settings","agent_messages.allowlist.get","accounts.list","analytics.get","analytics.models","approvals.list","commands.entities","commands.list","config.get","credentials.list","hub.updates","hub.links","info.get","instructions.get","legacy.agent.get","legacy.agent.history","legacy.agent.schedules.list","legacy.agents.list","legacy.job.get","legacy.jobs.list","legacy.models","legacy.models.providers","legacy.schedule.get","legacy.schedules.list","mcp.catalog","mcp.list","models.catalogue","networks.list","peers.list","profiles.get","profiles.list","projects.search","providers.list","quota.notice","runtimes.list","sessions.aside.get","sessions.checkpoints","sessions.failovers","sessions.find","sessions.get","sessions.history","sessions.files","sessions.list","sessions.preview","sessions.report","sessions.search","sessions.variables.list","skills.list","subagents.transcript","teams.effective","teams.get","teams.list","tunnel.setup.plan","tunnel.setup.read","usage.get"]),Ba=new Set(["analytics.get","analytics.models","networks.list","peers.list","usage.get","sessions.report","info.get","sessions.failovers"]);function Zr(e,t){const s=Math.round(t/1e3),i=Ua;return e==="sessions.transfer"?{code:i,message:`The app waits up to ${s} seconds for a move, and it was still running when the app stopped waiting. The move was asked for, so its outcome is unknown from here: read the session again before moving it anywhere else.`}:e==="approvals.approve"?{code:i,message:`The app waits up to ${s} seconds for an approval, and the signing prompt was still open when it stopped waiting. The request was sent, so the decision may or may not have landed: read the approvals again — if the record still waits, answering it again is safe, because the store keeps the first decision and refuses a second.`}:Ma.has(e)?{code:i,message:"This is taking longer than expected. It may still finish; the mark will update."}:Za.has(e)?{code:i,message:Ba.has(e)?`The app waits up to ${s} seconds for this panel's data, and the read was still running when the app stopped waiting. Nothing was read; reopen the panel to ask again.`:`The app waits up to ${s} seconds for this read, and it was still running when the app stopped waiting. Nothing was read; ask again.`}:{code:i,message:`The app waits up to ${s} seconds for this request, and it was still running when the app stopped waiting. It may or may not have reached the server; check the result before repeating it.`}}const Br=ha,Gr=fa;n.object({state:n.enum(["ok","depleted","limit_reached","unverified","unknown","not_applicable"]),provider:n.string(),kind:n.enum(["balance","subscription","radient","none"]),model_free:n.boolean(),title:n.string(),body:n.string(),actions:n.array(n.object({id:n.enum(["open_url","resend_verification","refresh"]),label:n.string(),url:n.string().nullable().optional()})),resets_at_ms:n.number().int().nullable().optional(),checked_at_ms:n.number().int(),age_ms:n.number().int().nullable().optional(),source:n.enum(["cached","live"])});function Ga(e){return e.sessionId?{session_id:e.sessionId}:{...e.cwd?{cwd:e.cwd}:{},...e.target?{target:e.target}:{}}}function gn(e){return{...e.in!==void 0?{in:e.in}:{},...e.at!==void 0?{at:e.at}:{},...e.every!==void 0?{every:e.every}:{},...e.until!==void 0?{until:e.until}:{},...e.limit!==void 0?{limit:e.limit}:{}}}function ft(e){return{...e.requestId?{request_id:e.requestId}:{},...e.subscribe!==void 0?{subscribe:e.subscribe}:{},...e.autoPush!==void 0?{auto_push:e.autoPush}:{},...e.confirmPublicEgress!==void 0?{confirm_public_egress:e.confirmPublicEgress}:{}}}function gt(e){if(e.visibility==="org"!=!!e.tenantId)throw new Error('A publication target needs both `visibility: "org"` and `tenantId`, or neither: one half would publish to the public hub.')}function bn(e){return{sources:e.sources??null,session_ids:e.sessionIds??{},all:e.all??!1,include_subagents:e.includeSubagents??!1,include_cleared_segments:e.includeClearedSegments??!1,include_memory:e.includeMemory??!0,include_instructions:e.includeInstructions??!0,...e.maxSessions===void 0?{}:{max_sessions:e.maxSessions}}}function vn(e){return e===void 0?"":`?tenant_id=${encodeURIComponent(e)}`}function zr(e){switch(e.op){case"capabilities":return{path:"/v1/capabilities",method:"GET"};case"runtimes.list":return{path:"/v1/desktop/runtimes?probe=false",method:"GET"};case"peers.list":return{path:"/v1/desktop/peers",method:"GET"};case"networks.list":return{path:"/v1/desktop/networks",method:"GET"};case"asks.list":return{path:"/v1/desktop/asks",method:"GET"};case"networks.invite":return{path:`/v1/desktop/networks/${encodeURIComponent(e.networkId)}/invite`,method:"POST",body:{role:e.role,device:e.deviceId??null}};case"networks.member.remove":return{path:`/v1/desktop/networks/${encodeURIComponent(e.networkId)}/members/${encodeURIComponent(e.deviceId)}`,method:"DELETE",body:{confirm:e.confirm}};case"sessions.transfer":return{path:`/v1/desktop/sessions/${encodeURIComponent(e.sessionId)}/transfer`,method:"POST",body:{to:e.to,keep:e.keep??!1,wait_s:e.waitS??0,...e.requestId?{request_id:e.requestId}:{}}};case"approvals.list":return{path:"/v1/desktop/approvals",method:"GET"};case"approvals.approve":return{path:`/v1/desktop/approvals/${encodeURIComponent(e.approvalId)}/approve`,method:"POST"};case"approvals.deny":return{path:`/v1/desktop/approvals/${encodeURIComponent(e.approvalId)}/deny`,method:"POST"};case"profiles.list":return{path:"/v1/desktop/profiles",method:"GET"};case"profiles.get":return{path:`/v1/desktop/profiles/${encodeURIComponent(e.name)}`,method:"GET"};case"profiles.install":return{path:"/v1/desktop/profiles/install",method:"POST",body:{request_id:e.requestId,name:e.name}};case"imports.sources":return{path:"/v1/desktop/imports/sources",method:"GET"};case"imports.sessions":{const t=new URLSearchParams({source:e.source});return e.includeSubagents&&t.set("include_subagents","true"),{path:`/v1/desktop/imports/sessions?${t.toString()}`,method:"GET"}}case"imports.preview":return{path:"/v1/desktop/imports/preview",method:"POST",body:bn(e)};case"imports.start":return{path:"/v1/desktop/imports/jobs",method:"POST",body:bn(e)};case"imports.status":return{path:`/v1/desktop/imports/jobs/${encodeURIComponent(e.jobId)}`,method:"GET"};case"imports.cancel":return{path:`/v1/desktop/imports/jobs/${encodeURIComponent(e.jobId)}`,method:"DELETE"};case"profiles.create":return{path:"/v1/desktop/profiles",method:"POST",body:{request_id:e.requestId,name:e.name,...e.fields}};case"profiles.update":return{path:`/v1/desktop/profiles/${encodeURIComponent(e.name)}`,method:"PATCH",body:{request_id:e.requestId,...e.fields,...e.expectedDefinitionRevision!==void 0&&e.expectedDefinitionRevision!==null?{expected_definition_revision:e.expectedDefinitionRevision}:{}}};case"hub.updates":return{path:"/v1/desktop/hub/updates",method:"GET"};case"hub.skillPull":return{path:"/v1/desktop/hub/skills/pull",method:"POST",body:{request_id:e.requestId,hub_id:e.hubId,hub_source:e.hubSource,visibility:e.visibility,tenant_id:e.tenantId,local_alias:e.localAlias,...e.subscribe!==void 0?{subscribe:e.subscribe}:{},...e.autoPush!==void 0?{auto_push:e.autoPush}:{},...e.confirmPublicEgress!==void 0?{confirm_public_egress:e.confirmPublicEgress}:{}}};case"hub.skillPublish":return{path:"/v1/desktop/hub/skills/publish",method:"POST",body:{request_id:e.requestId,dry_run:e.dryRun,source_skill:e.sourceSkill,local_alias:e.localAlias,visibility:e.visibility,tenant_id:e.tenantId,subscribe:e.subscribe,auto_push:e.autoPush,confirm_public_egress:e.confirmPublicEgress,...e.previewReceipt?{preview_receipt:e.previewReceipt}:{},...e.confirmPublish?{confirm_publish:!0}:{}}};case"hub.links":return{path:`/v1/desktop/hub/links${e.kind?`?kind=${e.kind}`:""}`,method:"GET"};case"hub.policy":return{path:`/v1/desktop/hub/links/${encodeURIComponent(e.linkId)}`,method:"PATCH",body:{request_id:e.requestId,expected_policy_revision:e.expectedPolicyRevision,...e.subscribe!==void 0?{subscribe:e.subscribe}:{},...e.autoPush!==void 0?{auto_push:e.autoPush}:{},...e.confirmPublicEgress!==void 0?{confirm_public_egress:e.confirmPublicEgress}:{}}};case"hub.check":return{path:"/v1/desktop/hub/updates/check",method:"POST",body:{request_id:e.requestId,...e.linkId?{link_id:e.linkId}:{},...e.direction?{direction:e.direction}:{},...e.kind?{kind:e.kind}:{},...e.name?{name:e.name}:{}}};case"hub.apply":return{path:"/v1/desktop/hub/updates/apply",method:"POST",body:{request_id:e.requestId,...e.previewReceipt?{preview_receipt:e.previewReceipt}:{},...e.confirmApply?{confirm_apply:!0}:{},...e.linkId?{link_id:e.linkId}:{},...e.direction?{direction:e.direction}:{},...e.kind?{kind:e.kind}:{},...e.name?{name:e.name}:{},...e.prefer?{prefer:e.prefer}:{},...e.acknowledgeUnknownBaseline!==void 0?{acknowledge_unknown_baseline:e.acknowledgeUnknownBaseline}:{},...e.dryRun!==void 0?{dry_run:e.dryRun}:{},...e.resolveSource===!0?{resolve_source:!0,hub_source:e.hubSource,visibility:e.visibility,tenant_id:e.tenantId??null}:{}}};case"hub.applyAll":return{path:"/v1/desktop/hub/updates/apply-all",method:"POST",body:{request_id:e.requestId,...e.kind?{kind:e.kind}:{}}};case"hub.retry":return{path:"/v1/desktop/hub/updates/retry",method:"POST",body:{request_id:e.requestId,...e.linkId?{link_id:e.linkId}:{},...e.direction?{direction:e.direction}:{},...e.kind?{kind:e.kind}:{},...e.name?{name:e.name}:{}}};case"hub.push":return{path:"/v1/desktop/hub/updates/push",method:"POST",body:{request_id:e.requestId,link_id:e.linkId,direction:e.direction,dry_run:e.dryRun,...e.previewReceipt?{preview_receipt:e.previewReceipt}:{},...e.confirmPublish?{confirm_publish:!0}:{}}};case"teams.list":return{path:"/v1/desktop/teams",method:"GET"};case"teams.get":return{path:`/v1/desktop/teams/${encodeURIComponent(e.name)}`,method:"GET"};case"teams.effective":return{path:`/v1/desktop/teams/${encodeURIComponent(e.name)}/effective`,method:"GET"};case"teams.create":return{path:"/v1/desktop/teams",method:"POST",body:{request_id:e.requestId,...e.fields}};case"teams.update":return{path:`/v1/desktop/teams/${encodeURIComponent(e.name)}`,method:"PATCH",body:{request_id:e.requestId,...e.fields,...e.expectedDefinitionRevision!==void 0&&e.expectedDefinitionRevision!==null?{expected_definition_revision:e.expectedDefinitionRevision}:{}}};case"sessions.list":{const t=new URLSearchParams;return t.set("limit",String(e.limit??100)),e.include_archived&&t.set("include_archived","true"),e.scope_kind&&t.set("scope_kind",e.scope_kind),e.scope_name&&t.set("scope_name",e.scope_name),e.cursor&&t.set("cursor",e.cursor),e.with_counts&&t.set("with_counts","true"),e.include_peers&&t.set("include_peers","true"),e.sort&&t.set("sort",e.sort),{path:`/v1/desktop/sessions?${t}`,method:"GET"}}case"delegated_cleanup_notice.ack":return{path:"/v1/desktop/delegated-cleanup-notice/ack",method:"POST"};case"sessions.search":{const t=new URLSearchParams({q:e.q,limit:String(e.limit??Pi)});return e.include_archived&&t.set("include_archived","true"),{path:`/v1/desktop/sessions/search?${t}`,method:"GET"}}case"sessions.archive":return{path:`/v1/desktop/sessions/${e.sessionId}/archive`,method:"POST",body:{archived:e.archived}};case"sessions.delete":return{path:`/v1/desktop/sessions/${e.sessionId}`,method:"DELETE",body:{confirmed:!0}};case"sessions.create":return{path:"/v1/desktop/sessions",method:"POST",body:{request_id:e.requestId,...e.cwd!==void 0?{cwd:e.cwd}:{},...e.peer?{peer:e.peer}:{},...e.target?{target:e.target}:{},...e.model?{model:e.model}:{},...e.draftId?{draft_id:e.draftId}:{},...e.purpose?{purpose:e.purpose}:{}}};case"sessions.preview":return{path:"/v1/desktop/sessions/preview",method:"POST",body:{request_id:e.requestId,cwd:e.cwd,...e.target?{target:e.target}:{},...e.model?{model:e.model}:{}}};case"sessions.draft":return{path:"/v1/desktop/sessions/draft",method:"POST",body:{request_id:e.requestId,cwd:e.cwd,...e.target?{target:e.target}:{},...e.model?{model:e.model}:{}}};case"sessions.get":{const t=new URLSearchParams;return e.journalOrder&&(t.set("journal_order","1"),e.peerJournalSource&&t.set("peer_journal_source","1"),kt(t,`/v1/desktop/sessions/${e.sessionId}`,e.orderIds??[])),{path:`/v1/desktop/sessions/${e.sessionId}${t.size?`?${t}`:""}`,method:"GET"}}case"sessions.files":{const t=new URLSearchParams({limit:String(e.limit??200)});for(const s of["scope","kind","q","sort","order","cursor"]){const i=e[s];i!==void 0&&t.set(s,i)}return{path:`/v1/desktop/sessions/${encodeURIComponent(e.sessionId)}/files?${t}`,method:"GET"}}case"sessions.files.materialise":return{path:`/v1/desktop/sessions/${encodeURIComponent(e.sessionId)}/files/${encodeURIComponent(e.fileId)}/materialise`,method:"POST"};case"sessions.history":{const t=new URLSearchParams({limit:String(e.limit??100)});return e.beforeId&&t.set("before_id",e.beforeId),e.openFrame&&(t.set("open_frame","1"),t.set("supplements","1")),e.journalOrder&&(t.set("journal_order","1"),e.peerJournalSource&&t.set("peer_journal_source","1"),e.sourceRead==="metadata"?t.set("source_read","metadata"):e.sourceRead==="payload"&&e.expectedJournalGeneration&&t.set("source_read","payload"),e.expectedJournalGeneration&&t.set("expected_journal_generation",e.expectedJournalGeneration),kt(t,`/v1/desktop/sessions/${e.sessionId}/history`,e.orderIds??[])),{path:`/v1/desktop/sessions/${e.sessionId}/history?${t}`,method:"GET"}}case"sessions.checkpoints":return{path:`/v1/desktop/sessions/${e.sessionId}/checkpoints`,method:"GET"};case"sessions.checkpoints.warm":return{path:`/v1/desktop/sessions/${e.sessionId}/checkpoints/warm`,method:"POST",body:{...e.ids?{ids:e.ids}:{},...e.limit!==void 0?{limit:e.limit}:{}}};case"sessions.find":{const t=new URLSearchParams({q:e.q,limit:String(e.limit??ji)});return{path:`/v1/desktop/sessions/${e.sessionId}/find?${t}`,method:"GET"}}case"subagents.transcript":{const t=new URLSearchParams({limit:String(e.limit??100)});return e.beforeId&&t.set("before_id",e.beforeId),{path:`/v1/desktop/sessions/${e.sessionId}/children/${e.childId}/transcript?${t}`,method:"GET"}}case"sessions.message":return{path:`/v1/desktop/sessions/${e.sessionId}/messages`,method:"POST",body:{request_id:e.requestId,text:e.text,images:e.images??[],mode:e.mode??"prompt",...e.inputMode?{input_mode:e.inputMode}:{},...e.inputPath?{input_path:e.inputPath}:{}}};case"sessions.command":return{path:`/v1/desktop/sessions/${e.sessionId}/commands`,method:"POST",body:{request_id:e.requestId,command:e.command,args:e.args??"",images:e.images??[]}};case"sessions.answer":return e.askId!==void 0?{path:`/v1/desktop/sessions/${e.sessionId}/answers`,method:"POST",body:{ask_id:e.askId,answers:e.answers,decline:e.decline,...e.revise===!0?{revise:!0}:{}}}:{path:`/v1/desktop/sessions/${e.sessionId}/answers`,method:"POST",body:{epoch:e.epoch,request_id:e.requestId,value:e.value,approved:e.approved,question_index:e.questionIndex}};case"sessions.seen":return{path:`/v1/desktop/sessions/${e.sessionId}/seen`,method:"POST",body:{completion_token:e.completionToken}};case"attention.seen":return{path:"/v1/desktop/attention/seen",method:"POST",body:{items:e.items.map(t=>({session_id:t.sessionId,completion_token:t.completionToken}))}};case"sessions.notified":return{path:`/v1/desktop/sessions/${e.sessionId}/notified`,method:"POST",body:{completion_token:e.completionToken}};case"tags.list":return{path:"/v1/desktop/tags",method:"GET"};case"tags.replace":return{path:"/v1/desktop/tags",method:"PUT",body:{tags:e.tags}};case"sessions.tags":return{path:`/v1/desktop/sessions/${e.sessionId}/tags`,method:"PUT",body:{tags:e.tags,primary:e.primary}};case"sessions.pin":return{path:`/v1/desktop/sessions/${e.sessionId}/pin`,method:"POST",body:{pinned:e.pinned}};case"sessions.watch":return{path:`/v1/desktop/sessions/${e.sessionId}/watch`,method:"POST",body:{subscription_id:e.subscriptionId,visible:e.visible,can_notify:e.canNotify}};case"sessions.presence":return{path:"/v1/desktop/presence",method:"POST",body:{subscription_id:e.subscriptionId,can_notify_kinds:e.canNotifyKinds,session_id:e.sessionId,window:e.window,can_notify:e.canNotify}};case"sessions.move":return{path:`/v1/desktop/sessions/${e.sessionId}/working-directory`,method:"POST",body:{request_id:e.requestId,cwd:e.cwd}};case"sessions.warm":return{path:`/v1/desktop/sessions/${e.sessionId}/warm`,method:"POST",body:{}};case"sessions.interrupt":return{path:`/v1/desktop/sessions/${e.sessionId}/interrupt`,method:"POST",body:{request_id:e.requestId}};case"supplements.cancel":return{path:`/v1/desktop/sessions/${e.sessionId}/supplements/${e.job}/cancel`,method:"POST",body:{anchor:e.anchor}};case"supplements.restart":return{path:`/v1/desktop/sessions/${e.sessionId}/supplements/${e.job}/restart`,method:"POST",body:{anchor:e.anchor}};case"supplements.steer":return{path:`/v1/desktop/sessions/${e.sessionId}/supplements/${e.job}/steer`,method:"POST",body:{anchor:e.anchor,text:e.text}};case"sessions.variables.list":return{path:`/v1/desktop/sessions/${e.sessionId}/variables`,method:"GET"};case"sessions.variables.create":return{path:`/v1/desktop/sessions/${e.sessionId}/variables`,method:"POST",body:{key:e.key,value:e.value,type:e.type}};case"sessions.variables.update":return{path:`/v1/desktop/sessions/${e.sessionId}/variables/${encodeURIComponent(e.key)}`,method:"PATCH",body:{value:e.value,type:e.type}};case"sessions.variables.delete":return{path:`/v1/desktop/sessions/${e.sessionId}/variables/${encodeURIComponent(e.key)}`,method:"DELETE"};case"legacy.models":{const t=new URLSearchParams;return e.provider&&t.set("provider",e.provider),e.sort&&t.set("sort",e.sort),e.direction&&t.set("direction",e.direction),{path:t.size>0?`/v1/models?${t}`:"/v1/models",method:"GET"}}case"legacy.models.providers":return{path:"/v1/models/providers",method:"GET"};case"auth.probe":return{path:`/v1/auth/providers/${e.provider}/probe`,method:"POST"};case"legacy.agent.upload":return{path:`/v1/agents/${e.agentId}/upload`,method:"POST"};case"agent.publish":{gt(e);const t=new URLSearchParams;e.visibility==="org"&&e.tenantId&&(t.set("visibility","org"),t.set("tenant_id",e.tenantId));const s=t.toString();return{path:`/v1/agents/${e.agentId}/publish${s?`?${s}`:""}`,method:"POST",body:{document:e.document??{},...ft(e)}}}case"agent.republish":{gt(e);const t=new URLSearchParams;e.visibility==="org"&&e.tenantId&&(t.set("visibility","org"),t.set("tenant_id",e.tenantId));const s=t.toString();return{path:`/v1/agents/${e.agentId}/publish${s?`?${s}`:""}`,method:"PUT",body:{hub_agent_id:e.hubAgentId,document:e.document??{},...ft(e),...e.expectedRemoteRevision?{expected_remote_revision:e.expectedRemoteRevision}:{}}}}case"team.publish":{gt(e);const t=new URLSearchParams;return e.visibility==="org"&&e.tenantId&&(t.set("visibility","org"),t.set("tenant_id",e.tenantId)),{path:`/v1/teams/${e.teamId}/publish${t.size?`?${t}`:""}`,method:"POST",body:ft(e)}}case"team.pull":{const t=new URLSearchParams;e.tenantId&&t.set("tenant_id",e.tenantId);const s=t.toString();return{path:`/v1/teams/pull/${e.teamId}${s?`?${s}`:""}`,method:"GET"}}case"agent.nameAvailability":return{path:`/v1/agent-name-availability?${new URLSearchParams({name:e.name})}`,method:"GET"};case"legacy.agents.list":{const t=new URLSearchParams({page:String(e.page??1),per_page:String(e.perPage??10)});return e.name&&t.set("name",e.name),e.sort&&t.set("sort",e.sort),e.direction&&t.set("direction",e.direction),{path:`/v1/agents?${t}`,method:"GET"}}case"legacy.agent.get":return{path:`/v1/agents/${e.agentId}`,method:"GET"};case"legacy.agent.history":{const t=new URLSearchParams({page:String(e.page??1),per_page:String(e.perPage??10)});return{path:`/v1/agents/${e.agentId}/history?${t}`,method:"GET"}}case"wakes.list":{const t=new URLSearchParams;return e.limit!==void 0&&t.set("limit",String(e.limit)),e.includeDormant!==void 0&&t.set("include_dormant",String(e.includeDormant)),{path:t.size>0?`/v1/desktop/wakes?${t}`:"/v1/desktop/wakes",method:"GET"}}case"wakes.create":return{path:"/v1/desktop/wakes",method:"POST",body:{request_id:e.requestId,...Ga(e),message:e.message,...gn(e)}};case"wakes.edit":return{path:`/v1/desktop/wakes/${e.sessionId}/${e.wakeId}`,method:"PATCH",body:{...e.message!==void 0?{message:e.message}:{},...gn(e)}};case"wakes.remove":return{path:`/v1/desktop/wakes/${e.sessionId}/${e.wakeId}`,method:"DELETE"};case"monitors.cancel":return{path:`/v1/desktop/monitors/${encodeURIComponent(e.sessionId)}/${encodeURIComponent(e.monitorId)}`,method:"DELETE"};case"jobs.cancel":return{path:`/v1/desktop/sessions/${encodeURIComponent(e.sessionId)}/jobs/${encodeURIComponent(e.jobId)}/cancel`,method:"POST"};case"legacy.jobs.list":{const t=new URLSearchParams;return e.agentId&&t.set("agent_id",e.agentId),e.status&&t.set("status",e.status),{path:t.size>0?`/v1/jobs?${t}`:"/v1/jobs",method:"GET"}}case"legacy.job.get":return{path:`/v1/jobs/${e.jobId}`,method:"GET"};case"legacy.schedules.list":return{path:`/v1/schedules?${new URLSearchParams({page:String(e.page??1),per_page:String(e.perPage??10)})}`,method:"GET"};case"legacy.agent.schedules.list":{const t=new URLSearchParams({page:String(e.page??1),per_page:String(e.perPage??10)});return{path:`/v1/agents/${e.agentId}/schedules?${t}`,method:"GET"}}case"legacy.agent.schedule.create":return{path:`/v1/agents/${e.agentId}/schedules`,method:"POST",body:e.schedule};case"legacy.schedule.get":return{path:`/v1/schedules/${e.scheduleId}`,method:"GET"};case"legacy.schedule.edit":return{path:`/v1/schedules/${e.scheduleId}`,method:"PATCH",body:e.schedule};case"legacy.schedule.remove":return{path:`/v1/schedules/${e.scheduleId}`,method:"DELETE"};case"legacy.agent.create":return{path:"/v1/agents",method:"POST",body:e.agent};case"legacy.agent.update":return{path:`/v1/agents/${e.agentId}`,method:"PATCH",body:e.update};case"legacy.agent.delete":return{path:`/v1/agents/${e.agentId}`,method:"DELETE"};case"legacy.agent.conversation.clear":return{path:`/v1/agents/${e.agentId}/conversation`,method:"DELETE"};case"legacy.agent.systemPrompt.get":return{path:`/v1/agents/${e.agentId}/system-prompt`,method:"GET"};case"legacy.agent.systemPrompt.update":return{path:`/v1/agents/${e.agentId}/system-prompt`,method:"PUT",body:{system_prompt:e.systemPrompt}};case"legacy.agent.download":return{path:`/v1/agents/${e.agentId}/download`,method:"GET"};case"legacy.job.cancel":return{path:`/v1/jobs/${e.jobId}`,method:"DELETE"};case"commands.list":return{path:"/v1/desktop/commands",method:"GET"};case"commands.entities":return{path:`/v1/desktop/sessions/${e.sessionId}/command-entities?command=${encodeURIComponent(e.command)}${e.name?`&name=${encodeURIComponent(e.name)}`:""}`,method:"GET"};case"models.catalogue":{const t=e.scope?`&scope=${e.scope}`:"";return{path:`/v1/desktop/models?live=${e.live??!1}${t}`,method:"GET"}}case"usage.get":{const t=new URLSearchParams({live:String(e.live??!1),refresh:String(e.refresh??!1)});return e.provider&&t.set("provider",e.provider),{path:`/v1/desktop/usage?${t}`,method:"GET"}}case"quota.notice":{const t=new URLSearchParams({refresh:String(e.refresh??!1)});return e.provider&&t.set("provider",e.provider),e.model&&t.set("model",e.model),{path:`/v1/desktop/quota-notice?${t}`,method:"GET"}}case"analytics.get":{const t=new URLSearchParams({days:String(e.days??30)});return e.sessionId&&t.set("session_id",e.sessionId),e.sinceMs!==void 0&&t.set("since_ms",String(e.sinceMs)),e.untilMs!==void 0&&t.set("until_ms",String(e.untilMs)),{path:`/v1/desktop/analytics?${t}`,method:"GET"}}case"analytics.models":{const t=new URLSearchParams({days:String(e.days??30)});return e.sessionId&&t.set("session_id",e.sessionId),e.sinceMs!==void 0&&t.set("since_ms",String(e.sinceMs)),e.untilMs!==void 0&&t.set("until_ms",String(e.untilMs)),{path:`/v1/desktop/analytics/models?${t}`,method:"GET"}}case"info.get":return{path:"/v1/desktop/info",method:"GET"};case"sessions.report":{const t=new URLSearchParams({recent_limit:String(e.recentLimit??12)});return{path:`/v1/desktop/sessions/${e.sessionId}/report?${t}`,method:"GET"}}case"skills.list":{const t=new URLSearchParams;e.sessionId&&t.set("session_id",e.sessionId),e.cwd&&t.set("cwd",e.cwd),e.name&&t.set("name",e.name);const s=t.toString();return{path:`/v1/desktop/skills${s?`?${s}`:""}`,method:"GET"}}case"sessions.failovers":return{path:`/v1/desktop/sessions/${e.sessionId}/failovers`,method:"GET"};case"sessions.credential":return{path:`/v1/desktop/sessions/${e.sessionId}/credentials`,method:"POST",body:{action:e.action,key:e.key,value:e.value,confirmed:e.confirmed}};case"sessions.fork":return{path:`/v1/desktop/sessions/${e.sessionId}/fork`,method:"POST",body:{request_id:e.requestId,message:e.message,boundary:e.boundary,entry_id:e.entryId}};case"sessions.stop":return{path:"/v1/desktop/stop",method:"POST",body:{request_id:e.requestId,targets:e.targets,confirmed:e.confirmed}};case"sessions.aside":return{path:`/v1/desktop/sessions/${e.sessionId}/asides`,method:"POST",body:{request_id:e.requestId,text:e.text,aside_id:e.asideId,subscription_id:e.subscriptionId}};case"sessions.adopt":return{path:`/v1/desktop/sessions/${e.sessionId}/asides/${e.asideId}/adopt`,method:"POST",body:{request_id:e.requestId,confirmed:e.confirmed}};case"sessions.aside.get":case"sessions.aside.close":return{path:`/v1/desktop/sessions/${e.sessionId}/asides/${e.asideId}`,method:e.op==="sessions.aside.get"?"GET":"DELETE"};case"mcp.list":return{path:`/v1/desktop/sessions/${e.sessionId}/mcp`,method:"GET"};case"mcp.credentials.store":return{path:`/v1/desktop/sessions/${e.sessionId}/mcp/credentials`,method:"POST",body:{name:e.name,values:e.values,confirmed_replace:e.confirmedReplace}};case"mcp.control":return{path:`/v1/desktop/sessions/${e.sessionId}/mcp`,method:"POST",body:e.control};case"mcp.catalog":{const t=new URLSearchParams;e.cwd&&t.set("cwd",e.cwd),e.sessionId&&t.set("session_id",e.sessionId);const s=t.toString();return{path:s?`/v1/desktop/mcp?${s}`:"/v1/desktop/mcp",method:"GET"}}case"mcp.catalog.control":return{path:"/v1/desktop/mcp",method:"POST",body:{...e.control,...e.cwd?{cwd:e.cwd}:{}}};case"mcp.catalog.credentials":return{path:"/v1/desktop/mcp/credentials",method:"POST",body:{name:e.name,values:e.values,...e.header?{header:e.header}:{},confirmed_replace:e.confirmedReplace,...e.cwd?{cwd:e.cwd}:{}}};case"radient.request":return{path:"/v1/desktop/radient",method:"POST",body:e.control};case"providers.list":return{path:"/v1/auth/providers",method:"GET"};case"accounts.list":return{path:"/v1/auth/status",method:"GET"};case"accounts.remove":return{path:`/v1/auth/accounts/${e.accountId}`,method:"DELETE"};case"tunnel.setup.read":return{path:e.credentialId===void 0?"/v1/desktop/tunnel/setup":`/v1/desktop/tunnel/setup?credential_id=${e.credentialId}`,method:"GET"};case"tunnel.setup.plan":return{path:"/v1/desktop/tunnel/setup",method:"POST",body:{action:"plan",...e.credentialId!==void 0?{credential_id:e.credentialId}:{}}};case"tunnel.setup.run":return{path:"/v1/desktop/tunnel/setup",method:"POST",body:{action:"run",credential_id:e.credentialId,...e.acceptMonthlyPrice!==void 0?{accept_monthly_price:e.acceptMonthlyPrice}:{}}};case"auth.start":return{path:"/v1/auth/login",method:"POST",body:{provider:e.provider}};case"auth.status":return{path:`/v1/auth/operations/${e.id}`,method:"GET"};case"auth.input":return{path:`/v1/auth/operations/${e.id}/input`,method:"POST",body:{prompt_id:e.promptId,value:e.value}};case"auth.cancel":return{path:`/v1/auth/operations/${e.id}`,method:"DELETE"};case"auth.key":return{path:`/v1/auth/providers/${e.provider}/key`,method:"PUT",body:{value:e.value}};case"auth.logout":return{path:`/v1/auth/providers/${e.provider}/credentials`,method:"DELETE"};case"agent_messages.status":return{path:`/v1/desktop/team-bridge/status?boundary=${e.boundary}`,method:"GET"};case"agent_messages.enable":return{path:"/v1/desktop/team-bridge/settings",method:"PUT",body:{expected_account_id:e.expected_account_id,tenant_id:e.tenant_id,state:e.state,consent_version:e.consent_version,consented_via:e.consented_via}};case"agent_messages.settings":return{path:`/v1/desktop/team-bridge/settings${vn(e.tenant_id)}`,method:"GET"};case"agent_messages.settings.put":return{path:"/v1/desktop/team-bridge/settings",method:"PUT",body:{expected_account_id:e.expected_account_id,...e.tenant_id===void 0?{}:{tenant_id:e.tenant_id},...e.consent_version===void 0?{}:{consent_version:e.consent_version},...e.consented_via===void 0?{}:{consented_via:e.consented_via},...e.label===void 0?{}:{label:e.label},state:e.state}};case"agent_messages.allowlist.get":return{path:`/v1/desktop/team-bridge/allowlist${vn(e.tenant_id)}`,method:"GET"};case"agent_messages.allowlist.put":return{path:"/v1/desktop/team-bridge/allowlist",method:"PUT",body:{expected_account_id:e.expected_account_id,...e.tenant_id===void 0?{}:{tenant_id:e.tenant_id},entries:e.entries}};case"settings.list":return{path:"/v1/settings",method:"GET"};case"settings.edit":return{path:`/v1/settings/${e.key}`,method:"PATCH",body:{value:e.value,base:e.base}};case"settings.reset":return{path:`/v1/settings/${e.key}/reset`,method:"POST"};case"tts.paths":return{path:"/v1/tts/paths",method:"GET"};case"config.get":return{path:"/v1/config",method:"GET"};case"config.update":return{path:"/v1/config",method:"PATCH",body:e.value};case"instructions.get":return{path:"/v1/config/system-prompt",method:"GET"};case"instructions.update":return{path:"/v1/config/system-prompt",method:"PATCH",body:{content:e.content}};case"credentials.list":return{path:"/v1/credentials",method:"GET"};case"credentials.update":return{path:"/v1/credentials",method:"PATCH",body:{key:e.key,value:e.value}};case"library.list":{const t=new URLSearchParams;e.q&&t.set("q",e.q),e.category&&t.set("category",e.category),e.kind&&t.set("kind",e.kind),e.origin_group&&t.set("origin_group",e.origin_group),e.origin&&t.set("origin",e.origin),e.tag&&t.set("tag",e.tag),e.tag_mode&&t.set("tag_mode",e.tag_mode),e.highlighted!==void 0&&t.set("highlighted",e.highlighted?"1":"0"),e.organized!==void 0&&t.set("organized",e.organized?"1":"0"),e.favorite!==void 0&&t.set("favorite",e.favorite?"1":"0"),e.session&&t.set("session",e.session),e.session_id&&t.set("session_id",e.session_id),e.sort&&t.set("sort",e.sort),e.order&&t.set("order",e.order),e.limit!==void 0&&t.set("limit",String(e.limit)),e.cursor&&t.set("cursor",e.cursor);const s=t.toString();return{path:`/v1/desktop/library/assets${s?`?${s}`:""}`,method:"GET"}}case"library.get":return{path:`/v1/desktop/library/assets/${encodeURIComponent(e.id)}`,method:"GET"};case"library.update":return{path:`/v1/desktop/library/assets/${encodeURIComponent(e.id)}`,method:"PATCH",body:e.fields};case"library.tags":return{path:"/v1/desktop/library/tags",method:"GET"};case"library.tags.create":return{path:"/v1/desktop/library/tags",method:"POST",body:{name:e.name,...e.category!==void 0?{category:e.category}:{}}};case"library.tags.update":return{path:`/v1/desktop/library/tags/${encodeURIComponent(e.id)}`,method:"PATCH",body:{...e.name!==void 0?{name:e.name}:{},...e.category!==void 0?{category:e.category}:{}}};case"library.tags.delete":return{path:`/v1/desktop/library/tags/${encodeURIComponent(e.id)}`,method:"DELETE"};case"library.tags.merge":return{path:`/v1/desktop/library/tags/${encodeURIComponent(e.id)}/merge`,method:"POST",body:{into:e.into}};case"library.tags.assign":return{path:`/v1/desktop/library/assets/${encodeURIComponent(e.id)}/tags`,method:"PUT",body:{tags:e.tags,...e.primary!==void 0?{primary:e.primary}:{}}};case"library.chat.link":return{path:`/v1/desktop/library/assets/${encodeURIComponent(e.id)}/chat`,method:"PUT",body:{session_id:e.sessionId}};case"library.chat.clear":return{path:`/v1/desktop/library/assets/${encodeURIComponent(e.id)}/chat`,method:"DELETE"};case"library.librarian":{const t=e.action??"status";return t==="status"?{path:"/v1/desktop/librarian",method:"GET"}:{path:"/v1/desktop/librarian",method:"POST",body:{op:t}}}case"projects.list":return{path:"/v1/desktop/projects",method:"GET"};case"projects.get":return{path:`/v1/desktop/projects/${encodeURIComponent(e.key)}`,method:"GET"};case"projects.create":return{path:"/v1/desktop/projects",method:"POST",body:{name:e.name,...e.description!==void 0?{description:e.description}:{},...e.status!==void 0?{status:e.status}:{},...e.tags!==void 0?{tags:e.tags}:{}}};case"projects.update":return{path:`/v1/desktop/projects/${encodeURIComponent(e.key)}`,method:"PATCH",body:{...e.fields,...e.force_done===!0?{force_done:!0}:{}}};case"projects.delete":return{path:`/v1/desktop/projects/${encodeURIComponent(e.key)}`,method:"DELETE",body:{confirm:e.confirmed_name}};case"projects.link":return{path:`/v1/desktop/projects/${encodeURIComponent(e.key)}/links`,method:"POST",body:{session_id:e.sessionId}};case"projects.unlink":return{path:`/v1/desktop/projects/${encodeURIComponent(e.key)}/links/${encodeURIComponent(e.sessionId)}`,method:"DELETE"};case"projects.milestone":return{path:`/v1/desktop/projects/${encodeURIComponent(e.key)}/milestones`,method:"POST",body:{name:e.name,...e.targetDate!==void 0?{target_date:e.targetDate}:{},...e.completed!==void 0?{completed:e.completed}:{}}};case"projects.milestone.remove":return{path:`/v1/desktop/projects/${encodeURIComponent(e.key)}/milestones/${encodeURIComponent(e.name)}`,method:"DELETE"};case"projects.request_update":return{path:`/v1/desktop/projects/${encodeURIComponent(e.key)}/request-update`,method:"POST"};case"projects.search":return{path:`/v1/desktop/projects/search?${new URLSearchParams({q:e.q,limit:String(e.limit??la)})}`,method:"GET"};case"aida.status":return{path:"/v1/desktop/aida",method:"GET"};case"aida.control":return{path:"/v1/desktop/aida",method:"POST",body:{op:e.action}};case"code_requests.list":return{path:`/v1/desktop/sessions/${e.sessionId}/code-requests`,method:"GET"};case"code_requests.refresh":return{path:`/v1/desktop/sessions/${e.sessionId}/code-requests/refresh`,method:"POST",body:{...e.keys!==void 0?{keys:e.keys}:{},...e.force!==void 0?{force:e.force}:{}}};case"static.sign":return{path:"/v1/static/sign",method:"POST",body:{route:e.route,path:e.path,ttl_s:e.ttlS}}}}const Fr=64,Hr=64*1024*1024,_n=e=>{let t;const s=new Set,i=(l,p)=>{const w=typeof l=="function"?l(t):l;if(!Object.is(w,t)){const y=t;t=p??(typeof w!="object"||w===null)?w:Object.assign({},t,w),s.forEach(P=>P(t,y))}},a=()=>t,c={setState:i,getState:a,getInitialState:()=>d,subscribe:l=>(s.add(l),()=>s.delete(l))},d=t=e(i,a,c);return c},za=e=>e?_n(e):_n,Fa=e=>e;function Ha(e,t=Fa){const s=Dt.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return Dt.useDebugValue(s),s}const yn=e=>{const t=za(e),s=i=>Ha(t,i);return Object.assign(s,t),s},Hn=e=>e?yn(e):yn;function Vn(e,t){let s;try{s=e()}catch{return}return{getItem:a=>{var o;const r=d=>d===null?null:JSON.parse(d,void 0),c=(o=s.getItem(a))!=null?o:null;return c instanceof Promise?c.then(r):r(c)},setItem:(a,o)=>s.setItem(a,JSON.stringify(o,void 0)),removeItem:a=>s.removeItem(a)}}const It=e=>t=>{try{const s=e(t);return s instanceof Promise?s:{then(i){return It(i)(s)},catch(i){return this}}}catch(s){return{then(i){return this},catch(i){return It(i)(s)}}}},Va=(e,t)=>(s,i,a)=>{let o={storage:Vn(()=>localStorage),partialize:T=>T,version:0,merge:(T,ne)=>({...ne,...T}),...t},r=!1;const c=new Set,d=new Set;let l=o.storage;if(!l)return e((...T)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),s(...T)},i,a);const p=()=>{const T=o.partialize({...i()});return l.setItem(o.name,{state:T,version:o.version})},w=a.setState;a.setState=(T,ne)=>{w(T,ne),p()};const y=e((...T)=>{s(...T),p()},i,a);a.getInitialState=()=>y;let P;const ue=()=>{var T,ne;if(!l)return;r=!1,c.forEach(j=>{var Z;return j((Z=i())!=null?Z:y)});const Le=((ne=o.onRehydrateStorage)==null?void 0:ne.call(o,(T=i())!=null?T:y))||void 0;return It(l.getItem.bind(l))(o.name).then(j=>{if(j)if(typeof j.version=="number"&&j.version!==o.version){if(o.migrate){const Z=o.migrate(j.state,j.version);return Z instanceof Promise?Z.then(ot=>[!0,ot]):[!0,Z]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,j.state];return[!1,void 0]}).then(j=>{var Z;const[ot,ls]=j;if(P=o.merge(ls,(Z=i())!=null?Z:y),s(P,!0),ot)return p()}).then(()=>{Le?.(P,void 0),P=i(),r=!0,d.forEach(j=>j(P))}).catch(j=>{Le?.(void 0,j)})};return a.persist={setOptions:T=>{o={...o,...T},T.storage&&(l=T.storage)},clearStorage:()=>{l?.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>ue(),hasHydrated:()=>r,onHydrate:T=>(c.add(T),()=>{c.delete(T)}),onFinishHydration:T=>(d.add(T),()=>{d.delete(T)})},o.skipHydration||ue(),P||y},Wn=Va,Wa=(e,t)=>e!==null&&e.message===t.message&&e.removed===t.removed&&e.max_age_hours===t.max_age_hours&&e.in_progress===t.in_progress&&e.first_removal_at===t.first_removal_at&&e.freed_bytes_estimate===t.freed_bytes_estimate&&e.record===t.record;function Vr(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.message!="string"||t.message.trim()==="")return null;const s=(i,a)=>typeof i=="number"&&Number.isFinite(i)?i:a;return{message:t.message,removed:s(t.removed,0),max_age_hours:s(t.max_age_hours,48),in_progress:t.in_progress===!0,first_removal_at:typeof t.first_removal_at=="string"?t.first_removal_at:"",freed_bytes_estimate:typeof t.freed_bytes_estimate=="number"&&Number.isFinite(t.freed_bytes_estimate)?t.freed_bytes_estimate:null,record:typeof t.record=="string"?t.record:""}}const Wr=Hn()(Wn(e=>({notice:null,receive:t=>e(s=>Wa(s.notice,t)?s:{notice:t}),dismiss:()=>e(t=>t.notice===null?t:{notice:null})}),{name:"delegated-cleanup-notice",storage:Vn(()=>{if(typeof localStorage>"u"||localStorage===null)throw new Error("no localStorage in this environment");return localStorage}),partialize:e=>({notice:e.notice})})),Me=260,Kn=220,Yn=320,xt=56,Ka=Me,Ya=1024,Xn=480,Jn=44,Qn=400,Xa=560;function qn(e){return Math.max(0,Math.min(Xa,e-Xn))}function kn(e){return qn(e)>=Qn?"docked":"overlay"}function Kr({capacity:e,min:t,max:s,drawn:i}){const a=e>=t;return a?{resizable:a,value:Math.min(Math.max(i,t),e),minWidth:t,maxWidth:Math.min(s,e)}:{resizable:a,value:i,minWidth:i,maxWidth:i}}function Ja(e,t=Me,s=Jn){return kn(e-es(t)-s)==="overlay"&&kn(e-xt-s)==="docked"}function es(e){return Number.isNaN(e)?Me:Math.min(Yn,Math.max(Kn,e))}function Yr(e,t,s,i=Me,a=!1,o=Jn){if(e>=Ya){const c=!t&&a&&Ja(e,i,o);return{mode:t||c?"strip":"docked",width:t||c?xt:es(i),collapsed:t||c,sheetOpen:!1,resizable:!t&&!c}}return{mode:s?"overlay":"strip",width:s?Ka:xt,collapsed:!0,sheetOpen:s,resizable:!1}}function Xr(e){return e.shiftKey||e.altKey||!(e.metaKey||e.ctrlKey)?!1:e.key.toLowerCase()==="b"}const Jr=e=>e?"⌘B":"Ctrl+B",Qa=["active","created"],Qr={running:"Running",today:"Today",week:"This week",older:"Older"},qa=new Set(["busy","delegating","approval","answer","wedged"]);function nt(e){return qa.has(e.status?.code??"")}const eo=new Set(["approval","answer"]);function to(e){return eo.has(e.status?.code??"")}const no=24*60*60*1e3,so=e=>{const t=new Date(e);return t.setHours(0,0,0,0),t.getTime()};function Pt(e,t){const s=t==="created"?e.created_at:e.updated_at;return typeof s!="number"||!Number.isFinite(s)||s<=0?null:s*1e3}const io="last_user_at";function ao(e){const t=e[io],s=typeof t=="number"&&Number.isFinite(t)&&t>0?t:e.created_at;return typeof s!="number"||!Number.isFinite(s)||s<=0?null:s*1e3}function oo(e,t,s){if(nt(e))return"running";const i=Pt(e,s);if(i===null)return"older";const a=so(t);return i>=a?"today":i>=a-6*no?"week":"older"}function qr(e,t,s){const i={running:[],today:[],week:[],older:[]};for(const a of e)i[oo(a,t,s)].push(a);return i}function ro(e,t,s){const i=Pt(e,s);if(i===null)return"";const a=Math.floor(Math.max(0,t-i)/6e4);if(a<1)return"now";if(a<60)return`${a}m`;const o=Math.floor(a/60);if(o<24)return`${o}h`;const r=Math.floor(o/24);if(r<7)return`${r}d`;const c=Math.floor(r/7);return r<365?`${c}w`:`${Math.floor(r/365)}y`}function ec(e,t,s){const i=ro(e,t,s);if(!i)return"";const a=s==="created"?"created":"last active";if(i==="now")return`${a} just now`;const o={m:"minute",h:"hour",d:"day",w:"week",y:"year"},r=Number.parseInt(i,10),c=o[i.slice(-1)];return`${a} ${r} ${c}${r===1?"":"s"} ago`}const Tt=["pinned","running","today","week","older","agents","teams"];function tc(e){return e==="agents"||e==="teams"}const Ae=8;function co(e,t){if(!(t in e))return e;const s={...e};return delete s[t],s}function nc(e,t){return{...e,[t]:(e[t]??Ae)+Ae}}function sc(e,t,s,i,a){const o=!(e[s]??i);return{expanded:{...e,[s]:o},caps:!o&&!a?co(t,s):t}}function ic(e,t,s,i){return(e||t!=="")&&(i>Ae||s.trim()!=="")}const ac="Collapse, then reopen, to restore the compact list";function oc(e){return(e??Ae)>Ae}const rc=e=>`section-grown-hint-${e}`,lo=e=>e===1?"Show 1 more":`Show ${e} more`;function cc(e,t){return`${lo(e)} ${t}`}const _e={hidden:[],order:[...Tt],pins:[],groupBy:"section",tagsEnabled:!1,basis:"active",orderBy:"active-first",loads:0,pinnedAgents:[]},uo=10,he=[25,50],po=50,mo=500,ho=64;function re(e){const t=Math.max(0,Math.floor(e));return t===0?uo:t<=he.length?he[t-1]:he[he.length-1]+(t-he.length)*po}function lc(e,t){const s=re(e+1)-re(e),i=Math.max(0,Math.min(s,t));return i===1?"Show 1 more chat":`Show ${i} more chats`}function dc(e,t,s){const i=re(t+1)-re(t),a=re(t),o=Math.min(a+i,e.length);let r=0;for(let d=a;d<o;d+=1)Ct(e[d])&&(r+=1);const c=Math.max(0,o-a-r);return c>0?c:Math.max(0,Math.min(i,s))}function Ct(e){return nt(e)}function fo(e){return to(e)?0:nt(e)?1:2}function go(e,t){return nt(e)?ao(e):Pt(e,t)}function bo(e,t){return e===null&&t===null?0:e===null?1:t===null?-1:t-e}function uc(e,t,s){const i=e.map((a,o)=>({row:a,index:o,lane:t==="active-first"?fo(a):0,at:go(a,s)}));return i.sort((a,o)=>a.lane-o.lane||bo(a.at,o.at)||a.index-o.index),i.map(a=>a.row)}function pc(e,t){const{limit:s,currentId:i,searching:a=!1}=t;if(a)return{rows:[...e],lifted:!1,remaining:0};const o=[];let r=Math.max(0,s);for(const l of e){if(r>0){o.push(l),r-=1;continue}Ct(l)&&o.push(l)}const c=Math.max(0,e.length-o.length);if(!i)return{rows:o,lifted:!1,remaining:c};const d=e.find(l=>l.session_id===i)??null;return d===null||o.includes(d)?{rows:o,lifted:!1,remaining:c}:{rows:[d,...o],lifted:!0,remaining:c}}function mc(e,t){if(t.searching)return{rows:[...e],lifted:!1,hidden:0,held:e.length};const s=re(t.loads),i=[];let a=s;for(const d of e){if(Ct(d)){i.push(d);continue}a>0&&(i.push(d),a-=1)}const o=t.currentId,r=o==null?null:e.find(d=>d.session_id===o)??null,c=r!==null&&!i.includes(r);return{rows:c&&r!==null?[r,...i]:i,lifted:c,hidden:e.length-i.length-(c?1:0),held:e.length}}function hc(e){if(e.add<=0)return null;const t=e.add===1?"Show 1 more chat":`Show ${e.add} more chats`;if(e.drawn>=e.total)return{label:t,aria:t};const s=`${e.drawn} of ${e.total}`;return{label:`${t} · ${s}`,aria:`${t} · ${s} shown`}}const vo="mt-4",_o="mt-2";function fc(e){return e?vo:_o}function gc(e,t,s,i){return s?e.toLocaleLowerCase().includes(s.toLocaleLowerCase())||(i??"").toLocaleLowerCase().includes(s.toLocaleLowerCase())||t>0:!0}function bc(e,t){if(t==="section")return null;if(t==="flat")return[{key:"all",label:"",rows:[...e]}];const s=new Map;for(const o of e){const r=o.binding?.team||o.binding?.agent||"",c=r||"ungrouped",d=s.get(c)??{key:c,label:r||"Ungrouped",rows:[]};d.rows.push(o),s.set(c,d)}const i=[...s.values()],a=i.findIndex(o=>o.key==="ungrouped");return a>0&&i.push(...i.splice(a,1)),i}function yo(e,t){return!e.hidden.includes(t)}function ts(e){return e.order.filter(t=>yo(e,t))}function vc(e,t){const s=e.hidden.includes(t)?e.hidden.filter(i=>i!==t):[...e.hidden,t];return{...e,hidden:s}}function _c(e,t,s){const i=ts(e),a=i.indexOf(t),o=i[a+s];if(a<0||o===void 0)return e;const r=e.order.indexOf(t),c=e.order.indexOf(o),d=[...e.order];return d[r]=o,d[c]=t,{...e,order:d}}const ko=["running","today","week","older"];function Sn(e){return ko.includes(e)}function yc(e,t,s,i){if(!Sn(t)||i&&!i(t))return!1;const a=ts(e),o=a.indexOf(t);if(o<0)return!1;const r=a[o+s];return r===void 0||!Sn(r)?!1:i?i(r):!0}const So=["section","agent","flat"],wo=["active-first","recent"];function kc(e){if(typeof e!="object"||e===null)return _e;const t=e,s=new Set(Tt),i=[];if(Array.isArray(t.order))for(const y of t.order)typeof y=="string"&&s.has(y)&&(i.includes(y)||i.push(y));for(const y of Tt)i.includes(y)||i.push(y);const a=[];if(Array.isArray(t.hidden))for(const y of t.hidden)typeof y=="string"&&s.has(y)&&(a.includes(y)||a.push(y));const o=So.includes(t.groupBy)?t.groupBy:_e.groupBy,r=Qa.includes(t.basis)?t.basis:_e.basis,c=wo.includes(t.orderBy)?t.orderBy:_e.orderBy,d=typeof t.loads=="number"&&Number.isFinite(t.loads)&&t.loads>0?Math.min(mo,Math.floor(t.loads)):0,l=[];if(Array.isArray(t.pinnedAgents)){for(const y of t.pinnedAgents)if(typeof y=="string"&&y!==""&&!l.includes(y)){if(l.length>=ho)break;l.push(y)}}const p=[],w=new Set;if(Array.isArray(t.pins))for(const y of t.pins)typeof y=="string"&&y.length!==0&&(w.has(y)||(w.add(y),p.push(y)));return{hidden:a,order:i,groupBy:o,tagsEnabled:typeof t.tagsEnabled=="boolean"?t.tagsEnabled:!1,basis:r,orderBy:c,loads:d,pins:p,pinnedAgents:l}}const ns={sort:"recent",order:"asc",group:!0,workingOpen:!1,closedSections:[],kinds:[]},Io=["recent","name","kind","modified","created","size"],xo=["images","video","audio","documents","spreadsheets","presentations","code","archives","other"];function jt(e){const t=e&&typeof e=="object"?e:{};return{sort:Io.includes(t.sort??"")?t.sort:ns.sort,order:t.order==="desc"?"desc":"asc",group:typeof t.group=="boolean"?t.group:!0,workingOpen:t.workingOpen===!0,closedSections:Array.isArray(t.closedSections)?[...new Set(t.closedSections.filter(s=>["Highlights","Images","Videos","Sounds","Documents","Spreadsheets","Other"].includes(s)))]:[],kinds:Array.isArray(t.kinds)?[...new Set(t.kinds.filter(s=>xo.includes(s)))]:[]}}function Sc(e,t){const s=i=>{switch(t.sort){case"name":return i.row.name;case"kind":return`${i.row.kind}\0${i.row.name}`;case"modified":return i.modified;case"created":return i.created;case"size":return i.row.document.sizeBytes??null;default:return i.mentioned}};return[...e].sort((i,a)=>{const o=s(i),r=s(a);if(o===null||r===null)return o===r?0:o===null?1:-1;const c=typeof o=="string"&&typeof r=="string"?o.localeCompare(r,void 0,{numeric:!0}):Number(o)-Number(r);return(t.order==="asc"?c:-c)||i.mentioned-a.mentioned})}const To=e=>{switch(e.row.kind){case"images":return"Images";case"video":return"Videos";case"audio":return"Sounds";case"spreadsheets":return"Spreadsheets";case"documents":case"presentations":case"code":return"Documents";default:return"Other"}};function wc(e,t,s,i){const a=e.filter(c=>c.highlighted),o=e.filter(c=>!c.highlighted),r=[];if(a.length&&r.push({id:"Highlights",label:"Highlights",items:a,open:s||!i.has("Highlights"),highlights:!0}),a.length&&o.length&&(r.push({id:"Working files",label:"Working files",items:[],open:t.workingOpen||s,highlights:!1}),!t.workingOpen&&!s))return r;if(!t.group)o.length&&r.push({id:"Files",label:"Files",items:o,open:!0,highlights:!1});else for(const c of["Images","Videos","Sounds","Documents","Spreadsheets","Other"]){const d=o.filter(l=>To(l)===c);d.length&&r.push({id:c,label:c,items:d,open:s||!i.has(c),highlights:!1})}return r}function Ic(e,t,s){const i=[],a=new Map,o=Math.max(136,t-16),r=Math.max(1,Math.floor((o+4)/140));let c=0;const d=(l,p,w,y,P=1)=>{y.forEach((ue,T)=>a.set(ue.row.document.id,{band:i.length,column:T})),i.push({section:l,kind:p,height:w,top:c,items:y,cols:P}),c+=w};for(const l of e)if(d(l,"header",32,[]),!!l.open)if(l.highlights)for(const p of l.items)d(l,"highlight",p.why?68:44,[p]);else if(s&&l.id==="Images"){const p=(o-4*(r-1))/r,w=Math.round((p-8)*3/4)+32;for(let y=0;y<l.items.length;y+=r)d(l,"tiles",w,l.items.slice(y,y+r),r)}else if(s&&l.id==="Videos")for(const p of l.items)d(l,"video",Math.min(Math.round((o-8)*9/16),280)+32,[p]);else if(s&&l.id==="Sounds")for(const p of l.items)d(l,"audio",80,[p]);else for(const p of l.items)d(l,"compact",36,[p]);return{bands:i,height:c,columns:r,positions:a}}function xc(e,t,s,i){const a=Math.max(600,s*.75);let o=0,r=e.bands.length;for(;o<r;){const l=o+r>>>1,p=e.bands[l];p.top+p.height<t-a?o=l+1:r=l}const c=new Set;for(let l=o;l<e.bands.length&&e.bands[l].top<=t+s+a;l++)c.add(l);const d=i?e.positions.get(i):null;return d&&c.add(d.band),[...c].sort((l,p)=>l-p)}function Tc(e,t,s,i){const a=e.positions.get(t);if(!a)return null;const o=e.bands[a.band],r=e.bands.filter(p=>p.section.id===o.section.id&&p.items.length);if(s==="Home")return r[0]?.items[0]?.row.document.id??null;if(s==="End")return r.at(-1)?.items.at(-1)?.row.document.id??null;if(s==="ArrowLeft"||s==="ArrowRight")return o.items[a.column+(s==="ArrowLeft"?-1:1)]?.row.document.id??null;const c=s==="ArrowUp"||s==="PageUp"?-1:1,d=o.top+(s.startsWith("Page")?i*c:c);let l=a.band+c;for(;l>=0&&l<e.bands.length;l+=c){const p=e.bands[l];if(p.items.length&&!(s.startsWith("Page")&&(c>0?p.top<d:p.top>d)))return p.items[Math.min(a.column,p.items.length-1)].row.document.id}if(s.startsWith("Page")){const p=e.bands.filter(y=>y.items.length),w=c<0?p[0]:p.at(-1);return w?.items[c<0?0:w.items.length-1]?.row.document.id??null}return null}const Eo="both",ss="by-turn",Et=[{value:"by-turn",label:"By turn"},{value:"by-response",label:"By response"}];function Ec(e){for(const t of Et)if(e===t.value)return t.value;return ss}function Rc(e){return Et.find(t=>t.value===e)?.label??Et[0].label}const Oc="primary+alt+shift+space",Ro=/^f([1-9]|1[0-9]|2[0-4])$/;function Oo(e){return Ro.test(e)}function Po(e,t){const s=Co(e,t);return t==="mac"?s.join(""):s.join("+")}function Co(e,t){const i=t==="mac"?{primary:"⌘",meta:"⌘",ctrl:"⌃",alt:"⌥",shift:"⇧"}:{primary:"Ctrl",meta:t==="win"?"Win":"Super",ctrl:"Ctrl",alt:"Alt",shift:"Shift"},a={space:"Space",backspace:"Backspace",delete:"Delete",insert:"Insert",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown",up:"Up",down:"Down",left:"Left",right:"Right"};return e.split("+").map(o=>o.trim().toLowerCase()).filter(o=>o.length>0).map(o=>o in i?i[o]:o in a?a[o]:Oo(o)||o.length===1?o.toUpperCase():o)}const st=[{id:"panel.console",label:"Open console",category:"Panels",defaultChord:"primary+j",scope:"app"},{id:"panel.canvas",label:"Open canvas",category:"Panels",defaultChord:"primary+shift+c",scope:"app"},{id:"panel.run",label:"Open run details",category:"Panels",defaultChord:null,scope:"app"},{id:"panel.ask",label:"Open asks",category:"Panels",defaultChord:null,scope:"app"},{id:"panel.browser",label:"Open browser",category:"Panels",defaultChord:null,scope:"app"},{id:"panel.code",label:"Open code review",category:"Panels",defaultChord:null,scope:"app"}],jo=new Map(st.map(e=>[e.id,e])),Ao=e=>jo.get(e),$o=new Set(["primary+0","primary+r","primary+shift+r","primary+t","primary+shift+t","primary+l",...[1,2,3,4,5,6,7,8,9].map(e=>`primary+${e}`)]),At=new Map([["primary+p","Reserved: opens the command palette from anywhere."],["primary+shift+p","Reserved: opens the command palette on commands."],["primary+shift+s","Reserved: starts speech to text."],["primary+k","Reserved: opens the command palette on chats."],["primary+n","Reserved: starts a new chat."],["primary+b","Reserved: toggles the sidebar."],["primary+[","Reserved: goes back in the browser, or between chats outside it."],["primary+]","Reserved: goes forward in the browser, or between chats outside it."],["primary+f","Reserved: finds in the browser page, or searches the transcript outside it."],["primary+alt+up","Reserved: walks up the chat regions."],["primary+alt+down","Reserved: walks down the chat regions."],["primary+shift+a","Reserved: archives the focused conversation."],["primary+s","Reserved: saves the canvas document."],["primary+o","Reserved: opens a file in the canvas."],["primary+shift+up","Reserved: moves the focused chat up the pinned order."],["primary+shift+down","Reserved: moves the focused chat down the pinned order."],["primary+c","Reserved: copy."],["primary+x","Reserved: cut."],["primary+v","Reserved: paste."],["primary+a","Reserved: select all."],["primary+z","Reserved: undo."],["primary+shift+z","Reserved: redo."],["primary+y","Reserved: redo on Windows and Linux."],["primary+r","Reserved: reloads the browser page."],["primary+shift+r","Reserved: reloads the browser page, ignoring the cache."],["primary+t","Reserved: opens a new browser tab."],["primary+shift+t","Reserved: reopens the last closed browser tab."],["primary+l","Reserved: focuses the browser address bar."],...[1,2,3,4,5,6,7,8,9].map(e=>[`primary+${e}`,e===9?"Reserved: switches to the last browser tab.":`Reserved: switches to browser tab ${e}.`]),["primary+0","Reserved: resets browser page zoom, or app zoom outside it."],["primary+plus","Reserved: zooms the browser page or app in."],["primary+=","Reserved: zooms the browser page or app in."],["primary+-","Reserved: zooms the browser page or app out."],["primary+q","Reserved: quits the app."],["primary+w","Reserved: closes the browser tab, or the window outside it."],["primary+m","Reserved: minimises the window."]]),Mo=["primary","alt","shift"],No={primary:"primary",meta:"primary",cmd:"primary",command:"primary",super:"primary",ctrl:"primary",control:"primary",alt:"alt",option:"alt",shift:"shift"},Do=new Set(["space","backspace","delete","insert","home","end","pageup","pagedown","up","down","left","right"]),Lo=e=>Do.has(e)||/^[a-z0-9]$/.test(e);function $t(e){if(typeof e!="string")return null;const t=e.toLowerCase().split("+").map(o=>o.trim()).filter(o=>o.length>0);if(t.length===0)return null;const s=t[t.length-1];if(!Lo(s))return null;const i=new Set;for(const o of t.slice(0,-1)){const r=No[o];if(r===void 0)return null;i.add(r)}return[...Mo.filter(o=>i.has(o)),s].join("+")}const is=e=>e.split("+").includes("primary");function it(e,t){const s=t?.[e];return s===null?null:typeof s=="string"&&!At.has(s)?s:Ao(e)?.defaultChord??null}function Pc(e){const t=new Map;for(const s of st){const i=it(s.id,e);i!==null&&!t.has(i)&&t.set(i,s.id)}return t}const Uo=e=>e==="mac"?"A shortcut needs ⌘ or Ctrl.":"A shortcut needs Ctrl.";function Zo(e,t,s,i="linux"){const a=e===null?null:$t(e);if(a===null)return"That key cannot be bound.";if(!is(a))return Uo(i);const o=At.get(a);if(o!==void 0)return o;for(const r of st)if(r.id!==t&&it(r.id,s)===a)return`Already assigned to ${r.label}.`;return null}function Bo(e){if(e===null||typeof e!="object"||Array.isArray(e))return{};const t=e,s=new Set,i={};for(const a of st){const o=t[a.id];if(o===null){i[a.id]=null;continue}const r=typeof o=="string"?$t(o):null,c=r!==null&&$o.has(r),d=r!==null&&is(r)&&(c||!At.has(r)&&!s.has(r))?r:null;d!==null&&(i[a.id]=d);const l=it(a.id,i);l!==null&&s.add(l)}return i}function Cc(e,t,s){const i=it(e,t);return i===null?null:as(i,s)}function as(e,t){return Po(e,t)}function jc(e,t){const s=e.split("+"),i=s[s.length-1],a=s.slice(0,-1).map(o=>o==="primary"?t==="mac"?"Meta":"Control":o==="shift"?"Shift":o==="alt"?"Alt":o);return{glyph:as(e,t),aria:[...a,i.length===1?i.toUpperCase():i].join("+")}}const wn=64,Rt=["canvas","run","browser","console","code"],Go={canvas:"isCanvasOpen",run:"isRunPanelOpen",browser:"isBrowserPaneOpen",console:"isConsolePaneOpen",code:"isCodeReviewPaneOpen"};function os(e){return typeof e=="string"&&Rt.includes(e)}function Mt(e){return e.startsWith("draft:")}function Ne(e,t){for(let s=e.length-1;s>=0;s-=1){const i=e[s];if(i[0]===t)return i[1]}}function Nt(e){return e.length>wn?e.slice(e.length-wn):e}function rs(e,t,s){return Nt([...e.filter(([i])=>i!==t),[t,s]])}function zo(e,t,s){return Ne(e,t)!==s?e:e.filter(([i])=>i!==t)}function Fo(e,t){return Ne(e,t)===void 0?e:e.filter(([s])=>s!==t)}function Ho(e,t,s){const i=Ne(e,t);return i===void 0?e:Nt([...e.filter(([a])=>a!==t&&a!==s),[s,i]])}const In=Object.freeze({isCanvasOpen:!1,isRunPanelOpen:!1,isBrowserPaneOpen:!1,isConsolePaneOpen:!1,isCodeReviewPaneOpen:!1});function xn(e,t,s){if(s||typeof t!="string")return In;const i=Ne(e,t);return i===void 0?In:{isCanvasOpen:i==="canvas",isRunPanelOpen:i==="run",isBrowserPaneOpen:i==="browser",isConsolePaneOpen:i==="console",isCodeReviewPaneOpen:i==="code"}}function Vo(e){if(!Array.isArray(e))return[];const t=new Map;for(const s of e){if(!Array.isArray(s)||s.length!==2)continue;const[i,a]=s;typeof i!="string"||i===""||Mt(i)||os(a)&&(t.delete(i),t.set(i,a))}return Nt([...t.entries()])}function Ac(e){const t=new Set(Object.keys(e.forgotten));for(const[s,i]of Object.entries(e.archiveFacts))i?.archived===!0&&i.answered===!0&&t.add(s);return t}function Tn(e){return Go[e]}const Wo={canvas:"isCanvasOpen",run:"isRunPanelOpen",browser:"isBrowserPaneOpen",console:"isConsolePaneOpen",code:"isCodeReviewPaneOpen"},De=e=>e.isCanvasOpen?"canvas":e.isRunPanelOpen?"run":e.isBrowserPaneOpen?"browser":e.isConsolePaneOpen?"console":e.isCodeReviewPaneOpen?"code":e.isAskDrawerOpen?"ask":null,at=(e,t)=>e==="ask"?t.askDrawerScope==="fleet"||t.rightSlotRoute.mounted&&t.rightSlotRoute.session:t.rightSlotRoute.mounted,Ko=e=>{const t=De(e);return t===null||t==="ask"?null:Wo[t]},H=e=>({isRunPanelOpen:e==="isRunPanelOpen",isCanvasOpen:e==="isCanvasOpen",isBrowserPaneOpen:e==="isBrowserPaneOpen",isConsolePaneOpen:e==="isConsolePaneOpen",isCodeReviewPaneOpen:e==="isCodeReviewPaneOpen",isAskDrawerOpen:e==="isAskDrawerOpen",askDrawerEvictedPane:null}),X=(e,t)=>{const s=e.rightSlotKey;return typeof s!="string"?{}:{rightSlotMemory:rs(e.rightSlotMemory,s,t)}},fe=(e,t)=>{const s=e.rightSlotKey;if(typeof s!="string")return{};const i=zo(e.rightSlotMemory,s,t);return i===e.rightSlotMemory?{}:{rightSlotMemory:i}},Yo=e=>{const t=e.rightSlotKey;if(typeof t!="string")return{};const s=Fo(e.rightSlotMemory,t);return s===e.rightSlotMemory?{}:{rightSlotMemory:s}},Xo=Object.freeze({mounted:!1,session:!1}),cs=Object.freeze([]);function $c(e,t){const s=De(t);if(s===null||!at(s,t))return 0;let i;switch(s){case"canvas":case"ask":i=Math.max(Qn,t.rightSlotWidth||ge);break;case"run":i=Math.max(Rn,t.rightSlotWidth||ge);break;case"browser":i=Math.max(er,t.rightSlotWidth||ge);break;case"console":i=Math.max(tr,t.rightSlotWidth||ge);break;case"code":i=Math.max(Rn,t.rightSlotWidth||ge);break}return e<=0?i:s==="canvas"||s==="ask"?Math.min(i,qn(e)):Math.min(i,Math.max(0,e-Xn))}function Mc(e){const t=De(e);return t!==null&&at(t,e)}function Nc(e){const t=De(e);return t!==null&&at(t,e)?t:null}function Dc(e){const t=De(e);return(t==="canvas"||t==="ask")&&at(t,e)}const ge=640,En=Me,Jo=20,Qo=4,qo=20,Rn=320,er=480,tr=480,nr=5e3,Lc=(e,t)=>e.some(s=>s.surface===t),Uc=(e,t=Date.now())=>e.some(s=>t-s.at<nr),sr=[],ir=4,ar=["chatMeasureWidth"],Zc=Hn()(Wn((e,t)=>({finderFiles:ns,setFinderFiles:s=>e({finderFiles:jt({...t().finderFiles,...s})}),isCommandPaletteOpen:!1,commandPaletteQuery:"",isSidebarCollapsed:!1,sidebarOverflowExpanded:!1,showAgentReasoning:!1,transcriptDisplayMode:ss,themeName:ds,rightSlotWidth:0,chatSidebarWidth:En,chatSidebarRegions:Eo,chatSidebarView:_e,chatSidebarListHeight:null,chatSidebarOrder:"entities-first",dismissedBuiltinOfferSignature:"",isCanvasOpen:!1,isRunPanelOpen:!1,isBrowserPaneOpen:!1,isConsolePaneOpen:!1,isCodeReviewPaneOpen:!1,rightSlotKey:void 0,rightSlotMemory:cs,rightSlotLegacySeed:null,isAskDrawerOpen:!1,askDrawerScope:"session",askDrawerEvictedPane:null,askOpenIntent:null,rightSlotRoute:Xo,consoleOpenIntent:null,runPanelReveal:null,codeReviewReveal:null,browserPaneScope:"conversation",consoleActiveSurface:null,consoleUnseen:sr,isCreateAgentDialogOpen:!1,mentionRecents:null,profileRecents:{agent:[],team:[]},conversationRecents:[],shortcutBindings:{},openCreateAgentDialog:()=>{e({isCreateAgentDialogOpen:!0})},closeCreateAgentDialog:()=>{e({isCreateAgentDialogOpen:!1})},openCommandPalette:()=>{e({isCommandPaletteOpen:!0})},closeCommandPalette:()=>{e({isCommandPaletteOpen:!1,commandPaletteQuery:""})},toggleCommandPalette:(s="")=>{e(i=>({isCommandPaletteOpen:!i.isCommandPaletteOpen,commandPaletteQuery:i.isCommandPaletteOpen?i.commandPaletteQuery:s}))},setCommandPaletteQuery:s=>{e({commandPaletteQuery:s})},toggleSidebar:()=>{e(s=>({isSidebarCollapsed:!s.isSidebarCollapsed}))},setSidebarOverflowExpanded:s=>{e({sidebarOverflowExpanded:s})},setSidebarCollapsed:s=>{e({isSidebarCollapsed:s})},setShowAgentReasoning:s=>{e({showAgentReasoning:s})},setTranscriptDisplayMode:s=>{e({transcriptDisplayMode:s})},setTheme:s=>{e({themeName:s})},setCanvasOpen:s=>{e(i=>s?{...H("isCanvasOpen"),...X(i,"canvas")}:{isCanvasOpen:!1,...fe(i,"canvas")})},setRunPanelOpen:s=>{e(i=>s?{...H("isRunPanelOpen"),...X(i,"run")}:{isRunPanelOpen:!1,...fe(i,"run")})},setBrowserPaneOpen:s=>{e(i=>s?{...H("isBrowserPaneOpen"),...X(i,"browser")}:{isBrowserPaneOpen:!1,...fe(i,"browser")})},setConsolePaneOpen:s=>{e(i=>s?{...H("isConsolePaneOpen"),...X(i,"console")}:{isConsolePaneOpen:!1,...fe(i,"console")})},setCodeReviewPaneOpen:s=>{e(i=>s?{...H("isCodeReviewPaneOpen"),...X(i,"code")}:{isCodeReviewPaneOpen:!1,...fe(i,"code")})},clearCodeReviewReveal:s=>{e(i=>i.codeReviewReveal?.nonce===s?{codeReviewReveal:null}:{})},revealCodeReviewPane:()=>{e(s=>({...H("isCodeReviewPaneOpen"),...X(s,"code"),codeReviewReveal:{nonce:(s.codeReviewReveal?.nonce??0)+1}}))},setAskDrawerOpen:(s,i,a)=>{e(o=>{const r=typeof o.rightSlotKey=="string";if(s)return{...H("isAskDrawerOpen"),askDrawerScope:i,askDrawerEvictedPane:r?null:Ko(o),askOpenIntent:null};const c={isAskDrawerOpen:!1,askDrawerEvictedPane:null,askOpenIntent:null};return r?a?.dismissSlot?{...c,...Yo(o)}:{...c,...xn(o.rightSlotMemory,o.rightSlotKey,!1)}:o.rightSlotKey===null?a?.dismissSlot?{...c,rightSlotLegacySeed:null}:c:a?.dismissSlot?{...c,rightSlotLegacySeed:null}:{...c,...o.askDrawerEvictedPane===null?null:{[o.askDrawerEvictedPane]:!0}}})},requestAskOpen:(s,i="menu")=>{e({askOpenIntent:{scope:s,via:i}})},clearAskOpenIntent:s=>{e(i=>i.askOpenIntent?.scope===s?{askOpenIntent:null}:{})},setConsoleActiveSurface:s=>{e({consoleActiveSurface:s})},requestConsoleOpen:s=>{e({consoleOpenIntent:s})},clearConsoleOpenIntent:s=>{e(i=>i.consoleOpenIntent===s?{consoleOpenIntent:null}:{})},markConsoleUnseen:(s,i)=>{e(a=>a.consoleUnseen.some(o=>o.surface===i)?{}:{consoleUnseen:[...a.consoleUnseen,{sessionId:s,surface:i,at:Date.now()}]})},clearConsoleUnseen:s=>{const i=Array.isArray(s)?s:[s];e(a=>{const o=a.consoleUnseen.filter(r=>!i.includes(r.surface));return o.length===a.consoleUnseen.length?{}:{consoleUnseen:o}})},setRightSlotWidth:s=>{e({rightSlotWidth:s})},restoreDefaultRightSlotWidth:()=>{e({rightSlotWidth:0})},bindRightSlotKey:(s,i)=>{e(a=>{let o=a.rightSlotMemory,r=a.rightSlotLegacySeed;const c=i?.admittedFrom;return typeof c=="string"&&typeof s=="string"&&(o=Ho(o,c,s)),s===null||(Mt(s)?r=null:r!==null&&Ne(o,s)===void 0&&(o=rs(o,s,r),r=null)),{rightSlotKey:s,rightSlotMemory:o,rightSlotLegacySeed:r,...xn(o,s,a.isAskDrawerOpen)}})},setRightSlotRoute:s=>{const i=t().rightSlotRoute;i.mounted===s.mounted&&i.session===s.session||e({rightSlotRoute:{...s}})},setShortcutBinding:(s,i)=>{if(i===null){e(o=>{const r={...o.shortcutBindings};return delete r[s],{shortcutBindings:r}});return}const a=$t(i);a!==null&&Zo(a,s,t().shortcutBindings)===null&&e(o=>({shortcutBindings:{...o.shortcutBindings,[s]:a}}))},clearShortcutBinding:s=>{e(i=>({shortcutBindings:{...i.shortcutBindings,[s]:null}}))},setBrowserPaneScope:s=>{e({browserPaneScope:s})},revealRunPanelSection:s=>{e(i=>({...H("isRunPanelOpen"),...X(i,"run"),runPanelReveal:{section:s,nonce:(i.runPanelReveal?.nonce??0)+1}}))},clearRunPanelReveal:s=>{e(i=>i.runPanelReveal?.nonce===s?{runPanelReveal:null}:{})},setChatSidebarWidth:s=>{e({chatSidebarWidth:Math.min(Yn,Math.max(Kn,s))})},setChatSidebarRegions:s=>{e({chatSidebarRegions:s})},setChatSidebarListHeight:s=>{e({chatSidebarListHeight:s})},restoreDefaultChatSidebarListHeight:()=>{e({chatSidebarListHeight:null})},setChatSidebarOrder:s=>{e({chatSidebarOrder:s})},setChatSidebarView:s=>{e({chatSidebarView:s})},dismissBuiltinOffer:s=>{e({dismissedBuiltinOfferSignature:s})},restoreDefaultChatSidebarWidth:()=>{e({chatSidebarWidth:En})},rememberMention:(s,i)=>{e(a=>{const o=a.mentionRecents,r=o?.cwd===s?o.paths:[],c=[i,...r.filter(d=>d!==i)].slice(0,Jo);return{mentionRecents:{cwd:s,paths:c}}})},rememberProfile:(s,i)=>{e(a=>({profileRecents:{...a.profileRecents,[s]:or(a.profileRecents[s]??[],i)}}))},rememberConversation:s=>{e(i=>{const a=lr(i.conversationRecents),o=rr(a,s);return o.length===a.length&&o.every((r,c)=>r===a[c])?i:{conversationRecents:o}})}}),{name:"ui-preferences-storage",version:ir,migrate:mr,partialize:dr,merge:pr}));function or(e,t){return[t,...e.filter(s=>s!==t)].slice(0,Qo)}function rr(e,t){return[t,...e.filter(s=>s!==t)].slice(0,qo)}const cr=[];function lr(e){return Array.isArray(e)?e:cr}function dr(e){const{runPanelReveal:t,codeReviewReveal:s,consoleOpenIntent:i,askOpenIntent:a,isAskDrawerOpen:o,askDrawerScope:r,askDrawerEvictedPane:c,rightSlotRoute:d,isCanvasOpen:l,isRunPanelOpen:p,isBrowserPaneOpen:w,isConsolePaneOpen:y,isCodeReviewPaneOpen:P,rightSlotKey:ue,...T}=e;return{...T,rightSlotMemory:ur(e.rightSlotMemory)}}function ur(e){return(e??cs).filter(([t])=>!Mt(t))}function pr(e,t){const s=e??{},{isCanvasOpen:i,isRunPanelOpen:a,isBrowserPaneOpen:o,isConsolePaneOpen:r,isCodeReviewPaneOpen:c,...d}=s;return{...t,...d,finderFiles:jt(s.finderFiles),rightSlotKey:t.rightSlotKey,rightSlotMemory:Vo(s.rightSlotMemory),rightSlotLegacySeed:os(s.rightSlotLegacySeed)?s.rightSlotLegacySeed:null,shortcutBindings:Bo(s.shortcutBindings)}}function mr(e,t){const s={...e??{}};if(t<1&&hr(s),t<2)for(const i of ar)delete s[i];if(t<3){let i=null;for(const a of Rt)if(s[Tn(a)]===!0){i=a;break}i!==null&&(s.rightSlotLegacySeed=i);for(const a of Rt)delete s[Tn(a)]}return t<4&&(s.finderFiles=jt(s.finderFiles)),s}function hr(e){const t=[["canvasWidth",800],["runPanelWidth",420],["browserPanelWidth",640],["consolePanelWidth",796]];let s=0;for(const[i,a]of t){const o=e[i];if(typeof o=="number"&&o>0&&o!==a){s=o;break}}for(const[i]of t)delete e[i];e.rightSlotWidth=s}export{uc as $,Cc as A,J as B,Ua as C,Oc as D,Tr as E,Rr as F,jc as G,Uc as H,nr as I,Lc as J,st as K,Wr as L,Fr as M,Oi as N,Pi as O,cn as P,Pt as Q,Er as R,Ft as S,Et as T,yo as U,Sn as V,tc as W,vc as X,_c as Y,yc as Z,kc as _,Ki as a,kt as a$,pc as a0,re as a1,_e as a2,qr as a3,ts as a4,ic as a5,gc as a6,Ae as a7,fc as a8,bc as a9,Qn as aA,qn as aB,Rn as aC,ge as aD,er as aE,tr as aF,kn as aG,Xn as aH,lr as aI,Mr as aJ,Nr as aK,Pc as aL,Jr as aM,es as aN,Po as aO,Mt as aP,Ac as aQ,Ar as aR,Cr as aS,Ur as aT,Lr as aU,jr as aV,$r as aW,zr as aX,Vr as aY,Dr as aZ,Zr as a_,lc as aa,dc as ab,oc as ac,ac as ad,rc as ae,lo as af,cc as ag,nc as ah,mc as ai,hc as aj,ro as ak,nt as al,ec as am,Qr as an,sc as ao,Sc as ap,wc as aq,Ic as ar,xc as as,Tc as at,Sr as au,Rc as av,Mc as aw,Xo as ax,$c as ay,Kr as az,Yi as b,kr as b0,n as b1,A as b2,Vn as b3,Dc as b4,Yr as b5,Xr as b6,Ya as b7,xt as b8,Jn as b9,Yn as ba,Kn as bb,Br as bc,Kt as bd,Gr as be,$i as bf,Or as bg,Pr as bh,ss as bi,Hr as bj,Ci as bk,ji as bl,Ai as bm,Xt as bn,$t as bo,Oo as bp,Ui as bq,Ri as br,Yt as bs,Xi as c,Ji as d,Hn as e,Co as f,Wn as g,ca as h,Qi as i,la as j,hn as k,xr as l,Ir as m,yr as n,it as o,wr as p,as as q,Zo as r,Ec as s,vr as t,Zc as u,br as v,gr as w,_r as x,Ti as y,Nc as z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as d,u as O,
|
|
1
|
+
import{c as d,u as O,B as F}from"./error-boundary-h4sP8tdS.js";import{t as N,c as U,n as Q,b as z,g as B,e as V,h as S,i as C,j as D,a as v}from"./en-US-CHJkXXr4.js";import{j as i,c as p,t as c,r as P}from"./index-jSdScOuX.js";import{bN as $,bD as T,bO as Y,B as w,C as Z,u as M,aK as A,aN as G,aL as I,bI as W,ar as J,ai as q,bJ as X}from"./conversation-input-sync-BaU2f8nc.js";import{aN as ee,aO as te,aP as E}from"./index-DnJx-GT2.js";import{B as ae}from"./book-open-BSyul6vT.js";import{k as ne,m as se,n as oe,o as re,q as ie}from"./use-memberships-query-DlpZRSwv.js";import{b as ce,l as ue}from"./publication-validation-Cz7fxfa-.js";/**
|
|
2
2
|
* @license lucide-react v0.507.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
package/out/renderer/assets/{use-memberships-query-TOFQHH-q.js → use-memberships-query-DlpZRSwv.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as s,B as d,C as m,D as y}from"./conversation-input-sync-
|
|
1
|
+
import{A as s,B as d,C as m,D as y}from"./conversation-input-sync-BaU2f8nc.js";function a(){return crypto.randomUUID()}async function q(e=1,t=20,n){const r={page:e,per_page:t};if(n)for(const[o,u]of Object.entries(n))u&&(r[o]=u);return s({operation:"agents.list",query:r})}async function w(e){return s({operation:"agents.get",agentId:e})}async function T(e){return s({operation:"agents.delete",agentId:e,requestId:a(),confirmed:!0})}async function I(e){return s({operation:"agents.like",agentId:e,requestId:a()})}async function $(e){return s({operation:"agents.unlike",agentId:e,requestId:a(),confirmed:!0})}async function k(e){return s({operation:"agents.favourite",agentId:e,requestId:a()})}async function v(e){return s({operation:"agents.unfavourite",agentId:e,requestId:a(),confirmed:!0})}async function _(e,t){return s({operation:"comments.create",agentId:e,payload:t,requestId:a()})}async function j(e,t=1,n=20){return s({operation:"comments.list",agentId:e,query:{page:t,per_page:n}})}async function C(e,t,n){return s({operation:"comments.update",agentId:e,commentId:t,payload:n,requestId:a()})}async function P(e,t){return s({operation:"comments.delete",agentId:e,commentId:t,requestId:a(),confirmed:!0})}async function E(e){return s({operation:"agents.statuses",query:{agent_ids:e.join(",")}})}async function f(){return s({operation:"memberships.list"})}async function O(e,t=1,n=20,r){const o={page:t,per_page:n};if(r)for(const[u,c]of Object.entries(r))c&&(o[u]=c);return s({operation:"org_agents.list",tenantId:e,query:o})}async function H(e){return s({operation:"org_teams.list",tenantId:e})}class i extends Error{status;reason;constructor(t,n,r){super(t),this.name="PublicHubError",this.status=n,this.reason=r}}const b=/\/+$/,h=(e,t,n)=>{const r=e.replace(b,"");return n?`${r}/v1/${t}/${encodeURIComponent(n)}`:`${r}/v1/${t}`},p=(e,t)=>h(e,"teams",t),l=async e=>{let t;try{t=await fetch(e,{method:"GET",headers:{Accept:"application/json"},redirect:"error"})}catch(r){throw console.error("The public hub could not be reached:",r),new i("The public hub could not be reached.",null,r)}if(!t.ok)throw new i(`The public hub answered ${t.status}.`,t.status);let n;try{n=await t.json()}catch{throw new i("The public hub answered with a body that is not JSON.",t.status)}if(!n||typeof n!="object"||!("result"in n))throw new i("The public hub answered with a body this app cannot read.",t.status);return n};async function S(e,t=1,n=12){const r=`${p(e)}?page=${t}&per_page=${n}`;return l(r)}async function U(e,t){return l(p(e,t))}const g={all:["memberships"]},x=({enabled:e=!0}={})=>{const{isAuthenticated:t}=d(),n=m({queryKey:g.all,queryFn:async()=>(await f()).result??{memberships:[]},enabled:e&&t,staleTime:5*60*1e3,gcTime:10*60*1e3,refetchOnWindowFocus:!1,retry:y});return{...n,memberships:n.data?.memberships??[]}};export{i as P,q as a,j as b,_ as c,P as d,T as e,x as f,w as g,S as h,U as i,H as j,E as k,O as l,v as m,k as n,$ as o,h as p,I as q,l as r,C as u};
|
package/out/renderer/assets/{use-session-snapshot-BOMni_bJ.js → use-session-snapshot-CJ2UW6J0.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as c}from"./conversation-input-sync-
|
|
1
|
+
import{d as c}from"./conversation-input-sync-BaU2f8nc.js";import{r as n}from"./index-jSdScOuX.js";function s(){const[f,a]=n.useState(null),[l,o]=n.useState(null),r=n.useRef(null),u=n.useCallback(async e=>{r.current=e,a(t=>t&&t.id!==e?null:t),o(t=>t&&t.id!==e?null:t);try{const t=await c({op:"sessions.get",sessionId:e});if(r.current!==e)return;a({id:e,frontend:t.payload.frontend.snapshot})}catch{}try{const t=await c({op:"commands.entities",sessionId:e,command:"effort"});if(r.current!==e)return;o({id:e,entities:t.entities})}catch{}},[]);return{frontend:f?.frontend??null,effortEntities:l?.entities,refresh:u}}export{s as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as n,s as ii,g as ei,t as vt,q as si,a as ni,b as ai,l as Lt,K as oi,e as hi,z as ri,G as lt,F as Et,H as li,M as ci,i as ui,N as gi}from"./mermaid.core-
|
|
1
|
+
import{_ as n,s as ii,g as ei,t as vt,q as si,a as ni,b as ai,l as Lt,K as oi,e as hi,z as ri,G as lt,F as Et,H as li,M as ci,i as ui,N as gi}from"./mermaid.core-BtMOwfxh.js";import{x as kt,v as Tt,y as Rt}from"./conversation-input-sync-BaU2f8nc.js";import"./index-jSdScOuX.js";import"./ui-preferences-store-SQZFW3cf.js";import"./error-boundary-h4sP8tdS.js";var at=function(){var t=n(function(B,h,l,c){for(l=l||{},c=B.length;c--;l[B[c]]=h);return l},"o"),i=[1,10,12,14,16,18,19,21,23],e=[2,6],s=[1,3],o=[1,5],p=[1,6],g=[1,7],y=[1,5,10,12,14,16,18,19,21,23,34,35,36],T=[1,25],E=[1,26],S=[1,28],R=[1,29],I=[1,30],V=[1,31],_=[1,32],L=[1,33],f=[1,34],C=[1,35],r=[1,36],D=[1,37],N=[1,43],mt=[1,42],bt=[1,47],$=[1,50],b=[1,10,12,14,16,18,19,21,23,34,35,36],J=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],P=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],At=[1,64],tt={trace:n(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:n(function(h,l,c,u,m,a,X){var x=a.length-1;switch(m){case 5:u.setOrientation(a[x]);break;case 9:u.setDiagramTitle(a[x].text.trim());break;case 12:u.setLineData({text:"",type:"text"},a[x]);break;case 13:u.setLineData(a[x-1],a[x]);break;case 14:u.setBarData({text:"",type:"text"},a[x]);break;case 15:u.setBarData(a[x-1],a[x]);break;case 16:this.$=a[x].trim(),u.setAccTitle(this.$);break;case 17:case 18:this.$=a[x].trim(),u.setAccDescription(this.$);break;case 19:this.$=a[x-1];break;case 20:this.$=[Number(a[x-2]),...a[x]];break;case 21:this.$=[Number(a[x])];break;case 22:u.setXAxisTitle(a[x]);break;case 23:u.setXAxisTitle(a[x-1]);break;case 24:u.setXAxisTitle({type:"text",text:""});break;case 25:u.setXAxisBand(a[x]);break;case 26:u.setXAxisRangeData(Number(a[x-2]),Number(a[x]));break;case 27:this.$=a[x-1];break;case 28:this.$=[a[x-2],...a[x]];break;case 29:this.$=[a[x]];break;case 30:u.setYAxisTitle(a[x]);break;case 31:u.setYAxisTitle(a[x-1]);break;case 32:u.setYAxisTitle({type:"text",text:""});break;case 33:u.setYAxisRangeData(Number(a[x-2]),Number(a[x]));break;case 37:this.$={text:a[x],type:"text"};break;case 38:this.$={text:a[x],type:"text"};break;case 39:this.$={text:a[x],type:"markdown"};break;case 40:this.$=a[x];break;case 41:this.$=a[x-1]+""+a[x];break}},"anonymous"),table:[t(i,e,{3:1,4:2,7:4,5:s,34:o,35:p,36:g}),{1:[3]},t(i,e,{4:2,7:4,3:8,5:s,34:o,35:p,36:g}),t(i,e,{4:2,7:4,6:9,3:10,5:s,8:[1,11],34:o,35:p,36:g}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(y,[2,34]),t(y,[2,35]),t(y,[2,36]),{1:[2,1]},t(i,e,{4:2,7:4,3:21,5:s,34:o,35:p,36:g}),{1:[2,3]},t(y,[2,5]),t(i,[2,7],{4:22,34:o,35:p,36:g}),{11:23,37:24,38:T,39:E,40:27,41:S,42:R,43:I,44:V,45:_,46:L,47:f,48:C,49:r,50:D},{11:39,13:38,24:N,27:mt,29:40,30:41,37:24,38:T,39:E,40:27,41:S,42:R,43:I,44:V,45:_,46:L,47:f,48:C,49:r,50:D},{11:45,15:44,27:bt,33:46,37:24,38:T,39:E,40:27,41:S,42:R,43:I,44:V,45:_,46:L,47:f,48:C,49:r,50:D},{11:49,17:48,24:$,37:24,38:T,39:E,40:27,41:S,42:R,43:I,44:V,45:_,46:L,47:f,48:C,49:r,50:D},{11:52,17:51,24:$,37:24,38:T,39:E,40:27,41:S,42:R,43:I,44:V,45:_,46:L,47:f,48:C,49:r,50:D},{20:[1,53]},{22:[1,54]},t(b,[2,18]),{1:[2,2]},t(b,[2,8]),t(b,[2,9]),t(J,[2,37],{40:55,41:S,42:R,43:I,44:V,45:_,46:L,47:f,48:C,49:r,50:D}),t(J,[2,38]),t(J,[2,39]),t(P,[2,40]),t(P,[2,42]),t(P,[2,43]),t(P,[2,44]),t(P,[2,45]),t(P,[2,46]),t(P,[2,47]),t(P,[2,48]),t(P,[2,49]),t(P,[2,50]),t(P,[2,51]),t(b,[2,10]),t(b,[2,22],{30:41,29:56,24:N,27:mt}),t(b,[2,24]),t(b,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:T,39:E,40:27,41:S,42:R,43:I,44:V,45:_,46:L,47:f,48:C,49:r,50:D},t(b,[2,11]),t(b,[2,30],{33:60,27:bt}),t(b,[2,32]),{31:[1,61]},t(b,[2,12]),{17:62,24:$},{25:63,27:At},t(b,[2,14]),{17:65,24:$},t(b,[2,16]),t(b,[2,17]),t(P,[2,41]),t(b,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},t(b,[2,31]),{27:[1,69]},t(b,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},t(b,[2,15]),t(b,[2,26]),t(b,[2,27]),{11:59,32:72,37:24,38:T,39:E,40:27,41:S,42:R,43:I,44:V,45:_,46:L,47:f,48:C,49:r,50:D},t(b,[2,33]),t(b,[2,19]),{25:73,27:At},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:n(function(h,l){if(l.recoverable)this.trace(h);else{var c=new Error(h);throw c.hash=l,c}},"parseError"),parse:n(function(h){var l=this,c=[0],u=[],m=[null],a=[],X=this.table,x="",G=0,Ct=0,Kt=2,wt=1,Zt=a.slice.call(arguments,1),A=Object.create(this.lexer),W={yy:{}};for(var it in this.yy)Object.prototype.hasOwnProperty.call(this.yy,it)&&(W.yy[it]=this.yy[it]);A.setInput(h,W.yy),W.yy.lexer=A,W.yy.parser=this,typeof A.yylloc>"u"&&(A.yylloc={});var et=A.yylloc;a.push(et);var Jt=A.options&&A.options.ranges;typeof W.yy.parseError=="function"?this.parseError=W.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ti(k){c.length=c.length-2*k,m.length=m.length-k,a.length=a.length-k}n(ti,"popStack");function St(){var k;return k=u.pop()||A.lex()||wt,typeof k!="number"&&(k instanceof Array&&(u=k,k=u.pop()),k=l.symbols_[k]||k),k}n(St,"lex");for(var w,O,v,st,z={},j,M,_t,Q;;){if(O=c[c.length-1],this.defaultActions[O]?v=this.defaultActions[O]:((w===null||typeof w>"u")&&(w=St()),v=X[O]&&X[O][w]),typeof v>"u"||!v.length||!v[0]){var nt="";Q=[];for(j in X[O])this.terminals_[j]&&j>Kt&&Q.push("'"+this.terminals_[j]+"'");A.showPosition?nt="Parse error on line "+(G+1)+`:
|
|
2
2
|
`+A.showPosition()+`
|
|
3
3
|
Expecting `+Q.join(", ")+", got '"+(this.terminals_[w]||w)+"'":nt="Parse error on line "+(G+1)+": Unexpected "+(w==wt?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(nt,{text:A.match,token:this.terminals_[w]||w,line:A.yylineno,loc:et,expected:Q})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+O+", token: "+w);switch(v[0]){case 1:c.push(w),m.push(A.yytext),a.push(A.yylloc),c.push(v[1]),w=null,Ct=A.yyleng,x=A.yytext,G=A.yylineno,et=A.yylloc;break;case 2:if(M=this.productions_[v[1]][1],z.$=m[m.length-M],z._$={first_line:a[a.length-(M||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(M||1)].first_column,last_column:a[a.length-1].last_column},Jt&&(z._$.range=[a[a.length-(M||1)].range[0],a[a.length-1].range[1]]),st=this.performAction.apply(z,[x,Ct,G,W.yy,v[1],m,a].concat(Zt)),typeof st<"u")return st;M&&(c=c.slice(0,-1*M*2),m=m.slice(0,-1*M),a=a.slice(0,-1*M)),c.push(this.productions_[v[1]][0]),m.push(z.$),a.push(z._$),_t=X[c[c.length-2]][c[c.length-1]],c.push(_t);break;case 3:return!0}}return!0},"parse")},Qt=function(){var B={EOF:1,parseError:n(function(l,c){if(this.yy.parser)this.yy.parser.parseError(l,c);else throw new Error(l)},"parseError"),setInput:n(function(h,l){return this.yy=l||this.yy||{},this._input=h,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:n(function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var l=h.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),h},"input"),unput:n(function(h){var l=h.length,c=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var m=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===u.length?this.yylloc.first_column:0)+u[u.length-c.length].length-c[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[m[0],m[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:n(function(){return this._more=!0,this},"more"),reject:n(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:n(function(h){this.unput(this.match.slice(h))},"less"),pastInput:n(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:n(function(){var h=this.match;return h.length<20&&(h+=this._input.substr(0,20-h.length)),(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:n(function(){var h=this.pastInput(),l=new Array(h.length+1).join("-");return h+this.upcomingInput()+`
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
<title>Local Operator Console Capture</title>
|
|
7
7
|
<meta http-equiv="Content-Security-Policy"
|
|
8
8
|
content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self' data:" />
|
|
9
|
-
<script type="module" crossorigin src="./assets/consoleCapture-
|
|
10
|
-
<link rel="modulepreload" crossorigin href="./assets/index-
|
|
11
|
-
<link rel="modulepreload" crossorigin href="./assets/ui-preferences-store-
|
|
12
|
-
<link rel="modulepreload" crossorigin href="./assets/console-mirror-
|
|
13
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
9
|
+
<script type="module" crossorigin src="./assets/consoleCapture-F0nqNi_2.js"></script>
|
|
10
|
+
<link rel="modulepreload" crossorigin href="./assets/index-jSdScOuX.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="./assets/ui-preferences-store-SQZFW3cf.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="./assets/console-mirror-D0KKDQl3.js">
|
|
13
|
+
<link rel="stylesheet" crossorigin href="./assets/index-CU8sWhx0.css">
|
|
14
14
|
<link rel="stylesheet" crossorigin href="./assets/console-mirror-DOrYoP_4.css">
|
|
15
15
|
</head>
|
|
16
16
|
|